diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-05-05 16:53:09 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-06-25 18:22:05 +0100 |
commit | 08080f9744094772e935204a9d59a101da83a801 (patch) | |
tree | 3b210fd6add91093c659cf3b7d11d0c366739596 /gdb/testsuite | |
parent | 81b327aadd3454a5c855e10180b30b6cafe5fc84 (diff) | |
download | gdb-08080f9744094772e935204a9d59a101da83a801.zip gdb-08080f9744094772e935204a9d59a101da83a801.tar.gz gdb-08080f9744094772e935204a9d59a101da83a801.tar.bz2 |
gdb/guile: allow for catchpoint type breakpoints in guile
This commit adds initial support for catchpoints to the guile
breakpoint API.
This commit adds a BP_CATCHPOINT constant which corresponds to
GDB's internal bp_catchpoint. The new constant is documented in the
manual.
The user can't create breakpoints with type BP_CATCHPOINT after this
commit, but breakpoints that already exist, obtained with
the (breakpoints) function, can now have this type.
gdb/ChangeLog:
* guile/scm-breakpoint.c (bpscm_type_to_string): Handle
bp_catchpoint.
(bpscm_want_scm_wrapper_p): Likewise.
(gdbscm_make_breakpoint): Likewise.
(breakpoint_integer_constants): Likewise.
gdb/doc/ChangeLog:
* guile.texinfo (Breakpoints In Guile): Add BP_CATCHPOINT
description.
gdb/testsuite/ChangeLog:
* gdb.guile/scm-breakpoint.exp (test_catchpoints): New proc.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.guile/scm-breakpoint.exp | 37 |
2 files changed, 41 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 330e7c8..30db261 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2021-06-25 Andrew Burgess <andrew.burgess@embecosm.com> + * gdb.guile/scm-breakpoint.exp (test_catchpoints): New proc. + +2021-06-25 Andrew Burgess <andrew.burgess@embecosm.com> + * gdb.guile/scm-breakpoint.exp (test_watchpoints): Add new tests. gdb/testsuite/ChangeLog diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.exp b/gdb/testsuite/gdb.guile/scm-breakpoint.exp index 0e9e64e..c603af7 100644 --- a/gdb/testsuite/gdb.guile/scm-breakpoint.exp +++ b/gdb/testsuite/gdb.guile/scm-breakpoint.exp @@ -519,10 +519,47 @@ proc_with_prefix test_bkpt_probe {} { "register probe breakpoint" } +proc_with_prefix test_catchpoints {} { + global srcfile testfile + global gdb_prompt decimal + + # Start with a fresh gdb. + clean_restart ${testfile} + + if ![gdb_guile_runto_main] { + return + } + + # Try to create a catchpoint, currently this isn't supported via + # the guile api. + gdb_test "guile (define cp (make-breakpoint \"syscall\" #:type BP_CATCHPOINT))" \ + "ERROR: In procedure gdbscm_make_breakpoint: unsupported breakpoint type in position 3: \"BP_CATCHPOINT\"\r\n.*" \ + "create a catchpoint via the api" + + # Setup a catchpoint. + set num "XXX" + gdb_test_multiple "catch syscall" "" { + -re "The feature \'catch syscall\' is not supported.*\r\n$gdb_prompt $" { + unsupported "catch syscall isn't supported" + return -1 + } + -re "Catchpoint ($decimal) \\(any syscall\\)\r\n$gdb_prompt $" { + set num $expect_out(1,string) + pass $gdb_test_name + } + } + + # Look for the catchpoint in the breakpoint list. + gdb_test "guile (for-each (lambda (b) (if (= (breakpoint-type b) BP_CATCHPOINT) (begin (display b) (newline)))) (breakpoints))" \ + "#<gdb:breakpoint #${num} BP_CATCHPOINT enabled noisy hit:0 ignore:0>" \ + "look for BP_CATCHPOINT in breakpoint list" +} + test_bkpt_basic test_bkpt_deletion test_bkpt_cond_and_cmds test_bkpt_invisible +test_catchpoints test_watchpoints test_bkpt_internal test_bkpt_eval_funcs |