22#define LLDB_OPTIONS_diagnostics_dump
23#include "CommandOptions.inc"
30 "Dump diagnostics to disk", nullptr) {}
45 switch (short_option) {
50 llvm_unreachable(
"Unimplemented option");
60 return llvm::ArrayRef(g_diagnostics_dump_options);
72 llvm::sys::fs::create_directories(
m_options.directory.GetPath());
74 return llvm::errorCodeToError(ec);
84 result.
AppendError(llvm::toString(directory.takeError()));
91 directory->GetPath().c_str());
96 result.
GetOutputStream() <<
"diagnostics written to " << *directory <<
'\n';
107 "Commands controlling LLDB diagnostics.",
108 "diagnostics <subcommand> [<command-options>]") {
static llvm::raw_ostream & error(Stream &strm)
~CommandOptions() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
Options * GetOptions() override
llvm::Expected< FileSpec > GetDirectory()
void DoExecute(Args &args, CommandReturnObject &result) override
~CommandObjectDiagnosticsDump() override=default
CommandObjectDiagnosticsDump(CommandInterpreter &interpreter)
A command line argument class.
CommandObjectDiagnostics(CommandInterpreter &interpreter)
~CommandObjectDiagnostics() override
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
CommandObjectMultiword(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
friend class CommandInterpreter
CommandObjectParsed(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
Stream & GetOutputStream()
llvm::Error Create(const FileSpec &dir)
Gather diagnostics in the given directory.
static llvm::Expected< FileSpec > CreateUniqueDirectory()
Create a unique diagnostic directory.
static Diagnostics & Instance()
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
@ eReturnStatusSuccessFinishResult