This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
warning: RTTI symbol not found for class
- From: ali_anwar <ali_anwar at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>, <keiths at redhat dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Wed, 21 Nov 2012 23:06:22 +0500
- Subject: warning: RTTI symbol not found for class
Hi,
While debugging a cpp demo (containing the std::cout call) when I issue
"p std::cout", I get following warning: "warning: RTTI symbol not found
for class 'std::ostream'".
Even after setting the print object off.
set print object off
p std::cout
$4 = warning: RTTI symbol not found for class 'std::ostream'
Attached patch is a work around for it.
I also came across following mail thread:
http://www.sourceware.org/ml/gdb-patches/2011-08/msg00474.html
I have verified that this work around also works for the bug 1266
mentioned in the mail:
b calltest(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >)
Breakpoint 11 at 0x1d58: file ../src/cpp_.cpp, line 5.
b calltest(foo)
Note: breakpoint 11 also set at pc 0x1d58.
Breakpoint 12 at 0x1d58: file ../src/cpp_.cpp, line 5.
b calltest(std::string)
Note: breakpoints 11 and 12 also set at pc 0x1d58.
Breakpoint 13 at 0x1d58: file ../src/cpp_.cpp, line 5.
Do we have any fix for this issue if not then is it ok to have this work
around until we get a proper fix?
I have not added the DMGL_VERBOSE to dwarf2_physname and
lookup_symbol_in_language as I saw the Keith's mail thread after testing
my patch. Also as I have not seen that part of the code (I thought to
share the patch before doing so) so I am not sure why its going to be
useful to have DMGL_VERBOSE added there.
Thanks,
-Ali
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.14849
diff -u -r1.14849 ChangeLog
--- ChangeLog 21 Nov 2012 14:09:03 -0000 1.14849
+++ ChangeLog 21 Nov 2012 16:38:10 -0000
@@ -1,3 +1,7 @@
+2012-11-21 Ali Anwar <ali_anwar@codesourcery.com>
+
+ * gdbtypes.c (symbol_find_demangled_name): Add DMGL_VERBOSE.
+
2012-11-21 Yao Qi <yao@codesourcery.com>
PR tdep/7438
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.323
diff -u -r1.323 symtab.c
--- symtab.c 20 Nov 2012 22:51:04 -0000 1.323
+++ symtab.c 21 Nov 2012 16:38:12 -0000
@@ -593,7 +593,7 @@
|| gsymbol->language == language_auto)
{
demangled =
- cplus_demangle (mangled, DMGL_PARAMS | DMGL_ANSI);
+ cplus_demangle (mangled, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE);
if (demangled != NULL)
{
gsymbol->language = language_cplus;