summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-09-26 22:40:50 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-09-26 22:40:50 +0000
commit5d0434644c6eb732ffebc7b9a34671dee6b1deae (patch)
tree16ce6cf4b525af47dd59b2fa32be1697373fa74a
parent1db746afbf8c71c5f287722eb229007fc9aa189b (diff)
downloadbcm5719-llvm-5d0434644c6eb732ffebc7b9a34671dee6b1deae.tar.gz
bcm5719-llvm-5d0434644c6eb732ffebc7b9a34671dee6b1deae.zip
Add SB API class SBWatchpointLocation and some extra methods to the SBTarget class to
iterate on the available watchpoint locations and to perform watchpoint manipulations. I still need to export the SBWatchpointLocation class as well as the added watchpoint manipulation methods to the Python interface. And write test cases for them. llvm-svn: 140575
-rw-r--r--lldb/include/lldb/API/SBDefines.h1
-rw-r--r--lldb/include/lldb/API/SBStream.h1
-rw-r--r--lldb/include/lldb/API/SBTarget.h22
-rw-r--r--lldb/include/lldb/API/SBWatchpointLocation.h85
-rw-r--r--lldb/include/lldb/Breakpoint/WatchpointLocation.h7
-rw-r--r--lldb/include/lldb/Breakpoint/WatchpointLocationList.h1
-rw-r--r--lldb/include/lldb/lldb-forward.h1
-rw-r--r--lldb/lldb.xcodeproj/project.pbxproj10
-rw-r--r--lldb/source/API/SBTarget.cpp132
-rw-r--r--lldb/source/API/SBWatchpointLocation.cpp183
-rw-r--r--lldb/source/Breakpoint/WatchpointLocation.cpp1
-rw-r--r--lldb/source/Breakpoint/WatchpointLocationList.cpp1
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp1
-rw-r--r--lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp1
-rw-r--r--lldb/source/Target/StopInfo.cpp1
-rw-r--r--lldb/source/Target/Target.cpp2
16 files changed, 431 insertions, 19 deletions
diff --git a/lldb/include/lldb/API/SBDefines.h b/lldb/include/lldb/API/SBDefines.h
index 5a8b6d1a3ca..5731b91798c 100644
--- a/lldb/include/lldb/API/SBDefines.h
+++ b/lldb/include/lldb/API/SBDefines.h
@@ -63,6 +63,7 @@ class SBType;
class SBTypeList;
class SBValue;
class SBValueList;
+class SBWatchpointLocation;
}
diff --git a/lldb/include/lldb/API/SBStream.h b/lldb/include/lldb/API/SBStream.h
index 3c133423043..22d990e54d4 100644
--- a/lldb/include/lldb/API/SBStream.h
+++ b/lldb/include/lldb/API/SBStream.h
@@ -76,6 +76,7 @@ protected:
friend class SBTarget;
friend class SBThread;
friend class SBValue;
+ friend class SBWatchpointLocation;
friend class SBCommandReturnObject;
#ifndef SWIG
diff --git a/lldb/include/lldb/API/SBTarget.h b/lldb/include/lldb/API/SBTarget.h
index 49760d03ad1..023e5e7a5b6 100644
--- a/lldb/include/lldb/API/SBTarget.h
+++ b/lldb/include/lldb/API/SBTarget.h
@@ -16,6 +16,7 @@
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBFileSpecList.h"
#include "lldb/API/SBType.h"
+#include "lldb/API/SBWatchpointLocation.h"
namespace lldb {
@@ -443,6 +444,27 @@ public:
bool
DeleteAllBreakpoints ();
+ uint32_t
+ GetNumWatchpointLocations () const;
+
+ lldb::SBWatchpointLocation
+ GetWatchpointLocationAtIndex (uint32_t idx) const;
+
+ bool
+ WatchpointLocationDelete (watch_id_t watch_id);
+
+ lldb::SBWatchpointLocation
+ FindWatchpointLocationByID (watch_id_t watch_id);
+
+ bool
+ EnableAllWatchpointLocations ();
+
+ bool
+ DisableAllWatchpointLocations ();
+
+ bool
+ DeleteAllWatchpointLocations ();
+
lldb::SBBroadcaster
GetBroadcaster () const;
diff --git a/lldb/include/lldb/API/SBWatchpointLocation.h b/lldb/include/lldb/API/SBWatchpointLocation.h
new file mode 100644
index 00000000000..37df01658a4
--- /dev/null
+++ b/lldb/include/lldb/API/SBWatchpointLocation.h
@@ -0,0 +1,85 @@
+//===-- SBWatchpointLocation.h ----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBWatchpointLocation_h_
+#define LLDB_SBWatchpointLocation_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+
+class SBWatchpointLocation
+{
+public:
+
+ SBWatchpointLocation ();
+
+ SBWatchpointLocation (const lldb::SBWatchpointLocation &rhs);
+
+ ~SBWatchpointLocation ();
+
+#ifndef SWIG
+ const lldb::SBWatchpointLocation &
+ operator = (const lldb::SBWatchpointLocation &rhs);
+#endif
+
+ bool
+ IsValid() const;
+
+ lldb::addr_t
+ GetWatchAddress () const;
+
+ size_t
+ GetWatchSize() const;
+
+ void
+ SetEnabled(bool enabled);
+
+ bool
+ IsEnabled ();
+
+ uint32_t
+ GetIgnoreCount ();
+
+ void
+ SetIgnoreCount (uint32_t n);
+
+ bool
+ GetDescription (lldb::SBStream &description, DescriptionLevel level);
+
+#ifndef SWIG
+ SBWatchpointLocation (const lldb::WatchpointLocationSP &watch_loc_sp);
+#endif
+
+private:
+ friend class SBTarget;
+
+#ifndef SWIG
+
+ lldb_private::WatchpointLocation *
+ operator->() const;
+
+ lldb_private::WatchpointLocation *
+ get() const;
+
+ lldb::WatchpointLocationSP &
+ operator *();
+
+ const lldb::WatchpointLocationSP &
+ operator *() const;
+
+#endif
+
+ lldb::WatchpointLocationSP m_opaque_sp;
+
+};
+
+} // namespace lldb
+
+#endif // LLDB_SBWatchpointLocation_h_
diff --git a/lldb/include/lldb/Breakpoint/WatchpointLocation.h b/lldb/include/lldb/Breakpoint/WatchpointLocation.h
index e1f4cdc5203..08b9539491c 100644
--- a/lldb/include/lldb/Breakpoint/WatchpointLocation.h
+++ b/lldb/include/lldb/Breakpoint/WatchpointLocation.h
@@ -20,6 +20,7 @@
// Project includes
#include "lldb/lldb-private.h"
+#include "lldb/Target/Target.h"
#include "lldb/Core/UserID.h"
#include "lldb/Breakpoint/StoppointLocation.h"
@@ -56,8 +57,14 @@ public:
void GetDescription (Stream *s, lldb::DescriptionLevel level);
void Dump (Stream *s) const;
void DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const;
+ Target &GetTarget() { return *m_target; }
private:
+ friend class Target;
+
+ 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
diff --git a/lldb/include/lldb/Breakpoint/WatchpointLocationList.h b/lldb/include/lldb/Breakpoint/WatchpointLocationList.h
index 16e865c5c7d..07991593b3c 100644
--- a/lldb/include/lldb/Breakpoint/WatchpointLocationList.h
+++ b/lldb/include/lldb/Breakpoint/WatchpointLocationList.h
@@ -19,7 +19,6 @@
#include "lldb/lldb-private.h"
#include "lldb/Core/Address.h"
#include "lldb/Host/Mutex.h"
-#include "lldb/Breakpoint/WatchpointLocation.h"
namespace lldb_private {
diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h
index 6e6265c718e..9c193c49766 100644
--- a/lldb/include/lldb/lldb-forward.h
+++ b/lldb/include/lldb/lldb-forward.h
@@ -196,6 +196,7 @@ class ValueObjectList;
class Variable;
class VariableList;
class WatchpointLocation;
+class WatchpointLocationList;
struct LineEntry;
} // namespace lldb_private
diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj
index 47f9f2165d3..bc8aacee321 100644
--- a/lldb/lldb.xcodeproj/project.pbxproj
+++ b/lldb/lldb.xcodeproj/project.pbxproj
@@ -450,6 +450,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 */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -1362,6 +1364,8 @@
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>"; };
B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstructionUtils.h; path = Utility/InstructionUtils.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -1832,6 +1836,8 @@
9A19A6AD1163BB9800E0D453 /* SBValue.cpp */,
9A357582116CFDEE00E8ED2F /* SBValueList.h */,
9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */,
+ B2A58723143119D50092BFBA /* SBWatchpointLocation.cpp */,
+ B2A58721143119810092BFBA /* SBWatchpointLocation.h */,
);
name = API;
sourceTree = "<group>";
@@ -2865,9 +2871,10 @@
9A357583116CFDEE00E8ED2F /* SBValueList.h in Headers */,
26D265A2136B40EE002EEE45 /* SharingPtr.h in Headers */,
26D265BC136B4269002EEE45 /* lldb-public.h in Headers */,
- 4CAA56131422D96A001FFA01 /* BreakpointResolverFileRegex.h in Headers */,
4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */,
+ 4CAA56131422D96A001FFA01 /* BreakpointResolverFileRegex.h in Headers */,
26B8283D142D01E9002DBC64 /* SBSection.h in Headers */,
+ B2A58722143119810092BFBA /* SBWatchpointLocation.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3154,6 +3161,7 @@
4CAA56151422D986001FFA01 /* BreakpointResolverFileRegex.cpp in Sources */,
4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */,
26B82840142D020F002DBC64 /* SBSection.cpp in Sources */,
+ B2A58724143119D50092BFBA /* SBWatchpointLocation.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 74580c431e2..fa074b24737 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -766,6 +766,49 @@ SBTarget::BreakpointCreateBySourceRegex (const char *source_regex,
return sb_bp;
}
+uint32_t
+SBTarget::GetNumBreakpoints () const
+{
+ if (m_opaque_sp)
+ {
+ // The breakpoint list is thread safe, no need to lock
+ return m_opaque_sp->GetBreakpointList().GetSize();
+ }
+ return 0;
+}
+
+SBBreakpoint
+SBTarget::GetBreakpointAtIndex (uint32_t idx) const
+{
+ SBBreakpoint sb_breakpoint;
+ if (m_opaque_sp)
+ {
+ // The breakpoint list is thread safe, no need to lock
+ *sb_breakpoint = m_opaque_sp->GetBreakpointList().GetBreakpointAtIndex(idx);
+ }
+ return sb_breakpoint;
+}
+
+bool
+SBTarget::BreakpointDelete (break_id_t bp_id)
+{
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ bool result = false;
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
+ result = m_opaque_sp->RemoveBreakpointByID (bp_id);
+ }
+
+ if (log)
+ {
+ log->Printf ("SBTarget(%p)::BreakpointDelete (bp_id=%d) => %i", m_opaque_sp.get(), (uint32_t) bp_id, result);
+ }
+
+ return result;
+}
+
SBBreakpoint
SBTarget::FindBreakpointByID (break_id_t bp_id)
{
@@ -787,31 +830,67 @@ SBTarget::FindBreakpointByID (break_id_t bp_id)
return sb_breakpoint;
}
+bool
+SBTarget::EnableAllBreakpoints ()
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
+ m_opaque_sp->EnableAllBreakpoints ();
+ return true;
+ }
+ return false;
+}
+
+bool
+SBTarget::DisableAllBreakpoints ()
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
+ m_opaque_sp->DisableAllBreakpoints ();
+ return true;
+ }
+ return false;
+}
+
+bool
+SBTarget::DeleteAllBreakpoints ()
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
+ m_opaque_sp->RemoveAllBreakpoints ();
+ return true;
+ }
+ return false;
+}
+
uint32_t
-SBTarget::GetNumBreakpoints () const
+SBTarget::GetNumWatchpointLocations () const
{
if (m_opaque_sp)
{
// The breakpoint list is thread safe, no need to lock
- return m_opaque_sp->GetBreakpointList().GetSize();
+ return m_opaque_sp->GetWatchpointLocationList().GetSize();
}
return 0;
}
-SBBreakpoint
-SBTarget::GetBreakpointAtIndex (uint32_t idx) const
+SBWatchpointLocation
+SBTarget::GetWatchpointLocationAtIndex (uint32_t idx) const
{
- SBBreakpoint sb_breakpoint;
+ SBWatchpointLocation sb_watchpoint_location;
if (m_opaque_sp)
{
// The breakpoint list is thread safe, no need to lock
- *sb_breakpoint = m_opaque_sp->GetBreakpointList().GetBreakpointAtIndex(idx);
+ *sb_watchpoint_location = m_opaque_sp->GetWatchpointLocationList().GetByIndex(idx);
}
- return sb_breakpoint;
+ return sb_watchpoint_location;
}
bool
-SBTarget::BreakpointDelete (break_id_t bp_id)
+SBTarget::WatchpointLocationDelete (watch_id_t wp_id)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -819,48 +898,69 @@ SBTarget::BreakpointDelete (break_id_t bp_id)
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
- result = m_opaque_sp->RemoveBreakpointByID (bp_id);
+ result = m_opaque_sp->RemoveWatchpointLocationByID (wp_id);
}
if (log)
{
- log->Printf ("SBTarget(%p)::BreakpointDelete (bp_id=%d) => %i", m_opaque_sp.get(), (uint32_t) bp_id, result);
+ log->Printf ("SBTarget(%p)::WatchpointLocationDelete (wp_id=%d) => %i", m_opaque_sp.get(), (uint32_t) wp_id, result);
}
return result;
}
+SBWatchpointLocation
+SBTarget::FindWatchpointLocationByID (watch_id_t wp_id)
+{
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ SBWatchpointLocation sb_watchpoint_location;
+ 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);
+ }
+
+ if (log)
+ {
+ log->Printf ("SBTarget(%p)::FindWatchpointLocationByID (bp_id=%d) => SBWatchpointLocation(%p)",
+ m_opaque_sp.get(), (uint32_t) wp_id, sb_watchpoint_location.get());
+ }
+
+ return sb_watchpoint_location;
+}
+
bool
-SBTarget::EnableAllBreakpoints ()
+SBTarget::EnableAllWatchpointLocations ()
{
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
- m_opaque_sp->EnableAllBreakpoints ();
+ m_opaque_sp->EnableAllWatchpointLocations ();
return true;
}
return false;
}
bool
-SBTarget::DisableAllBreakpoints ()
+SBTarget::DisableAllWatchpointLocations ()
{
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
- m_opaque_sp->DisableAllBreakpoints ();
+ m_opaque_sp->DisableAllWatchpointLocations ();
return true;
}
return false;
}
bool
-SBTarget::DeleteAllBreakpoints ()
+SBTarget::DeleteAllWatchpointLocations ()
{
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
- m_opaque_sp->RemoveAllBreakpoints ();
+ m_opaque_sp->RemoveAllWatchpointLocations ();
return true;
}
return false;
diff --git a/lldb/source/API/SBWatchpointLocation.cpp b/lldb/source/API/SBWatchpointLocation.cpp
new file mode 100644
index 00000000000..b0e3eb827b8
--- /dev/null
+++ b/lldb/source/API/SBWatchpointLocation.cpp
@@ -0,0 +1,183 @@
+//===-- SBWatchpointLocation.cpp --------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/API/SBWatchpointLocation.h"
+#include "lldb/API/SBDefines.h"
+#include "lldb/API/SBAddress.h"
+#include "lldb/API/SBDebugger.h"
+#include "lldb/API/SBStream.h"
+
+#include "lldb/lldb-types.h"
+#include "lldb/lldb-defines.h"
+#include "lldb/Breakpoint/WatchpointLocation.h"
+#include "lldb/Breakpoint/WatchpointLocationList.h"
+#include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
+#include "lldb/Core/StreamFile.h"
+#include "lldb/Target/Target.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+
+SBWatchpointLocation::SBWatchpointLocation () :
+ m_opaque_sp ()
+{
+}
+
+SBWatchpointLocation::SBWatchpointLocation (const lldb::WatchpointLocationSP &watch_loc_sp) :
+ m_opaque_sp (watch_loc_sp)
+{
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ if (log)
+ {
+ SBStream sstr;
+ GetDescription (sstr, lldb::eDescriptionLevelBrief);
+ log->Printf ("SBWatchpointLocation::SBWatchpointLocation (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) :
+ m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+const SBWatchpointLocation &
+SBWatchpointLocation::operator = (const SBWatchpointLocation &rhs)
+{
+ if (this != &rhs)
+ m_opaque_sp = rhs.m_opaque_sp;
+ return *this;
+}
+
+
+SBWatchpointLocation::~SBWatchpointLocation ()
+{
+}
+
+bool
+SBWatchpointLocation::IsValid() const
+{
+ return m_opaque_sp.get() != NULL;
+}
+
+addr_t
+SBWatchpointLocation::GetWatchAddress () const
+{
+ addr_t ret_addr = LLDB_INVALID_ADDRESS;
+
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ ret_addr = m_opaque_sp->GetLoadAddress();
+ }
+
+ return ret_addr;
+}
+
+size_t
+SBWatchpointLocation::GetWatchSize () const
+{
+ size_t watch_size = 0;
+
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ watch_size = m_opaque_sp->GetByteSize();
+ }
+
+ return watch_size;
+}
+
+void
+SBWatchpointLocation::SetEnabled (bool enabled)
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetEnabled (enabled);
+ }
+}
+
+bool
+SBWatchpointLocation::IsEnabled ()
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->IsEnabled();
+ }
+ else
+ return false;
+}
+
+uint32_t
+SBWatchpointLocation::GetIgnoreCount ()
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetIgnoreCount();
+ }
+ else
+ return 0;
+}
+
+void
+SBWatchpointLocation::SetIgnoreCount (uint32_t n)
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetIgnoreCount (n);
+ }
+}
+
+bool
+SBWatchpointLocation::GetDescription (SBStream &description, DescriptionLevel level)
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ description.ref();
+ m_opaque_sp->GetDescription (description.get(), level);
+ description.get()->EOL();
+ }
+ else
+ description.Printf ("No value");
+
+ return true;
+}
+
+lldb_private::WatchpointLocation *
+SBWatchpointLocation::operator->() const
+{
+ return m_opaque_sp.get();
+}
+
+lldb_private::WatchpointLocation *
+SBWatchpointLocation::get() const
+{
+ return m_opaque_sp.get();
+}
+
+lldb::WatchpointLocationSP &
+SBWatchpointLocation::operator *()
+{
+ return m_opaque_sp;
+}
+
+const lldb::WatchpointLocationSP &
+SBWatchpointLocation::operator *() const
+{
+ return m_opaque_sp;
+}
+
diff --git a/lldb/source/Breakpoint/WatchpointLocation.cpp b/lldb/source/Breakpoint/WatchpointLocation.cpp
index a0bbc037d5c..6b2785a22b3 100644
--- a/lldb/source/Breakpoint/WatchpointLocation.cpp
+++ b/lldb/source/Breakpoint/WatchpointLocation.cpp
@@ -20,6 +20,7 @@ using namespace lldb_private;
WatchpointLocation::WatchpointLocation (lldb::addr_t addr, size_t size, bool hardware) :
StoppointLocation (GetNextID(), addr, size, hardware),
+ m_target(NULL),
m_enabled(0),
m_is_hardware(hardware),
m_watch_read(0),
diff --git a/lldb/source/Breakpoint/WatchpointLocationList.cpp b/lldb/source/Breakpoint/WatchpointLocationList.cpp
index ac466fa4f02..b2ff26663a1 100644
--- a/lldb/source/Breakpoint/WatchpointLocationList.cpp
+++ b/lldb/source/Breakpoint/WatchpointLocationList.cpp
@@ -14,7 +14,6 @@
// Project includes
#include "lldb/Breakpoint/WatchpointLocationList.h"
#include "lldb/Breakpoint/WatchpointLocation.h"
-#include "lldb/Target/Target.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 555afc3491e..d1a9e8715ec 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -14,6 +14,7 @@
#include <string>
// Other libraries and framework includes
// Project includes
+#include "lldb/Breakpoint/WatchpointLocation.h"
#include "lldb/Core/DataVisualization.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
index b62c0c340b2..637835010fd 100644
--- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
+++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
@@ -13,6 +13,7 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Breakpoint/WatchpointLocation.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Target/Process.h"
diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp
index 78eed6fe0f6..b66e2da0565 100644
--- a/lldb/source/Target/StopInfo.cpp
+++ b/lldb/source/Target/StopInfo.cpp
@@ -19,6 +19,7 @@
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
+#include "lldb/Breakpoint/WatchpointLocation.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Expression/ClangUserExpression.h"
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 60831baae05..6a742c28e59 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -18,6 +18,7 @@
#include "lldb/Breakpoint/BreakpointResolverFileLine.h"
#include "lldb/Breakpoint/BreakpointResolverFileRegex.h"
#include "lldb/Breakpoint/BreakpointResolverName.h"
+#include "lldb/Breakpoint/WatchpointLocation.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Event.h"
#include "lldb/Core/Log.h"
@@ -439,6 +440,7 @@ Target::CreateWatchpointLocation(lldb::addr_t addr, size_t size, uint32_t type)
return wp_loc_sp;
}
new_loc->SetWatchpointType(type);
+ new_loc->SetTarget(this);
wp_loc_sp.reset(new_loc);
m_watchpoint_location_list.Add(wp_loc_sp);
}
OpenPOWER on IntegriCloud