public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13615] New: inherited typedefs not found properly
@ 2012-01-23 18:21 tromey at redhat dot com
2012-01-23 21:20 ` [Bug c++/13615] " jan.kratochvil at redhat dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: tromey at redhat dot com @ 2012-01-23 18:21 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13615
Bug #: 13615
Summary: inherited typedefs not found properly
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned@sourceware.org
ReportedBy: tromey@redhat.com
Classification: Unclassified
Consider this program:
struct Base {
typedef int value_type;
};
struct Derived : public Base {
value_type x;
};
Derived d;
Derived::value_type v;
Compile this with '-g -c' and run gdb on the .o.
Now some type lookups work, but some do not:
(gdb) ptype Derived::value_type
type = int
(gdb) p (Derived::value_type *) 0
A syntax error in expression, near `) 0'.
(gdb) p (Base::value_type *) 0
A syntax error in expression, near `) 0'.
(gdb) python print gdb.lookup_type('Derived::value_type')
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: No type named Derived::value_type.
Error while executing Python code.
(gdb) python print gdb.lookup_type('Base::value_type')
Base::value_type
--
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/13615] inherited typedefs not found properly
2012-01-23 18:21 [Bug c++/13615] New: inherited typedefs not found properly tromey at redhat dot com
@ 2012-01-23 21:20 ` jan.kratochvil at redhat dot com
2012-11-16 20:54 ` cvs-commit at gcc dot gnu.org
2012-11-16 20:56 ` keiths at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-01-23 21:20 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13615
Jan Kratochvil <jan.kratochvil at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jan.kratochvil at redhat
| |dot com
--
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/13615] inherited typedefs not found properly
2012-01-23 18:21 [Bug c++/13615] New: inherited typedefs not found properly tromey at redhat dot com
2012-01-23 21:20 ` [Bug c++/13615] " jan.kratochvil at redhat dot com
@ 2012-11-16 20:54 ` cvs-commit at gcc dot gnu.org
2012-11-16 20:56 ` keiths at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2012-11-16 20:54 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13615
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2012-11-16 20:54:34 UTC ---
CVSROOT: /cvs/src
Module name: src
Changes by: kseitz@sourceware.org 2012-11-16 20:54:30
Modified files:
gdb : ChangeLog cp-namespace.c
gdb/testsuite : ChangeLog
gdb/testsuite/gdb.cp: derivation.exp derivation.cc
Added files:
gdb/testsuite/gdb.cp: baseenum.cc baseenum.exp
Log message:
PR c++/13615
* cp-namespace.c (cp_lookup_symbol_in_namespace): Add SEARCH
parameter and pass it to lookup_symbol_file.
(cp_lookup_symbol_imports): Tell cp_lookup_symbol_in_namespace
to search base classes.
(cp_lookup_symbol_namespace): Likewise.
(lookup_namespace_scope): Likewise.
(lookup_symbol_file): Add SEARCH parameter.
If SEARCH is non-zero and no symbol is found, lookup the class
and call cp_lookup_nested_symbol.
(find_symbol_in_baseclass): New function.
(cp_lookup_nested_symbol): Do not let
cp_lookup_symbol_in_namespace search through base classes.
Do that later when there is no global symbol match.
PR c++/13615
* gdb.cp/baseenum.cc: New file.
* gdb.cp/baseenum.exp: New file.
* gdb.cp/derivation.cc (A): Add copyright.
Add a typedef.
(B): Use A::value_type instead of int. Change all references.
(D): Use value_type instead of int. Change all references.
(E): Likewise.
(F); Likewise.
(Z): New class.
(ZZ): New class.
(N, Base, Derived): New namespace and classes.
(main): Add instances of Z and ZZ.
Make sure all symbols from N are kept.
* gdb.cp/derivation.exp: Update typedef changes in tests.
Add tests for class typedefs both before and after starting
the inferior.
Add tests for searching for a typedef while stopped in a
method.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14837&r2=1.14838
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cp-namespace.c.diff?cvsroot=src&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3459&r2=1.3460
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/baseenum.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/baseenum.exp.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/derivation.exp.diff?cvsroot=src&r1=1.22&r2=1.23
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/derivation.cc.diff?cvsroot=src&r1=1.3&r2=1.4
--
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/13615] inherited typedefs not found properly
2012-01-23 18:21 [Bug c++/13615] New: inherited typedefs not found properly tromey at redhat dot com
2012-01-23 21:20 ` [Bug c++/13615] " jan.kratochvil at redhat dot com
2012-11-16 20:54 ` cvs-commit at gcc dot gnu.org
@ 2012-11-16 20:56 ` keiths at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: keiths at redhat dot com @ 2012-11-16 20:56 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13615
Keith Seitz <keiths at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |keiths at redhat dot com
Version|unknown |archer
Resolution| |FIXED
AssignedTo|unassigned at sourceware |keiths at redhat dot com
|dot org |
--- Comment #2 from Keith Seitz <keiths at redhat dot com> 2012-11-16 20:56:25 UTC ---
Patch committed.
--
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-16 20:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-23 18:21 [Bug c++/13615] New: inherited typedefs not found properly tromey at redhat dot com
2012-01-23 21:20 ` [Bug c++/13615] " jan.kratochvil at redhat dot com
2012-11-16 20:54 ` cvs-commit at gcc dot gnu.org
2012-11-16 20:56 ` keiths at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).