This is the mail archive of the gdb-patches@sourceware.org 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]

FYI: ignore partial units in dw2_get_file_names_reader


I'm checking this in.

This fixes a small latent bug in dw2_get_file_names_reader.

If we are calling into a "quick" method that iterates over file names in
the index, then we don't want to consider partial units.

The reason for this is that a partial unit can't be expanded in
isolation; we must always expand a full CU and pull in the partial units
as a side effect.  With the index, there is no extra information about
CU inclusions, so this can't be done directly.

I don't have a test case for this but it can be seen by running the gdb
test suite with dwz's multifile mode and gdb_index.

Built and regtested on x86-64 Fedora 16.

Tom

2012-06-11  Tom Tromey  <tromey@redhat.com>

	* dwarf2read.c (dw2_get_file_names_reader): Ignore partial units.

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 7e25d08..1fdd819 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2449,6 +2449,14 @@ dw2_get_file_names_reader (const struct die_reader_specs *reader,
   struct quick_file_names *qfn;
   unsigned int line_offset;
 
+  /* Our callers never want to match partial units -- instead they
+     will match the enclosing full CU.  */
+  if (comp_unit_die->tag == DW_TAG_partial_unit)
+    {
+      this_cu->v.quick->no_file_data = 1;
+      return;
+    }
+
   lh = NULL;
   slot = NULL;
   line_offset = 0;


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