diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:53:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:53:01 +0000 |
commit | ead246455adf1a215ec2715dad6533073a6beb4e (patch) | |
tree | f3f97a47d77053bf96fe74cdbd6fae74380e8a92 /tools/lldb-mi/MICmdArgValPrintValues.cpp | |
parent | fdb00c4408990a0a63ef7f496d809ce59f263bc5 (diff) | |
download | src-ead246455adf1a215ec2715dad6533073a6beb4e.tar.gz src-ead246455adf1a215ec2715dad6533073a6beb4e.zip |
Vendor import of stripped lldb trunk r375505, the last commit before thevendor/lldb/lldb-trunk-r375505vendor/lldb
upstream Subversion repository was made read-only, and the LLVM project
migrated to GitHub:
https://llvm.org/svn/llvm-project/lldb/trunk@375505
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=353952
svn path=/vendor/lldb/lldb-r375505/; revision=353953; tag=vendor/lldb/lldb-trunk-r375505
Diffstat (limited to 'tools/lldb-mi/MICmdArgValPrintValues.cpp')
-rw-r--r-- | tools/lldb-mi/MICmdArgValPrintValues.cpp | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/tools/lldb-mi/MICmdArgValPrintValues.cpp b/tools/lldb-mi/MICmdArgValPrintValues.cpp deleted file mode 100644 index a2ce45247375..000000000000 --- a/tools/lldb-mi/MICmdArgValPrintValues.cpp +++ /dev/null @@ -1,125 +0,0 @@ -//===-- MICmdArgValPrintValues.cpp ------------------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// In-house headers: -#include "MICmdArgValPrintValues.h" -#include "MICmdArgContext.h" - -//++ -// Details: CMICmdArgValPrintValues constructor. -// Type: Method. -// Args: None. -// Return: None. -// Throws: None. -//-- -CMICmdArgValPrintValues::CMICmdArgValPrintValues() : m_nPrintValues(0) {} - -//++ -// Details: CMICmdArgValPrintValues constructor. -// Type: Method. -// Args: vrArgName - (R) Argument's name to search by. -// vbMandatory - (R) True = Yes must be present, false = optional -// argument. -// vbHandleByCmd - (R) True = Command processes *this option, false = -// not handled. -// Return: None. -// Throws: None. -//-- -CMICmdArgValPrintValues::CMICmdArgValPrintValues(const CMIUtilString &vrArgName, - const bool vbMandatory, - const bool vbHandleByCmd) - : CMICmdArgValBaseTemplate(vrArgName, vbMandatory, vbHandleByCmd), - m_nPrintValues(0) {} - -//++ -// Details: CMICmdArgValPrintValues destructor. -// Type: Overridden. -// Args: None. -// Return: None. -// Throws: None. -//-- -CMICmdArgValPrintValues::~CMICmdArgValPrintValues() {} - -//++ -// Details: Parse the command's argument options string and try to extract the -// value *this -// argument is looking for. -// Type: Overridden. -// Args: vwArgContext - (RW) The command's argument options string. -// Return: MIstatus::success - Functional succeeded. -// MIstatus::failure - Functional failed. -// Throws: None. -//-- -bool CMICmdArgValPrintValues::Validate(CMICmdArgContext &vwArgContext) { - if (vwArgContext.IsEmpty()) - return m_bMandatory ? MIstatus::failure : MIstatus::success; - - const CMIUtilString strArg(vwArgContext.GetArgs()[0]); - if (IsArgPrintValues(strArg) && ExtractPrintValues(strArg)) { - m_bFound = true; - m_bValid = true; - m_argValue = GetPrintValues(); - vwArgContext.RemoveArg(strArg); - return MIstatus::success; - } - - return MIstatus::failure; -} - -//++ -// Details: Examine the string and determine if it is a valid string type -// argument. -// Type: Method. -// Args: vrTxt - (R) Some text. -// Return: bool - True = yes valid arg, false = no. -// Throws: None. -//-- -bool CMICmdArgValPrintValues::IsArgPrintValues( - const CMIUtilString &vrTxt) const { - return (CMIUtilString::Compare(vrTxt, "0") || - CMIUtilString::Compare(vrTxt, "--no-values") || - CMIUtilString::Compare(vrTxt, "1") || - CMIUtilString::Compare(vrTxt, "--all-values") || - CMIUtilString::Compare(vrTxt, "2") || - CMIUtilString::Compare(vrTxt, "--simple-values")); -} - -//++ -// Details: Extract the print-values from the print-values argument. -// Type: Method. -// Args: vrTxt - (R) Some text. -// Return: MIstatus::success - Functional succeeded. -// MIstatus::failure - Functional failed. -// Throws: None. -//-- -bool CMICmdArgValPrintValues::ExtractPrintValues(const CMIUtilString &vrTxt) { - if (CMIUtilString::Compare(vrTxt, "0") || - CMIUtilString::Compare(vrTxt, "--no-values")) - m_nPrintValues = 0; - else if (CMIUtilString::Compare(vrTxt, "1") || - CMIUtilString::Compare(vrTxt, "--all-values")) - m_nPrintValues = 1; - else if (CMIUtilString::Compare(vrTxt, "2") || - CMIUtilString::Compare(vrTxt, "--simple-values")) - m_nPrintValues = 2; - else - return MIstatus::failure; - - return MIstatus::success; -} - -//++ -// Details: Retrieve the print-values found in the argument. -// Type: Method. -// Args: None. -// Return: MIuint - The print-values. -// Throws: None. -//-- -MIuint CMICmdArgValPrintValues::GetPrintValues() const { - return m_nPrintValues; -} |