This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: $thread convenience variable
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, gdb at sources dot redhat dot com
- Date: Fri, 3 Feb 2006 16:10:12 +0300
- Subject: Re: $thread convenience variable
- References: <drl4fn$4h8$1@sea.gmane.org> <200602031410.42115.ghost@cs.msu.su> <43E35434.4070201@st.com>
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