[Lldb-commits] [PATCH] D14197: Handle the option and parameter separator in every command.

Hafiz Abid Qadeer via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 30 04:33:46 PDT 2015


abidh created this revision.
abidh added a reviewer: ki.stfu.
abidh added a subscriber: lldb-commits.

As per the following link, the "--" as separator between options and
parameter can come in any command. Currently, it was being handled in
only one command. I have moved into the base so that any command can
have this separator.

https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax

http://reviews.llvm.org/D14197

Files:
  tools/lldb-mi/MICmdBase.cpp
  tools/lldb-mi/MICmdBase.h
  tools/lldb-mi/MICmdCmdData.cpp
  tools/lldb-mi/MICmdCmdData.h

Index: tools/lldb-mi/MICmdCmdData.h
===================================================================
--- tools/lldb-mi/MICmdCmdData.h
+++ tools/lldb-mi/MICmdCmdData.h
@@ -106,7 +106,6 @@
   private:
     const CMIUtilString m_constStrArgAddrStart; // MI spec non mandatory, *this command mandatory
     const CMIUtilString m_constStrArgAddrEnd;   // MI spec non mandatory, *this command mandatory
-    const CMIUtilString m_constStrArgConsume;
     const CMIUtilString m_constStrArgMode;
     CMICmnMIValueList m_miValueList;
 };
Index: tools/lldb-mi/MICmdCmdData.cpp
===================================================================
--- tools/lldb-mi/MICmdCmdData.cpp
+++ tools/lldb-mi/MICmdCmdData.cpp
@@ -239,7 +239,6 @@
 CMICmdCmdDataDisassemble::CMICmdCmdDataDisassemble()
     : m_constStrArgAddrStart("s")
     , m_constStrArgAddrEnd("e")
-    , m_constStrArgConsume("--")
     , m_constStrArgMode("mode")
     , m_miValueList(true)
 {
@@ -277,7 +276,6 @@
         new CMICmdArgValOptionShort(m_constStrArgAddrStart, true, true, CMICmdArgValListBase::eArgValType_StringQuotedNumber, 1));
     m_setCmdArgs.Add(
         new CMICmdArgValOptionShort(m_constStrArgAddrEnd, true, true, CMICmdArgValListBase::eArgValType_StringQuotedNumber, 1));
-    m_setCmdArgs.Add(new CMICmdArgValConsume(m_constStrArgConsume, true));
     m_setCmdArgs.Add(new CMICmdArgValNumber(m_constStrArgMode, true, true));
     return ParseValidateCmdOptions();
 }
Index: tools/lldb-mi/MICmdBase.h
===================================================================
--- tools/lldb-mi/MICmdBase.h
+++ tools/lldb-mi/MICmdBase.h
@@ -98,6 +98,7 @@
     const CMIUtilString m_constStrArgThreadGroup;
     const CMIUtilString m_constStrArgThread;
     const CMIUtilString m_constStrArgFrame;
+    const CMIUtilString m_constStrArgConsume;
 
     // These 3 members can be used by the derived classes to make any of
     // "thread", "frame" or "thread-group" mandatory.
Index: tools/lldb-mi/MICmdBase.cpp
===================================================================
--- tools/lldb-mi/MICmdBase.cpp
+++ tools/lldb-mi/MICmdBase.cpp
@@ -12,6 +12,7 @@
 #include "MICmnMIValueConst.h"
 #include "MICmnLLDBDebugSessionInfo.h"
 #include "MICmdArgValOptionLong.h"
+#include "MICmdArgValConsume.h"
 
 //++ ------------------------------------------------------------------------------------
 // Details: CMICmdBase constructor.
@@ -27,6 +28,7 @@
     , m_constStrArgThreadGroup("thread-group")
     , m_constStrArgThread("thread")
     , m_constStrArgFrame("frame")
+    , m_constStrArgConsume("--")
     , m_ThreadGrpArgMandatory(false)
     , m_ThreadArgMandatory(false)
     , m_FrameArgMandatory(false)
@@ -97,6 +99,7 @@
     m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgThreadGroup, m_ThreadGrpArgMandatory, true, CMICmdArgValListBase::eArgValType_ThreadGrp, 1));
     m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgThread, m_ThreadArgMandatory, true, CMICmdArgValListBase::eArgValType_Number, 1));
     m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgFrame, m_FrameArgMandatory, true, CMICmdArgValListBase::eArgValType_Number, 1));
+    m_setCmdArgs.Add(new CMICmdArgValConsume(m_constStrArgConsume, false));
 }
 
 //++ ------------------------------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14197.38792.patch
Type: text/x-patch
Size: 3318 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151030/8bbc44d8/attachment-0001.bin>


More information about the lldb-commits mailing list