Re: [RFA] fix disassemble foo::bar::~bar

Keith Seitz
2013-02-21T23:58:15Z

On 02/21/2013 01:14 PM, Tom Tromey wrote:
> I wonder what would happen if we just removed destructor_name_p,
> or alternatively made it work by examining the type's function fields,
> looking for a match.

You jogged my memory...

Another option is to use the c++ name parser:

diff --git a/gdb/valops.c b/gdb/valops.c
index 93c09d8..b006b49 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3160,7 +3160,7 @@ destructor_name_p (const char *name, struct type
*type)
{
if (name[0] == '~')
{
- const char *dname = type_name_no_tag_or_error (type);
+ const char *dname = cp_func_name (type_name_no_tag_or_error (type));
const char *cp = strchr (dname, '<');
unsigned int len;

The above patch fixes Doug's test cases and also is regression-free on
native x86_64-unknown-linux (Fedora 15).

[I note that "print foo::bar::~bar" also didn't work for the same reason.]

Keith