Re: Regression for -gstabs+ [Re: FYI: fix spelling of "delete" in c-exp.y]

Tom Tromey
2012-06-19T17:24:30Z

>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> I'll revert it and figure out a different fix.

Ok, I take that back.

I did some more debugging and I think my fix is correct.

First, abstractly, it does not make sense to try to look up a name with
a trailing space. No such symbol ever exists -- partial symbols have
the argument (and any possible space) stripped, and full symbols have
the arguments.

Second, as noted earlier, psymtab_search_name will not strip this
trailing space. (And why should it? It is invalid.)

Third, the actual failure occurs in value_struct_elt_for_reference,
in the loop over function fields:

if (t_field_name && strcmp (t_field_name, name) == 0)

Here the function field is:

(top-gdb) p t_field_name
$27 = 0x2158539 "operator delete"

But we are searching for:

(top-gdb) p name
$23 = 0x2767c10 "operator delete "

Now, arguably perhaps this spot should use strcmp_iw. However,
strcmp_iw is evil; and secondly, there ought to be no reason to do so,
because the other lookup paths ensure that the search name doesn't have
a trailing space.

I think your earlier patch was correct, but the c-exp.y part was just
not needed.

I couldn't reproduce any crashing failure using -gstabs+ with the
current tree (I tried the two .exp files you mentioned in your original
post).

So in sum, I'm leaving things as they are.

Tom