22#include "llvm/ADT/ArrayRef.h"
28#define LLDB_OPTIONS_process_launch
29#include "CommandOptions.inc"
32 uint32_t option_idx, llvm::StringRef option_arg,
35 const int short_option = g_process_launch_options[option_idx].short_option;
39 switch (short_option) {
44 target_sp->CreateBreakpointAtUserEntry(
error);
49 if (action.
Open(STDIN_FILENO,
FileSpec(option_arg),
true,
false))
57 if (action.
Open(STDOUT_FILENO,
FileSpec(option_arg),
false,
true))
65 if (action.
Open(STDERR_FILENO,
FileSpec(option_arg),
false,
true))
78 if (action.
Open(STDIN_FILENO, dev_null,
true,
false))
80 if (action.
Open(STDOUT_FILENO, dev_null,
false,
true))
82 if (action.
Open(STDERR_FILENO, dev_null,
false,
true))
97 target_sp ? target_sp->GetPlatform() :
PlatformSP();
105 const bool disable_aslr_arg =
110 error.SetErrorStringWithFormat(
111 "Invalid boolean value for disable-aslr option: '%s'",
112 option_arg.empty() ?
"<null>" : option_arg.str().c_str());
119 const bool expand_args =
124 error.SetErrorStringWithFormat(
125 "Invalid boolean value for shell-expand-args option: '%s'",
126 option_arg.empty() ?
"<null>" : option_arg.str().c_str());
131 if (!option_arg.empty())
142 error.SetErrorStringWithFormat(
"unrecognized short option character '%c'",
150 return llvm::ArrayRef(g_process_launch_options);
static llvm::raw_ostream & error(Stream &strm)
lldb_private::LazyBool disable_aslr
lldb_private::ProcessLaunchInfo launch_info
lldb_private::Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, lldb_private::ExecutionContext *execution_context) override
llvm::ArrayRef< lldb_private::OptionDefinition > GetDefinitions() override
std::pair< iterator, bool > insert(llvm::StringRef KeyEqValue)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
bool Open(int fd, const FileSpec &file_spec, bool read, bool write)
static const char * DEV_NULL
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
Environment & GetEnvironment()
ArchSpec & GetArchitecture()
void SetShell(const FileSpec &shell)
void SetProcessPluginName(llvm::StringRef plugin)
void AppendFileAction(const FileAction &info)
void SetShellExpandArguments(bool expand)
void SetWorkingDirectory(const FileSpec &working_dir)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Platform > PlatformSP
std::shared_ptr< lldb_private::Target > TargetSP
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)