Commit Graph

19 Commits

Author SHA1 Message Date
Mark Kettenis c00dcbe965 * regcache.c (regcache_raw_write_signed,
regcache_raw_write_unsigned): New functions.
* regcache.h (regcache_raw_write_signed,
regcache_raw_write_unsigned): New prototypes.
2002-08-25 23:44:30 +00:00
Andrew Cagney d3b22ed57c 2002-08-25 Andrew Cagney <ac131313@redhat.com>
* regcache.h (register_offset_hack): Declare.
	(regcache_cooked_read_using_offset_hack): Declare.
	(regcache_cooked_write_using_offset_hack): Declare.

	* regcache.c (register_offset_hack): New function.
	(regcache_cooked_read_using_offset_hack): New function.
	(regcache_cooked_write_using_offset_hack): New function.
	(regcache_dump): Check that the registers, according to their
	offset, are packed hard against each other.
	(cooked_xfer_using_offset_hack): New function.
2002-08-25 18:47:16 +00:00
Andrew Cagney bb4250135d 2002-08-25 Andrew Cagney <ac131313@redhat.com>
* regcache.c (struct regcache_descr): Add field register_type.
	(init_legacy_regcache_descr): Pass a pre-allocated regcache_descr
	in as a parameter
	(init_regcache_descr): Initialize register_type.  Pass the descr
	to init_legacy_regcache_descr.  Use register_type instead of
	REGISTER_VIRTUAL_TYPE.
	(register_type): New function.
	(regcache_dump): Replace REGISTER_VIRTUAL_TYPE with register_type.
	* regcache.h (register_type): Declare.
2002-08-25 15:36:11 +00:00
Andrew Cagney 0ed04cce6d 2002-08-25 Andrew Cagney <ac131313@redhat.com>
* regcache.c (max_register_size): New function.
	(init_legacy_regcache_descr): Ensure that max_register_size is
	large enough for REGISTER_VIRTUAL_SIZE.
	* regcache.h (max_register_size): Declare.
2002-08-25 14:44:04 +00:00
Andrew Cagney 06c0b04e1c 2002-08-18 Andrew Cagney <ac131313@redhat.com>
* regcache.c (regcache_xfer_part): New function.
(regcache_raw_read_part): New function.
(regcache_raw_write_part): New function.
(regcache_cooked_read_part): New function.
(regcache_cooked_write_part): New function.
* regcache.h (regcache_raw_read_part): Declare.
(regcache_raw_write_part): Declare.
(regcache_cooked_read_part): Declare.
(regcache_cooked_write_part): Declare.
2002-08-19 00:43:41 +00:00
Andrew Cagney 28fc674094 2002-08-13 Andrew Cagney <cagney@redhat.com>
* i386-tdep.c (i386_register_name): Handle mmx registers.
(mmx_regnum_p): New function.
(i386_mmx_names): New array.
(mmx_num_regs): New variable.
(i386_pseudo_register_read): New function.
(i386_pseudo_register_write): New function.
(mmx_regnum_to_fp_regnum): New function. Code from Fernando Nasser.

