From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>, Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC][gdb/cli] Add convenience vars _wp_old_val and _wp_val
Date: Sat, 8 Oct 2022 08:11:59 +0200 [thread overview]
Message-ID: <2e3deaf2-3896-9db8-8144-c62bb669921f@suse.de> (raw)
In-Reply-To: <87o7uns9oa.fsf@tromey.com>
On 10/7/22 21:41, 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_*, ...
>
> 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.
I wondered if we can side-step the issue by defining the variable only
during watchpoint_check, and undefining it immediately afterwards.
Thanks,
- Tom
next prev parent reply other threads:[~2022-10-08 6:12 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 [this message]
2022-10-10 13:49 ` Pedro Alves
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=2e3deaf2-3896-9db8-8144-c62bb669921f@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
--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).