[Haiku-commits] r31052 - haiku/trunk/src/apps/debugger

bonefish at mail.berlios.de bonefish at mail.berlios.de
Sun Jun 14 19:16:17 CEST 2009


Author: bonefish
Date: 2009-06-14 19:16:08 +0200 (Sun, 14 Jun 2009)
New Revision: 31052
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31052&view=rev

Modified:
   haiku/trunk/src/apps/debugger/DebugInfoEntries.cpp
   haiku/trunk/src/apps/debugger/DebugInfoEntries.h
Log:
* Support for DW_AT_byte_size in DIECompoundType.
* Fixed several instances of attributes with dynamic values not being handled
  correctly.


Modified: haiku/trunk/src/apps/debugger/DebugInfoEntries.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/DebugInfoEntries.cpp	2009-06-14 14:18:55 UTC (rev 31051)
+++ haiku/trunk/src/apps/debugger/DebugInfoEntries.cpp	2009-06-14 17:16:08 UTC (rev 31052)
@@ -360,6 +360,14 @@
 }
 
 
+status_t
+DIECompoundType::AddAttribute_byte_size(uint16 attributeName,
+	const AttributeValue& value)
+{
+	return SetDynamicAttributeValue(fByteSize, value);
+}
+
+
 // #pragma mark - DIEClassBaseType
 
 
@@ -373,8 +381,6 @@
 
 DIEArrayType::DIEArrayType()
 	:
-	fBitStride(0),
-	fByteSize(0),
 	fOrdering(DW_ORD_row_major)
 {
 }
@@ -422,8 +428,7 @@
 DIEArrayType::AddAttribute_bit_stride(uint16 attributeName,
 	const AttributeValue& value)
 {
-	fBitStride = value.constant;
-	return B_OK;
+	return SetDynamicAttributeValue(fBitStride, value);
 }
 
 
@@ -431,8 +436,7 @@
 DIEArrayType::AddAttribute_stride_size(uint16 attributeName,
 	const AttributeValue& value)
 {
-	fBitStride = value.constant;
-	return B_OK;
+	return SetDynamicAttributeValue(fBitStride, value);
 }
 
 
@@ -440,8 +444,7 @@
 DIEArrayType::AddAttribute_byte_size(uint16 attributeName,
 	const AttributeValue& value)
 {
-	fByteSize = value.constant;
-	return B_OK;
+	return SetDynamicAttributeValue(fByteSize, value);
 }
 
 
@@ -871,10 +874,7 @@
 DIEBaseType::DIEBaseType()
 	:
 	fEncoding(0),
-	fEndianity(0),
-	fByteSize(0),
-	fBitSize(0),
-	fBitOffset(0)
+	fEndianity(0)
 {
 }
 
@@ -899,8 +899,7 @@
 DIEBaseType::AddAttribute_byte_size(uint16 attributeName,
 	const AttributeValue& value)
 {
-	fByteSize = value.constant;
-	return B_OK;
+	return SetDynamicAttributeValue(fByteSize, value);
 }
 
 
@@ -908,8 +907,7 @@
 DIEBaseType::AddAttribute_bit_size(uint16 attributeName,
 	const AttributeValue& value)
 {
-	fBitSize = value.constant;
-	return B_OK;
+	return SetDynamicAttributeValue(fBitSize, value);
 }
 
 
@@ -917,8 +915,7 @@
 DIEBaseType::AddAttribute_bit_offset(uint16 attributeName,
 	const AttributeValue& value)
 {
-	fBitOffset = value.constant;
-	return B_OK;
+	return SetDynamicAttributeValue(fBitOffset, value);
 }
 
 
@@ -1379,9 +1376,8 @@
 
 
 DIESharedType::DIESharedType()
-	:
-	fBlockSize(DWARF_ADDRESS_MAX)
 {
+	fBlockSize.SetTo(DWARF_ADDRESS_MAX);
 }
 
 
@@ -1396,8 +1392,7 @@
 DIESharedType::AddAttribute_count(uint16 attributeName,
 	const AttributeValue& value)
 {
-	fBlockSize = value.constant;
-	return B_OK;
+	return SetDynamicAttributeValue(fBlockSize, value);
 }
 
 

Modified: haiku/trunk/src/apps/debugger/DebugInfoEntries.h
===================================================================
--- haiku/trunk/src/apps/debugger/DebugInfoEntries.h	2009-06-14 14:18:55 UTC (rev 31051)
+++ haiku/trunk/src/apps/debugger/DebugInfoEntries.h	2009-06-14 17:16:08 UTC (rev 31052)
@@ -291,11 +291,15 @@
 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 @@
 // DW_AT_specification
 
 private:
-			uint64				fBitStride;
-			dwarf_addr_t		fByteSize;
+			DynamicAttributeValue fBitStride;
+			DynamicAttributeValue fByteSize;
+			DebugInfoEntryList	fDimensions;
 			uint8				fOrdering;
-			DebugInfoEntryList	fDimensions;
 };
 
 
@@ -628,11 +632,11 @@
 // DW_AT_small
 
 private:
+			DynamicAttributeValue fByteSize;
+			DynamicAttributeValue fBitOffset;
+			DynamicAttributeValue fBitSize;
 			uint8				fEncoding;
 			uint8				fEndianity;
-			uint16				fByteSize;
-			uint16				fBitSize;
-			uint16				fBitOffset;
 };
 
 
@@ -890,7 +894,7 @@
 									const AttributeValue& value);
 
 private:
-			uint64				fBlockSize;
+			DynamicAttributeValue fBlockSize;
 			DeclarationLocation	fDeclarationLocation;
 };
 




More information about the Haiku-commits mailing list