From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: Gaius Mulley <gaius@glam.ac.uk>,
Sandeep222 <sandeep.srikumar@honeywell.com>,
"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: How to store function-name and its return values while program runs
Date: Fri, 21 Nov 2008 22:11:00 -0000 [thread overview]
Message-ID: <8ac60eac0811211410s2196e9a1g28c824850b222bf6@mail.gmail.com> (raw)
In-Reply-To: <4927062C.4020806@vmware.com>
On Fri, Nov 21, 2008 at 11:04 AM, Michael Snyder <msnyder@vmware.com> wrote:
> (gdb) break function1
> (gdb) commands
>> finish
>> continue
>> end
> (gdb)
I wished many times that above worked, but it doesn't: 'finish'
appears to interrupt flow of script, and subsequent commands are
never executed:
cat t.c
int foo() { return 42; }
int main() { return foo(); }
gcc -g t.c
gdb64-cvs ./a.out
GNU gdb (GDB) 6.8.50.20081118-cvs
Copyright (C) 2008 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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) b foo
Breakpoint 1 at 0x400310: file t.c, line 1.
(gdb) commands 1
>finish
>print/a $pc
>continue
>end
(gdb) r
Breakpoint 1, foo () at t.c:1
1 int foo() { return 42; }
0x0000000000400325 in main () at t.c:2
2 int main() { return foo(); }
Value returned is $1 = 42
# Neither 'print/a $pc' nor 'continue' executed :(
(gdb) q
Is this a bug?
--
Paul Pluzhnikov
next prev parent reply other threads:[~2008-11-21 22:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-21 10:36 Sandeep222
2008-11-21 11:02 ` Gaius Mulley
2008-11-21 19:05 ` Michael Snyder
2008-11-21 22:11 ` Paul Pluzhnikov [this message]
2008-11-21 22:29 ` Joel Brobecker
2008-11-22 0:48 ` Michael Snyder
2008-11-22 0:59 ` Joel Brobecker
2008-11-22 0:47 ` Michael Snyder
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=8ac60eac0811211410s2196e9a1g28c824850b222bf6@mail.gmail.com \
--to=ppluzhnikov@google.com \
--cc=gaius@glam.ac.uk \
--cc=gdb@sourceware.org \
--cc=msnyder@vmware.com \
--cc=sandeep.srikumar@honeywell.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