/* CTF format support.
- Copyright (C) 2012-2020 Free Software Foundation, Inc.
+ Copyright (C) 2012-2022 Free Software Foundation, Inc.
Contributed by Hui Zhu <hui_zhu@mentor.com>
Contributed by Yao Qi <yao@codesourcery.com>
gdb_assert (start_pos->type == BT_SEEK_RESTORE);
trace_dirname = xstrdup (dirname);
- push_target (&ctf_ops);
+ current_inferior ()->push_target (&ctf_ops);
inferior_appeared (current_inferior (), CTF_PID);
- inferior_ptid = ptid_t (CTF_PID);
- add_thread_silent (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);
- post_create_inferior (&ctf_ops, from_tty);
+ post_create_inferior (from_tty);
}
/* This is the implementation of target_ops method to_close. Destroy
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 ();
/* module initialization */
+void _initialize_ctf ();
void
-_initialize_ctf (void)
+_initialize_ctf ()
{
#if HAVE_LIBBABELTRACE
add_target (ctf_target_info, ctf_target_open, filename_completer);