summaryrefslogtreecommitdiffstats
path: root/src/evalfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 3cb66f3bbc..24c31945d7 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -123,6 +123,9 @@ static void f_cosh(typval_T *argvars, typval_T *rettv);
static void f_count(typval_T *argvars, typval_T *rettv);
static void f_cscope_connection(typval_T *argvars, typval_T *rettv);
static void f_cursor(typval_T *argsvars, typval_T *rettv);
+#ifdef WIN3264
+static void f_debugbreak(typval_T *argvars, typval_T *rettv);
+#endif
static void f_deepcopy(typval_T *argvars, typval_T *rettv);
static void f_delete(typval_T *argvars, typval_T *rettv);
static void f_deletebufline(typval_T *argvars, typval_T *rettv);
@@ -577,6 +580,9 @@ static struct fst
{"count", 2, 4, f_count},
{"cscope_connection",0,3, f_cscope_connection},
{"cursor", 1, 3, f_cursor},
+#ifdef WIN3264
+ {"debugbreak", 1, 1, f_debugbreak},
+#endif
{"deepcopy", 1, 2, f_deepcopy},
{"delete", 1, 2, f_delete},
{"deletebufline", 2, 3, f_deletebufline},
@@ -2761,6 +2767,33 @@ f_cursor(typval_T *argvars, typval_T *rettv)
rettv->vval.v_number = 0;
}
+#ifdef WIN3264
+/*
+ * "debugbreak()" function
+ */
+ static void
+f_debugbreak(typval_T *argvars, typval_T *rettv)
+{
+ int pid;
+
+ rettv->vval.v_number = FAIL;
+ pid = (int)get_tv_number(&argvars[0]);
+ if (pid == 0)
+ EMSG(_(e_invarg));
+ else
+ {
+ HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
+
+ if (hProcess != NULL)
+ {
+ DebugBreakProcess(hProcess);
+ CloseHandle(hProcess);
+ rettv->vval.v_number = OK;
+ }
+ }
+}
+#endif
+
/*
* "deepcopy()" function
*/