summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/API/SBWatchpoint.h10
-rw-r--r--lldb/include/lldb/Breakpoint/Watchpoint.h21
-rw-r--r--lldb/scripts/Python/interface/SBWatchpoint.i9
-rw-r--r--lldb/source/API/SBWatchpoint.cpp12
-rw-r--r--lldb/source/Breakpoint/Watchpoint.cpp4
-rw-r--r--lldb/test/python_api/default-constructor/sb_watchpoint.py2
6 files changed, 31 insertions, 27 deletions
diff --git a/lldb/include/lldb/API/SBWatchpoint.h b/lldb/include/lldb/API/SBWatchpoint.h
index 17272f34bf6..7cfc6233d0b 100644
--- a/lldb/include/lldb/API/SBWatchpoint.h
+++ b/lldb/include/lldb/API/SBWatchpoint.h
@@ -29,15 +29,15 @@ public:
operator = (const lldb::SBWatchpoint &rhs);
#endif
- lldb::SBError
- GetError ();
+ bool
+ IsValid() const;
+
+ SBError
+ GetError();
watch_id_t
GetID ();
- bool
- IsValid() const;
-
/// With -1 representing an invalid hardware index.
int32_t
GetHardwareIndex ();
diff --git a/lldb/include/lldb/Breakpoint/Watchpoint.h b/lldb/include/lldb/Breakpoint/Watchpoint.h
index 854723fc7d9..71df5b2c50b 100644
--- a/lldb/include/lldb/Breakpoint/Watchpoint.h
+++ b/lldb/include/lldb/Breakpoint/Watchpoint.h
@@ -58,6 +58,7 @@ public:
void Dump (Stream *s) const;
void DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const;
Target &GetTarget() { return *m_target; }
+ const Error &GetError() { return m_error; }
private:
friend class Target;
@@ -65,16 +66,18 @@ private:
void SetTarget(Target *target_ptr) { m_target = target_ptr; }
Target *m_target;
- bool m_enabled; // Is this watchpoint enabled
- bool m_is_hardware; // Is this a hardware watchpoint
- uint32_t m_watch_read:1, // 1 if we stop when the watched data is read from
- m_watch_write:1, // 1 if we stop when the watched data is written to
- m_watch_was_read:1, // Set to 1 when watchpoint is hit for a read access
- m_watch_was_written:1; // Set to 1 when watchpoint is hit for a write access
- uint32_t m_ignore_count; // Number of times to ignore this breakpoint
+ bool m_enabled; // Is this watchpoint enabled
+ bool m_is_hardware; // Is this a hardware watchpoint
+ uint32_t m_watch_read:1, // 1 if we stop when the watched data is read from
+ m_watch_write:1, // 1 if we stop when the watched data is written to
+ m_watch_was_read:1, // Set to 1 when watchpoint is hit for a read access
+ m_watch_was_written:1; // Set to 1 when watchpoint is hit for a write access
+ uint32_t m_ignore_count; // Number of times to ignore this breakpoint
WatchpointHitCallback m_callback;
- void * m_callback_baton; // Callback user data to pass to callback
- std::string m_decl_str; // Declaration information, if any.
+ void * m_callback_baton; // Callback user data to pass to callback
+ std::string m_decl_str; // Declaration information, if any.
+ Error m_error; // An error object describing errors creating watchpoint.
+
static lldb::break_id_t
GetNextID();
diff --git a/lldb/scripts/Python/interface/SBWatchpoint.i b/lldb/scripts/Python/interface/SBWatchpoint.i
index 58a15e7d8d5..03e7edb3167 100644
--- a/lldb/scripts/Python/interface/SBWatchpoint.i
+++ b/lldb/scripts/Python/interface/SBWatchpoint.i
@@ -28,12 +28,15 @@ public:
~SBWatchpoint ();
- watch_id_t
- GetID ();
-
bool
IsValid();
+ SBError
+ GetError();
+
+ watch_id_t
+ GetID ();
+
%feature("docstring", "
//------------------------------------------------------------------
/// With -1 representing an invalid hardware index.
diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp
index e3f9d8cc522..de43364f049 100644
--- a/lldb/source/API/SBWatchpoint.cpp
+++ b/lldb/source/API/SBWatchpoint.cpp
@@ -86,25 +86,19 @@ SBWatchpoint::GetID ()
bool
SBWatchpoint::IsValid() const
{
- return m_opaque_sp.get() != NULL;
-#if 0
- if (m_opaque_sp)
- return m_opaque_sp->GetError().Success();
+ if (m_opaque_sp && m_opaque_sp->GetError().Success())
+ return true;
return false;
-#endif
}
SBError
SBWatchpoint::GetError ()
{
SBError sb_error;
-#if 0
if (m_opaque_sp)
{
- // TODO: Johnny fill this in
- sb_error.ref() = m_opaque_sp->GetError();
+ sb_error.SetError(m_opaque_sp->GetError());
}
-#endif
return sb_error;
}
diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp
index 43f443a47fe..b5d3f68a8a2 100644
--- a/lldb/source/Breakpoint/Watchpoint.cpp
+++ b/lldb/source/Breakpoint/Watchpoint.cpp
@@ -29,7 +29,9 @@ Watchpoint::Watchpoint (lldb::addr_t addr, size_t size, bool hardware) :
m_watch_was_written(0),
m_ignore_count(0),
m_callback(NULL),
- m_callback_baton(NULL)
+ m_callback_baton(NULL),
+ m_decl_str(),
+ m_error()
{
}
diff --git a/lldb/test/python_api/default-constructor/sb_watchpoint.py b/lldb/test/python_api/default-constructor/sb_watchpoint.py
index 8b0b1ecc481..29d58628e57 100644
--- a/lldb/test/python_api/default-constructor/sb_watchpoint.py
+++ b/lldb/test/python_api/default-constructor/sb_watchpoint.py
@@ -7,6 +7,8 @@ import lldb
def fuzz_obj(obj):
obj.GetID()
+ obj.IsValid()
+ obj.GetError()
obj.GetHardwareIndex()
obj.GetWatchAddress()
obj.GetWatchSize()
OpenPOWER on IntegriCloud