This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa/c] Signed read_register()
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [rfa/c] Signed read_register()
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Mon, 10 Jul 2000 20:27:44 -0700
- CC: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Organization: Cygnus Solutions
- References: <396A9331.EBB745B6@cygnus.com>
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?