Article View: gnu.gcc.help
Article #53307using gdb with gcc V2.0 for c++ source on a decstation
From: stan
Date: Wed, 26 Feb 1992 06:37
Date: Wed, 26 Feb 1992 06:37
47 lines
1790 bytes
1790 bytes
I am having trouble getting gdb 4.4 to work in conjunction with c++
source compiled with gcc V2.0 on a decstation running ultrix. This is a
sample piece of code as given by nelson@vishnu.reed.edu. Is there a
patch to gdb 4.4 or gcc V2.0 that will fixx this problem ??
------------------------cut here---------------------
#include <stdio.h>
// this trivial program demonstrates a bug with gcc 2.0 as a C++ compiler
// under Ultrix 4.2, in combination with gdb 4.4. The problem is that
// gdb doesn't seem to know the correct type for the class.
// in particular, compiling this with "g++ -g test.C", and loading it
// under gdb 4.4:
//
// (gdb) break Test::itsValue
// The class Test does not have any method named itsValue
// (gdb) ptype Test
// type = struct Test {
// int value;
// }
//
// looks like gdb doesn't know this thing is really a class.
// This works fine under a version of gcc 1.96 with Ultrix 4.2 and gdb 4.4
// nelson@reed.edu
class Test {
public:
Test(int);
int itsValue(void);
private:
int value;
};
Test::Test(int v) {
value = v;
}
int
Test::itsValue(void) {
return value;
}
int main() {
Test a(3);
printf("%d\n", a.itsValue());
}
Technical Details
Message-ID:
<9202261837.AA14587@sabaac.mayo.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sabaac.mayo.edu!stanShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,3d41d9b113fb8379,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-02-26 11:14:42 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sabaac.mayo.edu!stan From: stan@sabaac.mayo.edu Subject: using gdb with gcc V2.0 for c++ source on a decstation Message-ID: <9202261837.AA14587@sabaac.mayo.edu> Sender: daemon@cis.ohio-state.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 26 Feb 1992 06:37:51 GMT Lines: 47