This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 3/5] Implement breakpoint_kind_from_pc and sw_breakpoint_from_kind for ARM 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: Wed, 21 Oct 2015 12:19:01 +0100
- Subject: Re: [PATCH v3 3/5] Implement breakpoint_kind_from_pc and sw_breakpoint_from_kind for ARM in GDBServer.
- Authentication-results: sourceware.org; auth=none
- References: <1445359685-2589-1-git-send-email-antoine dot tremblay at ericsson dot com> <1445359685-2589-4-git-send-email-antoine dot tremblay at ericsson dot com>
On 10/20/2015 05:48 PM, Antoine Tremblay wrote:
> +static int
> +arm_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
> +{
> + if (IS_THUMB_ADDR (*pcptr))
> + {
> + gdb_byte buf[2];
> +
> + *pcptr = UNMAKE_THUMB_ADDR (*pcptr);
> +
> + /* Check whether we are replacing a thumb2 32-bit instruction. */
> + if ((*the_target->read_memory) (*pcptr, buf, 2) == 0)
> + {
> + unsigned short inst1 = 0;
> +
> + (*the_target->read_memory) (*pcptr, (gdb_byte *) &inst1, 2);
> + if (thumb_insn_size (inst1) == 4)
> + {
> + return ARM_BP_KIND_THUMB2;
> + }
Unnecessary braces.
> + }
> + return ARM_BP_KIND_THUMB;
> + }
> + else
> + {
> + return ARM_BP_KIND_ARM;
> + }
Unnecessary braces.
Otherwise LGTM.
Thanks,
Pedro Alves