summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/DNB.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-02-02 19:23:22 +0000
committerGreg Clayton <gclayton@apple.com>2012-02-02 19:23:22 +0000
commitfb640c2d4cbeaa6e1be1e619c063f1074d289d74 (patch)
treedb02d7f74f79964913f4a1f29afedc85eb55d31b /lldb/tools/debugserver/source/DNB.cpp
parent1e8d7207433bc1585101016cbf248fc4af5bd33d (diff)
downloadbcm5719-llvm-fb640c2d4cbeaa6e1be1e619c063f1074d289d74.tar.gz
bcm5719-llvm-fb640c2d4cbeaa6e1be1e619c063f1074d289d74.zip
Kill our child process that we launch when we can't get the task_for_pid()
otherwise we will have a launched process stopped at the entry point and it will get reparented when debugserver goes away and we won't be able to kill the process later. llvm-svn: 149622
Diffstat (limited to 'lldb/tools/debugserver/source/DNB.cpp')
-rw-r--r--lldb/tools/debugserver/source/DNB.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp
index f60c26fab6d..1b8632eb717 100644
--- a/lldb/tools/debugserver/source/DNB.cpp
+++ b/lldb/tools/debugserver/source/DNB.cpp
@@ -250,6 +250,10 @@ DNBProcessLaunch (const char *path,
if (processSP->Task().TaskPortForProcessID (launch_err) == TASK_NULL)
{
// We failed to get the task for our process ID which is bad.
+ // Kill our process otherwise it will be stopped at the entry
+ // point and get reparented to someone else and never go away.
+ kill (SIGKILL, pid);
+
if (err_str && err_len > 0)
{
if (launch_err.AsString())
OpenPOWER on IntegriCloud