aboutsummaryrefslogtreecommitdiff
path: root/tools/lldb-mi/MICmdArgValConsume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lldb-mi/MICmdArgValConsume.cpp')
-rw-r--r--tools/lldb-mi/MICmdArgValConsume.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/tools/lldb-mi/MICmdArgValConsume.cpp b/tools/lldb-mi/MICmdArgValConsume.cpp
index 3a01db4bc4f8..041005567393 100644
--- a/tools/lldb-mi/MICmdArgValConsume.cpp
+++ b/tools/lldb-mi/MICmdArgValConsume.cpp
@@ -73,31 +73,22 @@ CMICmdArgValConsume::Validate(CMICmdArgContext &vwArgContext)
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;