28 lines · c
1#include "attach.h"2#include <stdio.h>3#ifdef _WIN324#include <process.h>5#else6#include <unistd.h>7#endif8 9int main(int argc, char const *argv[]) {10 lldb_enable_attach();11 12 if (argc >= 2) {13 // Create the synchronization token.14 FILE *f = fopen(argv[1], "wx");15 if (!f)16 return 1;17 fputs("\n", f);18 fflush(f);19 fclose(f);20 }21 22 // Wait on input from stdin.23 getchar();24 25 printf("pid = %i\n", getpid());26 return 0;27}28