summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectWatchpoint.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-10-14 00:42:25 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-10-14 00:42:25 +0000
commit01a678603a0d39a52eff956b5eb5a83ccb7a9fa3 (patch)
tree093d868ffa0030e5ba0e2072501cfd068766826e /lldb/source/Commands/CommandObjectWatchpoint.cpp
parenteafa9d50c2be7900d3cab2079123f1e91a54bcbd (diff)
downloadbcm5719-llvm-01a678603a0d39a52eff956b5eb5a83ccb7a9fa3.tar.gz
bcm5719-llvm-01a678603a0d39a52eff956b5eb5a83ccb7a9fa3.zip
SBValue::Watch() and SBValue::WatchPointee() are now the official API for creating
a watchpoint for either the variable encapsulated by SBValue (Watch) or the pointee encapsulated by SBValue (WatchPointee). Removed SBFrame::WatchValue() and SBFrame::WatchLocation() API as a result of that. Modified the watchpoint related test suite to reflect the change. Plus replacing WatchpointLocation with Watchpoint throughout the code base. There are still cleanups to be dome. This patch passes the whole test suite. Check it in so that we aggressively catch regressions. llvm-svn: 141925
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index 7c07a03eb85..02b43a31073 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -13,8 +13,8 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Breakpoint/WatchpointLocation.h"
-#include "lldb/Breakpoint/WatchpointLocationList.h"
+#include "lldb/Breakpoint/Watchpoint.h"
+#include "lldb/Breakpoint/WatchpointList.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -27,10 +27,10 @@ using namespace lldb;
using namespace lldb_private;
static void
-AddWatchpointDescription(Stream *s, WatchpointLocation *wp_loc, lldb::DescriptionLevel level)
+AddWatchpointDescription(Stream *s, Watchpoint *wp, lldb::DescriptionLevel level)
{
s->IndentMore();
- wp_loc->GetDescription(s, level);
+ wp->GetDescription(s, level);
s->IndentLess();
s->EOL();
}
@@ -280,9 +280,9 @@ CommandObjectWatchpointList::Execute(Args& args, CommandReturnObject &result)
return true;
}
- const WatchpointLocationList &watchpoints = target->GetWatchpointLocationList();
+ const WatchpointList &watchpoints = target->GetWatchpointList();
Mutex::Locker locker;
- target->GetWatchpointLocationList().GetListMutex(locker);
+ target->GetWatchpointList().GetListMutex(locker);
size_t num_watchpoints = watchpoints.GetSize();
@@ -301,8 +301,8 @@ CommandObjectWatchpointList::Execute(Args& args, CommandReturnObject &result)
result.AppendMessage ("Current watchpoints:");
for (size_t i = 0; i < num_watchpoints; ++i)
{
- WatchpointLocation *wp_loc = watchpoints.GetByIndex(i).get();
- AddWatchpointDescription(&output_stream, wp_loc, m_options.m_level);
+ Watchpoint *wp = watchpoints.GetByIndex(i).get();
+ AddWatchpointDescription(&output_stream, wp, m_options.m_level);
}
result.SetStatus(eReturnStatusSuccessFinishNoResult);
}
@@ -320,9 +320,9 @@ CommandObjectWatchpointList::Execute(Args& args, CommandReturnObject &result)
const size_t size = wp_ids.size();
for (size_t i = 0; i < size; ++i)
{
- WatchpointLocation *wp_loc = watchpoints.FindByID(wp_ids[i]).get();
- if (wp_loc)
- AddWatchpointDescription(&output_stream, wp_loc, m_options.m_level);
+ Watchpoint *wp = watchpoints.FindByID(wp_ids[i]).get();
+ if (wp)
+ AddWatchpointDescription(&output_stream, wp, m_options.m_level);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
}
}
@@ -359,9 +359,9 @@ CommandObjectWatchpointEnable::Execute(Args& args, CommandReturnObject &result)
return false;
Mutex::Locker locker;
- target->GetWatchpointLocationList().GetListMutex(locker);
+ target->GetWatchpointList().GetListMutex(locker);
- const WatchpointLocationList &watchpoints = target->GetWatchpointLocationList();
+ const WatchpointList &watchpoints = target->GetWatchpointList();
size_t num_watchpoints = watchpoints.GetSize();
@@ -375,7 +375,7 @@ CommandObjectWatchpointEnable::Execute(Args& args, CommandReturnObject &result)
if (args.GetArgumentCount() == 0)
{
// No watchpoint selected; enable all currently set watchpoints.
- target->EnableAllWatchpointLocations();
+ target->EnableAllWatchpoints();
result.AppendMessageWithFormat("All watchpoints enabled. (%lu watchpoints)\n", num_watchpoints);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
}
@@ -393,7 +393,7 @@ CommandObjectWatchpointEnable::Execute(Args& args, CommandReturnObject &result)
int count = 0;
const size_t size = wp_ids.size();
for (size_t i = 0; i < size; ++i)
- if (target->EnableWatchpointLocationByID(wp_ids[i]))
+ if (target->EnableWatchpointByID(wp_ids[i]))
++count;
result.AppendMessageWithFormat("%d watchpoints enabled.\n", count);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
@@ -431,9 +431,9 @@ CommandObjectWatchpointDisable::Execute(Args& args, CommandReturnObject &result)
return false;
Mutex::Locker locker;
- target->GetWatchpointLocationList().GetListMutex(locker);
+ target->GetWatchpointList().GetListMutex(locker);
- const WatchpointLocationList &watchpoints = target->GetWatchpointLocationList();
+ const WatchpointList &watchpoints = target->GetWatchpointList();
size_t num_watchpoints = watchpoints.GetSize();
if (num_watchpoints == 0)
@@ -446,7 +446,7 @@ CommandObjectWatchpointDisable::Execute(Args& args, CommandReturnObject &result)
if (args.GetArgumentCount() == 0)
{
// No watchpoint selected; disable all currently set watchpoints.
- if (target->DisableAllWatchpointLocations())
+ if (target->DisableAllWatchpoints())
{
result.AppendMessageWithFormat("All watchpoints disabled. (%lu watchpoints)\n", num_watchpoints);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
@@ -471,7 +471,7 @@ CommandObjectWatchpointDisable::Execute(Args& args, CommandReturnObject &result)
int count = 0;
const size_t size = wp_ids.size();
for (size_t i = 0; i < size; ++i)
- if (target->DisableWatchpointLocationByID(wp_ids[i]))
+ if (target->DisableWatchpointByID(wp_ids[i]))
++count;
result.AppendMessageWithFormat("%d watchpoints disabled.\n", count);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
@@ -509,9 +509,9 @@ CommandObjectWatchpointDelete::Execute(Args& args, CommandReturnObject &result)
return false;
Mutex::Locker locker;
- target->GetWatchpointLocationList().GetListMutex(locker);
+ target->GetWatchpointList().GetListMutex(locker);
- const WatchpointLocationList &watchpoints = target->GetWatchpointLocationList();
+ const WatchpointList &watchpoints = target->GetWatchpointList();
size_t num_watchpoints = watchpoints.GetSize();
@@ -530,7 +530,7 @@ CommandObjectWatchpointDelete::Execute(Args& args, CommandReturnObject &result)
}
else
{
- target->RemoveAllWatchpointLocations();
+ target->RemoveAllWatchpoints();
result.AppendMessageWithFormat("All watchpoints removed. (%lu watchpoints)\n", num_watchpoints);
}
result.SetStatus (eReturnStatusSuccessFinishNoResult);
@@ -549,7 +549,7 @@ CommandObjectWatchpointDelete::Execute(Args& args, CommandReturnObject &result)
int count = 0;
const size_t size = wp_ids.size();
for (size_t i = 0; i < size; ++i)
- if (target->RemoveWatchpointLocationByID(wp_ids[i]))
+ if (target->RemoveWatchpointByID(wp_ids[i]))
++count;
result.AppendMessageWithFormat("%d watchpoints deleted.\n",count);
result.SetStatus (eReturnStatusSuccessFinishNoResult);
@@ -651,9 +651,9 @@ CommandObjectWatchpointIgnore::Execute(Args& args, CommandReturnObject &result)
return false;
Mutex::Locker locker;
- target->GetWatchpointLocationList().GetListMutex(locker);
+ target->GetWatchpointList().GetListMutex(locker);
- const WatchpointLocationList &watchpoints = target->GetWatchpointLocationList();
+ const WatchpointList &watchpoints = target->GetWatchpointList();
size_t num_watchpoints = watchpoints.GetSize();
@@ -666,7 +666,7 @@ CommandObjectWatchpointIgnore::Execute(Args& args, CommandReturnObject &result)
if (args.GetArgumentCount() == 0)
{
- target->IgnoreAllWatchpointLocations(m_options.m_ignore_count);
+ target->IgnoreAllWatchpoints(m_options.m_ignore_count);
result.AppendMessageWithFormat("All watchpoints ignored. (%lu watchpoints)\n", num_watchpoints);
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
@@ -684,7 +684,7 @@ CommandObjectWatchpointIgnore::Execute(Args& args, CommandReturnObject &result)
int count = 0;
const size_t size = wp_ids.size();
for (size_t i = 0; i < size; ++i)
- if (target->IgnoreWatchpointLocationByID(wp_ids[i], m_options.m_ignore_count))
+ if (target->IgnoreWatchpointByID(wp_ids[i], m_options.m_ignore_count))
++count;
result.AppendMessageWithFormat("%d watchpoints ignored.\n",count);
result.SetStatus (eReturnStatusSuccessFinishNoResult);
OpenPOWER on IntegriCloud