2 years ago

#62697

test-img

Phillip S

Can't debug using lldb on Apple M1 over ssh

When I run lldb with my program then do "run" in lldb, I get

error: process exited with status -1 (this is a non-interactive debug session, cannot get permission to debug processes.)

I've done both of these:

  • sudo DevToolsSecurity --enable
  • spctl developer-mode enable-terminal

That allowed me to debug when I'm sitting at the Mac, but it would be much more convenient to ssh in and use it remotely. Before I ran the above commands, both my program & lldb would be killed when I tried to run them.

Edited to add: One problem is that all programs on Apple silicon must be codesigned. I'm not building with Xcode, so I'm not automatically signing the code (yet).

I temporarily turned off System Integrity Protection until I can update our build process, which allows me to run the unsigned binaries I'm building, but I still haven't figured out how to remotely debug. If I'm sitting at the computer, it doesn't pop up a request for permission to debug. When I'm using ssh remotely, it gives the "non-interactive debug session" message from above.

ssh

lldb

macos-monterey

0 Answers

Your Answer

Accepted video resources