Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Gaius Mulley <gaius@glam.ac.uk>
Cc: 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 19:05:00 -0000	[thread overview]
Message-ID: <4927062C.4020806@vmware.com> (raw)
In-Reply-To: <87skpl1gy7.fsf@j228-gm.comp.glam.ac.uk>

Gaius Mulley wrote:
> Sandeep222 <sandeep.srikumar@honeywell.com> writes:
> 
>> As we proceed with debugging a program, if I need to know the order of
>> functions being executed by printing on screen along with their return
>> values when a 'run' command or 'next' command is executed, how can i
>> proceed? I went thru frame.c but all the function seem to execute only when
>> a command is executed in the gdb. Plz help. 
>> Reg, 
>> Sandeep
> 
> set a breakpoint at each of the functions of interest.
> 
> (gdb) break function1
> (gdb) break function2
> 
> etc
> 
> now run the program
> 
> (gdb) run
> 
> when gdb hits a breakpoint you can finish the function and
> print the result via:
> 
> (gdb) fin

And indeed, you can make that automatic by attaching the
commands to the breakpoints:

(gdb) break function1
(gdb) commands
 > finish
 > continue
 > end
(gdb)


  reply	other threads:[~2008-11-21 19:05 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 [this message]
2008-11-21 22:11     ` Paul Pluzhnikov
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=4927062C.4020806@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gaius@glam.ac.uk \
    --cc=gdb@sourceware.org \
    --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