Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro_alves@portugalmail.pt>
To: gdb-patches@sourceware.org
Subject: Re: [gdbserver/win32]: Ignore OUTPUT_DEBUG_STRING_EVENT events 	when  remote  is not connected.
Date: Sun, 08 Jul 2007 14:45:00 -0000	[thread overview]
Message-ID: <4690F4C8.10704@portugalmail.pt> (raw)
In-Reply-To: <20070708034833.GA18642@caradoc.them.org>

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

Daniel Jacobowitz wrote:
> On Sun, Jul 08, 2007 at 02:01:14AM +0100, Pedro Alves wrote:
>> Hi,
>>
>> OUTPUT_DEBUG_STRING_EVENT events can happen from after the inferior
>> is created, until it is stopped at the initial breakpoint, waiting
>> for gdb.  The OUTPUT_DEBUG_STRING_EVENT handler doesn't currently
>> check if a remote connection is open before sending data, generating
>> annoying putpkt error logs to gdbserver's console.  This
>> patch fixes it by simply ignoring those events when there isn't any
>> gdb connected yet.  I didn't use server_wait, because this event
>> is also handled in win32_kill, outside of a wait.
> 
> But don't you want to discard it if you're outside of a wait?  I don't
> see how GDB would display them otherwise; remote_wait handles the 'O'
> response.
> 

I woke up this morning hoping you still hadn't looked at this
path yet.  :)  Sorry for the extra review work.

Here goes a new version using server_waiting.  If you don't mind, I would
like to keep the option to see the outputs in debug mode.  I've had a use
for it in the past.

Cheers,
Pedro Alves




[-- Attachment #2: outputdebugstring_no_server_waiting.diff --]
[-- Type: text/x-diff, Size: 755 bytes --]

2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>

	* win32-low.c (handle_output_debug_string): Ignore event if not	waiting.

---
 gdb/gdbserver/win32-low.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Index: src/gdb/gdbserver/win32-low.c
===================================================================
--- src.orig/gdb/gdbserver/win32-low.c	2007-07-08 15:14:56.000000000 +0100
+++ src/gdb/gdbserver/win32-low.c	2007-07-08 15:27:26.000000000 +0100
@@ -568,7 +568,15 @@ handle_output_debug_string (struct targe
     }
 
   if (strncmp (s, "cYg", 3) != 0)
-    monitor_output (s);
+    {
+      if (!server_waiting)
+	{
+	  OUTMSG2(("%s", s));
+	  return;
+	}
+
+      monitor_output (s);
+    }
 #undef READ_BUFFER_LEN
 }
 


  reply	other threads:[~2007-07-08 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08  1:22 Pedro Alves
2007-07-08  3:48 ` Daniel Jacobowitz
2007-07-08 14:45   ` Pedro Alves [this message]
2007-07-08 17:22     ` Daniel Jacobowitz

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=4690F4C8.10704@portugalmail.pt \
    --to=pedro_alves@portugalmail.pt \
    --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