From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7253 invoked by alias); 6 Feb 2006 23:52:27 -0000 Received: (qmail 7245 invoked by uid 22791); 6 Feb 2006 23:52:27 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 06 Feb 2006 23:52:26 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F6G9c-0000BU-2B; Mon, 06 Feb 2006 18:52:20 -0500 Date: Mon, 06 Feb 2006 23:52:00 -0000 From: Daniel Jacobowitz To: Andrew STUBBS Cc: Vladimir Prus , Eli Zaretskii , gdb@sources.redhat.com Subject: Re: $thread convenience variable Message-ID: <20060206235220.GC523@nevyn.them.org> Mail-Followup-To: Andrew STUBBS , Vladimir Prus , Eli Zaretskii , gdb@sources.redhat.com References: <200602031410.42115.ghost@cs.msu.su> <43E35434.4070201@st.com> <200602031610.12398.ghost@cs.msu.su> <43E36080.4080503@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43E36080.4080503@st.com> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00039.txt.bz2 On Fri, Feb 03, 2006 at 01:54:08PM +0000, Andrew STUBBS wrote: > Vladimir Prus wrote: > >Is that technically feasible? The $thread variable must be set before the > >call to bpstat_stop_status, otherwise you can't use $thread in breakpoint > >condition. Well, you can, but when evaluating breakpoint condition you'll > >use the old value of $thread, not the number of the thread where we've > >stopped. > > > >Unless cli-script.c is somehow invoked from handle_inferior_event. > > You're quite right, cli-script.c probably isn't the place to put this > stuff. It would convert it at the wrong time and wouldn't work. Somehow > I got confused with attaching command scripts to the breakpoint, not > conditions. In that case it would work. > > What I really meant to say was _like_ the ones in cli-script.c. The code > might live somewhere else. > > My point was that a (read-only) substitution might be better than a > generic convenience variable for this purpose. > > Anyway, it was just a suggestion, and, thinking about it again, it > probably would be quite difficult to get it substituted in all the right > places at all the right times without limiting its scope somehow. It ought to be able to live near the rest of the internalvar code in value.c, I expect. But you're right that this wouldn't be easy. If you want to implement the simpler version (last stopped thread), I recommend naming it something else, so that we don't get bug reports about it not following "thread". And that will leave the option of implementing "$thread" open, later. -- Daniel Jacobowitz CodeSourcery