This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] Implement "to_stopped_by_hw_breakpoint" for x86 debug registers.
- From: Pedro Alves <palves at redhat dot com>
- To: John Baldwin <jhb at FreeBSD dot org>, gdb-patches at sourceware dot org
- Date: Fri, 2 Mar 2018 20:19:17 +0000
- Subject: Re: [PATCH 1/3] Implement "to_stopped_by_hw_breakpoint" for x86 debug registers.
- Authentication-results: sourceware.org; auth=none
- References: <20180228014656.32372-1-jhb@FreeBSD.org> <20180228014656.32372-2-jhb@FreeBSD.org>
Hi John,
This LGTM, with the nits below addressed.
On 02/28/2018 01:46 AM, John Baldwin wrote:
> This change should be a no-op since a target
> still needs to implement the "to_supports_stopped_by_hw_breakpoint"
> method before this function is used.
I think it'd be good to dd something like this as a comment somewhere.
Maybe next to where t->to_stopped_by_hw_breakpoint is set?
Because while looking at the patch, I didn't notice that comment in
the git log, and it took me a bit to realize that this does not affect
all x86 ports as is.
> +/* Return non-zero if the inferior has some breakpoint that triggered.
> + Otherwise return zero. */
> +
> +int
> +x86_dr_stopped_by_breakpoint (struct x86_debug_reg_state *state)
> +{
I was also slightly confused by this until I realized that you
meant _hardware_ breakpoint. Can you rename this to
x86_dr_stopped_by_hw_breakpoint, and update the comment too?
Thanks,
Pedro Alves