[wip/rfc] Handle saved regcache using a regbuf

Andrew Cagney ac131313@cygnus.com
Sat May 11 12:39:00 GMT 2002


Hello,

Several chunks of code like to make a copy of the global (ulgh) 
registers[] array and then manipulate the copy using REGISTER_BYTE().

For instance:
- after an inferior function call has completed, the inferior function 
call code saves the post-call register state before restoring the 
registers to the pre-call state.  The saved state is then used by 
architecture specific functions to extract return values and the like.
- the dummy frame code, uses a buffer to save the registers of the dummy 
frame

The attached patch is a work-in-progress that rewrites such code to use 
a ``struct regbuf'' object.  regcache_save() is used to save the 
register cache, and regcache_restore_no_writethrough() to later restore 
it (instead of write_register_bytes()).

At this stage, in addition to testing, I'm still trying to figure out 
how to transition target architectures to this new mechanism without 
breaking existing builds.  Interfaces such as 
extract_struct_return_value_address() and extract_return_value() are 
affected.  I suspect I'll be renaming the existing interfaces to 
deprecated_..., and then installing new ones.

Anyway, i'm tableing this for comment.  In a few days, I'll separate out 
the regbuf.[hc] code and post that separatly as a patch.

enjoy,
Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb/attachments/20020511/50648ae0/attachment.ksh>


More information about the Gdb mailing list