gdb/testsuite: add back needed -re clause in gdb_breakpoint
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 5 Jan 2023 16:23:45 +0000 (11:23 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 5 Jan 2023 16:36:05 +0000 (11:36 -0500)
Commit 4b9728be ("gdb: use gdb_test_multiple in gdb_breakpoint") caused,
amongst others:

   (gdb) break 1^M
   No line 1 in the current file.^M
   Make breakpoint pending on future shared library load? (y or [n]) n^M
   (gdb) FAIL: gdb.dwarf2/dw2-main-no-line-number.exp: gdb_breakpoint: set breakpoint at 1
   FAIL: gdb.dwarf2/dw2-main-no-line-number.exp: !$breakpoint_at_missing_lineno_set

This is because it removed one empty -re clause (matching just the
prompt) that is necessary after replying "n" to the pending breakpoint
question.  Add this clause back.

Change-Id: Ibfaa059d58bbea660bc29f0547e2f75c323fcbc6
Approved-By: Tom de Vries <tdevries@suse.de>
gdb/testsuite/lib/gdb.exp

index e17eace4cb13197071e47b72bc943c2fee1213cd..af538e5c8fbd11af0f2e38f3635225f64b69995d 100644 (file)
@@ -657,6 +657,12 @@ proc gdb_breakpoint { linespec args } {
                send_gdb "$pending_response\n"
                exp_continue
        }
+       -re "$gdb_prompt $" {
+           if { $print_fail } {
+               fail $test_name
+           }
+           return 0
+       }
     }
     if { $print_pass } {
        pass $test_name