35 bool should_prompt =
false;
42 const TargetList &target_list(debugger_sp->GetTargetList());
43 for (uint32_t target_idx = 0;
44 target_idx < static_cast<uint32_t>(target_list.
GetNumTargets());
49 ProcessSP process_sp(target_sp->GetProcessSP());
50 if (process_sp && process_sp->IsValid() && process_sp->IsAlive() &&
51 process_sp->WarnBeforeDetach()) {
53 if (!process_sp->GetShouldDetach()) {
65 bool is_a_detach =
true;
68 message.
Printf(
"Quitting LLDB will %s one or more processes. Do you really "
70 (is_a_detach ?
"detach from" :
"kill"));
78 result.
AppendError(
"Too many arguments for 'quit'. Only an optional exit "
87 if (arg.getAsInteger( 0, exit_code)) {
89 std::string arg_str = arg.str();
90 s.
Printf(
"Couldn't parse '%s' as integer for exit code.", arg_str.data());
95 result.
AppendError(
"The current driver doesn't allow custom exit codes"
96 " for the quit command.");
101 const uint32_t event_type =
A command line argument class.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
const char * GetArgumentAtIndex(size_t idx) const
Gets the NULL terminated C string argument pointer for the argument at index idx.
void BroadcastEvent(lldb::EventSP &event_sp)
Broadcast an event which has no associated data.
bool Confirm(llvm::StringRef message, bool default_answer)
bool SetQuitExitCode(int exit_code)
Sets the exit code for the quit command.
@ eBroadcastBitQuitCommandReceived
bool GetPromptOnQuit() const
CommandObjectQuit(CommandInterpreter &interpreter)
void DoExecute(Args &args, CommandReturnObject &result) override
bool ShouldAskForConfirmation(bool &is_a_detach)
~CommandObjectQuit() override
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
CommandInterpreter & m_interpreter
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
static lldb::DebuggerSP GetDebuggerAtIndex(size_t index)
static size_t GetNumDebuggers()
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
lldb::TargetSP GetTargetAtIndex(uint32_t index) const
size_t GetNumTargets() const
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Debugger > DebuggerSP
@ eArgTypeUnsignedInteger
std::shared_ptr< lldb_private::Target > TargetSP