public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom Tromey <tom@tromey.com>
Cc: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [RFC][gdb/cli] Add convenience vars _wp_old_val and _wp_val
Date: Mon, 10 Oct 2022 14:49:19 +0100	[thread overview]
Message-ID: <5cb844c2-55a6-0c76-7c60-57c3e72f9166@palves.net> (raw)
In-Reply-To: <87o7uns9oa.fsf@tromey.com>

Hi,

On 2022-10-07 8:41 p.m., Tom Tromey wrote:
> Pedro> It can't be safely used in regular CLI after the watchpoint hit is process, though,
> Pedro> given another watchpoint may trigger meanwhile.  I mean, say, in non-stop, you do:
> 
> FWIW gdb probably already has this problem with some other convenience
> variables, like $_exitcode, $_exception, $_probe_*, ...

Hmm, indeed.  Good point.

> 
> So, maybe adding one more isn't so bad.  Or maybe now is when we want to
> think of a general solution.
> 
> I'm not sure this works though:
> 
> Pedro> A way to make this safer would be to make it a convenience function instead, that
> Pedro> takes as argument the number of the watchpoint, like:
> 
> ... because it seems to me that the same watchpoint can be hit any
> number of times.

Also true.

I withdraw my suggestion then.

I guess one way to address this would be to make it so that the
values were put in the value history, with their own unique history
numbers.  Like, e.g.:

  Hardware watchpoint 2: v

  Old value ($123) = 3
  New value ($124) = 2

Not sure about that.  Maybe we can think up something better.
For some other time.

Pedro Alves

      parent reply	other threads:[~2022-10-10 13:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30  9:16 Tom de Vries
2022-09-30 15:37 ` Pedro Alves
2022-10-07 19:41   ` Tom Tromey
2022-10-08  6:11     ` Tom de Vries
2022-10-10 13:49     ` Pedro Alves [this message]

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=5cb844c2-55a6-0c76-7c60-57c3e72f9166@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).