From: Tom Tromey <tromey@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [RFC] MI notification on register changes
Date: Thu, 01 Nov 2012 20:48:00 -0000 [thread overview]
Message-ID: <87lielqcba.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1350977008-28632-1-git-send-email-yao@codesourcery.com> (Yao Qi's message of "Tue, 23 Oct 2012 15:23:28 +0800")
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> User can type command in console 'set $reg = foo' to modify register.
Yao> The modification may not really happen in registers, because register
Yao> is already saved in frame, and modification really goes to memory (frame).
Yao> The new MI notification this patch adds is about 'register change' from
Yao> user's point of view, instead of from machine's point of view.
Yao> Usually, MI frontend has a 'register view' to show the contents of
Yao> registers. When users modify registers on a certain frame, this
Yao> notification is useful to tell MI frontend to refresh its 'register
Yao> view'.
This all seems reasonable to me.
Yao> This patch also extends the usage of field 'regnum' of 'struct value'.
Yao> Originally, this field is used to store the register number if content
Yao> is from register. With this patch, this field also store the register
Yao> number if it "presents" a register. For example, on non-innermost
Yao> frame, the value "reg" may be from memory instead of register.
Yao> set $reg = foo
The register may be stored in memory, but it this case really ever
represented as lval_memory in gdb? I thought the reason for
value::frame_id was to represent the notion of "register in a specific
frame", and that all registers are represented as lval_register.
Yao> +proc test_register_change { } { with_test_prefix "simple" {
For new tests I would prefer correct indentation. That is,
with_test_prefix on its own line. I think the existing tests are
written in this funny way to avoid a massive reindentation, but that
isn't a factor here.
Yao> +++ b/gdb/valops.c
Yao> @@ -1217,6 +1217,7 @@ value_assign (struct value *toval, struct value *fromval)
Yao> + /* Figure out which frame this is in currently. */
Yao> + frame = frame_find_by_id (VALUE_FRAME_ID (toval));
Yao> +
I find it pretty hard to convince myself that moving this out of the
switch can't cause some obscure problem.
How about hoisting the declaration of frame, initializing it to NULL,
and then changing this:
Yao> + if (VALUE_REGNUM (toval) >= 0)
Yao> + observer_notify_register_changed (VALUE_REGNUM (toval), frame,
Yao> + inferior_ptid,
Yao> + value_contents (val));
... to read 'if (frame != NULL)'?
Tom
next prev parent reply other threads:[~2012-11-01 20:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 7:24 Yao Qi
2012-11-01 0:36 ` ping: " Yao Qi
2012-11-01 20:48 ` Tom Tromey [this message]
2012-11-02 9:56 ` Yao Qi
2012-11-02 16:42 ` Tom Tromey
2012-11-05 10:26 ` Yao Qi
2012-11-05 20:10 ` Tom Tromey
2012-11-06 6:05 ` Yao Qi
2012-11-06 20:00 ` André Pönitz
2012-11-07 15:35 ` Marc Khouzam
2012-11-07 17:01 ` Pedro Alves
2012-11-07 18:18 ` Marc Khouzam
2012-11-07 18:54 ` Tom Tromey
2012-11-07 21:09 ` André Pönitz
2012-11-09 1:47 ` Yao Qi
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=87lielqcba.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.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