aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarfread.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-06-23 19:51:38 +0000
committerDaniel Jacobowitz <drow@false.org>2003-06-23 19:51:38 +0000
commitfba3138ed54e4df55d99cf903e236a683f39004a (patch)
tree4ad9d5e2a4374833be7bab82985ce152cff5d429 /gdb/dwarfread.c
parent041340adcdda7ff4d75f0183907a66de90a79fe1 (diff)
downloadgdb-fba3138ed54e4df55d99cf903e236a683f39004a.zip
gdb-fba3138ed54e4df55d99cf903e236a683f39004a.tar.gz
gdb-fba3138ed54e4df55d99cf903e236a683f39004a.tar.bz2
PR gdb/1179
* dwarfread.c (struct_type): Skip static fields without crashing.
Diffstat (limited to 'gdb/dwarfread.c')
-rw-r--r--gdb/dwarfread.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index 0856b89..ff65db0 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;