This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Functionalize registers[] and register_valid[]
- To: nsd at redhat dot com
- Subject: Re: [RFA] Functionalize registers[] and register_valid[]
- From: Eli Zaretskii <eliz at delorie dot com>
- Date: Thu, 4 Jan 2001 04:21:24 -0500 (EST)
- CC: gdb-patches at sources dot redhat dot com
- References: <200101032042.PAA14848@nog.bosbc.com>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
> Date: Wed, 3 Jan 2001 15:42:32 -0500
> From: Nicholas Duffek <nsd@redhat.com>
>
> This patch is in preparation for the new register definition interface
> patch following this message. It applies over the regno/regnum regcache.c
> patch I posted earlier.
>
> The patch replaces certain constructs with function calls, as follows:
>
> 1. "register_valid[regnum]" becomes "register_cached (regnum)" or
> "set_register_cached (regnum)".
>
> 2. "registers[regnum]" becomes "register_buffer (regnum)".
>
> 3. "registers" becomes "register_buffer (-1)".
>
> 4. "regnum < NUM_REGS" becomes "real_register (regnum)".
>
> 5. The sequence:
>
> if (real_register (regnum))
> target_fetch_registers (regnum);
> else if (pseudo_register (regnum))
> FETCH_PSEUDO_REGISTER (regnum);
>
> becomes "fetch_register (regnum)". This fixes a bug where
> read_signed_register() would fail given a pseudo-register.
>
> 6. The sequence:
>
> if (real_register (regnum))
> target_store_registers (regnum);
> else if (pseudo_register (regnum))
> STORE_PSEUDO_REGISTER (regnum);
>
> becomes "store_register (regnum)".
>
> The next patch will modify the new functions to call into the new register
> definition interface if it's active.
Is this change guaranteed to be 100% backward-compatible? That is,
will the old code still work? (From a quick look at the diffs, it
seems so, but I'm not sure I didn't miss something.)
If not, it will need to be accompanied by approriate changes to all
the application-level and target-specific code which currently uses
the old interface, or else that code will break.