Debugging of a basic C program fails when using lldb
The program is: hello.c
#include <stdio.h>
int main()
{
printf("Hello world\n");
return (0);
}
After compilation, linking and running lldb and then the run command. An error is shown
$ lldb hello
(lldb) target create "hello"
Current executable set to 'hello' (x86_64).
(lldb) run
error: process exited with status -1 (Error 1)
Any help in this regard is much appreciated
You need to enable developer mode on a mac before you can debug something. Run DevToolsSecurity -status
to display the current state. When logging in remotely (ssh) or running under something like tmux, you may not be able to debug things because UI interaction (to approve the debug session) is required. You may be able to run DevToolsSecurity -enable
or sudo DevToolsSecurity -enable
? I'm not sure if these behaviors have changed over different macOS versions. But in general, an auth window pops up on the screen and needs to be approved by the user before the debug session is allowed to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With