File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 14
14
15
15
#define HCAST (type , handle ) ((type)(intptr_t)handle)
16
16
17
+ void open_in_gdb (void )
18
+ {
19
+ static struct child_process cp = CHILD_PROCESS_INIT ;
20
+ extern char * _pgmptr ;
21
+
22
+ argv_array_pushl (& cp .args , "mintty" , "gdb" , NULL );
23
+ argv_array_pushf (& cp .args , "--pid=%d" , getpid ());
24
+ cp .clean_on_exit = 1 ;
25
+ if (start_command (& cp ) < 0 )
26
+ die_errno ("Could not start gdb" );
27
+ sleep (1 );
28
+ }
29
+
17
30
int err_win_to_posix (DWORD winerr )
18
31
{
19
32
int error = ENOSYS ;
Original file line number Diff line number Diff line change @@ -691,6 +691,16 @@ extern CRITICAL_SECTION pinfo_cs;
691
691
int wmain (int argc , const wchar_t * * w_argv );
692
692
int main (int argc , const char * * argv );
693
693
694
+ /*
695
+ * For debugging: if a problem occurs, say, in a Git process that is spawned
696
+ * from another Git process which in turn is spawned from yet another Git
697
+ * process, it can be quite daunting to figure out what is going on.
698
+ *
699
+ * Call this function to open a new MinTTY (this assumes you are in Git for
700
+ * Windows' SDK) with a GDB that attaches to the current process right away.
701
+ */
702
+ extern void open_in_gdb (void );
703
+
694
704
/*
695
705
* Used by Pthread API implementation for Windows
696
706
*/
You can’t perform that action at this time.
0 commit comments