[11/14] gdb/testsuite/gdb.base/break.exp: split test_break_nonexistent_line

Message ID 20221123183959.2476477-12-simon.marchi@polymtl.ca
State New
Headers
Series Break up gdb.base/break.exp in multiple procs |

Commit Message

Simon Marchi Nov. 23, 2022, 6:39 p.m. UTC
  Change-Id: I4390dd5da23bae83ccc513ad0de0169ddff7df12
---
 gdb/testsuite/gdb.base/break.exp | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index b4d12cb56a92..a5ef521a4b0a 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -496,11 +496,21 @@  gdb_continue_to_end
 
 # Verify that GDB responds gracefully when asked to set a breakpoint
 # on a nonexistent source line.
-#
-gdb_test_no_output "set breakpoint pending off"
-gdb_test "break 999" \
-    "No line 999 in the current file." \
-    "break on non-existent source line"
+
+proc_with_prefix test_break_nonexistent_line {} {
+    clean_restart break
+
+    if ![runto_main] then {
+	return
+    }
+
+    gdb_test_no_output "set breakpoint pending off"
+    gdb_test "break 999" \
+	"No line 999 in the current file." \
+	"break on non-existent source line"
+}
+
+test_break_nonexistent_line
 
 proc_with_prefix test_break_default {} {
     clean_restart break