From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22978 invoked by alias); 3 Feb 2006 13:10:30 -0000 Received: (qmail 22966 invoked by uid 22791); 3 Feb 2006 13:10:30 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Feb 2006 13:10:29 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1F50hl-0002Jp-Pn for gdb@sources.redhat.com; Fri, 03 Feb 2006 16:10:26 +0300 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1F50hY-0002JF-Vn; Fri, 03 Feb 2006 16:10:12 +0300 From: Vladimir Prus To: Andrew STUBBS Subject: Re: $thread convenience variable Date: Fri, 03 Feb 2006 13:10:00 -0000 User-Agent: KMail/1.7.2 Cc: Eli Zaretskii , gdb@sources.redhat.com References: <200602031410.42115.ghost@cs.msu.su> <43E35434.4070201@st.com> In-Reply-To: <43E35434.4070201@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602031610.12398.ghost@cs.msu.su> 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/msg00022.txt.bz2 On Friday 03 February 2006 16:01, Andrew STUBBS wrote: > Vladimir Prus wrote: > > With it, the $thread variable will mean the last thread where we've > > stopped, as opposed to the current one -- that is, does not change after > > "thread XXX" command. This might be confusing to users, or might not. > > It might be better to do this in cli-script.c in the same way as > $arg0-$arg9 and $argc. That way it would always be up to date and would > be read-only. 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. - Volodya