diff options
author | Pedro Alves <palves@redhat.com> | 2019-09-06 22:54:12 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-09-06 23:31:05 +0100 |
commit | dbec2282eb4b89f21c96a14ec9ab6670ba4e6ea7 (patch) | |
tree | 075640ce5fa9a5670212408d26322c7f1d3c4fbd | |
parent | f5725086fcb3cc9297d8682cc6ccb1f75a6a2516 (diff) | |
download | binutils-gdb-dbec2282eb4b89f21c96a14ec9ab6670ba4e6ea7.tar.gz |
tfile_target::close: trace_fd can't be -1
It's not possible to open a tfile target with an invalid trace_fd, and
it's not possible to close a closed target, so this early return is dead.
gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>
* tracefile-tfile.c (tfile_target::close): Assert that trace_fd is
not -1.
-rw-r--r-- | gdb/tracefile-tfile.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c index 5c3837ec5b9..c5063e66b02 100644 --- a/gdb/tracefile-tfile.c +++ b/gdb/tracefile-tfile.c @@ -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 ()); |