http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48049
Summary: 4.6 Regression? DW_AT_accessibility change breaks GDB Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: debug AssignedTo: unassig...@gcc.gnu.org ReportedBy: jan.kratoch...@redhat.com CC: ja...@gcc.gnu.org Target: x86_64-fedora15-linux-gnu Only -gdwarf-3 is affected here: debug/45124 has changed DW_AT_accessibility generation for DWARF-3+. GGC-4.5 was compatible with GDB but both were not compliant with DWARF-3+. GCC-4.6 is now DWARF-3+ compliant but it breaks GDB. By providing DW_AT_accessibility explicitly even for cases when one could assume a default value may be both compatible with existing GDBs and DWARF-3+ compliant. I believe this was the Jakub's intention but it did not get implemented in GCC that way: Bug 45124 Comment 1: > I'm afraid we need to live with some extra DW_AT_accessibility attributes for > > compatibility. class C { private: int private_; } v; gcc -c -Wall -gdwarf-3 GNU gdb (GDB) 7.2.50.20110309-cvs PASS: g++ (GCC) 4.5.3 20110124 (prerelease) (gdb) ptype C type = class C { int private_; } <2><37>: Abbrev Number: 3 (DW_TAG_member) <38> DW_AT_name : (indirect string, offset: 0x2e): private_ <3c> DW_AT_decl_file : 1 <3d> DW_AT_decl_line : 4 <3e> DW_AT_type : <0x45> <42> DW_AT_data_member_location: 0 <43> DW_AT_accessibility: 3 (private) but: FAIL: g++ (GCC) 4.6.0 20110309 (experimental) (gdb) ptype C type = class C { public: ^^^^^^^ int private_; } because: <2><37>: Abbrev Number: 3 (DW_TAG_member) <38> DW_AT_name : (indirect string, offset: 0x54): private_ <3c> DW_AT_decl_file : 1 <3d> DW_AT_decl_line : 4 <3e> DW_AT_type : <0x44> <42> DW_AT_data_member_location: 0 (That GDB should be changed is sure but there may be some DW_AT_producer checks, depending on how it gets resolved for GCC-4.6.0.)