[gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp
authorTom de Vries <tdevries@suse.de>
Fri, 22 Oct 2021 15:42:37 +0000 (17:42 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 22 Oct 2021 15:42:37 +0000 (17:42 +0200)
commitd5684c961f52597152b386ef2d6de3d53b0df9c6
treefd5c46d18764e108099275a9d5a952ee7c8f9f94
parent625f7b1cdc771befb362370c42e32a3476abdb85
[gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp

Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
mi_gdb_test" we run into:
...
PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: mi runto main
Expecting: ^(-break-insert -f pendfunc1[^M
]+)?((&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-created,\
  bkpt=\{number="2",type="breakpoint".*\}.*\n\^done[^M
]+[(]gdb[)] ^M
[ ]*)
-break-insert -f pendfunc1^M
^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",\
  addr="0x00007ffff7bd559e",func="pendfunc1",\
  file="gdb/testsuite/gdb.mi/pendshr1.c",\
  fullname="gdb/testsuite/gdb.mi/pendshr1.c",line="21",thread-groups=["i1"],\
  times="0",original-location="pendfunc1"}^M
(gdb) ^M
FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
  -break-insert -f pendfunc1 (unexpected output)
...

The regexp expects a breakpoint-created event, but that's actually suppressed
by the command:
...
DEF_MI_CMD_MI_1 ("break-insert", mi_cmd_break_insert,
                   &mi_suppress_notification.breakpoint),
...

Fix this by updating the regexp.

Likewise for the following:
...
PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
  -break-insert -f pendfunc1
Expecting: ^(-break-enable count 1 2[^M
]+)?(=breakpoint-modified,\
  bkpt=\{number="2",type="breakpoint",disp="dis",enabled="y".*\}.*\n\^done[^M
]+[(]gdb[)] ^M
[ ]*)
-break-enable count 1 2^M
^done^M
(gdb) ^M
FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
  -break-enable count 1 2 (unexpected out\
put)
...

Tested on x86_64-linux.
gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp