This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[intercu] Don't crash on unnamed enums
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 21 Feb 2004 20:36:59 -0500
- Subject: [intercu] Don't crash on unnamed enums
Made a last-minute change as I was merging the previous patch. Pity it was
wrong... we can discard simple types regardless of whether they are named,
but we can only add partial symbols for them if they are.
Committed to the intercu branch.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-02-21 Daniel Jacobowitz <drow@mvista.com>
* dwarf2read.c (load_partial_dies): Check for NULL name before
adding types.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.135.2.14
diff -u -p -r1.135.2.14 dwarf2read.c
--- dwarf2read.c 22 Feb 2004 00:56:11 -0000 1.135.2.14
+++ dwarf2read.c 22 Feb 2004 01:32:48 -0000
@@ -4572,10 +4572,11 @@ load_partial_dies (bfd *abfd, char *info
|| part_die->tag == DW_TAG_subrange_type
|| part_die->tag == DW_TAG_enumeration_type))
{
- add_psymbol_to_list (part_die->name, strlen (part_die->name),
- VAR_DOMAIN, LOC_TYPEDEF,
- &cu->objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu->language, cu->objfile);
+ if (part_die->name != NULL)
+ add_psymbol_to_list (part_die->name, strlen (part_die->name),
+ VAR_DOMAIN, LOC_TYPEDEF,
+ &cu->objfile->static_psymbols,
+ 0, (CORE_ADDR) 0, cu->language, cu->objfile);
info_ptr = locate_pdi_sibling (part_die, info_ptr, abfd, cu);
continue;
}