public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] tfile_target::close: trace_fd can't be -1
Date: Sat, 11 Jan 2020 06:04:00 -0000	[thread overview]
Message-ID: <c17e02e1b55b5e9cbdc6581f05bfec96dc8436f4@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT c17e02e1b55b5e9cbdc6581f05bfec96dc8436f4 ***

commit c17e02e1b55b5e9cbdc6581f05bfec96dc8436f4
Author:     Pedro Alves <palves@redhat.com>
AuthorDate: Fri Jan 10 20:05:50 2020 +0000
Commit:     Pedro Alves <palves@redhat.com>
CommitDate: Fri Jan 10 20:05:50 2020 +0000

    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.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2d18e3e439..49501dfd4f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 1ceb03e691..977c0dab06 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 ());


             reply	other threads:[~2020-01-11  6:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-11  6:04 gdb-buildbot [this message]
2020-01-11  6:04 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot
2020-01-11  6:37 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2020-01-12 20:02 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-m32, branch master *** BREAKAGE *** gdb-buildbot
2020-01-12 20:13 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-01-12 20:39 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-01-12 21:02 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-01-12 21:02 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-01-12 21:30 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-01-12 21:30 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c17e02e1b55b5e9cbdc6581f05bfec96dc8436f4@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).