31 lines · c
1#include "attach.h"2#include <stdio.h>3#ifdef _WIN324#include <process.h>5#include <windows.h>6#else7#include <unistd.h>8#endif9 10int main(int argc, char const *argv[]) {11 lldb_enable_attach();12 13 if (argc >= 2) {14 // Create the synchronization token.15 FILE *f = fopen(argv[1], "wx");16 if (!f)17 return 1;18 fputs("\n", f);19 fflush(f);20 fclose(f);21 }22 23 printf("pid = %i\n", getpid());24#ifdef _WIN3225 Sleep(10 * 1000);26#else27 sleep(10);28#endif29 return 0; // breakpoint 130}31