Skip to content

Commit

Permalink
added sys_has_debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Sep 13, 2022
1 parent 36619c3 commit d6c2899
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/std/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);

0 comments on commit d6c2899

Please sign in to comment.