This is the mail archive of the gdb-prs@sourceware.org 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]
Other format: [Raw text]

[Bug c++/9065] can't use typeid


http://sourceware.org/bugzilla/show_bug.cgi?id=9065

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|cmoller at redhat dot com   |unassigned at sourceware
                   |                            |dot org
         AssignedTo|unassigned at sourceware    |tromey at redhat dot com
                   |dot org                     |
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |7.7

FrÃdÃric Buclin <LpSolit at netscape dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|"grover, grover at kuchera  |
                   |dot com                     |

--- Comment #3 from Tom Tromey <tromey at redhat dot com> 2013-02-22 19:35:49 UTC ---
(In reply to comment #2)
> I think this can easily be done for classes with vtables.
> For other types it does not appear to be easy; it may not
> even be possible.

We can be optimistic and try to find the symbol.
For a type named T, we can just look up the symbol "typeinfo for T".
E.g., from libstdc++

[...]
0000003be82eec80 V typeinfo for signed char
0000003be82eee60 V typeinfo for bool
0000003be82eece0 V typeinfo for char
0000003be82ee7a0 V typeinfo for double
[...]

--- Comment #4 from Tom Tromey <tromey at redhat dot com> 2013-02-25 16:46:03 UTC ---
I have an initial patch for this.

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-04-15 17:36:15 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    tromey@sourceware.org    2013-04-15 17:36:14

Modified files:
    gdb            : ChangeLog NEWS breakpoint.c c-exp.y cp-abi.c 
                     cp-abi.h eval.c expprint.c gnu-v3-abi.c parse.c 
                     std-operator.def 
    gdb/testsuite  : ChangeLog 
Added files:
    gdb/testsuite/gdb.cp: typeid.cc typeid.exp 

Log message:
    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.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15412&r2=1.15413
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/NEWS.diff?cvsroot=src&r1=1.588&r2=1.589
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/breakpoint.c.diff?cvsroot=src&r1=1.754&r2=1.755
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/c-exp.y.diff?cvsroot=src&r1=1.116&r2=1.117
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cp-abi.c.diff?cvsroot=src&r1=1.40&r2=1.41
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cp-abi.h.diff?cvsroot=src&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/eval.c.diff?cvsroot=src&r1=1.181&r2=1.182
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/expprint.c.diff?cvsroot=src&r1=1.67&r2=1.68
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gnu-v3-abi.c.diff?cvsroot=src&r1=1.82&r2=1.83
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/parse.c.diff?cvsroot=src&r1=1.139&r2=1.140
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/std-operator.def.diff?cvsroot=src&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3624&r2=1.3625
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/typeid.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/typeid.exp.diff?cvsroot=src&r1=NONE&r2=1.1

--- Comment #6 from Tom Tromey <tromey at redhat dot com> 2013-04-15 18:15:53 UTC ---
Fix checked in.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

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