Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Add isremote fallback
@ 2026-10-13 15:12 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2026-10-13 15:12 UTC (permalink / raw)
  To: gdb-patches

On openSUSE Leap 16.0 with dejagnu 1.6.3 both is_remote and isremote are
supported.

On openSUSE Leap 15.6 with dejagnu 1.6.1 only is_remote is supported.

In a recent commit I added:
...
proc remote_kill_spawn_id_p { board sig } {
  ...
	if {[isremote $board]} {
...
which works fine with dejagnu 1.6.3 but with 1.6.1 I run into:
...
UNRESOLVED: gdb.base/quit-live.exp: appear_how=run: extra_inferior=0: \
  testcase aborted due to invalid command name: isremote
ERROR: tcl error sourcing gdb.base/quit-live.exp.
ERROR: invalid command name "isremote"
...

The dejagnu sources 1.6.3 call is_remote "legacy", and dejagnu NEWS calls it
deprecated, so I suppose it'll eventually disappear.

Fix this by making sure that proc isremote is available.

Instead, we could just replace isremote with is_remote in
remote_kill_spawn_id_p, but that does nothing to prevent re-introduction of
the same problem elsewhere.  We could undefine proc isremote, but we'd just be
forcing the user to use a deprecated function on newer platforms.

Tested test-case gdb.base/quit-live.exp on both aforementioned configurations
(x86_64-linux).
---
 gdb/testsuite/lib/future.exp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
index 44fc17b3f00..1bf4b35c1fe 100644
--- a/gdb/testsuite/lib/future.exp
+++ b/gdb/testsuite/lib/future.exp
@@ -759,6 +759,13 @@ if { [array size use_gdb_compile] != 0 } {
     unproc gdb_default_target_compile
 }
 
+# Dejagnu versions before 1.6.3 don't define isremote.
+if {[info procs isremote] == ""} {
+    proc isremote {board} {
+	return [is_remote $board]
+    }
+}
+
 # Various ccache versions provide incorrect debug info such as ignoring
 # different current directory, breaking GDB testsuite.
 set env(CCACHE_DISABLE) 1

base-commit: bad8b979b27e050b2b4db16a261f8a78e24b8aa2
-- 
2.51.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-13 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-13 15:12 [pushed] [gdb/testsuite] Add isremote fallback Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox