aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-03-03 17:33:40 +0000
committerTom Tromey <tromey@redhat.com>2011-03-03 17:33:40 +0000
commit3e2a0cee5514e0c5d2d1c6d71e504eb618e50c3b (patch)
treea9005db02c7d189e4e0f25c079da0ca8160cb82a /gdb
parent58397cb74447f384a9cc803b01b52838c6f82f6d (diff)
downloadgdb-3e2a0cee5514e0c5d2d1c6d71e504eb618e50c3b.zip
gdb-3e2a0cee5514e0c5d2d1c6d71e504eb618e50c3b.tar.gz
gdb-3e2a0cee5514e0c5d2d1c6d71e504eb618e50c3b.tar.bz2
PR gdb/12538:
* dwarf2read.c (process_psymtab_comp_unit): Handle case where DW_STRING is NULL.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/dwarf2read.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 285c01b..6a26ea4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2011-03-03 Tom Tromey <tromey@redhat.com>
+
+ PR gdb/12538:
+ * dwarf2read.c (process_psymtab_comp_unit): Handle case where
+ DW_STRING is NULL.
+
2011-03-03 Michael Snyder <msnyder@vmware.com>
* tui/tui-winsource.c (tui_update_source_window_as_is): Initialize
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index a255eef..d12028f 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3191,6 +3191,7 @@ process_psymtab_comp_unit (struct objfile *objfile,
struct attribute *attr;
CORE_ADDR best_lowpc = 0, best_highpc = 0;
struct die_reader_specs reader_specs;
+ const char *filename;
init_one_comp_unit (&cu, objfile);
back_to_inner = make_cleanup (free_stack_comp_unit, &cu);
@@ -3250,8 +3251,12 @@ process_psymtab_comp_unit (struct objfile *objfile,
/* Allocate a new partial symbol table structure. */
attr = dwarf2_attr (comp_unit_die, DW_AT_name, &cu);
+ if (attr == NULL || !DW_STRING (attr))
+ filename = "";
+ else
+ filename = DW_STRING (attr);
pst = start_psymtab_common (objfile, objfile->section_offsets,
- (attr != NULL) ? DW_STRING (attr) : "",
+ filename,
/* TEXTLOW and TEXTHIGH are set below. */
0,
objfile->global_psymbols.next,