diff options
author | Michael Snyder <msnyder@vmware.com> | 2000-07-12 22:01:17 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2000-07-12 22:01:17 +0000 |
commit | fcdc5976b34caefdbc10b76bd953394916a44856 (patch) | |
tree | f6f69f0eb569787ee747572c130f99ad926908ec /gdb/inferior.h | |
parent | 86d65c94b28348d0f70a9bac843ae3b2d4f43b85 (diff) | |
download | gdb-fcdc5976b34caefdbc10b76bd953394916a44856.zip gdb-fcdc5976b34caefdbc10b76bd953394916a44856.tar.gz gdb-fcdc5976b34caefdbc10b76bd953394916a44856.tar.bz2 |
2000-07-12 Michael Snyder <msnyder@cleaver.cygnus.com>
* regcache.c (registers_changed, registers_fetched): Use
ARCH_NUM_REGS directly, eliminating an unnecessary variable.
This change adds pseudo-register capability to GDB.
Pseudo-registers are handled like registers, but they
don't come from or live on the target. They may be
aliases for an existing register, or they may be computed.
* defs.h (NUM_PSEUDO_REGISTERS): Define default of zero.
(ARCH_FETCH_PSEUDO_REGISTERS): Define default of no-op.
(ARCH_STORE_PSEUDO_REGISTERS): Define default of no-op.
# regcache.c (registers_changed): Mark pseudo-registers
invalid, as well as real registers.
(registers_fetched): Do not mark pseudo-registers as fetched
at the same time as other (real) registers.
(read_register_bytes): Fetch pseudo-registers (if any) from
the target architecture module instead of from the target.
(read_register_gen): Ditto.
(read_register): Ditto.
(write_register_bytes): Store pseudo-registers (if any) to
the target architecture module instead of to the target.
(write_register_gen): Ditto.
(write_register): Ditto.
(build_regcache): Allocate enough register_valid space for
pseudo-registers as well as normal (real) ones.
Diffstat (limited to 'gdb/inferior.h')
-rw-r--r-- | gdb/inferior.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gdb/inferior.h b/gdb/inferior.h index 26798a5..95a8c61 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -52,12 +52,36 @@ extern void write_inferior_status_register (struct inferior_status /* This macro gives the number of registers actually in use by the inferior. This may be less than the total number of registers, - perhaps depending on the actual CPU in use or program being run. */ + perhaps depending on the actual CPU in use or program being run. + FIXME: This could be replaced by the new MULTI_ARCH capability. */ #ifndef ARCH_NUM_REGS #define ARCH_NUM_REGS NUM_REGS #endif +/* This macro gives the number of pseudo-registers that live in the + register namespace but do not get fetched or stored on the target. + These pseudo-registers may be aliases for other registers, + combinations of other registers, or they may be computed by GDB. + FIXME: move into gdbarch.[ch] */ +#ifndef NUM_PSEUDO_REGS +#define NUM_PSEUDO_REGS 0 +#endif + +/* This function is called when the value of a pseudo-register needs + to be updated. Typically it will be defined on a per-architecture + basis. FIXME: move into gdbarch.[ch]. */ +#ifndef ARCH_FETCH_PSEUDO_REGISTERS +#define ARCH_FETCH_PSEUDO_REGISTERS(REGNUM) /* no-op */ +#endif + +/* This function is called when the value of a pseudo-register needs + to be set or stored. Typically it will be defined on a per-architecture + basis. FIXME: move into gdbarch.[ch]. */ +#ifndef ARCH_STORE_PSEUDO_REGISTERS +#define ARCH_STORE_PSEUDO_REGISTERS(REGNUM) /* no-op */ +#endif + extern void set_sigint_trap (void); extern void clear_sigint_trap (void); |