[fpc-devel] GDB barfs on FPC generated stabs.

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Sep 9 10:28:02 CEST 2007

On 09 Sep 2007, at 10:07, Bruce Tulloch wrote:

> I have encountered a problem using GDB (6.4.90-debian) with FPC (2.0.4
> or 2.1.4). In a nutshell, GDB sometimes barfs on FPC generated stabs.

That is a quite old gdb version. I would recommend at least gdb 6.5,  
and preferably gdb 6.6.

> If the program is compiled with -g (stabs format) the debugger works
> but attempts to print some data structures or produce a back-trace
> can result in a SEGV in GDB (ie, GDB itself crashes).

Sounds like a bug in the gdb version you are using.

> By way of example, with GDB run in the (project home) directory
>   /home/bruce/vc/
> with dwarf symbols GDB reports:
>   (gdb) info source
>   Current source file is src//Widget.pas
>   Compilation directory is src/
>   Located in /home/bruce/vc/src/Widget.pas
>   Contains 637 lines.
>   Source language is pascal.
>   Compiled with unknown debugging format.
>   Does not include preprocessor macro info.

That's gdb which is doing that. We do not say in the debug  
information that the source file is called "src//Widget.pas"; we set  
the compilation dir to ./src/ and the file name to Widget.pas, just  
like when generating stabs.

In fact, it appears this bug is not present in Apple's fork of gdb.  
It is present in gdb 6.5-15.fc6rh (on Fedora Core 6) though.

>  [1] has anyone else seen the GDB crashing problem when a program is
>      compiled with stabs info?

I haven't, but as I said you're using a really old version of gdb.

>  [2] is the filename problem with dwarf encoded symbols an FPC bug or
>      is there some configuration I'm missing somehere.

It's a gdb bug.


More information about the fpc-devel mailing list