diff options
author | Pedro Alves <palves@redhat.com> | 2020-06-18 21:28:24 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2020-06-18 23:07:35 +0100 |
commit | 5233f39b8b999f2675fb9493149e878c281e1d60 (patch) | |
tree | bf7215ab791d499f31f186d5327eab880948dcbd /gdb | |
parent | 087e161b3cd9a8626dc05ce1bdb8dfaf353a71b1 (diff) | |
download | gdb-5233f39b8b999f2675fb9493149e878c281e1d60.zip gdb-5233f39b8b999f2675fb9493149e878c281e1d60.tar.gz gdb-5233f39b8b999f2675fb9493149e878c281e1d60.tar.bz2 |
Don't write to inferior_ptid in tracectf.c
gdb/ChangeLog:
2020-06-18 Pedro Alves <palves@redhat.com>
* tracectf.c (ctf_target_open): Switch to added thread instead of
writing to inferior_ptid directly.
(ctf_target::close): Use switch_to_no_thread instead of writing to
inferior_ptid directly.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/tracectf.c | 7 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4454a58..b02a576 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2020-06-18 Pedro Alves <palves@redhat.com> + * tracectf.c (ctf_target_open): Switch to added thread instead of + writing to inferior_ptid directly. + (ctf_target::close): Use switch_to_no_thread instead of writing to + inferior_ptid directly. + +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 diff --git a/gdb/tracectf.c b/gdb/tracectf.c index 1c7003c..2c9a749 100644 --- a/gdb/tracectf.c +++ b/gdb/tracectf.c @@ -1168,8 +1168,9 @@ ctf_target_open (const char *dirname, int from_tty) push_target (&ctf_ops); inferior_appeared (current_inferior (), CTF_PID); - inferior_ptid = ptid_t (CTF_PID); - add_thread_silent (&ctf_ops, inferior_ptid); + + thread_info *thr = add_thread_silent (&ctf_ops, ptid_t (CTF_PID)); + switch_to_thread (thr); merge_uploaded_trace_state_variables (&uploaded_tsvs); merge_uploaded_tracepoints (&uploaded_tps); @@ -1187,7 +1188,7 @@ ctf_target::close () xfree (trace_dirname); trace_dirname = NULL; - inferior_ptid = null_ptid; /* Avoid confusion from thread stuff. */ + switch_to_no_thread (); /* Avoid confusion from thread stuff. */ exit_inferior_silent (current_inferior ()); trace_reset_local_state (); |