<div dir="ltr">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 test.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 31, 2015 at 4:08 PM Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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?<br>
<br>
> On Aug 31, 2015, at 3:16 PM, Greg Clayton via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
><br>
> So a few things:<br>
><br>
> 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.<br>
><br>
> 2 - on linux I believe this is solved by doing a manual fork(), sync(), exec().<br>
><br>
> 3 - on windows we have a sync problem for the launch first then attach due to this extra thread. Is this the case?<br>
><br>
> Seems like you should be able to launch with Use the CreateProcess() function, set CREATE_SUSPENDED and then attach no?<br>
><br>
> 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.<br>
><br>
> Greg<br>
><br>
><br>
><br>
>> On Aug 27, 2015, at 4:04 PM, via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> On Thu, Aug 27, 2015 at 10:17:24PM +0000, Zachary Turner wrote:<br>
>>> In what instances do you think it wouldn't work? At least on Windows it's<br>
>>> trivial. Jim provided some code that would work on OSX, and someone else<br>
>>> provided a method earlier in the thread that should work for Linux. What<br>
>>> are the specific reliability concerns you have?<br>
>><br>
>> I'm basing this off our own experiences - we use a similar method to<br>
>> test Android and iOS platforms, and they work most of the time, but fail<br>
>> randomly, about once every 25 runs, because one of the 50 or so test<br>
>> cases couldn't sync up with the debug server on the device. Do other<br>
>> people see similar problems?<br>
>><br>
>> If you're running the tests natively, I bet you'll be fine.<br>
>> _______________________________________________<br>
>> lldb-dev mailing list<br>
>> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_lldb-2Ddev&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=e494ZqshU04UaasD49FjA8X8-41XrPe2DEAUCC4uIBA&m=rcCO6AJ3AdDHg5mYGyuAIclByBVrIHeeEMSbtprurNY&s=7I8Xb9uQ5clKv1lA-TQgZ6iHALia6UDWoINpajCOoQ8&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_lldb-2Ddev&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=e494ZqshU04UaasD49FjA8X8-41XrPe2DEAUCC4uIBA&m=rcCO6AJ3AdDHg5mYGyuAIclByBVrIHeeEMSbtprurNY&s=7I8Xb9uQ5clKv1lA-TQgZ6iHALia6UDWoINpajCOoQ8&e=</a><br>
><br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
<br>
</blockquote></div>