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

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Sep 9 14:03:40 CEST 2007


On 09 Sep 2007, at 13:36, Bruce Tulloch wrote:

> I've since downloaded and built gdb 6.6 and both problems remain  
> the same
> so I don't think it's gdb per se. This latest GDB version still  
> produces a
> SEGV on stabs symbols from time to time

A segfault in gdb is a bug in gdb regardless of whether our debug  
information contains an error or not, but it may of course point at  
an error in our debug info. We'll need a compilable example and  
instructions on how to reproduce it before we can fix it though.

> However for units that are in a directory specified via an -Fu  
> argument the
> names are corrupted as I described before. Eg, -Fusrc/ produces a  
> filename
> for the "Widget" unit as "src//Widget.pas" instead of just  
> "Widget.pas". In
> the case of stabs the filename is reported correctly regardless of  
> where
> the unit is located.

We really do not add any extra directory to the file name, I checked  
it in the generated assembler code.

> Is there another tool I can use than gdb to dump the dwarf data  
> from the
> object?

readelf -w program

Example:

<0><5d>: Abbrev Number: 1 (DW_TAG_compile_unit)
      DW_AT_name        : un.pp
      DW_AT_producer    : Free Pascal 2.3.1 2007/08/28
      DW_AT_comp_dir    : ./udir

Still, gdb (6.5 under Fedora) also says:

(gdb) info source
Current source file is ./udir//un.pp
Compilation directory is ./udir
Located in /user/jmaebe/lnxhome/fpc/test/udir/un.pp


Jonas





More information about the fpc-devel mailing list