From e379b391417a10ddedd68ed23a2858e87a0a6792 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 18 Jun 2013 14:12:09 +0000 Subject: [PATCH] fix python-selftest.exp failure with gdbserver python-selftest.exp fails with an error when using the native-gdbserver.exp board. The bug is that the selftest code doesn't work in this situation. It never has. This patch fixes the problem by pushing the needed check into do_self_tests. This helps prevent the problem in the future. * lib/selftest-support.exp (do_self_tests): Reject remote or non-native targets. * gdb.gdb/complaints.exp: Remove check. * gdb.gdb/observer.exp: Remove check. * gdb.gdb/xfullpath.exp: Remove check. * gdb.gdb/complaints.exp: Remove check. --- gdb/testsuite/ChangeLog | 9 +++++++++ gdb/testsuite/gdb.gdb/complaints.exp | 5 ----- gdb/testsuite/gdb.gdb/observer.exp | 5 ----- gdb/testsuite/gdb.gdb/xfullpath.exp | 5 ----- gdb/testsuite/lib/selftest-support.exp | 5 +++++ 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 06217f99b8..7c659ca210 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2013-06-18 Tom Tromey + + * lib/selftest-support.exp (do_self_tests): Reject remote or + non-native targets. + * gdb.gdb/complaints.exp: Remove check. + * gdb.gdb/observer.exp: Remove check. + * gdb.gdb/xfullpath.exp: Remove check. + * gdb.gdb/complaints.exp: Remove check. + 2013-06-07 Pedro Alves * boards/native-extended-gdbserver.exp: Remove semicolon. diff --git a/gdb/testsuite/gdb.gdb/complaints.exp b/gdb/testsuite/gdb.gdb/complaints.exp index 932dfd5836..e5f6e4ae19 100644 --- a/gdb/testsuite/gdb.gdb/complaints.exp +++ b/gdb/testsuite/gdb.gdb/complaints.exp @@ -19,11 +19,6 @@ load_lib selftest-support.exp -# are we on a target board -if { [is_remote target] || ![isnative] } then { - return -} - if [target_info exists gdb,noinferiorio] { verbose "Skipping because of no inferiorio capabilities." return diff --git a/gdb/testsuite/gdb.gdb/observer.exp b/gdb/testsuite/gdb.gdb/observer.exp index 32030d88da..b70c2b1170 100644 --- a/gdb/testsuite/gdb.gdb/observer.exp +++ b/gdb/testsuite/gdb.gdb/observer.exp @@ -18,11 +18,6 @@ load_lib selftest-support.exp -# are we on a target board -if { [is_remote target] || ![isnative] } then { - return -} - proc attach_first_observer { message } { gdb_test_no_output "set \$first_obs = observer_attach_test_notification (&observer_test_first_notification_function)" \ "$message; attach first observer" diff --git a/gdb/testsuite/gdb.gdb/xfullpath.exp b/gdb/testsuite/gdb.gdb/xfullpath.exp index 5bc01c6f82..d758a18c88 100644 --- a/gdb/testsuite/gdb.gdb/xfullpath.exp +++ b/gdb/testsuite/gdb.gdb/xfullpath.exp @@ -18,11 +18,6 @@ load_lib selftest-support.exp -# are we on a target board -if { [is_remote target] || ![isnative] } then { - return -} - proc test_with_self {} { # A file which contains a directory prefix gdb_test "print gdb_realpath (\"./xfullpath.exp\")" \ diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp index c3758499dc..fc4bccce69 100644 --- a/gdb/testsuite/lib/selftest-support.exp +++ b/gdb/testsuite/lib/selftest-support.exp @@ -119,6 +119,11 @@ proc selftest_setup { executable function } { proc do_self_tests {function body} { global GDB tool + # Are we on a target board. + if { [is_remote target] || ![isnative] } then { + return + } + # Run the test with self. Copy the file executable file in case # this OS doesn't like to edit its own text space. -- 2.34.1