summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2013-04-19 19:47:32 +0000
committerSean Callanan <scallanan@apple.com>2013-04-19 19:47:32 +0000
commited185ab5c715adb3ba49d6edc786497f2a23e7b5 (patch)
tree88da61e6bc322cfbdc757d90e18939a74a851430 /lldb/source/Core
parente8f9bfdb714946971da33a1d351c3448a077a340 (diff)
downloadbcm5719-llvm-ed185ab5c715adb3ba49d6edc786497f2a23e7b5.tar.gz
bcm5719-llvm-ed185ab5c715adb3ba49d6edc786497f2a23e7b5.zip
Fixed two problems when reading constant/register
variables in the ValueObject code: - Report an error if the variable does not have a valid address. - Return the contents of the data to GetData(), even if the value is constant. <rdar://problem/13690855> llvm-svn: 179876
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/ValueObject.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 19dfdee5b2a..41fc3ea5540 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1007,7 +1007,17 @@ ValueObject::GetData (DataExtractor& data)
ExecutionContext exe_ctx (GetExecutionContextRef());
Error error = m_value.GetValueAsData(&exe_ctx, GetClangAST(), data, 0, GetModule().get());
if (error.Fail())
- return 0;
+ {
+ if (m_data.GetByteSize())
+ {
+ data = m_data;
+ return data.GetByteSize();
+ }
+ else
+ {
+ return 0;
+ }
+ }
data.SetAddressByteSize(m_data.GetAddressByteSize());
data.SetByteOrder(m_data.GetByteOrder());
return data.GetByteSize();
@@ -3832,6 +3842,13 @@ ValueObject::AddressOf (Error &error)
break;
}
}
+ else
+ {
+ StreamString expr_path_strm;
+ GetExpressionPath(expr_path_strm, true);
+ error.SetErrorStringWithFormat("'%s' doesn't have a valid address", expr_path_strm.GetString().c_str());
+ }
+
return m_addr_of_valobj_sp;
}
OpenPOWER on IntegriCloud