Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -0,0 +1,48 @@
add_lldb_library(lldbCommands
CommandCompletions.cpp
CommandObjectApropos.cpp
CommandObjectArgs.cpp
CommandObjectBreakpoint.cpp
CommandObjectBreakpointCommand.cpp
CommandObjectBugreport.cpp
CommandObjectCommands.cpp
CommandObjectDisassemble.cpp
CommandObjectExpression.cpp
CommandObjectFrame.cpp
CommandObjectGUI.cpp
CommandObjectHelp.cpp
CommandObjectLog.cpp
CommandObjectMemory.cpp
CommandObjectMultiword.cpp
CommandObjectPlatform.cpp
CommandObjectPlugin.cpp
CommandObjectProcess.cpp
CommandObjectQuit.cpp
CommandObjectRegister.cpp
CommandObjectSettings.cpp
CommandObjectSource.cpp
CommandObjectSyntax.cpp
CommandObjectTarget.cpp
CommandObjectThread.cpp
CommandObjectType.cpp
CommandObjectVersion.cpp
CommandObjectWatchpoint.cpp
CommandObjectWatchpointCommand.cpp
CommandObjectLanguage.cpp
LINK_LIBS
lldbBase
lldbBreakpoint
lldbCore
lldbDataFormatters
lldbExpression
lldbHost
lldbInterpreter
lldbSymbol
lldbTarget
lldbUtility
lldbPluginExpressionParserClang
LINK_COMPONENTS
Support
)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,112 @@
//===-- CommandObjectApropos.cpp ---------------------------------*- C++
//-*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "CommandObjectApropos.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Interpreter/Property.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());
size_t max_len = 0;
for (size_t i = 0; i < commands_found.GetSize(); ++i) {
size_t len = strlen(commands_found.GetStringAtIndex(i));
if (len > max_len)
max_len = len;
}
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 =
m_interpreter.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();
}

View File

@@ -0,0 +1,38 @@
//===-- CommandObjectApropos.h -----------------------------------*- C++
//-*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectApropos_h_
#define liblldb_CommandObjectApropos_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObject.h"
namespace lldb_private {
//-------------------------------------------------------------------------
// CommandObjectApropos
//-------------------------------------------------------------------------
class CommandObjectApropos : public CommandObjectParsed {
public:
CommandObjectApropos(CommandInterpreter &interpreter);
~CommandObjectApropos() override;
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override;
};
} // namespace lldb_private
#endif // liblldb_CommandObjectApropos_h_

View File

