Re: [PATCH v3 3/5] Implement breakpoint_kind_from_pc and sw_breakpoint_from_kind for ARM in GDBServer.

Pedro Alves
2015-10-21T11:19:06Z

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