When I run gdb with a debug binary(gdb binary name).. I dunno where is the source code for that debug binary is present... But I can set the breakpoint in main and debug the code with correct src code.. I dunno from where the gdb is taking the source code from ... The source code is not present in CWD.... how to find from which location the gdb is taking the code....?
where do the gdb stores this source code location? Is it in the executable itself?
suresh
2009-12-16 08:22:14
In executable itself that was built with debugging information.
skwllsp
2009-12-16 08:56:36
+1
A:
Use the gdb "show directories" command to see the source search path.
anon
2009-12-15 12:22:06
+1
A:
use
(gdb) show directories
if you don't know where those directories get set check into your .gdbinit if there are statements like
directory /path/to/source
see also this other SO Thread about gdb
fabrizioM
2009-12-15 12:23:53
+2
A:
This information is kept in binary in DWARF2 format. So, in order to see DWARF2 information, you can use dwarfdump utility. Needed information is kept in DW_AT_comp_dir field.
Marko Kevac
2009-12-15 14:45:45