2011-10-14 02:08:26 +08:00
|
|
|
//===-- SWIG Interface for SBWatchpoint -----------------*- C++ -*-===//
|
2011-09-27 09:19:20 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2011-09-27 09:19:20 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
namespace lldb {
|
|
|
|
|
|
|
|
%feature("docstring",
|
2011-10-14 08:42:25 +08:00
|
|
|
"Represents an instance of watchpoint for a specific target program.
|
2011-09-27 09:19:20 +08:00
|
|
|
|
2011-10-14 08:42:25 +08:00
|
|
|
A watchpoint is determined by the address and the byte size that resulted in
|
|
|
|
this particular instantiation. Each watchpoint has its settable options.
|
2011-09-27 09:19:20 +08:00
|
|
|
|
2021-01-15 21:43:26 +08:00
|
|
|
See also :py:class:`SBTarget.watchpoint_iter()` for example usage of iterating through the
|
2011-10-26 08:44:40 +08:00
|
|
|
watchpoints of the target."
|
2011-10-14 02:08:26 +08:00
|
|
|
) SBWatchpoint;
|
|
|
|
class SBWatchpoint
|
2011-09-27 09:19:20 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2011-10-14 02:08:26 +08:00
|
|
|
SBWatchpoint ();
|
2011-09-27 09:19:20 +08:00
|
|
|
|
2011-10-14 02:08:26 +08:00
|
|
|
SBWatchpoint (const lldb::SBWatchpoint &rhs);
|
2011-09-27 09:19:20 +08:00
|
|
|
|
2011-10-14 02:08:26 +08:00
|
|
|
~SBWatchpoint ();
|
2011-09-27 09:19:20 +08:00
|
|
|
|
|
|
|
bool
|
2011-10-14 02:08:26 +08:00
|
|
|
IsValid();
|
2011-09-27 09:19:20 +08:00
|
|
|
|
Add "operator bool" to SB APIs
Summary:
Our python version of the SB API has (the python equivalent of)
operator bool, but the C++ version doesn't.
This is because our python operators are added by modify-python-lldb.py,
which performs postprocessing on the swig-generated interface files.
In this patch, I add the "operator bool" to all SB classes which have an
IsValid method (which is the same logic used by modify-python-lldb.py).
This way, we make the two interfaces more constent, and it allows us to
rely on swig's automatic syntesis of python __nonzero__ methods instead
of doing manual fixups.
Reviewers: zturner, jingham, clayborg, jfb, serge-sans-paille
Subscribers: jdoerfert, lldb-commits
Differential Revision: https://reviews.llvm.org/D58792
llvm-svn: 355824
2019-03-11 21:58:46 +08:00
|
|
|
explicit operator bool() const;
|
|
|
|
|
Make operator==s consistent between c++ and python APIs
Summary:
modify-python-lldb.py had code to insert python equality operators to
some classes. Some of those classes already had c++ equality operators,
and some didn't.
This makes the situation more consistent, by removing all equality
handilng from modify-python-lldb. Instead, I add c++ operators to
classes where they were missing, and expose them in the swig interface
files so that they are available to python too.
The only tricky case was the SBAddress class, which had an operator==
defined as a free function, which is not handled by swig. This function
cannot be removed without breaking ABI, and we cannot add an extra
operator== member, as that would make equality comparisons ambiguous.
For this class, I define a python __eq__ function by hand and have it
delegate to the operator!=, which I have defined as a member function.
This isn't fully NFC, as the semantics of some equality functions in
python changes slightly, but I believe it changes for the better (e.g.,
previously SBBreakpoint.__eq__ would consider two breakpoints with the
same ID as equal, even if they belonged to different targets; now they
are only equal if they belong to the same target).
Reviewers: jingham, clayborg, zturner
Subscribers: jdoerfert, JDevlieghere, lldb-commits
Differential Revision: https://reviews.llvm.org/D59819
llvm-svn: 357463
2019-04-02 18:18:46 +08:00
|
|
|
bool operator==(const SBWatchpoint &rhs) const;
|
|
|
|
|
|
|
|
bool operator!=(const SBWatchpoint &rhs) const;
|
|
|
|
|
2012-06-09 05:56:10 +08:00
|
|
|
SBError
|
|
|
|
GetError();
|
|
|
|
|
2011-10-15 03:15:48 +08:00
|
|
|
watch_id_t
|
|
|
|
GetID ();
|
|
|
|
|
2011-09-27 09:19:20 +08:00
|
|
|
%feature("docstring", "
|
2019-04-19 00:23:33 +08:00
|
|
|
With -1 representing an invalid hardware index.") GetHardwareIndex;
|
2011-09-27 09:19:20 +08:00
|
|
|
int32_t
|
2011-10-14 02:08:26 +08:00
|
|
|
GetHardwareIndex ();
|
2011-09-27 09:19:20 +08:00
|
|
|
|
|
|
|
lldb::addr_t
|
2011-10-14 02:08:26 +08:00
|
|
|
GetWatchAddress ();
|
2011-09-27 09:19:20 +08:00
|
|
|
|
|
|
|
size_t
|
2011-10-14 02:08:26 +08:00
|
|
|
GetWatchSize();
|
2011-09-27 09:19:20 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
SetEnabled(bool enabled);
|
|
|
|
|
|
|
|
bool
|
|
|
|
IsEnabled ();
|
|
|
|
|
|
|
|
uint32_t
|
2011-10-14 02:08:26 +08:00
|
|
|
GetHitCount ();
|
2011-09-27 09:19:20 +08:00
|
|
|
|
|
|
|
uint32_t
|
|
|
|
GetIgnoreCount ();
|
|
|
|
|
|
|
|
void
|
|
|
|
SetIgnoreCount (uint32_t n);
|
|
|
|
|
2011-10-19 03:13:06 +08:00
|
|
|
%feature("docstring", "
|
2019-04-19 00:23:33 +08:00
|
|
|
Get the condition expression for the watchpoint.") GetCondition;
|
2011-10-18 02:58:00 +08:00
|
|
|
const char *
|
|
|
|
GetCondition ();
|
|
|
|
|
2011-10-19 03:13:06 +08:00
|
|
|
%feature("docstring", "
|
2019-04-19 00:23:33 +08:00
|
|
|
The watchpoint stops only if the condition expression evaluates to true.") SetCondition;
|
|
|
|
void
|
2011-10-18 02:58:00 +08:00
|
|
|
SetCondition (const char *condition);
|
2019-04-19 00:23:33 +08:00
|
|
|
|
2011-09-27 09:19:20 +08:00
|
|
|
bool
|
|
|
|
GetDescription (lldb::SBStream &description, DescriptionLevel level);
|
2012-12-18 10:03:49 +08:00
|
|
|
|
|
|
|
static bool
|
|
|
|
EventIsWatchpointEvent (const lldb::SBEvent &event);
|
2019-04-19 00:23:33 +08:00
|
|
|
|
2012-12-18 10:03:49 +08:00
|
|
|
static lldb::WatchpointEventType
|
|
|
|
GetWatchpointEventTypeFromEvent (const lldb::SBEvent& event);
|
|
|
|
|
|
|
|
static lldb::SBWatchpoint
|
|
|
|
GetWatchpointFromEvent (const lldb::SBEvent& event);
|
|
|
|
|
2020-01-09 12:56:11 +08:00
|
|
|
STRING_EXTENSION_LEVEL(SBWatchpoint, lldb::eDescriptionLevelVerbose)
|
2011-09-27 09:19:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace lldb
|