@@ -0,0 +1,234 @@
//===-- CommandObjectArgs.cpp -----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "CommandObjectArgs.h"
#include "Plugins/ExpressionParser/Clang/ClangExpressionVariable.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Value.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/Variable.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "llvm/ADT/StringSwitch.h"
using namespace lldb;
using namespace lldb_private;
// This command is a toy. I'm just using it to have a way to construct the
// arguments to
// calling functions.
//
static OptionDefinition g_arg_options[] = {
// clang-format off
{ LLDB_OPT_SET_1, false, "debug", 'g', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Enable verbose debug logging of the expression parsing and evaluation." },
// clang-format on
};
CommandObjectArgs::CommandOptions::CommandOptions(
CommandInterpreter &interpreter)
: Options() {
// Keep only one place to reset the values to their defaults
OptionParsingStarting(nullptr);
}
CommandObjectArgs::CommandOptions::~CommandOptions() = default;
Status CommandObjectArgs::CommandOptions::SetOptionValue(
uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) {
Status error;
const int short_option = m_getopt_table[option_idx].val;
error.SetErrorStringWithFormat("invalid short option character '%c'",
short_option);
return error;
}
void CommandObjectArgs::CommandOptions::OptionParsingStarting(
ExecutionContext *execution_context) {}
llvm::ArrayRef<OptionDefinition>
CommandObjectArgs::CommandOptions::GetDefinitions() {
return llvm::makeArrayRef(g_arg_options);
}
CommandObjectArgs::CommandObjectArgs(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "args",
"When stopped at the start of a function, reads "
"function arguments of type (u?)int(8|16|32|64)_t, "
"(void|char)*",
"args"),
m_options(interpreter) {}
CommandObjectArgs::~CommandObjectArgs() = default;
Options *CommandObjectArgs::GetOptions() { return &m_options; }
bool CommandObjectArgs::DoExecute(Args &args, CommandReturnObject &result) {
ConstString target_triple;
Process *process = m_exe_ctx.GetProcessPtr();
if (!process) {
result.AppendError("Args found no process.");
result.SetStatus(eReturnStatusFailed);
return false;
}
const ABI *abi = process->GetABI().get();
if (!abi) {
result.AppendError("The current process has no ABI.");
result.SetStatus(eReturnStatusFailed);
return false;
}
if (args.empty()) {
result.AppendError("args requires at least one argument");
result.SetStatus(eReturnStatusFailed);
return false;
}
Thread *thread = m_exe_ctx.GetThreadPtr();
if (!thread) {
result.AppendError("args found no thread.");
result.SetStatus(eReturnStatusFailed);
return false;
}
lldb::StackFrameSP thread_cur_frame = thread->GetSelectedFrame();
if (!thread_cur_frame) {
result.AppendError("The current thread has no current frame.");
result.SetStatus(eReturnStatusFailed);
return false;
}
ModuleSP thread_module_sp(
thread_cur_frame->GetFrameCodeAddress().GetModule());
if (!thread_module_sp) {
result.AppendError("The PC has no associated module.");
result.SetStatus(eReturnStatusFailed);
return false;
}
TypeSystem *type_system =
thread_module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
if (type_system == nullptr) {
result.AppendError("Unable to create C type system.");
result.SetStatus(eReturnStatusFailed);
return false;
}
ValueList value_list;
for (auto &arg_entry : args.entries()) {
llvm::StringRef arg_type = arg_entry.ref;
Value value;
value.SetValueType(Value::eValueTypeScalar);
CompilerType compiler_type;
std::size_t int_pos = arg_type.find("int");
if (int_pos != llvm::StringRef::npos) {
Encoding encoding = eEncodingSint;
int width = 0;
if (int_pos > 1) {
result.AppendErrorWithFormat("Invalid format: %s.\n",
arg_entry.c_str());
result.SetStatus(eReturnStatusFailed);
return false;
}
if (int_pos == 1 && arg_type[0] != 'u') {
result.AppendErrorWithFormat("Invalid format: %s.\n",
arg_entry.c_str());
result.SetStatus(eReturnStatusFailed);
return false;
}
if (arg_type[0] == 'u') {
encoding = eEncodingUint;
}
llvm::StringRef width_spec = arg_type.drop_front(int_pos + 3);
auto exp_result = llvm::StringSwitch<llvm::Optional<int>>(width_spec)
.Case("8_t", 8)
.Case("16_t", 16)
.Case("32_t", 32)
.Case("64_t", 64)
.Default(llvm::None);
if (!exp_result.hasValue()) {
result.AppendErrorWithFormat("Invalid format: %s.\n",
arg_entry.c_str());
result.SetStatus(eReturnStatusFailed);
return false;
}
width = *exp_result;
compiler_type =
type_system->GetBuiltinTypeForEncodingAndBitSize(encoding, width);
if (!compiler_type.IsValid()) {
result.AppendErrorWithFormat(
"Couldn't get Clang type for format %s (%s integer, width %d).\n",
arg_entry.c_str(),
(encoding == eEncodingSint ? "signed" : "unsigned"), width);
result.SetStatus(eReturnStatusFailed);
return false;
}
} else if (arg_type == "void*") {
compiler_type =
type_system->GetBasicTypeFromAST(eBasicTypeVoid).GetPointerType();
} else if (arg_type == "char*") {
compiler_type =
type_system->GetBasicTypeFromAST(eBasicTypeChar).GetPointerType();
} else {
result.AppendErrorWithFormat("Invalid format: %s.\n", arg_entry.c_str());
result.SetStatus(eReturnStatusFailed);
return false;
}
value.SetCompilerType(compiler_type);
value_list.PushValue(value);
}
if (!abi->GetArgumentValues(*thread, value_list)) {
result.AppendError("Couldn't get argument values");
result.SetStatus(eReturnStatusFailed);
return false;
}
result.GetOutputStream().Printf("Arguments : \n");
for (auto entry : llvm::enumerate(args.entries())) {
result.GetOutputStream().Printf(
"%" PRIu64 " (%s): ", (uint64_t)entry.index(), entry.value().c_str());
value_list.GetValueAtIndex(entry.index())->Dump(&result.GetOutputStream());
result.GetOutputStream().Printf("\n");
}
return result.Succeeded();
}

View File

@@ -0,0 +1,52 @@
//===-- CommandObjectArgs.h -------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectArgs_h_
#define liblldb_CommandObjectArgs_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/Options.h"
namespace lldb_private {
class CommandObjectArgs : public CommandObjectParsed {
public:
class CommandOptions : public Options {
public:
CommandOptions(CommandInterpreter &interpreter);
~CommandOptions() override;
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) override;
void OptionParsingStarting(ExecutionContext *execution_context) override;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
};
CommandObjectArgs(CommandInterpreter &interpreter);
~CommandObjectArgs() override;
Options *GetOptions() override;
protected:
CommandOptions m_options;
bool DoExecute(Args &command, CommandReturnObject &result) override;
};
} // namespace lldb_private
#endif // liblldb_CommandObjectArgs_h_

