* [PATCH] Add CTF support to GDB [5] Add test for CTF function
@ 2013-01-14 3:49 Hui Zhu
2013-01-14 12:44 ` Yao Qi
2013-01-14 13:30 ` Joel Brobecker
0 siblings, 2 replies; 14+ messages in thread
From: Hui Zhu @ 2013-01-14 3:49 UTC (permalink / raw)
To: gdb-patches ml, Tom Tromey
[-- Attachment #1: Type: text/plain, Size: 420 bytes --]
Hi,
According to the comments from Tom. I make a patch to add test for
CTF function.
This test will test both "tsave -ctf" and "target ctf" function. You
can use following command call it:
make check RUNTESTFLAGS="--target_board=native-gdbserver ctf.exp"
Thanks,
Hui
2013-01-14 Hui Zhu <hui_zhu@mentor.com>
* gdb.trace/Makefile.in (PROGS): Add ctf.
* gdb.trace/ctf.c: New file.
* gdb.trace/ctf.exp: New file.
[-- Attachment #2: ctf-test.txt --]
[-- Type: text/plain, Size: 3617 bytes --]
--- a/testsuite/gdb.trace/Makefile.in
+++ b/testsuite/gdb.trace/Makefile.in
@@ -5,7 +5,7 @@ srcdir = @srcdir@
PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \
passc-dyn passcount report save-trace tfile tfind tracecmd tsv \
- unavailable while-dyn while-stepping
+ unavailable while-dyn while-stepping ctf
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
--- /dev/null
+++ b/testsuite/gdb.trace/ctf.c
@@ -0,0 +1,33 @@
+typedef char test_t1;
+typedef test_t1 test_t2;
+typedef test_t2 test_t3;
+
+void
+end (void)
+{}
+
+int
+main ()
+{
+ int i;
+ int a = 0;
+ test_t3 b = 1;
+ test_t3 c[][4] = {"123", "456", "789", "123", "456", "789"};
+ struct
+ {
+ int a;
+ int b;
+ } d[2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}};
+
+ for (i = 0; i < 10; i++)
+ {
+ ++a;
+ ++b;
+ ++c[0][1];
+ ++d[0][1].a;
+ }
+
+ end ();
+
+ return 0;
+}
--- /dev/null
+++ b/testsuite/gdb.trace/ctf.exp
@@ -0,0 +1,91 @@
+# Copyright 2013 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/>.
+
+load_lib "trace-support.exp";
+
+standard_testfile
+set executable $testfile
+set expfile $testfile.exp
+set ctfdir $testfile.ctf
+
+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;
+}
+
+
+#Test "tsave -ctf"
+
+gdb_test "trace 24" "Tracepoint \[0-9\]+ at .*"
+gdb_trace_setactions "set action for line 24" "" \
+ "collect \$local" "^$"
+gdb_test "trace 25" "Tracepoint \[0-9\]+ at .*"
+gdb_trace_setactions "set action for line 25" "" \
+ "collect \$reg" "^$"
+
+gdb_test_no_output "tstart"
+
+gdb_test "break end" "Breakpoint ${decimal} at .*"
+gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*"
+gdb_test_no_output "tstop"
+
+gdb_test "tsave -ctf $ctfdir" "Trace data saved to directory \'$ctfdir\'."
+
+set ret [exec whereis babeltrace]
+if { [string compare "babeltrace:" $ret] == 0 } then {
+ unsupported "babeltrace check ctf directory"
+} else {
+ set ret [catch {exec babeltrace $ctfdir} results]
+ if { $ret != 0 } then {
+ fail "babeltrace open ctf directory"
+ return -1
+ }
+}
+
+
+#Test "target ctf"
+
+gdb_test_no_output "set confirm off"
+gdb_test_no_output "target ctf $ctfdir"
+
+gdb_test "tfind 0" ".*Found trace frame 0.*"
+gdb_test "tdump" ".*b = 1.*a = 0.*i = 0.*"
+gdb_test "print \$b" ".* = 1.*"
+gdb_test "print \$a" ".* = 0.*"
+gdb_test "print \$i" ".* = 0.*"
+
+gdb_test "tfind 1" ".*Found trace frame 1.*"
+
+gdb_test "tfind 2" ".*Found trace frame 2.*"
+gdb_test "tdump" ".*b = 2.*a = 1.*i = 1.*"
+gdb_test "print \$b" ".* = 2.*"
+gdb_test "print \$a" ".* = 1.*"
+gdb_test "print \$i" ".* = 1.*"
+
+
+#Clean
+
+exec rm -rf $ctfdir
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-14 3:49 [PATCH] Add CTF support to GDB [5] Add test for CTF function Hui Zhu @ 2013-01-14 12:44 ` Yao Qi 2013-01-15 11:19 ` Hui Zhu 2013-01-14 13:30 ` Joel Brobecker 1 sibling, 1 reply; 14+ messages in thread From: Yao Qi @ 2013-01-14 12:44 UTC (permalink / raw) To: Hui Zhu; +Cc: gdb-patches ml, Tom Tromey On 01/14/2013 11:48 AM, Hui Zhu wrote: > --- a/testsuite/gdb.trace/Makefile.in > +++ b/testsuite/gdb.trace/Makefile.in > @@ -5,7 +5,7 @@ srcdir = @srcdir@ > > PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \ > passc-dyn passcount report save-trace tfile tfind tracecmd tsv \ > - unavailable while-dyn while-stepping > + unavailable while-dyn while-stepping ctf Looks we should keep the alphabetic order of this list. > --- /dev/null > +++ b/testsuite/gdb.trace/ctf.exp > + > +#Test "tsave -ctf" > + > +gdb_test "trace 24" "Tracepoint \[0-9\]+ at .*" We can use 'gdb_get_line_number' instead of hard-code the line number. > +gdb_trace_setactions "set action for line 24" "" \ > + "collect \$local" "^$" > +gdb_test "trace 25" "Tracepoint \[0-9\]+ at .*" Likewise. > +gdb_trace_setactions "set action for line 25" "" \ > + "collect \$reg" "^$" > + > +gdb_test_no_output "tstart" > + > +gdb_test "break end" "Breakpoint ${decimal} at .*" > +gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" > +gdb_test_no_output "tstop" > + > +gdb_test "tsave -ctf $ctfdir" "Trace data saved to directory \'$ctfdir\'." > + What if GDB is built without ctf support? > +set ret [exec whereis babeltrace] We should use 'remote_exec host' instead of 'exec' and I am not sure it is portable to check 'babeltrace' exist by 'whereis'. > +if { [string compare "babeltrace:" $ret] == 0 } then { > + unsupported "babeltrace check ctf directory" > +} else { > + set ret [catch {exec babeltrace $ctfdir} results] remote_exec host 'babeltrace $ctfdir' > + if { $ret != 0 } then { > + fail "babeltrace open ctf directory" > + return -1 > + } > +} > + > + > +#Test "target ctf" > + > +gdb_test_no_output "set confirm off" > +gdb_test_no_output "target ctf $ctfdir" > + > +gdb_test "tfind 0" ".*Found trace frame 0.*" > +gdb_test "tdump" ".*b = 1.*a = 0.*i = 0.*" > +gdb_test "print \$b" ".* = 1.*" > +gdb_test "print \$a" ".* = 0.*" > +gdb_test "print \$i" ".* = 0.*" > + > +gdb_test "tfind 1" ".*Found trace frame 1.*" > + > +gdb_test "tfind 2" ".*Found trace frame 2.*" > +gdb_test "tdump" ".*b = 2.*a = 1.*i = 1.*" > +gdb_test "print \$b" ".* = 2.*" > +gdb_test "print \$a" ".* = 1.*" > +gdb_test "print \$i" ".* = 1.*" > + I don't run it but there must be some duplicated test results in gdb.sum, such as "tdump", "print $a", and etc. It is better to run 'tfind' until there is no trace frame in the trace file, to make sure no unexpected trace frame is generated. > + > +#Clean > + > +exec rm -rf $ctfdir remote_exec host "rm -rf $ctfdir" -- Yao (é½å°§) ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-14 12:44 ` Yao Qi @ 2013-01-15 11:19 ` Hui Zhu 2013-01-15 13:49 ` Yao Qi 0 siblings, 1 reply; 14+ messages in thread From: Hui Zhu @ 2013-01-15 11:19 UTC (permalink / raw) To: Yao Qi, Joel Brobecker; +Cc: gdb-patches ml, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 3665 bytes --] Hi Yao and Joel, Thanks for your review. On Mon, Jan 14, 2013 at 3:03 PM, Yao Qi <yao@codesourcery.com> wrote: > On 01/14/2013 11:48 AM, Hui Zhu wrote: >> >> --- a/testsuite/gdb.trace/Makefile.in >> +++ b/testsuite/gdb.trace/Makefile.in >> @@ -5,7 +5,7 @@ srcdir = @srcdir@ >> >> PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \ >> passc-dyn passcount report save-trace tfile tfind tracecmd tsv \ >> - unavailable while-dyn while-stepping >> + unavailable while-dyn while-stepping ctf > > > Looks we should keep the alphabetic order of this list. Fixed. > >> --- /dev/null >> +++ b/testsuite/gdb.trace/ctf.exp >> + >> +#Test "tsave -ctf" >> + >> +gdb_test "trace 24" "Tracepoint \[0-9\]+ at .*" > > > We can use 'gdb_get_line_number' instead of hard-code the line number. Fixed. > >> +gdb_trace_setactions "set action for line 24" "" \ >> + "collect \$local" "^$" >> +gdb_test "trace 25" "Tracepoint \[0-9\]+ at .*" > > > Likewise. > >> +gdb_trace_setactions "set action for line 25" "" \ >> + "collect \$reg" "^$" >> + >> +gdb_test_no_output "tstart" >> + >> +gdb_test "break end" "Breakpoint ${decimal} at .*" >> +gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" >> +gdb_test_no_output "tstop" >> + >> +gdb_test "tsave -ctf $ctfdir" "Trace data saved to directory >> \'$ctfdir\'." >> + > > > What if GDB is built without ctf support? Because tsave -ctf is not base on the babeltrace. So it is not a issue. Please see the last part of http://sourceware.org/ml/gdb-patches/2012-12/msg00492.html to see the introduce about that. And I added a check unsupport in "target ctf" because it need support of babeltrace. > >> +set ret [exec whereis babeltrace] > > > We should use 'remote_exec host' instead of 'exec' and I am not sure it is > portable to check 'babeltrace' exist by 'whereis'. I found an example in gas-defs.exp and update ctf.exp according to gas_version. > >> +if { [string compare "babeltrace:" $ret] == 0 } then { >> + unsupported "babeltrace check ctf directory" >> +} else { >> + set ret [catch {exec babeltrace $ctfdir} results] > > > remote_exec host 'babeltrace $ctfdir' > >> + if { $ret != 0 } then { >> + fail "babeltrace open ctf directory" >> + return -1 >> + } >> +} >> + >> + >> +#Test "target ctf" >> + >> +gdb_test_no_output "set confirm off" >> +gdb_test_no_output "target ctf $ctfdir" >> + >> +gdb_test "tfind 0" ".*Found trace frame 0.*" >> +gdb_test "tdump" ".*b = 1.*a = 0.*i = 0.*" >> +gdb_test "print \$b" ".* = 1.*" >> +gdb_test "print \$a" ".* = 0.*" >> +gdb_test "print \$i" ".* = 0.*" >> + >> +gdb_test "tfind 1" ".*Found trace frame 1.*" >> + >> +gdb_test "tfind 2" ".*Found trace frame 2.*" >> +gdb_test "tdump" ".*b = 2.*a = 1.*i = 1.*" >> +gdb_test "print \$b" ".* = 2.*" >> +gdb_test "print \$a" ".* = 1.*" >> +gdb_test "print \$i" ".* = 1.*" >> + > > > I don't run it but there must be some duplicated test results in gdb.sum, > such as "tdump", "print $a", and etc. > > It is better to run 'tfind' until there is no trace frame in the trace file, > to make sure no unexpected trace frame is generated. Fixed. > >> + >> +#Clean >> + >> +exec rm -rf $ctfdir > > > remote_exec host "rm -rf $ctfdir" > -- > Yao (齐尧) And I added copyright header in ctf.c. Post a new version. Please help me review it. Thanks, Hui 2013-01-15 Hui Zhu <hui_zhu@mentor.com> * gdb.trace/Makefile.in (PROGS): Add ctf. * gdb.trace/ctf.c: New file. * gdb.trace/ctf.exp: New file. [-- Attachment #2: ctf-test.txt --] [-- Type: text/plain, Size: 6774 bytes --] --- a/testsuite/gdb.trace/Makefile.in +++ b/testsuite/gdb.trace/Makefile.in @@ -3,7 +3,7 @@ srcdir = @srcdir@ .PHONY: all clean mostlyclean distclean realclean -PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \ +PROGS = ax backtrace ctf deltrace disconnected-tracing infotrace packetlen \ passc-dyn passcount report save-trace tfile tfind tracecmd tsv \ unavailable while-dyn while-stepping --- /dev/null +++ b/testsuite/gdb.trace/ctf.c @@ -0,0 +1,48 @@ +/* CTF test program. + + Copyright (C) 2013 Free Software Foundation, Inc. + + This file is part of GDB. + + 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/>. */ + +typedef char test_t1; +typedef test_t1 test_t2; +typedef test_t2 test_t3; + +int +main () +{ + int i; + int a = 0; + test_t3 b = 1; + test_t3 c[][4] = {"123", "456", "789", "123", "456", "789"}; + struct + { + int a; + int b; + } d[2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}}; + + for (i = 0; i < 10; i++) + { + ++a; /* set tracepoint 1 here */ + ++b; /* set tracepoint 2 here */ + ++c[0][1]; + ++d[0][1].a; + } + + /* set breakpoint end here */ + + return 0; +} --- /dev/null +++ b/testsuite/gdb.trace/ctf.exp @@ -0,0 +1,140 @@ +# Copyright 2013 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/>. + +load_lib "trace-support.exp"; + +standard_testfile +set executable $testfile +set expfile $testfile.exp +set ctfdir $testfile.ctf + +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; +} + + +#Test "tsave -ctf" + +set trace_location1 [gdb_get_line_number "set tracepoint 1 here"] +gdb_test "trace $trace_location1" "Tracepoint ${decimal} at .*" +gdb_trace_setactions "set action for line $trace_location1" "" \ + "collect \$local" "^$" + +set trace_location2 [gdb_get_line_number "set tracepoint 2 here"] +gdb_test "trace $trace_location2" "Tracepoint ${decimal} at .*" +gdb_trace_setactions "set action for line $trace_location2" "" \ + "collect \$reg" "^$" + +gdb_test_no_output "tstart" + +set break_end [gdb_get_line_number "set breakpoint end here"] +gdb_test "break $break_end" "Breakpoint ${decimal} at .*" + +gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" +gdb_test_no_output "tstop" + +gdb_test "tsave -ctf $ctfdir" "Trace data saved to directory \'$ctfdir\'." + +#Get the pathname of babeltrace and set it to $which_babeltrace. +#If host doesn't have babeltrace, $which_babeltrace will set to 0. +if [is_remote host] then { + remote_exec host "which babeltrace" "" "" "babeltrace.which" + remote_upload host "babeltrace.which" + set which_babeltrace [file_contents "babeltrace.which"] + remote_file build delete "babeltrace.which" + remote_file host delete "babeltrace.which" +} else { + set which_babeltrace [which babeltrace] +} + +if { $which_babeltrace == 0 } then { + unsupported "babeltrace check ctf directory" +} else { + #Let babeltrace output an error to make sure current way is right. + if [is_remote host] then { + remote_exec host "$which_babeltrace not_exist < /dev/null" "" "" "babeltrace.output" + remote_upload host "babeltrace.output" + set babeltrace_output [file_contents "babeltrace.output"] + remote_file build delete "babeltrace.output" + remote_file host delete "babeltrace.output" + } else { + catch "exec $which_babeltrace not_exist < /dev/null" babeltrace_output + } + if { [string last "\[error\]" $babeltrace_output] == -1 } then { + unsupported "babeltrace check ctf directory" + } else { + if [is_remote host] then { + remote_exec host "$which_babeltrace $ctfdir < /dev/null" "" "" "babeltrace.output" + remote_upload host "babeltrace.output" + set babeltrace_output [file_contents "babeltrace.output"] + remote_file build delete "babeltrace.output" + remote_file host delete "babeltrace.output" + } else { + catch "exec $which_babeltrace $ctfdir < /dev/null" babeltrace_output + } + if { [string last "\[error\]" $babeltrace_output] != -1 } then { + fail "babeltrace open ctf directory" + } + } +} + + +#Test "target ctf" +gdb_test_no_output "set confirm off" +gdb_test_no_output "kill" +gdb_test_multiple "target ctf $ctfdir" "" { + -re "Undefined target command: \"ctf ctf\.ctf\"\. Try \"help target\"\." { + unsupported "target does not support ctf" + remote_exec host "rm -rf $ctfdir" + return -1; + } + -re ".*fail.*" { + fail "target ctf $ctfdir" + } + -re "^$" { + pass "target ctf $ctfdir" + } +} + +gdb_test "tfind 0" ".*Found trace frame 0.*" "target ctf tfind 0" +gdb_test "tdump" ".*b = 1.*a = 0.*i = 0.*" "first target ctf tdump" +gdb_test "print \$b" ".* = 1.*" "first target ctf print \$b" +gdb_test "print \$a" ".* = 0.*" "first target ctf print \$a" +gdb_test "print \$i" ".* = 0.*" "first target ctf print \$i" + +gdb_test "tfind 1" ".*Found trace frame 1.*" "target ctf tfind 1" + +gdb_test "tfind 2" ".*Found trace frame 2.*" "target ctf tfind 2" +gdb_test "tdump" ".*b = 2.*a = 1.*i = 1.*" "second target ctf tdump" +gdb_test "print \$b" ".* = 2.*" "second target ctf print \$b" +gdb_test "print \$a" ".* = 1.*" "second target ctf print \$a" +gdb_test "print \$i" ".* = 1.*" "second target ctf print \$i" + + +#Clean + +remote_exec host "rm -rf $ctfdir" ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-15 11:19 ` Hui Zhu @ 2013-01-15 13:49 ` Yao Qi 2013-01-16 7:39 ` Hui Zhu 0 siblings, 1 reply; 14+ messages in thread From: Yao Qi @ 2013-01-15 13:49 UTC (permalink / raw) To: Hui Zhu; +Cc: Joel Brobecker, gdb-patches ml, Tom Tromey On 01/15/2013 07:18 PM, Hui Zhu wrote: > +#Get the pathname of babeltrace and set it to $which_babeltrace. > +#If host doesn't have babeltrace, $which_babeltrace will set to 0. > +if [is_remote host] then { > + remote_exec host "which babeltrace" "" "" "babeltrace.which" > + remote_upload host "babeltrace.which" > + set which_babeltrace [file_contents "babeltrace.which"] proc file_contents is not defined. FAIL: gdb.trace/ctf.exp: tsave -ctf ctf.ctf ERROR: (DejaGnu) proc "file_contents babeltrace.which" does not exist. The error code is NONE The info on the error is: invalid command name "file_contents" while executing "::tcl_unknown file_contents babeltrace.which" ("uplevel" body line 1) invoked from within "uplevel 1 ::tcl_unknown $args" You can run this test case in a remote-host setting in this way, $ make check RUNTESTFLAGS='--target_board=native-gdbserver --host_board=local-remote-host ctf.exp' > + remote_file build delete "babeltrace.which" > + remote_file host delete "babeltrace.which" > +} else { > + set which_babeltrace [which babeltrace] > +} > + > +if { $which_babeltrace == 0 } then { > + unsupported "babeltrace check ctf directory" > +} else { > + #Let babeltrace output an error to make sure current way is right. > + if [is_remote host] then { > + remote_exec host "$which_babeltrace not_exist < /dev/null" "" "" "babeltrace.output" > + remote_upload host "babeltrace.output" > + set babeltrace_output [file_contents "babeltrace.output"] > + remote_file build delete "babeltrace.output" > + remote_file host delete "babeltrace.output" > + } else { > + catch "exec $which_babeltrace not_exist < /dev/null" babeltrace_output > + } > + if { [string last "\[error\]" $babeltrace_output] == -1 } then { > + unsupported "babeltrace check ctf directory" > + } else { > + if [is_remote host] then { > + remote_exec host "$which_babeltrace $ctfdir < /dev/null" "" "" "babeltrace.output" > + remote_upload host "babeltrace.output" > + set babeltrace_output [file_contents "babeltrace.output"] > + remote_file build delete "babeltrace.output" > + remote_file host delete "babeltrace.output" > + } else { > + catch "exec $which_babeltrace $ctfdir < /dev/null" babeltrace_output > + } > + if { [string last "\[error\]" $babeltrace_output] != -1 } then { > + fail "babeltrace open ctf directory" > + } > + } > +} > + These code looks overkill to me. What we want to do here is to run babeltrace on host. Maybe we can do something simpler, remote_exec host "babeltrace $ctfdir < /dev/null" "" "" "output" remote_upload host "output" # Then check the content in file "output" to see 1) babeltrace exists, 2) the result of execution. > + > +#Test "target ctf" > +gdb_test_no_output "set confirm off" > +gdb_test_no_output "kill" > +gdb_test_multiple "target ctf $ctfdir" "" { > + -re "Undefined target command: \"ctf ctf\.ctf\"\. Try \"help target\"\." { > + unsupported "target does not support ctf" > + remote_exec host "rm -rf $ctfdir" > + return -1; > + } > + -re ".*fail.*" { > + fail "target ctf $ctfdir" > + } > + -re "^$" { > + pass "target ctf $ctfdir" > + } > +} Please add ".*\r\n$gdb_prompt $" at the end of each pattern to be matched to avoid racing. -- Yao (é½å°§) ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-15 13:49 ` Yao Qi @ 2013-01-16 7:39 ` Hui Zhu 2013-01-16 9:52 ` Yao Qi 0 siblings, 1 reply; 14+ messages in thread From: Hui Zhu @ 2013-01-16 7:39 UTC (permalink / raw) To: Yao Qi; +Cc: Joel Brobecker, gdb-patches ml, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 4203 bytes --] On Tue, Jan 15, 2013 at 9:48 PM, Yao Qi <yao@codesourcery.com> wrote: > On 01/15/2013 07:18 PM, Hui Zhu wrote: >> >> +#Get the pathname of babeltrace and set it to $which_babeltrace. >> +#If host doesn't have babeltrace, $which_babeltrace will set to 0. >> +if [is_remote host] then { >> + remote_exec host "which babeltrace" "" "" "babeltrace.which" >> + remote_upload host "babeltrace.which" >> + set which_babeltrace [file_contents "babeltrace.which"] > > > proc file_contents is not defined. > > FAIL: gdb.trace/ctf.exp: tsave -ctf ctf.ctf > ERROR: (DejaGnu) proc "file_contents babeltrace.which" does not exist. > The error code is NONE > The info on the error is: > invalid command name "file_contents" > while executing > "::tcl_unknown file_contents babeltrace.which" > ("uplevel" body line 1) > invoked from within > "uplevel 1 ::tcl_unknown $args" > > You can run this test case in a remote-host setting in this way, > > $ make check RUNTESTFLAGS='--target_board=native-gdbserver > --host_board=local-remote-host ctf.exp' I add a file_contents in ctf.exp. Not sure why my part can running without define "file_contents" inside ctf.exp. > >> + remote_file build delete "babeltrace.which" >> + remote_file host delete "babeltrace.which" >> +} else { >> + set which_babeltrace [which babeltrace] >> +} >> + >> +if { $which_babeltrace == 0 } then { >> >> + unsupported "babeltrace check ctf directory" >> +} else { >> + #Let babeltrace output an error to make sure current way is right. >> + if [is_remote host] then { >> + remote_exec host "$which_babeltrace not_exist < /dev/null" "" "" >> "babeltrace.output" >> + remote_upload host "babeltrace.output" >> + set babeltrace_output [file_contents "babeltrace.output"] >> + remote_file build delete "babeltrace.output" >> + remote_file host delete "babeltrace.output" >> + } else { >> + catch "exec $which_babeltrace not_exist < /dev/null" >> babeltrace_output >> + } >> + if { [string last "\[error\]" $babeltrace_output] == -1 } then { >> >> + unsupported "babeltrace check ctf directory" >> + } else { >> + if [is_remote host] then { >> + remote_exec host "$which_babeltrace $ctfdir < /dev/null" "" "" >> "babeltrace.output" >> + remote_upload host "babeltrace.output" >> + set babeltrace_output [file_contents "babeltrace.output"] >> + remote_file build delete "babeltrace.output" >> + remote_file host delete "babeltrace.output" >> + } else { >> + catch "exec $which_babeltrace $ctfdir < /dev/null" >> babeltrace_output >> + } >> + if { [string last "\[error\]" $babeltrace_output] != -1 } then { >> >> + fail "babeltrace open ctf directory" >> + } >> + } >> +} >> + > > > These code looks overkill to me. What we want to do here is to run > babeltrace on host. Maybe we can do something simpler, > > remote_exec host "babeltrace $ctfdir < /dev/null" "" "" "output" > remote_upload host "output" > # Then check the content in file "output" to see 1) babeltrace exists, 2) > the result of execution. If use test: make check RUNTESTFLAGS="--target_board=native-gdbserver ctf.exp" remote_exec host "babeltrace $ctfdir < /dev/null" "" "" "output" will get error. I think that is why gas_version have "if [is_remote host]" for that. > >> + >> +#Test "target ctf" >> +gdb_test_no_output "set confirm off" >> +gdb_test_no_output "kill" >> +gdb_test_multiple "target ctf $ctfdir" "" { >> + -re "Undefined target command: \"ctf ctf\.ctf\"\. Try \"help >> target\"\." { >> + unsupported "target does not support ctf" >> + remote_exec host "rm -rf $ctfdir" >> + return -1; >> + } >> + -re ".*fail.*" { >> + fail "target ctf $ctfdir" >> + } >> + -re "^$" { >> + pass "target ctf $ctfdir" >> + } >> +} > > > Please add ".*\r\n$gdb_prompt $" at the end of each pattern to be matched to > avoid racing. Fixed. > > -- > Yao (齐尧) Post a new version. Thanks, Hui [-- Attachment #2: ctf-test.txt --] [-- Type: text/plain, Size: 6966 bytes --] --- a/testsuite/gdb.trace/Makefile.in +++ b/testsuite/gdb.trace/Makefile.in @@ -3,7 +3,7 @@ srcdir = @srcdir@ .PHONY: all clean mostlyclean distclean realclean -PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \ +PROGS = ax backtrace ctf deltrace disconnected-tracing infotrace packetlen \ passc-dyn passcount report save-trace tfile tfind tracecmd tsv \ unavailable while-dyn while-stepping --- /dev/null +++ b/testsuite/gdb.trace/ctf.c @@ -0,0 +1,48 @@ +/* CTF test program. + + Copyright (C) 2013 Free Software Foundation, Inc. + + This file is part of GDB. + + 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/>. */ + +typedef char test_t1; +typedef test_t1 test_t2; +typedef test_t2 test_t3; + +int +main () +{ + int i; + int a = 0; + test_t3 b = 1; + test_t3 c[][4] = {"123", "456", "789", "123", "456", "789"}; + struct + { + int a; + int b; + } d[2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}}; + + for (i = 0; i < 10; i++) + { + ++a; /* set tracepoint 1 here */ + ++b; /* set tracepoint 2 here */ + ++c[0][1]; + ++d[0][1].a; + } + + /* set breakpoint end here */ + + return 0; +} --- /dev/null +++ b/testsuite/gdb.trace/ctf.exp @@ -0,0 +1,147 @@ +# Copyright 2013 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/>. + +load_lib "trace-support.exp"; + +proc file_contents { filename } { + set file [open $filename r] + set contents [read $file] + close $file + return $contents +} + +standard_testfile +set executable $testfile +set expfile $testfile.exp +set ctfdir $testfile.ctf + +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; +} + + +#Test "tsave -ctf" + +set trace_location1 [gdb_get_line_number "set tracepoint 1 here"] +gdb_test "trace $trace_location1" "Tracepoint ${decimal} at .*" +gdb_trace_setactions "set action for line $trace_location1" "" \ + "collect \$local" "^$" + +set trace_location2 [gdb_get_line_number "set tracepoint 2 here"] +gdb_test "trace $trace_location2" "Tracepoint ${decimal} at .*" +gdb_trace_setactions "set action for line $trace_location2" "" \ + "collect \$reg" "^$" + +gdb_test_no_output "tstart" + +set break_end [gdb_get_line_number "set breakpoint end here"] +gdb_test "break $break_end" "Breakpoint ${decimal} at .*" + +gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" +gdb_test_no_output "tstop" + +gdb_test "tsave -ctf $ctfdir" "Trace data saved to directory \'$ctfdir\'." + +#Get the pathname of babeltrace and set it to $which_babeltrace. +#If host doesn't have babeltrace, $which_babeltrace will set to 0. +if [is_remote host] then { + remote_exec host "which babeltrace" "" "" "babeltrace.which" + remote_upload host "babeltrace.which" + set which_babeltrace [file_contents "babeltrace.which"] + remote_file build delete "babeltrace.which" + remote_file host delete "babeltrace.which" +} else { + set which_babeltrace [which babeltrace] +} + +if { $which_babeltrace == 0 } then { + unsupported "babeltrace check ctf directory" +} else { + #Let babeltrace output an error to make sure current way is right. + if [is_remote host] then { + remote_exec host "$which_babeltrace not_exist < /dev/null" "" "" "babeltrace.output" + remote_upload host "babeltrace.output" + set babeltrace_output [file_contents "babeltrace.output"] + remote_file build delete "babeltrace.output" + remote_file host delete "babeltrace.output" + } else { + catch "exec $which_babeltrace not_exist < /dev/null" babeltrace_output + } + if { [string last "\[error\]" $babeltrace_output] == -1 } then { + unsupported "babeltrace check ctf directory" + } else { + if [is_remote host] then { + remote_exec host "$which_babeltrace $ctfdir < /dev/null" "" "" "babeltrace.output" + remote_upload host "babeltrace.output" + set babeltrace_output [file_contents "babeltrace.output"] + remote_file build delete "babeltrace.output" + remote_file host delete "babeltrace.output" + } else { + catch "exec $which_babeltrace $ctfdir < /dev/null" babeltrace_output + } + if { [string last "\[error\]" $babeltrace_output] != -1 } then { + fail "babeltrace open ctf directory" + } + } +} + + +#Test "target ctf" +gdb_test_no_output "set confirm off" +gdb_test_no_output "kill" +gdb_test_multiple "target ctf $ctfdir" "" { + -re "Undefined target command: \"ctf ctf\.ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" { + unsupported "target does not support ctf" + remote_exec host "rm -rf $ctfdir" + return -1; + } + -re ".*fail.*\r\n$gdb_prompt $" { + fail "target ctf $ctfdir" + } + -re "\r\n$gdb_prompt $" { + pass "target ctf $ctfdir" + } +} + +gdb_test "tfind 0" ".*Found trace frame 0.*" "target ctf tfind 0" +gdb_test "tdump" ".*b = 1.*a = 0.*i = 0.*" "first target ctf tdump" +gdb_test "print \$b" ".* = 1.*" "first target ctf print \$b" +gdb_test "print \$a" ".* = 0.*" "first target ctf print \$a" +gdb_test "print \$i" ".* = 0.*" "first target ctf print \$i" + +gdb_test "tfind 1" ".*Found trace frame 1.*" "target ctf tfind 1" + +gdb_test "tfind 2" ".*Found trace frame 2.*" "target ctf tfind 2" +gdb_test "tdump" ".*b = 2.*a = 1.*i = 1.*" "second target ctf tdump" +gdb_test "print \$b" ".* = 2.*" "second target ctf print \$b" +gdb_test "print \$a" ".* = 1.*" "second target ctf print \$a" +gdb_test "print \$i" ".* = 1.*" "second target ctf print \$i" + + +#Clean + +remote_exec host "rm -rf $ctfdir" ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-16 7:39 ` Hui Zhu @ 2013-01-16 9:52 ` Yao Qi 2013-01-18 1:23 ` Hui Zhu 0 siblings, 1 reply; 14+ messages in thread From: Yao Qi @ 2013-01-16 9:52 UTC (permalink / raw) To: Hui Zhu; +Cc: Joel Brobecker, gdb-patches ml, Tom Tromey On 01/16/2013 03:38 PM, Hui Zhu wrote: > make check RUNTESTFLAGS="--target_board=native-gdbserver ctf.exp" > remote_exec host "babeltrace $ctfdir < /dev/null" "" "" "output" will > get error. I think that is why gas_version have "if [is_remote host]" > for that. What is the error? 'remote_exec host' has been used in some places in gdb testsuite so it should work well. The one-line statement below works with combinations of {remote-host, local-host} x {babeltrace installed, babeltrace not installed} set ctfdir "foo" set status [remote_exec host "babeltrace $ctfdir < /dev/null"] verbose -log "status\[0\] ([lindex $status 0])" verbose -log "status\[1\] ([lindex $status 1])" 1) babeltrace installed (local-host and remote-host). We'll get, status[0] (1) status[1] ([error] opening trace "foo" for reading. 2) babeltrace not installed, local-host. We'll get, status[0] (-1) status[1] (spawn failed) 3) babeltrace not installed, remote-host. We'll get, status[0] (1) status[1] (sh: babeltrace: command not found) We can match 'status[1]' to know the different results of executing 'babeltrace' on host. P.S. I am not good at tcl/expect, so I may miss something. -- Yao (é½å°§) ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-16 9:52 ` Yao Qi @ 2013-01-18 1:23 ` Hui Zhu 2013-01-18 2:07 ` Yao Qi 2013-01-18 15:28 ` Tom Tromey 0 siblings, 2 replies; 14+ messages in thread From: Hui Zhu @ 2013-01-18 1:23 UTC (permalink / raw) To: Yao Qi; +Cc: Joel Brobecker, gdb-patches ml, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 1904 bytes --] On Wed, Jan 16, 2013 at 5:52 PM, Yao Qi <yao@codesourcery.com> wrote: > On 01/16/2013 03:38 PM, Hui Zhu wrote: >> >> make check RUNTESTFLAGS="--target_board=native-gdbserver ctf.exp" >> remote_exec host "babeltrace $ctfdir < /dev/null" "" "" "output" will >> get error. I think that is why gas_version have "if [is_remote host]" >> for that. > > > What is the error? 'remote_exec host' has been used in some places in gdb > testsuite so it should work well. The one-line statement below works with > combinations of {remote-host, local-host} x {babeltrace installed, > babeltrace not installed} ERROR: tcl error sourcing ../../../gdb/gdb/testsuite/gdb.trace/ctf.exp. ERROR: bad spawn_id (process died earlier?) This is what I got. > > set ctfdir "foo" > set status [remote_exec host "babeltrace $ctfdir < /dev/null"] > verbose -log "status\[0\] ([lindex $status 0])" > verbose -log "status\[1\] ([lindex $status 1])" > > 1) babeltrace installed (local-host and remote-host). We'll get, > status[0] (1) > status[1] ([error] opening trace "foo" for reading. > > 2) babeltrace not installed, local-host. We'll get, > status[0] (-1) > status[1] (spawn failed) > > 3) babeltrace not installed, remote-host. We'll get, > status[0] (1) > status[1] (sh: babeltrace: command not found) > > We can match 'status[1]' to know the different results of executing > 'babeltrace' on host. > > P.S. I am not good at tcl/expect, so I may miss something. Thanks. I am very clear about this way. Do you mind I keep current way that I just used? > > -- > Yao (齐尧) According to the reveiw from Abid. I found that we need a test for while-stepping. So I add test for that. Thanks, Hui 2013-01-18 Hui Zhu <hui_zhu@mentor.com> * gdb.trace/Makefile.in (PROGS): Add ctf. * gdb.trace/ctf.c: New file. * gdb.trace/ctf.exp: New file. [-- Attachment #2: ctf-test.txt --] [-- Type: text/plain, Size: 7982 bytes --] --- a/testsuite/gdb.trace/Makefile.in +++ b/testsuite/gdb.trace/Makefile.in @@ -3,7 +3,7 @@ srcdir = @srcdir@ .PHONY: all clean mostlyclean distclean realclean -PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \ +PROGS = ax backtrace ctf deltrace disconnected-tracing infotrace packetlen \ passc-dyn passcount report save-trace tfile tfind tracecmd tsv \ unavailable while-dyn while-stepping --- /dev/null +++ b/testsuite/gdb.trace/ctf.c @@ -0,0 +1,48 @@ +/* CTF test program. + + Copyright (C) 2013 Free Software Foundation, Inc. + + This file is part of GDB. + + 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/>. */ + +typedef char test_t1; +typedef test_t1 test_t2; +typedef test_t2 test_t3; + +int +main () +{ + int i; + int a = 0; + test_t3 b = 1; + test_t3 c[][4] = {"123", "456", "789", "123", "456", "789"}; + struct + { + int a; + int b; + } d[2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}}; + + for (i = 0; i < 10; i++) + { + ++a; /* set tracepoint 1 here */ + ++b; /* set tracepoint 2 here */ + ++c[0][1]; + ++d[0][1].a; + } + + /* set breakpoint end here */ + + return 0; +} --- /dev/null +++ b/testsuite/gdb.trace/ctf.exp @@ -0,0 +1,173 @@ +# Copyright 2013 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/>. + +load_lib "trace-support.exp"; + +proc file_contents { filename } { + set file [open $filename r] + set contents [read $file] + close $file + return $contents +} + +standard_testfile +set executable $testfile +set expfile $testfile.exp +set ctfdir $testfile.ctf + +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; +} + + +#Test "tsave -ctf" + +set trace_location1 [gdb_get_line_number "set tracepoint 1 here"] +gdb_test "trace $trace_location1" "Tracepoint ${decimal} at .*" +gdb_trace_setactions "set action for line $trace_location1" "" \ + "collect \$local" "^$" \ + "while-stepping 1" "^$" \ + "collect \$local" "^$" \ + "end" "^$" \ + "end" "" + +set trace_location2 [gdb_get_line_number "set tracepoint 2 here"] +gdb_test "trace $trace_location2" "Tracepoint ${decimal} at .*" +gdb_trace_setactions "set action for line $trace_location2" "" \ + "collect \$reg" "^$" \ + "while-stepping 1" "^$" \ + "collect \$reg" "^$" \ + "end" "^$" \ + "end" "" + +gdb_test_no_output "tstart" + +set break_end [gdb_get_line_number "set breakpoint end here"] +gdb_test "break $break_end" "Breakpoint ${decimal} at .*" + +gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" +gdb_test_no_output "tstop" + +gdb_test "tsave -ctf $ctfdir" "Trace data saved to directory \'$ctfdir\'." + +#Get the pathname of babeltrace and set it to $which_babeltrace. +#If host doesn't have babeltrace, $which_babeltrace will set to 0. +if [info exists BABELTRACE] { + set which_babeltrace ${BABELTRACE} +} else { + if [is_remote host] then { + remote_exec host "which babeltrace" "" "" "babeltrace.which" + remote_upload host "babeltrace.which" + set which_babeltrace [file_contents "babeltrace.which"] + remote_file build delete "babeltrace.which" + remote_file host delete "babeltrace.which" + } else { + set which_babeltrace [which babeltrace] + } +} + +#Use $which_babeltrace check $ctfdir. +if { $which_babeltrace == 0 } then { + unsupported "babeltrace check ctf directory" +} else { + #Let babeltrace output an error to make sure current way is right. + if [is_remote host] then { + remote_exec host "$which_babeltrace not_exist < /dev/null" "" "" "babeltrace.output" + remote_upload host "babeltrace.output" + set babeltrace_output [file_contents "babeltrace.output"] + remote_file build delete "babeltrace.output" + remote_file host delete "babeltrace.output" + } else { + catch "exec $which_babeltrace not_exist < /dev/null" babeltrace_output + } + if { [string last "\[error\]" $babeltrace_output] == -1 } then { + unsupported "cannot handle babeltrace output" + } else { + if [is_remote host] then { + remote_exec host "$which_babeltrace $ctfdir < /dev/null" "" "" "babeltrace.output" + remote_upload host "babeltrace.output" + set babeltrace_output [file_contents "babeltrace.output"] + remote_file build delete "babeltrace.output" + remote_file host delete "babeltrace.output" + } else { + catch "exec $which_babeltrace $ctfdir < /dev/null" babeltrace_output + } + if { [string last "\[error\]" $babeltrace_output] != -1 } then { + fail "babeltrace open ctf directory" + } + } +} + + +#Test "target ctf" with $ctfdir. +gdb_test_no_output "set confirm off" +gdb_test_no_output "kill" +gdb_test_multiple "target ctf $ctfdir" "" { + -re "Undefined target command: \"ctf ctf\.ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" { + unsupported "target does not support ctf" + remote_exec host "rm -rf $ctfdir" + return -1; + } + -re ".*fail.*\r\n$gdb_prompt $" { + fail "target ctf $ctfdir" + } + -re "\r\n$gdb_prompt $" { + pass "target ctf $ctfdir" + } +} + +gdb_test "tfind 0" ".*Found trace frame 0.*" "target ctf tfind 0" +gdb_test "tdump" ".*b = 1.*a = 0.*i = 0.*" "first target ctf tdump" +gdb_test "print \$b" ".* = 1.*" "first target ctf print \$b" +gdb_test "print \$a" ".* = 0.*" "first target ctf print \$a" +gdb_test "print \$i" ".* = 0.*" "first target ctf print \$i" + +gdb_test "tfind 1" ".*Found trace frame 1.*" "target ctf tfind 1" +gdb_test "tdump" ".*b = 1.*a = 1.*i = 0.*" "second target ctf tdump" +gdb_test "print \$b" ".* = 1.*" "second target ctf print \$b" +gdb_test "print \$a" ".* = 1.*" "second target ctf print \$a" +gdb_test "print \$i" ".* = 0.*" "second target ctf print \$i" + +gdb_test "tfind 2" ".*Found trace frame 2.*" "target ctf tfind 2" + +gdb_test "tfind 3" ".*Found trace frame 3.*" "target ctf tfind 3" + +gdb_test "tfind 4" ".*Found trace frame 4.*" "target ctf tfind 4" +gdb_test "tdump" ".*b = 2.*a = 1.*i = 1.*" "third target ctf tdump" +gdb_test "print \$b" ".* = 2.*" "third target ctf print \$b" +gdb_test "print \$a" ".* = 1.*" "third target ctf print \$a" +gdb_test "print \$i" ".* = 1.*" "third target ctf print \$i" + +gdb_test "tfind 5" ".*Found trace frame 5.*" "target ctf tfind 5" +gdb_test "tdump" ".*b = 2.*a = 2.*i = 1.*" "fourth target ctf tdump" +gdb_test "print \$b" ".* = 2.*" "fourth target ctf print \$b" +gdb_test "print \$a" ".* = 2.*" "fourth target ctf print \$a" +gdb_test "print \$i" ".* = 1.*" "fourth target ctf print \$i" + +#Clean + +#remote_exec host "rm -rf $ctfdir" ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-18 1:23 ` Hui Zhu @ 2013-01-18 2:07 ` Yao Qi 2013-01-18 15:28 ` Tom Tromey 1 sibling, 0 replies; 14+ messages in thread From: Yao Qi @ 2013-01-18 2:07 UTC (permalink / raw) To: Hui Zhu; +Cc: Joel Brobecker, gdb-patches ml, Tom Tromey On 01/18/2013 09:22 AM, Hui Zhu wrote: >> What is the error? 'remote_exec host' has been used in some places in gdb >> >testsuite so it should work well. The one-line statement below works with >> >combinations of {remote-host, local-host} x {babeltrace installed, >> >babeltrace not installed} > ERROR: tcl error sourcing ../../../gdb/gdb/testsuite/gdb.trace/ctf.exp. > ERROR: bad spawn_id (process died earlier?) > > This is what I got. Looks Tom encountered this error before and it was discussed here <http://sourceware.org/ml/gdb-patches/2012-11/msg00310.html> I think you get an error in this line remote_exec host "babeltrace $ctfdir < /dev/null" "" "" "output" as mentioned in the link above, this line should work, remote_exec host "babeltrace $ctfdir < /dev/null" "" "/dev/null" "output" or remote_exec host "babeltrace $ctfdir" "" "/dev/null" "output" This approach is used in proc run in gdb/testsuite/gdb.base/gnu-debugdata.exp. > >> > >> > set ctfdir "foo" >> > set status [remote_exec host "babeltrace $ctfdir < /dev/null"] >> > verbose -log "status\[0\] ([lindex $status 0])" >> > verbose -log "status\[1\] ([lindex $status 1])" >> > >> >1) babeltrace installed (local-host and remote-host). We'll get, >> >status[0] (1) >> >status[1] ([error] opening trace "foo" for reading. >> > >> >2) babeltrace not installed, local-host. We'll get, >> >status[0] (-1) >> >status[1] (spawn failed) >> > >> >3) babeltrace not installed, remote-host. We'll get, >> >status[0] (1) >> >status[1] (sh: babeltrace: command not found) >> > >> >We can match 'status[1]' to know the different results of executing >> >'babeltrace' on host. >> > >> >P.S. I am not good at tcl/expect, so I may miss something. > Thanks. I am very clear about this way. Do you mind I keep current > way that I just used? > If the existing method to fix 'remote_exec host' errors (mentioned above) still doesn't work, I don't mind using your approach, although I didn't read it carefully. Or we can skip it in remote host? I have no comments on this patch. I am not the maintainer to approve or reject the patches, and all my comments are optional. Please feel free to "cherry-pick" useful ones. -- Yao (é½å°§) ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-18 1:23 ` Hui Zhu 2013-01-18 2:07 ` Yao Qi @ 2013-01-18 15:28 ` Tom Tromey 2013-01-25 11:10 ` Hui Zhu 1 sibling, 1 reply; 14+ messages in thread From: Tom Tromey @ 2013-01-18 15:28 UTC (permalink / raw) To: Hui Zhu; +Cc: Yao Qi, Joel Brobecker, gdb-patches ml >>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes: Hui> +set ctfdir $testfile.ctf I'd like it if new temporary files were all named using standard_output_file. This way we can move them later. Hui> +#Test "tsave -ctf" Space after "#". Hui> +#Get the pathname of babeltrace and set it to $which_babeltrace. Hui> +#If host doesn't have babeltrace, $which_babeltrace will set to 0. Hui> +if [info exists BABELTRACE] { Hui> + set which_babeltrace ${BABELTRACE} Hui> +} else { Hui> + if [is_remote host] then { Hui> + remote_exec host "which babeltrace" "" "" "babeltrace.which" This seems possibly questionable to me, but I don't really do any remote host testing. Is this used elsewhere in the test suite? Hui> +#Clean Hui> + Hui> +#remote_exec host "rm -rf $ctfdir" You might as well just delete this. I tend to think that having tests clean up after themselves is inconvenient, as it makes debugging any failures trickier -- you have to hack the test case and run it again in order to see the various files. I'm not sure whether this has ever been discussed here though. I do see that a fair number of tests do this kind of cleanup. Tom ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-18 15:28 ` Tom Tromey @ 2013-01-25 11:10 ` Hui Zhu 2013-02-11 12:55 ` Hui Zhu 2013-02-18 10:39 ` Yao Qi 0 siblings, 2 replies; 14+ messages in thread From: Hui Zhu @ 2013-01-25 11:10 UTC (permalink / raw) To: Tom Tromey, Yao Qi; +Cc: Joel Brobecker, gdb-patches ml [-- Attachment #1: Type: text/plain, Size: 1728 bytes --] Hi Yao and Tom, Thanks for your help. I post a new patch according to your comments. And I remove "if [is_remote host] then {" check and update code to: remote_exec host "which babeltrace" "" "/dev/null" "babeltrace.which" It work OK in my part. Please help me review it. Best, Hui 2013-01-25 Hui Zhu <hui_zhu@mentor.com> * gdb.trace/Makefile.in (PROGS): Add ctf. * gdb.trace/ctf.c: New file. * gdb.trace/ctf.exp: New file. On Fri, Jan 18, 2013 at 11:28 PM, Tom Tromey <tromey@redhat.com> wrote: >>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes: > > Hui> +set ctfdir $testfile.ctf > > I'd like it if new temporary files were all named using > standard_output_file. This way we can move them later. > > Hui> +#Test "tsave -ctf" > > Space after "#". > > Hui> +#Get the pathname of babeltrace and set it to $which_babeltrace. > Hui> +#If host doesn't have babeltrace, $which_babeltrace will set to 0. > Hui> +if [info exists BABELTRACE] { > Hui> + set which_babeltrace ${BABELTRACE} > Hui> +} else { > Hui> + if [is_remote host] then { > Hui> + remote_exec host "which babeltrace" "" "" "babeltrace.which" > > This seems possibly questionable to me, but I don't really do any remote > host testing. Is this used elsewhere in the test suite? > > Hui> +#Clean > Hui> + > Hui> +#remote_exec host "rm -rf $ctfdir" > > You might as well just delete this. > > I tend to think that having tests clean up after themselves is > inconvenient, as it makes debugging any failures trickier -- you have to > hack the test case and run it again in order to see the various files. > > I'm not sure whether this has ever been discussed here though. I do see > that a fair number of tests do this kind of cleanup. > > Tom [-- Attachment #2: ctf-test.txt --] [-- Type: text/plain, Size: 7684 bytes --] --- a/testsuite/gdb.trace/Makefile.in +++ b/testsuite/gdb.trace/Makefile.in @@ -3,7 +3,7 @@ srcdir = @srcdir@ .PHONY: all clean mostlyclean distclean realclean -PROGS = ax backtrace deltrace disconnected-tracing infotrace packetlen \ +PROGS = ax backtrace ctf deltrace disconnected-tracing infotrace packetlen \ passc-dyn passcount report save-trace tfile tfind tracecmd tsv \ unavailable while-dyn while-stepping --- /dev/null +++ b/testsuite/gdb.trace/ctf.c @@ -0,0 +1,48 @@ +/* CTF test program. + + Copyright (C) 2013 Free Software Foundation, Inc. + + This file is part of GDB. + + 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/>. */ + +typedef char test_t1; +typedef test_t1 test_t2; +typedef test_t2 test_t3; + +int +main () +{ + int i; + int a = 0; + test_t3 b = 1; + test_t3 c[][4] = {"123", "456", "789", "123", "456", "789"}; + struct + { + int a; + int b; + } d[2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}}; + + for (i = 0; i < 10; i++) + { + ++a; /* set tracepoint 1 here */ + ++b; /* set tracepoint 2 here */ + ++c[0][1]; + ++d[0][1].a; + } + + /* set breakpoint end here */ + + return 0; +} --- /dev/null +++ b/testsuite/gdb.trace/ctf.exp @@ -0,0 +1,159 @@ +# Copyright 2013 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/>. + +load_lib "trace-support.exp"; + +proc file_contents { filename } { + set file [open $filename r] + set contents [read $file] + close $file + return $contents +} + +standard_testfile +set executable $testfile +set expfile $testfile.exp +set ctfdir [standard_output_file $testfile.ctf] + +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; +} + + +# Test "tsave -ctf" + +set trace_location1 [gdb_get_line_number "set tracepoint 1 here"] +gdb_test "trace $trace_location1" "Tracepoint ${decimal} at .*" +gdb_trace_setactions "set action for line $trace_location1" "" \ + "collect \$local" "^$" \ + "while-stepping 1" "^$" \ + "collect \$local" "^$" \ + "end" "^$" \ + "end" "" + +set trace_location2 [gdb_get_line_number "set tracepoint 2 here"] +gdb_test "trace $trace_location2" "Tracepoint ${decimal} at .*" +gdb_trace_setactions "set action for line $trace_location2" "" \ + "collect \$reg" "^$" \ + "while-stepping 1" "^$" \ + "collect \$reg" "^$" \ + "end" "^$" \ + "end" "" + +gdb_test_no_output "tstart" + +set break_end [gdb_get_line_number "set breakpoint end here"] +gdb_test "break $break_end" "Breakpoint ${decimal} at .*" +gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" + +gdb_test_no_output "tstop" + +gdb_test "tsave -ctf $ctfdir" "Trace data saved to directory \'$ctfdir\'." + +# Get the pathname of babeltrace and set it to $which_babeltrace. +# If host doesn't have babeltrace, $which_babeltrace will set to 0. +if [info exists BABELTRACE] { + set which_babeltrace ${BABELTRACE} +} else { + remote_exec host "which babeltrace" "" "/dev/null" "babeltrace.which" + remote_upload host "babeltrace.which" + set which_babeltrace [file_contents "babeltrace.which"] + remote_file build delete "babeltrace.which" + remote_file host delete "babeltrace.which" +} + +# Use $which_babeltrace check $ctfdir. +if { $which_babeltrace == "" } then { + unsupported "babeltrace check ctf directory" +} else { + # Let babeltrace output an error to make sure current way is right. + remote_exec host "$which_babeltrace not_exist" "" "/dev/null" "babeltrace.output" + remote_upload host "babeltrace.output" + set babeltrace_output [file_contents "babeltrace.output"] + remote_file build delete "babeltrace.output" + remote_file host delete "babeltrace.output" + if { [string last "\[error\]" $babeltrace_output] == -1 } then { + unsupported "cannot handle babeltrace output" + } else { + #Call $which_babeltrace check $ctfdir. + remote_exec host "$which_babeltrace $ctfdir" "" "/dev/null" "babeltrace.output" + remote_upload host "babeltrace.output" + set babeltrace_output [file_contents "babeltrace.output"] + remote_file build delete "babeltrace.output" + remote_file host delete "babeltrace.output" + if { [string last "\[error\]" $babeltrace_output] != -1 } then { + fail "babeltrace open ctf directory" + } + } +} + + +#Test "target ctf" with $ctfdir. +gdb_test_no_output "set confirm off" +gdb_test_no_output "kill" +gdb_test_multiple "target ctf $ctfdir" "" { + -re "Undefined target command: \"ctf ctf\.ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" { + unsupported "target does not support ctf" + remote_exec host "rm -rf $ctfdir" + return -1; + } + -re ".*Unable.*\r\n$gdb_prompt $" { + fail "target ctf $ctfdir" + } + -re "\r\n$gdb_prompt $" { + pass "target ctf $ctfdir" + } +} + +gdb_test "tfind 0" ".*Found trace frame 0.*" "target ctf tfind 0" +gdb_test "tdump" ".*b = 1.*a = 0.*i = 0.*" "first target ctf tdump" +gdb_test "print \$b" ".* = 1.*" "first target ctf print \$b" +gdb_test "print \$a" ".* = 0.*" "first target ctf print \$a" +gdb_test "print \$i" ".* = 0.*" "first target ctf print \$i" + +gdb_test "tfind 1" ".*Found trace frame 1.*" "target ctf tfind 1" +gdb_test "tdump" ".*b = 1.*a = 1.*i = 0.*" "second target ctf tdump" +gdb_test "print \$b" ".* = 1.*" "second target ctf print \$b" +gdb_test "print \$a" ".* = 1.*" "second target ctf print \$a" +gdb_test "print \$i" ".* = 0.*" "second target ctf print \$i" + +gdb_test "tfind 2" ".*Found trace frame 2.*" "target ctf tfind 2" + +gdb_test "tfind 3" ".*Found trace frame 3.*" "target ctf tfind 3" + +gdb_test "tfind 4" ".*Found trace frame 4.*" "target ctf tfind 4" +gdb_test "tdump" ".*b = 2.*a = 1.*i = 1.*" "third target ctf tdump" +gdb_test "print \$b" ".* = 2.*" "third target ctf print \$b" +gdb_test "print \$a" ".* = 1.*" "third target ctf print \$a" +gdb_test "print \$i" ".* = 1.*" "third target ctf print \$i" + +gdb_test "tfind 5" ".*Found trace frame 5.*" "target ctf tfind 5" +gdb_test "tdump" ".*b = 2.*a = 2.*i = 1.*" "fourth target ctf tdump" +gdb_test "print \$b" ".* = 2.*" "fourth target ctf print \$b" +gdb_test "print \$a" ".* = 2.*" "fourth target ctf print \$a" +gdb_test "print \$i" ".* = 1.*" "fourth target ctf print \$i" + ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-25 11:10 ` Hui Zhu @ 2013-02-11 12:55 ` Hui Zhu 2013-02-18 10:39 ` Yao Qi 1 sibling, 0 replies; 14+ messages in thread From: Hui Zhu @ 2013-02-11 12:55 UTC (permalink / raw) To: Tom Tromey, Yao Qi; +Cc: Joel Brobecker, gdb-patches ml On Fri, Jan 25, 2013 at 7:09 PM, Hui Zhu <teawater@gmail.com> wrote: > Hi Yao and Tom, > > Thanks for your help. > > I post a new patch according to your comments. > And I remove "if [is_remote host] then {" check and update code to: > remote_exec host "which babeltrace" "" "/dev/null" "babeltrace.which" > > It work OK in my part. > > Please help me review it. > > Best, > Hui Hi, Ping. Thanks, Hui > > 2013-01-25 Hui Zhu <hui_zhu@mentor.com> > > * gdb.trace/Makefile.in (PROGS): Add ctf. > * gdb.trace/ctf.c: New file. > * gdb.trace/ctf.exp: New file. > > On Fri, Jan 18, 2013 at 11:28 PM, Tom Tromey <tromey@redhat.com> wrote: >>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes: >> >> Hui> +set ctfdir $testfile.ctf >> >> I'd like it if new temporary files were all named using >> standard_output_file. This way we can move them later. >> >> Hui> +#Test "tsave -ctf" >> >> Space after "#". >> >> Hui> +#Get the pathname of babeltrace and set it to $which_babeltrace. >> Hui> +#If host doesn't have babeltrace, $which_babeltrace will set to 0. >> Hui> +if [info exists BABELTRACE] { >> Hui> + set which_babeltrace ${BABELTRACE} >> Hui> +} else { >> Hui> + if [is_remote host] then { >> Hui> + remote_exec host "which babeltrace" "" "" "babeltrace.which" >> >> This seems possibly questionable to me, but I don't really do any remote >> host testing. Is this used elsewhere in the test suite? >> >> Hui> +#Clean >> Hui> + >> Hui> +#remote_exec host "rm -rf $ctfdir" >> >> You might as well just delete this. >> >> I tend to think that having tests clean up after themselves is >> inconvenient, as it makes debugging any failures trickier -- you have to >> hack the test case and run it again in order to see the various files. >> >> I'm not sure whether this has ever been discussed here though. I do see >> that a fair number of tests do this kind of cleanup. >> >> Tom ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-25 11:10 ` Hui Zhu 2013-02-11 12:55 ` Hui Zhu @ 2013-02-18 10:39 ` Yao Qi 2013-02-19 6:57 ` Hui Zhu 1 sibling, 1 reply; 14+ messages in thread From: Yao Qi @ 2013-02-18 10:39 UTC (permalink / raw) To: Hui Zhu; +Cc: Tom Tromey, Joel Brobecker, gdb-patches ml On 01/25/2013 07:09 PM, Hui Zhu wrote: > +# Get the pathname of babeltrace and set it to $which_babeltrace. > +# If host doesn't have babeltrace, $which_babeltrace will set to 0. > +if [info exists BABELTRACE] { > + set which_babeltrace ${BABELTRACE} > +} else { > + remote_exec host "which babeltrace" "" "/dev/null" "babeltrace.which" > + remote_upload host "babeltrace.which" > + set which_babeltrace [file_contents "babeltrace.which"] > + remote_file build delete "babeltrace.which" > + remote_file host delete "babeltrace.which" > +} > + > +# Use $which_babeltrace check $ctfdir. > +if { $which_babeltrace == "" } then { > + unsupported "babeltrace check ctf directory" > +} else { > + # Let babeltrace output an error to make sure current way is right. > + remote_exec host "$which_babeltrace not_exist" "" "/dev/null" "babeltrace.output" > + remote_upload host "babeltrace.output" > + set babeltrace_output [file_contents "babeltrace.output"] > + remote_file build delete "babeltrace.output" > + remote_file host delete "babeltrace.output" > + if { [string last "\[error\]" $babeltrace_output] == -1 } then { > + unsupported "cannot handle babeltrace output" > + } else { > + #Call $which_babeltrace check $ctfdir. > + remote_exec host "$which_babeltrace $ctfdir" "" "/dev/null" "babeltrace.output" > + remote_upload host "babeltrace.output" > + set babeltrace_output [file_contents "babeltrace.output"] > + remote_file build delete "babeltrace.output" > + remote_file host delete "babeltrace.output" > + if { [string last "\[error\]" $babeltrace_output] != -1 } then { > + fail "babeltrace open ctf directory" > + } > + } > +} Unless I misunderstand it, it is still incorrect. IIUC, what you want to do here is to run "babeltrace" to check your trace data, you can simply do remote_exec host "babeltrace $ctfdir < /dev/null" "" "/dev/null" "output" You can tell from the return value and "output" about 1) whether babeltrace is installed on host machine, 2) whether babeltrace is executed successfully. DejaGNU is smart enough to know what is the host machine, and execute this command there, which is determined by the board file. If you are testing a native gdb, the command will be run in local machine, if you are testing GDB in a remote host way (test a native mingw32 native gdb on linux machine), this command will be executed on the remote host (a windows machine). -- Yao (é½å°§) ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-02-18 10:39 ` Yao Qi @ 2013-02-19 6:57 ` Hui Zhu 0 siblings, 0 replies; 14+ messages in thread From: Hui Zhu @ 2013-02-19 6:57 UTC (permalink / raw) To: Yao Qi; +Cc: Tom Tromey, Joel Brobecker, gdb-patches ml On Mon, Feb 18, 2013 at 6:38 PM, Yao Qi <yao@codesourcery.com> wrote: > On 01/25/2013 07:09 PM, Hui Zhu wrote: >> >> +# Get the pathname of babeltrace and set it to $which_babeltrace. >> +# If host doesn't have babeltrace, $which_babeltrace will set to 0. >> +if [info exists BABELTRACE] { >> >> + set which_babeltrace ${BABELTRACE} >> +} else { >> + remote_exec host "which babeltrace" "" "/dev/null" >> "babeltrace.which" >> >> + remote_upload host "babeltrace.which" >> + set which_babeltrace [file_contents "babeltrace.which"] >> + remote_file build delete "babeltrace.which" >> + remote_file host delete "babeltrace.which" >> +} >> + >> +# Use $which_babeltrace check $ctfdir. >> +if { $which_babeltrace == "" } then { >> >> + unsupported "babeltrace check ctf directory" >> +} else { >> + # Let babeltrace output an error to make sure current way is right. >> >> + remote_exec host "$which_babeltrace not_exist" "" "/dev/null" >> "babeltrace.output" >> + remote_upload host "babeltrace.output" >> + set babeltrace_output [file_contents "babeltrace.output"] >> + remote_file build delete "babeltrace.output" >> + remote_file host delete "babeltrace.output" >> + if { [string last "\[error\]" $babeltrace_output] == -1 } then { >> + unsupported "cannot handle babeltrace output" >> + } else { >> + #Call $which_babeltrace check $ctfdir. >> >> + remote_exec host "$which_babeltrace $ctfdir" "" "/dev/null" >> "babeltrace.output" >> + remote_upload host "babeltrace.output" >> + set babeltrace_output [file_contents "babeltrace.output"] >> + remote_file build delete "babeltrace.output" >> + remote_file host delete "babeltrace.output" >> + if { [string last "\[error\]" $babeltrace_output] != -1 } then { >> + fail "babeltrace open ctf directory" >> + } >> + } >> +} > > > Unless I misunderstand it, it is still incorrect. IIUC, what you want to do > here is to run "babeltrace" to check your trace data, you can simply do > > remote_exec host "babeltrace $ctfdir < /dev/null" "" "/dev/null" > "output" > > You can tell from the return value and "output" about > 1) whether babeltrace is installed on host machine, > 2) whether babeltrace is executed successfully. If I think is right, this idea base on "babeltrace" will not change its error output. But if they change the error output in some feature version. And maybe in different environment, this test will face with different version of "babeltrace". So what I want in this test call "babeltrace" is: 1. Make sure the system have the "babeltrace". It is not because call this command got error. Just because the system really don't have it. 2. Make sure the current way in test is the right way to check the output of babeltrace. 3. Use this way to check the output the babeltrace. Are you sure a "remote_exec" is OK for this part? Or maybe I think too much in this part? :) Thanks, Hui > > DejaGNU is smart enough to know what is the host machine, and execute this > command there, which is determined by the board file. If you are testing a > native gdb, the command will be run in local machine, if you are testing GDB > in a remote host way (test a native mingw32 native gdb on linux machine), > this command will be executed on the remote host (a windows machine). > > -- > Yao (齐尧) ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function 2013-01-14 3:49 [PATCH] Add CTF support to GDB [5] Add test for CTF function Hui Zhu 2013-01-14 12:44 ` Yao Qi @ 2013-01-14 13:30 ` Joel Brobecker 1 sibling, 0 replies; 14+ messages in thread From: Joel Brobecker @ 2013-01-14 13:30 UTC (permalink / raw) To: Hui Zhu; +Cc: gdb-patches ml, Tom Tromey This isn't a review, but I noticed that... > --- /dev/null > +++ b/testsuite/gdb.trace/ctf.c > @@ -0,0 +1,33 @@ > +typedef char test_t1; ... this file is missing a copyright header. Thank you, -- Joel ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2013-02-19 6:57 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-01-14 3:49 [PATCH] Add CTF support to GDB [5] Add test for CTF function Hui Zhu 2013-01-14 12:44 ` Yao Qi 2013-01-15 11:19 ` Hui Zhu 2013-01-15 13:49 ` Yao Qi 2013-01-16 7:39 ` Hui Zhu 2013-01-16 9:52 ` Yao Qi 2013-01-18 1:23 ` Hui Zhu 2013-01-18 2:07 ` Yao Qi 2013-01-18 15:28 ` Tom Tromey 2013-01-25 11:10 ` Hui Zhu 2013-02-11 12:55 ` Hui Zhu 2013-02-18 10:39 ` Yao Qi 2013-02-19 6:57 ` Hui Zhu 2013-01-14 13:30 ` Joel Brobecker
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox