From 5875f13a9f11f40af2f5d9a671dfbf73e1316a07 Mon Sep 17 00:00:00 2001 From: fangting Date: Wed, 16 Jul 2025 16:14:14 +0800 Subject: [PATCH] fix code error Issue:#ICMQEW Signed-off-by: fangting --- ecmascript/napi/jsnapi_expo.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ecmascript/napi/jsnapi_expo.cpp b/ecmascript/napi/jsnapi_expo.cpp index 4996fe134f..e321bb924c 100644 --- a/ecmascript/napi/jsnapi_expo.cpp +++ b/ecmascript/napi/jsnapi_expo.cpp @@ -5147,15 +5147,15 @@ bool JSNApi::StartDebuggerForSocketPair([[maybe_unused]] int tid, [[maybe_unused return false; } - using StartDebugForSocketpair = bool (*)(int, int); + using StartDebugForSocketpair = bool (*)(int, int, bool); auto sym = panda::os::library_loader::ResolveSymbol(handle, "StartDebugForSocketpair"); if (!sym) { LOG_ECMA(ERROR) << "[StartDebuggerForSocketPair] Resolve symbol fail: " << sym.Error().ToString(); return false; } - - bool ret = reinterpret_cast(sym.Value())(tid, socketfd); + // false: not hybrid + bool ret = reinterpret_cast(sym.Value())(tid, socketfd, false); if (!ret) { // Reset the config jsDebuggerManager->SetDebugMode(false); @@ -5230,7 +5230,7 @@ bool JSNApi::NotifyDebugMode([[maybe_unused]] int tid, #ifndef PANDA_TARGET_ARM32 // Initialize debugger - using InitializeDebuggerForSocketpair = bool(*)(void*); + using InitializeDebuggerForSocketpair = bool(*)(void*, bool); auto sym = panda::os::library_loader::ResolveSymbol( jsDebuggerManager->GetDebugLibraryHandle(), "InitializeDebuggerForSocketpair"); if (!sym) { @@ -5238,7 +5238,8 @@ bool JSNApi::NotifyDebugMode([[maybe_unused]] int tid, << sym.Error().ToString(); return false; } - if (!reinterpret_cast(sym.Value())(vm)) { + // false: not hybrid + if (!reinterpret_cast(sym.Value())(vm, false)) { LOG_ECMA(ERROR) << "[NotifyDebugMode] InitializeDebuggerForSocketpair fail"; return false; } @@ -5311,13 +5312,14 @@ bool JSNApi::StoreDebugInfo([[maybe_unused]] int tid, } reinterpret_cast(symOfStoreDebuggerInfo.Value())(tid, vm, debuggerPostTask); bool ret = false; - using InitializeDebuggerForSocketpair = bool(*)(void*); + using InitializeDebuggerForSocketpair = bool(*)(void*, bool); auto sym = panda::os::library_loader::ResolveSymbol(handler, "InitializeDebuggerForSocketpair"); if (!sym) { LOG_ECMA(ERROR) << "[InitializeDebuggerForSocketpair] Resolve symbol fail: " << sym.Error().ToString(); return false; } - ret = reinterpret_cast(sym.Value())(vm); + // false: not hybrid + ret = reinterpret_cast(sym.Value())(vm, false); if (!ret) { // Reset the config vm->GetJsDebuggerManager()->SetDebugMode(false); @@ -5343,15 +5345,15 @@ bool JSNApi::StopDebugger([[maybe_unused]] EcmaVM *vm) const auto &handle = vm->GetJsDebuggerManager()->GetDebugLibraryHandle(); - using StopDebug = void (*)(void *); + using StopDebug = void (*)(void *, bool); auto sym = panda::os::library_loader::ResolveSymbol(handle, "StopDebug"); if (!sym) { LOG_ECMA(ERROR) << sym.Error().ToString(); return false; } - - reinterpret_cast(sym.Value())(vm); + // false: not hybrid + reinterpret_cast(sym.Value())(vm, false); vm->GetJsDebuggerManager()->SetDebugMode(false); uint32_t tid = vm->GetTid(); -- Gitee