summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectWatchpoint.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-06-05 19:37:43 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-06-05 19:37:43 +0000
commit3f476c4a7263180f2aaeea7415c9b5b269d3f681 (patch)
treef223ad7806227b598d97b208b79dd8bb3f846cd9 /lldb/source/Commands/CommandObjectWatchpoint.cpp
parentbaa1ac260bf5cc2b5bcbabaeccef15029b9d9e76 (diff)
downloadbcm5719-llvm-3f476c4a7263180f2aaeea7415c9b5b269d3f681.tar.gz
bcm5719-llvm-3f476c4a7263180f2aaeea7415c9b5b269d3f681.zip
rdar://problem/11597911
Fix confusing error message about "expression did not evaluate to an address" when doing 'watchpoint set expression". Instead of using 0 as the fail_value when invoking ValueObject::GetValueAsUnsigned(), modify the API to take an addition bool pointer (defaults to NULL) to indicate success/failure of value conversion. llvm-svn: 158016
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp5
1 files changed, 3 insertions, 2 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;
OpenPOWER on IntegriCloud