Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] 'tfind none' is an alias of 'tfind end'.
@ 2012-08-13  9:37 Yao Qi
  2012-08-15 19:43 ` Tom Tromey
  2012-08-17  8:24 ` Regression for gdb.trace/tfind.exp [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.] Jan Kratochvil
  0 siblings, 2 replies; 7+ messages in thread
From: Yao Qi @ 2012-08-13  9:37 UTC (permalink / raw)
  To: gdb-patches

Hi,
As doc said, 'tfind none' and 'tfind end' does the same thing,
but they are registered as two commands.  This patch is to
change 'tfind none' to the alias of 'tfind end'.

Regression tested on x86_64-unknown-linux-gnu.  OK to apply?

gdb:

2012-08-13  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (trace_find_none_command): Remove.
	(_initialize_tracepoint): Call add_alias_cmd for "tfind none".
---
 gdb/tracepoint.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 21701b4..3455abe 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2418,13 +2418,6 @@ trace_find_end_command (char *args, int from_tty)
   trace_find_command ("-1", from_tty);
 }
 
-/* tfind none */
-static void
-trace_find_none_command (char *args, int from_tty)
-{
-  trace_find_command ("-1", from_tty);
-}
-
 /* tfind start */
 static void
 trace_find_start_command (char *args, int from_tty)
@@ -5260,13 +5253,10 @@ Default is the current PC, or the PC of the current trace frame."),
 	   &tfindlist);
 
   add_cmd ("end", class_trace, trace_find_end_command, _("\
-Synonym for 'none'.\n\
 De-select any trace frame and resume 'live' debugging."),
 	   &tfindlist);
 
