]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb_is_target_native -> gdb_protocol_is_native
authorPedro Alves <pedro@palves.net>
Wed, 17 Apr 2024 18:59:01 +0000 (19:59 +0100)
committerPedro Alves <pedro@palves.net>
Fri, 26 Apr 2024 20:22:48 +0000 (21:22 +0100)
commitc7a2ee649115c78a7722fddccb5e27dbd1478a5c
tree761ca5a7b8e052a824cedb9f5fb099c75f82c688
parentef27d39dd2c2e7b6af70884895e6d751872ae305
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>
gdb/testsuite/gdb.base/attach.exp
gdb/testsuite/gdb.base/foll-exec-mode.exp
gdb/testsuite/gdb.base/load-command.exp
gdb/testsuite/gdb.multi/stop-all-on-exit.exp
gdb/testsuite/gdb.python/py-inferior.exp
gdb/testsuite/gdb.threads/threads-after-exec.exp
gdb/testsuite/lib/gdb.exp