2011-01-01 15:34:07 +00:00
|
|
|
/* Copyright 2003, 2004, 2007, 2008, 2009, 2010, 2011
|
|
|
|
Free Software Foundation, Inc.
|
2003-05-20 22:54:53 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-23 18:08:50 +00:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2003-05-20 22:54:53 +00:00
|
|
|
(at your option) any later version.
|
2007-08-23 18:08:50 +00:00
|
|
|
|
2003-05-20 22:54:53 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2007-08-23 18:08:50 +00:00
|
|
|
|
2003-05-20 22:54:53 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 18:08:50 +00:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2004-02-11 Michael Chastain <mec.gnu@mindspring.com>
Partial fix for PR gdb/1543.
* gdb.cp/ambiguous.exp, gdb.cp/annota2.exp, gdb.cp/annota3.exp,
gdb.cp/anon-union.exp, gdb.cp/casts.exp, gdb.cp/classes.exp,
gdb.cp/cplusfuncs.exp, gdb.cp/ctti.exp, gdb.exp/demangle.exp,
gdb.cp/derivation.exp, gdb.cp/exception.exp, gdb.cp/hang.exp,
gdb.cp/inherit.exp, gdb.cp/local.exp, gdb.cp/maint.exp,
gdb.cp/member-ptr.exp, gdb.cp/method.exp, gdb.cp/misc.exp,
gdb.cp/namespace.exp, gdb.cp/overload.exp, gdb.cp/ovldbreak.exp,
gdb.cp/psmang.exp, gdb.cp/ref-types.exp, gdb.cp/templates.exp,
gdb.cp/userdef.exp, gdb.cp/virtfunc.exp: Remove reference
to bug-gdb@prep.ai.mit.edu .
* gdb.cp/bs15503.cc, gdb.cp/class2.cc, gdb.cp/cttiadd.cc,
gdb.cp/cttiadd1.cc, gdb.cp/cttiadd2.cc, gdb.cp/cttiadd3.cc,
gdb.cp/exception.cc, gdb.cp/member-ptr.cc, gdb.cp/namespace1.cc:
Likewise.
2004-02-11 14:01:25 +00:00
|
|
|
*/
|
|
|
|
|
2003-05-20 22:54:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace C
|
|
|
|
{
|
2004-01-14 David Carlton <carlton@kealia.com>
Change symbols for C++ nested types to contain the fully qualified
name, if possible. (At least in the DWARF-2 case.) Partial fix
for PR's c++/57, c++/488, c++/539, c++/573, c++/609, c++/832,
c++/895.
* c-exp.y: Update copyright:
(qualified_type): Handle types nested within classes.
* cp-namespace.c: Update comments.
(cp_set_block_scope): Delete #if 0.
(cp_lookup_nested_type): Handle types nested within classes.
* dwarf2read.c: (scan_partial_symbols): Call add_partial_structure
when appropriate.
(add_partial_symbol): Add the name of the enclosing namespace to
types.
(pdi_needs_namespace): New.
(add_partial_namespace): Tweak comment.
(add_partial_structure): New.
(psymtab_to_symtab_1): Initialize processing_current_prefix
here...
(process_die): instead of here.
(read_structure_scope): Try to figure out the name of the class or
namespace that the structure might be defined within.
(read_enumeration): Generate fully-qualified names, if possible.
(read_namespace): Don't set name to NULL.
(die_specification): New.
(new_symbol): Generate fully-qualified names for types.
(read_type_die): Determine appropriate prefix.
(determine_prefix): New.
(typename_concat): New.
(class_name): New.
* valops.c: Update copyright.
(value_aggregate_elt): Pass NOSIDE to
value_struct_elt_for_reference.
(value_struct_elt_for_reference): Make static, add NOSIDE
parameter, call value_maybe_namespace_elt as a last resort.
(value_namespace_elt): Break out code into
value_maybe_namespace_elt.
(value_maybe_namespace_elt): New.
2004-01-14 David Carlton <carlton@kealia.com>
* gdb.cp/namespace.exp: Add tests involving classes defined within
namespaces.
* gdb.cp/namespace.cc (C::CClass): New.
* gdb.cp/namespace1.cc: Update copyright.
(C::OtherFileClass): New.
2004-01-14 16:54:43 +00:00
|
|
|
class OtherFileClass {
|
|
|
|
public:
|
|
|
|
int z;
|
2010-06-28 20:35:52 +00:00
|
|
|
|
|
|
|
typedef short cOtherFileClassType;
|
2010-06-28 20:39:30 +00:00
|
|
|
typedef long cOtherFileClassType2;
|
2010-06-28 20:35:52 +00:00
|
|
|
static const cOtherFileClassType cOtherFileClassVar = 318;
|
2010-06-28 20:39:30 +00:00
|
|
|
static const cOtherFileClassType2 cOtherFileClassVar2 = 320;
|
2010-06-28 20:35:52 +00:00
|
|
|
cOtherFileClassType cOtherFileClassVar_use ();
|
2004-01-14 David Carlton <carlton@kealia.com>
Change symbols for C++ nested types to contain the fully qualified
name, if possible. (At least in the DWARF-2 case.) Partial fix
for PR's c++/57, c++/488, c++/539, c++/573, c++/609, c++/832,
c++/895.
* c-exp.y: Update copyright:
(qualified_type): Handle types nested within classes.
* cp-namespace.c: Update comments.
(cp_set_block_scope): Delete #if 0.
(cp_lookup_nested_type): Handle types nested within classes.
* dwarf2read.c: (scan_partial_symbols): Call add_partial_structure
when appropriate.
(add_partial_symbol): Add the name of the enclosing namespace to
types.
(pdi_needs_namespace): New.
(add_partial_namespace): Tweak comment.
(add_partial_structure): New.
(psymtab_to_symtab_1): Initialize processing_current_prefix
here...
(process_die): instead of here.
(read_structure_scope): Try to figure out the name of the class or
namespace that the structure might be defined within.
(read_enumeration): Generate fully-qualified names, if possible.
(read_namespace): Don't set name to NULL.
(die_specification): New.
(new_symbol): Generate fully-qualified names for types.
(read_type_die): Determine appropriate prefix.
(determine_prefix): New.
(typename_concat): New.
(class_name): New.
* valops.c: Update copyright.
(value_aggregate_elt): Pass NOSIDE to
value_struct_elt_for_reference.
(value_struct_elt_for_reference): Make static, add NOSIDE
parameter, call value_maybe_namespace_elt as a last resort.
(value_namespace_elt): Break out code into
value_maybe_namespace_elt.
(value_maybe_namespace_elt): New.
2004-01-14 David Carlton <carlton@kealia.com>
* gdb.cp/namespace.exp: Add tests involving classes defined within
namespaces.
* gdb.cp/namespace.cc (C::CClass): New.
* gdb.cp/namespace1.cc: Update copyright.
(C::OtherFileClass): New.
2004-01-14 16:54:43 +00:00
|
|
|
};
|
2010-06-28 20:35:52 +00:00
|
|
|
OtherFileClass::cOtherFileClassType OtherFileClass::cOtherFileClassVar_use ()
|
|
|
|
{
|
2010-06-28 20:39:30 +00:00
|
|
|
return cOtherFileClassVar + cOtherFileClassVar2;
|
2010-06-28 20:35:52 +00:00
|
|
|
}
|
2004-01-14 David Carlton <carlton@kealia.com>
Change symbols for C++ nested types to contain the fully qualified
name, if possible. (At least in the DWARF-2 case.) Partial fix
for PR's c++/57, c++/488, c++/539, c++/573, c++/609, c++/832,
c++/895.
* c-exp.y: Update copyright:
(qualified_type): Handle types nested within classes.
* cp-namespace.c: Update comments.
(cp_set_block_scope): Delete #if 0.
(cp_lookup_nested_type): Handle types nested within classes.
* dwarf2read.c: (scan_partial_symbols): Call add_partial_structure
when appropriate.
(add_partial_symbol): Add the name of the enclosing namespace to
types.
(pdi_needs_namespace): New.
(add_partial_namespace): Tweak comment.
(add_partial_structure): New.
(psymtab_to_symtab_1): Initialize processing_current_prefix
here...
(process_die): instead of here.
(read_structure_scope): Try to figure out the name of the class or
namespace that the structure might be defined within.
(read_enumeration): Generate fully-qualified names, if possible.
(read_namespace): Don't set name to NULL.
(die_specification): New.
(new_symbol): Generate fully-qualified names for types.
(read_type_die): Determine appropriate prefix.
(determine_prefix): New.
(typename_concat): New.
(class_name): New.
* valops.c: Update copyright.
(value_aggregate_elt): Pass NOSIDE to
value_struct_elt_for_reference.
(value_struct_elt_for_reference): Make static, add NOSIDE
parameter, call value_maybe_namespace_elt as a last resort.
(value_namespace_elt): Break out code into
value_maybe_namespace_elt.
(value_maybe_namespace_elt): New.
2004-01-14 David Carlton <carlton@kealia.com>
* gdb.cp/namespace.exp: Add tests involving classes defined within
namespaces.
* gdb.cp/namespace.cc (C::CClass): New.
* gdb.cp/namespace1.cc: Update copyright.
(C::OtherFileClass): New.
2004-01-14 16:54:43 +00:00
|
|
|
|
2003-05-20 22:54:53 +00:00
|
|
|
namespace {
|
|
|
|
int cXOtherFile = 29;
|
|
|
|
};
|
|
|
|
|
|
|
|
int cOtherFile = 316;
|
2009-12-28 21:45:24 +00:00
|
|
|
|
|
|
|
void ensureOtherRefs () {
|
|
|
|
// NOTE (2004-04-23, carlton): This function is here only to make
|
|
|
|
// sure that GCC 3.4 outputs debug info for this class.
|
|
|
|
static OtherFileClass *c = new OtherFileClass();
|
|
|
|
c->z = cOtherFile + cXOtherFile;
|
|
|
|
}
|
2010-06-28 20:35:52 +00:00
|
|
|
|
|
|
|
typedef short cOtherFileType;
|
2010-06-28 20:39:30 +00:00
|
|
|
typedef long cOtherFileType2;
|
2010-06-28 20:35:52 +00:00
|
|
|
static const cOtherFileType cOtherFileVar = 319;
|
2010-06-28 20:39:30 +00:00
|
|
|
static const cOtherFileType2 cOtherFileVar2 = 321;
|
2010-06-28 20:35:52 +00:00
|
|
|
cOtherFileType cOtherFileVar_use ()
|
|
|
|
{
|
2010-06-28 20:39:30 +00:00
|
|
|
return cOtherFileVar + cOtherFileVar2;
|
2010-06-28 20:35:52 +00:00
|
|
|
}
|
2003-05-20 22:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
int XOtherFile = 317;
|
|
|
|
}
|
2009-12-28 21:45:24 +00:00
|
|
|
|
|
|
|
int ensureOtherRefs ()
|
|
|
|
{
|
|
|
|
C::ensureOtherRefs ();
|
|
|
|
return XOtherFile;
|
|
|
|
}
|