Bug 477057 - Source "Path Mapping" of relative paths do not work with breakpoints
Summary: Source "Path Mapping" of relative paths do not work with breakpoints
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 9.0.0   Edit
Assignee: Project Inbox CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on: 472765
Blocks:
  Show dependency tree
 
Reported: 2015-09-10 07:40 EDT by Jonah Graham CLA
Modified: 2016-04-12 06:00 EDT (History)
4 users (show)

See Also:


Attachments
Example Makefile project showing error on relocated sources (2.93 KB, application/zip)
2015-09-10 07:40 EDT, Jonah Graham CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonah Graham CLA 2015-09-10 07:40:21 EDT
Created attachment 256487 [details]
Example Makefile project showing error on relocated sources

When an elf file is compiled with relative paths (e.g. ../src/main.c) and the file is relocated, source lookups created with the 
CSourceNotFoundEditor cause breakpoints not to be insertable.

Please see the attached project for a test case.

Steps to reproduce:
- Build attached project
- Debug relative_oldsrc.elf
- When stopped at main, in the CSourceNotFoundEditor, locate the file
  - this creates a new mapping, and reloads the correct file in the editor)
  - GDB reports the file as fullname="/scratch/RelocatingProject/Debug/../oldsrc/main.c"
  - the file to browse to is /scratch/RelocatingProject/src/main.c
- Insert a breakpoint on main.c:5

In the GDB console you will have an error similar to:
No source file named /scratch/RelocatingProject/oldsrc/main.c.

In the GDB traces you have this:
790,985 33-break-insert -f /scratch/RelocatingProject/oldsrc/main.c:5
790,994 &"No source file named /scratch/RelocatingProject/oldsrc/main.c.\n"
790,995 33^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending=\
"/scratch/RelocatingProject/oldsrc/main.c:5",times="0",original-location="/sc\
ratch/RelocatingProject/oldsrc/main.c:5"}

Ran on:
- Eclipse Mars
- Ubuntu 14.04
- GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
- gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Comment 1 Jonah Graham CLA 2015-09-10 07:44:52 EDT
When discussing source mappings at recent CDT call (https://wiki.eclipse.org/CDT/MultiCoreDebugWorkingGroup/calls/minutes#August_11th.2C_2015) this issue was raised as the known case where Path Mappings do not work. I cannot find a bug specifically on point and I wanted to ensure this issue was accommodated for by any change to source lookup.
Comment 2 Marc-André Laperle CLA 2015-09-10 09:59:03 EDT
I reported the bug on the GDB side because I thought this is where it should be fixed
https://sourceware.org/bugzilla/show_bug.cgi?id=17497
Comment 3 Jonah Graham CLA 2015-12-24 10:59:18 EST
As part of work on Bug 472765 I proposed some new tests in https://git.eclipse.org/r/#/c/63266/ that are marked with this bug.
Comment 4 Jonah Graham CLA 2015-12-28 05:59:08 EST
This bug is fixed by Bug 472765