summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2015-03-26 07:08:47 +0000
committerIlia K <ki.stfu@gmail.com>2015-03-26 07:08:47 +0000
commitfcc89a079f8f52551b36713d8f6ce84c89701430 (patch)
tree5cbae19c8d3ab82ce42fbca5df432c017931f30c /lldb/source/Target/Process.cpp
parent7124230682b8a35f9788cc0e4c9bd3c7e3feca8a (diff)
downloadbcm5719-llvm-fcc89a079f8f52551b36713d8f6ce84c89701430.tar.gz
bcm5719-llvm-fcc89a079f8f52551b36713d8f6ce84c89701430.zip
Fix -gdb-exit to detach if was attached or destroy otherwise (MI)
Summary: This patch fixes -gdb-exit for locally target. It includes the following changes: # Fix Process::Finalize # Use SBProcess::Destroy in -gdb-exit Reviewers: abidh, zturner, clayborg Reviewed By: clayborg Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8298 llvm-svn: 233255
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp35
1 files changed, 9 insertions, 26 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 579f9ae8388..6137b7f1b89 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -822,32 +822,8 @@ Process::GetGlobalProperties()
void
Process::Finalize()
{
- switch (GetPrivateState())
- {
- case eStateConnected:
- case eStateAttaching:
- case eStateLaunching:
- case eStateStopped:
- case eStateRunning:
- case eStateStepping:
- case eStateCrashed:
- case eStateSuspended:
- if (GetShouldDetach())
- {
- // FIXME: This will have to be a process setting:
- bool keep_stopped = false;
- Detach(keep_stopped);
- }
- else
- Destroy();
- break;
-
- case eStateInvalid:
- case eStateUnloaded:
- case eStateDetached:
- case eStateExited:
- break;
- }
+ // Destroy this process
+ Destroy();
// Clear our broadcaster before we proceed with destroying
Broadcaster::Clear();
@@ -3952,6 +3928,13 @@ Process::Destroy ()
// that might hinder the destruction. Remember to set this back to false when we are done. That way if the attempt
// failed and the process stays around for some reason it won't be in a confused state.
+ if (GetShouldDetach())
+ {
+ // FIXME: This will have to be a process setting:
+ bool keep_stopped = false;
+ Detach(keep_stopped);
+ }
+
m_destroy_in_process = true;
Error error (WillDestroy());
OpenPOWER on IntegriCloud