From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [MI non-stop 10/11] Skip varobj in running threads.
Date: Fri, 11 Jul 2008 19:07:00 -0000 [thread overview]
Message-ID: <200807112307.26477.vladimir@codesourcery.com> (raw)
In-Reply-To: <20080711135335.GF2651@caradoc.them.org>
On Friday 11 July 2008 17:53:35 Daniel Jacobowitz wrote:
> On Sat, Jun 28, 2008 at 09:00:06PM +0400, Vladimir Prus wrote:
> >
> > If a variable object is bound to a specific thread, and we're doing
> >
> > -var-update *
> >
> > and varobj's thread is running, we cannot update varobj -- so we skip it.
> > Will commit when core non-stop is in.
>
> I think this needs to go in the manual. Would it be helpful to
> indicate to the front end that a variable could not be updated due to
> a running thread?
Possibly -- the frontend may want to decorate varobj from running threads
in specific ways. OTOH, until non-stop frontends actually appear, we don't
know exact requirements, so I'd prefer to introduce bare minimum -- which
is not falling over trying evaluate expressions in running threads.
> If a varobj is bound to a particular thread that usually means it's
> bound to a particular frame, right?
Yes. Assuming non-always-a-thread targets do not exist, varobj is bound to a
particular thread if and only if it's bound to some frame.
> In which case reading it while
> the target is running doesn't make (much) sense, so there's nothing
> target specific about this.
Right. Even if target can technically access memory of a running thread,
there's no way to evaluate such a varobj since we don't have no stack.
> > + if (thread_id == 0 && is_executing (inferior_ptid))
> > + thread_running = 1;
> > + else if (thread_id > 0)
> > + {
> > + struct thread_info *tp = find_thread_id (thread_id);
> > + if (tp)
> > + thread_running = is_running (tp->ptid);
> > + }
>
> Why is_running in one place and is_executing in the other?
It's a mistake, should be is_running.
> Should we try reading from something besides inferior_ptid for unbound
> varobjs?
The current MI/non-stop design assumes that commands are executed in a
specific thread. If it's running, and command needs to access target, we get
an error. This is more predictable than picking random thread. Some targets,
like break, can implicitly use the current frame, and switching to random
thread will make them behave erratically.
- Volodya
next prev parent reply other threads:[~2008-07-11 19:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-28 17:22 Vladimir Prus
2008-07-11 13:53 ` Daniel Jacobowitz
2008-07-11 19:07 ` Vladimir Prus [this message]
2008-07-11 13:57 ` Pedro Alves
2008-07-11 14:02 ` Daniel Jacobowitz
2008-07-13 5:34 ` Vladimir Prus
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=200807112307.26477.vladimir@codesourcery.com \
--to=vladimir@codesourcery.com \
--cc=gdb-patches@sources.redhat.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