Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Abid, Hafiz" <hafiz_abid@mentor.com>
To: <stan@codesourcery.com>, <palves@redhat.com>,
	<gdb-patches@sourceware.org>
Subject: [patch] remote_set_trace_notes
Date: Fri, 01 Mar 2013 17:43:00 -0000	[thread overview]
Message-ID: <1362159789.18212.1@abidh-ubunto1104> (raw)

[-- 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';
 

             reply	other threads:[~2013-03-01 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-01 17:43 Abid, Hafiz [this message]
2013-03-01 18:31 ` Pedro Alves

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=1362159789.18212.1@abidh-ubunto1104 \
    --to=hafiz_abid@mentor.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=stan@codesourcery.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