diff options
author | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
commit | 8037fa4ee916fa20b3c63cbf531f4ee7e1c76138 (patch) | |
tree | 3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /tools/lldb-mi/MICmdArgSet.cpp | |
parent | d61b076ede88b56f3372a55e7d1eac6a9d717120 (diff) | |
download | FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.zip FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.tar.gz |
Import LLDB as of upstream SVN 241361 (git 612c075f)
Diffstat (limited to 'tools/lldb-mi/MICmdArgSet.cpp')
-rw-r--r-- | tools/lldb-mi/MICmdArgSet.cpp | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/tools/lldb-mi/MICmdArgSet.cpp b/tools/lldb-mi/MICmdArgSet.cpp index 290f9ee..3d63a61 100644 --- a/tools/lldb-mi/MICmdArgSet.cpp +++ b/tools/lldb-mi/MICmdArgSet.cpp @@ -7,18 +7,6 @@ // //===----------------------------------------------------------------------===// -//++ -// File: MICmdArgSet.cpp -// -// Overview: CMICmdArgSet implementation. -// -// Environment: Compilers: Visual C++ 12. -// gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 -// Libraries: See MIReadmetxt. -// -// Copyright: None. -//-- - // In-house headers: #include "MICmdArgSet.h" #include "MICmdArgValBase.h" @@ -181,28 +169,24 @@ CMICmdArgSet::Validate(const CMIUtilString &vStrMiCmd, CMICmdArgContext &vwCmdAr m_cmdArgContext = vwCmdArgsText; // Iterate all the arguments or options required by a command - const MIuint nArgs = vwCmdArgsText.GetNumberArgsPresent(); - MIuint nArgsMandatoryCnt = 0; SetCmdArgs_t::const_iterator it = m_setCmdArgs.begin(); while (it != m_setCmdArgs.end()) { const CMICmdArgValBase *pArg(*it); - const CMIUtilString &rArgName(pArg->GetName()); - MIunused(rArgName); - if (pArg->GetIsMandatory()) - nArgsMandatoryCnt++; + if (!const_cast<CMICmdArgValBase *>(pArg)->Validate(vwCmdArgsText)) { - if (pArg->GetIsMandatory() && !pArg->GetFound()) - m_setCmdArgsThatAreMissing.push_back(const_cast<CMICmdArgValBase *>(pArg)); - else if (pArg->GetFound()) + if (pArg->GetFound()) { if (pArg->GetIsMissingOptions()) m_setCmdArgsMissingInfo.push_back(const_cast<CMICmdArgValBase *>(pArg)); else if (!pArg->GetValid()) m_setCmdArgsThatNotValid.push_back(const_cast<CMICmdArgValBase *>(pArg)); } + else if (pArg->GetIsMandatory()) + m_setCmdArgsThatAreMissing.push_back(const_cast<CMICmdArgValBase *>(pArg)); } + if (pArg->GetFound() && !pArg->GetIsHandledByCmd()) { m_bIsArgsPresentButNotHandledByCmd = true; @@ -213,14 +197,7 @@ CMICmdArgSet::Validate(const CMIUtilString &vStrMiCmd, CMICmdArgContext &vwCmdAr ++it; } - // Check that one or more argument objects have any issues to report... - - if (nArgs < nArgsMandatoryCnt) - { - SetErrorDescription(CMIUtilString::Format(MIRSRC(IDS_CMD_ARGS_ERR_N_OPTIONS_REQUIRED), nArgsMandatoryCnt)); - return MIstatus::failure; - } - + // report any issues with arguments/options if (IsArgsPresentButNotHandledByCmd()) WarningArgsNotHandledbyCmdLogFile(vStrMiCmd); |