From 36b5d6f1896883b936a71995ac95ebbf3604c37d Mon Sep 17 00:00:00 2001 From: gongyuhang Date: Thu, 22 Sep 2022 20:33:33 +0800 Subject: [PATCH] Fix jerry-debugger's unexpected behavior when re-entering a function after a step operation. Clear flag JERRY_DEBUGGER_VM_STOP and set debugger_stop_context Null everytime jerry's debugger call a function. Issue:https://gitee.com/openharmony/third_party_jerryscript/issues/I5SMSQ Test: N/A Signed-off-by: gongyuhang --- jerry-core/api/jerry.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jerry-core/api/jerry.c b/jerry-core/api/jerry.c index 923e0f96..c5e0216a 100644 --- a/jerry-core/api/jerry.c +++ b/jerry-core/api/jerry.c @@ -2871,6 +2871,14 @@ jerry_call_function (const jerry_value_t func_obj_val, /**< function object to c jerry_assert_api_available (); #if ENABLED (JERRY_DEBUGGER) + /** + * Clear flag JERRY_DEBUGGER_VM_STOP and set debugger_stop_context Null everytime jerry's debugger call a function. + * This could solve the problem that jerry's debugger stops at an unexpected line when re-entering a function after a + * step-operation. + */ + JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_VM_STOP); + JERRY_CONTEXT (debugger_stop_context) = NULL; + if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED) { if (jerry_debugger_receive (NULL)) { JERRY_DEBUG_MSG ("resume"); -- Gitee