This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 7/7] Support software breakpoints for ARM linux in GDBServer.
- From: Pedro Alves <palves at redhat dot com>
- To: Antoine Tremblay <antoine dot tremblay at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Thu, 15 Oct 2015 17:07:28 +0100
- Subject: Re: [PATCH v2 7/7] Support software breakpoints for ARM linux in GDBServer.
- Authentication-results: sourceware.org; auth=none
- References: <1444063455-31558-1-git-send-email-antoine dot tremblay at ericsson dot com> <1444063455-31558-8-git-send-email-antoine dot tremblay at ericsson dot com>
On 10/05/2015 05:44 PM, Antoine Tremblay wrote:
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -3,6 +3,8 @@
>
> *** Changes since GDB 7.10
>
> +* Support for software breakpoints on ARM linux was added in GDBServer.
Putting a user hat on, what does this mean? Why is it news worthy?
> +
> * Record btrace now supports non-stop mode.
>
> * Support for tracepoints on aarch64-linux was added in GDBserver.
> diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
> index d16ea60..bd499f8 100644
> --- a/gdb/gdbserver/linux-arm-low.c
> +++ b/gdb/gdbserver/linux-arm-low.c
> @@ -336,6 +336,28 @@ arm_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
> }
> }
>
> +/* Get the breakpoint from the remote kind
> + 2 is thumb-16
> + 3 is thumb2-32
> + 4 is arm
> +*/
> +static const unsigned char *
> +arm_breakpoint_from_kind (int *kind)
> +{
> + switch (*kind) {
> + case 2:
Formatting, break line before {, indent case.
> + return (unsigned char *) &thumb_breakpoint;
> + case 3:
> + *kind = 4;
> + return (unsigned char *) &thumb2_breakpoint;
> + case 4:
> + return (unsigned char *) &arm_breakpoint;
> + default:
> + return NULL;
> + }
> + return NULL;
> +}
> +
Thanks,
Pedro Alves