aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-01-10 20:05:50 +0000
committerPedro Alves <palves@redhat.com>2020-01-10 20:05:50 +0000
commitc17e02e1b55b5e9cbdc6581f05bfec96dc8436f4 (patch)
tree6f080d1a83ae57b3a12b1a7c246163126afbaaf3
parentab1ddbcf110a3f1ad45e3a346d2da98ffb833dec (diff)
downloadgdb-c17e02e1b55b5e9cbdc6581f05bfec96dc8436f4.zip
gdb-c17e02e1b55b5e9cbdc6581f05bfec96dc8436f4.tar.gz
gdb-c17e02e1b55b5e9cbdc6581f05bfec96dc8436f4.tar.bz2
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: 2020-01-10 Pedro Alves <palves@redhat.com> * tracefile-tfile.c (tfile_target::close): Assert that trace_fd is not -1.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/tracefile-tfile.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2d18e3e..49501df 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2020-01-10 Pedro Alves <palves@redhat.com>
+ * tracefile-tfile.c (tfile_target::close): Assert that trace_fd is
+ not -1.
+
+2020-01-10 Pedro Alves <palves@redhat.com>
+
* break-catch-sig.c (signal_catchpoint_print_it): Don't pass a
ptid to get_last_target_status.
* break-catch-syscall.c (print_it_catch_syscall): Don't pass a
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 1ceb03e..977c0da 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 ());