added sys_has_debugger
@@ -669,6 +669,12 @@ HL_PRIM bool hl_sys_check_reload( vbyte *debug_alt_file ) {
return reload_fun && ((bool(*)(void*))reload_fun)(reload_param);
}
+extern int hl_closure_stack_capture;
+
+HL_PRIM bool hl_sys_has_debugger() {
+ return hl_closure_stack_capture != 0;
+}
+
#ifndef HL_MOBILE
const char *hl_sys_special( const char *key ) {
hl_error("Unknown sys_special key");
@@ -711,3 +717,4 @@ DEFINE_PRIM(_I32, sys_getpid, _NO_ARG);
DEFINE_PRIM(_BOOL, sys_check_reload, _BYTES);
DEFINE_PRIM(_VOID, sys_profile_event, _I32 _BYTES _I32);
DEFINE_PRIM(_I32, sys_set_flags, _I32);
+DEFINE_PRIM(_BOOL, sys_has_debugger, _NO_ARG);
\ No newline at end of file
