Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb@sources.redhat.com
Subject: Re: MI threads behaviour
Date: Wed, 16 Jul 2008 12:52:00 -0000	[thread overview]
Message-ID: <200807161652.24626.vladimir@codesourcery.com> (raw)
In-Reply-To: <20080716121045.GA30641@caradoc.them.org>

On Wednesday 16 July 2008 16:10:45 Daniel Jacobowitz wrote:
> On Wed, Jul 16, 2008 at 03:51:00PM +0400, Vladimir Prus wrote:
> > On Thursday 10 July 2008 01:03:11 Daniel Jacobowitz wrote:
> > > On Wed, Jun 18, 2008 at 04:01:52PM +0400, Vladimir Prus wrote:
> > > > The CLI behaviour of setting GDB current thread to invalid value if the
> > > > current thread exits will be preserved, but is of limited value, since 
> > > > the frontend does not depend on current thread directly, and will be notified
> > > > about thread exit anyway. Therefore, no notification will be emitted in
> > > > this case.
> > > 
> > > What about in all-stop mode, where the CLI behavior is to change to a
> > > new event thread?
> > 
> > We're talking about thread exit here -- does CLI automatically switch to a non-dead
> > thread when the current one exits? If so, then the notification would have to
> > be emitted, too.
> 
> It doesn't do anything when the thread exits - it's blocked in wait.
> But at the next stop it will select the event thread.

Does this happen in non-stop? Anyway, thread selections due to stop in all-stop
mode all result in notification.

> > > > The notification will be emitted even if the thread user requested to be
> > > > selected is the same as currently selected thread. Imagine the frontend
> > > > has two windows open -- in one, UI has thread 1 selected, and in another,
> > > > UI has thread 2 selected. If user types "thread 2" in GDB console in the
> > > > first window, would expect the first window UI to switch to thread 2. So,
> > > > the notification should be emitted even if GDB current thread is 2, 
> > > > already.
> > > 
> > > I don't understand the need for this.  If you're going to let the user
> > > type a CLI command, then before you can do that you have to make sure
> > > GDB and the UI are synchronized on the current thread/frame.
> > > Otherwise "backtrace" or "thread" won't work.
> > 
> > What is "synchronized"? You don't need to emit -thread-select, since there's
> > --thread, and what I mean is that if have a window where UI's selected thread
> > is 1, and you type "thread 2" in console, and frontend sends
> > 
> >    -interpreter-exec --thread 1 "thread 2"
> > 
> > then one should get
> > 
> >    =thread-selected,id="2"
> > 
> > regardless of what inferior_ptid was immediately before this command is processed.
> 
> You'd get a notification there but only because we changed from thread
> 1 to thread 2 inside the command.  For the purposes of that command,
> the "currently selected thread" is thread 1.
> This is the command I don't think should get a notification:
> 
>   -thread-select 2
>   -interpreter-exec --thread 1 console "thread 1"

Why? Is it guaranteed that whenever CLI command is executed, the value to
the 'thread' option is equal to whatever is current for UI? 

- Volodya


  reply	other threads:[~2008-07-16 12:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-18 12:02 Vladimir Prus
2008-07-08  5:29 ` Vladimir Prus
2008-07-09 21:03 ` Daniel Jacobowitz
2008-07-10 13:14   ` Marc Khouzam
2008-07-14 15:56     ` Pawel Piech
2008-07-14 16:04       ` Marc Khouzam
2008-07-14 20:27         ` Pawel Piech
2008-07-16 11:51   ` Vladimir Prus
2008-07-16 12:11     ` Daniel Jacobowitz
2008-07-16 12:52       ` Vladimir Prus [this message]
2008-07-16 13:08         ` Daniel Jacobowitz
2008-07-16 13:23           ` Vladimir Prus
2008-07-16 13:33             ` Daniel Jacobowitz

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=200807161652.24626.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb@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