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


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.

Andrew


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