March 18, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bernard Helyer | On 18/03/10 23:22, Bernard Helyer wrote: > Okay got it. It's 6000 lines and six megabytes large (and hacked to all > hell, as the std.string templates started breaking, for some reason), > but it doesn't debug with `-gc`! What's the best way to get it to you? You can either upload it somewhere (eg http://omploader.org/ or some other file upload site if you've not got hosting), or email it to me (my address is the same as I use for the newsgroups). Either way if you tar/zip it up you should be able to save a few megs on that :) |
March 19, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Clipsham | On 19/03/10 12:32, Robert Clipsham wrote: > On 18/03/10 23:22, Bernard Helyer wrote: >> Okay got it. It's 6000 lines and six megabytes large (and hacked to all >> hell, as the std.string templates started breaking, for some reason), >> but it doesn't debug with `-gc`! What's the best way to get it to you? > > You can either upload it somewhere (eg http://omploader.org/ or some > other file upload site if you've not got hosting), or email it to me (my > address is the same as I use for the newsgroups). Either way if you > tar/zip it up you should be able to save a few megs on that :) http://omploader.org/iM3ZudA There you go. D2, run build.debug.sh to build. Modify the script to add options and the like. Built with `-gc` list _Dmain or break _Dmain doesn't work, if you force a segfault (remove the comments from the first few lines of ator.main and compile with -noboundscheck to cause one) bt doesn't work, etc, etc. |
March 19, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bernard Helyer | On 19/03/10 00:34, Bernard Helyer wrote:
> http://omploader.org/iM3ZudA
>
> There you go. D2, run build.debug.sh to build. Modify the script to add
> options and the like. Built with `-gc` list _Dmain or break _Dmain
> doesn't work, if you force a segfault (remove the comments from the
> first few lines of ator.main and compile with -noboundscheck to cause
> one) bt doesn't work, etc, etc.
Thanks! I've managed to work this down to a 2 line test case:
----
void function() myfunc;
void main(){}
----
Which errors with:
----
Die: DW_TAG_padding (abbrev = 0, offset = 0)
has children: FALSE
attributes:
Dwarf Error: Cannot find type of die [in module /tmp/test]
----
Compile with either dmd -gc test.d or dmd -g test.d. I'll spend some more time with it now and see if I can figure out a cause so we can give a more useful bug report, if not I'll open a bug as is. If anyone else is getting different errors from gdb when using -gc, let me know and I can narrow them down too.
|
March 19, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Clipsham | Robert Clipsham wrote: > On 19/03/10 00:34, Bernard Helyer wrote: >> http://omploader.org/iM3ZudA >> >> There you go. D2, run build.debug.sh to build. Modify the script to add >> options and the like. Built with `-gc` list _Dmain or break _Dmain >> doesn't work, if you force a segfault (remove the comments from the >> first few lines of ator.main and compile with -noboundscheck to cause >> one) bt doesn't work, etc, etc. > > Thanks! I've managed to work this down to a 2 line test case: > ---- > void function() myfunc; > void main(){} > ---- Wow, good work... > Which errors with: > ---- > Die: DW_TAG_padding (abbrev = 0, offset = 0) > has children: FALSE > attributes: > Dwarf Error: Cannot find type of die [in module /tmp/test] > ---- > > Compile with either dmd -gc test.d or dmd -g test.d. I'll spend some more time with it now and see if I can figure out a cause so we can give a more useful bug report, if not I'll open a bug as is. If anyone else is getting different errors from gdb when using -gc, let me know and I can narrow them down too. If I compile it with dmd -gc test.d, start gdb (version "7.0.1-debian"), and type "break _Dmain", I just get "Dwarf Error: Cannot find DIE at 0x0 referenced from DIE at 0x46 [in module /tmp/test]". This is with dmd v1.055 without gdb patches (but some other custom patches, though I think none should affect the debugging infos). |
March 19, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to grauzone | On 19/03/10 21:37, grauzone wrote: > Wow, good work... Thanks :) Took a while, but I got there. > If I compile it with dmd -gc test.d, start gdb (version "7.0.1-debian"), > and type "break _Dmain", I just get "Dwarf Error: Cannot find DIE at 0x0 > referenced from DIE at 0x46 [in module /tmp/test]". > > This is with dmd v1.055 without gdb patches (but some other custom > patches, though I think none should affect the debugging infos). I'm using dmd v2.040 with the gdb patches (gdb 6.8), which could explain the difference in error messages. I might have to give it a shot, as that error message looks far more useful than what I'm getting out of 6.8. I'll keep playing for a bit, and if I don't start getting somewhere I'll try it :) |
March 19, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bernard Helyer | On 19/03/10 00:34, Bernard Helyer wrote: > http://omploader.org/iM3ZudA > > There you go. D2, run build.debug.sh to build. Modify the script to add > options and the like. Built with `-gc` list _Dmain or break _Dmain > doesn't work, if you force a segfault (remove the comments from the > first few lines of ator.main and compile with -noboundscheck to cause > one) bt doesn't work, etc, etc. http://d.puremagic.com/issues/show_bug.cgi?id=3987 Submitted to bugzilla with a test case, I couldn't narrow down the exact reason for it happening though, so that will have to be left to someone else. I'm pretty sure there's another bug in there somewhere too, because I came up with some odd errors while narrowing down a test case... I'll leave it until that is fixed though in case it's the same bug, unless someone can come up with another test case for me to work down. |
March 25, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Clipsham | On 19/03/10 12:32, Robert Clipsham wrote: > On 18/03/10 23:22, Bernard Helyer wrote: >> Okay got it. It's 6000 lines and six megabytes large (and hacked to all >> hell, as the std.string templates started breaking, for some reason), >> but it doesn't debug with `-gc`! What's the best way to get it to you? > > You can either upload it somewhere (eg http://omploader.org/ or some > other file upload site if you've not got hosting), or email it to me (my > address is the same as I use for the newsgroups). Either way if you > tar/zip it up you should be able to save a few megs on that :) Found another, no function pointers in this one, I think. It's much smaller, too! D2, dmd -ofnetmon.bin netmon/*.d -gc -debug. Linux only. http://omploader.org/iM3h0cw |
March 25, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bernard Helyer | On 25/03/10 00:03, Bernard Helyer wrote:
> On 19/03/10 12:32, Robert Clipsham wrote:
>> On 18/03/10 23:22, Bernard Helyer wrote:
>>> Okay got it. It's 6000 lines and six megabytes large (and hacked to all
>>> hell, as the std.string templates started breaking, for some reason),
>>> but it doesn't debug with `-gc`! What's the best way to get it to you?
>>
>> You can either upload it somewhere (eg http://omploader.org/ or some
>> other file upload site if you've not got hosting), or email it to me (my
>> address is the same as I use for the newsgroups). Either way if you
>> tar/zip it up you should be able to save a few megs on that :)
>
> Found another, no function pointers in this one, I think. It's much
> smaller, too! D2, dmd -ofnetmon.bin netmon/*.d -gc -debug. Linux only.
>
> http://omploader.org/iM3h0cw
Excellent :) OmpLoader seems to be down right now, so I'll try again later... As soon as I can get it I'll see what I can do. In the mean time you could upload it somewhere else or email it to me directly (I'll post here once I've got it :)).
|
March 25, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Clipsham | On 26/03/10 04:30, Robert Clipsham wrote:
> On 25/03/10 00:03, Bernard Helyer wrote:
>> On 19/03/10 12:32, Robert Clipsham wrote:
>>> On 18/03/10 23:22, Bernard Helyer wrote:
>>>> Okay got it. It's 6000 lines and six megabytes large (and hacked to all
>>>> hell, as the std.string templates started breaking, for some reason),
>>>> but it doesn't debug with `-gc`! What's the best way to get it to you?
>>>
>>> You can either upload it somewhere (eg http://omploader.org/ or some
>>> other file upload site if you've not got hosting), or email it to me (my
>>> address is the same as I use for the newsgroups). Either way if you
>>> tar/zip it up you should be able to save a few megs on that :)
>>
>> Found another, no function pointers in this one, I think. It's much
>> smaller, too! D2, dmd -ofnetmon.bin netmon/*.d -gc -debug. Linux only.
>>
>> http://omploader.org/iM3h0cw
>
> Excellent :) OmpLoader seems to be down right now, so I'll try again
> later... As soon as I can get it I'll see what I can do. In the mean
> time you could upload it somewhere else or email it to me directly (I'll
> post here once I've got it :)).
Okay, I sent it to you. You should receive it with any luck.
|
March 25, 2010 Re: What's the proper way to debug D programs with GDB? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bernard Helyer | On 25/03/10 00:03, Bernard Helyer wrote:
> Found another, no function pointers in this one, I think. It's much
> smaller, too! D2, dmd -ofnetmon.bin netmon/*.d -gc -debug. Linux only.
>
> http://omploader.org/iM3h0cw
I think it's the same bug. A test case:
----
import std.stdio;
void main()
{
writeln("");
}
----
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.
|
Copyright © 1999-2021 by the D Language Foundation