rdar://problem/11584012
Refactorings of watchpoint creation APIs so that SBTarget::WatchAddress(), SBValue::Watch(), and SBValue::WatchPointee()
now take an additional 'SBError &error' parameter (at the end) to contain the reason if there is some failure in the
operation. Update 'watchpoint set variable/expression' commands to take advantage of that.
Update existing test cases to reflect the API change and add test cases to verify that the SBError mechanism works for
SBTarget::WatchAddress() by passing an invalid watch_size.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157964 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBWatchpoint.cpp b/source/API/SBWatchpoint.cpp
index fd505ae..76ce57c 100644
--- a/source/API/SBWatchpoint.cpp
+++ b/source/API/SBWatchpoint.cpp
@@ -87,22 +87,7 @@
bool
SBWatchpoint::IsValid() const
{
- lldb::WatchpointSP watchpoint_sp(GetSP());
- if (watchpoint_sp && watchpoint_sp->GetError().Success())
- return true;
- return false;
-}
-
-SBError
-SBWatchpoint::GetError ()
-{
- SBError sb_error;
- lldb::WatchpointSP watchpoint_sp(GetSP());
- if (watchpoint_sp)
- {
- sb_error.SetError(watchpoint_sp->GetError());
- }
- return sb_error;
+ return m_opaque_sp;
}
int32_t