[binutils-gdb] GDB: testsuite: DWARF: Don't return -1 from top-level (manual)

Thiago Bauermann via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=24e1aca02a5a8ac90229047db574ee16466dbb8d

commit 24e1aca02a5a8ac90229047db574ee16466dbb8d
Author: Thiago Jung Bauermann <[email protected]>
Date:   Wed Apr 29 20:04:10 2026 -0300

    GDB: testsuite: DWARF: Don't return -1 from top-level (manual)
    
    This patch manually changes "return -1" statements that weren't caught
    by the sed command.
    
    These return statements fall into one of these criteria:
    
    - misaligned line, which is then fixed by this patch;
    - return at top level but inside block such as save_vars,
      with_test_prefix, foreach, gdb_test_multiple.
    
    Some weren't changed because they didn't meet the criteria above, or
    weren't trivial to check.
    
    Approved-By: Tom Tromey <[email protected]>

Diff:
---
 gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp                       | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp                       | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp                       | 2 +-
 gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp                  | 4 ++--
 gdb/testsuite/gdb.dwarf2/gdb-index.exp                              | 2 +-
 gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp                         | 2 +-
 gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp                  | 2 +-
 gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp                    | 2 +-
 gdb/testsuite/gdb.dwarf2/loclists-start-end.exp                     | 2 +-
 gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp                  | 2 +-
 gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp                    | 2 +-
 gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp                      | 2 +-
 13 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp b/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp
index 250f479e027..9432415fdd0 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp
+++ b/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp
@@ -61,7 +61,7 @@ save_vars { GDBFLAGS } {
     append GDBFLAGS " -iex \"maint set dwarf synchronous on\""
     if { [prepare_for_testing "failed to prepare" ${testfile} \
 	      [list $srcfile $asm_file] {nodebug}] } {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
index fa3bf5f4b3e..1be466f513c 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
@@ -25,7 +25,7 @@ require dwarf2_support
 standard_testfile .c -dw.S
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
-	return -1
+    return
 }
 
 # Make some DWARF for the test.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
index 7f9f9464aaf..e6859159c29 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
@@ -46,7 +46,7 @@ set result [catch {exec {*}$command} output]
 verbose "result is $result"
 verbose "output is $output"
 if {$result != 0} {
-  return -1
+    return
 }
 
 gdb_load ${binfile_stripped}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
index 294e7c8bf45..8032f71c7d9 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
@@ -95,7 +95,7 @@ with_test_prefix "ignore-prologue-end" {
     gdb_test_no_output "maintenance set ignore-prologue-end-flag on"
 
     if {![runto_main]} {
-	return -1
+	return
     }
 
     # If we ignore the prologue-end flag, we should stop at the first statement
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
index 6d3bf29c1b1..94afa35f558 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
@@ -27,12 +27,12 @@ standard_testfile main.c
 with_test_prefix non-symlink {
     if { [prepare_for_testing "failed to prepare" "${testfile}" \
 	      [list ${srcfile}]] } {
-	return -1
+	return
     }
 
     if { [ensure_gdb_index $binfile] == -1 } {
 	untested "error adding gdb index"
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp
index 456d7266c59..6ff1209ad1b 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp
@@ -117,7 +117,7 @@ gdb_test_multiple $cmd $test {
 	lassign [local_add_gdb_index $binfile] binfile_with_index host_binfile_with_index
 	set testfile_with_index [file tail $binfile_with_index]
 	if { ${binfile_with_index} == "" } {
-	    return -1
+	    return
 	}
     }
     -re ".*${gdb_prompt} $" {
diff --git a/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp
index f2a244791d1..edfcb8842d1 100644
--- a/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp
+++ b/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp
@@ -97,7 +97,7 @@ foreach_with_prefix is_64 {false true} {
 
     if { [prepare_for_testing "failed to prepare" ${testfile} \
 	      [list $srcfile $asm_file] {nodebug}] } {
-	return -1
+	return
     }
 
     if { ![runto_main] } {
diff --git a/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp b/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
index a822f0c2f2e..e2bacbcb8dc 100644
--- a/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
+++ b/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
@@ -124,7 +124,7 @@ foreach_with_prefix is_64 {false true} {
 
     if { [prepare_for_testing "failed to prepare" ${testfile} \
 	      [list $srcfile $asm_file] {nodebug}] } {
-	return -1
+	return
     }
 
     if { ![runto_main] } {
diff --git a/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp
index b80639b32dd..bc64b7adabd 100644
--- a/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp
+++ b/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp
@@ -212,7 +212,7 @@ foreach_with_prefix is_64 {false true} {
 
     if { [prepare_for_testing "failed to prepare" ${testfile} \
 	      [list $srcfile $asm_file] {nodebug}] } {
-	return -1
+	return
     }
 
     if { ![runto_main] } {
diff --git a/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp b/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp
index f40d6fd8ec5..c8d9f123625 100644
--- a/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp
+++ b/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp
@@ -115,7 +115,7 @@ foreach_with_prefix is_64 {false true} {
 
     if { [prepare_for_testing "failed to prepare" ${testfile} \
 	      [list $srcfile $asm_file] {nodebug}] } {
-	return -1
+	return
     }
 
     if { ![runto_main] } {
diff --git a/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp b/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp
index d005c8b907c..e48eb39f3a5 100644
--- a/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp
+++ b/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp
@@ -92,7 +92,7 @@ foreach_with_prefix is_64 {false true} {
 
     if { [prepare_for_testing "failed to prepare" ${testfile} \
 	      [list $srcfile $asm_file] {nodebug}] } {
-	return -1
+	return
     }
 
     # Sanity checks to make sure GDB slurped the symbols correctly.
diff --git a/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp
index bbfc9e35c64..6207e31b9d0 100644
--- a/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp
+++ b/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp
@@ -131,7 +131,7 @@ foreach_with_prefix is_64 {false true} {
 
     if { [prepare_for_testing "failed to prepare" ${testfile} \
 	      [list $srcfile $asm_file] {nodebug}] } {
-	return -1
+	return
     }
 
     # Sanity checks to make sure GDB slurped the symbols correctly.
diff --git a/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp b/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
index 4218dd11947..28a2fd7ad58 100644
--- a/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
@@ -124,7 +124,7 @@ save_vars { GDBFLAGS } {
 
     if { [prepare_for_testing "failed to prepare" ${testfile} \
 	      [list $srcfile $asm_file] {nodebug}] } {
-	return -1
+	return
     }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.