This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] multi-arch CANNOT_^&*^*&_REGISTER(); Was: New gdb 31 & 64 bit patches for S/390


Hello,

This multi-arches CANNOT_FETCH_REGISTER() and CANNOT_STORE_REGISTER(). 
It should be equivalent to the original s390 gdbarch.sh patch.
I should note that the original s390 patch included a change that added 
the concept of a default expression/values.  I've left that idea for a 
rain day.

	Andrew
2001-06-15  Andrew Cagney  <ac131313@redhat.com>

	* gdbarch.sh (CANNOT_FETCH_REGISTER): Multi-arch.
	(CANNOT_STORE_REGISTER): Ditto.
	* infptrace.c (CANNOT_FETCH_REGISTER): Delete definition.
	(CANNOT_STORE_REGISTER): Ditto.
	* regcache.c (CANNOT_STORE_REGISTER): Ditto.
	* lynx-nat.c (CANNOT_STORE_REGISTER): Ditto.
	* arch-utils.h (cannot_register_not): Define.
	* arch-utils.c (cannot_register_not): Declare.
	
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.31
diff -p -r1.31 arch-utils.c
*** arch-utils.c	2001/06/15 23:10:54	1.31
--- arch-utils.c	2001/06/15 23:39:34
*************** init_frame_pc_noop (int fromleaf, struct
*** 306,311 ****
--- 306,317 ----
    return;
  }
  
+ int
+ cannot_register_not (int regnum)
+ {
+   return 0;
+ }
+ 
  /* Functions to manipulate the endianness of the target.  */
  
  #ifdef TARGET_BYTE_ORDER_SELECTABLE
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.16
diff -p -r1.16 arch-utils.h
*** arch-utils.h	2001/06/15 23:10:54	1.16
--- arch-utils.h	2001/06/15 23:39:34
*************** extern int generic_prepare_to_proceed (i
*** 115,118 ****
--- 115,123 ----
  
  void init_frame_pc_noop (int fromleaf, struct frame_info *prev);
  
+ /* Version of cannot_fetch_register() / cannot_store_register() that
+    always fails. */
+ 
+ int cannot_register_not (int regnum);
+ 
  #endif
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.69
diff -p -r1.69 gdbarch.sh
*** gdbarch.sh	2001/06/15 23:10:55	1.69
--- gdbarch.sh	2001/06/15 23:39:35
*************** f:2:DO_REGISTERS_INFO:void:do_registers_
*** 429,434 ****
--- 429,436 ----
  # also include/...-sim.h.
  f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::default_register_sim_regno::0
  F:2:REGISTER_BYTES_OK:int:register_bytes_ok:long nr_bytes:nr_bytes::0:0
+ f:2:CANNOT_FETCH_REGISTER:int:cannot_fetch_register:int regnum:regnum:::cannot_register_not::0
+ f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0
  #
  v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1
  v:2:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0
Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.15
diff -p -r1.15 infptrace.c
*** infptrace.c	2001/05/15 00:03:36	1.15
--- infptrace.c	2001/06/15 23:39:35
*************** _initialize_kernel_u_addr (void)
*** 349,359 ****
      - KERNEL_U_ADDR
  #endif
  
- /* Registers we shouldn't try to fetch.  */
- #if !defined (CANNOT_FETCH_REGISTER)
- #define CANNOT_FETCH_REGISTER(regno) 0
- #endif
- 
  /* Fetch one register.  */
  
  static void
--- 349,354 ----
*************** fetch_inferior_registers (int regno)
*** 417,427 ****
  	}
      }
  }
- 
- /* Registers we shouldn't try to store.  */
- #if !defined (CANNOT_STORE_REGISTER)
- #define CANNOT_STORE_REGISTER(regno) 0
- #endif
  
  /* Store one register. */
  
--- 412,417 ----
Index: lynx-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/lynx-nat.c,v
retrieving revision 1.8
diff -p -r1.8 lynx-nat.c
*** lynx-nat.c	2001/05/04 04:15:25	1.8
--- lynx-nat.c	2001/06/15 23:39:35
*************** fetch_inferior_registers (int regno)
*** 539,549 ****
     If REGNO is -1, do this for all registers.
     Otherwise, REGNO specifies which register (so we can save time).  */
  
- /* Registers we shouldn't try to store.  */
- #if !defined (CANNOT_STORE_REGISTER)
- #define CANNOT_STORE_REGISTER(regno) 0
- #endif
- 
  void
  store_inferior_registers (int regno)
  {
--- 539,544 ----
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.23
diff -p -r1.23 regcache.c
*** regcache.c	2001/05/04 04:15:26	1.23
--- regcache.c	2001/06/15 23:39:35
*************** read_register_gen (int regnum, char *buf
*** 315,325 ****
  /* Write register REGNUM at MYADDR to the target.  MYADDR points at
     REGISTER_RAW_BYTES(REGNUM), which must be in target byte-order.  */
  
- /* Registers we shouldn't try to store.  */
- #if !defined (CANNOT_STORE_REGISTER)
- #define CANNOT_STORE_REGISTER(regnum) 0
- #endif
- 
  static void
  legacy_write_register_gen (int regnum, char *myaddr)
  {
--- 315,320 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]