GNU Binutils with patches for OS216
修订版 | 087e161b3cd9a8626dc05ce1bdb8dfaf353a71b1 (tree) |
---|---|
时间 | 2020-06-19 07:06:57 |
作者 | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
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.
@@ -1,5 +1,12 @@ | ||
1 | 1 | 2020-06-18 Pedro Alves <palves@redhat.com> |
2 | 2 | |
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 | + | |
3 | 10 | * procfs.c (procfs_target::attach): Don't write to inferior_ptid. |
4 | 11 | (procfs_target::detach): Use switch_to_no_thread |
5 | 12 | instead of writing to inferior_ptid directly. |
@@ -556,8 +556,9 @@ tfile_target_open (const char *arg, int from_tty) | ||
556 | 556 | } |
557 | 557 | |
558 | 558 | 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); | |
561 | 562 | |
562 | 563 | if (ts->traceframe_count <= 0) |
563 | 564 | warning (_("No traceframes present in this file.")); |
@@ -618,7 +619,7 @@ tfile_target::close () | ||
618 | 619 | { |
619 | 620 | gdb_assert (trace_fd != -1); |
620 | 621 | |
621 | - inferior_ptid = null_ptid; /* Avoid confusion from thread stuff. */ | |
622 | + switch_to_no_thread (); /* Avoid confusion from thread stuff. */ | |
622 | 623 | exit_inferior_silent (current_inferior ()); |
623 | 624 | |
624 | 625 | ::close (trace_fd); |