From: Phil Muldoon <pmuldoon@redhat.com>
To: Saurabh T <saurabh@hotmail.com>, gdb@sourceware.org
Subject: Re: Problem calling functions within gdb (version 7.5)
Date: Thu, 25 Apr 2013 13:10:00 -0000 [thread overview]
Message-ID: <51792B51.2090409@redhat.com> (raw)
In-Reply-To: <DUB123-W3379C1D5569CB0664A9923B1B50@phx.gbl>
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 <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>.
(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
next prev parent reply other threads:[~2013-04-25 13:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 21:30 Saurabh T
2013-04-25 13:10 ` Phil Muldoon [this message]
2013-04-25 13:26 ` Tom Tromey
2013-04-25 13:25 ` Tom Tromey
2013-04-25 14:24 ` Saurabh T
[not found] ` <5179472B.5020107@redhat.com>
2013-04-25 15:45 ` Saurabh T
[not found] ` <517955D3.4010101@redhat.com>
2013-04-25 16:35 ` Saurabh T
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=51792B51.2090409@redhat.com \
--to=pmuldoon@redhat.com \
--cc=gdb@sourceware.org \
--cc=saurabh@hotmail.com \
/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