View File

@@ -0,0 +1 @@
5a175d61060e3eae1988b3b3738fc09790c3d8b6

View File

@@ -0,0 +1,67 @@
//===-- CommandObjectBreakpoint.h -------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectBreakpoint_h_
#define liblldb_CommandObjectBreakpoint_h_
// C Includes
// C++ Includes
#include <utility>
#include <vector>
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Breakpoint/BreakpointName.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/STLUtils.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/Options.h"
namespace lldb_private {
//-------------------------------------------------------------------------
// CommandObjectMultiwordBreakpoint
//-------------------------------------------------------------------------
class CommandObjectMultiwordBreakpoint : public CommandObjectMultiword {
public:
CommandObjectMultiwordBreakpoint(CommandInterpreter &interpreter);
~CommandObjectMultiwordBreakpoint() override;
static void VerifyBreakpointOrLocationIDs(Args &args, Target *target,
CommandReturnObject &result,
BreakpointIDList *valid_ids,
BreakpointName::Permissions
::PermissionKinds purpose) {
VerifyIDs(args, target, true, result, valid_ids, purpose);
}
static void VerifyBreakpointIDs(Args &args, Target *target,
CommandReturnObject &result,
BreakpointIDList *valid_ids,
BreakpointName::Permissions::PermissionKinds
purpose) {
VerifyIDs(args, target, false, result, valid_ids, purpose);
}
private:
static void VerifyIDs(Args &args, Target *target, bool allow_locations,
CommandReturnObject &result,
BreakpointIDList *valid_ids,
BreakpointName::Permissions::PermissionKinds
purpose);
};
} // namespace lldb_private
#endif // liblldb_CommandObjectBreakpoint_h_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
//===-- CommandObjectBreakpointCommand.h ------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectBreakpointCommand_h_
#define liblldb_CommandObjectBreakpointCommand_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/lldb-types.h"
namespace lldb_private {
//-------------------------------------------------------------------------
// CommandObjectMultiwordBreakpoint
//-------------------------------------------------------------------------
class CommandObjectBreakpointCommand : public CommandObjectMultiword {
public:
CommandObjectBreakpointCommand(CommandInterpreter &interpreter);
~CommandObjectBreakpointCommand() override;
};
} // namespace lldb_private
#endif // liblldb_CommandObjectBreakpointCommand_h_

View File

