GDB for D debugging on OS X seems to be broken

Jack Stouffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 16 10:34:07 PDT 2015


For reference:
     OSX 10.10.5
     GDB 7.9.1 (non apple; from homebrew)
     yes, it is code signed
     Compiling with dub: "dflags": ["-gc", "-gs"]

I would also like to preface this post by saying that everything 
works fine in GDB on linux.

When finding that a bug in my program was a null pointer bug, I 
decided to drop into GDB to try to figure out what was happening. 
But I quickly realized that trying to set a breakpoint in a file 
other than the one where the main function is, and stepping into 
functions in a file other than the one where the main function 
is, don't work. GDB will return something like:

     Cannot insert breakpoint 2.
     Cannot access memory at address 0x9bc06

when trying to insert a breakpoint in another file. GDB also 
treats the aforementioned step command as a continue because it 
can't read the file where the function is defined. Nothing 
changes when running the command as sudo either.

Two more pain points: `info locals` doesn't work. It responds 
with "No symbol table info available." And `info variables` 
returns the mangled D names for variables and not their real 
name, despite the language being set to D and doing `demangle 
[some_name]` returns the correct names.


More information about the Digitalmars-d-learn mailing list