Discussion:
gdb internal error
AaronP
2011-12-26 22:57:45 UTC
Permalink
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?
Robert Clipsham
2011-12-27 14:11:45 UTC
Permalink
Post by AaronP
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/
AaronP
2011-12-27 15:37:50 UTC
Permalink
Post by Robert Clipsham
Post by AaronP
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
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?
Robert Clipsham
2011-12-27 18:20:00 UTC
Permalink
Post by AaronP
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/
Trass3r
2011-12-27 16:54:05 UTC
Permalink
On Tuesday, 27 December 2011 at 14:11:45 UTC, Robert Clipsham
Post by Robert Clipsham
Post by AaronP
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
That has bitten me before too.
Why the heck isn't -g == -gc as long as -g is fucked up that bad?
AaronP
2011-12-27 17:05:21 UTC
Permalink
Post by Trass3r
Post by Robert Clipsham
Post by AaronP
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
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"
Robert Clipsham
2011-12-27 18:20:32 UTC
Permalink
Post by AaronP
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/
Robert Clipsham
2011-12-27 18:21:16 UTC
Permalink
Post by Trass3r
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/
Continue reading on narkive:
Search results for 'gdb internal error' (Questions and Answers)
3
replies
COMPUTER HELP???????
started 2012-01-28 05:45:20 UTC
computers & internet
Loading...