On Fri, 16 Jan 2026, Hans-Peter Nilsson wrote:

> What?  No!  The presence of an ERROR is *usually* a sign of
> a typo in a testsuite patch that causes an early-abort for
> parts of the test-suite, a common error that is otherwise
> hard to detect.  If an ERROR can be avoided by, say, a few
> lines of "monkey-patching", that helps.

Well, you could probably monkey-patch along the following lines (untested) 
if you want.  But I don't think this is a particularly good idea, given it 
would break if there is a real sim_exec implementation in upstream DejaGnu 
in future.

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index f2e5228fff58..15c1a1b2411a 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -1378,8 +1378,14 @@ proc gdb-exists { args } {
            }
        }
     }
-    if { [lindex [remote_exec target "$::env(GDB_FOR_GCC_TESTING)" "-v"] 0]
-        == 0 } {
+    rename sim_exec saved_sim_exec
+    proc sim_exec { dest srcfile args } {
+       return [list -1 "Remote execution for simulators not implemented."]
+    }
+    set res [remote_exec target "$::env(GDB_FOR_GCC_TESTING)" "-v"]
+    rename sim_exec ""
+    rename saved_sim_exec sim_exec
+    if { [lindex $res 0] == 0 } {
        return 1;
     }
     return 0;
diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp 
b/gcc/testsuite/lib/gcc-gdb-test.exp
index f7c1da8fae25..90f918aeb262 100644
--- a/gcc/testsuite/lib/gcc-gdb-test.exp
+++ b/gcc/testsuite/lib/gcc-gdb-test.exp
@@ -176,7 +176,13 @@ proc gdb-test { useline args } {
 # Argument 1 is the location where gdb is used
 # 
 proc report_gdb { gdb loc } {
+    rename sim_exec saved_sim_exec
+    proc sim_exec { dest srcfile args } {
+       return [list -1 "Remote execution for simulators not implemented."]
+    }
     set status [remote_exec target "which" "$gdb"]
+    rename sim_exec ""
+    rename saved_sim_exec sim_exec
     set gdb [string trim [lindex $status 1]]
     if { [lindex $status 0] != 0 } {
        send_log "gdb not found in $loc: $gdb\n"

-- 
Joseph S. Myers
[email protected]

Reply via email to