* [PATCH]testsuite: test for disconnected-tracing
@ 2012-03-27 14:00 Hui Zhu
2012-03-28 18:51 ` Tom Tromey
0 siblings, 1 reply; 15+ messages in thread
From: Hui Zhu @ 2012-03-27 14:00 UTC (permalink / raw)
To: gdb-patches; +Cc: Pedro Alves
[-- Attachment #1: Type: text/plain, Size: 519 bytes --]
Hi,
There is a patch for testsuite for the issue in
http://sourceware.org/ml/gdb-patches/2012-01/msg01006.html that is fixed
now.
This is the testsuite for it.
It will do 2 times reconnect to GDB with disconnected-tracing and check
the "info tracepoints".
Please help me review it.
Thanks,
Hui
2012-03-27 Hui Zhu <hui_zhu@mentor.com>
* gdb.trace/Makefile.in (BUILD_DATA_DIRECTORY): Add
disconnected-tracing.
* gdb.trace/disconnected-tracing.c: New file.
* gdb.trace/disconnected-tracing.exp: New file.
[-- Attachment #2: disconnected-tracing.txt --]
[-- Type: text/plain, Size: 2698 bytes --]
---
testsuite/gdb.trace/Makefile.in | 2
testsuite/gdb.trace/disconnected-tracing.c | 5 ++
testsuite/gdb.trace/disconnected-tracing.exp | 58 +++++++++++++++++++++++++++
3 files changed, 64 insertions(+), 1 deletion(-)
--- a/testsuite/gdb.trace/Makefile.in
+++ b/testsuite/gdb.trace/Makefile.in
@@ -5,7 +5,7 @@ srcdir = @srcdir@
PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
- while-stepping
+ while-stepping disconnected-tracing
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.c
@@ -0,0 +1,5 @@
+int
+main()
+{
+ return 0;
+}
\ No newline at end of file
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.exp
@@ -0,0 +1,58 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test of disconnected-tracing.
+
+load_lib "trace-support.exp";
+
+set testfile "disconnected-tracing"
+set executable $testfile
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+set expfile $testfile.exp
+set gdbserver_reconnect_p 1
+
+if [prepare_for_testing $expfile $executable $srcfile \
+ {debug nowarnings}] {
+ untested "failed to prepare for trace tests"
+ return -1
+}
+
+if ![runto_main] {
+ fail "Can't run to main to check for trace support"
+ return -1
+}
+
+if ![gdb_target_supports_trace] {
+ unsupported "target does not support trace"
+ return -1;
+}
+
+gdb_test "set confirm off" ".*"
+
+gdb_test "trace main" ".*"
+
+gdb_test "tstart" ".*"
+
+gdb_test "info tracepoints" ".*in main at.*" "First info tracepoints"
+gdb_test "disconnect" ".*"
+
+gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
+gdb_test "info tracepoints" ".*in main at.*" "Second info tracepoints"
+gdb_test "disconnect" ".*"
+
+gdb_test "delete" ".*"
+gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
+gdb_test "info tracepoints" ".*in main at.*" "Third info tracepoints"
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-03-27 14:00 [PATCH]testsuite: test for disconnected-tracing Hui Zhu
@ 2012-03-28 18:51 ` Tom Tromey
2012-03-29 1:17 ` Hui Zhu
0 siblings, 1 reply; 15+ messages in thread
From: Tom Tromey @ 2012-03-28 18:51 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, Pedro Alves
>>>>> ">" == Hui Zhu <hui_zhu@mentor.com> writes:
>> +gdb_test "set confirm off" ".*"
I think we use gdb_test_no_output for things like this now.
I'm not sure whether it applies to other cases in your patch.
>> +gdb_test "delete" ".*"
Perhaps just calling delete_breakpoints would work?
Tom
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-03-28 18:51 ` Tom Tromey
@ 2012-03-29 1:17 ` Hui Zhu
2012-03-29 11:37 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: Hui Zhu @ 2012-03-29 1:17 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches, Pedro Alves
[-- Attachment #1: Type: text/plain, Size: 657 bytes --]
Hi Tom,
Thanks for your review.
I post a new patch according to your comments.
Best,
Hui
2012-03-29 Hui Zhu <hui_zhu@mentor.com>
* gdb.trace/Makefile.in (BUILD_DATA_DIRECTORY): Add
disconnected-tracing.
* gdb.trace/disconnected-tracing.c: New file.
* gdb.trace/disconnected-tracing.exp: New file.
On 03/29/12 02:51, Tom Tromey wrote:
>>>>>> ">" == Hui Zhu<hui_zhu@mentor.com> writes:
>
>>> +gdb_test "set confirm off" ".*"
>
> I think we use gdb_test_no_output for things like this now.
> I'm not sure whether it applies to other cases in your patch.
>
>>> +gdb_test "delete" ".*"
>
> Perhaps just calling delete_breakpoints would work?
>
> Tom
[-- Attachment #2: disconnected-tracing.txt --]
[-- Type: text/plain, Size: 2781 bytes --]
---
testsuite/gdb.trace/Makefile.in | 2
testsuite/gdb.trace/disconnected-tracing.c | 5 ++
testsuite/gdb.trace/disconnected-tracing.exp | 59 +++++++++++++++++++++++++++
3 files changed, 65 insertions(+), 1 deletion(-)
--- a/testsuite/gdb.trace/Makefile.in
+++ b/testsuite/gdb.trace/Makefile.in
@@ -5,7 +5,7 @@ srcdir = @srcdir@
PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
- while-stepping
+ while-stepping disconnected-tracing
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.c
@@ -0,0 +1,5 @@
+int
+main()
+{
+ return 0;
+}
\ No newline at end of file
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.exp
@@ -0,0 +1,59 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test of disconnected-tracing.
+
+load_lib "trace-support.exp";
+
+set testfile "disconnected-tracing"
+set executable $testfile
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+set expfile $testfile.exp
+set gdbserver_reconnect_p 1
+
+if [prepare_for_testing $expfile $executable $srcfile \
+ {debug nowarnings}] {
+ untested "failed to prepare for trace tests"
+ return -1
+}
+
+if ![runto_main] {
+ fail "Can't run to main to check for trace support"
+ return -1
+}
+
+if ![gdb_target_supports_trace] {
+ unsupported "target does not support trace"
+ return -1;
+}
+
+gdb_test_no_output "set confirm off" ".*"
+
+gdb_test "trace main" ".*"
+gdb_test "tstart" ".*"
+
+gdb_test "info tracepoints" ".*in main at.*" "First info tracepoints"
+gdb_test "disconnect" ".*"
+
+gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
+gdb_test "info tracepoints" ".*in main at.*" "Second info tracepoints"
+gdb_test "disconnect" ".*"
+
+delete_breakpoints
+gdb_test "info tracepoints" ".*No tracepoints..*" "Third info tracepoints"
+
+gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
+gdb_test "info tracepoints" ".*in main at.*" "Fourth info tracepoints"
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-03-29 1:17 ` Hui Zhu
@ 2012-03-29 11:37 ` Pedro Alves
2012-04-05 8:14 ` Hui Zhu
0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-03-29 11:37 UTC (permalink / raw)
To: Hui Zhu; +Cc: Tom Tromey, gdb-patches
On 03/29/2012 02:17 AM, Hui Zhu wrote:
> Hi Tom,
>
> Thanks for your review.
> I post a new patch according to your comments.
>
> Best,
> Hui
>
> 2012-03-29 Hui Zhu <hui_zhu@mentor.com>
>
> * gdb.trace/Makefile.in (BUILD_DATA_DIRECTORY): Add
"BUILD_DATA_DIRECTORY" ? It looks like the change was to "PROGS" ?
> disconnected-tracing.
> * gdb.trace/disconnected-tracing.c: New file.
> * gdb.trace/disconnected-tracing.exp: New file.
>
> On 03/29/12 02:51, Tom Tromey wrote:
>>>>>>> ">" == Hui Zhu<hui_zhu@mentor.com> writes:
>>
>>>> +gdb_test "set confirm off" ".*"
>>
>> I think we use gdb_test_no_output for things like this now.
>> I'm not sure whether it applies to other cases in your patch.
>>
>>>> +gdb_test "delete" ".*"
>>
>> Perhaps just calling delete_breakpoints would work?
>>
>> Tom
>
> disconnected-tracing.txt
>
>
> ---
> testsuite/gdb.trace/Makefile.in | 2
> testsuite/gdb.trace/disconnected-tracing.c | 5 ++
> testsuite/gdb.trace/disconnected-tracing.exp | 59 +++++++++++++++++++++++++++
> 3 files changed, 65 insertions(+), 1 deletion(-)
>
> --- a/testsuite/gdb.trace/Makefile.in
> +++ b/testsuite/gdb.trace/Makefile.in
> @@ -5,7 +5,7 @@ srcdir = @srcdir@
>
> PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
> report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
> - while-stepping
> + while-stepping disconnected-tracing
>
> all info install-info dvi install uninstall installcheck check:
> @echo "Nothing to be done for $@..."
> --- /dev/null
> +++ b/testsuite/gdb.trace/disconnected-tracing.c
> @@ -0,0 +1,5 @@
> +int
> +main()
> +{
> + return 0;
> +}
> \ No newline at end of file
Please add one.
Add a copyright header while at it. Best be consistent and
make that a rule, even if the file is actually void of
copyrightable content for now.
> --- /dev/null
> +++ b/testsuite/gdb.trace/disconnected-tracing.exp
> @@ -0,0 +1,59 @@
> +# Copyright 2012 Free Software Foundation, Inc.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
> +
> +# Test of disconnected-tracing.
> +
> +load_lib "trace-support.exp";
> +
> +set testfile "disconnected-tracing"
> +set executable $testfile
> +set srcfile ${testfile}.c
> +set binfile $objdir/$subdir/$testfile
> +set expfile $testfile.exp
> +set gdbserver_reconnect_p 1
Please see gdb.base/solib-disc.exp, the only current user
of gdbserver_reconnect_p. Add:
if { [info proc gdb_reconnect] == "" } {
return 0
}
> +
> +if [prepare_for_testing $expfile $executable $srcfile \
> + {debug nowarnings}] {
> + untested "failed to prepare for trace tests"
> + return -1
> +}
> +
> +if ![runto_main] {
> + fail "Can't run to main to check for trace support"
> + return -1
> +}
> +
> +if ![gdb_target_supports_trace] {
> + unsupported "target does not support trace"
> + return -1;
> +}
> +
> +gdb_test_no_output "set confirm off" ".*"
Please always look at the resulting messages in gdb.sum:
PASS: gdb.trace/disconnected-tracing.exp: .*
^^
PASS: gdb.trace/disconnected-tracing.exp: trace main
PASS: gdb.trace/disconnected-tracing.exp: tstart
PASS: gdb.trace/disconnected-tracing.exp: First info tracepoints
PASS: gdb.trace/disconnected-tracing.exp: disconnect
PASS: gdb.trace/disconnected-tracing.exp: Second info tracepoints
PASS: gdb.trace/disconnected-tracing.exp: disconnect
PASS: gdb.trace/disconnected-tracing.exp: Third info tracepoints
PASS: gdb.trace/disconnected-tracing.exp: Fourth info tracepoints
There are duplicate messages here. See
<http://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique>.
I'd lowercase the "First", etc., in the test messages. It's much more common.
> +
> +gdb_test "trace main" ".*"
> +gdb_test "tstart" ".*"
Use gdb_test_no_output for tstart:
gdb_test_no_output "tstart" "start trace experiment"
> +
> +gdb_test "info tracepoints" ".*in main at.*" "First info tracepoints"
> +gdb_test "disconnect" ".*"
> +
> +gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
Please see gdb.base/solib-disc.exp for how to reconnect to the target.
> +gdb_test "info tracepoints" ".*in main at.*" "Second info tracepoints"
> +gdb_test "disconnect" ".*"
> +
> +delete_breakpoints
> +gdb_test "info tracepoints" ".*No tracepoints..*" "Third info tracepoints"
> +
> +gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
> +gdb_test "info tracepoints" ".*in main at.*" "Fourth info tracepoints"
But most importantly, I've tried this patch against a tree from just before
the fixes, but the new tests all run cleanly there too.
Also, should there be a "set disconnected-tracing on" somewhere?
If not, then the test's filename appears misleading. Maybe something
with "reconnect" in the name would be more representative?
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-03-29 11:37 ` Pedro Alves
@ 2012-04-05 8:14 ` Hui Zhu
2012-04-05 11:51 ` Pedro Alves
2012-04-08 7:59 ` Yao Qi
0 siblings, 2 replies; 15+ messages in thread
From: Hui Zhu @ 2012-04-05 8:14 UTC (permalink / raw)
To: Pedro Alves; +Cc: Tom Tromey, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 6085 bytes --]
Hi Pedro,
Thanks for your help.
On 03/29/12 19:36, Pedro Alves wrote:
> On 03/29/2012 02:17 AM, Hui Zhu wrote:
>
>> Hi Tom,
>>
>> Thanks for your review.
>> I post a new patch according to your comments.
>>
>> Best,
>> Hui
>>
>> 2012-03-29 Hui Zhu<hui_zhu@mentor.com>
>>
>> * gdb.trace/Makefile.in (BUILD_DATA_DIRECTORY): Add
>
>
> "BUILD_DATA_DIRECTORY" ? It looks like the change was to "PROGS" ?
>
>> disconnected-tracing.
>> * gdb.trace/disconnected-tracing.c: New file.
>> * gdb.trace/disconnected-tracing.exp: New file.
>>
>> On 03/29/12 02:51, Tom Tromey wrote:
>>>>>>>> ">" == Hui Zhu<hui_zhu@mentor.com> writes:
>>>
>>>>> +gdb_test "set confirm off" ".*"
>>>
>>> I think we use gdb_test_no_output for things like this now.
>>> I'm not sure whether it applies to other cases in your patch.
>>>
>>>>> +gdb_test "delete" ".*"
>>>
>>> Perhaps just calling delete_breakpoints would work?
>>>
>>> Tom
>>
>> disconnected-tracing.txt
>>
>>
>> ---
>> testsuite/gdb.trace/Makefile.in | 2
>> testsuite/gdb.trace/disconnected-tracing.c | 5 ++
>> testsuite/gdb.trace/disconnected-tracing.exp | 59 +++++++++++++++++++++++++++
>> 3 files changed, 65 insertions(+), 1 deletion(-)
>>
>> --- a/testsuite/gdb.trace/Makefile.in
>> +++ b/testsuite/gdb.trace/Makefile.in
>> @@ -5,7 +5,7 @@ srcdir = @srcdir@
>>
>> PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
>> report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
>> - while-stepping
>> + while-stepping disconnected-tracing
>>
>> all info install-info dvi install uninstall installcheck check:
>> @echo "Nothing to be done for $@..."
>> --- /dev/null
>> +++ b/testsuite/gdb.trace/disconnected-tracing.c
>> @@ -0,0 +1,5 @@
>> +int
>> +main()
>> +{
>> + return 0;
>> +}
>> \ No newline at end of file
>
>
> Please add one.
>
> Add a copyright header while at it. Best be consistent and
> make that a rule, even if the file is actually void of
> copyrightable content for now.
>
>
>> --- /dev/null
>> +++ b/testsuite/gdb.trace/disconnected-tracing.exp
>> @@ -0,0 +1,59 @@
>> +# Copyright 2012 Free Software Foundation, Inc.
>> +#
>> +# This program is free software; you can redistribute it and/or modify
>> +# it under the terms of the GNU General Public License as published by
>> +# the Free Software Foundation; either version 3 of the License, or
>> +# (at your option) any later version.
>> +#
>> +# This program is distributed in the hope that it will be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program. If not, see<http://www.gnu.org/licenses/>.
>> +
>> +# Test of disconnected-tracing.
>> +
>> +load_lib "trace-support.exp";
>> +
>> +set testfile "disconnected-tracing"
>> +set executable $testfile
>> +set srcfile ${testfile}.c
>> +set binfile $objdir/$subdir/$testfile
>> +set expfile $testfile.exp
>> +set gdbserver_reconnect_p 1
>
>
> Please see gdb.base/solib-disc.exp, the only current user
> of gdbserver_reconnect_p. Add:
>
> if { [info proc gdb_reconnect] == "" } {
> return 0
> }
>
>> +
>> +if [prepare_for_testing $expfile $executable $srcfile \
>> + {debug nowarnings}] {
>> + untested "failed to prepare for trace tests"
>> + return -1
>> +}
>> +
>> +if ![runto_main] {
>> + fail "Can't run to main to check for trace support"
>> + return -1
>> +}
>> +
>> +if ![gdb_target_supports_trace] {
>> + unsupported "target does not support trace"
>> + return -1;
>> +}
>> +
>> +gdb_test_no_output "set confirm off" ".*"
>
>
> Please always look at the resulting messages in gdb.sum:
>
> PASS: gdb.trace/disconnected-tracing.exp: .*
> ^^
> PASS: gdb.trace/disconnected-tracing.exp: trace main
> PASS: gdb.trace/disconnected-tracing.exp: tstart
> PASS: gdb.trace/disconnected-tracing.exp: First info tracepoints
> PASS: gdb.trace/disconnected-tracing.exp: disconnect
> PASS: gdb.trace/disconnected-tracing.exp: Second info tracepoints
> PASS: gdb.trace/disconnected-tracing.exp: disconnect
> PASS: gdb.trace/disconnected-tracing.exp: Third info tracepoints
> PASS: gdb.trace/disconnected-tracing.exp: Fourth info tracepoints
>
> There are duplicate messages here. See
> <http://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique>.
>
> I'd lowercase the "First", etc., in the test messages. It's much more common.
>
>> +
>> +gdb_test "trace main" ".*"
>> +gdb_test "tstart" ".*"
>
>
> Use gdb_test_no_output for tstart:
>
> gdb_test_no_output "tstart" "start trace experiment"
>
>> +
>> +gdb_test "info tracepoints" ".*in main at.*" "First info tracepoints"
>> +gdb_test "disconnect" ".*"
>> +
>> +gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
>
>
> Please see gdb.base/solib-disc.exp for how to reconnect to the target.
>
>> +gdb_test "info tracepoints" ".*in main at.*" "Second info tracepoints"
>> +gdb_test "disconnect" ".*"
>> +
>> +delete_breakpoints
>> +gdb_test "info tracepoints" ".*No tracepoints..*" "Third info tracepoints"
>> +
>> +gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
>
>> +gdb_test "info tracepoints" ".*in main at.*" "Fourth info tracepoints"
>
>
> But most importantly, I've tried this patch against a tree from just before
> the fixes, but the new tests all run cleanly there too.
>
> Also, should there be a "set disconnected-tracing on" somewhere?
> If not, then the test's filename appears misleading. Maybe something
> with "reconnect" in the name would be more representative?
>
Oops, I forgot it.
I post a new version patch according to your comments.
And I have test it with gdb-7.4 and got fail.
Best,
Hui
2012-04-05 Hui Zhu <hui_zhu@mentor.com>
* gdb.trace/Makefile.in (PROGS): Add
disconnected-tracing.
* gdb.trace/disconnected-tracing.c: New file.
* gdb.trace/disconnected-tracing.exp: New file.
[-- Attachment #2: disconnected-tracing.txt --]
[-- Type: text/plain, Size: 3932 bytes --]
---
testsuite/gdb.trace/Makefile.in | 2
testsuite/gdb.trace/disconnected-tracing.c | 22 +++++++
testsuite/gdb.trace/disconnected-tracing.exp | 76 +++++++++++++++++++++++++++
3 files changed, 99 insertions(+), 1 deletion(-)
--- a/testsuite/gdb.trace/Makefile.in
+++ b/testsuite/gdb.trace/Makefile.in
@@ -5,7 +5,7 @@ srcdir = @srcdir@
PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
- while-stepping
+ while-stepping disconnected-tracing
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.c
@@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+main()
+{
+ return 0;
+}
\ No newline at end of file
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.exp
@@ -0,0 +1,76 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test of disconnected-tracing.
+
+load_lib "trace-support.exp";
+
+set testfile "disconnected-tracing"
+set executable $testfile
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+set expfile $testfile.exp
+set gdbserver_reconnect_p 1
+
+if { [info proc gdb_reconnect] == "" } {
+ unsupported "target does not support reconnect"
+ return -1
+}
+
+if [prepare_for_testing $expfile $executable $srcfile \
+ {debug nowarnings}] {
+ untested "failed to prepare for trace tests"
+ return -1
+}
+
+if ![runto_main] {
+ fail "can't run to main to check for trace support"
+ return -1
+}
+
+if ![gdb_target_supports_trace] {
+ unsupported "target does not support trace"
+ return -1;
+}
+
+delete_breakpoints
+gdb_test_no_output "set confirm off"
+gdb_test_no_output "set disconnected-tracing on"
+gdb_test "trace main" ".*"
+gdb_test_no_output "tstart"
+
+gdb_test "info tracepoints" ".*in main at.*" "First info tracepoints"
+
+gdb_test "disconnect" "Ending remote debugging\\."
+if { [gdb_reconnect] == 0 } {
+ pass "reconnect after unload"
+} else {
+ fail "reconnect after unload"
+ return 0
+}
+gdb_test "info tracepoints" ".*in main at.*" "Second info tracepoints"
+
+delete_breakpoints
+gdb_test "info tracepoints" ".*No tracepoints..*" "Third info tracepoints"
+
+gdb_test "disconnect" "Ending remote debugging\\."
+if { [gdb_reconnect] == 0 } {
+ pass "reconnect after unload"
+} else {
+ fail "reconnect after unload"
+ return 0
+}
+gdb_test "info tracepoints" ".*in main at.*" "Fourth info tracepoints"
+
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-04-05 8:14 ` Hui Zhu
@ 2012-04-05 11:51 ` Pedro Alves
2012-04-11 5:58 ` Hui Zhu
2012-04-08 7:59 ` Yao Qi
1 sibling, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-04-05 11:51 UTC (permalink / raw)
To: Hui Zhu; +Cc: Tom Tromey, gdb-patches
On 04/05/2012 09:14 AM, Hui Zhu wrote:
> I post a new version patch according to your comments.
> And I have test it with gdb-7.4 and got fail.
Thanks. Only a few nits remain, and this is technically ready to
check in. See below.
However, what's the status of your copyright assignment? Last I
heard (and from what I see in FSF's copyright assignment records), we
still can't accept changes from you on behalf of Mentor. :-(
> 2012-04-05 Hui Zhu <hui_zhu@mentor.com>
>
> * gdb.trace/Makefile.in (PROGS): Add
> disconnected-tracing.
This fits fine on a single line. Please do that.
> * gdb.trace/disconnected-tracing.c: New file.
> * gdb.trace/disconnected-tracing.exp: New file.
>
> --- /dev/null
> +++ b/testsuite/gdb.trace/disconnected-tracing.c
...
> +
> +int
> +main()
Might as well follow the coding standards, and add a space before parens.
> +{
> + return 0;
> +}
> \ No newline at end of file
^^^^^^^^^^^^^^^^^^^^^^^^^
Please add a newline.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-04-05 8:14 ` Hui Zhu
2012-04-05 11:51 ` Pedro Alves
@ 2012-04-08 7:59 ` Yao Qi
1 sibling, 0 replies; 15+ messages in thread
From: Yao Qi @ 2012-04-08 7:59 UTC (permalink / raw)
To: Hui Zhu; +Cc: Pedro Alves, Tom Tromey, gdb-patches
On 04/05/2012 04:14 PM, Hui Zhu wrote:
> PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
> report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
> - while-stepping
> + while-stepping disconnected-tracing
Do we want to keep the alphabetic order of this list? Looks like this
list is in alphabetic order, it is better to keep it.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-04-05 11:51 ` Pedro Alves
@ 2012-04-11 5:58 ` Hui Zhu
2012-05-10 4:19 ` Hui Zhu
0 siblings, 1 reply; 15+ messages in thread
From: Hui Zhu @ 2012-04-11 5:58 UTC (permalink / raw)
To: Pedro Alves; +Cc: Tom Tromey, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]
On 04/05/12 19:50, Pedro Alves wrote:
> On 04/05/2012 09:14 AM, Hui Zhu wrote:
>
>> I post a new version patch according to your comments.
>> And I have test it with gdb-7.4 and got fail.
>
>
> Thanks. Only a few nits remain, and this is technically ready to
> check in. See below.
>
> However, what's the status of your copyright assignment? Last I
> heard (and from what I see in FSF's copyright assignment records), we
> still can't accept changes from you on behalf of Mentor. :-(
What I got is it is OK now. I will send you a mail and cc the people
that about the law.
>
>> 2012-04-05 Hui Zhu<hui_zhu@mentor.com>
>>
>> * gdb.trace/Makefile.in (PROGS): Add
>> disconnected-tracing.
>
>
> This fits fine on a single line. Please do that.
>
>> * gdb.trace/disconnected-tracing.c: New file.
>> * gdb.trace/disconnected-tracing.exp: New file.
>>
>
>
>> --- /dev/null
>> +++ b/testsuite/gdb.trace/disconnected-tracing.c
>
> ...
>
>> +
>> +int
>> +main()
>
>
> Might as well follow the coding standards, and add a space before parens.
>
>> +{
>> + return 0;
>> +}
>> \ No newline at end of file
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Please add a newline.
>
Post a new version according to your commnets.
Thanks,
Hui
2012-04-11 Hui Zhu <hui_zhu@mentor.com>
* gdb.trace/Makefile.in (PROGS): Add disconnected-tracing.
* gdb.trace/disconnected-tracing.c: New file.
* gdb.trace/disconnected-tracing.exp: New file.
[-- Attachment #2: disconnected-tracing.txt --]
[-- Type: text/plain, Size: 3904 bytes --]
---
testsuite/gdb.trace/Makefile.in | 2
testsuite/gdb.trace/disconnected-tracing.c | 21 +++++++
testsuite/gdb.trace/disconnected-tracing.exp | 76 +++++++++++++++++++++++++++
3 files changed, 98 insertions(+), 1 deletion(-)
--- a/testsuite/gdb.trace/Makefile.in
+++ b/testsuite/gdb.trace/Makefile.in
@@ -5,7 +5,7 @@ srcdir = @srcdir@
PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
- while-stepping
+ while-stepping disconnected-tracing
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.c
@@ -0,0 +1,21 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int main ()
+{
+ return 0;
+}
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.exp
@@ -0,0 +1,76 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test of disconnected-tracing.
+
+load_lib "trace-support.exp";
+
+set testfile "disconnected-tracing"
+set executable $testfile
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+set expfile $testfile.exp
+set gdbserver_reconnect_p 1
+
+if { [info proc gdb_reconnect] == "" } {
+ unsupported "target does not support reconnect"
+ return -1
+}
+
+if [prepare_for_testing $expfile $executable $srcfile \
+ {debug nowarnings}] {
+ untested "failed to prepare for trace tests"
+ return -1
+}
+
+if ![runto_main] {
+ fail "can't run to main to check for trace support"
+ return -1
+}
+
+if ![gdb_target_supports_trace] {
+ unsupported "target does not support trace"
+ return -1;
+}
+
+delete_breakpoints
+gdb_test_no_output "set confirm off"
+gdb_test_no_output "set disconnected-tracing on"
+gdb_test "trace main" ".*"
+gdb_test_no_output "tstart"
+
+gdb_test "info tracepoints" ".*in main at.*" "First info tracepoints"
+
+gdb_test "disconnect" "Ending remote debugging\\."
+if { [gdb_reconnect] == 0 } {
+ pass "reconnect after unload"
+} else {
+ fail "reconnect after unload"
+ return 0
+}
+gdb_test "info tracepoints" ".*in main at.*" "Second info tracepoints"
+
+delete_breakpoints
+gdb_test "info tracepoints" ".*No tracepoints..*" "Third info tracepoints"
+
+gdb_test "disconnect" "Ending remote debugging\\."
+if { [gdb_reconnect] == 0 } {
+ pass "reconnect after unload"
+} else {
+ fail "reconnect after unload"
+ return 0
+}
+gdb_test "info tracepoints" ".*in main at.*" "Fourth info tracepoints"
+
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-04-11 5:58 ` Hui Zhu
@ 2012-05-10 4:19 ` Hui Zhu
2012-05-10 11:57 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: Hui Zhu @ 2012-05-10 4:19 UTC (permalink / raw)
To: Pedro Alves; +Cc: Tom Tromey, gdb-patches
On 04/11/12 13:44, Hui Zhu wrote:
> On 04/05/12 19:50, Pedro Alves wrote:
>> On 04/05/2012 09:14 AM, Hui Zhu wrote:
>>
>>> I post a new version patch according to your comments.
>>> And I have test it with gdb-7.4 and got fail.
>>
>>
>> Thanks. Only a few nits remain, and this is technically ready to
>> check in. See below.
>>
>> However, what's the status of your copyright assignment? Last I
>> heard (and from what I see in FSF's copyright assignment records), we
>> still can't accept changes from you on behalf of Mentor. :-(
>
> What I got is it is OK now. I will send you a mail and cc the people that about the law.
Hi Pedro,
The copyright issue is OK now. Do you think I can check in this patch?
Thanks,
Hui
>
>>
>>> 2012-04-05 Hui Zhu<hui_zhu@mentor.com>
>>>
>>> * gdb.trace/Makefile.in (PROGS): Add
>>> disconnected-tracing.
>>
>>
>> This fits fine on a single line. Please do that.
>>
>>> * gdb.trace/disconnected-tracing.c: New file.
>>> * gdb.trace/disconnected-tracing.exp: New file.
>>>
>>
>>
>>> --- /dev/null
>>> +++ b/testsuite/gdb.trace/disconnected-tracing.c
>>
>> ...
>>
>>> +
>>> +int
>>> +main()
>>
>>
>> Might as well follow the coding standards, and add a space before parens.
>>
>>> +{
>>> + return 0;
>>> +}
>>> \ No newline at end of file
>>
>> ^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> Please add a newline.
>>
>
> Post a new version according to your commnets.
>
> Thanks,
> Hui
>
> 2012-04-11 Hui Zhu <hui_zhu@mentor.com>
>
> * gdb.trace/Makefile.in (PROGS): Add disconnected-tracing.
> * gdb.trace/disconnected-tracing.c: New file.
> * gdb.trace/disconnected-tracing.exp: New file.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-05-10 4:19 ` Hui Zhu
@ 2012-05-10 11:57 ` Pedro Alves
2012-05-10 15:05 ` Hui Zhu
0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-05-10 11:57 UTC (permalink / raw)
To: Hui Zhu; +Cc: Tom Tromey, gdb-patches
On 05/10/2012 05:18 AM, Hui Zhu wrote:
> On 04/11/12 13:44, Hui Zhu wrote:
>> On 04/05/12 19:50, Pedro Alves wrote:
>>> On 04/05/2012 09:14 AM, Hui Zhu wrote:
>>>
>>>> I post a new version patch according to your comments.
>>>> And I have test it with gdb-7.4 and got fail.
>>>
>>>
>>> Thanks. Only a few nits remain, and this is technically ready to
>>> check in. See below.
>>>
>>> However, what's the status of your copyright assignment? Last I
>>> heard (and from what I see in FSF's copyright assignment records), we
>>> still can't accept changes from you on behalf of Mentor. :-(
>>
>> What I got is it is OK now. I will send you a mail and cc the people that about the law.
>
> Hi Pedro,
>
> The copyright issue is OK now.
Yep, took a while, but it's sorted now. Thanks for your patience.
> Do you think I can check in this patch?
I took another look at the patch, and I now notice you didn't address
some of my early comments in <http://sourceware.org/ml/gdb-patches/2012-03/msg00987.html>:
> Please always look at the resulting messages in gdb.sum:
..
> There are duplicate messages here. See
> <http://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique>.
>
> I'd lowercase the "First", etc., in the test messages. It's much more common.
This is what I get now:
>cat testsuite/gdb.sum| grep PASS | sort | uniq -c | sort -nr
2 PASS: gdb.trace/disconnected-tracing.exp: reconnect after unload
2 PASS: gdb.trace/disconnected-tracing.exp: disconnect
1 PASS: gdb.trace/disconnected-tracing.exp: tstart
1 PASS: gdb.trace/disconnected-tracing.exp: trace main
1 PASS: gdb.trace/disconnected-tracing.exp: Third info tracepoints
1 PASS: gdb.trace/disconnected-tracing.exp: set disconnected-tracing on
1 PASS: gdb.trace/disconnected-tracing.exp: set confirm off
1 PASS: gdb.trace/disconnected-tracing.exp: Second info tracepoints
1 PASS: gdb.trace/disconnected-tracing.exp: Fourth info tracepoints
1 PASS: gdb.trace/disconnected-tracing.exp: First info tracepoints
Yao also made a valid comment here:
<http://sourceware.org/ml/gdb-patches/2012-04/msg00124.html>
that doesn't appear to have been addressed.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-05-10 11:57 ` Pedro Alves
@ 2012-05-10 15:05 ` Hui Zhu
2012-05-10 15:10 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: Hui Zhu @ 2012-05-10 15:05 UTC (permalink / raw)
To: Pedro Alves; +Cc: Hui Zhu, Tom Tromey, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 2803 bytes --]
On Thu, May 10, 2012 at 7:56 PM, Pedro Alves <palves@redhat.com> wrote:
> On 05/10/2012 05:18 AM, Hui Zhu wrote:
>
>> On 04/11/12 13:44, Hui Zhu wrote:
>>> On 04/05/12 19:50, Pedro Alves wrote:
>>>> On 04/05/2012 09:14 AM, Hui Zhu wrote:
>>>>
>>>>> I post a new version patch according to your comments.
>>>>> And I have test it with gdb-7.4 and got fail.
>>>>
>>>>
>>>> Thanks. Only a few nits remain, and this is technically ready to
>>>> check in. See below.
>>>>
>>>> However, what's the status of your copyright assignment? Last I
>>>> heard (and from what I see in FSF's copyright assignment records), we
>>>> still can't accept changes from you on behalf of Mentor. :-(
>>>
>>> What I got is it is OK now. I will send you a mail and cc the people that about the law.
>>
>> Hi Pedro,
>>
>> The copyright issue is OK now.
>
>
> Yep, took a while, but it's sorted now. Thanks for your patience.
>
>> Do you think I can check in this patch?
>
>
> I took another look at the patch, and I now notice you didn't address
> some of my early comments in <http://sourceware.org/ml/gdb-patches/2012-03/msg00987.html>:
>
>> Please always look at the resulting messages in gdb.sum:
> ..
>> There are duplicate messages here. See
>> <http://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique>.
>>
>> I'd lowercase the "First", etc., in the test messages. It's much more common.
>
> This is what I get now:
>
>>cat testsuite/gdb.sum| grep PASS | sort | uniq -c | sort -nr
> 2 PASS: gdb.trace/disconnected-tracing.exp: reconnect after unload
> 2 PASS: gdb.trace/disconnected-tracing.exp: disconnect
> 1 PASS: gdb.trace/disconnected-tracing.exp: tstart
> 1 PASS: gdb.trace/disconnected-tracing.exp: trace main
> 1 PASS: gdb.trace/disconnected-tracing.exp: Third info tracepoints
> 1 PASS: gdb.trace/disconnected-tracing.exp: set disconnected-tracing on
> 1 PASS: gdb.trace/disconnected-tracing.exp: set confirm off
> 1 PASS: gdb.trace/disconnected-tracing.exp: Second info tracepoints
> 1 PASS: gdb.trace/disconnected-tracing.exp: Fourth info tracepoints
> 1 PASS: gdb.trace/disconnected-tracing.exp: First info tracepoints
>
> Yao also made a valid comment here:
>
> <http://sourceware.org/ml/gdb-patches/2012-04/msg00124.html>
>
> that doesn't appear to have been addressed.
>
> --
> Pedro Alves
Hi Pedro,
I post a new version that lowercase the pass info and update
Makefile.in according to Yao's comments. Please help me review it.
Thanks,
Hui
2012-05-10 Hui Zhu <hui_zhu@mentor.com>
* gdb.trace/Makefile.in (PROGS): Add disconnected-tracing.
* gdb.trace/disconnected-tracing.c: New file.
* gdb.trace/disconnected-tracing.exp: New file.
[-- Attachment #2: disconnected-tracing.txt --]
[-- Type: text/plain, Size: 4103 bytes --]
---
testsuite/gdb.trace/Makefile.in | 6 +-
testsuite/gdb.trace/disconnected-tracing.c | 21 +++++++
testsuite/gdb.trace/disconnected-tracing.exp | 76 +++++++++++++++++++++++++++
3 files changed, 100 insertions(+), 3 deletions(-)
--- a/testsuite/gdb.trace/Makefile.in
+++ b/testsuite/gdb.trace/Makefile.in
@@ -3,9 +3,9 @@ srcdir = @srcdir@
.PHONY: all clean mostlyclean distclean realclean
-PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
- report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
- while-stepping
+PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \
+ passc-dyn passcount report save-trace tfile tfind tracecmd tsv \
+ unavailable while-dyn while-stepping
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.c
@@ -0,0 +1,21 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int main ()
+{
+ return 0;
+}
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.exp
@@ -0,0 +1,76 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test of disconnected-tracing.
+
+load_lib "trace-support.exp";
+
+set testfile "disconnected-tracing"
+set executable $testfile
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+set expfile $testfile.exp
+set gdbserver_reconnect_p 1
+
+if { [info proc gdb_reconnect] == "" } {
+ unsupported "target does not support reconnect"
+ return -1
+}
+
+if [prepare_for_testing $expfile $executable $srcfile \
+ {debug nowarnings}] {
+ untested "failed to prepare for trace tests"
+ return -1
+}
+
+if ![runto_main] {
+ fail "can't run to main to check for trace support"
+ return -1
+}
+
+if ![gdb_target_supports_trace] {
+ unsupported "target does not support trace"
+ return -1;
+}
+
+delete_breakpoints
+gdb_test_no_output "set confirm off"
+gdb_test_no_output "set disconnected-tracing on"
+gdb_test "trace main" ".*"
+gdb_test_no_output "tstart"
+
+gdb_test "info tracepoints" ".*in main at.*" "first info tracepoints"
+
+gdb_test "disconnect" "Ending remote debugging\\."
+if { [gdb_reconnect] == 0 } {
+ pass "reconnect after unload"
+} else {
+ fail "reconnect after unload"
+ return 0
+}
+gdb_test "info tracepoints" ".*in main at.*" "second info tracepoints"
+
+delete_breakpoints
+gdb_test "info tracepoints" ".*No tracepoints..*" "third info tracepoints"
+
+gdb_test "disconnect" "Ending remote debugging\\."
+if { [gdb_reconnect] == 0 } {
+ pass "reconnect after unload"
+} else {
+ fail "reconnect after unload"
+ return 0
+}
+gdb_test "info tracepoints" ".*in main at.*" "fourth info tracepoints"
+
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-05-10 15:05 ` Hui Zhu
@ 2012-05-10 15:10 ` Pedro Alves
2012-05-11 0:59 ` Hui Zhu
0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-05-10 15:10 UTC (permalink / raw)
To: Hui Zhu; +Cc: Hui Zhu, Tom Tromey, gdb-patches
On 05/10/2012 04:04 PM, Hui Zhu wrote:
> I post a new version that lowercase the pass info and update
> Makefile.in according to Yao's comments. Please help me review it.
Again, please read:
<http://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique>.
You still have duplicate messages.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-05-10 15:10 ` Pedro Alves
@ 2012-05-11 0:59 ` Hui Zhu
2012-05-11 10:45 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: Hui Zhu @ 2012-05-11 0:59 UTC (permalink / raw)
To: Pedro Alves; +Cc: Hui Zhu, Tom Tromey, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 779 bytes --]
On Thu, May 10, 2012 at 11:10 PM, Pedro Alves <palves@redhat.com> wrote:
> On 05/10/2012 04:04 PM, Hui Zhu wrote:
>
>> I post a new version that lowercase the pass info and update
>> Makefile.in according to Yao's comments. Please help me review it.
>
>
> Again, please read:
>
> <http://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique>.
>
> You still have duplicate messages.
>
> --
> Pedro Alves
Hi Pedro,
Sorry for misunderstand your comments. I post a new patch fixed it.
Please help me review it.
Thanks,
Hui
2012-05-11 Hui Zhu <hui_zhu@mentor.com>
* gdb.trace/Makefile.in (PROGS): Add disconnected-tracing.
* gdb.trace/disconnected-tracing.c: New file.
* gdb.trace/disconnected-tracing.exp: New file.
[-- Attachment #2: disconnected-tracing.txt --]
[-- Type: text/plain, Size: 4168 bytes --]
---
testsuite/gdb.trace/Makefile.in | 6 +-
testsuite/gdb.trace/disconnected-tracing.c | 21 +++++++
testsuite/gdb.trace/disconnected-tracing.exp | 76 +++++++++++++++++++++++++++
3 files changed, 100 insertions(+), 3 deletions(-)
--- a/testsuite/gdb.trace/Makefile.in
+++ b/testsuite/gdb.trace/Makefile.in
@@ -3,9 +3,9 @@ srcdir = @srcdir@
.PHONY: all clean mostlyclean distclean realclean
-PROGS = ax backtrace deltrace infotrace packetlen passc-dyn passcount \
- report save-trace tfile tfind tracecmd tsv unavailable while-dyn \
- while-stepping
+PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \
+ passc-dyn passcount report save-trace tfile tfind tracecmd tsv \
+ unavailable while-dyn while-stepping
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.c
@@ -0,0 +1,21 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int main ()
+{
+ return 0;
+}
--- /dev/null
+++ b/testsuite/gdb.trace/disconnected-tracing.exp
@@ -0,0 +1,76 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test of disconnected-tracing.
+
+load_lib "trace-support.exp";
+
+set testfile "disconnected-tracing"
+set executable $testfile
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+set expfile $testfile.exp
+set gdbserver_reconnect_p 1
+
+if { [info proc gdb_reconnect] == "" } {
+ unsupported "target does not support reconnect"
+ return -1
+}
+
+if [prepare_for_testing $expfile $executable $srcfile \
+ {debug nowarnings}] {
+ untested "failed to prepare for trace tests"
+ return -1
+}
+
+if ![runto_main] {
+ fail "can't run to main to check for trace support"
+ return -1
+}
+
+if ![gdb_target_supports_trace] {
+ unsupported "target does not support trace"
+ return -1;
+}
+
+delete_breakpoints
+gdb_test_no_output "set confirm off"
+gdb_test_no_output "set disconnected-tracing on"
+gdb_test "trace main" ".*"
+gdb_test_no_output "tstart"
+
+gdb_test "info tracepoints" ".*in main at.*" "first info tracepoints"
+
+gdb_test "disconnect" "Ending remote debugging\\." "first disconnect"
+if { [gdb_reconnect] == 0 } {
+ pass "first reconnect after unload"
+} else {
+ fail "first reconnect after unload"
+ return 0
+}
+gdb_test "info tracepoints" ".*in main at.*" "second info tracepoints"
+
+delete_breakpoints
+gdb_test "info tracepoints" ".*No tracepoints..*" "third info tracepoints"
+
+gdb_test "disconnect" "Ending remote debugging\\." "second disconnect"
+if { [gdb_reconnect] == 0 } {
+ pass "second reconnect after unload"
+} else {
+ fail "second reconnect after unload"
+ return 0
+}
+gdb_test "info tracepoints" ".*in main at.*" "fourth info tracepoints"
+
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-05-11 0:59 ` Hui Zhu
@ 2012-05-11 10:45 ` Pedro Alves
2012-05-14 2:25 ` Hui Zhu
0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-05-11 10:45 UTC (permalink / raw)
To: Hui Zhu; +Cc: Hui Zhu, Tom Tromey, gdb-patches
On 05/11/2012 01:58 AM, Hui Zhu wrote:
> 2012-05-11 Hui Zhu <hui_zhu@mentor.com>
>
> * gdb.trace/Makefile.in (PROGS): Add disconnected-tracing.
> * gdb.trace/disconnected-tracing.c: New file.
> * gdb.trace/disconnected-tracing.exp: New file.
This versions is okay, thanks.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH]testsuite: test for disconnected-tracing
2012-05-11 10:45 ` Pedro Alves
@ 2012-05-14 2:25 ` Hui Zhu
0 siblings, 0 replies; 15+ messages in thread
From: Hui Zhu @ 2012-05-14 2:25 UTC (permalink / raw)
To: Pedro Alves; +Cc: Hui Zhu, Tom Tromey, gdb-patches
On 05/11/12 18:45, Pedro Alves wrote:
> On 05/11/2012 01:58 AM, Hui Zhu wrote:
>
>> 2012-05-11 Hui Zhu <hui_zhu@mentor.com>
>>
>> * gdb.trace/Makefile.in (PROGS): Add disconnected-tracing.
>> * gdb.trace/disconnected-tracing.c: New file.
>> * gdb.trace/disconnected-tracing.exp: New file.
>
>
> This versions is okay, thanks.
>
Thanks for your help.
Checked in. http://sourceware.org/ml/gdb-cvs/2012-05/msg00097.html
Best,
Hui
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-05-14 2:25 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-27 14:00 [PATCH]testsuite: test for disconnected-tracing Hui Zhu
2012-03-28 18:51 ` Tom Tromey
2012-03-29 1:17 ` Hui Zhu
2012-03-29 11:37 ` Pedro Alves
2012-04-05 8:14 ` Hui Zhu
2012-04-05 11:51 ` Pedro Alves
2012-04-11 5:58 ` Hui Zhu
2012-05-10 4:19 ` Hui Zhu
2012-05-10 11:57 ` Pedro Alves
2012-05-10 15:05 ` Hui Zhu
2012-05-10 15:10 ` Pedro Alves
2012-05-11 0:59 ` Hui Zhu
2012-05-11 10:45 ` Pedro Alves
2012-05-14 2:25 ` Hui Zhu
2012-04-08 7:59 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox