From: Yao Qi <yao@codesourcery.com>
To: Hui Zhu <teawater@gmail.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>,
Tom Tromey <tromey@redhat.com>
Subject: Re: [PATCH] Add CTF support to GDB [5] Add test for CTF function
Date: Mon, 14 Jan 2013 12:44:00 -0000 [thread overview]
Message-ID: <50F3ADB8.1000603@codesourcery.com> (raw)
In-Reply-To: <CANFwon2=EmBWtGqx5ygrmMNt0MBM0oLbjOZ2VMsx5+S9TErP7w@mail.gmail.com>
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 (é½å°§)
next prev parent reply other threads:[~2013-01-14 12:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 3:49 Hui Zhu
2013-01-14 12:44 ` Yao Qi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F3ADB8.1000603@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=teawater@gmail.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox