From: "André Pönitz" <apoenitz@trolltech.com>
To: gdb@sourceware.org
Subject: problem with gdb's 'call'
Date: Tue, 12 Aug 2008 15:30:00 -0000 [thread overview]
Message-ID: <200808121636.43694.apoenitz@trolltech.com> (raw)
Hi all.
I have a problem calling certain functions in the inferior using gdb's
"call" command.
With gdb 6.8 and the following code compiled with g++ -g main.cpp
template <class T> T foo() { return T(0); }
int main() { return foo<int>(); }
I get after 'b main' and 'r':
(gdb) p _Z3fooIiET_v
$1 = {int (void)} 0x400544 <int foo<int>()>
(gdb) call _Z3fooIiET_v()
/build/buildd/gdb-6.8/gdb/valops.c:2069: internal-error: find_oload_champ_namespace_loop:
Assertion `new_oload_champ != -1' failed.
A problem internal to GDB has been detected,
The same happens if I do a 'set print demangle off'. I thought in this case
there should be not much C++ involved, but somehow demangling seems
to be attempted anyway.
I already use the mangled name of the symbol as I did not find a way to
quote 'call foo<int>()' in a way that looks acceptable to gdb.
Now I have two questions:
How can I quote the function name such that it will be acceptable by the
gdb parser [actually the function that I'd like to call in reality looks more like
ns::foo<ns::type>((ns::type*)0x1234). I am not sure this is even 'quotable']
Is there a way to make the gdb core accept the mangled name without
attempting to demangling it (to avoid the crash)?
As usual, I am at the my wit's end and would appreciate any help ;-}
Regards,
André
PS: Stack trace would be something like
#0 0x00002b695b4ff095 in raise () from /lib/libc.so.6
#1 0x00002b695b500af0 in abort () from /lib/libc.so.6
#2 0x0000000000451635 in ?? ()
#3 0x000000000044e949 in internal_verror ()
#4 0x000000000044e9e1 in internal_error ()
#5 0x00000000004bc3b6 in ?? ()
#6 0x00000000004bc2fb in ?? ()
#7 0x00000000004bc2fb in ?? ()
#8 0x00000000004bd27f in find_overload_match ()
#9 0x00000000004b9bfe in evaluate_subexp_standard ()
#10 0x00000000004b636d in evaluate_expression ()
#11 0x00000000004c8086 in ?? ()
#12 0x000000000044d7e2 in execute_command ()
#13 0x00000000004ee04b in ?? ()
#14 0x00000000004eecdb in ?? ()
#15 0x00002b695a9cfea7 in rl_callback_read_char () from /lib/libreadline.so.5
#16 0x00000000004ee229 in ?? ()
#17 0x00000000004eccd3 in ?? ()
#18 0x00000000004ed5e8 in gdb_do_one_event ()
#19 0x00000000004ea4ab in catch_errors ()
#20 0x0000000000493876 in ?? ()
#21 0x0000000000445dc9 in ?? ()
#22 0x00000000004ea4ab in catch_errors ()
#23 0x0000000000446566 in ?? ()
at that point of time, I guess I can re-compile gdb with debug symbols
if that would help.
next reply other threads:[~2008-08-12 14:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-12 15:30 André Pönitz [this message]
2008-08-12 16:12 ` Daniel Jacobowitz
2008-08-12 21:10 ` André Pönitz
2008-08-12 22:51 ` Daniel Jacobowitz
2008-08-12 19:30 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200808121636.43694.apoenitz@trolltech.com \
--to=apoenitz@trolltech.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox