gdb/testsuite: introduce is_target_non_stop helper proc
authorAndrew Burgess <aburgess@redhat.com>
Sat, 18 Feb 2023 20:52:40 +0000 (20:52 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 28 Feb 2023 10:56:28 +0000 (10:56 +0000)
commit47171eeb9468fd38e3785b0181d63a2abea3bf29
tree2b93b46f275ffcdecd531909e34c5a4e4b7e9208
parent292deeba7d6e0f1df99fff8c18000a1a3c481f3a
gdb/testsuite: introduce is_target_non_stop helper proc

I noticed that several tests included copy & pasted code to run the
'maint show target-non-stop' command, and then switch based on the
result.

In this commit I factor this code out into a helper proc in
lib/gdb.exp, and update all the places I could find that used this
pattern to make use of the helper proc.

There should be no change in what is tested after this commit.

Reviewed-By: Pedro Alves <pedro@palves.net>
gdb/testsuite/gdb.base/access-mem-running.exp
gdb/testsuite/gdb.base/fork-running-state.exp
gdb/testsuite/gdb.threads/access-mem-running-thread-exit.exp
gdb/testsuite/gdb.threads/clone-attach-detach.exp
gdb/testsuite/gdb.threads/detach-step-over.exp
gdb/testsuite/lib/gdb.exp