Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: [patch] Crash on windows hosts
Date: Thu, 28 Apr 2005 02:00:00 -0000	[thread overview]
Message-ID: <200504280300.34690.paul@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

serial_fdopen can return NULL on non-unix (ie. windows) hosts. This was 
causing a segfault in print_flush.
The attached patch fixes this.

Ok?

Paul

2005-04-28  Paul Brook  <paul@codesourcery.com>

	* exceptions.c (print_flush): Handle NULL gdb_stdout_serial.

[-- Attachment #2: patch.gdb_serflush --]
[-- Type: text/x-diff, Size: 677 bytes --]

Index: gdb/exceptions.c
===================================================================
RCS file: /var/cvsroot/src-cvs/src/gdb/exceptions.c,v
retrieving revision 1.19
diff -u -p -r1.19 exceptions.c
--- gdb/exceptions.c	11 Feb 2005 18:13:49 -0000	1.19
+++ gdb/exceptions.c	28 Apr 2005 01:23:04 -0000
@@ -282,8 +282,11 @@ print_flush (void)
 
   /* 3.  The system-level buffer.  */
   gdb_stdout_serial = serial_fdopen (1);
-  serial_drain_output (gdb_stdout_serial);
-  serial_un_fdopen (gdb_stdout_serial);
+  if (gdb_stdout_serial)
+    {
+      serial_drain_output (gdb_stdout_serial);
+      serial_un_fdopen (gdb_stdout_serial);
+    }
 
   annotate_error_begin ();
 }

             reply	other threads:[~2005-04-28  2:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-28  2:00 Paul Brook [this message]
2005-04-28  3:27 ` Daniel Jacobowitz
2005-04-28  3:36   ` Christopher Faylor
2005-04-28 13:22     ` Daniel Jacobowitz
2005-04-28 14:05       ` Christopher Faylor

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=200504280300.34690.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=gdb-patches@sources.redhat.com \
    /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