I am trying to debug a C/MPI library that I have built. All objects are compiled using GCC and -ggdb
, they are also linked using -ggdb
.
When I try to attach a gdb session to the process with the -p PID
flag from a standard shell, I have no problems. I can debug and access all source file info.
However, when I invoke a GDB session in Emacs 24.3.1, GDB reports that it cannot load my shared library:
warning: Could not load shared library symbols for ./libllg.so.
I noticed that Emacs called GDB with the flag -i=mi
is this causing the problem?
Everything is exactly the same, the symbol is found from a normal bash shell but not from the emacs GDB implementation. Any ideas?
LD_LIBRARY_PATH
? If so, Emacs may not be loading your configuration and you would need to do that yourself, for example via(setenv "LD_LIBRARY_PATH" ...)
.C-U M-x gdb
? That way you can pass your own flag, including the-p PID
. Also did you try withgud-gdb
?