diff options
Diffstat (limited to 'gdb/gnu-v3-abi.c')
-rw-r--r-- | gdb/gnu-v3-abi.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 5321401..b1882a2 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -26,6 +26,7 @@ #include "demangle.h" #include "objfiles.h" #include "valprint.h" +#include "c-lang.h" #include "gdb_assert.h" #include "gdb_string.h" @@ -456,10 +457,8 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, LONGEST adjustment) { int i; - const char *physname; /* Search this class first. */ - physname = NULL; if (adjustment == 0) { int len; @@ -587,15 +586,24 @@ gnuv3_print_method_ptr (const gdb_byte *contents, { char *demangled_name = cplus_demangle (physname, DMGL_ANSI | DMGL_PARAMS); - if (demangled_name != NULL) + fprintf_filtered (stream, "&virtual "); + if (demangled_name == NULL) + fputs_filtered (physname, stream); + else { - fprintf_filtered (stream, "&virtual "); fputs_filtered (demangled_name, stream); xfree (demangled_name); - return; } + return; } } + else if (ptr_value != 0) + { + /* Found a non-virtual function: print out the type. */ + fputs_filtered ("(", stream); + c_print_type (type, "", stream, -1, 0); + fputs_filtered (") ", stream); + } /* We didn't find it; print the raw data. */ if (vbit) |