[gdb/testsuite] Fix gdb.guile/scm-breakpoint.exp with guile 3.0
authorTom de Vries <tdevries@suse.de>
Thu, 8 Jul 2021 09:17:05 +0000 (11:17 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 8 Jul 2021 09:17:05 +0000 (11:17 +0200)
commit732236a76ef01d950b78558046f88c8429128b0d
treebfc91e9afdc5ca0853bf5492dd8f17b555766e31
parente7ca24a166c54850fbf3412c1fc4e8d1825bc455
[gdb/testsuite] Fix gdb.guile/scm-breakpoint.exp with guile 3.0

When running test-case gdb.guile/scm-breakpoint.exp on openSUSE Tumbleweed
with guile 3.0, I run into:
...
(gdb) guile (define cp (make-breakpoint "syscall" #:type BP_CATCHPOINT))^M
ERROR: In procedure make-breakpoint:^M
In procedure gdbscm_make_breakpoint: unsupported breakpoint type in \
  position 3: "BP_CATCHPOINT"^M
Error while executing Scheme code.^M
(gdb) FAIL: gdb.guile/scm-breakpoint.exp: test_catchpoints: \
  create a catchpoint via the api
...

The same test passes on openSUSE Leap 15.2 with guile 2.0, where the second
line of the error message starts with the same prefix as the first:
...
ERROR: In procedure gdbscm_make_breakpoint: unsupported breakpoint type in \
  position 3: "BP_CATCHPOINT"^M
...

I observe the same difference in many other tests, f.i.:
...
(gdb) gu (print (value-add i '()))^M
ERROR: In procedure value-add:^M
In procedure gdbscm_value_add: Wrong type argument in position 2: ()^M
Error while executing Scheme code.^M
(gdb) PASS: gdb.guile/scm-math.exp: catch error in guile type conversion
...
but it doesn't cause FAILs anywhere else.

Fix this by updating the regexp to make the "ERROR: " prefix optional.

Tested on x86_64-linux, with both guile 2.0 and 3.0.

gdb/testsuite/ChangeLog:

2021-07-08  Tom de Vries  <tdevries@suse.de>

* gdb.guile/scm-breakpoint.exp: Make additional "ERROR: " prefix in
exception printing optional.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.guile/scm-breakpoint.exp
This page took 0.024765 seconds and 4 git commands to generate.