Re: [RFA] patch for DW_AT_comp_dir/DW_AT_name vs .debug_line inco nsistencies

Aleksandar Ristovski
2008-04-08T13:08:30Z

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

Doug Evans wrote:
> I have an occasion to revisit this:
> http://sourceware.org/ml/gdb-patches/2007-11/msg00314.html
>
> Or in a different form:
> http://sourceware.org/ml/gdb-patches/2008-01/msg00103.html
>
> When we last left our story, watching for a single path mismatch of
> the main source file only seemed ok. That's what this patch does.
> It's just a minor revision of
> http://sourceware.org/ml/gdb-patches/2008-01/msg00103.html
>
>
Hello Doug,

Without going through your revisited patch:

I have been using a patch based on your initial patch and it seems to work
fine,
with one exception, there is one problem in your patch - fixed with the diff

attached. I think the code comment is self-explanatory.

Thanks,

---
Aleksandar Ristovski
QNX Software Systems

[-- Attachment #2: dwarf2read.doug.diff --]
[-- Type: text/plain, Size: 867 bytes --]

Index: gdb/dwarf2read.c
===================================================================
--- gdb/dwarf2read.c (revision 99)
+++ gdb/dwarf2read.c (revision 115)
@@ -6988,7 +6988,16 @@ dwarf_decode_lines (struct line_header *
read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
add_file_name (lh, cur_file, dir_index, mod_time, length);
- }
+ if (!decode_for_pst_p)
+ {
+ /* Re-create subfile_names. We created it initially
+ assuming lh->file_names is final, but now that
+ it changed, we need to rebuild. */
+ subfile_names = dwarf_build_subfile_names (
+ lh, cu_file_name, comp_dir);
+ make_cleanup (dwarf_free_subfile_names, subfile_names);
+ }
+ }
break;
default:
complaint (&symfile_complaints,