[lldb-dev] How does attach work on non-Windows?
Zachary Turner via lldb-dev
lldb-dev at lists.llvm.org
Mon Aug 31 16:26:06 PDT 2015
I think it's mostly a problem of tests. Basically we have tests which are
written in such a way that the inferior and the debugger need to reach a
synchronization point before the test can proceed to test what it wants to
On Mon, Aug 31, 2015 at 4:08 PM Greg Clayton <gclayton at apple.com> wrote:
> Or is this just a problem with a bad test? Are we telling LLDB to launch
> the test and LLDB is doing the launch + attach in the windows platform and
> that is what is hosing up the attach? Or is this a flawed test where the
> test just manually launches the process with no hopes of syncing with the
> process we are attaching to?
> > On Aug 31, 2015, at 3:16 PM, Greg Clayton via lldb-dev <
> lldb-dev at lists.llvm.org> wrote:
> > So a few things:
> > 1 - on MacOSX we can reliably launch a process via posix_spawn() with a
> flag set that sets the process to stop at __dyld_start which is the first
> instruction in the program. So our launch then attach always works reliably
> because when we launch the process set set this posix_spawn() flag.
> > 2 - on linux I believe this is solved by doing a manual fork(), sync(),
> > 3 - on windows we have a sync problem for the launch first then attach
> due to this extra thread. Is this the case?
> > Seems like you should be able to launch with Use the CreateProcess()
> function, set CREATE_SUSPENDED and then attach no?
> > I would rather not solve this problem that is windows only by requiring
> that all test suite functions link to a .a file. We should be able to
> launch a process and debug it using the launch then attach method that is
> used by our platform.
> > Greg
> >> On Aug 27, 2015, at 4:04 PM, via lldb-dev <lldb-dev at lists.llvm.org>
> >> On Thu, Aug 27, 2015 at 10:17:24PM +0000, Zachary Turner wrote:
> >>> In what instances do you think it wouldn't work? At least on Windows
> >>> trivial. Jim provided some code that would work on OSX, and someone
> >>> provided a method earlier in the thread that should work for Linux.
> >>> are the specific reliability concerns you have?
> >> I'm basing this off our own experiences - we use a similar method to
> >> test Android and iOS platforms, and they work most of the time, but fail
> >> randomly, about once every 25 runs, because one of the 50 or so test
> >> cases couldn't sync up with the debug server on the device. Do other
> >> people see similar problems?
> >> If you're running the tests natively, I bet you'll be fine.
> >> _______________________________________________
> >> lldb-dev mailing list
> >> lldb-dev at lists.llvm.org
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-dev