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] Look for FIR in the last FreeBSD/mips floating-point register.


On Monday, June 05, 2017 10:27:48 PM Simon Marchi wrote:
> On 2017-05-31 18:58, John Baldwin wrote:
> > +  for (i = 0; i < 32; i++)
> > +    if (regnum == fp0num + i || regnum == -1)
> > +      mips_fbsd_collect_reg (regcache, fp0num + i,
> > +			     regs + i * regsize, regsize);
> > +  if (regnum == mips_regnum (gdbarch)->fp_control_status || regnum == 
> > -1)
> > +    mips_fbsd_collect_reg (regcache, mips_regnum 
> > (gdbarch)->fp_control_status,
> > +			   regs + 32 * regsize, regsize);
> > +  if (regnum == mips_regnum (gdbarch)->fp_implementation_revision
> > +      || regnum == -1)
> > +    mips_fbsd_collect_reg (regcache,
> > +			   mips_regnum (gdbarch)->fp_implementation_revision,
> > +			   regs + 33 * regsize, regsize);
> 
> I'm just curious to know why you changed this.  They previous code 
> assumed that the 32 floating-point registers and the control register 
> were contiguous their numbering.  Is this no longer true with the new 
> register, or is it just for clarity that you separately handle the 
> different kinds of registers?

Just for clarity.  mips-tdep.c does happen to layout the registers such
that fsr and fir are consecutive after fp31, but fsr and fir do have
separate entries in the mips_regnum structure.

-- 
John Baldwin


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