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] Add predicate for EXTRACT_STRUCT_VALUE_ADDRESS; Was: New gdb 31 & 64 bit patches for S/390


FYI,

I'm going to check in the attached cleanup.  It converts 
EXTRACT_STRUCT_VALUE_ADDRESS into a function with predicate 
EXTRACT_STRUCT_VALUE_ADDRESS_P.  By doing this, I've eliminated the need 
to add a seprate EXTRACT_STRUCT_VALUE_ADDRESS_P variable to the gdbarch 
vector.

For reference, I've also included the relevant bits of the original patch.

	Andrew

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

	* gdbarch.sh (EXTRACT_STRUCT_VALUE_ADDRESS_P): Delete definition.
	(EXTRACT_STRUCT_VALUE_ADDRESS): Change to a function with
	predicate.
	* gdbarch.h, gdbarch.c: Regenerate.
	* values.c (value_being_returned): Change the reference to
	EXTRACT_STRUCT_VALUE_ADDRESS_P to a function call.

Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.66
diff -p -r1.66 gdbarch.sh
*** gdbarch.sh	2001/06/07 20:52:47	1.66
--- gdbarch.sh	2001/06/15 19:08:28
*************** f:2:D10V_CONVERT_IADDR_TO_RAW:CORE_ADDR:
*** 476,482 ****
  #
  f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
  f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0
! f:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0
  f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::0
  #
  f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0
--- 476,482 ----
  #
  f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
  f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0
! F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0
  f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::0
  #
  f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0
*************** extern disassemble_info tm_print_insn_in
*** 1041,1057 ****
     USE of these macro's is *STRONGLY* discouraged. */
  
  #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v)
- 
- 
- /* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */
- #ifndef EXTRACT_STRUCT_VALUE_ADDRESS
- #define EXTRACT_STRUCT_VALUE_ADDRESS_P (0)
- #define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error (__FILE__, __LINE__, "gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
- #else
- #ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P
- #define EXTRACT_STRUCT_VALUE_ADDRESS_P (1)
- #endif
- #endif
  
  
  /* Set the dynamic target-system-dependent parameters (architecture,
--- 1041,1046 ----
Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.18
diff -p -r1.18 values.c
*** values.c	2001/06/10 16:25:51	1.18
--- values.c	2001/06/15 19:08:34
*************** value_being_returned (struct type *valty
*** 1328,1334 ****
    CORE_ADDR addr;
  
    /* If this is not defined, just use EXTRACT_RETURN_VALUE instead.  */
!   if (EXTRACT_STRUCT_VALUE_ADDRESS_P)
      if (struct_return)
        {
  	addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
--- 1328,1334 ----
    CORE_ADDR addr;
  
    /* If this is not defined, just use EXTRACT_RETURN_VALUE instead.  */
!   if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
      if (struct_return)
        {
  	addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
--- src.orig/gdb/gdbarch.sh	Thu Feb  8 07:03:53 2001
+++ src.new/gdb/gdbarch.sh	Tue Feb 27 20:12:37 2001
@@ -449,7 +456,8 @@
 #
 f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
 f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0
-f:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0
+f:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf::0:0::gdbarch->extract_struct_value_address_p && gdbarch->extract_struct_value_address == 0
+v:2:EXTRACT_STRUCT_VALUE_ADDRESS_P:int:extract_struct_value_address_p::::0:-1
 f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::0
 #
 f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0

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