diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-05-10 09:53:52 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-06-25 18:22:03 +0100 |
commit | 81b327aadd3454a5c855e10180b30b6cafe5fc84 (patch) | |
tree | 635e9620afd2ab37246a5d4a4d2fba235d9a34fd /gdb/ChangeLog | |
parent | 202054aea670db6441f6b04c59ff58e6c3a1f8ca (diff) | |
download | gdb-81b327aadd3454a5c855e10180b30b6cafe5fc84.zip gdb-81b327aadd3454a5c855e10180b30b6cafe5fc84.tar.gz gdb-81b327aadd3454a5c855e10180b30b6cafe5fc84.tar.bz2 |
gdb/guile: improve the errors when creating breakpoints
When creating a breakpoint using the guile API, if an invalid
breakpoint type number was used then the error would report the wrong
argument position, like this:
(gdb) guile (define wp2 (make-breakpoint "result" #:wp-class WP_WRITE #:type 999))
ERROR: In procedure make-breakpoint:
ERROR: In procedure gdbscm_make_breakpoint: Out of range: invalid breakpoint type in position 3: 999
Error while executing Scheme code.
(gdb)
The 'position 3' here is actually pointing at WP_WRITE, when it should
say 'position 5' and point to the 999. This commit fixes this.
However, you also get errors like this:
(gdb) guile (define wp2 (make-breakpoint "result" #:wp-class WP_WRITE #:type BP_NONE))
ERROR: In procedure make-breakpoint:
ERROR: In procedure gdbscm_make_breakpoint: Out of range: invalid breakpoint type in position 3: 0
Error while executing Scheme code.
The BP_NONE is a valid breakpoint type, it's just not valid for
creating breakpoints through the 'make-breakpoint' API. The use of
'0' in the error message (which is the value of BP_NONE) is not
great. This commit changes the error in this case to:
(gdb) guile (define wp2 (make-breakpoint "result" #:wp-class WP_WRITE #:type BP_NONE))
ERROR: In procedure make-breakpoint:
ERROR: In procedure gdbscm_make_breakpoint: unsupported breakpoint type in position 5: "BP_NONE"
Error while executing Scheme code.
Which seems better; we now use the name of the type, and report that
this type is unsupported.
gdb/ChangeLog:
* guile/scm-breakpoint.c (gdbscm_make_breakpoint): Split the error
for invalid breakpoint numbers, and unsupported breakpoint
numbers.
gdb/testsuite/ChangeLog:
* gdb.guile/scm-breakpoint.exp (test_watchpoints): Add new tests.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 54f1b7b..80ccc9f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2021-06-25 Andrew Burgess <andrew.burgess@embecosm.com> + + * guile/scm-breakpoint.c (gdbscm_make_breakpoint): Split the error + for invalid breakpoint numbers, and unsupported breakpoint + numbers. + 2021-06-25 Tom Tromey <tom@tromey.com> * dwarf2/index-write.c (struct addrmap_index_data): Add |