This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [python][patch] PR python/19151 Hardware breakpoints in GDB Python.
- From: Pedro Alves <palves at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 9 May 2018 15:31:52 +0100
- Subject: Re: [python][patch] PR python/19151 Hardware breakpoints in GDB Python.
- References: <12c35b5f-aa8d-17b3-476d-2fbf4eb3587d@redhat.com> <68969e58-85d9-5cb7-d2a5-14930d08f799@redhat.com>
Hi Phil,
I agree with Eli, this should be mentioned in NEWS, as all
Python API additions/changes do.
Some nits below, but otherwise looks fine.
Please post a v2 with a NEWS entry, including the proposed
git commit log, and it should be good to go.
On 04/30/2018 01:37 PM, Phil Muldoon wrote:
>
> 2018-04-30 Phil Muldoon <pmuldoon@redhat.com>
>
> PR python/19151
> * python/py-breakpoint.c: Add hardware breakpoint constant
> gdb.BP_HARDWARE_BREAKPOINT.
Mention "(pybp_codes)":
* python/py-breakpoint.c (pybp_codes): Add hardware
breakpoint constant gdb.BP_HARDWARE_BREAKPOINT.
> (bppy_init): Add bp_hardware_breakpoint case. Use the enum bptype
> variable
Double space after '.' and missing '.' at end of second sentence.
> --- a/gdb/testsuite/gdb.python/py-breakpoint.exp
> +++ b/gdb/testsuite/gdb.python/py-breakpoint.exp
> @@ -681,6 +681,33 @@ proc_with_prefix test_bkpt_qualified {} {
> "-q in spec string and qualified false"
> }
>
> +# Test hardware assisted breakpoints
> +proc_with_prefix test_hardware_breakpoints { } {
> + global srcfile testfile decimal
> +
> + # Start with a fresh gdb.
> + clean_restart ${testfile}
> +
> + if {[skip_hw_breakpoint_tests]} {
> + unsupported "Hardware breakpoints."
Missing "return"
> + }
> +
> + if ![runto_main] then {
> + fail "cannot run to main."
> + return 0
> + }
> +
> + set hardware_location [gdb_get_line_number "Break at multiply."]
> + gdb_test "python hbp = gdb.Breakpoint (\"$hardware_location\", type=gdb.BP_HARDWARE_BREAKPOINT)" \
^^ spurious double space.
> + ".*Hardware assisted breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\." \
Leading ".*" not necessary, it's implied.
> + "Set hardware breakpoint"
Lowercase "Set".
> + gdb_continue_to_breakpoint "Break at multiply." \
> + ".*$srcfile:$hardware_location.*"
Leading ".*" not necessary, it's implied.
> + gdb_test "info breakpoints" \
> + "2.*hw breakpoint.*$srcfile:$hardware_location.*" \
> + "Check info breakpoints shows a hardware breakpoint"
Lowercase "Check". I'd remove "check, even, since all tests
are checking something:
"info breakpoints shows a hardware breakpoint"
Thanks,
Pedro Alves