SBValue::Watch() and SBValue::WatchPointee() are now the official API for creating
a watchpoint for either the variable encapsulated by SBValue (Watch) or the pointee
encapsulated by SBValue (WatchPointee).
Removed SBFrame::WatchValue() and SBFrame::WatchLocation() API as a result of that.
Modified the watchpoint related test suite to reflect the change.
Plus replacing WatchpointLocation with Watchpoint throughout the code base.
There are still cleanups to be dome. This patch passes the whole test suite.
Check it in so that we aggressively catch regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141925 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/interface/SBFrame.i b/scripts/Python/interface/SBFrame.i
index 40d6572..28526ab 100644
--- a/scripts/Python/interface/SBFrame.i
+++ b/scripts/Python/interface/SBFrame.i
@@ -215,25 +215,6 @@
lldb::SBValue
FindValue (const char *name, ValueType value_type, lldb::DynamicValueType use_dynamic);
- %feature("docstring", "
- /// Find and watch a variable using the frame as the scope.
- /// It returns an SBValue, similar to FindValue() method, if find-and-watch
- /// operation succeeds. Otherwise, an invalid SBValue is returned.
- /// You can use LLDB_WATCH_TYPE_READ | LLDB_WATCH_TYPE_WRITE for 'rw' watch.
- ") WatchValue;
- lldb::SBValue
- WatchValue (const char *name, ValueType value_type, uint32_t watch_type);
-
- %feature("docstring", "
- /// Find and watch the location pointed to by a variable using the frame as
- /// the scope.
- /// It returns an SBValue, similar to FindValue() method, if find-and-watch
- /// operation succeeds. Otherwise, an invalid SBValue is returned.
- /// You can use LLDB_WATCH_TYPE_READ | LLDB_WATCH_TYPE_WRITE for 'rw' watch.
- ") WatchLocation;
- lldb::SBValue
- WatchLocation (const char *name, ValueType value_type, uint32_t watch_type, size_t size);
-
bool
GetDescription (lldb::SBStream &description);
diff --git a/scripts/Python/interface/SBTarget.i b/scripts/Python/interface/SBTarget.i
index 9c628a6..d462ed9 100644
--- a/scripts/Python/interface/SBTarget.i
+++ b/scripts/Python/interface/SBTarget.i
@@ -12,8 +12,7 @@
%feature("docstring",
"Represents the target program running under the debugger.
-SBTarget supports module, breakpoint, and watchpoint_location iterations. For
-example,
+SBTarget supports module, breakpoint, and watchpoint iterations. For example,
for m in target.module_iter():
print m
@@ -39,14 +38,14 @@
and,
- for wp_loc in target.watchpoint_location_iter():
+ for wp_loc in target.watchpoint_iter():
print wp_loc
produces:
-WatchpointLocation 1: addr = 0x1034ca048 size = 4 state = enabled type = rw
+Watchpoint 1: addr = 0x1034ca048 size = 4 state = enabled type = rw
declare @ '/Volumes/data/lldb/svn/trunk/test/python_api/watchpoint/main.c:12'
- hw_index = 0 hit_count = 2 ignore_count = 0 callback = 0x0 baton = 0x0"
+ hw_index = 0 hit_count = 2 ignore_count = 0"
) SBTarget;
class SBTarget
{
diff --git a/scripts/Python/interface/SBValue.i b/scripts/Python/interface/SBValue.i
index 439e0ab..39a92c6 100644
--- a/scripts/Python/interface/SBValue.i
+++ b/scripts/Python/interface/SBValue.i
@@ -278,9 +278,17 @@
lldb::SBFrame
GetFrame();
+ %feature("docstring", "
+ /// Find and watch a variable.
+ /// It returns an SBWatchpoint, which may be invalid.
+ ") Watch;
lldb::SBWatchpoint
Watch (bool resolve_location, bool read, bool write);
+ %feature("docstring", "
+ /// Find and watch the location pointed to by a variable.
+ /// It returns an SBWatchpoint, which may be invalid.
+ ") WatchPointee;
lldb::SBWatchpoint
WatchPointee (bool resolve_location, bool read, bool write);
diff --git a/scripts/Python/interface/SBWatchpoint.i b/scripts/Python/interface/SBWatchpoint.i
index 5ddba45..58a15e7 100644
--- a/scripts/Python/interface/SBWatchpoint.i
+++ b/scripts/Python/interface/SBWatchpoint.i
@@ -10,14 +10,13 @@
namespace lldb {
%feature("docstring",
-"Represents an instance of watchpoint location for a specific target program.
+"Represents an instance of watchpoint for a specific target program.
-A watchpoint location is determined by the address and the byte size that
-resulted in this particular instantiation. Each watchpoint location has its
-settable options.
+A watchpoint is determined by the address and the byte size that resulted in
+this particular instantiation. Each watchpoint has its settable options.
-See also SBTarget.watchpoint_location_iter() for for example usage of iterating
-through the watchpoint locations of the target."
+See also SBTarget.watchpoint_iter() for for example usage of iterating through
+the watchpoints of the target."
) SBWatchpoint;
class SBWatchpoint
{
diff --git a/scripts/Python/modify-python-lldb.py b/scripts/Python/modify-python-lldb.py
index 15f42a4..06be303 100644
--- a/scripts/Python/modify-python-lldb.py
+++ b/scripts/Python/modify-python-lldb.py
@@ -173,7 +173,7 @@
iter_def = " def __iter__(self): return lldb_iter(self, '%s', '%s')"
module_iter = " def module_iter(self): return lldb_iter(self, '%s', '%s')"
breakpoint_iter = " def breakpoint_iter(self): return lldb_iter(self, '%s', '%s')"
-watchpoint_location_iter = " def watchpoint_location_iter(self): return lldb_iter(self, '%s', '%s')"
+watchpoint_iter = " def watchpoint_iter(self): return lldb_iter(self, '%s', '%s')"
section_iter = " def section_iter(self): return lldb_iter(self, '%s', '%s')"
# Called to implement the built-in function len().
@@ -222,7 +222,7 @@
# SBTarget needs special processing, see below.
'SBTarget': {'module': ('GetNumModules', 'GetModuleAtIndex'),
'breakpoint': ('GetNumBreakpoints', 'GetBreakpointAtIndex'),
- 'watchpoint_location': ('GetNumWatchpointLocations', 'GetWatchpointLocationAtIndex')
+ 'watchpoint': ('GetNumWatchpoints', 'GetWatchpointAtIndex')
},
# SBModule has an additional section_iter(), see below.
@@ -369,7 +369,7 @@
if cls == "SBTarget":
new_content.add_line(module_iter % (d[cls]['module']))
new_content.add_line(breakpoint_iter % (d[cls]['breakpoint']))
- new_content.add_line(watchpoint_location_iter % (d[cls]['watchpoint_location']))
+ new_content.add_line(watchpoint_iter % (d[cls]['watchpoint']))
else:
if (state & DEFINING_ITERATOR):
new_content.add_line(iter_def % d[cls])