Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Steve Rodrigues <steverod@netapp.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] Indirect access to GDB history variables
Date: Fri, 15 Dec 2006 08:43:00 -0000	[thread overview]
Message-ID: <u3b7hy2g6.fsf@gnu.org> (raw)
In-Reply-To: <20061215024050.GA8750@linden.netapp.com> (message from Steve 	Rodrigues on Thu, 14 Dec 2006 18:40:50 -0800)

> Date: Thu, 14 Dec 2006 18:40:50 -0800
> From: Steve Rodrigues <steverod@netapp.com>
> Cc: Steve Rodrigues <steverod@netapp.com>
> 
> New Feature for GDB: Programmatic access to the value history.
> 
> Problem Description: Our company has a wide variety of GDB scripts used to 
> analyze problems within core files. Many of these scripts will generate values
> that are useful to probe into later; however, the scripts will generate a LOT
> of values, or values that aren't in sequential order (you care about, say,
> every third value). GDB only lets you reference previous history value either
> with absolute numbers ($10, $236) or with reference to the most recently printed value ($$, $$9, etc). It sure would be nice if there was a way to be able to
> access the value history by indirecting through a variable.

Why can't you put the values you are interested in into a named
variable, like $foo, and use that?

> Feature: This patch enables users to programmatcially access the value history
> through a GDB variable, by overloading the "$$" construct to contain a variable
> name. For example, if my script had printed out values $10-$27, but only every
> 3rd one was interesting (it was a pointer I wished to examine further), I could
> do the following:
> 
> 	set $i=10
> 	while ($i < 28)
> 		p *$$i
> 		set $i+= 3
> 	end
> 
> ... and I'd see values of $10, $13, $16 and so on. This makes it easier to
> compose scripts together when debugging.

Thanks.

If this patch is accepted, I will request you to write a patch for
the manual to describe this feature.  It should also be mentioned in
NEWS.


  reply	other threads:[~2006-12-15  8:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-15  2:41 Steve Rodrigues
2006-12-15  8:43 ` Eli Zaretskii [this message]
2006-12-16 17:10 ` Daniel Jacobowitz
2006-12-16 18:40   ` Eli Zaretskii
2006-12-16 18:45     ` Daniel Jacobowitz
2006-12-16 19:43       ` Eli Zaretskii
2006-12-18  5:46       ` Steve Rodrigues
2006-12-18 13:40         ` Daniel Jacobowitz
     [not found] <20061215182551.GA10789@siml11.eng.netapp.com>
2006-12-16  9:34 ` Eli Zaretskii

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=u3b7hy2g6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=steverod@netapp.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