From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24747 invoked by alias); 16 Jul 2008 12:11:09 -0000 Received: (qmail 24739 invoked by uid 22791); 16 Jul 2008 12:11:08 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 16 Jul 2008 12:10:49 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 22E72982C3; Wed, 16 Jul 2008 12:10:47 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 81B4C98200; Wed, 16 Jul 2008 12:10:46 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KJ5qH-00084K-Ba; Wed, 16 Jul 2008 08:10:45 -0400 Date: Wed, 16 Jul 2008 12:11:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: MI threads behaviour Message-ID: <20080716121045.GA30641@caradoc.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <200806181601.52404.vladimir@codesourcery.com> <20080709210311.GA18103@caradoc.them.org> <200807161551.01112.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200807161551.01112.vladimir@codesourcery.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00186.txt.bz2 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. > > > 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" -- Daniel Jacobowitz CodeSourcery