How can I stop ggdb from unsetting DYLD_FALLBACK_LIBRARY_PATH?

158 views Asked by At

I'm setting DYLD_FALLBACK_LIBRARY_PATH in my bash ~/.profile and then call ggdb (installed with macports). But if in ggdb I issue:

(gdb) show environment DYLD_FALLBACK_LIBRARY_PATH

I see

Environment variable "DYLD_FALLBACK_LIBRARY_PATH" not defined.

Then, of course, upon trying to debug my binary I get dynamic linker errors:

dyld: Library not loaded: @loader_path/libXXXX.dylib
  Referenced from: /XXX/
  Reason: image not found

Suppose my ~/.profile looks like:

...
export FOO="BAR
export DYLD_FALLBACK_LIBRARY_PATH="/path/to/lib/"
...

Then

(gdb) show environment FOO

works, and I see

FOO = BAR

My ~/.gdbinit file is empty. Is there some other initialization that's wiping out this environment variable?

Note: This does not happen with the default gdb. There, DYLD_FALLBACK_LIBRARY_PATH is loaded correctly.

0

There are 0 answers