How to know the name and/or path of the debug symbol file which is linked to a binary executable?
Suppose you did like this:
objcopy --only-keep-debug foo foo.dbg
objcopy --strip-debug foo
objcopy --add-gnu-debuglink=foo.dbg foo
Now foo.dbg has debug symbols, foo only has the link to foo.dbg that gdb can use. Since gdb can know the symbol file from foo, how can we know same without actually running gdb?
I have observed that even if I rename the executable from foo to xyz still gdb loads symbols from foo.dbg so it is not like binaryname.extension, and extension is optional anyway.