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

Michael Elizabeth Chastain
2002-02-16T00:38:45Z

Hi Daniel,

> What we really SHOULD do is set it on both constructors silently, without
> even acknowledging that they are different functions, or else offer the user
> the choice. My preference is actually for the former.

There's more grossness than that. Suppose that the constructor calls
another function foo(). Suppose the user sets a breakpoint on foo()
and looks at the stack and sees the constructor. Suppose the user looks
at the assembly code for the constructor. Suppose the user continues,
and takes the breakpoint on foo() again, and disassembles the constructor
again, and sees different assembly code for the constructor.

Games like that impair the user's trust in gdb. They start with a lie,
And they lead to endless scenarios where you have to fix things up in
order to maintain the lie.

I would prefer that the different blocks of object code with different
mangled names have different demangled names as well, such as "Foo::Foo()"
and "Foo::Foo$nic()". (I guess if the user actually names one of his
member functions Foo$nic then we are screwed ... is there any possible
name which is not legal C++ member name?)

Michael C