From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13535 invoked by alias); 12 Aug 2008 14:34:17 -0000 Received: (qmail 13526 invoked by uid 22791); 12 Aug 2008 14:34:15 -0000 X-Spam-Check-By: sourceware.org Received: from hoat.troll.no (HELO hoat.troll.no) (62.70.27.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Aug 2008 14:33:36 +0000 Received: from hoat.troll.no (tedur.troll.no [62.70.27.154]) by hoat.troll.no (Postfix) with SMTP id CFA5020819 for ; Tue, 12 Aug 2008 16:33:33 +0200 (CEST) Received: from gar.trolltech.de (gar.trolltech.de [10.4.0.24]) by hoat.troll.no (Postfix) with ESMTP id B7DC520756 for ; Tue, 12 Aug 2008 16:33:33 +0200 (CEST) From: =?iso-8859-1?q?Andr=E9_P=F6nitz?= To: gdb@sourceware.org Subject: problem with gdb's 'call' Date: Tue, 12 Aug 2008 15:30:00 -0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200808121636.43694.apoenitz@trolltech.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00161.txt.bz2 Hi all. I have a problem calling certain functions in the inferior using gdb's=20 "call" command. With gdb 6.8 and the following code compiled with g++ -g main.cpp template T foo() { return T(0); } int main() { return foo(); } I get after 'b main' and 'r': (gdb) p _Z3fooIiET_v $1 =3D {int (void)} 0x400544 ()> (gdb) call _Z3fooIiET_v() /build/buildd/gdb-6.8/gdb/valops.c:2069: internal-error: find_oload_cham= p_namespace_loop: Assertion `new_oload_champ !=3D -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()' in a way that looks acceptable to gdb. Now I have two questions:=20 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 mo= re like ns::foo((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=E9 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.