[haiku-commits] haiku: hrev45891 - src/apps/debugger/dwarf

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 22 Jul 2013 03:22:43 +0200 (CEST)

hrev45891 adds 1 changeset to branch 'master'
old head: 6dbd3ed18ca5c5fc49fa897083d156da8131d6bd
new head: 8e80ec6aaaf058e7fe032e1b78201344e9b665d8
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=8e80ec6+%5E6dbd3ed

----------------------------------------------------------------------------

8e80ec6: Debugger: Handle some more v4 attributes.
  
  - DIECompileUnit can also be marked with DW_AT_main_subprogram to
  indicate that the main program resides within that particular unit.
  
  - DIEBaseType and DIEMember now have the additional attribute
  DW_AT_data_bit_offset which defines the offset in a somewhat different
  manner than DWARF2/3's DW_AT_bit_offset, and deprecates the latter.
  
  Unused/untested for the moment, as gcc 4.7.3 doesn't yet appear to be
  generating either of the above attributes.

                                      [ Rene Gollent <anevilyak@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45891
Commit:      8e80ec6aaaf058e7fe032e1b78201344e9b665d8
URL:         http://cgit.haiku-os.org/haiku/commit/?id=8e80ec6
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Mon Jul 22 01:19:26 2013 UTC

----------------------------------------------------------------------------

2 files changed, 46 insertions(+), 1 deletion(-)
src/apps/debugger/dwarf/DebugInfoEntries.cpp | 28 +++++++++++++++++++++++-
src/apps/debugger/dwarf/DebugInfoEntries.h   | 19 ++++++++++++++++

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.cpp 
b/src/apps/debugger/dwarf/DebugInfoEntries.cpp
index 1f8a08b..dd0d1d9 100644
--- a/src/apps/debugger/dwarf/DebugInfoEntries.cpp
+++ b/src/apps/debugger/dwarf/DebugInfoEntries.cpp
@@ -28,7 +28,8 @@ DIECompileUnitBase::DIECompileUnitBase()
        fBaseTypesUnit(NULL),
        fLanguage(0),
        fIdentifierCase(0),
-       fUseUTF8(true)
+       fUseUTF8(true),
+       fContainsMainSubprogram(false)
 {
 }
 
@@ -190,6 +191,15 @@ DIECompileUnitBase::AddAttribute_ranges(uint16 
attributeName,
 }
 
 
+status_t
+DIECompileUnitBase::AddAttribute_main_subprogram(uint16 attributeName,
+       const AttributeValue& value)
+{
+       fContainsMainSubprogram = true;
+       return B_OK;
+}
+
+
 // #pragma mark - DIEType
 
 
@@ -1069,6 +1079,14 @@ DIEMember::AddAttribute_bit_offset(uint16 attributeName,
 }
 
 
+status_t
+DIEMember::AddAttribute_data_bit_offset(uint16 attributeName,
+       const AttributeValue& value)
+{
+       return SetDynamicAttributeValue(fDataBitOffset, value);
+}
+
+
 // #pragma mark - DIEPointerType
 
 
@@ -1646,6 +1664,14 @@ DIEBaseType::AddAttribute_bit_offset(uint16 
attributeName,
 
 
 status_t
+DIEBaseType::AddAttribute_data_bit_offset(uint16 attributeName,
+       const AttributeValue& value)
+{
+       return SetDynamicAttributeValue(fDataBitOffset, value);
+}
+
+
+status_t
 DIEBaseType::AddAttribute_endianity(uint16 attributeName,
        const AttributeValue& value)
 {
diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.h 
b/src/apps/debugger/dwarf/DebugInfoEntries.h
index 0b8b700..8dbd2c4 100644
--- a/src/apps/debugger/dwarf/DebugInfoEntries.h
+++ b/src/apps/debugger/dwarf/DebugInfoEntries.h
@@ -161,6 +161,9 @@ public:
                        off_t                           StatementListOffset() 
const
                                                                        { 
return fStatementListOffset; }
 
+                       bool                            
ContainsMainSubprogram() const
+                                                                       { 
return fContainsMainSubprogram; }
+
        virtual status_t                        AddChild(DebugInfoEntry* child);
 
        virtual status_t                        AddAttribute_name(uint16 
attributeName,
@@ -188,6 +191,9 @@ public:
                                                                        const 
AttributeValue& value);
        virtual status_t                        AddAttribute_ranges(uint16 
attributeName,
                                                                        const 
AttributeValue& value);
+       virtual status_t                        AddAttribute_main_subprogram(
+                                                                       uint16 
attributeName,
+                                                                       const 
AttributeValue& value);
 
 //TODO:
 //     virtual status_t                        AddAttribute_segment(uint16 
attributeName,
@@ -209,6 +215,7 @@ protected:
                        uint16                          fLanguage;
                        uint8                           fIdentifierCase;
                        bool                            fUseUTF8;
+                       bool                            fContainsMainSubprogram;
 };
 
 
@@ -669,6 +676,8 @@ public:
                                                                        { 
return &fByteSize; }
                        const DynamicAttributeValue* BitOffset() const
                                                                        { 
return &fBitOffset; }
+                       const DynamicAttributeValue* DataBitOffset() const
+                                                                       { 
return &fDataBitOffset; }
                        const DynamicAttributeValue* BitSize() const
                                                                        { 
return &fBitSize; }
                        const MemberLocation* Location() const
@@ -682,6 +691,9 @@ public:
                                                                        const 
AttributeValue& value);
        virtual status_t                        AddAttribute_bit_offset(uint16 
attributeName,
                                                                        const 
AttributeValue& value);
+       virtual status_t                        AddAttribute_data_bit_offset(
+                                                                       uint16 
attributeName,
+                                                                       const 
AttributeValue& value);
        virtual status_t                        
AddAttribute_data_member_location(
                                                                        uint16 
attributeName,
                                                                        const 
AttributeValue& value);
@@ -693,6 +705,7 @@ private:
                        DIEType*                        fType;
                        DynamicAttributeValue fByteSize;
                        DynamicAttributeValue fBitOffset;
+                       DynamicAttributeValue fDataBitOffset;
                        DynamicAttributeValue fBitSize;
                        MemberLocation          fLocation;
 };
@@ -1041,6 +1054,8 @@ public:
        virtual const DynamicAttributeValue* ByteSize() const;
                        const DynamicAttributeValue* BitOffset() const
                                                                        { 
return &fBitOffset; }
+                       const DynamicAttributeValue* DataBitOffset() const
+                                                                       { 
return &fDataBitOffset; }
                        const DynamicAttributeValue* BitSize() const
                                                                        { 
return &fBitSize; }
                        uint8                           Encoding() const        
{ return fEncoding; }
@@ -1054,6 +1069,9 @@ public:
                                                                        const 
AttributeValue& value);
        virtual status_t                        AddAttribute_bit_offset(uint16 
attributeName,
                                                                        const 
AttributeValue& value);
+       virtual status_t                        AddAttribute_data_bit_offset(
+                                                                       uint16 
attributeName,
+                                                                       const 
AttributeValue& value);
        virtual status_t                        AddAttribute_endianity(uint16 
attributeName,
                                                                        const 
AttributeValue& value);
 
@@ -1069,6 +1087,7 @@ public:
 private:
                        DynamicAttributeValue fByteSize;
                        DynamicAttributeValue fBitOffset;
+                       DynamicAttributeValue fDataBitOffset;
                        DynamicAttributeValue fBitSize;
                        uint8                           fEncoding;
                        uint8                           fEndianity;


Other related posts:

  • » [haiku-commits] haiku: hrev45891 - src/apps/debugger/dwarf - anevilyak