From: Pedro Alves <palves@redhat.com>
To: Don Breazeal <donb@codesourcery.com>,
gdb-patches@sourceware.org, andrew.burgess@embecosm.com
Subject: Re: [PATCH v2] Fix -var-update for registers in frames 1 and up
Date: Wed, 10 Aug 2016 15:49:00 -0000 [thread overview]
Message-ID: <5e305a9a-5582-a2e9-240d-48845ac903d6@redhat.com> (raw)
In-Reply-To: <1465854882-42527-1-git-send-email-donb@codesourcery.com>
On 06/13/2016 10:54 PM, Don Breazeal wrote:
> The fix is to change the initialization of innermost_block in
> varobj_create from NULL to the global block, as returned by
> block_global_block.
Hmm, this sounds questionable to me. innermost_block is an output
parameter, after all. parse_exp_1 already takes an input block
parameter.
> Then varobj_create sets varobj->root->frame for register varobjs, and
> value_of_root_1 can check for the global block when determining
> whether the variable is in-scope and select the frame appropriately.
>
> A side-effect of this change is that for register varobjs and some
> global variable varobjs, the output of -var-create now includes the
> thread-id field. The rationale for this is as follow: if we ask for
> a particular expression in a particular frame, that implies a
> particular thread. Thus including the thread-id is correct behavior,
> and the test results have been updated accordingly.
Sounds OK for register varobjs, but it's not as clear for global
variable varobjs.
I see no way to tell -var-create to create a global variable fixed
varobj that is _not_ associated with a particular thread:
-var-create {name | "-"} {frame-addr | "*" | "@"} expression
The docs say:
If an expression specified when creating a fixed variable object
refers to a local variable, the variable object becomes bound to
the thread and frame in which the variable object is created. When such
variable object is updated, GDB makes sure that the thread/frame combination
the variable object is bound to still exists, and re-evaluates the variable
object in context of that thread/frame.
So if the expression needed a frame, then it gets bound to
the frame/thread. But if it didn't, then it won't, by my reading?
I worry about whether this might break frontends.
In principle, this sounds similar to watchpoints -- those also
need to check whether the original expression is still in scope,
for the case of watchpoints on local variables.
See update_watchpoint.
I'm still trying to wrap my head around all this, and I need to
read the varobj code to understand how this all works.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-08-10 15:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 21:37 [PATCH] " Don Breazeal
2016-06-08 13:01 ` Andrew Burgess
2016-06-08 13:09 ` Andrew Burgess
2016-06-09 0:48 ` Don Breazeal
2016-06-09 18:23 ` Don Breazeal
[not found] ` <20160610103220.GJ26734@embecosm.com>
2016-06-10 21:25 ` Don Breazeal
2016-06-13 9:05 ` Andrew Burgess
2016-06-13 21:54 ` [PATCH v2] " Don Breazeal
2016-06-20 15:32 ` [PING] " Don Breazeal
2016-07-11 14:48 ` Don Breazeal
2016-07-20 21:07 ` Don Breazeal
2016-07-21 16:59 ` Don Breazeal
2016-07-29 16:13 ` [PING^4] " Don Breazeal
2016-08-05 18:22 ` [PING] " Don Breazeal
2016-08-10 15:49 ` Pedro Alves [this message]
2016-10-04 20:56 ` [PATCH v3] PR mi/20395 - " Don Breazeal
2016-10-05 14:18 ` Pedro Alves
2016-10-07 0:05 ` Andrew Burgess
2016-10-14 16:59 ` Don Breazeal
2016-10-26 18:04 ` [PING] " Don Breazeal
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=5e305a9a-5582-a2e9-240d-48845ac903d6@redhat.com \
--to=palves@redhat.com \
--cc=andrew.burgess@embecosm.com \
--cc=donb@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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