MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / enter_function

Method enter_function

modules/gdscript/gdscript.h:494–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492 bool debug_break_parse(const String &p_file, int p_line, const String &p_error);
493
494 _FORCE_INLINE_ void enter_function(CallLevel *call_level, GDScriptInstance *p_instance, GDScriptFunction *p_function, Variant *p_stack, int *p_ip, int *p_line) {
495 if (!track_call_stack) {
496 return;
497 }
498
499#ifdef DEBUG_ENABLED
500 ScriptDebugger *script_debugger = EngineDebugger::get_script_debugger();
501 if (script_debugger != nullptr && script_debugger->get_lines_left() > 0 && script_debugger->get_depth() >= 0) {
502 script_debugger->set_depth(script_debugger->get_depth() + 1);
503 }
504#endif
505
506 if (unlikely(_call_stack_size >= _debug_max_call_stack)) {
507 _debug_error = vformat("Stack overflow (stack size: %s). Check for infinite recursion in your script.", _debug_max_call_stack);
508
509#ifdef DEBUG_ENABLED
510 if (script_debugger != nullptr) {
511 script_debugger->debug(this);
512 }
513#endif
514
515 return;
516 }
517
518 call_level->prev = _call_stack;
519 _call_stack = call_level;
520 call_level->stack = p_stack;
521 call_level->instance = p_instance;
522 call_level->function = p_function;
523 call_level->ip = p_ip;
524 call_level->line = p_line;
525 _call_stack_size++;
526 }
527
528 _FORCE_INLINE_ void exit_function() {
529 if (!track_call_stack) {

Callers 1

gdscript_vm.cppFile · 0.80

Calls 5

vformatFunction · 0.85
get_lines_leftMethod · 0.45
get_depthMethod · 0.45
set_depthMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected