Lldb attached to OS X process from ssh session

How can I connect lldb to a running process when I ssh in OS X? I cannot debug this application from a terminal window because changing windows will change some state of the user interface that I am trying to debug.

When I attach lldb from an ssh session, it says: "Connection failed: connection lost."

EDIT: This is not ssh that is disconnecting. I am not disconnecting from ssh, it is just that lldb will not attach while I am in an ssh session.

+6
source share
1 answer

The security policy for debugging in OS X requires that the administrator user on the main console authenticate to enable debugging on this computer. It is not possible to do this remotely on purpose. One way to do this is to run Xcode and debug something (no matter what) on the machine you are entering. This will lead to the "you want to enable debugging on this machine" dialog that the admin user must authenticate.

You can also enable debugging by running the tool:

> /usr/sbin/DevToolsSecurity --enable 

but again, this will lead to a GUI confirmation dialog, so you must have access to the console for authentication.

You can also manually change the security policies on the target system so as not to require authentication for debugging, but I only know that this is possible, and not how to do it ...

+9
source

Source: https://habr.com/ru/post/978967/


All Articles