003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/source/Interpreter
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
source
/
Interpreter
/
📁
..
📄
CommandAlias.cpp
(7.86 KB)
📄
CommandHistory.cpp
(3 KB)
📄
CommandInterpreter.cpp
(115 KB)
📄
CommandObject.cpp
(51.13 KB)
📄
CommandObjectRegexCommand.cpp
(3.78 KB)
📄
CommandObjectScript.cpp
(2.37 KB)
📄
CommandObjectScript.h
(966 B)
📄
CommandOptionValidators.cpp
(1.14 KB)
📄
CommandReturnObject.cpp
(5.06 KB)
📄
InterpreterProperties.td
(1.32 KB)
📄
OptionArgParser.cpp
(7.56 KB)
📄
OptionGroupArchitecture.cpp
(1.8 KB)
📄
OptionGroupBoolean.cpp
(2.22 KB)
📄
OptionGroupFile.cpp
(2.92 KB)
📄
OptionGroupFormat.cpp
(8.4 KB)
📄
OptionGroupOutputFile.cpp
(1.9 KB)
📄
OptionGroupPlatform.cpp
(4.6 KB)
📄
OptionGroupPythonClassWithDict.cpp
(5.51 KB)
📄
OptionGroupString.cpp
(1.88 KB)
📄
OptionGroupUInt64.cpp
(1.87 KB)
📄
OptionGroupUUID.cpp
(1.51 KB)
📄
OptionGroupValueObjectDisplay.cpp
(7.67 KB)
📄
OptionGroupVariable.cpp
(5.05 KB)
📄
OptionGroupWatchpoint.cpp
(3.19 KB)
📄
OptionValue.cpp
(17.49 KB)
📄
OptionValueArch.cpp
(2.39 KB)
📄
OptionValueArgs.cpp
(769 B)
📄
OptionValueArray.cpp
(9.99 KB)
📄
OptionValueBoolean.cpp
(2.8 KB)
📄
OptionValueChar.cpp
(1.85 KB)
📄
OptionValueDictionary.cpp
(10.06 KB)
📄
OptionValueEnumeration.cpp
(3.94 KB)
📄
OptionValueFileSpec.cpp
(4.28 KB)
📄
OptionValueFileSpecList.cpp
(5.38 KB)
📄
OptionValueFormat.cpp
(1.89 KB)
📄
OptionValueFormatEntity.cpp
(4.02 KB)
📄
OptionValueLanguage.cpp
(2.53 KB)
📄
OptionValuePathMappings.cpp
(6.95 KB)
📄
OptionValueProperties.cpp
(22.56 KB)
📄
OptionValueRegex.cpp
(1.95 KB)
📄
OptionValueSInt64.cpp
(2.48 KB)
📄
OptionValueString.cpp
(4.3 KB)
📄
OptionValueUInt64.cpp
(2.3 KB)
📄
OptionValueUUID.cpp
(2.66 KB)
📄
Options.cpp
(47.68 KB)
📄
Property.cpp
(11 KB)
📄
ScriptInterpreter.cpp
(7.53 KB)
📄
embedded_interpreter.py
(4.31 KB)
Editing: OptionGroupVariable.cpp
//===-- OptionGroupVariable.cpp -------------------------------------------===// // // 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 // //===----------------------------------------------------------------------===// #include "lldb/Interpreter/OptionGroupVariable.h" #include "lldb/DataFormatters/DataVisualization.h" #include "lldb/Host/OptionParser.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Target/Target.h" #include "lldb/Utility/Status.h" using namespace lldb; using namespace lldb_private; // if you add any options here, remember to update the counters in // OptionGroupVariable::GetNumDefinitions() static constexpr OptionDefinition g_variable_options[] = { {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-args", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Omit function arguments."}, {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-recognized-args", 't', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Omit recognized function arguments."}, {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-locals", 'l', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Omit local variables."}, {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-globals", 'g', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Show the current frame source file global and static variables."}, {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-declaration", 'c', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Show variable declaration information (source file and line where the " "variable was declared)."}, {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "regex", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeRegularExpression, "The <variable-name> argument for name lookups are regular expressions."}, {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "scope", 's', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Show variable scope (argument, local, global, static)."}, {LLDB_OPT_SET_1, false, "summary", 'y', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Specify the summary that the variable output should use."}, {LLDB_OPT_SET_2, false, "summary-string", 'z', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Specify a summary string to use to format the variable output."}, }; static Status ValidateNamedSummary(const char *str, void *) { if (!str || !str[0]) return Status("must specify a valid named summary"); TypeSummaryImplSP summary_sp; if (!DataVisualization::NamedSummaryFormats::GetSummaryFormat( ConstString(str), summary_sp)) return Status("must specify a valid named summary"); return Status(); } static Status ValidateSummaryString(const char *str, void *) { if (!str || !str[0]) return Status("must specify a non-empty summary string"); return Status(); } OptionGroupVariable::OptionGroupVariable(bool show_frame_options) : OptionGroup(), include_frame_options(show_frame_options), summary(ValidateNamedSummary), summary_string(ValidateSummaryString) {} OptionGroupVariable::~OptionGroupVariable() {} Status OptionGroupVariable::SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; if (!include_frame_options) option_idx += 3; const int short_option = g_variable_options[option_idx].short_option; switch (short_option) { case 'r': use_regex = true; break; case 'a': show_args = false; break; case 'l': show_locals = false; break; case 'g': show_globals = true; break; case 'c': show_decl = true; break; case 's': show_scope = true; break; case 't': show_recognized_args = false; break; case 'y': error = summary.SetCurrentValue(option_arg); break; case 'z': error = summary_string.SetCurrentValue(option_arg); break; default: llvm_unreachable("Unimplemented option"); } return error; } void OptionGroupVariable::OptionParsingStarting( ExecutionContext *execution_context) { show_args = true; // Frame option only show_recognized_args = true; // Frame option only show_locals = true; // Frame option only show_globals = false; // Frame option only show_decl = false; use_regex = false; show_scope = false; summary.Clear(); summary_string.Clear(); } #define NUM_FRAME_OPTS 3 llvm::ArrayRef<OptionDefinition> OptionGroupVariable::GetDefinitions() { auto result = llvm::makeArrayRef(g_variable_options); // Show the "--no-args", "--no-locals" and "--show-globals" options if we are // showing frame specific options if (include_frame_options) return result; // Skip the "--no-args", "--no-locals" and "--show-globals" options if we are // not showing frame specific options (globals only) return result.drop_front(NUM_FRAME_OPTS); }
Upload File
Create Folder