This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]