This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/8] Python: Use correct ptid in btrace recording
"Wiederhake, Tim" <tim.wiederhake@intel.com> writes:
>> > +
>> > +# Thread 1 is supposed to call func1 (), thread 2 is supposed to call
>> func2 ().
>> > +# Check that the function call history for the current thread contains
>> a call
>> > +# to the right function and does not contain a call to the wrong
>> function.
>> > +proc check_insn_for_thread { self other } {
>>
>> Need to switch current thread to "self".
>
> We want to explicitly test retrieving the recorded data from a thread
> that is not the current one.
> That's why we have two gdb.Record objects here.
>
Sorry, my comment is misleading. What I want to say is that the call
histories got from these two gdb.Record objects should be orthogonal to
current thread, so the result we got from gdb.Record should be the same
no matter which thread is current thread. We can switch current thread
to 1 and 2, and do test respectively,
foreach_with_prefix thread { 1 2 } {
gdb_test "thread $thread"
check_insn_for_thread 1 2
check_insn_for_thread 2 1
}
--
Yao (齐尧)