From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24842 invoked by alias); 1 Mar 2013 17:43:21 -0000 Received: (qmail 24680 invoked by uid 22791); 1 Mar 2013 17:43:19 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_XS X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Mar 2013 17:43:13 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UBTzD-0001OH-W8 from Hafiz_Abid@mentor.com ; Fri, 01 Mar 2013 09:43:12 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 1 Mar 2013 09:43:11 -0800 Received: from abidh-ubunto1104 (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.1.289.1; Fri, 1 Mar 2013 17:43:10 +0000 Date: Fri, 01 Mar 2013 17:43:00 -0000 From: "Abid, Hafiz" Subject: [patch] remote_set_trace_notes To: , , Message-ID: <1362159789.18212.1@abidh-ubunto1104> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-iRLSZyU4X+UloIJcY/NJ" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-03/txt/msg00031.txt.bz2 --=-iRLSZyU4X+UloIJcY/NJ Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 396 Hi All, During review of trace-buffer-size patch, I was asked to move a change=20=20 into a separate patch. This is simple change in remote_set_trace_notes=20=20 that will make this function return if all arguments are NULL. 2012-03-01 Stan Shebs Hafiz Abid Qadeer gdb/ * remote.c (remote_set_trace_notes): Handle no-op case better.= --=-iRLSZyU4X+UloIJcY/NJ Content-Type: text/x-patch; charset="us-ascii"; name="set-trace-notes.patch" Content-Disposition: attachment; filename="set-trace-notes.patch" Content-Transfer-Encoding: quoted-printable Content-length: 1181 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, ch= ar *stop_notes) char *buf =3D rs->buf; char *endbuf =3D rs->buf + get_remote_packet_size (); int nbytes; + int any =3D 0; =20 buf +=3D xsnprintf (buf, endbuf - buf, "QTNotes:"); if (user) @@ -11058,6 +11059,7 @@ remote_set_trace_notes (char *user, char *notes, ch= ar *stop_notes) nbytes =3D bin2hex (user, buf, 0); buf +=3D 2 * nbytes; *buf++ =3D ';'; + any =3D 1; } if (notes) { @@ -11065,6 +11067,7 @@ remote_set_trace_notes (char *user, char *notes, ch= ar *stop_notes) nbytes =3D bin2hex (notes, buf, 0); buf +=3D 2 * nbytes; *buf++ =3D ';'; + any =3D 1; } if (stop_notes) { @@ -11072,7 +11075,11 @@ remote_set_trace_notes (char *user, char *notes, c= har *stop_notes) nbytes =3D bin2hex (stop_notes, buf, 0); buf +=3D 2 * nbytes; *buf++ =3D ';'; + any =3D 1; } + if (any =3D=3D 0) + return 0; + /* Ensure the buffer is terminated. */ *buf =3D '\0'; =20 --=-iRLSZyU4X+UloIJcY/NJ--