Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lldb gives error "error: process exited with status -1 (Error 1)"

Tags:

c

lldb

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

like image 878
Sudheer Hebbale Avatar asked Sep 15 '19 12:09

Sudheer Hebbale


1 Answers

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.

like image 154
Jason Molenda Avatar answered Sep 27 '22 21:09

Jason Molenda