Change regcache list to be an hash map
[deliverable/binutils-gdb.git] / gdb / tracefile-tfile.c
index 0953b03781ff6864db1e3ae4c9fd9d90976ab6a1..fd7bab822a1223f3929044c705a35b0a6ee3b58b 100644 (file)
@@ -1,6 +1,6 @@
 /* Trace file TFILE format support in GDB.
 
-   Copyright (C) 1997-2019 Free Software Foundation, Inc.
+   Copyright (C) 1997-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -556,8 +556,9 @@ tfile_target_open (const char *arg, int from_tty)
     }
 
   inferior_appeared (current_inferior (), TFILE_PID);
-  inferior_ptid = ptid_t (TFILE_PID);
-  add_thread_silent (inferior_ptid);
+
+  thread_info *thr = add_thread_silent (&tfile_ops, ptid_t (TFILE_PID));
+  switch_to_thread (thr);
 
   if (ts->traceframe_count <= 0)
     warning (_("No traceframes present in this file."));
@@ -616,10 +617,9 @@ tfile_interp_line (char *line, struct uploaded_tp **utpp,
 void
 tfile_target::close ()
 {
-  if (trace_fd < 0)
-    return;
+  gdb_assert (trace_fd != -1);
 
-  inferior_ptid = null_ptid;   /* Avoid confusion from thread stuff.  */
+  switch_to_no_thread ();      /* Avoid confusion from thread stuff.  */
   exit_inferior_silent (current_inferior ());
 
   ::close (trace_fd);
@@ -1132,8 +1132,9 @@ tfile_append_tdesc_line (const char *line)
   buffer_grow_str (&trace_tdesc, "\n");
 }
 
+void _initialize_tracefile_tfile ();
 void
-_initialize_tracefile_tfile (void)
+_initialize_tracefile_tfile ()
 {
   add_target (tfile_target_info, tfile_target_open, filename_completer);
 }
This page took 0.027263 seconds and 4 git commands to generate.