[v2,04/37] GDB: testsuite: x86, amd64, i386: Don't return value from top-level (manual)

Message ID 20260429230432.60487-5-thiago.bauermann@linaro.org
State New
Headers
Series GDB: testsuite: Fix top-level returns |

Commit Message

Thiago Jung Bauermann April 29, 2026, 11:03 p.m. UTC
  This patch manually changes the "return -1" statements that weren't
caught by the sed command.

In amd64-shadow-stack-cmds.exp the return statements have extra
indentation due to being inside a save_vars block.

In i386-bp_permanent.exp this was caused by misaligned lines, which are
now fixed.
---
 gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp | 8 ++++----
 gdb/testsuite/gdb.arch/i386-bp_permanent.exp       | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp b/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp
index e4daecb590dd..e67a0c2e4a1f 100644
--- a/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp
+++ b/gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp
@@ -42,16 +42,16 @@  save_vars { ::env(GLIBC_TUNABLES) } {
 
     append_environment GLIBC_TUNABLES "glibc.cpu.hwcaps" "SHSTK"
 
     if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 	  {debug additional_flags="-fcf-protection=return"}] } {
-	return -1
+	return
     }
 
     clean_restart ${::testfile}
     if { ![runto_main] } {
-	return -1
+	return
     }
 
     with_test_prefix "test inferior call and continue" {
 	gdb_breakpoint [ gdb_get_line_number "break call1" ]
 	gdb_continue_to_breakpoint "break call1" ".*break call1.*"
@@ -83,11 +83,11 @@  save_vars { ::env(GLIBC_TUNABLES) } {
 	gdb_continue_to_end
     }
 
     clean_restart ${::testfile}
     if { ![runto_main] } {
-	return -1
+	return
     }
 
     set call1_line [ gdb_get_line_number "break call1" ]
     set call2_line [ gdb_get_line_number "break call2" ]
 
@@ -120,11 +120,11 @@  save_vars { ::env(GLIBC_TUNABLES) } {
 	gdb_continue_to_end
     }
 
     clean_restart ${::testfile}
     if { ![runto_main] } {
-	return -1
+	return
     }
 
     with_test_prefix "test return from past frame" {
 	gdb_breakpoint $call2_line
 	gdb_continue_to_breakpoint "break call2" ".*break call2.*"
diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
index ef4d0370de89..9805f5626348 100644
--- a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
+++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
@@ -38,11 +38,11 @@  clean_restart $::testfile
 #
 # Run to `main' where we begin our tests.
 #
 
 if {![runto_main]} {
-  return -1
+    return
 }
 
 set function "standard"
 
 set retcode [gdb_test_multiple "disassemble $function" "disassemble function '$function'" {
@@ -51,12 +51,12 @@  set retcode [gdb_test_multiple "disassemble $function" "disassemble function '$f
       set address_after_bp $expect_out(3,string)
     }
 }]
 
 if {$retcode != 0} {
-  fail "disassemble failed, skipping entire test."
-  return -1
+    fail "disassemble failed, skipping entire test."
+    return
 }
 
 gdb_breakpoint "*$address_bp"
 
 gdb_test "continue" "Breakpoint .*, $address_bp in $function.*" \