* dwarf2read.c (dw2_require_line_header): Read from .debug_types
authorDoug Evans <dje@google.com>
Fri, 27 Aug 2010 23:09:58 +0000 (23:09 +0000)
committerDoug Evans <dje@google.com>
Fri, 27 Aug 2010 23:09:58 +0000 (23:09 +0000)
as appropriate.

gdb/ChangeLog
gdb/dwarf2read.c

index 5280cc488b107aed2546465ec3e8fe01eb51d4e9..8e25db542bb96983a35c94d6a3eb042d111ffd58 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-27  Doug Evans  <dje@google.com>
+
+       * dwarf2read.c (dw2_require_line_header): Read from .debug_types
+       as appropriate.
+
 2010-08-27  Tom Tromey  <tromey@redhat.com>
 
        * dwarf2read.c (dwarf2_attach_fields_to_type): Don't set
index ebab2652ddd06e93f160703856e211b2e18f361b..ac954e66fcdb816e2ab3399f758cd5960921a0a2 100644 (file)
@@ -1990,6 +1990,7 @@ dw2_require_line_header (struct objfile *objfile,
   struct attribute *attr;
   struct cleanup *cleanups;
   struct die_info *comp_unit_die;
+  struct dwarf2_section_info* sec;
   gdb_byte *beg_of_comp_unit, *info_ptr, *buffer;
   int has_children, i;
   struct dwarf2_cu cu;
@@ -2007,9 +2008,13 @@ dw2_require_line_header (struct objfile *objfile,
 
   cleanups = make_cleanup (free_stack_comp_unit, &cu);
 
-  dwarf2_read_section (objfile, &dwarf2_per_objfile->info);
-  buffer_size = dwarf2_per_objfile->info.size;
-  buffer = dwarf2_per_objfile->info.buffer;
+  if (this_cu->from_debug_types)
+    sec = &dwarf2_per_objfile->types;
+  else
+    sec = &dwarf2_per_objfile->info;
+  dwarf2_read_section (objfile, sec);
+  buffer_size = sec->size;
+  buffer = sec->buffer;
   info_ptr = buffer + this_cu->offset;
   beg_of_comp_unit = info_ptr;