This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: arm_addr_bits_remove
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: Joel Brobecker <brobecker at adacore dot com>, Pedro Alves <pedro at codesourcery dot com>, Jim Blandy <jimb at red-bean dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Mon, 4 Feb 2008 14:44:32 +0000 (GMT)
- Subject: Re: arm_addr_bits_remove
- References: <479752C8.8030201@portugalmail.pt> <8f2776cb0801231121r3fe9aea0q6f3c3d6887fcb251@mail.gmail.com> <20080123192842.GA22477@caradoc.them.org> <8f2776cb0801231311o19c31781h8a4663c405bcd22b@mail.gmail.com> <479819E2.1030603@portugalmail.pt> <8f2776cb0801232227n64502d4akef4642b051e77772@mail.gmail.com> <4798871B.4080207@codesourcery.com> <20080124133844.GA15771@caradoc.them.org> <20080124214849.GF3979@adacore.com> <Pine.LNX.4.64N.0802041006230.23236@blysk.ds.pg.gda.pl> <20080204134132.GB28485@caradoc.them.org>
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