This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: fix PR gdb/2489


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]