www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - gdb internal error

reply AaronP <aaronbpaden gmail.com> writes:
Trying to set a breakpoint on gdb (7.3.1-1) gives me an error.

(gdb) b game.d:die
buildsym.c:824: internal-error: start_symtab: Assertion `! 
pending_addrmap' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)


Is there some kind of special sauce for getting gdb working with D?
Dec 26 2011
parent reply Robert Clipsham <robert octarineparrot.com> writes:
On 26/12/2011 22:57, AaronP wrote:
 Trying to set a breakpoint on gdb (7.3.1-1) gives me an error.

 (gdb) b game.d:die
 buildsym.c:824: internal-error: start_symtab: Assertion `!
 pending_addrmap' failed.
 A problem internal to GDB has been detected,
 further debugging may prove unreliable.
 Quit this debugging session? (y or n)


 Is there some kind of special sauce for getting gdb working with D?
Make sure you're compiling with -gc (not -g), if that's still happening then one of two things needs to happen: 1) A bug gets filed to the gdb team with the relevant object files so they can reproduce it/fix it 2) It needs narrowing down so that dmd can work around it. Alternatively you could compile with ldc or gdc as they will produce different debug information and probably won't cause gdb to crash. -- Robert http://octarineparrot.com/
Dec 27 2011
next sibling parent reply AaronP <aaronbpaden gmail.com> writes:
On 12/27/2011 08:11 AM, Robert Clipsham wrote:
 On 26/12/2011 22:57, AaronP wrote:
 Trying to set a breakpoint on gdb (7.3.1-1) gives me an error.

 (gdb) b game.d:die
 buildsym.c:824: internal-error: start_symtab: Assertion `!
 pending_addrmap' failed.
 A problem internal to GDB has been detected,
 further debugging may prove unreliable.
 Quit this debugging session? (y or n)


 Is there some kind of special sauce for getting gdb working with D?
Make sure you're compiling with -gc (not -g), if that's still happening then one of two things needs to happen: 1) A bug gets filed to the gdb team with the relevant object files so they can reproduce it/fix it 2) It needs narrowing down so that dmd can work around it. Alternatively you could compile with ldc or gdc as they will produce different debug information and probably won't cause gdb to crash.
Ah, thanks, compiling with -gc works. Though names are mangled and I can only set breakpoints at line numbers. I thought I could compile with -g because I've got the latest gdb (woo Arch Linux). Weren't there some patches that were being included with gdb to make things better for d? Or was that for gdc?
Dec 27 2011
parent Robert Clipsham <robert octarineparrot.com> writes:
On 27/12/2011 15:37, AaronP wrote:
 Ah, thanks, compiling with -gc works. Though names are mangled and I can
 only set breakpoints at line numbers. I thought I could compile with -g
 because I've got the latest gdb (woo Arch Linux). Weren't there some
 patches that were being included with gdb to make things better for d?
 Or was that for gdc?
There are patches for gdb that have been integrated... They only work with -g though (or when using ldc or gdc). However you need to use -gc to stop gdb giving fatal errors... It's a bit of a pain. To work around this, use: (gdb) set language d There is a patch that should fix this, it still needs to be merged though: https://github.com/D-Programming-Language/dmd/pull/526 The issue goes something like this: * -g emits debug information with D extensions that conflict with official standards (causing gdb to error). It sets the language to D, so the gdb D extensions are activated. * -gc emits debug information without D extensions, and sets the language to C. Hopefully the above pull request will be integrated soon, in the mean time, try set language in gdb, or switch to ldc or gdc. -- Robert http://octarineparrot.com/
Dec 27 2011
prev sibling parent reply "Trass3r" <un known.com> writes:
On Tuesday, 27 December 2011 at 14:11:45 UTC, Robert Clipsham 
wrote:
 On 26/12/2011 22:57, AaronP wrote:
 Is there some kind of special sauce for getting gdb working 
 with D?
Make sure you're compiling with -gc (not -g), if that's still happening then one of two things needs to happen:
That has bitten me before too. Why the heck isn't -g == -gc as long as -g is fucked up that bad?
Dec 27 2011
next sibling parent reply AaronP <aaronbpaden gmail.com> writes:
On 12/27/2011 10:54 AM, Trass3r wrote:
 On Tuesday, 27 December 2011 at 14:11:45 UTC, Robert Clipsham wrote:
 On 26/12/2011 22:57, AaronP wrote:
 Is there some kind of special sauce for getting gdb working with D?
Make sure you're compiling with -gc (not -g), if that's still happening then one of two things needs to happen:
That has bitten me before too. Why the heck isn't -g == -gc as long as -g is fucked up that bad?
Not to mention the dmd man page suggests -gc is only for "older gdb's"
Dec 27 2011
parent Robert Clipsham <robert octarineparrot.com> writes:
On 27/12/2011 17:05, AaronP wrote:
 Not to mention the dmd man page suggests -gc is only for "older gdb's"
The dmd man page is out of date, it could do with a patch. -- Robert http://octarineparrot.com/
Dec 27 2011
prev sibling parent Robert Clipsham <robert octarineparrot.com> writes:
On 27/12/2011 16:54, Trass3r wrote:
 Why the heck isn't -g == -gc as long as -g is fucked up that bad?
See my other replies. Just a matter of time really (hopefully). -- Robert http://octarineparrot.com/
Dec 27 2011