Error when gdb_is_target_1 is called without running gdb instance
authorKeith Seitz <keiths@redhat.com>
Mon, 28 Feb 2022 15:40:23 +0000 (07:40 -0800)
committerKeith Seitz <keiths@redhat.com>
Mon, 28 Feb 2022 15:40:23 +0000 (07:40 -0800)
commitea764154c27a11619ba764a4c92f395ba5007234
treee6671b347bf82bfa0f19df1dec4575a9c8dc0168
parente008305278cb42a576107cd8aa9f0b182eea1af2
Error when gdb_is_target_1 is called without running gdb instance

This is a snafu that I encountered while implementing the previous
patch, which attempted to use gdb_is_target_native.  This proc and
gdb_is_target_remote both rely on gdb_is_target_1, which actually
cannot be called without gdb already running.

This patch adds appropriate warning comments to these procs and
causes gdb_is_target_1 to issue a Tcl error if it is called without a
gdb instance already running.  This should prevent unwitting callers
from using this at the wrong time.
gdb/testsuite/lib/gdb.exp