Community
Participate
Working Groups
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
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.
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
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.
This bug is fixed by Bug 472765