From 6e72ca205c018b9906fa2047ffb1be7f546e0643 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 15 Apr 2013 17:36:14 +0000 Subject: 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) : New fields. * eval.c (evaluate_subexp_standard) : New case. * expprint.c (dump_subexp_body_standard) : 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) : New case. * std-operator.def (OP_TYPEID): New. gdb/testsuite * gdb.cp/typeid.cc: New file. * gdb.cp/typeid.exp: New file. --- gdb/cp-abi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gdb/cp-abi.c') diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index 8e9d545..7ac2a20 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -179,6 +179,26 @@ cplus_print_vtable (struct value *value) (*current_cp_abi.print_vtable) (value); } +/* See cp-abi.h. */ + +struct value * +cplus_typeid (struct value *value) +{ + if (current_cp_abi.get_typeid == NULL) + error (_("GDB cannot find the typeid on this target")); + return (*current_cp_abi.get_typeid) (value); +} + +/* See cp-abi.h. */ + +struct type * +cplus_typeid_type (struct gdbarch *gdbarch) +{ + if (current_cp_abi.get_typeid_type == NULL) + error (_("GDB cannot find the type for 'typeid' on this target")); + return (*current_cp_abi.get_typeid_type) (gdbarch); +} + int cp_pass_by_reference (struct type *type) { -- cgit v1.1