mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
[gdb/testsuite] Add proc require in lib/gdb.exp
Add a new proc require in lib/gdb.exp, and use it to shorten: ... if { [gdb_skip_xml_test] } { # Valgrind gdbserver requires gdb with xml support. untested "missing xml support" return 0 } ... into: ... require gdb_skip_xml_test 0 ... Tested on x86_64-linux, both with and without a trigger patch that forces gdb_skip_xml_test to return 1.
This commit is contained in:
@ -13,11 +13,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if { [gdb_skip_xml_test] } {
|
# Valgrind gdbserver requires gdb with xml support.
|
||||||
# Valgrind gdbserver requires gdb with xml support.
|
require gdb_skip_xml_test 0
|
||||||
untested "missing xml support"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
load_lib valgrind.exp
|
load_lib valgrind.exp
|
||||||
|
|
||||||
|
@ -18,11 +18,8 @@
|
|||||||
# really tests is that GDB falls back to in-line stepping
|
# really tests is that GDB falls back to in-line stepping
|
||||||
# automatically instead of getting stuck or crashing.
|
# automatically instead of getting stuck or crashing.
|
||||||
|
|
||||||
if { [gdb_skip_xml_test] } {
|
# Valgrind gdbserver requires gdb with xml support.
|
||||||
# Valgrind gdbserver requires gdb with xml support.
|
require gdb_skip_xml_test 0
|
||||||
untested "missing xml support"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
load_lib valgrind.exp
|
load_lib valgrind.exp
|
||||||
|
|
||||||
|
@ -29,11 +29,8 @@
|
|||||||
# terminate called after throwing an instance of 'gdb_exception_error'
|
# terminate called after throwing an instance of 'gdb_exception_error'
|
||||||
# Aborted (core dumped)
|
# Aborted (core dumped)
|
||||||
|
|
||||||
if { [gdb_skip_xml_test] } {
|
# Valgrind gdbserver requires gdb with xml support.
|
||||||
# Valgrind gdbserver requires gdb with xml support.
|
require gdb_skip_xml_test 0
|
||||||
untested "missing xml support"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
load_lib valgrind.exp
|
load_lib valgrind.exp
|
||||||
|
|
||||||
|
@ -13,11 +13,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if { [gdb_skip_xml_test] } {
|
# Valgrind gdbserver requires gdb with xml support.
|
||||||
# Valgrind gdbserver requires gdb with xml support.
|
require gdb_skip_xml_test 0
|
||||||
untested "missing xml support"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
load_lib valgrind.exp
|
load_lib valgrind.exp
|
||||||
|
|
||||||
|
@ -8215,5 +8215,35 @@ gdb_caching_proc have_avx {
|
|||||||
return $status
|
return $status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Called as either:
|
||||||
|
# - require EXPR VAL
|
||||||
|
# - require EXPR OP VAL
|
||||||
|
# In the first case, OP is ==.
|
||||||
|
#
|
||||||
|
# Require EXPR OP VAL, where EXPR is evaluated in caller context. If not,
|
||||||
|
# return in the caller's context.
|
||||||
|
|
||||||
|
proc require { fn arg1 {arg2 ""} } {
|
||||||
|
if { $arg2 == "" } {
|
||||||
|
set op ==
|
||||||
|
set val $arg1
|
||||||
|
} else {
|
||||||
|
set op $arg1
|
||||||
|
set val $arg2
|
||||||
|
}
|
||||||
|
set res [uplevel 1 $fn]
|
||||||
|
if { [expr $res $op $val] } {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
switch "$fn $op $val" {
|
||||||
|
"gdb_skip_xml_test == 0" { set msg "missing xml support" }
|
||||||
|
default { set msg "$fn != $val" }
|
||||||
|
}
|
||||||
|
|
||||||
|
untested $msg
|
||||||
|
return -code return 0
|
||||||
|
}
|
||||||
|
|
||||||
# Always load compatibility stuff.
|
# Always load compatibility stuff.
|
||||||
load_lib future.exp
|
load_lib future.exp
|
||||||
|
Reference in New Issue
Block a user