Cleaned up the SBWatchpoint public API.

llvm-svn: 141876
This commit is contained in:
Greg Clayton 2011-10-13 18:08:26 +00:00
parent d5a9a3afaf
commit 1b282f9619
18 changed files with 260 additions and 165 deletions

View File

@ -63,7 +63,7 @@ class SBType;
class SBTypeList;
class SBValue;
class SBValueList;
class SBWatchpointLocation;
class SBWatchpoint;
}

View File

@ -81,6 +81,7 @@ protected:
friend class SBThread;
friend class SBTarget;
friend class SBValue;
friend class SBWatchpoint;
lldb_private::Error *
get();

View File

@ -77,7 +77,7 @@ protected:
friend class SBTarget;
friend class SBThread;
friend class SBValue;
friend class SBWatchpointLocation;
friend class SBWatchpoint;
#ifndef SWIG

View File

@ -16,7 +16,7 @@
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBFileSpecList.h"
#include "lldb/API/SBType.h"
#include "lldb/API/SBWatchpointLocation.h"
#include "lldb/API/SBWatchpoint.h"
namespace lldb {
@ -452,28 +452,28 @@ public:
DeleteAllBreakpoints ();
uint32_t
GetNumWatchpointLocations () const;
GetNumWatchpoints () const;
lldb::SBWatchpointLocation
GetLastCreatedWatchpointLocation ();
lldb::SBWatchpointLocation
GetWatchpointLocationAtIndex (uint32_t idx) const;
lldb::SBWatchpoint
GetWatchpointAtIndex (uint32_t idx) const;
bool
WatchpointLocationDelete (watch_id_t watch_id);
DeleteWatchpoint (lldb::watch_id_t watch_id);
lldb::SBWatchpointLocation
FindWatchpointLocationByID (watch_id_t watch_id);
lldb::SBWatchpoint
FindWatchpointByID (lldb::watch_id_t watch_id);
lldb::SBWatchpoint
WatchAddress (lldb::addr_t addr, size_t size, bool read, bool write);
bool
EnableAllWatchpointLocations ();
EnableAllWatchpoints ();
bool
DisableAllWatchpointLocations ();
DisableAllWatchpoints ();
bool
DeleteAllWatchpointLocations ();
DeleteAllWatchpoints ();
lldb::SBBroadcaster
GetBroadcaster () const;

View File

@ -275,6 +275,58 @@ public:
SBValue (const lldb::ValueObjectSP &value_sp);
//------------------------------------------------------------------
/// Watch this value if it resides in memory.
///
/// Sets a watchpoint on the value.
///
/// @param[in] resolve_location
/// Resolve the location of this value once and watch its address.
/// This value must currently be set to \b true as watching all
/// locations of a variable or a variable path is not yet supported,
/// though we plan to support it in the future.
///
/// @param[in] read
/// Stop when this value is accessed.
///
/// @param[in] write
/// Stop when this value is modified
///
/// @return
/// An SBWatchpoint object. This object might not be valid upon
/// return due to a value not being contained in memory, too
/// large, or watchpoint resources are not available or all in
/// use.
//------------------------------------------------------------------
lldb::SBWatchpoint
Watch (bool resolve_location, bool read, bool write);
//------------------------------------------------------------------
/// Watch this value that this value points to in memory
///
/// Sets a watchpoint on the value.
///
/// @param[in] resolve_location
/// Resolve the location of this value once and watch its address.
/// This value must currently be set to \b true as watching all
/// locations of a variable or a variable path is not yet supported,
/// though we plan to support it in the future.
///
/// @param[in] read
/// Stop when this value is accessed.
///
/// @param[in] write
/// Stop when this value is modified
///
/// @return
/// An SBWatchpoint object. This object might not be valid upon
/// return due to a value not being contained in memory, too
/// large, or watchpoint resources are not available or all in
/// use.
//------------------------------------------------------------------
lldb::SBWatchpoint
WatchPointee (bool resolve_location, bool read, bool write);
#ifndef SWIG
// this must be defined in the .h file because synthetic children as implemented in the core
// currently rely on being able to extract the SharedPointer out of an SBValue. if the implementation

View File

@ -1,4 +1,4 @@
//===-- SBWatchpointLocation.h ----------------------------------*- C++ -*-===//
//===-- SBWatchpoint.h ----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,43 +7,46 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_SBWatchpointLocation_h_
#define LLDB_SBWatchpointLocation_h_
#ifndef LLDB_SBWatchpoint_h_
#define LLDB_SBWatchpoint_h_
#include "lldb/API/SBDefines.h"
namespace lldb {
class SBWatchpointLocation
class SBWatchpoint
{
public:
SBWatchpointLocation ();
SBWatchpoint ();
SBWatchpointLocation (const lldb::SBWatchpointLocation &rhs);
SBWatchpoint (const lldb::SBWatchpoint &rhs);
~SBWatchpointLocation ();
~SBWatchpoint ();
#ifndef SWIG
const lldb::SBWatchpointLocation &
operator = (const lldb::SBWatchpointLocation &rhs);
const lldb::SBWatchpoint &
operator = (const lldb::SBWatchpoint &rhs);
#endif
lldb::SBError
GetError ();
watch_id_t
GetID () const;
GetID ();
bool
IsValid() const;
/// With -1 representing an invalid hardware index.
int32_t
GetHardwareIndex () const;
GetHardwareIndex ();
lldb::addr_t
GetWatchAddress () const;
GetWatchAddress ();
size_t
GetWatchSize() const;
GetWatchSize();
void
SetEnabled(bool enabled);
@ -52,7 +55,7 @@ public:
IsEnabled ();
uint32_t
GetHitCount () const;
GetHitCount ();
uint32_t
GetIgnoreCount ();
@ -64,7 +67,7 @@ public:
GetDescription (lldb::SBStream &description, DescriptionLevel level);
#ifndef SWIG
SBWatchpointLocation (const lldb::WatchpointLocationSP &watch_loc_sp);
SBWatchpoint (const lldb::WatchpointLocationSP &watch_loc_sp);
#endif
private:
@ -73,17 +76,14 @@ private:
#ifndef SWIG
lldb_private::WatchpointLocation *
operator->() const;
operator->();
lldb_private::WatchpointLocation *
get() const;
get();
lldb::WatchpointLocationSP &
operator *();
const lldb::WatchpointLocationSP &
operator *() const;
#endif
lldb::WatchpointLocationSP m_opaque_sp;
@ -92,4 +92,4 @@ private:
} // namespace lldb
#endif // LLDB_SBWatchpointLocation_h_
#endif // LLDB_SBWatchpoint_h_

View File

@ -452,8 +452,8 @@
B271B11413D6139300C3FEDB /* FormatClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94A9112D13D5DF210046D8A6 /* FormatClasses.cpp */; };
B27318421416AC12006039C8 /* WatchpointLocationList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27318411416AC12006039C8 /* WatchpointLocationList.cpp */; };
B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */; };
B2A58722143119810092BFBA /* SBWatchpointLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A58721143119810092BFBA /* SBWatchpointLocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
B2A58724143119D50092BFBA /* SBWatchpointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpointLocation.cpp */; };
B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A58721143119810092BFBA /* SBWatchpoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpoint.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -1368,9 +1368,9 @@
B287E63E12EFAE2C00C9BEFE /* ARMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMDefines.h; path = Utility/ARMDefines.h; sourceTree = "<group>"; };
B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectVersion.cpp; path = source/Commands/CommandObjectVersion.cpp; sourceTree = "<group>"; };
B296983512C2FB2B002D92C3 /* CommandObjectVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectVersion.h; path = source/Commands/CommandObjectVersion.h; sourceTree = "<group>"; };
B2A58721143119810092BFBA /* SBWatchpointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBWatchpointLocation.h; path = include/lldb/API/SBWatchpointLocation.h; sourceTree = "<group>"; };
B2A58723143119D50092BFBA /* SBWatchpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBWatchpointLocation.cpp; path = source/API/SBWatchpointLocation.cpp; sourceTree = "<group>"; };
B2A5872514313B480092BFBA /* SBWatchpointLocation.i */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; path = SBWatchpointLocation.i; sourceTree = "<group>"; };
B2A58721143119810092BFBA /* SBWatchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBWatchpoint.h; path = include/lldb/API/SBWatchpoint.h; sourceTree = "<group>"; };
B2A58723143119D50092BFBA /* SBWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBWatchpoint.cpp; path = source/API/SBWatchpoint.cpp; sourceTree = "<group>"; };
B2A5872514313B480092BFBA /* SBWatchpoint.i */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; path = SBWatchpoint.i; sourceTree = "<group>"; };
B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstructionUtils.h; path = Utility/InstructionUtils.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -1732,7 +1732,7 @@
2611FF11142D83060017FEA3 /* SBType.i */,
2611FF12142D83060017FEA3 /* SBValue.i */,
2611FF13142D83060017FEA3 /* SBValueList.i */,
B2A5872514313B480092BFBA /* SBWatchpointLocation.i */,
B2A5872514313B480092BFBA /* SBWatchpoint.i */,
);
name = interface;
path = scripts/Python/interface;
@ -1842,8 +1842,8 @@
9A19A6AD1163BB9800E0D453 /* SBValue.cpp */,
9A357582116CFDEE00E8ED2F /* SBValueList.h */,
9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */,
B2A58723143119D50092BFBA /* SBWatchpointLocation.cpp */,
B2A58721143119810092BFBA /* SBWatchpointLocation.h */,
B2A58723143119D50092BFBA /* SBWatchpoint.cpp */,
B2A58721143119810092BFBA /* SBWatchpoint.h */,
);
name = API;
sourceTree = "<group>";
@ -2882,7 +2882,7 @@
4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */,
4CAA56131422D96A001FFA01 /* BreakpointResolverFileRegex.h in Headers */,
26B8283D142D01E9002DBC64 /* SBSection.h in Headers */,
B2A58722143119810092BFBA /* SBWatchpointLocation.h in Headers */,
B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -3171,7 +3171,7 @@
4CAA56151422D986001FFA01 /* BreakpointResolverFileRegex.cpp in Sources */,
4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */,
26B82840142D020F002DBC64 /* SBSection.cpp in Sources */,
B2A58724143119D50092BFBA /* SBWatchpointLocation.cpp in Sources */,
B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -3577,6 +3577,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
@ -3613,6 +3614,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PREPROCESSOR_DEFINITIONS = (
__STDC_CONSTANT_MACROS,
@ -3646,7 +3648,6 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@ -3661,7 +3662,6 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks;
INSTALL_PATH = /Developer/usr/bin;
ONLY_ACTIVE_ARCH = NO;
@ -3673,7 +3673,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks;
INSTALL_PATH = /Developer/usr/bin;
ONLY_ACTIVE_ARCH = NO;
@ -3687,7 +3686,6 @@
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 80;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 80;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
@ -3739,7 +3737,6 @@
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 80;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 80;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
@ -3826,7 +3823,6 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 80;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_CURRENT_VERSION = 80;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
@ -3865,7 +3861,6 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 80;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_CURRENT_VERSION = 80;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
@ -3904,6 +3899,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PREPROCESSOR_DEFINITIONS = (
__STDC_CONSTANT_MACROS,
@ -3938,7 +3934,6 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 80;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@ -3969,7 +3964,6 @@
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 80;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 80;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
@ -4047,7 +4041,6 @@
CODE_SIGN_IDENTITY = lldb_codesign;
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@ -4096,7 +4089,6 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 80;
DEBUG_INFORMATION_FORMAT = dwarf;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@ -4127,7 +4119,6 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 80;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",

View File

@ -86,7 +86,7 @@
launchStyle = "0"
useCustomWorkingDirectory = "NO"
customWorkingDirectory = "/Volumes/work/gclayton/Documents/devb/attach"
buildConfiguration = "Debug"
buildConfiguration = "Release"
ignoresPersistentStateOnLaunch = "YES"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">

View File

@ -72,7 +72,7 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
" ${SRC_ROOT}/include/lldb/API/SBType.h"\
" ${SRC_ROOT}/include/lldb/API/SBValue.h"\
" ${SRC_ROOT}/include/lldb/API/SBValueList.h"\
" ${SRC_ROOT}/include/lldb/API/SBWatchpointLocation.h"\
" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"\
INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBBlock.i"\
@ -108,7 +108,7 @@ INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBType.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBValue.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBValueList.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBWatchpointLocation.i"
" ${SRC_ROOT}/scripts/Python/interface/SBWatchpoint.i"
if [ $Debug == 1 ]
then

View File

@ -442,28 +442,32 @@ public:
DeleteAllBreakpoints ();
uint32_t
GetNumWatchpointLocations () const;
lldb::SBWatchpointLocation
GetLastCreatedWatchpointLocation ();
lldb::SBWatchpointLocation
GetWatchpointLocationAtIndex (uint32_t idx) const;
GetNumWatchpoints () const;
lldb::SBWatchpoint
GetWatchpointAtIndex (uint32_t idx) const;
bool
WatchpointLocationDelete (watch_id_t watch_id);
lldb::SBWatchpointLocation
FindWatchpointLocationByID (watch_id_t watch_id);
DeleteWatchpoint (lldb::watch_id_t watch_id);
lldb::SBWatchpoint
FindWatchpointByID (lldb::watch_id_t watch_id);
bool
EnableAllWatchpointLocations ();
EnableAllWatchpoints ();
bool
DisableAllWatchpointLocations ();
DisableAllWatchpoints ();
bool
DeleteAllWatchpointLocations ();
DeleteAllWatchpoints ();
lldb::SBWatchpoint
WatchAddress (lldb::addr_t addr,
size_t size,
bool read,
bool write);
lldb::SBBroadcaster
GetBroadcaster () const;

View File

@ -278,6 +278,12 @@ public:
lldb::SBFrame
GetFrame();
lldb::SBWatchpoint
Watch (bool resolve_location, bool read, bool write);
lldb::SBWatchpoint
WatchPointee (bool resolve_location, bool read, bool write);
bool
GetDescription (lldb::SBStream &description);

View File

@ -1,4 +1,4 @@
//===-- SWIG Interface for SBWatchpointLocation -----------------*- C++ -*-===//
//===-- SWIG Interface for SBWatchpoint -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -18,22 +18,22 @@ settable options.
See also SBTarget.watchpoint_location_iter() for for example usage of iterating
through the watchpoint locations of the target."
) SBWatchpointLocation;
class SBWatchpointLocation
) SBWatchpoint;
class SBWatchpoint
{
public:
SBWatchpointLocation ();
SBWatchpoint ();
SBWatchpointLocation (const lldb::SBWatchpointLocation &rhs);
SBWatchpoint (const lldb::SBWatchpoint &rhs);
~SBWatchpointLocation ();
~SBWatchpoint ();
watch_id_t
GetID () const;
GetID ();
bool
IsValid() const;
IsValid();
%feature("docstring", "
//------------------------------------------------------------------
@ -41,13 +41,13 @@ public:
//------------------------------------------------------------------
") GetHardwareIndex;
int32_t
GetHardwareIndex () const;
GetHardwareIndex ();
lldb::addr_t
GetWatchAddress () const;
GetWatchAddress ();
size_t
GetWatchSize() const;
GetWatchSize();
void
SetEnabled(bool enabled);
@ -56,7 +56,7 @@ public:
IsEnabled ();
uint32_t
GetHitCount () const;
GetHitCount ();
uint32_t
GetIgnoreCount ();

View File

@ -236,7 +236,7 @@ d = { 'SBBreakpoint': ('GetNumLocations', 'GetLocationAtIndex'),
#
e = { 'SBAddress': ['GetFileAddress', 'GetModule'],
'SBBreakpoint': ['GetID'],
'SBWatchpointLocation': ['GetID'],
'SBWatchpoint': ['GetID'],
'SBFileSpec': ['GetFilename', 'GetDirectory'],
'SBModule': ['GetFileSpec', 'GetUUIDString'],
'SBType': ['GetByteSize', 'GetName']

View File

@ -160,8 +160,8 @@
return PyString_FromString (description.GetData());
}
}
%extend lldb::SBWatchpointLocation {
PyObject *lldb::SBWatchpointLocation::__repr__ (){
%extend lldb::SBWatchpoint {
PyObject *lldb::SBWatchpoint::__repr__ (){
lldb::SBStream description;
$self->GetDescription (description, lldb::eDescriptionLevelVerbose);
return PyString_FromString (description.GetData());

View File

@ -79,7 +79,7 @@ o SBLineEntry: Specifies an association with a contiguous range of instructions
#include "lldb/API/SBType.h"
#include "lldb/API/SBValue.h"
#include "lldb/API/SBValueList.h"
#include "lldb/API/SBWatchpointLocation.h"
#include "lldb/API/SBWatchpoint.h"
%}
/* Various liblldb typedefs that SWIG needs to know about. */
@ -132,7 +132,7 @@ o SBLineEntry: Specifies an association with a contiguous range of instructions
%include "./Python/interface/SBType.i"
%include "./Python/interface/SBValue.i"
%include "./Python/interface/SBValueList.i"
%include "./Python/interface/SBWatchpointLocation.i"
%include "./Python/interface/SBWatchpoint.i"
%include "./Python/python-extensions.swig"

View File

@ -883,7 +883,7 @@ SBTarget::DeleteAllBreakpoints ()
}
uint32_t
SBTarget::GetNumWatchpointLocations () const
SBTarget::GetNumWatchpoints () const
{
if (m_opaque_sp)
{
@ -893,31 +893,10 @@ SBTarget::GetNumWatchpointLocations () const
return 0;
}
SBWatchpointLocation
SBTarget::GetLastCreatedWatchpointLocation ()
SBWatchpoint
SBTarget::GetWatchpointAtIndex (uint32_t idx) const
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBWatchpointLocation sb_watchpoint_location;
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
sb_watchpoint_location = m_opaque_sp->GetLastCreatedWatchpointLocation();
}
if (log)
{
log->Printf ("SBTarget(%p)::GetLastCreateWatchpointLocation () => SBWatchpointLocation(%p)",
m_opaque_sp.get(), sb_watchpoint_location.get());
}
return sb_watchpoint_location;
}
SBWatchpointLocation
SBTarget::GetWatchpointLocationAtIndex (uint32_t idx) const
{
SBWatchpointLocation sb_watchpoint_location;
SBWatchpoint sb_watchpoint_location;
if (m_opaque_sp)
{
// The watchpoint location list is thread safe, no need to lock
@ -927,7 +906,7 @@ SBTarget::GetWatchpointLocationAtIndex (uint32_t idx) const
}
bool
SBTarget::WatchpointLocationDelete (watch_id_t wp_id)
SBTarget::DeleteWatchpoint (watch_id_t wp_id)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@ -946,29 +925,51 @@ SBTarget::WatchpointLocationDelete (watch_id_t wp_id)
return result;
}
SBWatchpointLocation
SBTarget::FindWatchpointLocationByID (watch_id_t wp_id)
SBWatchpoint
SBTarget::FindWatchpointByID (lldb::watch_id_t wp_id)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBWatchpointLocation sb_watchpoint_location;
SBWatchpoint sb_watchpoint;
if (m_opaque_sp && wp_id != LLDB_INVALID_WATCH_ID)
{
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
*sb_watchpoint_location = m_opaque_sp->GetWatchpointLocationList().FindByID(wp_id);
*sb_watchpoint = m_opaque_sp->GetWatchpointLocationList().FindByID(wp_id);
}
if (log)
{
log->Printf ("SBTarget(%p)::FindWatchpointLocationByID (bp_id=%d) => SBWatchpointLocation(%p)",
m_opaque_sp.get(), (uint32_t) wp_id, sb_watchpoint_location.get());
log->Printf ("SBTarget(%p)::FindWatchpointLocationByID (bp_id=%d) => SBWatchpoint(%p)",
m_opaque_sp.get(), (uint32_t) wp_id, sb_watchpoint.get());
}
return sb_watchpoint_location;
return sb_watchpoint;
}
lldb::SBWatchpoint
SBTarget::WatchAddress (lldb::addr_t addr, size_t size, bool read, bool write)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBWatchpoint sb_watchpoint;
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
// TODO: Johnny fill this in
//*sb_watchpoint = m_opaque_sp->GetWatchpointLocationList().FindByID(wp_id);
}
if (log)
{
log->Printf ("SBTarget(%p)::WatchAddress (addr=0x%llx, 0x%u) => SBWatchpoint(%p)",
m_opaque_sp.get(), addr, (uint32_t) size, sb_watchpoint.get());
}
return sb_watchpoint;
}
bool
SBTarget::EnableAllWatchpointLocations ()
SBTarget::EnableAllWatchpoints ()
{
if (m_opaque_sp)
{
@ -980,7 +981,7 @@ SBTarget::EnableAllWatchpointLocations ()
}
bool
SBTarget::DisableAllWatchpointLocations ()
SBTarget::DisableAllWatchpoints ()
{
if (m_opaque_sp)
{
@ -992,7 +993,7 @@ SBTarget::DisableAllWatchpointLocations ()
}
bool
SBTarget::DeleteAllWatchpointLocations ()
SBTarget::DeleteAllWatchpoints ()
{
if (m_opaque_sp)
{

View File

@ -1097,3 +1097,31 @@ SBValue::GetData ()
return sb_data;
}
lldb::SBWatchpoint
SBValue::Watch (bool resolve_location, bool read, bool write)
{
lldb::SBWatchpoint sb_watchpoint;
Target* target = m_opaque_sp->GetUpdatePoint().GetTargetSP().get();
if (target)
{
Mutex::Locker api_locker (target->GetAPIMutex());
// TODO: Johnny fill this in
}
return sb_watchpoint;
}
lldb::SBWatchpoint
SBValue::WatchPointee (bool resolve_location, bool read, bool write)
{
lldb::SBWatchpoint sb_watchpoint;
Target* target = m_opaque_sp->GetUpdatePoint().GetTargetSP().get();
if (target)
{
Mutex::Locker api_locker (target->GetAPIMutex());
// TODO: Johnny fill this in
}
return sb_watchpoint;
}

View File

@ -1,4 +1,4 @@
//===-- SBWatchpointLocation.cpp --------------------------------*- C++ -*-===//
//===-- SBWatchpoint.cpp --------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
#include "lldb/API/SBWatchpointLocation.h"
#include "lldb/API/SBWatchpoint.h"
#include "lldb/API/SBDefines.h"
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBDebugger.h"
@ -26,12 +26,12 @@ using namespace lldb;
using namespace lldb_private;
SBWatchpointLocation::SBWatchpointLocation () :
SBWatchpoint::SBWatchpoint () :
m_opaque_sp ()
{
}
SBWatchpointLocation::SBWatchpointLocation (const lldb::WatchpointLocationSP &watch_loc_sp) :
SBWatchpoint::SBWatchpoint (const lldb::WatchpointLocationSP &watch_loc_sp) :
m_opaque_sp (watch_loc_sp)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@ -40,18 +40,18 @@ SBWatchpointLocation::SBWatchpointLocation (const lldb::WatchpointLocationSP &wa
{
SBStream sstr;
GetDescription (sstr, lldb::eDescriptionLevelBrief);
log->Printf ("SBWatchpointLocation::SBWatchpointLocation (const lldb::WatchpointLocationsSP &watch_loc_sp"
log->Printf ("SBWatchpoint::SBWatchpoint (const lldb::WatchpointLocationsSP &watch_loc_sp"
"=%p) => this.sp = %p (%s)", watch_loc_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
}
SBWatchpointLocation::SBWatchpointLocation(const SBWatchpointLocation &rhs) :
SBWatchpoint::SBWatchpoint(const SBWatchpoint &rhs) :
m_opaque_sp (rhs.m_opaque_sp)
{
}
const SBWatchpointLocation &
SBWatchpointLocation::operator = (const SBWatchpointLocation &rhs)
const SBWatchpoint &
SBWatchpoint::operator = (const SBWatchpoint &rhs)
{
if (this != &rhs)
m_opaque_sp = rhs.m_opaque_sp;
@ -59,12 +59,12 @@ SBWatchpointLocation::operator = (const SBWatchpointLocation &rhs)
}
SBWatchpointLocation::~SBWatchpointLocation ()
SBWatchpoint::~SBWatchpoint ()
{
}
watch_id_t
SBWatchpointLocation::GetID () const
SBWatchpoint::GetID ()
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@ -75,22 +75,41 @@ SBWatchpointLocation::GetID () const
if (log)
{
if (watch_id == LLDB_INVALID_WATCH_ID)
log->Printf ("SBWatchpointLocation(%p)::GetID () => LLDB_INVALID_WATCH_ID", m_opaque_sp.get());
log->Printf ("SBWatchpoint(%p)::GetID () => LLDB_INVALID_WATCH_ID", m_opaque_sp.get());
else
log->Printf ("SBWatchpointLocation(%p)::GetID () => %u", m_opaque_sp.get(), watch_id);
log->Printf ("SBWatchpoint(%p)::GetID () => %u", m_opaque_sp.get(), watch_id);
}
return watch_id;
}
bool
SBWatchpointLocation::IsValid() const
SBWatchpoint::IsValid() const
{
return m_opaque_sp.get() != NULL;
#if 0
if (m_opaque_sp)
return m_opaque_sp->GetError().Success();
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();
}
#endif
return sb_error;
}
int32_t
SBWatchpointLocation::GetHardwareIndex () const
SBWatchpoint::GetHardwareIndex ()
{
int32_t hw_index = -1;
@ -104,7 +123,7 @@ SBWatchpointLocation::GetHardwareIndex () const
}
addr_t
SBWatchpointLocation::GetWatchAddress () const
SBWatchpoint::GetWatchAddress ()
{
addr_t ret_addr = LLDB_INVALID_ADDRESS;
@ -118,7 +137,7 @@ SBWatchpointLocation::GetWatchAddress () const
}
size_t
SBWatchpointLocation::GetWatchSize () const
SBWatchpoint::GetWatchSize ()
{
size_t watch_size = 0;
@ -132,7 +151,7 @@ SBWatchpointLocation::GetWatchSize () const
}
void
SBWatchpointLocation::SetEnabled (bool enabled)
SBWatchpoint::SetEnabled (bool enabled)
{
if (m_opaque_sp)
{
@ -142,7 +161,7 @@ SBWatchpointLocation::SetEnabled (bool enabled)
}
bool
SBWatchpointLocation::IsEnabled ()
SBWatchpoint::IsEnabled ()
{
if (m_opaque_sp)
{
@ -154,7 +173,7 @@ SBWatchpointLocation::IsEnabled ()
}
uint32_t
SBWatchpointLocation::GetHitCount () const
SBWatchpoint::GetHitCount ()
{
uint32_t count = 0;
if (m_opaque_sp)
@ -165,13 +184,13 @@ SBWatchpointLocation::GetHitCount () const
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
log->Printf ("SBWatchpointLocation(%p)::GetHitCount () => %u", m_opaque_sp.get(), count);
log->Printf ("SBWatchpoint(%p)::GetHitCount () => %u", m_opaque_sp.get(), count);
return count;
}
uint32_t
SBWatchpointLocation::GetIgnoreCount ()
SBWatchpoint::GetIgnoreCount ()
{
if (m_opaque_sp)
{
@ -183,7 +202,7 @@ SBWatchpointLocation::GetIgnoreCount ()
}
void
SBWatchpointLocation::SetIgnoreCount (uint32_t n)
SBWatchpoint::SetIgnoreCount (uint32_t n)
{
if (m_opaque_sp)
{
@ -193,7 +212,7 @@ SBWatchpointLocation::SetIgnoreCount (uint32_t n)
}
bool
SBWatchpointLocation::GetDescription (SBStream &description, DescriptionLevel level)
SBWatchpoint::GetDescription (SBStream &description, DescriptionLevel level)
{
if (m_opaque_sp)
{
@ -209,26 +228,19 @@ SBWatchpointLocation::GetDescription (SBStream &description, DescriptionLevel le
}
lldb_private::WatchpointLocation *
SBWatchpointLocation::operator->() const
SBWatchpoint::operator->()
{
return m_opaque_sp.get();
}
lldb_private::WatchpointLocation *
SBWatchpointLocation::get() const
SBWatchpoint::get()
{
return m_opaque_sp.get();
}
lldb::WatchpointLocationSP &
SBWatchpointLocation::operator *()
SBWatchpoint::operator *()
{
return m_opaque_sp;
}
const lldb::WatchpointLocationSP &
SBWatchpointLocation::operator *() const
{
return m_opaque_sp;
}