Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] remote_set_trace_notes
@ 2013-03-01 17:43 Abid, Hafiz
  2013-03-01 18:31 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Abid, Hafiz @ 2013-03-01 17:43 UTC (permalink / raw)
  To: stan, palves, gdb-patches

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


Hi All,
During review of trace-buffer-size patch, I was asked to move a change  
into a separate patch. This is simple change in remote_set_trace_notes  
that will make this function return if all arguments are NULL.

2012-03-01  Stan Shebs  <stan@codesourcery.com>
	    Hafiz Abid Qadeer  <abidh@codesourcery.com>

	gdb/
	* remote.c (remote_set_trace_notes): Handle no-op case better.

[-- Attachment #2: set-trace-notes.patch --]
[-- Type: text/x-patch, Size: 1171 bytes --]

diff --git a/gdb/remote.c b/gdb/remote.c
index 88a57c8..8326ce8 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -11050,6 +11050,7 @@ remote_set_trace_notes (char *user, char *notes, char *stop_notes)
   char *buf = rs->buf;
   char *endbuf = rs->buf + get_remote_packet_size ();
   int nbytes;
+  int any = 0;
 
   buf += xsnprintf (buf, endbuf - buf, "QTNotes:");
   if (user)
@@ -11058,6 +11059,7 @@ remote_set_trace_notes (char *user, char *notes, char *stop_notes)
       nbytes = bin2hex (user, buf, 0);
       buf += 2 * nbytes;
       *buf++ = ';';
+      any = 1;
     }
   if (notes)
     {
@@ -11065,6 +11067,7 @@ remote_set_trace_notes (char *user, char *notes, char *stop_notes)
       nbytes = bin2hex (notes, buf, 0);
       buf += 2 * nbytes;
       *buf++ = ';';
+      any = 1;
     }
   if (stop_notes)
     {
@@ -11072,7 +11075,11 @@ remote_set_trace_notes (char *user, char *notes, char *stop_notes)
       nbytes = bin2hex (stop_notes, buf, 0);
       buf += 2 * nbytes;
       *buf++ = ';';
+      any = 1;
     }
+  if (any == 0)
+    return 0;
+
   /* Ensure the buffer is terminated.  */
   *buf = '\0';
 

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

end of thread, other threads:[~2013-03-01 18:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-01 17:43 [patch] remote_set_trace_notes Abid, Hafiz
2013-03-01 18:31 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox