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 1/2] RISC-V: Print FP regs as union of float types.


On Sat, Oct 20, 2018 at 2:38 PM Kevin Buettner <kevinb@redhat.com> wrote:
>
> On Fri, 19 Oct 2018 14:49:07 -0700
> Jim Wilson <jimw@sifive.com> wrote:
>
> > A 64-bit FP register can hold either a single or double float value, so
> > print it as both types by using a union type for FP registers.  Likewise
> > for 128-bit regs which can also hold long double.
> >
> >       gdb/
> >       * riscv-tdep.c (riscv_fpreg_d_type, riscv_fpreg_q_type): New.
> >       (riscv_register_type): Use them.
> >       (riscv_print_one_register_info): Handle union of floats same as float.
> >       * riscv-tdep.h (struct gdbarch_tdep): Add riscv_fpreg_d_type and
> >       riscv_fpreg_q_type fields.
>
> The GDB coding standard say that this must be coded as:
>
>      if (tdep->riscv_fpreg_d_type == NULL)
>
> Though I think we prefer nullptr over NULL these days.

I updated the patch to use nullptr, retested it, and committed it.

Jim


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