aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-abi.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-04-15 17:36:14 +0000
committerTom Tromey <tromey@redhat.com>2013-04-15 17:36:14 +0000
commit6e72ca205c018b9906fa2047ffb1be7f546e0643 (patch)
treef3a97011f1f148c9d0609bf241e87ef54e32779d /gdb/cp-abi.h
parent715c6909e29a233406d54739976bb8674fa6b836 (diff)
downloadgdb-6e72ca205c018b9906fa2047ffb1be7f546e0643.zip
gdb-6e72ca205c018b9906fa2047ffb1be7f546e0643.tar.gz
gdb-6e72ca205c018b9906fa2047ffb1be7f546e0643.tar.bz2
PR c++/9065:
* NEWS: Update. * breakpoint.c (watchpoint_exp_is_const): Add OP_TYPEID. * c-exp.y (TYPEID): New token. (exp): Add new TYPEID productions. (ident_tokens): Add "typeid". * cp-abi.c (cplus_typeid, cplus_typeid_type): New functions. * cp-abi.h (cplus_typeid, cplus_typeid_type): Declare. (struct cp_abi_ops) <get_typeid, get_typeid_type>: New fields. * eval.c (evaluate_subexp_standard) <OP_TYPEID>: New case. * expprint.c (dump_subexp_body_standard) <OP_TYPEID>: New case. * gnu-v3-abi.c (std_type_info_gdbarch_data): New global. (build_std_type_info_type, gnuv3_get_typeid_type) (gnuv3_get_typeid): New functions. (init_gnuv3_ops): Initialize std_type_info_gdbarch_data. Set new fields on ABI object. * parse.c (operator_length_standard) <OP_TYPEID>: New case. * std-operator.def (OP_TYPEID): New. gdb/testsuite * gdb.cp/typeid.cc: New file. * gdb.cp/typeid.exp: New file.
Diffstat (limited to 'gdb/cp-abi.h')
-rw-r--r--gdb/cp-abi.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h
index 96e9aea..d68e2ec 100644
--- a/gdb/cp-abi.h
+++ b/gdb/cp-abi.h
@@ -178,6 +178,16 @@ void cplus_make_method_ptr (struct type *type, gdb_byte *CONTENTS,
void cplus_print_vtable (struct value *value);
+/* Implement 'typeid': find the type info for VALUE, if possible. If
+ the type info cannot be found, throw an exception. */
+
+extern struct value *cplus_typeid (struct value *value);
+
+/* Return the type of 'typeid' for the current C++ ABI on the given
+ architecture. */
+
+extern struct type *cplus_typeid_type (struct gdbarch *gdbarch);
+
/* 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. */
@@ -219,6 +229,8 @@ struct cp_abi_ops
struct value * (*method_ptr_to_value) (struct value **,
struct value *);
void (*print_vtable) (struct value *);
+ struct value *(*get_typeid) (struct value *value);
+ struct type *(*get_typeid_type) (struct gdbarch *gdbarch);
CORE_ADDR (*skip_trampoline) (struct frame_info *, CORE_ADDR);
int (*pass_by_reference) (struct type *type);
};