[fpc-devel] FPC SVN 8427 : GDB/DWARF2 issues

Bruce Tulloch bruce at causal.com
Tue Sep 11 08:56:03 CEST 2007


Jonas Maebe wrote:
>
> There was actually a bug in our compiler: for source files not in the
> current directory, we set the "current compiler directory" to the
> location of the source file, but at the same time also specified that
> those source files were located in an "include directory" (which is a
> relative path from the cwd when you started the compilation).
>
> I've fixed this now in svn. It won't be in 2.2.0 though, since that one
> will be released somewhere during the next couple of days.

I can confirm that this appears fixed, though still a little strange.

To explain...

Using FPC 2.3.1 SVN 8427 and GDB 6.6 and building with -gw/-gl we have:

  (gdb) info source
  Current source file is /home/bruce/vc/src//Widget.pas
  Compilation directory is /home/bruce/vc/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.

The difference appears to be that all references to directories are now
absolute, not relative and Emacs/GUD (at least) works happily with GDB.

The first strange thing to notice is that the current source file still
has a path prepended (as reported by GDB) if the source file is not in
the working directory (ie, the "/home/bruce/vc/src//" shown above).

The second strange thing is that gdb's "info source" reports

  Source language is minimal.
  Compiled with DWARF 2 debugging format.
  Does not include preprocessor macro info.

when viewing source which is in the current working directory but:

  Source language is pascal.
  Compiled with unknown debugging format.
  Does not include preprocessor macro info.

when viewing source which is located elsewhere. It seems gdb understands
that it's reading DWARF2 but not that the language is pascal if the file
is in the working directory and vice versa if the file is elsewhere.

So far these issues appear benign for our purposes here, but presumably
they indicate something is still amiss?

Another clue may be complaints by readelf -wl which reports:

"Warning: The line info appears to be corrupt - the section is too small"

I hope this helps. We will feedback more as we discover stuff.

Cheers, Bruce.



More information about the fpc-devel mailing list