aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/gdb.exp
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2023-07-14 08:39:24 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2023-07-14 08:39:24 -0700
commit6af166ed587b15a46a2bb92bb16b72f4b76d400f (patch)
tree52ccd6c997e320890fb7ad9c25968f08ecca60f9 /gdb/testsuite/lib/gdb.exp
parenta4a688ffa46533bf26d5d27dc7f75c22d90fd638 (diff)
downloadbinutils-6af166ed587b15a46a2bb92bb16b72f4b76d400f.zip
binutils-6af166ed587b15a46a2bb92bb16b72f4b76d400f.tar.gz
binutils-6af166ed587b15a46a2bb92bb16b72f4b76d400f.tar.bz2
Add a have_native_target helper function for use with require.
Move logic from auto-connect-native-target.exp into this helper.
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r--gdb/testsuite/lib/gdb.exp14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index bf8cdbd..66c04a2 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -9837,6 +9837,20 @@ gdb_caching_proc have_compile_and_link_flag { flag } {
additional_flags=$flag]
}
+# Return 1 if this GDB is configured with a "native" target.
+
+gdb_caching_proc have_native_target {} {
+ gdb_test_multiple "help target native" "" {
+ -re -wrap "Undefined target command.*" {
+ return 0
+ }
+ -re -wrap "Native process.*" {
+ return 1
+ }
+ }
+ return 0
+}
+
# Handle include file $srcdir/$subdir/FILE.
proc include_file { file } {