diff options
author | Johnny Chen <johnny.chen@apple.com> | 2012-06-05 19:37:43 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2012-06-05 19:37:43 +0000 |
commit | 3f476c4a7263180f2aaeea7415c9b5b269d3f681 (patch) | |
tree | f223ad7806227b598d97b208b79dd8bb3f846cd9 /lldb/source/Commands/CommandObjectWatchpoint.cpp | |
parent | baa1ac260bf5cc2b5bcbabaeccef15029b9d9e76 (diff) | |
download | bcm5719-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.cpp | 5 |
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; |