From: Tom Tromey <tom@tromey.com>
To: Jan Vrany via Gdb <gdb@sourceware.org>
Cc: Jan Vrany <jan@vrany.io>
Subject: Re: MI and modifying register value
Date: Fri, 08 Sep 2023 10:53:09 -0600 [thread overview]
Message-ID: <87msxwli8a.fsf@tromey.com> (raw)
In-Reply-To: <459b4b9d5f83a6b03b66486a45f5c4e4daa0b5e7.camel@vrany.io> (Jan Vrany via Gdb's message of "Mon, 04 Sep 2023 21:41:18 +0000")
>>>>> "Jan" == Jan Vrany via Gdb <gdb@sourceware.org> writes:
Jan> 1) There's an MI command to set register value: -data-write-register-values
Jan> This command is not documented and looking at the code, seems to be somewhat
Jan> half-implemented - does not use <format> parameter its comment mentions and
Jan> only works for frame 0 (but using --frame 1 does not result in an error,
Jan> it just silently changes value in frame 0).
Jan> Is this command some leftover that should not be used (but kept for some
Jan> old clients)? Or is it something to fix?
It's very old and seems to have landed without tests or documentation.
I think the addition of 'format' here must be some kind of copy-paste
bug. I can't imagine how it would be useful. However, in the spirit of
API conservatism I think it should just be left untouched -- we can just
document that it's a mistake and clients can send whatever they like for
this argument.
Fixing the frame bug seems completely fine to me.
Jan> 2) Another way to change register value is CLI command `set r4 = 0x4`. There's
Jan> no mechanism the MI client gets notified about the change - there's no =register-changed
Jan> async event.
Surely it must be "set $r4 = 0x4" -- the "$" should be needed I think.
Jan> Is this by purpose? I'd expect some kind of notification, just like there's =memory-changed
Jan> event. Also, in Python API, there's memory_ckanged event which get triggered when
Jan> using `set` to modify register.
There's the weird "-data-list-changed-registers" command. It doesn't
really documented "changed since what", but it seems to be "since last
time this was called". There's a static local variable in the
implementation :-(
I do see there is a "register_changed" observable, so implementing the
notification seems relatively easy. This observable seems to only track
changes made by the user, though.
Tom
next prev parent reply other threads:[~2023-09-08 16:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 21:41 Jan Vrany
2023-09-08 16:53 ` Tom Tromey [this message]
2023-09-08 21:25 ` Jan Vrany
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=87msxwli8a.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb@sourceware.org \
--cc=jan@vrany.io \
/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).