* regcache.c (regcache_raw_read_unsigned): New function.
(regcache_raw_read_signed): New function.
* regcache.h (regcache_raw_read_unsigned): Declare.
(regcache_raw_read_signed): Declare.
2002-08-13 14:32:28 +00:00
Andrew Cagney a378f41926 2002-08-12 Andrew Cagney <cagney@redhat.com>
* regcache.c (regcache_raw_read_as_address): Delete function.
(regcache_cooked_read_signed): New function.
(regcache_cooked_read_unsigned): New function.
* regcache.h (regcache_cooked_read_signed): Declare.
(regcache_cooked_read_unsigned): Declare.
(regcache_raw_read_as_address): Delete declaration.
* blockframe.c (generic_read_register_dummy): Use
regcache_cooked_read_unsigned.
* i386-tdep.c (i386_extract_struct_value_address): Use
regcache_cooked_read_unsigned.
2002-08-13 13:58:50 +00:00
Andrew Cagney 68365089fc Add the cooked register interface. 2002-08-02 18:08:31 +00:00
Andrew Cagney 1aaa5f999f 2002-07-24 Andrew Cagney <cagney@redhat.com>
* regcache.c (regcache_raw_write): Change buf parameter to a
constant void pointer.
(regcache_raw_read): Change buf parameter to a void pointer.
(legacy_write_register_gen): Change myaddr parameter a constant
void pointer.
(supply_register): Change val parameter to a const void pointer.
* regcache.h (regcache_raw_write): Update declaration.
(regcache_raw_read): Update declaration.
(supply_register): Update declaration.
2002-07-24 19:43:43 +00:00
Andrew Cagney 0818c12a55 2002-07-24 Andrew Cagney <cagney@redhat.com>
* regcache.h (regcache_raw_read, regcache_raw_write): Replace
regcache_read and regcache_write.
(regcache_raw_read_as_address): Replace regcache_read_as_address.
* regcache.c: Update.
* sh-tdep.c (sh64_push_arguments): Update comment.
(sh_pseudo_register_read): Update.
(sh_pseudo_register_write): Update.
(sh4_register_read): Update.
(sh4_register_write): Update.
(sh64_pseudo_register_read): Update.
(sh64_pseudo_register_write): Update.
(sh64_register_read): Update.
(sh64_register_write): Update.
* i386-tdep.c (i386_extract_return_value): Update.
(i386_extract_struct_value_address): Update.
(i386_extract_return_value): Update.
* blockframe.c (generic_read_register_dummy): Update.
(generic_call_dummy_register_unwind): Update
* infrun.c (write_inferior_status_register): Update.
2002-07-24 14:38:55 +00:00
Andrew Cagney 36160dc4b2 * infcmd.c (print_return_value): Remove compatibility code calling
deprecated_grub_regcache_for_registers.

* values.c: Include "regcache.h".
(value_being_returned): Update.  Use
deprecated_grub_regcache_for_registers to extract the register
buffer address.
* value.h (value_being_returned): Change ``retbuf'' parameter to a
``struct regcache''.
* Makefile.in (values.o): Add dependency on $(regcache_h).

* inferior.h (run_stack_dummy): Change type of second parameter to
a ``struct regcache''.
* valops.c (hand_function_call): Change type of retbuf to ``struct
regcache''.  Allocate using regcache_xmalloc, clean using
make_cleanup_regcache_xfree.
* infcmd.c (run_stack_dummy): Update.  Use
regcache_cpu_no_passthrough instead of memcpy to copy the buffer.

* regcache.c (do_regcache_xfree): New function.
(make_cleanup_regcache_xfree): New function.
* regcache.h (make_cleanup_regcache_xfree): Declare.
2002-07-03 20:36:54 +00:00
Andrew Cagney 37e7137227 * regcache.h: Update comments describing the regcache_cpy family
of functions.
(regcache_save, regcache_restore): Delete declaration.
(regcache_save_no_passthrough): Delete declaration.
(regcache_restore_no_passthrough): Delete declaration.
* regcache.c (regcache_save): Delete function.
(regcache_save_no_passthrough): Delete function.
(regcache_restore): Delete function.
(regcache_restore_no_passthrough): Delete function.
2002-06-22 21:18:32 +00:00
Andrew Cagney 3fadccb31d * 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
Andrew Cagney 193cb69f7b * TODO (register_buffer): Delete.
* regcache.c (register_buffer): Make static.
(regcache_collect): New function.
* regcache.h (register_buffer): Delete declaration.
(regcache_collect): Declare.
* remote.c (store_register_using_P): Rewrite using
regcache_collect.
(remote_store_registers): Ditto.
* go32-nat.c (store_register): Ditto.
2001-11-15 06:43:10 +00:00
Kevin Buettner 39f770628a Phase 1 of the ptid_t changes. 2001-05-04 04:15:33 +00:00
Andrew Cagney 61a0eb5b8e Re-vamp the register code so that a lot more is routed through
{read,write}_register_gen.  Hook that function with multi-arch.
2001-03-24 01:26:09 +00:00
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Andrew Cagney 97900206ca * regcache.h (register_valid): Fix comment documenting valid
states.
2001-03-01 01:51:54 +00:00
Andrew Cagney 4e052eda91 Create new file regcache.h. Update all uses. 2001-03-01 01:39:22 +00:00