[Lldb-commits] [lldb] r226909 - Fix handling of data-disassemble command arguments.
Deepak Panickal
deepak at codeplay.com
Fri Jan 23 06:31:56 PST 2015
Author: panickal
Date: Fri Jan 23 08:31:56 2015
New Revision: 226909
URL: http://llvm.org/viewvc/llvm-project?rev=226909&view=rev
Log:
Fix handling of data-disassemble command arguments.
Modified:
lldb/trunk/tools/lldb-mi/MICmdArgValConsume.cpp
Modified: lldb/trunk/tools/lldb-mi/MICmdArgValConsume.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValConsume.cpp?rev=226909&r1=226908&r2=226909&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdArgValConsume.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdArgValConsume.cpp Fri Jan 23 08:31:56 2015
@@ -73,31 +73,22 @@ CMICmdArgValConsume::Validate(CMICmdArgC
if (vwArgContext.IsEmpty())
return MIstatus::success;
- if (vwArgContext.GetNumberArgsPresent() == 1)
- {
- const CMIUtilString &rArg(vwArgContext.GetArgsLeftToParse());
- m_bFound = true;
- m_bValid = true;
- vwArgContext.RemoveArg(rArg);
- return MIstatus::success;
- }
-
- // In reality there are more than one option, if so the file option
- // is the last one (don't handle that here - find the best looking one)
+ // Consume the optional file, line, linenum arguments till the mode '--' argument
const CMIUtilString::VecString_t vecOptions(vwArgContext.GetArgs());
CMIUtilString::VecString_t::const_iterator it = vecOptions.begin();
while (it != vecOptions.end())
{
- const CMIUtilString &rTxt(*it);
- m_bFound = true;
-
- if (vwArgContext.RemoveArg(rTxt))
+ const CMIUtilString & rTxt( *it );
+
+ if ( rTxt.compare( "--" ) == 0 )
{
+ m_bFound = true;
m_bValid = true;
- return MIstatus::success;
- }
- else
- return MIstatus::success;
+ return MIstatus::success;
+ }
+
+ if ( !vwArgContext.RemoveArg( rTxt ) )
+ return MIstatus::failure;
// Next
++it;
More information about the lldb-commits
mailing list