This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ debug info problem
- To: egcs-bugs at cygnus dot com
- Subject: g++ debug info problem
- From: Michael Coulter <coulter at cup dot hp dot com>
- Date: Thu, 7 Jan 1999 12:55:54 -0800 (PST)
Software versions (-v output);
g++: gcc version 2.9-gnupro-98r1
gdb: GNU gdb 4.17
...
This GDB was configured as "hppa1.1-hp-hpux10.20".
If you compile the attached program with g++ and then run gdb against
the program and execute:
b main
run
ptype it.i
p (MyClass::PrivEnum) 3
The output of 'ptype it.i' should be:
type = enum MyClass::PrivEnum {white, red, gree, yellow}
but is:
type = enum {white, red, gree, yellow}
The output of 'p (MyClass::PrivEnum) 3' should be:
$1 = yellow
but is:
A syntax error in expression, near `'.
I believe that these problems are due to the debug information emitted
by g++. The examples work with HP's aCC compiler.
-- Michael Coulter coulter@cup.hp.com (408) 447-5391
----------------------------------------------------- source
class MyClass {
public:
enum PrivEnum { white, red, gree, yellow };
PrivEnum i;
};
enum MyEnum { red, green, blue };
int main(void)
{
MyClass it;
it.i = MyClass::red;
return red + MyClass::red;
}