@@ -0,0 +1,131 @@
//===-- CommandObjectBugreport.cpp ------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "CommandObjectBugreport.h"
// C Includes
#include <cstdio>
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionGroupOutputFile.h"
#include "lldb/Target/Thread.h"
using namespace lldb;
using namespace lldb_private;
//-------------------------------------------------------------------------
// "bugreport unwind"
//-------------------------------------------------------------------------
class CommandObjectBugreportUnwind : public CommandObjectParsed {
public:
CommandObjectBugreportUnwind(CommandInterpreter &interpreter)
: CommandObjectParsed(
interpreter, "bugreport unwind",
"Create a bugreport for a bug in the stack unwinding code.",
nullptr),
m_option_group(), m_outfile_options() {
m_option_group.Append(&m_outfile_options, LLDB_OPT_SET_ALL,
LLDB_OPT_SET_1 | LLDB_OPT_SET_2 | LLDB_OPT_SET_3);
m_option_group.Finalize();
}
~CommandObjectBugreportUnwind() override {}
Options *GetOptions() override { return &m_option_group; }
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
StringList commands;
commands.AppendString("thread backtrace");
Thread *thread = m_exe_ctx.GetThreadPtr();
if (thread) {
char command_buffer[256];
uint32_t frame_count = thread->GetStackFrameCount();
for (uint32_t i = 0; i < frame_count; ++i) {
StackFrameSP frame = thread->GetStackFrameAtIndex(i);
lldb::addr_t pc = frame->GetStackID().GetPC();
snprintf(command_buffer, sizeof(command_buffer),
"disassemble --bytes --address 0x%" PRIx64, pc);
commands.AppendString(command_buffer);
snprintf(command_buffer, sizeof(command_buffer),
"image show-unwind --address 0x%" PRIx64, pc);
commands.AppendString(command_buffer);
}
}
const FileSpec &outfile_spec =
m_outfile_options.GetFile().GetCurrentValue();
if (outfile_spec) {
char path[PATH_MAX];
outfile_spec.GetPath(path, sizeof(path));
uint32_t open_options =
File::eOpenOptionWrite | File::eOpenOptionCanCreate |
File::eOpenOptionAppend | File::eOpenOptionCloseOnExec;
const bool append = m_outfile_options.GetAppend().GetCurrentValue();
if (!append)
open_options |= File::eOpenOptionTruncate;
StreamFileSP outfile_stream = std::make_shared<StreamFile>();
Status error = outfile_stream->GetFile().Open(path, open_options);
if (error.Fail()) {
result.AppendErrorWithFormat("Failed to open file '%s' for %s: %s\n",
path, append ? "append" : "write",
error.AsCString());
result.SetStatus(eReturnStatusFailed);
return false;
}
result.SetImmediateOutputStream(outfile_stream);
}
CommandInterpreterRunOptions options;
options.SetStopOnError(false);
options.SetEchoCommands(true);
options.SetPrintResults(true);
options.SetAddToHistory(false);
m_interpreter.HandleCommands(commands, &m_exe_ctx, options, result);
return result.Succeeded();
}
private:
OptionGroupOptions m_option_group;
OptionGroupOutputFile m_outfile_options;
};
#pragma mark CommandObjectMultiwordBugreport
//-------------------------------------------------------------------------
// CommandObjectMultiwordBugreport
//-------------------------------------------------------------------------
CommandObjectMultiwordBugreport::CommandObjectMultiwordBugreport(
CommandInterpreter &interpreter)
: CommandObjectMultiword(
interpreter, "bugreport",
"Commands for creating domain-specific bug reports.",
"bugreport <subcommand> [<subcommand-options>]") {
LoadSubCommand(
"unwind", CommandObjectSP(new CommandObjectBugreportUnwind(interpreter)));
}
CommandObjectMultiwordBugreport::~CommandObjectMultiwordBugreport() {}

View File

