This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix kfail in gdb.base/callfuncs.exp
On 10/24/2012 02:41 AM, Tom Tromey wrote:
"Yao" == Yao Qi <yao@codesourcery.com> writes:
No comment on the patch, just a question
Yao> - setup_kfail_for_target gdb/12798 "x86_64-*-*"
I didn't know this proc, so I looked it up:
proc setup_kfail_for_target { PR target } {
if { [istarget $target] } {
setup_kfail $PR $target
}
}
But setup_kfail itself just does:
proc setup_kfail { args } {
[...]
if {[istarget $sub_arg]} {
set kfail_flag 1
continue
}
So I don't understand how setup_kfail_for_target is different.
If I'm missing something, I'd like to know what.
Otherwise I think we can nuke this proc entirely.
Tom,
This proc is to link the same fail to different PRs according to
different target triplets (See more here
http://sourceware.org/ml/gdb-patches/2011-05/msg00508.html). For
example, in gdb.base/varargs.exp
setup_kfail_for_target gdb/12790 "x86_64-*-*"
setup_kfail_for_target gdb/12791 "arm*-*-*"
gdb_test $test ".*= 4 \\+ 4 \\* I" $test
'setup_kfail_for_target' can be replaced with 'setup_kfail' if there is
only one PR number for a given fail, but it is still useful in
gdb.base/varargs.exp.
The patch below is to replace 'setup_kfail_for_target' with
'setup_kfail', and add one sentence of comment to proc
'setup_kfail_for_target'. Is it OK?
--
Yao
gdb/testsuite:
2012-10-24 Yao Qi <yao@codesourcery.com>
* gdb.base/callfuncs.exp (do_function_calls): User 'setup_kfail'
instead of 'setup_kfail_for_target'.
* gdb.trace/ftrace.exp (test_fast_tracepoints): Likewise.
* lib/gdb.exp (setup_kfail_for_target): Add comment.
---
gdb/testsuite/gdb.base/callfuncs.exp | 4 ++--
gdb/testsuite/gdb.trace/ftrace.exp | 4 ++--
gdb/testsuite/lib/gdb.exp | 3 ++-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp
b/gdb/testsuite/gdb.base/callfuncs.exp
index 75ea5f0..53ffafd 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -245,11 +245,11 @@ proc do_function_calls {} {
gdb_test "p t_structs_fc(struct_val1)" ".*= 3 \\+ 3 \\* I" \
"call inferior func with struct - returns float _Complex"
- setup_kfail_for_target gdb/12783 "i?86-*-*"
+ setup_kfail gdb/12783 "i?86-*-*"
gdb_test "p t_structs_dc(struct_val1)" ".*= 4 \\+ 4 \\* I" \
"call inferior func with struct - returns double _Complex"
- setup_kfail_for_target gdb/12783 "i?86-*-*"
+ setup_kfail gdb/12783 "i?86-*-*"
gdb_test "p t_structs_ldc(struct_val1)" "= 5 \\+ 5 \\* I" \
"call inferior func with struct - returns long double _Complex"
}
diff --git a/gdb/testsuite/gdb.trace/ftrace.exp
b/gdb/testsuite/gdb.trace/ftrace.exp
index 56cd2fa..2a3dbae 100644
--- a/gdb/testsuite/gdb.trace/ftrace.exp
+++ b/gdb/testsuite/gdb.trace/ftrace.exp
@@ -132,13 +132,13 @@ proc test_fast_tracepoints {} {
gdb_test "tfind pc *set_point" "Found trace frame .*" \
"tfind set_point frame, first time"
- setup_kfail_for_target "gdb/13808" "x86_64-*-linux*"
+ setup_kfail "gdb/13808" "x86_64-*-linux*"
gdb_test "print globvar" " = 1"
gdb_test "tfind pc *set_point" "Found trace frame .*" \
"tfind set_point frame, second time"
- setup_kfail_for_target "gdb/13808" "x86_64-*-linux*"
+ setup_kfail "gdb/13808" "x86_64-*-linux*"
gdb_test "print anarg" " = 200"
gdb_test "tfind start" "Found trace frame .*" \
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index f27d4a7..29bf8f7 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3435,7 +3435,8 @@ proc setup_xfail_format { format } {
}
# Like setup_kfail, but only call setup_kfail conditionally if
-# istarget[TARGET] returns true.
+# istarget[TARGET] returns true. This proc is useful to link
+# the same fail to different PRs on different triplets.
proc setup_kfail_for_target { PR target } {
if { [istarget $target] } {
setup_kfail $PR $target
--
1.7.7.6