summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/Watchpoint.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-02-25 06:44:30 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-02-25 06:44:30 +0000
commita4d6bc9ff85fc4eb979765f3ea8bd53fa4f3496a (patch)
treee77971ee81cfeb03fe25b40a68bed6f66c4d8e75 /lldb/source/Breakpoint/Watchpoint.cpp
parente06a2c1893a64c50e2f0d9d0ad35a7d6bd639f93 (diff)
downloadbcm5719-llvm-a4d6bc9ff85fc4eb979765f3ea8bd53fa4f3496a.tar.gz
bcm5719-llvm-a4d6bc9ff85fc4eb979765f3ea8bd53fa4f3496a.zip
Make the Watchpoint IDs unique per target, not across targets as before.
Now Each newly created target has its Watchpoint IDs as 1, 2, 3 ... llvm-svn: 151435
Diffstat (limited to 'lldb/source/Breakpoint/Watchpoint.cpp')
-rw-r--r--lldb/source/Breakpoint/Watchpoint.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp
index 02ae8b8b4bc..a0b47568594 100644
--- a/lldb/source/Breakpoint/Watchpoint.cpp
+++ b/lldb/source/Breakpoint/Watchpoint.cpp
@@ -24,9 +24,9 @@ using namespace lldb;
using namespace lldb_private;
Watchpoint::Watchpoint (lldb::addr_t addr, size_t size, bool hardware) :
- StoppointLocation (GetNextID(), addr, size, hardware),
+ StoppointLocation (0, addr, size, hardware),
m_target(NULL),
- m_enabled(0),
+ m_enabled(false),
m_is_hardware(hardware),
m_watch_read(0),
m_watch_write(0),
@@ -36,6 +36,7 @@ Watchpoint::Watchpoint (lldb::addr_t addr, size_t size, bool hardware) :
m_callback(NULL),
m_callback_baton(NULL),
m_decl_str(),
+ m_watch_spec_str(),
m_error()
{
}
@@ -44,13 +45,6 @@ Watchpoint::~Watchpoint()
{
}
-break_id_t
-Watchpoint::GetNextID()
-{
- static break_id_t g_next_ID = 0;
- return ++g_next_ID;
-}
-
bool
Watchpoint::SetCallback (WatchpointHitCallback callback, void *callback_baton)
{
@@ -66,6 +60,13 @@ Watchpoint::SetDeclInfo (std::string &str)
return;
}
+void
+Watchpoint::SetWatchSpec (std::string &str)
+{
+ m_watch_spec_str = str;
+ return;
+}
+
// Override default impl of StoppointLocation::IsHardware() since m_is_hardware
// member field is more accurate.
bool
@@ -117,13 +118,15 @@ Watchpoint::DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) c
GetID(),
GetLoadAddress(),
m_byte_size,
- m_enabled ? "enabled" : "disabled",
+ IsEnabled() ? "enabled" : "disabled",
m_watch_read ? "r" : "",
m_watch_write ? "w" : "");
if (description_level >= lldb::eDescriptionLevelFull) {
if (!m_decl_str.empty())
s->Printf("\n declare @ '%s'", m_decl_str.c_str());
+ if (!m_watch_spec_str.empty())
+ s->Printf("\n static watchpoint spec = '%s'", m_watch_spec_str.c_str());
if (GetConditionText())
s->Printf("\n condition = '%s'", GetConditionText());
}
OpenPOWER on IntegriCloud