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: arm_addr_bits_remove


On Mon, 4 Feb 2008, Daniel Jacobowitz wrote:

> >  For the record -- to ever hit this case on MIPS you would have to run the 
> > test suite in the 32-bit kernel mode, so IRIX certainly does not apply 
> > here.  One of the embedded targets might fit, e.g. using newlib and the 
> > GNU sim.  Still this would be a bug if it mattered these days as proper 
> > sign-extension of addresses is meant to be done for MIPS now.
> 
> Really?  This is for removing low bits, not high bits - I'd be more
> worried about MIPS16.

 Well, for MIPS the function only removes high bits if any at all:

static CORE_ADDR
mips_addr_bits_remove (CORE_ADDR addr)
{
  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  if (mips_mask_address_p (tdep) && (((ULONGEST) addr) >> 32 == 0xffffffffUL))
    return addr &= 0xffffffffUL; /* sic! */
  else
    return addr;
}

See the comment in the sources for some background which I can understand 
based on my experience with the issues over the years and which I skipped 
here due to its length.

  Maciej


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