summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp5
-rw-r--r--lldb/source/Core/ValueObject.cpp10
2 files changed, 12 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index 04d87898149..0ac4576f723 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -1196,8 +1196,9 @@ CommandObjectWatchpointSetExpression::ExecuteRawCommandString
}
// Get the address to watch.
- addr = valobj_sp->GetValueAsUnsigned(0);
- if (!addr) {
+ bool success = false;
+ addr = valobj_sp->GetValueAsUnsigned(0, &success);
+ if (!success) {
result.GetErrorStream().Printf("error: expression did not evaluate to an address\n");
result.SetStatus(eReturnStatusFailed);
return false;
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 07af307d755..b3c0a0b8c34 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1246,15 +1246,23 @@ ValueObject::GetValueAsCString ()
// if > 8bytes, 0 is returned. this method should mostly be used
// to read address values out of pointers
uint64_t
-ValueObject::GetValueAsUnsigned (uint64_t fail_value)
+ValueObject::GetValueAsUnsigned (uint64_t fail_value, bool *success)
{
// If our byte size is zero this is an aggregate type that has children
if (ClangASTContext::IsAggregateType (GetClangType()) == false)
{
Scalar scalar;
if (ResolveValue (scalar))
+ {
+ if (success)
+ *success = true;
return scalar.GetRawBits64(fail_value);
+ }
+ // fallthrough, otherwise...
}
+
+ if (success)
+ *success = false;
return fail_value;
}
OpenPOWER on IntegriCloud