• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修订版1e81a82ceb1c4e503e90c8b2d4441afef802df8c (tree)
时间2019-09-07 07:24:17
作者Pedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

Don't rely on inferior_ptid in record_full_wait

The multi-target patch sets inferior_ptid to null_ptid before handling
a target event, and thus before calling target_wait, in order to catch
places in target_ops::wait implementations that are incorrectly
relying on inferior_ptid (which could otherwise be a ptid of a
different target, for example). That caught this instance in
record-full.c.

Fix it by saving the last resumed ptid, and then using it in
record_full_wait_1, just like how the last "step" argument passed to
record_full_target::resume is handled too.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* record-full.c (record_full_resume_ptid): New global.
(record_full_target::resume): Set it.
(record_full_wait_1): Use record_full_resume_ptid instead of
inferior_ptid.

更改概述

差异

--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -1036,6 +1036,9 @@ record_full_base_target::async (int enable)
10361036 beneath ()->async (enable);
10371037 }
10381038
1039+/* The PTID and STEP arguments last passed to
1040+ record_full_target::resume. */
1041+static ptid_t record_full_resume_ptid = null_ptid;
10391042 static int record_full_resume_step = 0;
10401043
10411044 /* True if we've been resumed, and so each record_full_wait call should
@@ -1064,6 +1067,7 @@ static enum exec_direction_kind record_full_execution_dir = EXEC_FORWARD;
10641067 void
10651068 record_full_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
10661069 {
1070+ record_full_resume_ptid = inferior_ptid;
10671071 record_full_resume_step = step;
10681072 record_full_resumed = 1;
10691073 record_full_execution_dir = ::execution_direction;
@@ -1190,7 +1194,8 @@ record_full_wait_1 (struct target_ops *ops,
11901194 /* This is not a single step. */
11911195 ptid_t ret;
11921196 CORE_ADDR tmp_pc;
1193- struct gdbarch *gdbarch = target_thread_architecture (inferior_ptid);
1197+ struct gdbarch *gdbarch
1198+ = target_thread_architecture (record_full_resume_ptid);
11941199
11951200 while (1)
11961201 {