• 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

修订版087e161b3cd9a8626dc05ce1bdb8dfaf353a71b1 (tree)
时间2020-06-19 07:06:57
作者Pedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

Don't write to inferior_ptid in tracefile-tfile.c

gdb/ChangeLog:
2020-06-18 Pedro Alves <palves@redhat.com>

* tracefile-tfile.c (tfile_target_open): Don't write to
inferior_ptid directly, instead switch to added thread.
(tfile_target::close): Use switch_to_no_thread instead of writing
to inferior_ptid directly.

更改概述

差异

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
11 2020-06-18 Pedro Alves <palves@redhat.com>
22
3+ * tracefile-tfile.c (tfile_target_open): Don't write to
4+ inferior_ptid directly, instead switch to added thread.
5+ (tfile_target::close): Use switch_to_no_thread instead of writing
6+ to inferior_ptid directly.
7+
8+2020-06-18 Pedro Alves <palves@redhat.com>
9+
310 * procfs.c (procfs_target::attach): Don't write to inferior_ptid.
411 (procfs_target::detach): Use switch_to_no_thread
512 instead of writing to inferior_ptid directly.
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -556,8 +556,9 @@ tfile_target_open (const char *arg, int from_tty)
556556 }
557557
558558 inferior_appeared (current_inferior (), TFILE_PID);
559- inferior_ptid = ptid_t (TFILE_PID);
560- add_thread_silent (&tfile_ops, inferior_ptid);
559+
560+ thread_info *thr = add_thread_silent (&tfile_ops, ptid_t (TFILE_PID));
561+ switch_to_thread (thr);
561562
562563 if (ts->traceframe_count <= 0)
563564 warning (_("No traceframes present in this file."));
@@ -618,7 +619,7 @@ tfile_target::close ()
618619 {
619620 gdb_assert (trace_fd != -1);
620621
621- inferior_ptid = null_ptid; /* Avoid confusion from thread stuff. */
622+ switch_to_no_thread (); /* Avoid confusion from thread stuff. */
622623 exit_inferior_silent (current_inferior ());
623624
624625 ::close (trace_fd);