aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRene Gollent <anevilyak@gmail.com>2012-07-15 15:45:39 -0400
committerRene Gollent <anevilyak@gmail.com>2012-07-15 15:48:07 -0400
commit8c4773f75b06851586209f810ac1f8c759bf072f (patch)
tree5ec19adc9889fab1a75c9d53424735a90ff36692
parent4bb5af765fc7c9e4daf911d5ad8db763403fdd21 (diff)
Adjust address semantics of CStringValueNode.hrev44344
- When resolving its value, CStringValueNode now sets its node child's address to the address of the string buffer rather than the location of the originating pointer, which allows things like Inspect to pick that up.
-rw-r--r--src/apps/debugger/value/value_nodes/CStringValueNode.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/apps/debugger/value/value_nodes/CStringValueNode.cpp b/src/apps/debugger/value/value_nodes/CStringValueNode.cpp
index dc967113b4..3b5f90ce9d 100644
--- a/src/apps/debugger/value/value_nodes/CStringValueNode.cpp
+++ b/src/apps/debugger/value/value_nodes/CStringValueNode.cpp
@@ -73,14 +73,24 @@ CStringValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
if (dynamic_cast<AddressType*>(fType) != NULL) {
error = valueLoader->LoadValue(location, valueType, false,
addressData);
+ if (error != B_OK)
+ return error;
} else {
addressData.SetTo(location->PieceAt(0).address);
maxSize = dynamic_cast<ArrayType*>(fType)
->DimensionAt(0)->CountElements();
}
- if (error != B_OK)
- return error;
+ ValuePieceLocation piece;
+ piece.SetToMemory(addressData.ToUInt64());
+
+ ValueLocation* stringLocation = new(std::nothrow) ValueLocation(
+ valueLoader->GetArchitecture()->IsBigEndian(), piece);
+
+ if (stringLocation == NULL)
+ return B_NO_MEMORY;
+
+ BReference<ValueLocation> locationReference(stringLocation, true);
error = valueLoader->LoadStringValue(addressData, maxSize, valueData);
if (error != B_OK)
@@ -91,8 +101,8 @@ CStringValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
if (value == NULL)
return B_NO_MEMORY;
- location->AcquireReference();
- _location = location;
+ NodeChild()->SetLocation(stringLocation, B_OK);
+ _location = locationReference.Detach();
_value = value;
return B_OK;
}