Skip to content

Commit e20b67a

Browse files
delcypherbulbazord
authored andcommitted
[LLDB] Expose several methods in SBWatchpoint
This patch adds the following methods: * `GetType()` * `GetWatchValueKind()` * `GetWatchSpec()` * `IsWatchingReads()` * `IsWatchingWrites()` These mostly expose methods that `lldb_private::Watchpoint` already had. Tests are included that exercise these new methods. The motivation for exposing these are as follows: * `GetType()` - With this information and the address from a watchpoint it is now possible to construct an SBValue from an SBWatchpoint. Previously this wasn't possible. The included test case illustrates doing this. * `GetWatchValueKind()` - This allows the caller to determine whether the watchpoint is a variable watchpoint or an expression watchpoint. A new enum (`WatchpointValueKind`) has been introduced to represent the return values. Unfortunately the name `WatchpointKind` was already taken. * `GetWatchSpec()` - This allows (at least for variable watchpoints) to use a sensible name for SBValues created from an SBWatchpoint. * `IsWatchingReads()` - This allow checking if a watchpoint is monitoring read accesses. * `IsWatchingWRites()` - This allow checking if a watchpoint is monitoring write accesses. rdar://105606978 Reviewers: jingham, mib, bulbazord, jasonmolenda, JDevlieghere Differential Revision: https://reviews.llvm.org/D144937 (cherry picked from commit 55a363f)
1 parent 4cf5aef commit e20b67a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

lldb/bindings/interface/SBWatchpointDocstrings.i

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,30 @@ watchpoints of the target."
1919
%feature("docstring", "
2020
The watchpoint stops only if the condition expression evaluates to true."
2121
) lldb::SBWatchpoint::SetCondition;
22+
23+
%feature("docstring", "
24+
Returns the type recorded when the watchpoint was created. For variable
25+
watchpoints it is the type of the watched variable. For expression
26+
watchpoints it is the type of the provided expression."
27+
) lldb::SBWatchpoint::GetType;
28+
29+
%feature("docstring", "
30+
Returns the kind of value that was watched when the watchpoint was created.
31+
Returns one of the following eWatchPointValueKindVariable,
32+
eWatchPointValueKindExpression, eWatchPointValueKindInvalid.
33+
"
34+
) lldb::SBWatchpoint::GetWatchValueKind;
35+
36+
%feature("docstring", "
37+
Get the spec for the watchpoint. For variable watchpoints this is the name
38+
of the variable. For expression watchpoints it is empty
39+
(may change in the future)."
40+
) lldb::SBWatchpoint::GetWatchSpec;
41+
42+
%feature("docstring", "
43+
Returns true if the watchpoint is watching reads. Returns false otherwise."
44+
) lldb::SBWatchpoint::IsWatchingReads;
45+
46+
%feature("docstring", "
47+
Returns true if the watchpoint is watching writes. Returns false otherwise."
48+
) lldb::SBWatchpoint::IsWatchingWrites;

0 commit comments

Comments
 (0)