This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: fix PR gdb/2489
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 02 Feb 2009 18:36:18 -0700
- Subject: Re: RFA: fix PR gdb/2489
- References: <m3y73gy2c5.fsf@fleche.redhat.com> <200810212324.38183.pedro@codesourcery.com> <m3hc3cmj25.fsf@fleche.redhat.com> <200902030121.48729.pedro@codesourcery.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> Oh, sorry, I guess I wasn't clear. I meant after the
Pedro> type_name_no_tag call, at the strcmp line.
Oh, you were plenty clear -- I just misunderstood.
Pedro> I mainly asked due to this:
Pedro> /* Return a typename for a struct/union/enum type without "struct ",
Pedro> "union ", or "enum ". If the type has a NULL name, return NULL. */
Pedro> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pedro> char *
Pedro> type_name_no_tag (const struct type *type)
[...]
Pedro> I don't know if that can happen here. That was also the reason I
Pedro> suggested an annonymous struct/class test.
I looked at the anonymous test struct case and I see:
(top) p type_name
$2 = 0x8fa3f1e "<anonymous struct>"
However, this appears to come from g++:
<2><361>: Abbrev Number: 33 (DW_TAG_structure_type)
<362> DW_AT_name : (indirect string, offset: 0x172): <anonymous struct>
I seem to recall that this is actually a change in g++.
I tried with an older g++ and the dwarf says:
<2><58b>: Abbrev Number: 29 (DW_TAG_structure_type)
DW_AT_sibling : <5ab>
DW_AT_name : ._0
... which just seems weird.
Anyway, I suspect that you are correct, and we could see a NULL here,
but I don't know how to make it happen. I will add a check for NULL
here tomorrow.
Tom