btrace: temporarily set inferior_ptid in record_btrace_start_replaying
authorMarkus Metzger <markus.t.metzger@intel.com>
Wed, 26 Aug 2015 13:37:55 +0000 (15:37 +0200)
committerMarkus Metzger <markus.t.metzger@intel.com>
Fri, 18 Sep 2015 12:25:05 +0000 (14:25 +0200)
commitec71cc2fc6d319ebe4aebbe65a6a56ea1376200e
treef15a6af034afa9e4162b9e9802094935fec734f1
parent0ca912dfef6289f9d2cd7d70b7ec80883a9b4395
btrace: temporarily set inferior_ptid in record_btrace_start_replaying

Get_current_frame uses inferior_ptid.  In record_btrace_start_replaying,
we need to get the current frame of the argument thread.  So far, this
has always been inferior_ptid.  With non-stop, this is not guaranteed.

Temporarily set inferior_ptid to the ptid of the argument thread.

We already temporarily set the argument thread's executing flag to false.

Move both into a new function get_thread_current_frame that does the temporary
adjustments, calls get_current_frame, and restores the previous values.

gdb/
* record-btrace.c (get_thread_current_frame): New.
(record_btrace_start_replaying): Call get_thread_current_frame.
gdb/ChangeLog
gdb/record-btrace.c