aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-inferior.exp
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2024-04-17 19:59:01 +0100
committerPedro Alves <pedro@palves.net>2024-04-26 21:22:48 +0100
commitc7a2ee649115c78a7722fddccb5e27dbd1478a5c (patch)
tree761ca5a7b8e052a824cedb9f5fb099c75f82c688 /gdb/testsuite/gdb.python/py-inferior.exp
parentef27d39dd2c2e7b6af70884895e6d751872ae305 (diff)
downloadbinutils-c7a2ee649115c78a7722fddccb5e27dbd1478a5c.zip
binutils-c7a2ee649115c78a7722fddccb5e27dbd1478a5c.tar.gz
binutils-c7a2ee649115c78a7722fddccb5e27dbd1478a5c.tar.bz2
gdb_is_target_native -> gdb_protocol_is_native
gdb_is_target_native uses "maint print target-stack", which is unnecessary when checking whether gdb_protocol is empty would do. Checking gdb_protocol is more efficient, and can be done before starting GDB and running to main, unlike gdb_is_target_native. This adds a new gdb_protocol_is_native procedure, and uses it in place of gdb_is_target_native. At first, I thought that we'd end up with a few testcases needing to use gdb_is_target_native still, especially multi-target tests that connect to targets different from the default board target, but no, actually all uses of gdb_is_target_native could be converted. gdb_is_target_native will be eliminated in a following patch. In some spots, we no longer need to defer the check until after starting GDB, so the patch adjusts accordingly. Change-Id: Ia706232dbffac70f9d9740bcb89c609dbee5cee3 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/gdb.python/py-inferior.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-inferior.exp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp
index e74fbfd..ee30390 100644
--- a/gdb/testsuite/gdb.python/py-inferior.exp
+++ b/gdb/testsuite/gdb.python/py-inferior.exp
@@ -406,7 +406,7 @@ with_test_prefix "selected_inferior" {
gdb_test "py print (gdb.selected_inferior().connection.num)" "1" \
"first inferior's connection number, though connection object"
# Figure out if inf 1 has a native target.
- set inf_1_is_native [gdb_is_target_native]
+ set inf_1_is_native [gdb_protocol_is_native]
set num [add_inferior "-no-connection"]
gdb_test "inferior $num" ".*" "switch to inferior $num"