summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-01-06 14:08:56 +0000
committerPedro Alves <palves@redhat.com>2020-01-06 14:08:56 +0000
commit514ff03a6c0efe18bb75f0e68c4cce8db0474016 (patch)
treee0b4204e3050ffe7fa81db16627710fc8c759a20
parent9563d96a9be1062cfe08d05137bd66dd6c344580 (diff)
downloadbinutils-gdb-514ff03a6c0efe18bb75f0e68c4cce8db0474016.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 1ceb03e6918..977c0dab06b 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 ());