From c7a2ee649115c78a7722fddccb5e27dbd1478a5c Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 17 Apr 2024 19:59:01 +0100 Subject: 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 --- gdb/testsuite/gdb.python/py-inferior.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/testsuite/gdb.python/py-inferior.exp') 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" -- cgit v1.1