-  add_cmd ("none", class_trace, trace_find_none_command,
-	   _("De-select any trace frame and resume 'live' debugging."),
-	   &tfindlist);
+  add_alias_cmd ("none", "end", class_trace, 0, &tfindlist);
 
   add_cmd ("start", class_trace, trace_find_start_command,
 	   _("Select the first trace frame in the trace buffer."),
-- 
1.7.7.6


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

* Re: [PATCH] 'tfind none' is an alias of 'tfind end'.
  2012-08-13  9:37 [PATCH] 'tfind none' is an alias of 'tfind end' Yao Qi
@ 2012-08-15 19:43 ` Tom Tromey
  2012-08-17  8:24 ` Regression for gdb.trace/tfind.exp [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.] Jan Kratochvil
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2012-08-15 19:43 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> 2012-08-13  Yao Qi  <yao@codesourcery.com>
Yao> 	* tracepoint.c (trace_find_none_command): Remove.
Yao> 	(_initialize_tracepoint): Call add_alias_cmd for "tfind none".

Ok, thanks.

Tom


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

* Regression for gdb.trace/tfind.exp  [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.]
  2012-08-13  9:37 [PATCH] 'tfind none' is an alias of 'tfind end' Yao Qi
  2012-08-15 19:43 ` Tom Tromey
@ 2012-08-17  8:24 ` Jan Kratochvil
  2012-08-17  8:31   ` Yao Qi
  2012-08-17  8:58   ` Yao Qi
  1 sibling, 2 replies; 7+ messages in thread
From: Jan Kratochvil @ 2012-08-17  8:24 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On Mon, 13 Aug 2012 11:35:54 +0200, Yao Qi wrote:
> Regression tested on x86_64-unknown-linux-gnu.  OK to apply?

with testsuite using gdbserver:

44e688d2612fa2e3f80420502ce203db0e314e60 is the first bad commit
commit 44e688d2612fa2e3f80420502ce203db0e314e60
Author: qiyao <qiyao>
Date:   Thu Aug 16 07:26:15 2012 +0000

    gdb/
	* tracepoint.c (trace_find_none_command): Remove.
	(_initialize_tracepoint): Call add_alias_cmd for "tfind none".


 help tfind end^M
-Synonym for 'none'.^M
 De-select any trace frame and resume 'live' debugging.^M
-(gdb) PASS: gdb.trace/tfind.exp: 8.38: help tfind end
+(gdb) FAIL: gdb.trace/tfind.exp: 8.38: help tfind end



Jan


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

* Re: Regression for gdb.trace/tfind.exp  [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.]
  2012-08-17  8:24 ` Regression for gdb.trace/tfind.exp [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.] Jan Kratochvil
@ 2012-08-17  8:31   ` Yao Qi
  2012-08-17  8:58   ` Yao Qi
  1 sibling, 0 replies; 7+ messages in thread
From: Yao Qi @ 2012-08-17  8:31 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

On 08/17/2012 04:24 PM, Jan Kratochvil wrote:
>   help tfind end^M
> -Synonym for 'none'.^M
>   De-select any trace frame and resume 'live' debugging.^M
> -(gdb) PASS: gdb.trace/tfind.exp: 8.38: help tfind end
> +(gdb) FAIL: gdb.trace/tfind.exp: 8.38: help tfind end

Looks like the test case should be updated.  I'll have a look.

Jan, thanks for pointing this out.

-- 
Yao


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

* Re: Regression for gdb.trace/tfind.exp  [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.]
  2012-08-17  8:24 ` Regression for gdb.trace/tfind.exp [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.] Jan Kratochvil
  2012-08-17  8:31   ` Yao Qi
@ 2012-08-17  8:58   ` Yao Qi
  2012-08-17 15:19     ` Jan Kratochvil
  1 sibling, 1 reply; 7+ messages in thread
From: Yao Qi @ 2012-08-17  8:58 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

On 08/17/2012 04:24 PM, Jan Kratochvil wrote:
> help tfind end^M
> -Synonym for 'none'.^M
>   De-select any trace frame and resume 'live' debugging.^M
> -(gdb) PASS: gdb.trace/tfind.exp: 8.38: help tfind end
> +(gdb) FAIL: gdb.trace/tfind.exp: 8.38: help tfind end

"Synonym for 'none'' is removed as 'tfind none' becomes an alias of 'tfind
end', so the test here should be updated.  The reason I missed this 
regression is that I forgot to run testsuite with gdbserver, however, 
tests (checking the output of some 'help xxx' commands) here can be run 
in native testing.

Below is the fix to remove "Synonym for 'none'" in test, and move these 
tests related on 'help xxx' output before checking target supports 
trace or not.  With this patch applied, the output of these 'help xxx'
command are tested in native testing as well.

In native, we get,
# of expected passes            10
# of unsupported tests          1

In remote/gdbserver, we get,
# of expected passes            85

Is it OK?

-- 
Yao

gdb/testsuite:

2012-08-17  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/tfind.exp: Move tests on various command help before
	checking target supports trace.
	Fix the expected output of 'help tfind end'.
---
 gdb/testsuite/gdb.trace/tfind.exp |   52 ++++++++++++++++++++-----------------
 1 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp
index cce742e..edd3335 100644
--- a/gdb/testsuite/gdb.trace/tfind.exp
+++ b/gdb/testsuite/gdb.trace/tfind.exp
@@ -31,6 +31,34 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile" \
 gdb_load $binfile
 gdb_test "tstop"       ".*" ""
 gdb_test "tfind none"  ".*" ""
+
+# 6.2 test help tstart
+gdb_test "help tstart" \
+    "Start trace data collection\.\[\r\n\]+Usage: tstart \\\[ <notes> \.\.\. \\\]\[\r\n\]+Any arguments supplied are recorded with the trace as a note and\[\r\n\]+reported by tstatus \\(if the target supports trace notes\\)\." \
+    "6.2: help tstart"
+# 7.2 test help tstop
+gdb_test "help tstop" \
+    "Stop trace data collection\.\[\r\n\]+Usage: tstop \\\[ <notes> \.\.\. \\\]\[\r\n\]+Any arguments supplied are recorded with the trace as a stop reason and\[\r\n\]+reported by tstatus \\(if the target supports trace notes\\)\." \
+    "7.2: help tstop"
+
+# 8.38 test help tfind
+gdb_test "help tfind"       "Select a trace frame.*"      \
+	"8.38: help tfind"
+gdb_test "help tfind pc"    "Select a trace frame by PC.*" \
+	"8.38: help tfind PC"
+gdb_test "help tfind end"   "De-select any trace frame.*" \
+	"8.38: help tfind end"
+gdb_test "help tfind none"  "De-select any trace frame.*" \
+	"8.38: help tfind none"
+gdb_test "help tfind line"  "Select a trace frame by source line.*" \
+	"8.38: help tfind line"
+gdb_test "help tfind start" "Select the first trace frame.*" \
+	"8.38: help tfind start"
+gdb_test "help tfind range" "Select a trace frame whose PC is in.*" \
+	"8.38: help tfind range"
+gdb_test "help tfind trace" "Select a trace frame by tracepoint number.*" \
+	"8.38: help tfind tracepoint"
+
 runto_main
 gdb_reinitialize_dir $srcdir/$subdir
 
@@ -99,9 +127,6 @@ if { $return_me == 1 } then {
 # test tstatus (when trace on)
 gdb_test "tstatus" "\[Tt\]race is running.*" "test tstatus on"
 
-# 6.2 test help tstart
-gdb_test "help tstart" "Start trace data collection\.\[\r\n\]+Usage: tstart \\\[ <notes> \.\.\. \\\]\[\r\n\]+Any arguments supplied are recorded with the trace as a note and\[\r\n\]+reported by tstatus \\(if the target supports trace notes\\)\." "6.2: help tstart"
-
 gdb_test "break end" ".*" ""
 gdb_test "continue" \
     "Continuing.*Breakpoint $decimal, end.*" \
@@ -130,9 +155,6 @@ if { $return_me == 1 } then {
     return -1;
 }
 
-# 7.2 test help tstop
-gdb_test "help tstop" "Stop trace data collection\.\[\r\n\]+Usage: tstop \\\[ <notes> \.\.\. \\\]\[\r\n\]+Any arguments supplied are recorded with the trace as a stop reason and\[\r\n\]+reported by tstatus \\(if the target supports trace notes\\)\." "7.2: help tstop"
-
 # test tstatus (when trace off)
 gdb_test "tstatus" "Trace stopped by a tstop command.*" \
     "test tstatus off after tstop"
@@ -339,23 +361,5 @@ gdb_test "tfind NoSuChOpTiOn 21" \
 	"No symbol.*|\[Ww\]arning.*|\[Ee\]rror.*" \
 	"8.32: tfind with bad subcommand"
 
-# 8.38 test help tfind
-gdb_test "help tfind"       "Select a trace frame.*"      \
-	"8.38: help tfind"
-gdb_test "help tfind pc"    "Select a trace frame by PC.*" \
-	"8.38: help tfind PC"
-gdb_test "help tfind end"   "Synonym for 'none'.*"        \
-	"8.38: help tfind end"
-gdb_test "help tfind none"  "De-select any trace frame.*" \
-	"8.38: help tfind none"
-gdb_test "help tfind line"  "Select a trace frame by source line.*" \
-	"8.38: help tfind line"
-gdb_test "help tfind start" "Select the first trace frame.*" \
-	"8.38: help tfind start"
-gdb_test "help tfind range" "Select a trace frame whose PC is in.*" \
-	"8.38: help tfind range"
-gdb_test "help tfind trace" "Select a trace frame by tracepoint number.*" \
-	"8.38: help tfind tracepoint"
-
 # Finished!
 gdb_tfind_test "8.17: tfind none" "none" "-1"
-- 
1.7.7.6


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

* Re: Regression for gdb.trace/tfind.exp  [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.]
  2012-08-17  8:58   ` Yao Qi
@ 2012-08-17 15:19     ` Jan Kratochvil
  2012-08-18  1:02       ` [committed]: " Yao Qi
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kratochvil @ 2012-08-17 15:19 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On Fri, 17 Aug 2012 10:58:05 +0200, Yao Qi wrote:
> Below is the fix to remove "Synonym for 'none'" in test, and move these 
> tests related on 'help xxx' output before checking target supports 
> trace or not.

Please check it in.


Thanks,
Jan


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

* [committed]: Regression for gdb.trace/tfind.exp  [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.]
  2012-08-17 15:19     ` Jan Kratochvil
@ 2012-08-18  1:02       ` Yao Qi
  0 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2012-08-18  1:02 UTC (permalink / raw)
  Cc: gdb-patches

On 08/17/2012 11:18 PM, Jan Kratochvil wrote:
>> Below is the fix to remove "Synonym for 'none'" in test, and move these
>> >tests related on 'help xxx' output before checking target supports
>> >trace or not.
> Please check it in.

Thanks.  Committed.

-- 
Yao


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

end of thread, other threads:[~2012-08-18  1:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-13  9:37 [PATCH] 'tfind none' is an alias of 'tfind end' Yao Qi
2012-08-15 19:43 ` Tom Tromey
2012-08-17  8:24 ` Regression for gdb.trace/tfind.exp [Re: [PATCH] 'tfind none' is an alias of 'tfind end'.] Jan Kratochvil
2012-08-17  8:31   ` Yao Qi
2012-08-17  8:58   ` Yao Qi
2012-08-17 15:19     ` Jan Kratochvil
2012-08-18  1:02       ` [committed]: " Yao Qi

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