From c2e9f2a697ea9fbac24daa6a7fc9c7f50ee94cd3 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 14 Jun 2009 17:16:08 +0000 Subject: [PATCH] * Support for DW_AT_byte_size in DIECompoundType. * Fixed several instances of attributes with dynamic values not being handled correctly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31052 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/DebugInfoEntries.cpp | 39 +++++++++++--------------- src/apps/debugger/DebugInfoEntries.h | 20 +++++++------ 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/apps/debugger/DebugInfoEntries.cpp b/src/apps/debugger/DebugInfoEntries.cpp index fbb23d1f15..2f26590bef 100644 --- a/src/apps/debugger/DebugInfoEntries.cpp +++ b/src/apps/debugger/DebugInfoEntries.cpp @@ -360,6 +360,14 @@ DIECompoundType::DIECompoundType() } +status_t +DIECompoundType::AddAttribute_byte_size(uint16 attributeName, + const AttributeValue& value) +{ + return SetDynamicAttributeValue(fByteSize, value); +} + + // #pragma mark - DIEClassBaseType @@ -373,8 +381,6 @@ DIEClassBaseType::DIEClassBaseType() DIEArrayType::DIEArrayType() : - fBitStride(0), - fByteSize(0), fOrdering(DW_ORD_row_major) { } @@ -422,8 +428,7 @@ status_t DIEArrayType::AddAttribute_bit_stride(uint16 attributeName, const AttributeValue& value) { - fBitStride = value.constant; - return B_OK; + return SetDynamicAttributeValue(fBitStride, value); } @@ -431,8 +436,7 @@ status_t DIEArrayType::AddAttribute_stride_size(uint16 attributeName, const AttributeValue& value) { - fBitStride = value.constant; - return B_OK; + return SetDynamicAttributeValue(fBitStride, value); } @@ -440,8 +444,7 @@ status_t DIEArrayType::AddAttribute_byte_size(uint16 attributeName, const AttributeValue& value) { - fByteSize = value.constant; - return B_OK; + return SetDynamicAttributeValue(fByteSize, value); } @@ -871,10 +874,7 @@ DIEAccessDeclaration::Tag() const DIEBaseType::DIEBaseType() : fEncoding(0), - fEndianity(0), - fByteSize(0), - fBitSize(0), - fBitOffset(0) + fEndianity(0) { } @@ -899,8 +899,7 @@ status_t DIEBaseType::AddAttribute_byte_size(uint16 attributeName, const AttributeValue& value) { - fByteSize = value.constant; - return B_OK; + return SetDynamicAttributeValue(fByteSize, value); } @@ -908,8 +907,7 @@ status_t DIEBaseType::AddAttribute_bit_size(uint16 attributeName, const AttributeValue& value) { - fBitSize = value.constant; - return B_OK; + return SetDynamicAttributeValue(fBitSize, value); } @@ -917,8 +915,7 @@ status_t DIEBaseType::AddAttribute_bit_offset(uint16 attributeName, const AttributeValue& value) { - fBitOffset = value.constant; - return B_OK; + return SetDynamicAttributeValue(fBitOffset, value); } @@ -1379,9 +1376,8 @@ DIECondition::Tag() const DIESharedType::DIESharedType() - : - fBlockSize(DWARF_ADDRESS_MAX) { + fBlockSize.SetTo(DWARF_ADDRESS_MAX); } @@ -1396,8 +1392,7 @@ status_t DIESharedType::AddAttribute_count(uint16 attributeName, const AttributeValue& value) { - fBlockSize = value.constant; - return B_OK; + return SetDynamicAttributeValue(fBlockSize, value); } diff --git a/src/apps/debugger/DebugInfoEntries.h b/src/apps/debugger/DebugInfoEntries.h index 0692467ba4..9a5ad8c211 100644 --- a/src/apps/debugger/DebugInfoEntries.h +++ b/src/apps/debugger/DebugInfoEntries.h @@ -291,11 +291,15 @@ class DIECompoundType : public DIEDeclaredType { public: DIECompoundType(); + virtual status_t AddAttribute_byte_size(uint16 attributeName, + const AttributeValue& value); + // TODO: !interface + // TODO: -// DW_AT_byte_size // !interface // DW_AT_specification // !interface protected: + DynamicAttributeValue fByteSize; }; @@ -335,10 +339,10 @@ public: // DW_AT_specification private: - uint64 fBitStride; - dwarf_addr_t fByteSize; - uint8 fOrdering; + DynamicAttributeValue fBitStride; + DynamicAttributeValue fByteSize; DebugInfoEntryList fDimensions; + uint8 fOrdering; }; @@ -628,11 +632,11 @@ public: // DW_AT_small private: + DynamicAttributeValue fByteSize; + DynamicAttributeValue fBitOffset; + DynamicAttributeValue fBitSize; uint8 fEncoding; uint8 fEndianity; - uint16 fByteSize; - uint16 fBitSize; - uint16 fBitOffset; }; @@ -890,7 +894,7 @@ public: const AttributeValue& value); private: - uint64 fBlockSize; + DynamicAttributeValue fBlockSize; DeclarationLocation fDeclarationLocation; };