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] s/value_ptr/struct value */ for cp-abi.h and *abi*.c


Here comes another one.

enjoy,
Andrew

2001-10-20  Andrew Cagney  <ac131313@redhat.com>

  	* wrapper.c: Replace value_ptr with ``struct value *''.
  	* breakpoint.h, breakpoint.c: Ditto.
+ 	* cp-abi.h, hpacc-abi.c, gnu-v2-abi.c, cp-abi.c: Ditto.
  
Index: cp-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/cp-abi.c,v
retrieving revision 1.1
diff -p -r1.1 cp-abi.c
*** cp-abi.c	2001/04/27 00:19:09	1.1
--- cp-abi.c	2001/10/21 00:17:04
*************** is_operator_name (const char *name)
*** 60,67 ****
    return (*current_cp_abi.is_operator_name) (name);
  }
  
! value_ptr
! value_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j,
  			struct type * type, int offset)
  {
    if ((current_cp_abi.virtual_fn_field) == NULL)
--- 60,67 ----
    return (*current_cp_abi.is_operator_name) (name);
  }
  
! struct value *
! value_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
  			struct type * type, int offset)
  {
    if ((current_cp_abi.virtual_fn_field) == NULL)
*************** value_virtual_fn_field (value_ptr * arg1
*** 69,75 ****
    return (*current_cp_abi.virtual_fn_field) (arg1p, f, j, type, offset);
  }
  struct type *
! value_rtti_type (value_ptr v, int *full, int *top, int *using_enc)
  {
    if ((current_cp_abi.rtti_type) == NULL)
      return NULL;
--- 69,75 ----
    return (*current_cp_abi.virtual_fn_field) (arg1p, f, j, type, offset);
  }
  struct type *
! value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
  {
    if ((current_cp_abi.rtti_type) == NULL)
      return NULL;
Index: cp-abi.h
===================================================================
RCS file: /cvs/src/src/gdb/cp-abi.h,v
retrieving revision 1.2
diff -p -r1.2 cp-abi.h
*** cp-abi.h	2001/06/06 22:21:15	1.2
--- cp-abi.h	2001/10/21 00:17:04
***************
*** 25,30 ****
--- 25,32 ----
  #ifndef CP_ABI_H_
  #define CP_ABI_H_ 1
  
+ struct value;
+ 
  /* The functions here that attempt to determine what sort of thing a
     mangled name refers to may well be revised in the future.  It would
     certainly be cleaner to carry this information explicitly in GDB's
*************** extern int is_operator_name (const char 
*** 99,107 ****
     TYPE is the base type of *VALUEP whose method we're invoking ---
     this is the type containing F.  OFFSET is the offset of that base
     type within *VALUEP.  */
! extern value_ptr value_virtual_fn_field (value_ptr *valuep,
! 					 struct fn_field *f, int j,
! 					 struct type *type, int offset);
  
  
  /* Try to find the run-time type of VALUE, using C++ run-time type
--- 101,109 ----
     TYPE is the base type of *VALUEP whose method we're invoking ---
     this is the type containing F.  OFFSET is the offset of that base
     type within *VALUEP.  */
! extern struct value *value_virtual_fn_field (struct value **valuep,
! 					     struct fn_field *f, int j,
! 					     struct type *type, int offset);
  
  
  /* Try to find the run-time type of VALUE, using C++ run-time type
*************** struct cp_abi_ops
*** 142,150 ****
    enum dtor_kinds (*is_destructor_name) (const char *name);
    int (*is_vtable_name) (const char *name);
    int (*is_operator_name) (const char *name);
!   value_ptr (*virtual_fn_field) (value_ptr * arg1p, struct fn_field * f,
! 				 int j, struct type * type, int offset);
!   struct type *(*rtti_type) (value_ptr v, int *full, int *top,
  			     int *using_enc);
  };
  
--- 144,152 ----
    enum dtor_kinds (*is_destructor_name) (const char *name);
    int (*is_vtable_name) (const char *name);
    int (*is_operator_name) (const char *name);
!   struct value *(*virtual_fn_field) (struct value **arg1p, struct fn_field * f,
! 				     int j, struct type * type, int offset);
!   struct type *(*rtti_type) (struct value *v, int *full, int *top,
  			     int *using_enc);
  };
  
Index: gnu-v2-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-v2-abi.c,v
retrieving revision 1.4
diff -p -r1.4 gnu-v2-abi.c
*** gnu-v2-abi.c	2001/10/16 01:58:07	1.4
--- gnu-v2-abi.c	2001/10/21 00:17:05
*************** gnuv2_is_operator_name (const char *name
*** 82,92 ****
     J is an index into F which provides the desired virtual function.
  
     TYPE is the type in which F is located.  */
! static value_ptr
! gnuv2_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j,
  			struct type * type, int offset)
  {
!   value_ptr arg1 = *arg1p;
    struct type *type1 = check_typedef (VALUE_TYPE (arg1));
  
  
--- 82,92 ----
     J is an index into F which provides the desired virtual function.
  
     TYPE is the type in which F is located.  */
! static struct value *
! gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
  			struct type * type, int offset)
  {
!   struct value *arg1 = *arg1p;
    struct type *type1 = check_typedef (VALUE_TYPE (arg1));
  
  
*************** gnuv2_virtual_fn_field (value_ptr * arg1
*** 95,102 ****
       with a strange type, so cast it to type `pointer to long' (which
       should serve just fine as a function type).  Then, index into
       the table, and convert final value to appropriate function type.  */
!   value_ptr entry, vfn, vtbl;
!   value_ptr vi = value_from_longest (builtin_type_int,
  				     (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
    struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
    struct type *context;
--- 95,104 ----
       with a strange type, so cast it to type `pointer to long' (which
       should serve just fine as a function type).  Then, index into
       the table, and convert final value to appropriate function type.  */
!   struct value *entry;
!   struct value *vfn;
!   struct value *vtbl;
!   struct value *vi = value_from_longest (builtin_type_int,
  				     (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
    struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
    struct type *context;
*************** gnuv2_virtual_fn_field (value_ptr * arg1
*** 110,116 ****
    /* Now context is a pointer to the basetype containing the vtbl.  */
    if (TYPE_TARGET_TYPE (context) != type1)
      {
!       value_ptr tmp = value_cast (context, value_addr (arg1));
        arg1 = value_ind (tmp);
        type1 = check_typedef (VALUE_TYPE (arg1));
      }
--- 112,118 ----
    /* Now context is a pointer to the basetype containing the vtbl.  */
    if (TYPE_TARGET_TYPE (context) != type1)
      {
!       struct value *tmp = value_cast (context, value_addr (arg1));
        arg1 = value_ind (tmp);
        type1 = check_typedef (VALUE_TYPE (arg1));
      }
*************** gnuv2_virtual_fn_field (value_ptr * arg1
*** 179,190 ****
  
  
  struct type *
! gnuv2_value_rtti_type (value_ptr v, int *full, int *top, int *using_enc)
  {
    struct type *known_type;
    struct type *rtti_type;
    CORE_ADDR coreptr;
!   value_ptr vp;
    int using_enclosing = 0;
    long top_offset = 0;
    char rtti_type_name[256];
--- 181,192 ----
  
  
  struct type *
! gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
  {
    struct type *known_type;
    struct type *rtti_type;
    CORE_ADDR coreptr;
!   struct value *vp;
    int using_enclosing = 0;
    long top_offset = 0;
    char rtti_type_name[256];
*************** gnuv2_value_rtti_type (value_ptr v, int 
*** 246,252 ****
    */
    if (VALUE_ENCLOSING_TYPE(v) != VALUE_TYPE(v))
      {
!       value_ptr tempval;
        int bitpos = TYPE_BASECLASS_BITPOS (known_type,
                                            TYPE_VPTR_FIELDNO (known_type));
        tempval=value_field (v, TYPE_VPTR_FIELDNO(known_type));
--- 248,254 ----
    */
    if (VALUE_ENCLOSING_TYPE(v) != VALUE_TYPE(v))
      {
!       struct value *tempval;
        int bitpos = TYPE_BASECLASS_BITPOS (known_type,
                                            TYPE_VPTR_FIELDNO (known_type));
        tempval=value_field (v, TYPE_VPTR_FIELDNO(known_type));
Index: hpacc-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/hpacc-abi.c,v
retrieving revision 1.1
diff -p -r1.1 hpacc-abi.c
*** hpacc-abi.c	2001/04/27 00:19:09	1.1
--- hpacc-abi.c	2001/10/21 00:17:05
*************** hpacc_is_vtable_name (const char *name)
*** 80,95 ****
     J is an index into F which provides the desired virtual function.
  
     TYPE is the type in which F is located.  */
! static value_ptr
! hpacc_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j,
  			struct type * type, int offset)
  {
!   value_ptr arg1 = *arg1p;
    struct type *type1 = check_typedef (VALUE_TYPE (arg1));
  
    /* Deal with HP/Taligent runtime model for virtual functions */
!   value_ptr vp;
!   value_ptr argp;		/* arg1 cast to base */
    CORE_ADDR coreptr;		/* pointer to target address */
    int class_index;		/* which class segment pointer to use */
    struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);	/* method type */
--- 80,95 ----
     J is an index into F which provides the desired virtual function.
  
     TYPE is the type in which F is located.  */
! static struct value *
! hpacc_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
  			struct type * type, int offset)
  {
!   struct value *arg1 = *arg1p;
    struct type *type1 = check_typedef (VALUE_TYPE (arg1));
  
    /* Deal with HP/Taligent runtime model for virtual functions */
!   struct value *vp;
!   struct value *argp;		/* arg1 cast to base */
    CORE_ADDR coreptr;		/* pointer to target address */
    int class_index;		/* which class segment pointer to use */
    struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);	/* method type */
*************** hpacc_virtual_fn_field (value_ptr * arg1
*** 175,186 ****
  
  
  static struct type *
! hpacc_value_rtti_type (value_ptr v, int *full, int *top, int *using_enc)
  {
    struct type *known_type;
    struct type *rtti_type;
    CORE_ADDR coreptr;
!   value_ptr vp;
    int using_enclosing = 0;
    long top_offset = 0;
    char rtti_type_name[256];
--- 175,186 ----
  
  
  static struct type *
! hpacc_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
  {
    struct type *known_type;
    struct type *rtti_type;
    CORE_ADDR coreptr;
!   struct value *vp;
    int using_enclosing = 0;
    long top_offset = 0;
    char rtti_type_name[256];


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