From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 1/3] Tweak gdb.trace/backtrace.exp
Date: Thu, 27 Jun 2013 14:02:00 -0000 [thread overview]
Message-ID: <1372341726-5485-2-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1372341726-5485-1-git-send-email-yao@codesourcery.com>
Hi,
When I write test for command 'tdump' on selected frame, I find
backtrace.exp is a good place. However, backtrace.exp needs some
cleanups here and there. This is what this patch does.
gdb/testsuite:
2013-06-27 Yao Qi <yao@codesourcery.com>
* gdb.trace/backtrace.exp: Don't invoke 'get_exit' and 'gdb_start'.
Invoke 'prepare_for_testing' instead of 'gdb_compile'.
Use gdb_test_no_output to issue commands 'tstart' and 'tstop'.
---
gdb/testsuite/gdb.trace/backtrace.exp | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp
index e6447ac..5349f02 100644
--- a/gdb/testsuite/gdb.trace/backtrace.exp
+++ b/gdb/testsuite/gdb.trace/backtrace.exp
@@ -17,21 +17,20 @@
load_lib "trace-support.exp"
+standard_testfile actions.c
+set executable $testfile
+set expfile $testfile.exp
-gdb_exit
-gdb_start
+if [prepare_for_testing $expfile $executable $srcfile \
+ [list debug nowarnings]] {
+ untested "failed to prepare for trace tests"
+ return -1
+}
-standard_testfile actions.c
-if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
- executable {debug nowarnings}] != "" } {
- untested backtrace.exp
+if ![runto_main] {
+ fail "Can't run to main to check for trace support"
return -1
}
-gdb_load $binfile
-gdb_test "tstop" ".*" ""
-gdb_test "tfind none" ".*" ""
-runto_main
-gdb_reinitialize_dir $srcdir/$subdir
if { ![gdb_target_supports_trace] } then {
unsupported "Current target does not support trace"
@@ -156,14 +155,14 @@ gdb_trace_setactions "8.6: setup TP to collect stack mem cast expr" \
"$tdp6" \
"collect $fpreg, \(\*\(void \*\*\) \($spreg\)\) @ 64" "^$"
-gdb_test "tstart" ".*" ""
+gdb_test_no_output "tstart" ""
gdb_test "break end" ".*" ""
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
-gdb_test "tstop" ".*" ""
+gdb_test_no_output "tstop" ""
proc gdb_backtrace_tdp_1 { msg } {
global gdb_prompt
--
1.7.7.6
next prev parent reply other threads:[~2013-06-27 14:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-27 14:02 [PATCH 0/3] Select the current frame in command tdump Yao Qi
2013-06-27 14:02 ` [PATCH 2/3] Make test result of gdb.trace/backtrace.exp unique Yao Qi
2013-07-29 15:44 ` Pedro Alves
2013-06-27 14:02 ` Yao Qi [this message]
2013-07-29 15:44 ` [PATCH 1/3] Tweak gdb.trace/backtrace.exp Pedro Alves
2013-06-27 14:22 ` [PATCH 3/3] Select the current frame in command tdump Yao Qi
2013-07-29 15:44 ` Pedro Alves
2013-07-30 13:23 ` Yao Qi
2013-07-30 13:31 ` Pedro Alves
2013-07-31 0:47 ` Yao Qi
2013-07-22 1:13 ` [PATCH 0/3] " Yao Qi
2013-07-29 9:31 ` [ping 2]: " Yao Qi
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=1372341726-5485-2-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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