[patch/multi-arch] Move TARGET_{READ,WRITE}_{PC,FP,SP} to gdbarch.h
Andrew Cagney
ac131313@cygnus.com
Thu Aug 10 20:17:00 GMT 2000
FYI,
The attatched patch moves the TARGET_{READ,WRITE}_{PC,FP,SP} macros to
gdbarch.h (from regcache.c). It also provides default values.
Andrew
2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>
* regcache.c (TARGET_WRITE_PC, TARGET_READ_PC, TARGET_READ_FP,
TARGET_WRITE_FP, TARGET_READ_SP, TARGET_WRITE_SP): Move
initialization from here.
* gdbarch.sh: To here.
* gdbarch.h, gdbarch.c: Regenerate.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.39
diff -p -r1.39 gdbarch.sh
*** gdbarch.sh 2000/08/11 02:55:38 1.39
--- gdbarch.sh 2000/08/11 03:09:10
*************** v::TARGET_PTR_BIT:int:ptr_bit::::8 * siz
*** 324,338 ****
# Number of bits in a BFD_VMA for the target object file format.
v::TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
#
! v:1:IEEE_FLOAT:int:ieee_float::::0:0::0:::
#
! f:1:TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:0
! f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0
! f:1:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:0
! f:1:TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:0
! f:1:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:0
! f:1:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:0
! #
#
v:2:NUM_REGS:int:num_regs::::0:-1
# This macro gives the number of pseudo-registers that live in the
--- 324,337 ----
# Number of bits in a BFD_VMA for the target object file format.
v::TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
#
! v::IEEE_FLOAT:int:ieee_float::::0:0::0:::
#
! f::TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:generic_target_read_pc::0
! f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:generic_target_write_pc::0
! f::TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0
! f::TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:generic_target_write_fp::0
! f::TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0
! f::TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0
#
v:2:NUM_REGS:int:num_regs::::0:-1
# This macro gives the number of pseudo-registers that live in the
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.6
diff -p -r1.6 regcache.c
*** regcache.c 2000/07/24 14:35:14 1.6
--- regcache.c 2000/08/11 03:09:10
*************** default_get_saved_register (char *raw_bu
*** 200,210 ****
*addrp = addr;
}
- #if !defined (GET_SAVED_REGISTER)
- #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
- default_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
- #endif
-
void
get_saved_register (char *raw_buffer,
int *optimized,
--- 200,205 ----
*************** supply_register (int regno, char *val)
*** 715,724 ****
eliminate the intermediate read_pc_pid(). The client would call
TARGET_READ_PC directly. (cagney). */
- #ifndef TARGET_READ_PC
- #define TARGET_READ_PC generic_target_read_pc
- #endif
-
CORE_ADDR
generic_target_read_pc (int pid)
{
--- 710,715 ----
*************** read_pc (void)
*** 755,764 ****
return read_pc_pid (inferior_pid);
}
- #ifndef TARGET_WRITE_PC
- #define TARGET_WRITE_PC generic_target_write_pc
- #endif
-
void
generic_target_write_pc (CORE_ADDR pc, int pid)
{
--- 746,751 ----
*************** write_pc (CORE_ADDR pc)
*** 796,805 ****
/* Cope with strage ways of getting to the stack and frame pointers */
- #ifndef TARGET_READ_SP
- #define TARGET_READ_SP generic_target_read_sp
- #endif
-
CORE_ADDR
generic_target_read_sp (void)
{
--- 783,788 ----
*************** read_sp (void)
*** 816,825 ****
return TARGET_READ_SP ();
}
- #ifndef TARGET_WRITE_SP
- #define TARGET_WRITE_SP generic_target_write_sp
- #endif
-
void
generic_target_write_sp (CORE_ADDR val)
{
--- 799,804 ----
*************** write_sp (CORE_ADDR val)
*** 839,848 ****
TARGET_WRITE_SP (val);
}
- #ifndef TARGET_READ_FP
- #define TARGET_READ_FP generic_target_read_fp
- #endif
-
CORE_ADDR
generic_target_read_fp (void)
{
--- 818,823 ----
*************** read_fp (void)
*** 858,867 ****
{
return TARGET_READ_FP ();
}
-
- #ifndef TARGET_WRITE_FP
- #define TARGET_WRITE_FP generic_target_write_fp
- #endif
void
generic_target_write_fp (CORE_ADDR val)
--- 833,838 ----
More information about the Gdb-patches
mailing list