aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-10-24 18:43:46 +0200
committerTom de Vries <tdevries@suse.de>2019-10-24 18:43:46 +0200
commit4ccdfbec5028a56b9847ec2687b9139e1769ffc5 (patch)
tree9974d51badde0fcdaf15820d69e023316750c725 /gdb/testsuite/gdb.reverse
parentgdb/python: Return None from Progspace.block_for_pc on error (diff)
downloadbinutils-gdb-4ccdfbec5028a56b9847ec2687b9139e1769ffc5.tar.gz
binutils-gdb-4ccdfbec5028a56b9847ec2687b9139e1769ffc5.tar.bz2
binutils-gdb-4ccdfbec5028a56b9847ec2687b9139e1769ffc5.zip
[gdb/testsuite] Add -wrap pattern flag to gdb_test_multiple
Currently, in order to rewrite: ... gdb_test <command> <pattern> <message> ... using gdb_test_multiple, we get: ... gdb_test_multiple <command> <message> { -re "\[\r\n\]*(?:<pattern>)\[\r\n\]+$gdb_prompt $" { pass $gdb_test_name } } ... Add a '-wrap pattern flag to gdb_test_multiple, that wraps the regexp pattern as gdb_test wraps its message argument. This allows us to rewrite into the more compact: ... gdb_test_multiple <command> <message> { -re -wrap <pattern> { pass $gdb_test_name } } ... Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-10-24 Tom de Vries <tdevries@suse.de> * lib/gdb.exp (gdb_test_multiple): Add -wrap pattern flag. * gdb.reverse/step-precsave.exp: Rewrite gdb_test_multiple containing kfail using -wrap pattern flag and convenience variable gdb_test_name. Change-Id: Ie42c97d5ab7acf6db351299ccd23a83540fe6e1a
Diffstat (limited to 'gdb/testsuite/gdb.reverse')
-rw-r--r--gdb/testsuite/gdb.reverse/step-precsave.exp18
1 files changed, 7 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp
index 72ee279f806..2cdceef79e0 100644
--- a/gdb/testsuite/gdb.reverse/step-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/step-precsave.exp
@@ -46,19 +46,15 @@ gdb_test "break $end_of_main" \
# This can take awhile.
with_timeout_factor 20 {
- set test "run to end of main"
- set pass_pattern "Breakpoint .* end of main .*"
- set kfail_pattern "Process record does not support instruction 0xc5 at.*"
- set kfail2_pattern "Process record does not support instruction 0xfae64 at.*"
- gdb_test_multiple "continue" $test {
- -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" {
- pass $test
+ gdb_test_multiple "continue" "run to end of main" {
+ -re -wrap "Breakpoint .* end of main .*" {
+ pass $gdb_test_name
}
- -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" {
- kfail "record/23188" $test
+ -re -wrap "Process record does not support instruction 0xc5 at.*" {
+ kfail "record/23188" $gdb_test_name
}
- -re "\[\r\n\]*(?:$kfail2_pattern)\[\r\n\]+$gdb_prompt $" {
- kfail "record/25038" $test
+ -re -wrap "Process record does not support instruction 0xfae64 at.*" {
+ kfail "record/25038" $gdb_test_name
}
}
}