@@ -0,0 +1,34 @@
//===-- CommandObjectBugreport.h --------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectBugreport_h_
#define liblldb_CommandObjectBugreport_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObjectMultiword.h"
namespace lldb_private {
//-------------------------------------------------------------------------
// CommandObjectMultiwordBugreport
//-------------------------------------------------------------------------
class CommandObjectMultiwordBugreport : public CommandObjectMultiword {
public:
CommandObjectMultiwordBugreport(CommandInterpreter &interpreter);
~CommandObjectMultiwordBugreport() override;
};
} // namespace lldb_private
#endif // liblldb_CommandObjectBugreport_h_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
//===-- CommandObjectCommands.h -----------------------------------*- C++
//-*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectCommands_h_
#define liblldb_CommandObjectCommands_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Core/STLUtils.h"
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
namespace lldb_private {
//-------------------------------------------------------------------------
// CommandObjectMultiwordCommands
//-------------------------------------------------------------------------
class CommandObjectMultiwordCommands : public CommandObjectMultiword {
public:
CommandObjectMultiwordCommands(CommandInterpreter &interpreter);
~CommandObjectMultiwordCommands() override;
};
} // namespace lldb_private
#endif // liblldb_CommandObjectCommands_h_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,85 @@
//===-- CommandObjectDisassemble.h ------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectDisassemble_h_
#define liblldb_CommandObjectDisassemble_h_
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Utility/ArchSpec.h"
namespace lldb_private {
//-------------------------------------------------------------------------
// CommandObjectDisassemble
//-------------------------------------------------------------------------
class CommandObjectDisassemble : public CommandObjectParsed {
public:
class CommandOptions : public Options {
public:
CommandOptions();
~CommandOptions() override;
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) override;
void OptionParsingStarting(ExecutionContext *execution_context) override;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
const char *GetPluginName() {
return (plugin_name.empty() ? nullptr : plugin_name.c_str());
}
const char *GetFlavorString() {
if (flavor_string.empty() || flavor_string == "default")
return nullptr;
return flavor_string.c_str();
}
Status OptionParsingFinished(ExecutionContext *execution_context) override;
bool show_mixed; // Show mixed source/assembly
bool show_bytes;
uint32_t num_lines_context;
uint32_t num_instructions;
bool raw;
std::string func_name;
bool current_function;
lldb::addr_t start_addr;
lldb::addr_t end_addr;
bool at_pc;
bool frame_line;
std::string plugin_name;
std::string flavor_string;
ArchSpec arch;
bool some_location_specified; // If no location was specified, we'll select
// "at_pc". This should be set
// in SetOptionValue if anything the selects a location is set.
lldb::addr_t symbol_containing_addr;
static OptionDefinition g_option_table[];
};
CommandObjectDisassemble(CommandInterpreter &interpreter);
~CommandObjectDisassemble() override;
Options *GetOptions() override { return &m_options; }
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override;
CommandOptions m_options;
};
} // namespace lldb_private
#endif // liblldb_CommandObjectDisassemble_h_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,95 @@
//===-- CommandObjectExpression.h -------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectExpression_h_
#define liblldb_CommandObjectExpression_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Core/IOHandler.h"
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/OptionGroupBoolean.h"
#include "lldb/Interpreter/OptionGroupFormat.h"
#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/lldb-private-enumerations.h"
namespace lldb_private {
class CommandObjectExpression : public CommandObjectRaw,
public IOHandlerDelegate {
public:
class CommandOptions : public OptionGroup {
public:
CommandOptions();
~CommandOptions() override;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
ExecutionContext *execution_context) override;
void OptionParsingStarting(ExecutionContext *execution_context) override;
// Options table: Required for subclasses of Options.
static OptionDefinition g_option_table[];
bool top_level;
bool unwind_on_error;
bool ignore_breakpoints;
bool allow_jit;
bool show_types;
bool show_summary;
bool debug;
uint32_t timeout;
bool try_all_threads;
lldb::LanguageType language;
LanguageRuntimeDescriptionDisplayVerbosity m_verbosity;
LazyBool auto_apply_fixits;
};
CommandObjectExpression(CommandInterpreter &interpreter);
~CommandObjectExpression() override;
Options *GetOptions() override;
protected:
//------------------------------------------------------------------
// IOHandler::Delegate functions
//------------------------------------------------------------------
void IOHandlerInputComplete(IOHandler &io_handler,
std::string &line) override;
bool IOHandlerIsInputComplete(IOHandler &io_handler,
StringList &lines) override;
bool DoExecute(const char *command, CommandReturnObject &result) override;
bool EvaluateExpression(const char *expr, Stream *output_stream,
Stream *error_stream,
CommandReturnObject *result = NULL);
void GetMultilineExpression();
OptionGroupOptions m_option_group;
OptionGroupFormat m_format_options;
OptionGroupValueObjectDisplay m_varobj_options;
OptionGroupBoolean m_repl_option;
CommandOptions m_command_options;
uint32_t m_expr_line_count;
std::string m_expr_lines; // Multi-line expression support
std::string m_fixed_expression; // Holds the current expression's fixed text.
};
} // namespace lldb_private
#endif // liblldb_CommandObjectExpression_h_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
//===-- CommandObjectFrame.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_CommandObjectFrame_h_
#define liblldb_CommandObjectFrame_h_
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/Options.h"
namespace lldb_private {
//-------------------------------------------------------------------------
// CommandObjectMultiwordFrame
//-------------------------------------------------------------------------
class CommandObjectMultiwordFrame : public CommandObjectMultiword {
public:
CommandObjectMultiwordFrame(CommandInterpreter &interpreter);
~CommandObjectMultiwordFrame() override;
};
} // namespace lldb_private
#endif // liblldb_CommandObjectFrame_h_

Some files were not shown because too many files have changed in this diff Show More