aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:24:28 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:24:28 +0000
commitad4820ab42603b59ee496405ce0baa7276a0f537 (patch)
treec1f541d5b64e7c4e33f4ee3f61385f6a1e60e440 /gdb/cp-abi.h
parent * stack.c (return_command): Use frame architecture to determine (diff)
downloadbinutils-gdb-ad4820ab42603b59ee496405ce0baa7276a0f537.tar.gz
binutils-gdb-ad4820ab42603b59ee496405ce0baa7276a0f537.tar.bz2
binutils-gdb-ad4820ab42603b59ee496405ce0baa7276a0f537.zip
* cp-abi.h (cplus_method_ptr_size): Add TO_TYPE parameter.
(cplus_make_method_ptr): Add TYPE parameter. * cp-abi.c (cplus_method_ptr_size): Add TO_TYPE parameter. Pass it on to current_cp_abi.method_ptr_size callback. (cplus_make_method_ptr): Add TYPE parameter. Pass it on to current_cp_abi.make_method_ptr callback. * gdbtypes.c (lookup_methodptr_type): Pass target type argument to cplus_method_ptr_size. * valops.c (value_cast): Pass type argument to cplus_make_method_ptr. (value_struct_elt_for_reference): Likewise. * gnu-v3-abi.c (get_class_arch): New function. (vtable_address_point_offset): Add GDBARCH parameter. Use it instead of current_gdbarch. Update all callers. (gnuv3_get_vtable): Likewise. (gnuv3_get_virtual_fn): Likewise. (gnuv3_decode_method_ptr): Likewise. (gnuv3_rtti_type): Call get_class_arch to determine architecture. Use it instead of current_gdbarch. (gnuv3_virtual_fn_field): Likewise. (gnuv3_baseclass_offset): Likewise. (gnuv3_print_method_ptr): Likewise. (gnuv3_method_ptr_to_value): Likewise. (gnuv3_method_ptr_size): Add TYPE parameter. Use it to determine class architecture. Use architecture types instead of builtin types. (gnuv3_make_method_ptr): Likewise. * cp-valprint.c (cp_print_class_member): Expect pointer type instead of class type. Use its length when extracting value. * c-valprint.c (c_val_print): Update call to cp_print_class_member.
Diffstat (limited to 'gdb/cp-abi.h')
-rw-r--r--gdb/cp-abi.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h
index 18b5201645f..47d6dc841e4 100644
--- a/gdb/cp-abi.h
+++ b/gdb/cp-abi.h
@@ -151,21 +151,20 @@ extern int baseclass_offset (struct type *type, int index,
void cplus_print_method_ptr (const gdb_byte *contents, struct type *type,
struct ui_file *stream);
-/* Return the size of a pointer to member function for the current
- architecture. */
-int cplus_method_ptr_size (void);
+/* Return the size of a pointer to member function of type TO_TYPE. */
+int cplus_method_ptr_size (struct type *to_type);
/* Return the method which should be called by applying METHOD_PTR
to *THIS_P, and adjust *THIS_P if necessary. */
struct value *cplus_method_ptr_to_value (struct value **this_p,
struct value *method_ptr);
-/* Create the byte pattern in CONTENTS representing a pointer to
- member function at ADDRESS (if IS_VIRTUAL is 0) or with virtual
- table offset ADDRESS (if IS_VIRTUAL is 1). This is the opposite
- of cplus_method_ptr_to_value. */
-void cplus_make_method_ptr (gdb_byte *CONTENTS, CORE_ADDR address,
- int is_virtual);
+/* Create the byte pattern in CONTENTS representing a pointer of
+ type TYPE to member function at ADDRESS (if IS_VIRTUAL is 0)
+ or with virtual table offset ADDRESS (if IS_VIRTUAL is 1).
+ This is the opposite of cplus_method_ptr_to_value. */
+void cplus_make_method_ptr (struct type *type, gdb_byte *CONTENTS,
+ CORE_ADDR address, int is_virtual);
/* Determine if we are currently in a C++ thunk. If so, get the address
of the routine we are thunking to and continue to there instead. */
@@ -195,8 +194,8 @@ struct cp_abi_ops
const bfd_byte *valaddr, CORE_ADDR address);
void (*print_method_ptr) (const gdb_byte *contents, struct type *type,
struct ui_file *stream);
- int (*method_ptr_size) (void);
- void (*make_method_ptr) (gdb_byte *, CORE_ADDR, int);
+ int (*method_ptr_size) (struct type *);
+ void (*make_method_ptr) (struct type *, gdb_byte *, CORE_ADDR, int);
struct value * (*method_ptr_to_value) (struct value **, struct value *);
CORE_ADDR (*skip_trampoline) (struct frame_info *, CORE_ADDR);
int (*pass_by_reference) (struct type *type);