View mode: basic / threaded / horizontal-split · Log in · Help
March 25, 2010
Re: What's the proper way to debug D programs with GDB?
On 26/03/10 12:13, Robert Clipsham wrote:
>
> ----
> I haven't narrowed it down further, because it requires most of phobos,
> and does include function pointers. I could attempt to narrow it down
> further, but I believe it has the same cause.

So the only way debugging will work is if we don't use Phobos? >_<;;

Thanks for your good work.
March 25, 2010
Re: What's the proper way to debug D programs with GDB?
On 25/03/10 23:29, Bernard Helyer wrote:
> So the only way debugging will work is if we don't use Phobos? >_<;;
>
> Thanks for your good work.

Seems so, at least until 
http://d.puremagic.com/issues/show_bug.cgi?id=3987 is fixed. 
Unfortunately I don't know enough about DWARF to chase this any further, 
at least without significant effort on my part, we we'll just have to 
sit tight, and hope Walter take a look at it :)
March 29, 2010
Re: What's the proper way to debug D programs with GDB?
On 17/03/10 22:50, Walter Bright wrote:
> grauzone wrote:
>> dmd producing buggy debugging information seems to be an old problem:
>> http://d.puremagic.com/issues/show_bug.cgi?id=1079
>
> The problem is that dmd produces dwarf debug info according to the dwarf
> spec. When gdb fails, I have no clue why, and nobody has ever been able
> to figure out just *what* in the dwarf info is causing gdb to fail.
>
> Some problems were identified a few months back, and those were fixed
> (evidently gdb cannot handle module records, and gdb also relied on some
> undocumented stuff).
>
> If anyone wants to peruse the gdb source and figure out exactly *what*
> it is choking on, that would be most appreciated.

Done. I've attached a patch to 
http://d.puremagic.com/issues/show_bug.cgi?id=3987 which seems to fix 
the issue. The problem was incorrect debug information being created for 
function pointers, it seems there shouldn't be a type for both the 
function and the pointer to it.
April 01, 2010
Re: What's the proper way to debug D programs with GDB?
On 12/03/10 16:34, Vladimir Panteleev wrote:
> 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?
>
>

I've spent a lot of time on this, and with the patch from bug #3987 
applied debugging info should work, providing binaries are compiled with 
-gc and not -g :)
Next ›   Last »
1 2 3
Top | Discussion index | About this forum | D home