From 6aca59a35914f39148f06d4d43f56a56c3cc4e55 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Sun, 13 Apr 2003 15:25:23 +0000 Subject: [PATCH] * minsyms.c (install_minimal_symbols): Only switch to gnu-v3 mode if the linkage name demangled successfully. --- gdb/ChangeLog | 5 +++++ gdb/minsyms.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6cb324a6b41..7d6f504e4be 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-04-13 Daniel Jacobowitz + + * minsyms.c (install_minimal_symbols): Only switch to gnu-v3 mode + if the linkage name demangled successfully. + 2003-04-13 Mark Kettenis * x86-64-tdep.c (att_flavour, intel_flavour, valid_flavours, diff --git a/gdb/minsyms.c b/gdb/minsyms.c index d8569ff2aff..1f6cb388800 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -920,8 +920,14 @@ install_minimal_symbols (struct objfile *objfile) for (i = 0; i < mcount; i++) { + /* If a symbol's name starts with _Z and was successfully + demangled, then we can assume we've found a GNU v3 symbol. + For now we set the C++ ABI globally; if the user is + mixing ABIs then the user will need to "set cp-abi" + manually. */ const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]); - if (name[0] == '_' && name[1] == 'Z') + if (name[0] == '_' && name[1] == 'Z' + && SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL) { set_cp_abi_as_auto_default ("gnu-v3"); break; -- 2.30.2