2001-03-01 01:39:22 +00:00
|
|
|
/* Cache and manage the values of registers for GDB, the GNU debugger.
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
|
|
|
|
Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
|
|
|
|
2001, 2002 Free Software Foundation, Inc.
|
2001-03-01 01:39:22 +00:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
#ifndef REGCACHE_H
|
|
|
|
#define REGCACHE_H
|
|
|
|
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
struct regcache;
|
|
|
|
struct gdbarch;
|
|
|
|
|
|
|
|
extern struct regcache *current_regcache;
|
|
|
|
|
|
|
|
void regcache_xfree (struct regcache *regcache);
|
2002-07-03 20:36:54 +00:00
|
|
|
struct cleanup *make_cleanup_regcache_xfree (struct regcache *regcache);
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
struct regcache *regcache_xmalloc (struct gdbarch *gdbarch);
|
|
|
|
|
2003-09-27 19:32:53 +00:00
|
|
|
/* Return REGCACHE's architecture. */
|
|
|
|
|
|
|
|
extern struct gdbarch *get_regcache_arch (const struct regcache *regcache);
|
|
|
|
|
2001-03-24 01:26:09 +00:00
|
|
|
/* Transfer a raw register [0..NUM_REGS) between core-gdb and the
|
|
|
|
regcache. */
|
|
|
|
|
2002-07-24 19:43:43 +00:00
|
|
|
void regcache_raw_read (struct regcache *regcache, int rawnum, void *buf);
|
|
|
|
void regcache_raw_write (struct regcache *regcache, int rawnum,
|
|
|
|
const void *buf);
|
2002-08-13 14:32:28 +00:00
|
|
|
extern void regcache_raw_read_signed (struct regcache *regcache,
|
|
|
|
int regnum, LONGEST *val);
|
|
|
|
extern void regcache_raw_read_unsigned (struct regcache *regcache,
|
|
|
|
int regnum, ULONGEST *val);
|
2002-08-25 23:44:30 +00:00
|
|
|
extern void regcache_raw_write_signed (struct regcache *regcache,
|
|
|
|
int regnum, LONGEST val);
|
|
|
|
extern void regcache_raw_write_unsigned (struct regcache *regcache,
|
|
|
|
int regnum, ULONGEST val);
|
2002-08-19 00:43:41 +00:00
|
|
|
|
|
|
|
/* Partial transfer of a raw registers. These perform read, modify,
|
|
|
|
write style operations. */
|
|
|
|
|
|
|
|
void regcache_raw_read_part (struct regcache *regcache, int regnum,
|
|
|
|
int offset, int len, void *buf);
|
|
|
|
void regcache_raw_write_part (struct regcache *regcache, int regnum,
|
|
|
|
int offset, int len, const void *buf);
|
|
|
|
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
int regcache_valid_p (struct regcache *regcache, int regnum);
|
2001-03-24 01:26:09 +00:00
|
|
|
|
2002-08-02 18:08:31 +00:00
|
|
|
/* Transfer a cooked register [0..NUM_REGS+NUM_PSEUDO_REGS). */
|
|
|
|
void regcache_cooked_read (struct regcache *regcache, int rawnum, void *buf);
|
|
|
|
void regcache_cooked_write (struct regcache *regcache, int rawnum,
|
|
|
|
const void *buf);
|
|
|
|
|
2002-08-13 13:58:50 +00:00
|
|
|
/* NOTE: cagney/2002-08-13: At present GDB has no reliable mechanism
|
|
|
|
for indicating when a ``cooked'' register was constructed from
|
|
|
|
invalid or unavailable ``raw'' registers. One fairly easy way of
|
|
|
|
adding such a mechanism would be for the cooked functions to return
|
|
|
|
a register valid indication. Given the possibility of such a
|
|
|
|
change, the extract functions below use a reference parameter,
|
|
|
|
rather than a function result. */
|
|
|
|
|
|
|
|
/* Read a register as a signed/unsigned quantity. */
|
|
|
|
extern void regcache_cooked_read_signed (struct regcache *regcache,
|
|
|
|
int regnum, LONGEST *val);
|
|
|
|
extern void regcache_cooked_read_unsigned (struct regcache *regcache,
|
|
|
|
int regnum, ULONGEST *val);
|
2003-03-12 20:50:13 +00:00
|
|
|
extern void regcache_cooked_write_signed (struct regcache *regcache,
|
|
|
|
int regnum, LONGEST val);
|
|
|
|
extern void regcache_cooked_write_unsigned (struct regcache *regcache,
|
|
|
|
int regnum, ULONGEST val);
|
2002-08-13 13:58:50 +00:00
|
|
|
|
2002-08-19 00:43:41 +00:00
|
|
|
/* Partial transfer of a cooked register. These perform read, modify,
|
|
|
|
write style operations. */
|
|
|
|
|
|
|
|
void regcache_cooked_read_part (struct regcache *regcache, int regnum,
|
|
|
|
int offset, int len, void *buf);
|
|
|
|
void regcache_cooked_write_part (struct regcache *regcache, int regnum,
|
|
|
|
int offset, int len, const void *buf);
|
|
|
|
|
2001-11-15 06:43:10 +00:00
|
|
|
/* Transfer a raw register [0..NUM_REGS) between the regcache and the
|
|
|
|
target. These functions are called by the target in response to a
|
|
|
|
target_fetch_registers() or target_store_registers(). */
|
|
|
|
|
2002-07-24 19:43:43 +00:00
|
|
|
extern void supply_register (int regnum, const void *val);
|
2001-11-15 06:43:10 +00:00
|
|
|
extern void regcache_collect (int regnum, void *buf);
|
2003-08-29 09:59:28 +00:00
|
|
|
extern void regcache_raw_supply (struct regcache *regcache,
|
|
|
|
int regnum, const void *buf);
|
|
|
|
extern void regcache_raw_collect (const struct regcache *regcache,
|
|
|
|
int regnum, void *buf);
|
2001-11-15 06:43:10 +00:00
|
|
|
|
|
|
|
|
2002-08-25 18:47:16 +00:00
|
|
|
/* The register's ``offset''.
|
|
|
|
|
2003-03-14 17:07:01 +00:00
|
|
|
FIXME: cagney/2002-11-07: The frame_register() function, when
|
2002-11-07 21:43:23 +00:00
|
|
|
specifying the real location of a register, does so using that
|
|
|
|
registers offset in the register cache. That offset is then used
|
|
|
|
by valops.c to determine the location of the register. The code
|
|
|
|
should instead use the register's number and a location expression
|
|
|
|
to describe a value spread across multiple registers or memory. */
|
2002-08-25 18:47:16 +00:00
|
|
|
|
|
|
|
extern int register_offset_hack (struct gdbarch *gdbarch, int regnum);
|
|
|
|
|
|
|
|
|
2002-08-25 15:36:11 +00:00
|
|
|
/* The type of a register. This function is slightly more efficient
|
|
|
|
then its gdbarch vector counterpart since it returns a precomputed
|
|
|
|
value stored in a table.
|
|
|
|
|
|
|
|
NOTE: cagney/2002-08-17: The original macro was called
|
2003-09-30 13:29:44 +00:00
|
|
|
DEPRECATED_REGISTER_VIRTUAL_TYPE. This was because the register
|
|
|
|
could have different raw and cooked (nee virtual) representations.
|
|
|
|
The CONVERTABLE methods being used to convert between the two
|
2002-08-25 15:36:11 +00:00
|
|
|
representations. Current code does not do this. Instead, the
|
|
|
|
first [0..NUM_REGS) registers are 1:1 raw:cooked, and the type
|
|
|
|
exactly describes the register's representation. Consequently, the
|
|
|
|
``virtual'' has been dropped.
|
|
|
|
|
|
|
|
FIXME: cagney/2002-08-17: A number of architectures, including the
|
|
|
|
MIPS, are currently broken in this regard. */
|
|
|
|
|
|
|
|
extern struct type *register_type (struct gdbarch *gdbarch, int regnum);
|
|
|
|
|
|
|
|
|
2003-02-28 17:47:43 +00:00
|
|
|
/* Return the size of register REGNUM. All registers should have only
|
|
|
|
one size.
|
|
|
|
|
|
|
|
FIXME: cagney/2003-02-28:
|
|
|
|
|
Index: mi/ChangeLog
2003-10-24 Andrew Cagney <cagney@redhat.com>
* tui-out.c: Fix "fortunatly"[sic].
Index: doc/ChangeLog
2003-10-24 Andrew Cagney <cagney@redhat.com>
* annotate.texinfo: Fix "fortunatly"[sic].
2003-10-24 Andrew Cagney <cagney@redhat.com>
* osabi.c (gdbarch_init_osabi): Fix typos, and "fortunatly"[sic].
* PROBLEMS, arch-utils.c, cli-out.c, command.h: Ditto.
* complaints.c, cris-tdep.c, disasm.c, dwarf2-frame.c: Ditto.
* frame.c, frame.h, infcall.c, infcmd.c, infrun.c: Ditto.
* kod.c, mips-tdep.c, regcache.c, regcache.h, remote.c: Ditto.
2003-10-24 17:37:04 +00:00
|
|
|
Unfortunately, thanks to some legacy architectures, this doesn't
|
2003-02-28 17:47:43 +00:00
|
|
|
hold. A register's cooked (nee virtual) and raw size can differ
|
|
|
|
(see MIPS). Such architectures should be using different register
|
|
|
|
numbers for the different sized views of identical registers.
|
|
|
|
|
|
|
|
Anyway, the up-shot is that, until that mess is fixed, core code
|
|
|
|
can end up being very confused - should the RAW or VIRTUAL size be
|
2003-09-30 19:12:20 +00:00
|
|
|
used? As a rule of thumb, use DEPRECATED_REGISTER_VIRTUAL_SIZE in
|
|
|
|
cooked code, but with the comment:
|
2003-02-28 17:47:43 +00:00
|
|
|
|
|
|
|
OK: REGISTER_VIRTUAL_SIZE
|
|
|
|
|
|
|
|
or just
|
|
|
|
|
|
|
|
OK
|
|
|
|
|
|
|
|
appended to the end of the line. */
|
|
|
|
|
|
|
|
extern int register_size (struct gdbarch *gdbarch, int regnum);
|
|
|
|
|
|
|
|
|
2003-03-10 19:08:47 +00:00
|
|
|
/* Save/restore a register cache. The set of registers saved /
|
|
|
|
restored into the DST regcache determined by the save_reggroup /
|
|
|
|
restore_reggroup respectively. COOKED_READ returns zero iff the
|
|
|
|
register's value can't be returned. */
|
|
|
|
|
|
|
|
typedef int (regcache_cooked_read_ftype) (void *src, int regnum, void *buf);
|
|
|
|
|
|
|
|
extern void regcache_save (struct regcache *dst,
|
|
|
|
regcache_cooked_read_ftype *cooked_read,
|
|
|
|
void *src);
|
|
|
|
extern void regcache_restore (struct regcache *dst,
|
|
|
|
regcache_cooked_read_ftype *cooked_read,
|
|
|
|
void *src);
|
2002-11-13 17:59:40 +00:00
|
|
|
|
2002-06-22 21:18:32 +00:00
|
|
|
/* Copy/duplicate the contents of a register cache. By default, the
|
|
|
|
operation is pass-through. Writes to DST and reads from SRC will
|
|
|
|
go through to the target.
|
|
|
|
|
|
|
|
The ``cpy'' functions can not have overlapping SRC and DST buffers.
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
|
|
|
|
``no passthrough'' versions do not go through to the target. They
|
2002-06-22 21:18:32 +00:00
|
|
|
only transfer values already in the cache. */
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
|
|
|
|
extern struct regcache *regcache_dup (struct regcache *regcache);
|
|
|
|
extern struct regcache *regcache_dup_no_passthrough (struct regcache *regcache);
|
|
|
|
extern void regcache_cpy (struct regcache *dest, struct regcache *src);
|
|
|
|
extern void regcache_cpy_no_passthrough (struct regcache *dest, struct regcache *src);
|
|
|
|
|
2002-11-02 20:06:56 +00:00
|
|
|
/* NOTE: cagney/2002-11-02: The below have been superseded by the
|
|
|
|
regcache_cooked_*() functions found above, and the frame_*()
|
|
|
|
functions found in "frame.h". Take care though, often more than a
|
|
|
|
simple substitution is required when updating the code. The
|
|
|
|
change, as far as practical, should avoid adding references to
|
|
|
|
global variables (e.g., current_regcache, current_frame,
|
2002-11-29 Andrew Cagney <ac131313@redhat.com>
* stack.c (selected_frame, select_frame): Move from here ...
* frame.c (selected_frame, select_frame): ... to here. Include
"language.h".
* Makefile.in (frame.o): Update dependencies.
* frame.c (get_selected_frame): New function.
* frame.h (get_selected_frame): Declare.
(deprecated_selected_frame): Rename selected_frame.
* ada-lang.c, ada-tasks.c, breakpoint.c, corelow.c: Update.
* eval.c, f-valprint.c, findvar.c, frame.c, frame.h: Update.
* h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, infcmd.c: Update.
* inflow.c, infrun.c, macroscope.c, mips-tdep.c: Update.
* mn10300-tdep.c, ocd.c, regcache.h, remote-e7000.c: Update.
* remote-mips.c, remote-rdp.c, sh-tdep.c, sparc-tdep.c: Update.
* stack.c, thread.c, tracepoint.c, valops.c, varobj.c: Update.
* z8k-tdep.c, cli/cli-cmds.c: Update.
Index: mi/ChangeLog
2002-11-29 Andrew Cagney <ac131313@redhat.com>
* mi/mi-cmd-stack.c, mi/mi-main.c: Update to use
deprecated_selected_frame.
Index: tui/ChangeLog
2002-11-29 Andrew Cagney <ac131313@redhat.com>
* tui/tui-hooks.c: Update to use deprecated_selected_frame.
* tui/tui.c, tui/tuiDisassem.c, tui/tuiRegs.c: Ditto.
* tui/tuiSource.c, tui/tuiSourceWin.c, tui/tuiWin.c: Ditto.
2002-11-29 19:15:16 +00:00
|
|
|
current_gdbarch or deprecated_selected_frame) and instead refer to
|
|
|
|
the FRAME or REGCACHE that has been passed into the containing
|
|
|
|
function as parameters. Consequently, the change typically
|
|
|
|
involves modifying the containing function so that it takes a FRAME
|
|
|
|
or REGCACHE parameter. In the case of an architecture vector
|
|
|
|
method, there should already be a non-deprecated variant that is
|
|
|
|
parameterized with FRAME or REGCACHE. */
|
2002-11-02 20:06:56 +00:00
|
|
|
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
extern char *deprecated_grub_regcache_for_registers (struct regcache *);
|
2002-11-02 20:06:56 +00:00
|
|
|
extern void deprecated_read_register_gen (int regnum, char *myaddr);
|
|
|
|
extern void deprecated_write_register_gen (int regnum, char *myaddr);
|
2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.h (deprecated_read_register_bytes): Rename
read_register_bytes.
(deprecated_write_register_bytes): Rename write_register_bytes.
* alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update.
* dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update.
* m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update.
* ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update.
* remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update.
* sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update.
* xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update.
* config/nm-m3.h, config/h8500/tm-h8500.h: Update.
* config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update.
* config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update.
* config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update.
* config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update.
* config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update.
* config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update.
2002-11-13 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (mi_cmd_data_write_register_values): Use
deprecated_write_register_bytes instead of write_register_bytes.
2002-11-14 00:25:05 +00:00
|
|
|
extern void deprecated_read_register_bytes (int regbyte, char *myaddr,
|
|
|
|
int len);
|
|
|
|
extern void deprecated_write_register_bytes (int regbyte, char *myaddr,
|
|
|
|
int len);
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
|
2002-11-07 02:40:28 +00:00
|
|
|
/* Character array containing the current state of each register
|
|
|
|
(unavailable<0, invalid=0, valid>0) for the most recently
|
|
|
|
referenced thread. This global is often found in close proximity
|
|
|
|
to code that is directly manipulating the deprecated_registers[]
|
|
|
|
array. In such cases, it should be possible to replace the lot
|
|
|
|
with a call to supply_register(). If you find yourself in dire
|
|
|
|
straits, still needing access to the cache status bit, the
|
|
|
|
regcache_valid_p() and set_register_cached() functions are
|
|
|
|
available. */
|
|
|
|
extern signed char *deprecated_register_valid;
|
|
|
|
|
2002-11-14 Andrew Cagney <ac131313@redhat.com>
* regcache.h (deprecated_registers): Rename registers.
* a68v-nat.c, alpha-nat.c, arch-utils.c, core-sol2.c: Update.
* hp300ux-nat.c, hppab-nat.c, hppah-nat.c: Update.
* hppam3-nat.c, hpux-thread.c, i386gnu-nat.c: Update.
* ia64-aix-nat.c, ia64-linux-nat.c, ia64-tdep.c: Update.
* irix4-nat.c, irix5-nat.c, lynx-nat.c, m68k-tdep.c: Update.
* m68knbsd-nat.c, mips-linux-tdep.c, mipsm3-nat.c: Update.
* mipsv4-nat.c, ns32knbsd-nat.c, ppc-bdm.c: Update.
* ppc-sysv-tdep.c, ptx4-nat.c, regcache.c, remote-es.c: Update.
* remote-sds.c, remote-vx68.c, remote-vxmips.c: Update.
* remote-vxsparc.c, rs6000-tdep.c, sol-thread.c: Update.
* sparc-nat.c, sparc-tdep.c, sun3-nat.c, symm-nat.c: Update.
* v850ice.c: Update.
2002-11-14 20:37:29 +00:00
|
|
|
/* Character array containing an image of the inferior programs'
|
|
|
|
registers for the most recently referenced thread.
|
|
|
|
|
|
|
|
NOTE: cagney/2002-11-14: Target side code should be using
|
|
|
|
supply_register() and/or regcache_collect() while architecture side
|
|
|
|
code should use the more generic regcache methods. */
|
|
|
|
|
|
|
|
extern char *deprecated_registers;
|
|
|
|
|
2002-11-07 15:31:31 +00:00
|
|
|
/* NOTE: cagney/2002-11-05: This function, and its co-conspirator
|
|
|
|
deprecated_registers[], have been superseeded by supply_register(). */
|
|
|
|
extern void deprecated_registers_fetched (void);
|
|
|
|
|
2001-03-01 01:39:22 +00:00
|
|
|
extern int register_cached (int regnum);
|
|
|
|
|
|
|
|
extern void set_register_cached (int regnum, int state);
|
|
|
|
|
|
|
|
extern void registers_changed (void);
|
|
|
|
|
|
|
|
|
|
|
|
/* Rename to read_unsigned_register()? */
|
|
|
|
extern ULONGEST read_register (int regnum);
|
|
|
|
|
|
|
|
/* Rename to read_unsigned_register_pid()? */
|
2001-05-04 04:15:33 +00:00
|
|
|
extern ULONGEST read_register_pid (int regnum, ptid_t ptid);
|
2001-03-01 01:39:22 +00:00
|
|
|
|
|
|
|
extern void write_register (int regnum, LONGEST val);
|
|
|
|
|
2001-05-04 04:15:33 +00:00
|
|
|
extern void write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid);
|
2001-03-01 01:39:22 +00:00
|
|
|
|
|
|
|
#endif /* REGCACHE_H */
|