Re: arm_addr_bits_remove

Pedro Alves
2008-01-24T23:50:45Z

Joel Brobecker wrote:
> I just ran the testsuite on hppa and mips-irix, no regression.
> It might not come as a surprise given that the patch is removing
> something that handles what amounts to incorrect debugging info,
> but it's better than nothing. In both case, we use GNU and the
> system linker.
>

For the record:

hppa-tdep.c has this function registered as gdbarch_addr_bits_remove:

static CORE_ADDR
hppa_smash_text_address (CORE_ADDR addr)
{
/* The low two bits of the PC on the PA contain the privilege level.
Some genius implementing a (non-GCC) compiler apparently decided
this means that "addresses" in a text section therefore include a
privilege level, and thus symbol tables should contain these bits.
This seems like a bonehead thing to do--anyway, it seems to work
for our purposes to just ignore those bits. */

return (addr &= ~0x3);
}

I guess that compiler would be HP's. If the symbols had the bits set,
so could the line info. Do we still support HP's object format and
debug info ?

I see that the hppa port of gas has this .export pseudo that enable
the setting of a privilege level (priv_lev in c-hppa.texi). It doesn't
seem to be covered by gdb's testsuite in testsuite/gdb.hp.

--
Pedro Alves