digitalmars.D - It is impossible to debug code compiled with dmd
- Eldar Insafutdinov (1/1) Mar 31 2010 On Linux dmd outputs faulty debug info. On Windows optlink crashes when ...
- Robert Clipsham (19/22) Mar 31 2010 There are several bugs in the debug info on linux, one of them I've
- Fawzi Mohamed (6/28) Mar 31 2010 a new backend like gcc (of gdc) or even better llvm (ldc)?
- Robert Clipsham (5/18) Mar 31 2010 Having played with the testcase you sent me, it isn't another bug. You
- Matthias Pleh (4/23) Mar 31 2010 Does this mean, the -g option only works in compination with the ddbg
- Robert Clipsham (5/12) Mar 31 2010 Having never used ddbg I can't say if it supports -g or not (although it...
- Walter Bright (3/17) Mar 31 2010 Please let me know when you have dwarf.c patches ready, and thank you fo...
- Robert Clipsham (19/21) Mar 31 2010 The first one is in bugzilla, you just need to comment out/remove the li...
- Walter Bright (2/3) Mar 31 2010 Do you mean http://d.puremagic.com/issues/show_bug.cgi?id=1079 or anothe...
- Robert Clipsham (12/15) Mar 31 2010 http://d.puremagic.com/issues/show_bug.cgi?id=3987 Please ignore the
- Walter Bright (2/21) Mar 31 2010 I and I'm sure many others appreciate your efforts.
- Robert Clipsham (6/7) Apr 01 2010 Thanks :) I've finished a complete and working patch now, it's attached
- Walter Bright (2/10) Apr 01 2010 Will do. Thanks very much!
- Robert Clipsham (6/16) Apr 01 2010 There are a couple of other debugging patches that I created later on,
- Robert Clipsham (7/8) Apr 02 2010 Thought I'd call your attention to:
- Walter Bright (3/6) Mar 31 2010 Is there a bugzilla for this? For example, I compile the entire test sui...
- Max Samukha (6/12) Apr 01 2010 I've filed a bug report:
- Robert Clipsham (3/4) Apr 01 2010 Hopefully this is fixed with the patch from #3987, I've tried your test
On Linux dmd outputs faulty debug info. On Windows optlink crashes when building code in debug. Current situation is a complete disaster.
Mar 31 2010
On 31/03/10 10:41, Eldar Insafutdinov wrote:On Linux dmd outputs faulty debug info.There are several bugs in the debug info on linux, one of them I've fixed (for most cases ie. anything that requires phobos, I'm working on the other cases ie. anything that needs funky libraries that use a lot of complicated function pointers), and another one you've sent me a massive test case for which I'm working down to a manageable size for a bug report now (I'd have done it by now, your make file doesn't play nicely with my multilib system though ;)). Other than those 2 bugs I don't know what else is blocking debug info on linux... I'm becoming quite familiar with DWARF/dmd's backend code for DWARF through all this debugging, so if I can get these bugs fixed I'd be happy to work on any others while I have time.On Windows optlink crashes when building code in debug. Current situation is a complete disaster.OPTLINK still has problems, hopefully this situation will improve as it gradually gets ported to C and eventually open sourced (or at least we can hope that happens ;)). If not I guess we need to either write a new linker, or a new backend for dmd so it can output COFF and use another linker. Hopefully we can sort this situation out and get debug info for D on a par with C/C++ :)
Mar 31 2010
On 31-mar-10, at 17:09, Robert Clipsham wrote:On 31/03/10 10:41, Eldar Insafutdinov wrote:a new backend like gcc (of gdc) or even better llvm (ldc)? for linux that was already done, and for D 1.0 it works well (I am using linux x86_64). and debugging normally works, even tango's stacktrace... windows is indeed a different story (but I know some people use gdc).On Linux dmd outputs faulty debug info.There are several bugs in the debug info on linux, one of them I've fixed (for most cases ie. anything that requires phobos, I'm working on the other cases ie. anything that needs funky libraries that use a lot of complicated function pointers), and another one you've sent me a massive test case for which I'm working down to a manageable size for a bug report now (I'd have done it by now, your make file doesn't play nicely with my multilib system though ;)). Other than those 2 bugs I don't know what else is blocking debug info on linux... I'm becoming quite familiar with DWARF/dmd's backend code for DWARF through all this debugging, so if I can get these bugs fixed I'd be happy to work on any others while I have time.On Windows optlink crashes when building code in debug. Current situation is a complete disaster.OPTLINK still has problems, hopefully this situation will improve as it gradually gets ported to C and eventually open sourced (or at least we can hope that happens ;)). If not I guess we need to either write a new linker, or a new backend for dmd so it can output COFF and use another linker.Hopefully we can sort this situation out and get debug info for D on a par with C/C++ :)
Mar 31 2010
On 31/03/10 16:09, Robert Clipsham wrote:On 31/03/10 10:41, Eldar Insafutdinov wrote:Having played with the testcase you sent me, it isn't another bug. You were using -g instead of -gc, which won't work until debuggers support the D extensions to debug info. When using -gc it gives the error asOn Linux dmd outputs faulty debug info.There are several bugs in the debug info on linux, one of them I've fixed (for most cases ie. anything that requires phobos, I'm working on the other cases ie. anything that needs funky libraries that use a lot of complicated function pointers), and another one you've sent me a massive test case for which I'm working down to a manageable size for a bug report now (I'd have done it by now, your make file doesn't play nicely with my multilib system though ;)). Other than those 2 bugs I don't know what else is blocking debug info on linux... I'm becoming quite familiar with DWARF/dmd's backend code for DWARF through all this debugging, so if I can get these bugs fixed I'd be happy to work on any others while I have time.
Mar 31 2010
Am 31.03.2010 20:16, schrieb Robert Clipsham:On 31/03/10 16:09, Robert Clipsham wrote:Does this mean, the -g option only works in compination with the ddbg debugger and all other debugger need the -gc option? I need this to set a defaultsetting in codeblocks!On 31/03/10 10:41, Eldar Insafutdinov wrote:Having played with the testcase you sent me, it isn't another bug. You were using -g instead of -gc, which won't work until debuggers support the D extensions to debug info. When using -gc it gives the error asOn Linux dmd outputs faulty debug info.There are several bugs in the debug info on linux, one of them I've fixed (for most cases ie. anything that requires phobos, I'm working on the other cases ie. anything that needs funky libraries that use a lot of complicated function pointers), and another one you've sent me a massive test case for which I'm working down to a manageable size for a bug report now (I'd have done it by now, your make file doesn't play nicely with my multilib system though ;)). Other than those 2 bugs I don't know what else is blocking debug info on linux... I'm becoming quite familiar with DWARF/dmd's backend code for DWARF through all this debugging, so if I can get these bugs fixed I'd be happy to work on any others while I have time.
Mar 31 2010
On 31/03/10 19:31, Matthias Pleh wrote:Having never used ddbg I can't say if it supports -g or not (although it looks like it should). But yes, as far as I'm aware, all other debuggers need -gc to be used, unless they have had D support written for them (even gdb with the D patches doesn't support -g).Having played with the testcase you sent me, it isn't another bug. You were using -g instead of -gc, which won't work until debuggers support the D extensions to debug info. When using -gc it gives the error asDoes this mean, the -g option only works in compination with the ddbg debugger and all other debugger need the -gc option? I need this to set a defaultsetting in codeblocks!
Mar 31 2010
Robert Clipsham wrote:On 31/03/10 10:41, Eldar Insafutdinov wrote:Please let me know when you have dwarf.c patches ready, and thank you for trying to figure this out.On Linux dmd outputs faulty debug info.There are several bugs in the debug info on linux, one of them I've fixed (for most cases ie. anything that requires phobos, I'm working on the other cases ie. anything that needs funky libraries that use a lot of complicated function pointers), and another one you've sent me a massive test case for which I'm working down to a manageable size for a bug report now (I'd have done it by now, your make file doesn't play nicely with my multilib system though ;)). Other than those 2 bugs I don't know what else is blocking debug info on linux... I'm becoming quite familiar with DWARF/dmd's backend code for DWARF through all this debugging, so if I can get these bugs fixed I'd be happy to work on any others while I have time.
Mar 31 2010
On 31/03/10 21:37, Walter Bright wrote:Please let me know when you have dwarf.c patches ready, and thank you for trying to figure this out.The first one is in bugzilla, you just need to comment out/remove the lines: abuf.writeByte(DW_AT_type); abuf.writeByte(DW_FORM_ref4); (at about line 1447, in the TYjfunc case of the switch statement in dwarf_typidx()). And: infobuf->write32(nextidx); // DW_AT_type At about line 1469 of dwarf.c. This fixes debug info for druntime, phobos, and a couple of test projects (the debug info looks identical to the equivalent output from clang too). There is one case which this patch doesn't solve, and that's for function pointers in the form: T function(U function(V)) foobar; Where T, U and V are any type. If you look at the .debug_info produced by dmd (either before or after the above patch, use objdump --dwarf=info testFile), you will see that it ends up writing what is parsed as a DW_TAG_compile_unit after the second DW_TAG_formal_parameter, so it seems some stray bytes are getting written causing the 0x1 to be detected as the abbrev rather than what ever it was intended to be (I'm still looking into this).
Mar 31 2010
Robert Clipsham wrote:The first one is in bugzilla,Do you mean http://d.puremagic.com/issues/show_bug.cgi?id=1079 or another?
Mar 31 2010
On 31/03/10 21:58, Walter Bright wrote:Robert Clipsham wrote:http://d.puremagic.com/issues/show_bug.cgi?id=3987 Please ignore the attached patch file, it's the incorrect fix (although it does work). I haven't written a formal patch, I didn't see a need with it only being 2 lines needing removing (which are mentioned in my last post, and a comment on that bug). As an update to the case it doesn't fix, it seems the second DW_TAG_formal_param is causing the debug info for something else to be written half way between the debug info for something else, so when it's read it's read incorrectly. Still working on this, I'm hoping to have a patch for it tonight, I've already put days into this, I'd rather not spend too much more ;)The first one is in bugzilla,Do you mean http://d.puremagic.com/issues/show_bug.cgi?id=1079 or another?
Mar 31 2010
Robert Clipsham wrote:On 31/03/10 21:58, Walter Bright wrote:I and I'm sure many others appreciate your efforts.Robert Clipsham wrote:http://d.puremagic.com/issues/show_bug.cgi?id=3987 Please ignore the attached patch file, it's the incorrect fix (although it does work). I haven't written a formal patch, I didn't see a need with it only being 2 lines needing removing (which are mentioned in my last post, and a comment on that bug). As an update to the case it doesn't fix, it seems the second DW_TAG_formal_param is causing the debug info for something else to be written half way between the debug info for something else, so when it's read it's read incorrectly. Still working on this, I'm hoping to have a patch for it tonight, I've already put days into this, I'd rather not spend too much more ;)The first one is in bugzilla,Do you mean http://d.puremagic.com/issues/show_bug.cgi?id=1079 or another?
Mar 31 2010
On 31/03/10 23:15, Walter Bright wrote:I and I'm sure many others appreciate your efforts.Thanks :) I've finished a complete and working patch now, it's attached to http://d.puremagic.com/issues/show_bug.cgi?id=3987 and should fix the remaining issues with debugging info on linux. I've tested it with QtD, and various other projects, so I'd be grateful if you could review the patch and apply it!
Apr 01 2010
Robert Clipsham wrote:On 31/03/10 23:15, Walter Bright wrote:Will do. Thanks very much!I and I'm sure many others appreciate your efforts.Thanks :) I've finished a complete and working patch now, it's attached to http://d.puremagic.com/issues/show_bug.cgi?id=3987 and should fix the remaining issues with debugging info on linux. I've tested it with QtD, and various other projects, so I'd be grateful if you could review the patch and apply it!
Apr 01 2010
On 01/04/10 22:56, Walter Bright wrote:Robert Clipsham wrote:There are a couple of other debugging patches that I created later on, they're attached to separate bugs: http://d.puremagic.com/issues/show_bug.cgi?id=4037 http://d.puremagic.com/issues/show_bug.cgi?id=4038 It'd be good if you could apply them too :)On 31/03/10 23:15, Walter Bright wrote:Will do. Thanks very much!I and I'm sure many others appreciate your efforts.Thanks :) I've finished a complete and working patch now, it's attached to http://d.puremagic.com/issues/show_bug.cgi?id=3987 and should fix the remaining issues with debugging info on linux. I've tested it with QtD, and various other projects, so I'd be grateful if you could review the patch and apply it!
Apr 01 2010
On 01/04/10 22:56, Walter Bright wrote:Will do. Thanks very much!Thought I'd call your attention to: http://d.puremagic.com/issues/show_bug.cgi?id=4044 I created a tracker bug for all the gdb/debugging/DWARF/etc issues with dmd, quite a lot of them already have patches, so while you're looking through my patches, making sure they're ok, could you take a glance at some of the others and pass comment? Thanks again :)
Apr 02 2010
Eldar Insafutdinov wrote:On Linux dmd outputs faulty debug info. On Windows optlink crashes when building code in debug.Is there a bugzilla for this? For example, I compile the entire test suite on Windows with debugging on, and no optlink crashes.
Mar 31 2010
On 31.03.2010 23:36, Walter Bright wrote:Eldar Insafutdinov wrote:I've filed a bug report: http://d.puremagic.com/issues/show_bug.cgi?id=4035 Sorry, cannot make the test case smaller. And there is another that may describe the same bug: http://d.puremagic.com/issues/show_bug.cgi?id=4009On Linux dmd outputs faulty debug info. On Windows optlink crashes when building code in debug.Is there a bugzilla for this? For example, I compile the entire test suite on Windows with debugging on, and no optlink crashes.
Apr 01 2010
On 31/03/10 10:41, Eldar Insafutdinov wrote:On Linux dmd outputs faulty debug info.case and it works fine now.
Apr 01 2010