* cp-abi.h, hpacc-abi.c, gnu-v2-abi.c, cp-abi.c: Ditto.

This commit is contained in:
Andrew Cagney
2001-10-21 01:06:25 +00:00
parent 3bc62f91f4
commit e933e53888
5 changed files with 30 additions and 25 deletions

View File

@ -4,6 +4,7 @@
value_ptr with ``struct value *''. value_ptr with ``struct value *''.
* wrapper.c: Replace value_ptr with ``struct value *''. * wrapper.c: Replace value_ptr with ``struct value *''.
* breakpoint.h, breakpoint.c: Ditto. * breakpoint.h, breakpoint.c: Ditto.
* cp-abi.h, hpacc-abi.c, gnu-v2-abi.c, cp-abi.c: Ditto.
2001-10-20 Andrew Cagney <ac131313@redhat.com> 2001-10-20 Andrew Cagney <ac131313@redhat.com>

View File

@ -60,8 +60,8 @@ is_operator_name (const char *name)
return (*current_cp_abi.is_operator_name) (name); return (*current_cp_abi.is_operator_name) (name);
} }
value_ptr struct value *
value_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j, value_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
struct type * type, int offset) struct type * type, int offset)
{ {
if ((current_cp_abi.virtual_fn_field) == NULL) if ((current_cp_abi.virtual_fn_field) == NULL)
@ -69,7 +69,7 @@ value_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j,
return (*current_cp_abi.virtual_fn_field) (arg1p, f, j, type, offset); return (*current_cp_abi.virtual_fn_field) (arg1p, f, j, type, offset);
} }
struct type * struct type *
value_rtti_type (value_ptr v, int *full, int *top, int *using_enc) value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
{ {
if ((current_cp_abi.rtti_type) == NULL) if ((current_cp_abi.rtti_type) == NULL)
return NULL; return NULL;

View File

@ -25,6 +25,8 @@
#ifndef CP_ABI_H_ #ifndef CP_ABI_H_
#define CP_ABI_H_ 1 #define CP_ABI_H_ 1
struct value;
/* The functions here that attempt to determine what sort of thing a /* 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 mangled name refers to may well be revised in the future. It would
certainly be cleaner to carry this information explicitly in GDB's certainly be cleaner to carry this information explicitly in GDB's
@ -99,9 +101,9 @@ extern int is_operator_name (const char *name);
TYPE is the base type of *VALUEP whose method we're invoking --- 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 this is the type containing F. OFFSET is the offset of that base
type within *VALUEP. */ type within *VALUEP. */
extern value_ptr value_virtual_fn_field (value_ptr *valuep, extern struct value *value_virtual_fn_field (struct value **valuep,
struct fn_field *f, int j, struct fn_field *f, int j,
struct type *type, int offset); struct type *type, int offset);
/* Try to find the run-time type of VALUE, using C++ run-time type /* Try to find the run-time type of VALUE, using C++ run-time type
@ -142,9 +144,9 @@ struct cp_abi_ops
enum dtor_kinds (*is_destructor_name) (const char *name); enum dtor_kinds (*is_destructor_name) (const char *name);
int (*is_vtable_name) (const char *name); int (*is_vtable_name) (const char *name);
int (*is_operator_name) (const char *name); int (*is_operator_name) (const char *name);
value_ptr (*virtual_fn_field) (value_ptr * arg1p, struct fn_field * f, struct value *(*virtual_fn_field) (struct value **arg1p, struct fn_field * f,
int j, struct type * type, int offset); int j, struct type * type, int offset);
struct type *(*rtti_type) (value_ptr v, int *full, int *top, struct type *(*rtti_type) (struct value *v, int *full, int *top,
int *using_enc); int *using_enc);
}; };

View File

@ -82,11 +82,11 @@ gnuv2_is_operator_name (const char *name)
J is an index into F which provides the desired virtual function. J is an index into F which provides the desired virtual function.
TYPE is the type in which F is located. */ TYPE is the type in which F is located. */
static value_ptr static struct value *
gnuv2_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j, gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
struct type * type, int offset) struct type * type, int offset)
{ {
value_ptr arg1 = *arg1p; struct value *arg1 = *arg1p;
struct type *type1 = check_typedef (VALUE_TYPE (arg1)); struct type *type1 = check_typedef (VALUE_TYPE (arg1));
@ -95,8 +95,10 @@ gnuv2_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j,
with a strange type, so cast it to type `pointer to long' (which with a strange type, so cast it to type `pointer to long' (which
should serve just fine as a function type). Then, index into should serve just fine as a function type). Then, index into
the table, and convert final value to appropriate function type. */ the table, and convert final value to appropriate function type. */
value_ptr entry, vfn, vtbl; struct value *entry;
value_ptr vi = value_from_longest (builtin_type_int, struct value *vfn;
struct value *vtbl;
struct value *vi = value_from_longest (builtin_type_int,
(LONGEST) TYPE_FN_FIELD_VOFFSET (f, j)); (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j); struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
struct type *context; struct type *context;
@ -110,7 +112,7 @@ gnuv2_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j,
/* Now context is a pointer to the basetype containing the vtbl. */ /* Now context is a pointer to the basetype containing the vtbl. */
if (TYPE_TARGET_TYPE (context) != type1) if (TYPE_TARGET_TYPE (context) != type1)
{ {
value_ptr tmp = value_cast (context, value_addr (arg1)); struct value *tmp = value_cast (context, value_addr (arg1));
arg1 = value_ind (tmp); arg1 = value_ind (tmp);
type1 = check_typedef (VALUE_TYPE (arg1)); type1 = check_typedef (VALUE_TYPE (arg1));
} }
@ -179,12 +181,12 @@ gnuv2_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j,
struct type * struct type *
gnuv2_value_rtti_type (value_ptr v, int *full, int *top, int *using_enc) gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
{ {
struct type *known_type; struct type *known_type;
struct type *rtti_type; struct type *rtti_type;
CORE_ADDR coreptr; CORE_ADDR coreptr;
value_ptr vp; struct value *vp;
int using_enclosing = 0; int using_enclosing = 0;
long top_offset = 0; long top_offset = 0;
char rtti_type_name[256]; char rtti_type_name[256];
@ -246,7 +248,7 @@ gnuv2_value_rtti_type (value_ptr v, int *full, int *top, int *using_enc)
*/ */
if (VALUE_ENCLOSING_TYPE(v) != VALUE_TYPE(v)) if (VALUE_ENCLOSING_TYPE(v) != VALUE_TYPE(v))
{ {
value_ptr tempval; struct value *tempval;
int bitpos = TYPE_BASECLASS_BITPOS (known_type, int bitpos = TYPE_BASECLASS_BITPOS (known_type,
TYPE_VPTR_FIELDNO (known_type)); TYPE_VPTR_FIELDNO (known_type));
tempval=value_field (v, TYPE_VPTR_FIELDNO(known_type)); tempval=value_field (v, TYPE_VPTR_FIELDNO(known_type));

View File

@ -80,16 +80,16 @@ hpacc_is_vtable_name (const char *name)
J is an index into F which provides the desired virtual function. J is an index into F which provides the desired virtual function.
TYPE is the type in which F is located. */ TYPE is the type in which F is located. */
static value_ptr static struct value *
hpacc_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j, hpacc_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
struct type * type, int offset) struct type * type, int offset)
{ {
value_ptr arg1 = *arg1p; struct value *arg1 = *arg1p;
struct type *type1 = check_typedef (VALUE_TYPE (arg1)); struct type *type1 = check_typedef (VALUE_TYPE (arg1));
/* Deal with HP/Taligent runtime model for virtual functions */ /* Deal with HP/Taligent runtime model for virtual functions */
value_ptr vp; struct value *vp;
value_ptr argp; /* arg1 cast to base */ struct value *argp; /* arg1 cast to base */
CORE_ADDR coreptr; /* pointer to target address */ CORE_ADDR coreptr; /* pointer to target address */
int class_index; /* which class segment pointer to use */ int class_index; /* which class segment pointer to use */
struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); /* method type */ struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); /* method type */
@ -175,12 +175,12 @@ hpacc_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j,
static struct type * static struct type *
hpacc_value_rtti_type (value_ptr v, int *full, int *top, int *using_enc) hpacc_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
{ {
struct type *known_type; struct type *known_type;
struct type *rtti_type; struct type *rtti_type;
CORE_ADDR coreptr; CORE_ADDR coreptr;
value_ptr vp; struct value *vp;
int using_enclosing = 0; int using_enclosing = 0;
long top_offset = 0; long top_offset = 0;
char rtti_type_name[256]; char rtti_type_name[256];