hurd: add gnu_target pointer to fix thread API calls
[deliverable/binutils-gdb.git] / gdb / tracefile-tfile.c
index 5c3837ec5b93f30f09b24246167e0f1d7b83985c..ea19177475179f741289353995d82cf858a78e48 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.
 
@@ -32,6 +32,7 @@
 #include "xml-tdesc.h"
 #include "target-descriptions.h"
 #include "gdbsupport/buffer.h"
+#include "gdbsupport/pathstuff.h"
 #include <algorithm>
 
 #ifndef O_LARGEFILE
@@ -470,8 +471,7 @@ tfile_target_open (const char *arg, int from_tty)
 
   gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));
   if (!IS_ABSOLUTE_PATH (filename.get ()))
-    filename.reset (concat (current_directory, "/", filename.get (),
-                           (char *) NULL));
+    filename = gdb_abspath (filename.get ());
 
   flags = O_BINARY | O_LARGEFILE;
   flags |= O_RDONLY;
@@ -557,7 +557,7 @@ 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);
+  add_thread_silent (&tfile_ops, inferior_ptid);
 
   if (ts->traceframe_count <= 0)
     warning (_("No traceframes present in this file."));
@@ -616,8 +616,7 @@ 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.  */
   exit_inferior_silent (current_inferior ());
@@ -1132,8 +1131,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.025991 seconds and 4 git commands to generate.