From fba3138ed54e4df55d99cf903e236a683f39004a Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 23 Jun 2003 19:51:38 +0000 Subject: [PATCH] PR gdb/1179 * dwarfread.c (struct_type): Skip static fields without crashing. --- gdb/ChangeLog | 5 +++++ gdb/dwarfread.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f35b7db8cce..4d95fff1024 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-06-22 Daniel Jacobowitz + + PR gdb/1179 + * dwarfread.c (struct_type): Skip static fields without crashing. + 2003-06-22 Andrew Cagney GDB 6.0 branch created. diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 0856b899dc5..ff65db047e9 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -979,6 +979,13 @@ struct_type (struct dieinfo *dip, char *thisdie, char *enddie, switch (mbr.die_tag) { case TAG_member: + /* Static fields can be either TAG_global_variable (GCC) or else + TAG_member with no location (Diab). We could treat the latter like + the former... but since we don't support the former, just avoid + crashing on the latter for now. */ + if (mbr.at_location == NULL) + break; + /* Get space to record the next field's data. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); new->next = list; -- 2.30.2