<div dir="ltr">Hi,<div><br></div><div>My colleague is trying to use our lldb IDE attaching to app run/build from Xcode which failed. I can reproduce this with lldb console:</div><div><br></div><div><div>jeffreytan-mbp:$ ps aux | grep iOSApp</div><div>jeffreytan      61816   0.0  0.0  2432772    676 s002  S+    3:00PM   0:00.00 grep iOSApp</div><div>jeffreytan      61806   0.0  0.2  2721120  38600   ??  SXs   3:00PM   0:00.24 /Users/jeffreytan/Library/Developer/CoreSimulator/Devices/EF17E202-3981-4DB0-87C9-2A9345C1E713/data/Containers/Bundle/Application/CAEBA7D7-D284-4489-8A53-A88E56F9BB04/iOSAppTest.app/iOSAppTest</div><div>jeffreytan-mbp:$ lldb -p 61806</div><div>(lldb) process attach --pid 61806</div><div><b>error: attach failed: attach failed: unable to attach</b></div></div><div><b><br></b></div><div>My theory is:</div><div>1. Xcode does not have the concept of run without debugger and run under debugger, so it always run app with debugger enabled.(Is this true?)</div><div>2. And you can't have two native debuggers debugging the same process on Mac(this is true on Windows, is it true for Mac or Linux?)</div><div><br></div><div>If both are true, can we report meaningful message like "<span style="color:rgb(44,45,48);font-family:Slack-Lato,appleLogo,sans-serif;font-size:15px;line-height:22px;background-color:rgb(249,249,249)">inferior is already being debugged</span>" or something similar instead of the generic error message like "<b>attach failed: unable to attach</b>"? </div><div><br></div><div>Btw: I found I can still use gdb to attach to the process(with a permission elevation dialog pop-up) and see the callstack. How does gdb do that?</div><div><br></div><div>Jeffrey</div></div>