aboutsummaryrefslogtreecommitdiff
path: root/gdb/minsyms.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-05-22 21:02:41 +0000
committerJim Blandy <jimb@codesourcery.com>2001-05-22 21:02:41 +0000
commit7ed49443c244d7a9e911f013fcdd70306a349866 (patch)
tree56908846030553982dab585658ed96f82c02130d /gdb/minsyms.c
parent506eee2253b69d1cd98c00212a57e572a74945ec (diff)
downloadfsf-binutils-gdb-7ed49443c244d7a9e911f013fcdd70306a349866.zip
fsf-binutils-gdb-7ed49443c244d7a9e911f013fcdd70306a349866.tar.gz
fsf-binutils-gdb-7ed49443c244d7a9e911f013fcdd70306a349866.tar.bz2
Add support for the GNU V3 C++ ABI.
(Includes changes by Dan Berlin.) * gnu-v3-abi.c: New file. * minsyms.c: #include "value.h" and "cp-abi.h". (install_minimal_symbols): Check the minimal symbol table for symbols that look mangled in the V3 style, and select the V3 ABI if we find any. * Makefile.in (SFILES): Add gnu-v3-abi.c. (COMMON_OBS): Add gnu-v3-abi.o. (gnu-v3-abi.o): Add new rule. (minsyms.o): Depend on $(cp_abi_h) and $(value_h).
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r--gdb/minsyms.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 7608297..0ed38d2 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -47,6 +47,8 @@
#include "symfile.h"
#include "objfiles.h"
#include "demangle.h"
+#include "value.h"
+#include "cp-abi.h"
/* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
At the end, copy them all into one newly allocated location on an objfile's
@@ -956,9 +958,24 @@ install_minimal_symbols (struct objfile *objfile)
objfile->minimal_symbol_count = mcount;
objfile->msymbols = msymbols;
+ /* Try to guess the appropriate C++ ABI by looking at the names
+ of the minimal symbols in the table. */
+ {
+ int i;
+
+ for (i = 0; i < mcount; i++)
+ {
+ const char *name = SYMBOL_NAME (&objfile->msymbols[i]);
+ if (name[0] == '_' && name[1] == 'Z')
+ {
+ switch_to_cp_abi ("gnu-v3");
+ break;
+ }
+ }
+ }
+
/* Now walk through all the minimal symbols, selecting the newly added
ones and attempting to cache their C++ demangled names. */
-
for (; mcount-- > 0; msymbols++)
SYMBOL_INIT_DEMANGLED_NAME (msymbols, &objfile->symbol_obstack);