summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-17 21:22:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-17 21:22:18 (GMT)
commite154451a2feb7aa8c265aa7b9b0a67c7676e12c6 (patch)
tree8ba999615b8479cb9c4c68f506bd33203bfefba4 /compat/mingw.c
parentfc25a19265deb84170aab1216228d4e817a17d15 (diff)
parent08809c09aa1351b603e9c55734105cd2e3c24c41 (diff)
downloadgit-e154451a2feb7aa8c265aa7b9b0a67c7676e12c6.zip
git-e154451a2feb7aa8c265aa7b9b0a67c7676e12c6.tar.gz
git-e154451a2feb7aa8c265aa7b9b0a67c7676e12c6.tar.bz2
Merge branch 'js/mingw-open-in-gdb'
Dev support. * js/mingw-open-in-gdb: mingw: add a helper function to attach GDB to the current process
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 402c1ad..b523014 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -13,6 +13,19 @@
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;