* dwarf2read.c (dwarf2_get_section_info): Handle case where no
authorTom Tromey <tromey@redhat.com>
Wed, 17 Mar 2010 19:16:02 +0000 (19:16 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 17 Mar 2010 19:16:02 +0000 (19:16 +0000)
DWARF data is available.

gdb/ChangeLog
gdb/dwarf2read.c

index f1e5f6a0b39e50b4fe501582b0b5081f9207e42e..da6e1f8c1b62e6d4bec18610eccda81a959abc6f 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-17  Tom Tromey  <tromey@redhat.com>
+
+       * dwarf2read.c (dwarf2_get_section_info): Handle case where no
+       DWARF data is available.
+
 2010-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * symfile.c (generic_load): Reset breakpoints after loading.
index cbb742490f3f0c36d494ed52e98e00db768e20d7..3789d09f8c1b0c60c912161cbdb7e770336d55bc 100644 (file)
@@ -1397,6 +1397,16 @@ dwarf2_get_section_info (struct objfile *objfile, const char *section_name,
   struct dwarf2_per_objfile *data
     = objfile_data (objfile, dwarf2_objfile_data_key);
   struct dwarf2_section_info *info;
+
+  /* We may see an objfile without any DWARF, in which case we just
+     return nothing.  */
+  if (data == NULL)
+    {
+      *sectp = NULL;
+      *bufp = NULL;
+      *sizep = 0;
+      return;
+    }
   if (section_is_p (section_name, EH_FRAME_SECTION))
     info = &data->eh_frame;
   else if (section_is_p (section_name, FRAME_SECTION))