|
|
Re: Remote debugging [message #778288 is a reply to message #777454] |
Thu, 12 January 2012 02:43   |
Eclipse User |
|
|
|
Thank Marc,
I set path mapping and the error is still there. I was read in one forum that "No source file named x.c" means that your library hasn't been loaded yet at the time when the debugger is trying to set a breakpoint. I checked in gdb traces and I see that gdb is trying to set a breakpoint in my source file before the library file was loaded. It look something like this:
306,128 17-break-insert --thread-group i1 -f /xxx/xxx.c:441
306,129 &"No source file named /xxx/xxx.c.\n"
306,130 17^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/xxx/xxx.c:441",times="0",original-location="/xxx/xxx.c:441"}
306,485 =library-loaded,id="/tmp/xxx.so",target-name="/tmp/xxx.so",host-name="/xxx/xxx.so",symbols-loaded="0",thread-group="i1"
And what means "symbols-loaded="0"" I'm 100% sure that I'm using library with debug symbols.
|
|
|
Re: Remote debugging [message #866395 is a reply to message #778288] |
Mon, 30 April 2012 17:46  |
Eclipse User |
|
|
|
I got the same problem trying to debug a remote application using CDT (local side) + gdbserver (remote side).
When I tried to set a breakpoint at Eclipse, a "No source file named ..." message came up.
I used this steps to check what was going on at my gdb session and fix the problem:
1) run a debug session and open the gdb console inside Eclipse ('Console' tab -> 'Display Selected Console' button -> choose the one ending with 'gdb')
2) use command 'pwd' in the console to print gdb's current working dir
3) use command 'info line main' to get the source file where gdb expect to find of my "int main(...)" function
4) concatenate the result of step 2 with result of step 3 (which should be a relative path) to see if it matches the correct source file I want
5) use the 'cd' command in gdb (to change the current working dir) till I get the correct match in step 4
Knowing the initial working directory (2) and the correct working directory (5) for gdb , I had 2 options:
1) Use gdb's 'cd' command every time I launch a debug session (I could setup a .gdbinit file in the gdb initial working directory to do this automatically)
or
2) Setup the 'Source' tab, in 'Debug Configurations', to make Eclipse use paths that match with gdb's initial working dir ('Project - Path Relative to Source Folders' worked for me)
|
|
|
Powered by
FUDForum. Page generated in 0.05535 seconds