public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix gdb crash due to SIGPIPE when the compile command fails
@ 2021-06-02 17:31 Bernd Edlinger
  2021-06-02 18:21 ` Tom Tromey
  0 siblings, 1 reply; 20+ messages in thread
From: Bernd Edlinger @ 2021-06-02 17:31 UTC (permalink / raw)
  To: gdb-patches

Due to the SIGPIPE the gdb process is killed here, which is
not helpful.

2021-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* compile/compile.c (compile_to_object): Ignore SIGPIPE before calling
	the plugin.
---
 gdb/compile/compile.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 8481d14..134a077 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -755,6 +755,12 @@ struct compile_options
     fprintf_unfiltered (gdb_stdlog, "source file produced: %s\n\n",
 			fnames.source_file ());
 
+#ifdef SIGPIPE
+  /* If we don't do this, then GDB simply exits
+     when the remote side dies.  */
+  signal (SIGPIPE, SIG_IGN);
+#endif
+
   /* Call the compiler and start the compilation process.  */
   compiler->set_source_file (fnames.source_file ());
   ok = compiler->compile (fnames.object_file (), compile_debug);
-- 
1.9.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-06-15 11:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 17:31 [PATCH] Fix gdb crash due to SIGPIPE when the compile command fails Bernd Edlinger
2021-06-02 18:21 ` Tom Tromey
2021-06-02 22:19   ` Christian Biesinger
2021-06-03  5:45     ` Bernd Edlinger
2021-06-04 13:39       ` Tom Tromey
2021-06-05 11:44         ` Bernd Edlinger
2021-06-05 12:04           ` Andrew Burgess
2021-06-05 12:27             ` Bernd Edlinger
2021-06-05 14:04               ` Tom Tromey
2021-06-14 11:41           ` Rainer Orth
2021-06-14 12:57             ` Bernd Edlinger
2021-06-14 12:59               ` Rainer Orth
2021-06-14 14:36                 ` Bernd Edlinger
2021-06-14 14:39                   ` Rainer Orth
2021-06-14 15:07                 ` Tom Tromey
2021-06-15 11:10                   ` Rainer Orth
2021-06-14 15:04               ` Tom Tromey
2021-06-14 23:35         ` Pedro Alves
2021-06-15  5:14           ` Bernd Edlinger
2021-06-15 11:16             ` Pedro Alves

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).