This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb/456: gdb can't find certain source files from files compiled -gdwarf-2 with newer gcc's (?)


The following reply was made to PR gdb/456; it has been noted by GNATS.

From: Doug Evans <dje@transmeta.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/456: gdb can't find certain source files from files compiled -gdwarf-2 with newer gcc's (?)
Date: Sun, 7 Apr 2002 10:23:26 -0700

 To summarize the current state of this pr:
 
 It works for you because you're using a new enough gas that
 causes gcc to use dwarf2 .file/.loc primitives.
 
 In a little more detail:
 
 dwarf2 line number information can be output in two flavors.
 [N.B. I don't know all the ins and outs of dwarf2, so while the
 following is correct, no claim is made that it is complete.]
 
 Flavor one: Separate directory and file name tables.
 You can see this if you compile with -dA -S and look at the .debug_line
 section.  Another way is with astro-readelf -wl.
 File names have their directory parts stripped off and there's
 a separate source directory table.
 GDB doesn't properly handle this flavor and loses information
 about where source files are located.
 This is the situation I'm seeing.
 
 Flavor two: Don't output a directory table and specify the directory
 name with the file name.
 You can see this if you compile with -dA -S and look at the .debug_line
 section.  Another way is with astro-readelf -wl.
 When no directory is specified for a file GDB uses the compilation
 directory in the hopes that that works, and it does (at least most
 of the time anyway).
 
 There are two ways to achieve the second flavor.
 Older gcc's do it by generating raw dwarf2 info.
 Newer gcc's will generate it with .file/.loc directives if gas is new enough.
 
 Note that newer gcc's will generate flavor one if used with older gas's,
 which is what I was using.
 GAS is sufficiently out of date that gcc thinks it doesn't support
 dwarf2 .file/.loc (HAVE_AS_DWARF2_DEBUG_LINE in gcc-land).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]