Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Abid, Hafiz" <hafiz_abid@mentor.com>
To: Pedro Alves <palves@redhat.com>
Cc: Yao Qi <yao@codesourcery.com>, <gdb-patches@sourceware.org>,
	<stan@codesourcery.com>, <eliz@gnu.org>
Subject: Re: [patch] Change trace buffer size(v5)
Date: Fri, 03 May 2013 15:08:00 -0000	[thread overview]
Message-ID: <1367593723.5163.2@abidh-ubunto1104> (raw)
In-Reply-To: <5183C404.3070605@redhat.com> (from palves@redhat.com on Fri	May  3 15:04:52 2013)

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

On 03/05/13 15:04:52, Pedro Alves wrote:
> On 05/03/2013 12:38 PM, Abid, Hafiz wrote:
> 
> > Hi Pedro,
> > Thanks for letting me know. There is a testcase in  
> status-stop.exp(test_tstart_tstart) to check this case but it is not  
> working as intended. I will work on a patch.
> 
> Thanks.
> 
> --
> Pedro Alves
> 
Hi Pedro,
I have attached a patch. It calls 'stop_tracing' from the QTinit  
handler. I was wondering that setting 'tracing' to 0 may be enough. But  
stop_tracing seems to do a lot of other things which may be required.  
So I thought it is better to go with it. Another possibility is to let  
QTBuffer:size handler return ok if the new size is equal to current  
size irrespective of the value of 'tracing'.

As I mentioned earlier, a testcase was already present for this  
scenario but it was missing the error message that came after we press  
'y'. I have handled it but would like to know if there is a better way  
to do it. I saw no regression on native-gdbserver run.

Regards,
Abid

gdb/testsuite/ChangeLog:
2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* status-stop.exp (test_tstart_tstart): Check for error
	returned by the second 'tstart' command.


gdb/gdbserver/ChangeLog:
2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* tracepoint.c (cmd_qtinit): Call 'stop_tracing'.



[-- Attachment #2: test.patch --]
[-- Type: text/x-patch, Size: 1358 bytes --]

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 = -1;
 
+  stop_tracing ();
+
   trace_debug ("Initializing the trace");
 
   clear_installed_tracepoints ();
diff --git a/gdb/testsuite/gdb.trace/status-stop.exp b/gdb/testsuite/gdb.trace/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 { } {
 
 proc test_tstart_tstart { } {
     with_test_prefix "tstart_tstart" {
+	global gdb_prompt
 	global executable
 	global hex
 
@@ -79,9 +80,13 @@ proc test_tstart_tstart { } {
 	gdb_test "trace func1" "Tracepoint \[0-9\] at $hex: file.*"
 	gdb_test_no_output "tstart"
 
-	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. 
+		gdb_test_no_output "y" $test
+	    }
+	}
     }
 }
 

  reply	other threads:[~2013-05-03 15:08 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 18:13 [patch] Change trace buffer size Abid, Hafiz
2013-02-18 20:00 ` Eli Zaretskii
2013-02-19  2:53 ` Yao Qi
2013-02-27 16:55   ` Pedro Alves
2013-02-28  0:52     ` Yao Qi
2013-02-27 16:39 ` Pedro Alves
2013-03-01 17:07   ` [patch] Change trace buffer size(v2) Abid, Hafiz
2013-03-01 18:13     ` zinteger setshow commands broken Pedro Alves
2013-03-04 10:10       ` Abid, Hafiz
2013-03-04 10:16         ` Yao Qi
2013-03-04 10:28         ` Pedro Alves
2013-03-01 20:02     ` [patch] Change trace buffer size(v2) Pedro Alves
2013-03-04 19:03       ` [patch] Change trace buffer size(v3) Abid, Hafiz
2013-03-04 20:43         ` Pedro Alves
2013-03-05 14:12           ` [patch] Change trace buffer size(v4) Abid, Hafiz
2013-03-05 20:13             ` Pedro Alves
2013-03-08 11:30               ` [patch] Change trace buffer size(v5) Abid, Hafiz
2013-03-08 14:09                 ` Eli Zaretskii
2013-03-08 14:27                   ` Abid, Hafiz
2013-03-08 14:28                 ` Pedro Alves
2013-03-08 14:52                 ` Yao Qi
2013-03-08 15:15                   ` Abid, Hafiz
2013-03-08 15:27                     ` Yao Qi
2013-05-02 17:31                     ` Pedro Alves
2013-05-03 11:38                       ` Abid, Hafiz
2013-05-03 14:05                         ` Pedro Alves
2013-05-03 15:08                           ` Abid, Hafiz [this message]
2013-05-03 15:26                             ` Pedro Alves
2013-03-09  2:06                 ` Joel Brobecker
2013-03-09  8:27                   ` Eli Zaretskii
2013-03-09 10:20                     ` Abid, Hafiz
2013-03-09 10:39                       ` Abid, Hafiz
2013-03-09 11:11                         ` Eli Zaretskii
2013-03-09 11:07                       ` Eli Zaretskii
2013-03-11 18:33                         ` Tom Tromey
2013-03-11 19:44                           ` Eli Zaretskii

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