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 v2 3/4] Add FreeBSD/riscv architecture.


On 2018-09-24 04:51 PM, John Baldwin wrote:
> +/* Implement the "init" method of struct tramp_frame.  */
> +
> +static void
> +riscv_fbsd_sigframe_init (const struct tramp_frame *self,
> +			  struct frame_info *this_frame,
> +			  struct trad_frame_cache *this_cache,
> +			  CORE_ADDR func)
> +{
> +  struct gdbarch *gdbarch = get_frame_arch (this_frame);
> +  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
> +  CORE_ADDR sp = get_frame_register_unsigned (this_frame, RISCV_SP_REGNUM);
> +  CORE_ADDR mcontext_addr =
> +    sp
> +    + RISCV_SIGFRAME_UCONTEXT_OFFSET
> +    + RISCV_UCONTEXT_MCONTEXT_OFFSET;

Just a formatting nit, to match the GNU style it should be something like

  CORE_ADDR mcontext_addr
    = (sp
       + RISCV_SIGFRAME_UCONTEXT_OFFSET
       + RISCV_UCONTEXT_MCONTEXT_OFFSET);

The break should always be before a binary operator, and the parentheses help (I've
been told) with auto-formatting in Emacs.

Otherwise everything looks good to me, but again I think the RISC-V wizards should take a look.

Simon

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