[Lldb-commits] [PATCH] D14197: Handle the options and parameters separator in every MI command
Hafiz Abid Qadeer via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 2 02:06:28 PST 2015
abidh updated this revision to Diff 38879.
abidh added a comment.
Handled review comment.
Added a test for -data-disassemble without "--" separator.
http://reviews.llvm.org/D14197
Files:
packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
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));
}
//++ ------------------------------------------------------------------------------------
Index: packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
===================================================================
--- packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
@@ -40,6 +40,10 @@
# Test -data-disassemble: try to disassemble some address
self.runCmd("-data-disassemble -s %#x -e %#x -- 0" % (addr, addr + 0x10))
self.expect("\^done,asm_insns=\[{address=\"0x0*%x\",func-name=\"main\",offset=\"0\",size=\"[1-9]+\",inst=\".+?\"}," % addr)
+
+ # Test -data-disassemble without "--"
+ self.runCmd("-data-disassemble -s %#x -e %#x 0" % (addr, addr + 0x10))
+ self.expect("\^done,asm_insns=\[{address=\"0x0*%x\",func-name=\"main\",offset=\"0\",size=\"[1-9]+\",inst=\".+?\"}," % addr)
# Run to hello_world
self.runCmd("-break-insert -f hello_world")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14197.38879.patch
Type: text/x-patch
Size: 4250 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151102/e568aa26/attachment.bin>
More information about the lldb-commits
mailing list