From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12964 invoked by alias); 3 May 2013 15:08:54 -0000 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 Received: (qmail 12915 invoked by uid 89); 3 May 2013 15:08:49 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 03 May 2013 15:08:48 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UYHbK-0001eR-2k from Hafiz_Abid@mentor.com ; Fri, 03 May 2013 08:08:46 -0700 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, 3 May 2013 08:08:45 -0700 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.2.247.3; Fri, 3 May 2013 16:08:44 +0100 Date: Fri, 03 May 2013 15:08:00 -0000 From: "Abid, Hafiz" Subject: Re: [patch] Change trace buffer size(v5) To: Pedro Alves CC: Yao Qi , , , In-Reply-To: <5183C404.3070605@redhat.com> (from palves@redhat.com on Fri May 3 15:04:52 2013) Message-ID: <1367593723.5163.2@abidh-ubunto1104> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-CksISiEw3QMok7vXsy7x" X-Virus-Found: No X-SW-Source: 2013-05/txt/msg00055.txt.bz2 --=-CksISiEw3QMok7vXsy7x Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1381 On 03/05/13 15:04:52, Pedro Alves wrote: > On 05/03/2013 12:38 PM, Abid, Hafiz wrote: >=20 > > Hi Pedro, > > Thanks for letting me know. There is a testcase in=20=20 > status-stop.exp(test_tstart_tstart) to check this case but it is not=20=20 > working as intended. I will work on a patch. >=20 > Thanks. >=20 > -- > Pedro Alves >=20 Hi Pedro, I have attached a patch. It calls 'stop_tracing' from the QTinit=20=20 handler. I was wondering that setting 'tracing' to 0 may be enough. But=20= =20 stop_tracing seems to do a lot of other things which may be required.=20=20 So I thought it is better to go with it. Another possibility is to let=20=20 QTBuffer:size handler return ok if the new size is equal to current=20=20 size irrespective of the value of 'tracing'. As I mentioned earlier, a testcase was already present for this=20=20 scenario but it was missing the error message that came after we press=20=20 'y'. I have handled it but would like to know if there is a better way=20=20 to do it. I saw no regression on native-gdbserver run. Regards, Abid gdb/testsuite/ChangeLog: 2013-05-03 Hafiz Abid Qadeer * status-stop.exp (test_tstart_tstart): Check for error returned by the second 'tstart' command. gdb/gdbserver/ChangeLog: 2013-05-03 Hafiz Abid Qadeer * tracepoint.c (cmd_qtinit): Call 'stop_tracing'. --=-CksISiEw3QMok7vXsy7x Content-Type: text/x-patch; charset="us-ascii"; name="test.patch" Content-Disposition: attachment; filename="test.patch" Content-Transfer-Encoding: quoted-printable Content-length: 1334 diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 419765b..1ff6114 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -2354,6 +2354,8 @@ cmd_qtinit (char *packet) /* Make sure we don't try to read from a trace frame. */ current_traceframe =3D -1; =20 + stop_tracing (); + trace_debug ("Initializing the trace"); =20 clear_installed_tracepoints (); diff --git a/gdb/testsuite/gdb.trace/status-stop.exp b/gdb/testsuite/gdb.tr= ace/status-stop.exp index bca03d2..33c1eb9 100644 --- a/gdb/testsuite/gdb.trace/status-stop.exp +++ b/gdb/testsuite/gdb.trace/status-stop.exp @@ -66,6 +66,7 @@ proc test_tstart_tstop_tstart { } { =20 proc test_tstart_tstart { } { with_test_prefix "tstart_tstart" { + global gdb_prompt global executable global hex =20 @@ -79,9 +80,13 @@ proc test_tstart_tstart { } { gdb_test "trace func1" "Tracepoint \[0-9\] at $hex: file.*" gdb_test_no_output "tstart" =20 - gdb_test "tstart" "" "tstart again" \ - "A trace is running already. Start a new run\\? \\(y or n\\) " \ - "y" + set test "tstart again" + gdb_test_multiple "tstart" $test { + -re "A trace is running already. Start a new run.*y or n.*" { + # Send 'y' and make sure that we don't get any error.=20 + gdb_test_no_output "y" $test + } + } } } =20 --=-CksISiEw3QMok7vXsy7x--