]> git.ipfire.org Git - thirdparty/git.git/blobdiff - compat/mingw.c
Merge branch 'js/mingw-open-in-gdb'
[thirdparty/git.git] / compat / mingw.c
index 402c1ad91c1449c883bfee31b5be5303934a09cc..b5230149db53c4c49db930d75146224180d36368 100644 (file)
 
 static const int delay[] = { 0, 1, 10, 20, 40 };
 
+void open_in_gdb(void)
+{
+       static struct child_process cp = CHILD_PROCESS_INIT;
+       extern char *_pgmptr;
+
+       argv_array_pushl(&cp.args, "mintty", "gdb", NULL);
+       argv_array_pushf(&cp.args, "--pid=%d", getpid());
+       cp.clean_on_exit = 1;
+       if (start_command(&cp) < 0)
+               die_errno("Could not start gdb");
+       sleep(1);
+}
+
 int err_win_to_posix(DWORD winerr)
 {
        int error = ENOSYS;