summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2019-09-06 22:54:12 +0100
committerPedro Alves <palves@redhat.com>2019-09-06 23:31:05 +0100
commitdbec2282eb4b89f21c96a14ec9ab6670ba4e6ea7 (patch)
tree075640ce5fa9a5670212408d26322c7f1d3c4fbd
parentf5725086fcb3cc9297d8682cc6ccb1f75a6a2516 (diff)
downloadbinutils-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.c3
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 ());