X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Ftracefile-tfile.c;h=977c0dab06b0c8b94867ea7538060d469f668b79;hb=c17e02e1b55b5e9cbdc6581f05bfec96dc8436f4;hp=593556a8ba8935da475909fb6d82b57f2c15015d;hpb=eedc3f4f0a02c9774277bd1a34aab6ebdc32f797;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c index 593556a8ba..977c0dab06 100644 --- a/gdb/tracefile-tfile.c +++ b/gdb/tracefile-tfile.c @@ -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. @@ -20,8 +20,8 @@ #include "defs.h" #include "tracefile.h" #include "readline/tilde.h" -#include "common/filestuff.h" -#include "common/rsp-low.h" /* bin2hex */ +#include "gdbsupport/filestuff.h" +#include "gdbsupport/rsp-low.h" /* bin2hex */ #include "regcache.h" #include "inferior.h" #include "gdbthread.h" @@ -31,7 +31,8 @@ #include "remote.h" #include "xml-tdesc.h" #include "target-descriptions.h" -#include "common/buffer.h" +#include "gdbsupport/buffer.h" +#include "gdbsupport/pathstuff.h" #include #ifndef O_LARGEFILE @@ -43,7 +44,8 @@ static const target_info tfile_target_info = { "tfile", N_("Local trace dump file"), - N_("Use a trace file as a target. Specify the filename of the trace file.") + N_("Use a trace file as a target.\n\ +Specify the filename of the trace file.") }; class tfile_target final : public tracefile_target @@ -469,8 +471,7 @@ tfile_target_open (const char *arg, int from_tty) gdb::unique_xmalloc_ptr 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; @@ -615,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 ());