This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] patch for DW_AT_comp_dir/DW_AT_name vs .debug_line inco nsistencies
- From: Daniel Jacobowitz <drow at false dot org>
- To: Aleksandar Ristovski <ARistovski at qnx dot com>
- Cc: dje at google dot com, gdb-patches at sourceware dot org, Ryan Mansfield <RMansfield at qnx dot com>
- Date: Tue, 8 Jan 2008 16:56:47 -0500
- Subject: Re: [RFA] patch for DW_AT_comp_dir/DW_AT_name vs .debug_line inco nsistencies
- References: <2F6320727174C448A52CEB63D85D11F40A72@nova.ott.qnx.com>
On Tue, Jan 08, 2008 at 04:51:02PM -0500, Aleksandar Ristovski wrote:
> 1. case 3.3.5:
> DW_AT_name is correct, according to point 2 of quoted document.
> DW_AT_comp_dir is correct, according to point 6 of the quoted text.
> File table in debug_line section is correct (according to the spec) as it
> specifies files relative to DW_AT_comp_dir.
You can't use the DWARF specification like this. It describes a
representation, but not all the semantics of the representation; there
are plenty of things that appear valid according to the specification
and are still broken or meaningless. In the end you have to judge the
debug info based on its usefulness to consumers.
The compiler specifies the same directory using two completely
different names. I think this is a bug in the compiler, and that GDB
is not obliged to figure out that the two files are the same.
If you still need GDB to figure this out, I am open to a patch which
handles the case of a single entry in the line table with the correct
basename (i.e. if there is only one "main.c"). For any more
complicated situation, I think that guessing is too likely to break
some other case with more useful debug information.
--
Daniel Jacobowitz
CodeSourcery