Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] [gdb] Don't flush in handle_fatal_signal
Date: Fri, 23 Oct 2026 09:38:12 +0200	[thread overview]
Message-ID: <20261023073813.2224939-3-tdevries@suse.de> (raw)
In-Reply-To: <20261023073813.2224939-1-tdevries@suse.de>

In handle_fatal_signal we use "gdb_stderr->flush ()".

In this function, we only want to use async-safe output, and flushing isn't.

Furthermore, all output is done using sig_write, which is unbuffered, so
there's nothing to flush.

Drop it.
---
 gdb/event-top.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/gdb/event-top.c b/gdb/event-top.c
index 0fb6eafec57..78683ec364f 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -1016,14 +1016,6 @@ handle_fatal_signal (int sig)
 	  sig_write (".");
 	}
       sig_write ("\n\n");
-
-      if (gdb_stderr == nullptr || gdb_stderr->fd () == -1)
-	{
-	  /* Writing to file descriptor instead of stream, no flush
-	     required.  */
-	}
-      else
-	gdb_stderr->flush ();
     }
 #endif
 
-- 
2.51.0


  parent reply	other threads:[~2026-10-23  7:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  7:38 [PATCH 0/3] [gdb] Fix backtrace in log file Tom de Vries
2026-10-23  7:38 ` [PATCH 1/3] [gdb] Fix backtrace in log file (libbacktrace case) Tom de Vries
2026-10-23  7:38 ` Tom de Vries [this message]
2026-10-23  7:38 ` [PATCH 3/3] [gdb] Fix backtrace in log file (execinfo case) Tom de Vries

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=20261023073813.2224939-3-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@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