003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/source/Commands
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
source
/
Commands
/
📁
..
📄
CommandCompletions.cpp
(21.8 KB)
📄
CommandObjectApropos.cpp
(3.61 KB)
📄
CommandObjectApropos.h
(904 B)
📄
CommandObjectBreakpoint.cpp
(81.05 KB)
📄
CommandObjectBreakpoint.h
(1.72 KB)
📄
CommandObjectBreakpointCommand.cpp
(25.81 KB)
📄
CommandObjectBreakpointCommand.h
(902 B)
📄
CommandObjectCommands.cpp
(63.2 KB)
📄
CommandObjectCommands.h
(877 B)
📄
CommandObjectDisassemble.cpp
(17.74 KB)
📄
CommandObjectDisassemble.h
(3.05 KB)
📄
CommandObjectExpression.cpp
(23.86 KB)
📄
CommandObjectExpression.h
(3.63 KB)
📄
CommandObjectFrame.cpp
(42.35 KB)
📄
CommandObjectFrame.h
(852 B)
📄
CommandObjectGUI.cpp
(1.79 KB)
📄
CommandObjectGUI.h
(870 B)
📄
CommandObjectHelp.cpp
(8.53 KB)
📄
CommandObjectHelp.h
(2.35 KB)
📄
CommandObjectLanguage.cpp
(933 B)
📄
CommandObjectLanguage.h
(883 B)
📄
CommandObjectLog.cpp
(17.02 KB)
📄
CommandObjectLog.h
(1004 B)
📄
CommandObjectMemory.cpp
(61.7 KB)
📄
CommandObjectMemory.h
(799 B)
📄
CommandObjectMultiword.cpp
(13.54 KB)
📄
CommandObjectPlatform.cpp
(61.17 KB)
📄
CommandObjectPlatform.h
(997 B)
📄
CommandObjectPlugin.cpp
(2.68 KB)
📄
CommandObjectPlugin.h
(799 B)
📄
CommandObjectProcess.cpp
(55.63 KB)
📄
CommandObjectProcess.h
(866 B)
📄
CommandObjectQuit.cpp
(3.81 KB)
📄
CommandObjectQuit.h
(930 B)
📄
CommandObjectRegister.cpp
(15.66 KB)
📄
CommandObjectRegister.h
(1.04 KB)
📄
CommandObjectReproducer.cpp
(17.86 KB)
📄
CommandObjectReproducer.h
(851 B)
📄
CommandObjectSettings.cpp
(38.87 KB)
📄
CommandObjectSettings.h
(873 B)
📄
CommandObjectSource.cpp
(47.71 KB)
📄
CommandObjectSource.h
(863 B)
📄
CommandObjectStats.cpp
(3.52 KB)
📄
CommandObjectStats.h
(791 B)
📄
CommandObjectTarget.cpp
(177.86 KB)
📄
CommandObjectTarget.h
(859 B)
📄
CommandObjectThread.cpp
(78.3 KB)
📄
CommandObjectThread.h
(826 B)
📄
CommandObjectType.cpp
(98.61 KB)
📄
CommandObjectType.h
(774 B)
📄
CommandObjectVersion.cpp
(1.18 KB)
📄
CommandObjectVersion.h
(898 B)
📄
CommandObjectWatchpoint.cpp
(40.55 KB)
📄
CommandObjectWatchpoint.h
(1.04 KB)
📄
CommandObjectWatchpointCommand.cpp
(23.68 KB)
📄
CommandObjectWatchpointCommand.h
(902 B)
📄
Options.td
(58.93 KB)
📄
OptionsBase.td
(7.3 KB)
Editing: CommandObjectApropos.cpp
//===-- CommandObjectApropos.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 "CommandObjectApropos.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/Property.h" #include "lldb/Utility/Args.h" using namespace lldb; using namespace lldb_private; // CommandObjectApropos CommandObjectApropos::CommandObjectApropos(CommandInterpreter &interpreter) : CommandObjectParsed( interpreter, "apropos", "List debugger commands related to a word or subject.", nullptr) { CommandArgumentEntry arg; CommandArgumentData search_word_arg; // Define the first (and only) variant of this arg. search_word_arg.arg_type = eArgTypeSearchWord; search_word_arg.arg_repetition = eArgRepeatPlain; // There is only one variant this argument could be; put it into the argument // entry. arg.push_back(search_word_arg); // Push the data for the first argument into the m_arguments vector. m_arguments.push_back(arg); } CommandObjectApropos::~CommandObjectApropos() = default; bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) { const size_t argc = args.GetArgumentCount(); if (argc == 1) { auto search_word = args[0].ref(); if (!search_word.empty()) { // The bulk of the work must be done inside the Command Interpreter, // since the command dictionary is private. StringList commands_found; StringList commands_help; m_interpreter.FindCommandsForApropos(search_word, commands_found, commands_help, true, true, true); if (commands_found.GetSize() == 0) { result.AppendMessageWithFormat("No commands found pertaining to '%s'. " "Try 'help' to see a complete list of " "debugger commands.\n", args[0].c_str()); } else { if (commands_found.GetSize() > 0) { result.AppendMessageWithFormat( "The following commands may relate to '%s':\n", args[0].c_str()); const size_t max_len = commands_found.GetMaxStringLength(); for (size_t i = 0; i < commands_found.GetSize(); ++i) m_interpreter.OutputFormattedHelpText( result.GetOutputStream(), commands_found.GetStringAtIndex(i), "--", commands_help.GetStringAtIndex(i), max_len); } } std::vector<const Property *> properties; const size_t num_properties = GetDebugger().Apropos(search_word, properties); if (num_properties) { const bool dump_qualified_name = true; result.AppendMessageWithFormatv( "\nThe following settings variables may relate to '{0}': \n\n", args[0].ref()); for (size_t i = 0; i < num_properties; ++i) properties[i]->DumpDescription( m_interpreter, result.GetOutputStream(), 0, dump_qualified_name); } result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("'' is not a valid search word.\n"); result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("'apropos' must be called with exactly one argument.\n"); result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); }
Upload File
Create Folder