* 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
This commit is contained in:
Ingo Weinhold 2009-06-14 17:16:08 +00:00
parent f5334fd1a3
commit c2e9f2a697
2 changed files with 29 additions and 30 deletions

View File

@ -360,6 +360,14 @@ DIECompoundType::DIECompoundType()
} }
status_t
DIECompoundType::AddAttribute_byte_size(uint16 attributeName,
const AttributeValue& value)
{
return SetDynamicAttributeValue(fByteSize, value);
}
// #pragma mark - DIEClassBaseType // #pragma mark - DIEClassBaseType
@ -373,8 +381,6 @@ DIEClassBaseType::DIEClassBaseType()
DIEArrayType::DIEArrayType() DIEArrayType::DIEArrayType()
: :
fBitStride(0),
fByteSize(0),
fOrdering(DW_ORD_row_major) fOrdering(DW_ORD_row_major)
{ {
} }
@ -422,8 +428,7 @@ status_t
DIEArrayType::AddAttribute_bit_stride(uint16 attributeName, DIEArrayType::AddAttribute_bit_stride(uint16 attributeName,
const AttributeValue& value) const AttributeValue& value)
{ {
fBitStride = value.constant; return SetDynamicAttributeValue(fBitStride, value);
return B_OK;
} }
@ -431,8 +436,7 @@ status_t
DIEArrayType::AddAttribute_stride_size(uint16 attributeName, DIEArrayType::AddAttribute_stride_size(uint16 attributeName,
const AttributeValue& value) const AttributeValue& value)
{ {
fBitStride = value.constant; return SetDynamicAttributeValue(fBitStride, value);
return B_OK;
} }
@ -440,8 +444,7 @@ status_t
DIEArrayType::AddAttribute_byte_size(uint16 attributeName, DIEArrayType::AddAttribute_byte_size(uint16 attributeName,
const AttributeValue& value) const AttributeValue& value)
{ {
fByteSize = value.constant; return SetDynamicAttributeValue(fByteSize, value);
return B_OK;
} }
@ -871,10 +874,7 @@ DIEAccessDeclaration::Tag() const
DIEBaseType::DIEBaseType() DIEBaseType::DIEBaseType()
: :
fEncoding(0), fEncoding(0),
fEndianity(0), fEndianity(0)
fByteSize(0),
fBitSize(0),
fBitOffset(0)
{ {
} }
@ -899,8 +899,7 @@ status_t
DIEBaseType::AddAttribute_byte_size(uint16 attributeName, DIEBaseType::AddAttribute_byte_size(uint16 attributeName,
const AttributeValue& value) const AttributeValue& value)
{ {
fByteSize = value.constant; return SetDynamicAttributeValue(fByteSize, value);
return B_OK;
} }
@ -908,8 +907,7 @@ status_t
DIEBaseType::AddAttribute_bit_size(uint16 attributeName, DIEBaseType::AddAttribute_bit_size(uint16 attributeName,
const AttributeValue& value) const AttributeValue& value)
{ {
fBitSize = value.constant; return SetDynamicAttributeValue(fBitSize, value);
return B_OK;
} }
@ -917,8 +915,7 @@ status_t
DIEBaseType::AddAttribute_bit_offset(uint16 attributeName, DIEBaseType::AddAttribute_bit_offset(uint16 attributeName,
const AttributeValue& value) const AttributeValue& value)
{ {
fBitOffset = value.constant; return SetDynamicAttributeValue(fBitOffset, value);
return B_OK;
} }
@ -1379,9 +1376,8 @@ DIECondition::Tag() const
DIESharedType::DIESharedType() DIESharedType::DIESharedType()
:
fBlockSize(DWARF_ADDRESS_MAX)
{ {
fBlockSize.SetTo(DWARF_ADDRESS_MAX);
} }
@ -1396,8 +1392,7 @@ status_t
DIESharedType::AddAttribute_count(uint16 attributeName, DIESharedType::AddAttribute_count(uint16 attributeName,
const AttributeValue& value) const AttributeValue& value)
{ {
fBlockSize = value.constant; return SetDynamicAttributeValue(fBlockSize, value);
return B_OK;
} }

View File

@ -291,11 +291,15 @@ class DIECompoundType : public DIEDeclaredType {
public: public:
DIECompoundType(); DIECompoundType();
virtual status_t AddAttribute_byte_size(uint16 attributeName,
const AttributeValue& value);
// TODO: !interface
// TODO: // TODO:
// DW_AT_byte_size // !interface
// DW_AT_specification // !interface // DW_AT_specification // !interface
protected: protected:
DynamicAttributeValue fByteSize;
}; };
@ -335,10 +339,10 @@ public:
// DW_AT_specification // DW_AT_specification
private: private:
uint64 fBitStride; DynamicAttributeValue fBitStride;
dwarf_addr_t fByteSize; DynamicAttributeValue fByteSize;
uint8 fOrdering;
DebugInfoEntryList fDimensions; DebugInfoEntryList fDimensions;
uint8 fOrdering;
}; };
@ -628,11 +632,11 @@ public:
// DW_AT_small // DW_AT_small
private: private:
DynamicAttributeValue fByteSize;
DynamicAttributeValue fBitOffset;
DynamicAttributeValue fBitSize;
uint8 fEncoding; uint8 fEncoding;
uint8 fEndianity; uint8 fEndianity;
uint16 fByteSize;
uint16 fBitSize;
uint16 fBitOffset;
}; };
@ -890,7 +894,7 @@ public:
const AttributeValue& value); const AttributeValue& value);
private: private:
uint64 fBlockSize; DynamicAttributeValue fBlockSize;
DeclarationLocation fDeclarationLocation; DeclarationLocation fDeclarationLocation;
}; };