This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/13539] New: dbxout.c does not recognize protected inheritance
- From: "mec dot gnu at mindspring dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jan 2004 06:06:42 -0000
- Subject: [Bug debug/13539] New: dbxout.c does not recognize protected inheritance
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Here is a small source program:
class B { public: int bb; };
class D : private B { public: int dd; };
D d;
int main () { return 0; }
I compile with: gcc -gstabs+ -S
The stabs for "class D" says:
.stabs
"D:Tt(1,10)=s8!1,000,(1,1);dd:(0,1),32,32;operator=::(1,11)=#(1,10),(1,12)=&(1,10),(1,13)=*(1,10),(1,14)=&(1,15)=k(1,10),(1,7);:_ZN1DaSERKS_;2A.;__base_ctor::(1,16)=#(1,10),(1,7),(1,13),(1,14),(1,7);:_ZN1DC2ERKS_;2A.;__comp_ctor::(1,16):_ZN1DC1ERKS_;2A.;__base_ctor::(1,17)=#(1,10),(1,7),(1,13),(1,7);:_ZN1DC2Ev;2A.;__comp_ctor::(1,17):_ZN1DC1Ev;2A.;;",128,0,8,0
The problem is in the base class fields:
!1, 000
This says: D has one base. The first base in non-virtual, private, at offset 0.
The attributes should be "010" instead of "000".
The problem is in dbxout.c function dbxout_type:
if (use_gnu_debug_info_extensions)
{
have_used_extensions = 1;
putc (TREE_VIA_VIRTUAL (child) ? '1' : '0', asmfile);
putc (access == access_public_node ? '2' : '0', asmfile);
CHARS (2);
...
}
This shows up in the gdb test suite with test file derivation.exp. I reported
it as PR gdb/1498 as a gdb PR, but it's not gdb's fault.
--
Summary: dbxout.c does not recognize protected inheritance
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mec dot gnu at mindspring dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-liinux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13539