Re: [RFA] Select a particular mangling of a demangled symbol in lookup_block_symbol

Daniel Jacobowitz
2002-03-22T18:52:27Z

On Tue, Mar 19, 2002 at 05:19:41PM -0500, Elena Zannoni wrote:
> OK, approved. But I have my usual couple of questions:

Committed to trunk only; I'll move it to the branch in a week or so if
it doesn't break anything.

> Was the corresponding testsuite patch sorted out? Looks like it
> wasn't. Does this patch have any effect on the testsuite results w/o

Nope.

> the testsuite patch?

I don't believe so.

> In the above, should it be mangled_name = name or mangled_name =
> modified_name? It would seem more uniform with the rest of the
> function if we just used modified_name. Unless there is some problem
> with case sensitivity, in which case, calling cplus_demangle with
> modified_name seems wrong anyway. I.e. is it guaranteed that
> case_sensitive_off is NOT in effect? Just out of curiosity What
> would happen if the user sets the case sensitivity off?
> Wouldn't it change _ZN3fooC1ERS_ to _zn3fooc1ers_ ? (of course the user
> can always do a lot of things to screw himself up)

As far as I'm concerned - if the user sets case sensitivity off while
debugging C++, they deserve what they get. Mangling is not
case-insensitive. In fact, in v3, cplus_demangle is absolutely
guaranteed to fail (_z is not a legal prefix for a mangled name).
Perhaps it would be better to call cplus_demangle with the original
name.

> I guess what I am really asking is when is lookup_symbol called with a
> mangled name. I tried to do "break foo::foo", and I never saw it called
> with a mangled name.

find_methods will do it, in two places, at least if you're using stabs:
sym_arr[i1] = lookup_symbol (phys_name,
NULL, VAR_NAMESPACE,
(int *) NULL,
(struct symtab **) NULL);

It shouldn't do this, of course, but that requires a lot of work that I
haven't gotten to yet.

--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer