Bug 672157 - debug info: Missing DW_AT_accessibility
Summary: debug info: Missing DW_AT_accessibility
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-24 09:08 UTC by Jan Kratochvil
Modified: 2011-01-24 10:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-24 10:16:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jan Kratochvil 2011-01-24 09:08:20 UTC
Description of problem:
By the upgrade some GDB testsuite cases fail.

Version-Release number of selected component (if applicable):
FAIL gcc-c++-4.6.0-0.3.fc15.x86_64
PASS gcc-c++-4.5.1-4.fc14.x86_64
PASS g++ (GCC) 4.6.0 20110124 (experimental)
PASS g++ (GCC) 4.5.3 20110124 (prerelease)
PASS g++ (GCC) 4.4.6 20110124 (prerelease)

How reproducible:
Always.

Steps to Reproduce:
struct Alpha
{
  virtual void x() { }
};
struct Derived : public Alpha
{
} v;

Actual results:
FAIL:
 <2><41>: Abbrev Number: 3 (DW_TAG_inheritance)
    <42>   DW_AT_type        : <0x70>   
    <46>   DW_AT_data_member_location: 0        

Expected results:
PASS:
 <2><41>: Abbrev Number: 3 (DW_TAG_inheritance)
    <42>   DW_AT_type        : <0x70>   
    <46>   DW_AT_data_member_location: 0        
    <47>   DW_AT_accessibility: 1       (public)

Additional info:
DWARF3:
An inheritance entry may have a DW_AT_accessibility attribute. If no accessibility attribute is present, private access is assumed for an entry of a class [...]

Affects at least:
gdb.cp/casts.exp

Comment 1 Jakub Jelinek 2011-01-24 10:16:06 UTC
You've omitted the important following words:
An inheritance entry may have a DW_AT_accessibility attribute. If no accessibility attribute is present, private access is assumed for an entry of a class and public access is assumed for an entry of an interface, struct or union.

The rule used by GCC now for -gdwarf-3 and above is the default is the natural choice for the language in question, i.e. if source doesn't need explicit public: or private:, then no DW_AT_accessibility is used.  For -gdwarf-2 the old behavior has been preserved.
See http://gcc.gnu.org/PR45124

Upstream GCC behaves exactly the same, the only difference is that GCC 4.6-RH defaults to -gdwarf-3, while GCC 4.6 upstream defaults still to -gdwarf-2.


Note You need to log in before you can comment on or make changes to this bug.