This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 3/3] Add native target for FreeBSD/mips.
On Friday, November 25, 2016 10:25:53 PM Luis Machado wrote:
> On 11/23/2016 02:59 PM, John Baldwin wrote:
> > @@ -0,0 +1,141 @@
> > +/* Target-dependent code for FreeBSD/mips.
>
> FreeBSD/MIPS native support?
Whoops, 'Native-dependent' seems to be what many other native targets use,
so I'll go with that.
> > +/* Determine if PT_GETREGS fetches this register. */
> > +
> > +static int
>
> With GDB having switched to C++, using bool here sounds more appropriate.
Ok. This was actually borrowed from mips-nbsd-tdep.c, but I can use bool
here.
> > +getregs_supplies (struct gdbarch *gdbarch, int regnum)
>
> get_regs_supplies?
(Also copied as above). The ptrace operation to which this refers is
PT_GETREGS rather than PT_GET_REGS, so I think 'getregs' here is better.
> > + if (regnum == -1
> > + || regnum >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
> > + {
> > + struct fpreg fpregs;
> > +
> > + if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid),
> > + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
> > + perror_with_name (_("Couldn't get floating point status"));
>
> "Couldn't get floating point registers"?
Most targets use "status" rather than "registers" (including Linux/i386 and
Linux/x86-64). (Curiously, sparc-nat.c uses both "status" and "registers".)
> > + }
> > +}
> > +
> > +
>
> Spurious newline above.
There's actually a form feed (^L) in there as in many other targets before
the _initialize_foo() routine. mips-linux-*.c don't include one, but many
other targets do. This may be a no-longer-followed rule though (it is still
in the GNU coding standards at the end of 5.1)?
--
John Baldwin