LLDB mainline
Macros | Enumerations | Functions | Variables
CommandInterpreter.cpp File Reference
#include <chrono>
#include <cstdlib>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "Commands/CommandObjectApropos.h"
#include "Commands/CommandObjectBreakpoint.h"
#include "Commands/CommandObjectCommands.h"
#include "Commands/CommandObjectDWIMPrint.h"
#include "Commands/CommandObjectDiagnostics.h"
#include "Commands/CommandObjectDisassemble.h"
#include "Commands/CommandObjectExpression.h"
#include "Commands/CommandObjectFrame.h"
#include "Commands/CommandObjectGUI.h"
#include "Commands/CommandObjectHelp.h"
#include "Commands/CommandObjectLanguage.h"
#include "Commands/CommandObjectLog.h"
#include "Commands/CommandObjectMemory.h"
#include "Commands/CommandObjectPlatform.h"
#include "Commands/CommandObjectPlugin.h"
#include "Commands/CommandObjectProcess.h"
#include "Commands/CommandObjectQuit.h"
#include "Commands/CommandObjectRegexCommand.h"
#include "Commands/CommandObjectRegister.h"
#include "Commands/CommandObjectScripting.h"
#include "Commands/CommandObjectSession.h"
#include "Commands/CommandObjectSettings.h"
#include "Commands/CommandObjectSource.h"
#include "Commands/CommandObjectStats.h"
#include "Commands/CommandObjectTarget.h"
#include "Commands/CommandObjectThread.h"
#include "Commands/CommandObjectTrace.h"
#include "Commands/CommandObjectType.h"
#include "Commands/CommandObjectVersion.h"
#include "Commands/CommandObjectWatchpoint.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/StreamFile.h"
#include "lldb/Utility/ErrorMessages.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StructuredData.h"
#include "lldb/Utility/Timer.h"
#include "lldb/Host/Config.h"
#include "lldb/Host/File.h"
#include "lldb/Host/FileCache.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Interpreter/Property.h"
#include "lldb/Utility/Args.h"
#include "lldb/Target/Language.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/TargetList.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/UnixSignals.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/FormatAdapters.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/ScopedPrinter.h"
#include "InterpreterProperties.inc"
#include "InterpreterPropertiesEnum.inc"

Go to the source code of this file.

Macros

#define LLDB_PROPERTIES_interpreter
 
#define LLDB_PROPERTIES_interpreter
 
#define REGISTER_COMMAND_OBJECT(NAME, CLASS)    m_command_dict[NAME] = std::make_shared<CLASS>(*this);
 

Enumerations

enum  
 
enum  {
  eHandleCommandFlagStopOnContinue = (1u << 0) , eHandleCommandFlagStopOnError = (1u << 1) , eHandleCommandFlagEchoCommand = (1u << 2) , eHandleCommandFlagEchoCommentCommand = (1u << 3) ,
  eHandleCommandFlagPrintResult = (1u << 4) , eHandleCommandFlagPrintErrors = (1u << 5) , eHandleCommandFlagStopOnCrash = (1u << 6) , eHandleCommandFlagAllowRepeats = (1u << 7)
}
 

Functions

static void StripLeadingSpaces (std::string &s)
 
static size_t FindArgumentTerminator (const std::string &s)
 
static bool ExtractCommand (std::string &command_string, std::string &command, std::string &suffix, char &quote_char)
 
static void GetHomeInitFile (llvm::SmallVectorImpl< char > &init_file, llvm::StringRef suffix={})
 
static void GetHomeREPLInitFile (llvm::SmallVectorImpl< char > &init_file, LanguageType language)
 
static void GetCwdInitFile (llvm::SmallVectorImpl< char > &init_file)
 

Variables

static const char * k_white_space = " \t\v"
 
static constexpr const char * InitFileWarning
 
static const char * k_valid_command_chars
 

Macro Definition Documentation

◆ LLDB_PROPERTIES_interpreter [1/2]

#define LLDB_PROPERTIES_interpreter

Definition at line 121 of file CommandInterpreter.cpp.

◆ LLDB_PROPERTIES_interpreter [2/2]

#define LLDB_PROPERTIES_interpreter

Definition at line 121 of file CommandInterpreter.cpp.

◆ REGISTER_COMMAND_OBJECT

#define REGISTER_COMMAND_OBJECT (   NAME,
  CLASS 
)     m_command_dict[NAME] = std::make_shared<CLASS>(*this);

Definition at line 558 of file CommandInterpreter.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 120 of file CommandInterpreter.cpp.

◆ anonymous enum

anonymous enum
Enumerator
eHandleCommandFlagStopOnContinue 
eHandleCommandFlagStopOnError 
eHandleCommandFlagEchoCommand 
eHandleCommandFlagEchoCommentCommand 
eHandleCommandFlagPrintResult 
eHandleCommandFlagPrintErrors 
eHandleCommandFlagStopOnCrash 
eHandleCommandFlagAllowRepeats 

Definition at line 2670 of file CommandInterpreter.cpp.

Function Documentation

◆ ExtractCommand()

static bool ExtractCommand ( std::string &  command_string,
std::string &  command,
std::string &  suffix,
char &  quote_char 
)
static

◆ FindArgumentTerminator()

static size_t FindArgumentTerminator ( const std::string &  s)
static

◆ GetCwdInitFile()

static void GetCwdInitFile ( llvm::SmallVectorImpl< char > &  init_file)
static

◆ GetHomeInitFile()

static void GetHomeInitFile ( llvm::SmallVectorImpl< char > &  init_file,
llvm::StringRef  suffix = {} 
)
static

◆ GetHomeREPLInitFile()

static void GetHomeREPLInitFile ( llvm::SmallVectorImpl< char > &  init_file,
LanguageType  language 
)
static

◆ StripLeadingSpaces()

static void StripLeadingSpaces ( std::string &  s)
static

Definition at line 1541 of file CommandInterpreter.cpp.

References k_white_space.

Referenced by ExtractCommand().

Variable Documentation

◆ InitFileWarning

constexpr const char* InitFileWarning
staticconstexpr
Initial value:
=
"There is a .lldbinit file in the current directory which is not being "
"read.\n"
"To silence this warning without sourcing in the local .lldbinit,\n"
"add the following to the lldbinit file in your home directory:\n"
" settings set target.load-cwd-lldbinit false\n"
"To allow lldb to source .lldbinit files in the current working "
"directory,\n"
"set the value of this variable to true. Only do so if you understand "
"and\n"
"accept the security risk."

Definition at line 100 of file CommandInterpreter.cpp.

Referenced by lldb_private::CommandInterpreter::SourceInitFileCwd().

◆ k_valid_command_chars

const char* k_valid_command_chars
static
Initial value:
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"

Definition at line 1539 of file CommandInterpreter.cpp.

Referenced by ExtractCommand().

◆ k_white_space

const char* k_white_space = " \t\v"
static