Use the "last created watchpoint" rather than asserting on watchpoint commands passing no watchpoint ID.

<rdar://problem/14327560> 

llvm-svn: 185406
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index bed490a..7a6a47e 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -88,10 +88,22 @@
 // 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 @@
         {
             // 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 @@
         {
             // 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 @@
         {
             // 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 @@
         {
             // 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 @@
         {
             // 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 @@
         {
             // 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);