This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Saving/restoring the entire register set
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: gdb at sources dot redhat dot com
- Cc: Richard dot Earnshaw at arm dot com
- Date: Tue, 14 May 2002 16:17:37 +0100
- Subject: Saving/restoring the entire register set
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
The current implementation of generic_{push,pop}_dummy_frame use
{read,write}_register_bytes (0, addr, REGISTER_BYTES)
to save/restore the entire regset.
This is causing a problem for me with the new pseudo/raw register
separation that I'm trying to create because write_register_bytes calls
write_register_gen which calls arm_register_write and then aborts because
we are trying to directly update a raw register rather than a pseudo.
While the dummy frame code does seem to be doing something sensible, doing
it this way is somewhat of a pain, because I really want to fault out
attempts to directly poke into the raw registers (I've already tracked down
two or three bugs this way).
For this special case of saving/restoring the entire register bank, I wonder if a more suitable interface might be to have calls such as
struct regcache *regcache_alloc (); /* Allocate a new regcache structure */
regcache_save (regcache); /* Copy current registers into it */
regcache_restore (regcache); /* Restore registers from it */
regcache_free (regcache); /* Release it */
which would directly perform the precise operations that are required.
These routines could then directly use the legacy_{read,write}_register_gen
interface to fill/restore a copy of the structure.
R.