What's the proper way to debug D programs with GDB?

Vladimir Panteleev vladimir at thecybershadow.net
Fri Mar 12 08:34:03 PST 2010


Hi all,

I'm trying to debug some random crashes of some D services running on a  
Linux headless server.
I have compiled/linked my programs and Phobos with -g and without -O  
(using DMD), and applied the gdb patches from  
http://dsource.org/projects/gdb-patches/ .
I'm running a script based on  
https://wiki.ubuntu.com/Backtrace#Summary%20in%20script%20form to  
automatically record the backtrace and restart the program.
However, gdb still doesn't print very nice backtraces. Here's an example  
output:


[Thread debugging using libthread_db enabled]
[New Thread 0xf75506d0 (LWP 29591)]
Die: DW_TAG_<unknown> (abbrev = 9, offset = 449149)
         has children: FALSE
         attributes:
                 DW_AT_byte_size (DW_FORM_data1) constant: 8
                 DW_AT_type (DW_FORM_ref4) constant ref: 449143 (adjusted)
Dwarf Error: Cannot find type of die [in module  
/home/wnbot/wahostbot/HostingBuddy]
#0  0x080a72aa in _aaIn (aa={a = 0xf7461410}, keyti=0x8136969) at  
internal/aaA.d:253
         pkey = (void *) 0xff9439d8
         len = 97
         key_hash = 145249
         i = 40
         e = (struct aaA.aaA *) 0x180002
         c = 50Die: DW_TAG_<unknown> (abbrev = 4, offset = 52531)
         has children: FALSE
         attributes:
                 DW_AT_byte_size (DW_FORM_data1) constant: 8
                 DW_AT_type (DW_FORM_ref4) constant ref: 52523 (adjusted)

Dwarf Error: Cannot find type of die [in module  
/home/wnbot/wahostbot/HostingBuddy]


So, what's the proper way to set up D debugging on Linux? Should I just  
look into gdc?


-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d-debugger mailing list