From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14057 invoked by alias); 25 Apr 2013 13:10:49 -0000 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 Received: (qmail 14044 invoked by uid 89); 25 Apr 2013 13:10:48 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 25 Apr 2013 13:10:47 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3PDAjSV031585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Apr 2013 09:10:45 -0400 Received: from localhost.localdomain (ovpn-116-68.ams2.redhat.com [10.36.116.68]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3PDAgnG008201; Thu, 25 Apr 2013 09:10:45 -0400 Message-ID: <51792B51.2090409@redhat.com> Date: Thu, 25 Apr 2013 13:10:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Saurabh T , gdb@sourceware.org Subject: Re: Problem calling functions within gdb (version 7.5) References: In-Reply-To: Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00085.txt.bz2 On 24/04/13 22:30, Saurabh T wrote: > Here's a simple C++ example: > 1. call fn(3, x) > 2. print k > Let's say this prints 0x7ffb24 > call fn2(0x7ffb24) > gdb again says: Cannot resolve function fn2 to any overloaded instance > This also used to work with gdb 7.2. Here I can understand if promoting ints to arbitrary pointers is no longer supported. [pmuldoon@localhost build]$ gdb --version GNU gdb (GDB) Fedora (7.5.1-37.fc18) Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: . (gdb) b 19 Breakpoint 1 at 0x4006bc: file /home/pmuldoon/pr.c, line 19. (gdb) r Starting program: /home/pmuldoon/pr 1 2 3 3 4 5 5 6 7 3 Breakpoint 1, main () at /home/pmuldoon/pr.c:19 19 return 0; (gdb) call fn(3,x) 1 2 3 3 4 5 5 6 7 (gdb) call fn2(k) 3 (gdb) p k $1 = (int *) 0x7fffffffe064 (gdb) call fn2(0x7fffffffe064) 3 So it works with my installed GDB. What architecture, and what minor version of GDB are you using (ie 7.5.x)? How did you compile the binary? I did: gcc -std=c99 ~/build/pr.c -o ~/build/pr -O0 -g3 Cheers, Phil