This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: $thread convenience variable


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]