This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 3/4] Add FreeBSD/riscv architecture.
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: John Baldwin <jhb at FreeBSD dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: "andrew dot burgess at embecosm dot com" <andrew dot burgess at embecosm dot com>, "jimw at sifive dot com" <jimw at sifive dot com>
- Date: Thu, 27 Sep 2018 19:59:33 +0000
- Subject: Re: [PATCH v2 3/4] Add FreeBSD/riscv architecture.
- References: <20180924205151.22217-1-jhb@FreeBSD.org> <20180924205151.22217-4-jhb@FreeBSD.org>
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