xref: /llvm-project/lldb/test/API/functionalities/signal/handle-abrt/main.c (revision 99451b4453688a94c6014cac233d371ab4cc342d)
1 #include <signal.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 
handler(int sig)5 void handler(int sig)
6 {
7     printf("Set a breakpoint here.\n");
8     exit(0);
9 }
10 
abort_caller()11 void abort_caller() {
12     abort();
13 }
14 
main()15 int main()
16 {
17     if (signal(SIGABRT, handler) == SIG_ERR)
18     {
19         perror("signal");
20         return 1;
21     }
22 
23     abort_caller();
24     return 2;
25 }
26