[Lldb-commits] [lldb] r140346 - in /lldb/trunk: include/lldb/Interpreter/CommandObject.h include/lldb/lldb-enumerations.h source/Commands/CommandObjectBreakpoint.cpp source/Commands/CommandObjectWatchpoint.cpp source/Interpreter/CommandObject.cpp

Johnny Chen johnny.chen at apple.com
Thu Sep 22 15:34:09 PDT 2011


Author: johnny
Date: Thu Sep 22 17:34:09 2011
New Revision: 140346

URL: http://llvm.org/viewvc/llvm-project?rev=140346&view=rev
Log:
Watchpoint IDs and ID Ranges are not quite the same as Breakpoint IDs and ID Ranges.
Add eArgTypeWatchpointID and eArgTypeWatchpointIDRange to the CommandArgumentType enums and
modify the signature of CommandObject::AddIDsArgumentData() from:

    AddIDsArgumentData(CommandArgumentEntry &arg)

to:

    AddIDsArgumentData(CommandArgumentEntry &arg, CommandArgumentType ID, CommandArgumentType IDRange)

to accommodate.

Modified:
    lldb/trunk/include/lldb/Interpreter/CommandObject.h
    lldb/trunk/include/lldb/lldb-enumerations.h
    lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
    lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
    lldb/trunk/source/Interpreter/CommandObject.cpp

Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=140346&r1=140345&r2=140346&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Thu Sep 22 17:34:09 2011
@@ -365,7 +365,7 @@
     // Helper function to populate IDs or ID ranges as the command argument data
     // to the specified command argument entry.
     static void
-    AddIDsArgumentData(CommandArgumentEntry &arg);
+    AddIDsArgumentData(CommandArgumentEntry &arg, lldb::CommandArgumentType ID, lldb::CommandArgumentType IDRange);
 
 };
 

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=140346&r1=140345&r2=140346&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Thu Sep 22 17:34:09 2011
@@ -408,6 +408,8 @@
         eArgTypeWidth,
         eArgTypeNone,
         eArgTypePlatform,
+        eArgTypeWatchpointID,
+        eArgTypeWatchpointIDRange,
         eArgTypeWatchType,
         eArgTypeLastArg  // Always keep this entry as the last entry in this enumeration!!
     } CommandArgumentType;

Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp?rev=140346&r1=140345&r2=140346&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp Thu Sep 22 17:34:09 2011
@@ -805,7 +805,7 @@
                    NULL)
 {
     CommandArgumentEntry arg;
-    CommandObject::AddIDsArgumentData(arg);
+    CommandObject::AddIDsArgumentData(arg, eArgTypeBreakpointID, eArgTypeBreakpointIDRange);
     // Add the entry for the first argument for this command to the object's arguments vector.
     m_arguments.push_back (arg);   
 }
@@ -906,7 +906,7 @@
                    NULL)
 {
     CommandArgumentEntry arg;
-    CommandObject::AddIDsArgumentData(arg);
+    CommandObject::AddIDsArgumentData(arg, eArgTypeBreakpointID, eArgTypeBreakpointIDRange);
     // Add the entry for the first argument for this command to the object's arguments vector.
     m_arguments.push_back (arg);   
 }
@@ -1187,7 +1187,7 @@
                    NULL)
 {
     CommandArgumentEntry arg;
-    CommandObject::AddIDsArgumentData(arg);
+    CommandObject::AddIDsArgumentData(arg, eArgTypeBreakpointID, eArgTypeBreakpointIDRange);
     // Add the entry for the first argument for this command to the object's arguments vector.
     m_arguments.push_back (arg);   
 }
@@ -1447,7 +1447,7 @@
     m_options (interpreter)
 {
     CommandArgumentEntry arg;
-    CommandObject::AddIDsArgumentData(arg);
+    CommandObject::AddIDsArgumentData(arg, eArgTypeBreakpointID, eArgTypeBreakpointIDRange);
     // Add the entry for the first argument for this command to the object's arguments vector.
     m_arguments.push_back (arg);   
 }

Modified: lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp?rev=140346&r1=140345&r2=140346&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp Thu Sep 22 17:34:09 2011
@@ -251,7 +251,7 @@
     m_options(interpreter)
 {
     CommandArgumentEntry arg;
-    CommandObject::AddIDsArgumentData(arg);
+    CommandObject::AddIDsArgumentData(arg, eArgTypeWatchpointID, eArgTypeWatchpointIDRange);
     // Add the entry for the first argument for this command to the object's arguments vector.
     m_arguments.push_back(arg);
 }
@@ -339,7 +339,7 @@
                   NULL)
 {
     CommandArgumentEntry arg;
-    CommandObject::AddIDsArgumentData(arg);
+    CommandObject::AddIDsArgumentData(arg, eArgTypeWatchpointID, eArgTypeWatchpointIDRange);
     // Add the entry for the first argument for this command to the object's arguments vector.
     m_arguments.push_back(arg);
 }
@@ -411,7 +411,7 @@
                   NULL)
 {
     CommandArgumentEntry arg;
-    CommandObject::AddIDsArgumentData(arg);
+    CommandObject::AddIDsArgumentData(arg, eArgTypeWatchpointID, eArgTypeWatchpointIDRange);
     // Add the entry for the first argument for this command to the object's arguments vector.
     m_arguments.push_back(arg);
 }
@@ -489,7 +489,7 @@
                   NULL)
 {
     CommandArgumentEntry arg;
-    CommandObject::AddIDsArgumentData(arg);
+    CommandObject::AddIDsArgumentData(arg, eArgTypeWatchpointID, eArgTypeWatchpointIDRange);
     // Add the entry for the first argument for this command to the object's arguments vector.
     m_arguments.push_back(arg);
 }

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=140346&r1=140345&r2=140346&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Thu Sep 22 17:34:09 2011
@@ -744,17 +744,17 @@
 }
 
 void
-CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg)
+CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg, CommandArgumentType ID, CommandArgumentType IDRange)
 {
     CommandArgumentData id_arg;
     CommandArgumentData id_range_arg;
 
     // Create the first variant for the first (and only) argument for this command.
-    id_arg.arg_type = eArgTypeBreakpointID;
+    id_arg.arg_type = ID;
     id_arg.arg_repetition = eArgRepeatOptional;
 
     // Create the second variant for the first (and only) argument for this command.
-    id_range_arg.arg_type = eArgTypeBreakpointIDRange;
+    id_range_arg.arg_type = IDRange;
     id_range_arg.arg_repetition = eArgRepeatOptional;
 
     // The first (and only) argument for this command could be either an id or an id_range.
@@ -850,6 +850,8 @@
     { eArgTypeWidth, "width", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." },
     { eArgTypeNone, "none", CommandCompletions::eNoCompletion, { NULL, false }, "No help available for this." },
     { eArgTypePlatform, "platform-name", CommandCompletions::ePlatformPluginCompletion, { NULL, false }, "The name of an installed platform plug-in . Type 'platform list' to see a complete list of installed platforms." },
+    { eArgTypeWatchpointID, "watchpt-id", CommandCompletions::eNoCompletion, { NULL, false }, "Watchpoint IDs are positive integers." },
+    { eArgTypeWatchpointIDRange, "watchpt-id-list", CommandCompletions::eNoCompletion, { NULL, false }, "For example, '1-3' or '1 to 3'." },
     { eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, { NULL, false }, "Specify the type for a watchpoint." }
 };
 





More information about the lldb-commits mailing list