summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectQuit.cpp
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Commands/CommandObjectQuit.cpp
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadbcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/source/Commands/CommandObjectQuit.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectQuit.cpp111
1 files changed, 49 insertions, 62 deletions
diff --git a/lldb/source/Commands/CommandObjectQuit.cpp b/lldb/source/Commands/CommandObjectQuit.cpp
index a650398724f..2f258b71d14 100644
--- a/lldb/source/Commands/CommandObjectQuit.cpp
+++ b/lldb/source/Commands/CommandObjectQuit.cpp
@@ -25,75 +25,62 @@ using namespace lldb_private;
//-------------------------------------------------------------------------
CommandObjectQuit::CommandObjectQuit(CommandInterpreter &interpreter)
- : CommandObjectParsed(interpreter, "quit", "Quit the LLDB debugger.", "quit")
-{
-}
+ : CommandObjectParsed(interpreter, "quit", "Quit the LLDB debugger.",
+ "quit") {}
-CommandObjectQuit::~CommandObjectQuit ()
-{
-}
+CommandObjectQuit::~CommandObjectQuit() {}
// returns true if there is at least one alive process
-// is_a_detach will be true if all alive processes will be detached when you quit
+// is_a_detach will be true if all alive processes will be detached when you
+// quit
// and false if at least one process will be killed instead
-bool
-CommandObjectQuit::ShouldAskForConfirmation (bool& is_a_detach)
-{
- if (m_interpreter.GetPromptOnQuit() == false)
- return false;
- bool should_prompt = false;
- is_a_detach = true;
- for (uint32_t debugger_idx = 0;
- debugger_idx < Debugger::GetNumDebuggers();
- debugger_idx++)
- {
- DebuggerSP debugger_sp(Debugger::GetDebuggerAtIndex(debugger_idx));
- if (!debugger_sp)
- continue;
- const TargetList& target_list(debugger_sp->GetTargetList());
- for (uint32_t target_idx = 0;
- target_idx < static_cast<uint32_t>(target_list.GetNumTargets());
- target_idx++)
- {
- TargetSP target_sp(target_list.GetTargetAtIndex(target_idx));
- if (!target_sp)
- continue;
- ProcessSP process_sp(target_sp->GetProcessSP());
- if (process_sp
- && process_sp->IsValid()
- && process_sp->IsAlive()
- && process_sp->WarnBeforeDetach())
- {
- should_prompt = true;
- if (process_sp->GetShouldDetach() == false)
- {
- // if we need to kill at least one process, just say so and return
- is_a_detach = false;
- return should_prompt;
- }
- }
+bool CommandObjectQuit::ShouldAskForConfirmation(bool &is_a_detach) {
+ if (m_interpreter.GetPromptOnQuit() == false)
+ return false;
+ bool should_prompt = false;
+ is_a_detach = true;
+ for (uint32_t debugger_idx = 0; debugger_idx < Debugger::GetNumDebuggers();
+ debugger_idx++) {
+ DebuggerSP debugger_sp(Debugger::GetDebuggerAtIndex(debugger_idx));
+ if (!debugger_sp)
+ continue;
+ const TargetList &target_list(debugger_sp->GetTargetList());
+ for (uint32_t target_idx = 0;
+ target_idx < static_cast<uint32_t>(target_list.GetNumTargets());
+ target_idx++) {
+ TargetSP target_sp(target_list.GetTargetAtIndex(target_idx));
+ if (!target_sp)
+ continue;
+ ProcessSP process_sp(target_sp->GetProcessSP());
+ if (process_sp && process_sp->IsValid() && process_sp->IsAlive() &&
+ process_sp->WarnBeforeDetach()) {
+ should_prompt = true;
+ if (process_sp->GetShouldDetach() == false) {
+ // if we need to kill at least one process, just say so and return
+ is_a_detach = false;
+ return should_prompt;
}
+ }
}
- return should_prompt;
+ }
+ return should_prompt;
}
-bool
-CommandObjectQuit::DoExecute (Args& command, CommandReturnObject &result)
-{
- bool is_a_detach = true;
- if (ShouldAskForConfirmation (is_a_detach))
- {
- StreamString message;
- message.Printf("Quitting LLDB will %s one or more processes. Do you really want to proceed", (is_a_detach ? "detach from" : "kill"));
- if (!m_interpreter.Confirm(message.GetData(), true))
- {
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
+bool CommandObjectQuit::DoExecute(Args &command, CommandReturnObject &result) {
+ bool is_a_detach = true;
+ if (ShouldAskForConfirmation(is_a_detach)) {
+ StreamString message;
+ message.Printf("Quitting LLDB will %s one or more processes. Do you really "
+ "want to proceed",
+ (is_a_detach ? "detach from" : "kill"));
+ if (!m_interpreter.Confirm(message.GetData(), true)) {
+ result.SetStatus(eReturnStatusFailed);
+ return false;
}
- const uint32_t event_type = CommandInterpreter::eBroadcastBitQuitCommandReceived;
- m_interpreter.BroadcastEvent (event_type);
- result.SetStatus (eReturnStatusQuit);
- return true;
+ }
+ const uint32_t event_type =
+ CommandInterpreter::eBroadcastBitQuitCommandReceived;
+ m_interpreter.BroadcastEvent(event_type);
+ result.SetStatus(eReturnStatusQuit);
+ return true;
}
-
OpenPOWER on IntegriCloud