Re: [lldb-dev] SBProcess::Detach kills target

2016-04-01 Thread Pavel Labath via lldb-dev
> It might be also possible to run an expression that will route > stdin/stdout/stderr to /dev/null before detaching if we know that we have a > master/slave pty hooked up the the inferior's in/out/err. We could run an > expression like: (At least on linux) you would also need something like:

Re: [lldb-dev] SBProcess::Detach kills target

2016-03-31 Thread Eugene Birukov via lldb-dev
ene > From: lab...@google.com > Date: Thu, 31 Mar 2016 09:16:06 +0100 > Subject: Re: [lldb-dev] SBProcess::Detach kills target > To: eugen...@hotmail.com > CC: lldb-dev@lists.llvm.org > > We are not sending the SIGHUP, it is automatically getting sent by the > OS when the

Re: [lldb-dev] SBProcess::Detach kills target

2016-03-31 Thread Greg Clayton via lldb-dev
n MAC? >> >> >> To: lab...@google.com >> Date: Wed, 30 Mar 2016 14:49:33 -0700 >> CC: lldb-dev@lists.llvm.org >> Subject: Re: [lldb-dev] SBProcess::Detach kills target >> From: lldb-dev@lists.llvm.org >> >>

Re: [lldb-dev] SBProcess::Detach kills target

2016-03-31 Thread Pavel Labath via lldb-dev
oken? I.e. the > debugger closes its pty's on detach and that causes the signal? > What is the behavior on MAC? > > > To: lab...@google.com > Date: Wed, 30 Mar 2016 14:49:33 -0700 > CC: lldb-dev@lists.llvm.org > Subject: Re: [lldb-dev] SBProcess::Det

Re: [lldb-dev] SBProcess::Detach kills target

2016-03-30 Thread Eugene Birukov via lldb-dev
it in launch scenario too. Thanks,Eugene > From: lab...@google.com > Date: Wed, 30 Mar 2016 10:22:33 +0100 > Subject: Re: [lldb-dev] SBProcess::Detach kills target > To: eugen...@hotmail.com > CC: jing...@apple.com; lldb-dev@lists.llvm.org > > So I have made a small test progra

Re: [lldb-dev] SBProcess::Detach kills target

2016-03-30 Thread Eugene Birukov via lldb-dev
rom: lab...@google.com > Date: Wed, 30 Mar 2016 10:22:33 +0100 > Subject: Re: [lldb-dev] SBProcess::Detach kills target > To: eugen...@hotmail.com > CC: jing...@apple.com; lldb-dev@lists.llvm.org > > So I have made a small test program (which does nothing but spin in

Re: [lldb-dev] SBProcess::Detach kills target

2016-03-30 Thread Pavel Labath via lldb-dev
So I have made a small test program (which does nothing but spin in a loop), and indeed it is the SIGHUP that kills it after detach. If the test program blocks the signal, then it continues running even after detach: $ cat a.c #include #include int main() { signal(SIGHUP, SIG_IGN); for

Re: [lldb-dev] SBProcess::Detach kills target

2016-03-29 Thread Pavel Labath via lldb-dev
There is no system restriction which prevents you from doing this. (Without any investigation) my guess would be that your inferior is dying of SIGHUP, which it receives when we close the master end of its pty. Could you check whether the behavior persists if your app blocks SIGHUP and/or you

Re: [lldb-dev] SBProcess::Detach kills target

2016-03-25 Thread Greg Clayton via lldb-dev
Calling SBProcess::Detach() on a process that is currently running should always detach and this seems like a bug. This might be this way because if you launch a process in LLDB and then quit: % lldb /bin/ls (lldb) b malloc (lldb) run (lldb) quit This should kill the process if it was launched