This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [rfa/c] Signed read_register()


Andrew Cagney wrote:
> 
> Hello,
> 
> The attatched patch adds a signed version of the read_register{,_pid}()
> functions (read_signed_register{,_pid}()).  MIPS uses this when reading
> registers such as the PC/SP (well it will when I check in a few other
> changes :-).
> 
> I think the existing read_register*() functions should be explicitly
> re-named to read_unsigned_register() but that is another story :-)
> 
> Ok?  MichaelS, regcache.c is yours.

Attachment missing.  The idea is OK.
Is it possible that read_signed_register could be implemented
using read_register, or vice versa, to avoid code duplication?

Side issue #1: Shall we change the return type of
read_register from CORE_ADDR to LONGEST?  Or better
still, define a new INTREG_TYPE?

Side issue #2: Why can't the caller simply sign-extend?
Esp. if the return type is of the correct size?

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