summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectWatchpoint.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2013-07-02 02:09:46 +0000
committerJim Ingham <jingham@apple.com>2013-07-02 02:09:46 +0000
commitb0b4513ea2c1081f489c6a29f614aa511909ba43 (patch)
tree0fd8ca84ec222b925420299b4bf2d5cc5523bf9e /lldb/source/Commands/CommandObjectWatchpoint.cpp
parent92821745bf3656ef88b476cb99da93c48d7bc609 (diff)
downloadbcm5719-llvm-b0b4513ea2c1081f489c6a29f614aa511909ba43.tar.gz
bcm5719-llvm-b0b4513ea2c1081f489c6a29f614aa511909ba43.zip
Use the "last created watchpoint" rather than asserting on watchpoint commands passing no watchpoint ID.
<rdar://problem/14327560> llvm-svn: 185406
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index bed490a7aa2..7a6a47e60d0 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -88,10 +88,22 @@ WithRSAIndex(llvm::StringRef &Arg)
// Return true if wp_ids is successfully populated with the watch ids.
// False otherwise.
bool
-CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(Args &args, std::vector<uint32_t> &wp_ids)
+CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(Target *target, Args &args, std::vector<uint32_t> &wp_ids)
{
// Pre-condition: args.GetArgumentCount() > 0.
- assert(args.GetArgumentCount() > 0);
+ if (args.GetArgumentCount() == 0)
+ {
+ if (target == NULL)
+ return false;
+ WatchpointSP watch_sp = target->GetLastCreatedWatchpoint();
+ if (watch_sp)
+ {
+ wp_ids.push_back(watch_sp->GetID());
+ return true;
+ }
+ else
+ return false;
+ }
llvm::StringRef Minus("-");
std::vector<llvm::StringRef> StrRefArgs;
@@ -292,7 +304,7 @@ protected:
{
// Particular watchpoints selected; enable them.
std::vector<uint32_t> wp_ids;
- if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(command, wp_ids))
+ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, wp_ids))
{
result.AppendError("Invalid watchpoints specification.");
result.SetStatus(eReturnStatusFailed);
@@ -392,7 +404,7 @@ protected:
{
// Particular watchpoints selected; enable them.
std::vector<uint32_t> wp_ids;
- if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(command, wp_ids))
+ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, wp_ids))
{
result.AppendError("Invalid watchpoints specification.");
result.SetStatus(eReturnStatusFailed);
@@ -477,7 +489,7 @@ protected:
{
// Particular watchpoints selected; disable them.
std::vector<uint32_t> wp_ids;
- if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(command, wp_ids))
+ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, wp_ids))
{
result.AppendError("Invalid watchpoints specification.");
result.SetStatus(eReturnStatusFailed);
@@ -560,7 +572,7 @@ protected:
{
// Particular watchpoints selected; delete them.
std::vector<uint32_t> wp_ids;
- if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(command, wp_ids))
+ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, wp_ids))
{
result.AppendError("Invalid watchpoints specification.");
result.SetStatus(eReturnStatusFailed);
@@ -701,7 +713,7 @@ protected:
{
// Particular watchpoints selected; ignore them.
std::vector<uint32_t> wp_ids;
- if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(command, wp_ids))
+ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, wp_ids))
{
result.AppendError("Invalid watchpoints specification.");
result.SetStatus(eReturnStatusFailed);
@@ -858,7 +870,7 @@ protected:
{
// Particular watchpoints selected; set condition on them.
std::vector<uint32_t> wp_ids;
- if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(command, wp_ids))
+ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, wp_ids))
{
result.AppendError("Invalid watchpoints specification.");
result.SetStatus(eReturnStatusFailed);
OpenPOWER on IntegriCloud