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: [PR tdep/7438] Replace gdbarch 'smash_text_address' with 'addr_bits_remove'


On 11/20/2012 09:09 AM, Yao Qi wrote:
> Hi,
> This patch is to remove gdbarch method 'smash_text_address', and replace
> it with gdbarch method 'addr_bits_remove'.
> 
> In gdbarch.sh, there is a line of comment,
> 
>   # It is not at all clear why gdbarch_smash_text_address is not folded into
>   # gdbarch_addr_bits_remove.
>   m:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr::core_addr_identity::0
> 
> which was added by this patch,
> 
>   RFC/PATCH multi-arch SMASH_TEXT_ADDRESS
>   http://sourceware.org/ml/gdb-patches/2002-02/msg00028.html
> 
> The issue (why SMASH_TEXT_ADDRESS is not folded into ADDR_BITS_REMOVE) was
> tracked by PR7438, but was  not investigated further.
> 
> AFAICS, macro SMASH_TEXT_ADDRESS was added for hppa by this change,
> 
> Fri Jan 28 10:40:34 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
> 
>         * config/pa/tm-hppa.h: Define macro SMASH_TEXT_ADDRESS.
>         * elfread.c (record_minimal_symbol_and_info),
>         dwarfread.c (process_dies), paread.c (pa_symtab_read): Use it.
> 
> However, the same function 'hppa_smash_text_address' is installed to both
> gdbarch methods 'addr_bits_remove' and 'smash_text_address'.  Method
> 'smash_text_address' is set in arm-tdep.c as well, but as we can see,
> 'arm_addr_bits_remove' can cover 'arm_smash_text_address'.
> 
> Except arm and hppa, there is no port use 'smash_text_address', so
> we can safely replace 'smash_text_address' with 'addr_bits_remove'.
> 
> Regression tested on arm-none-gnueabi.  Is it OK?

Looks right to me.  OK.

-- 
Pedro Alves


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