From fca42b58fbbcd1a8230b54cf8d1e1c5a342c8693 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Fri, 3 Jun 2022 23:24:10 -0700 Subject: [PATCH] Improved OPCODE debug by tracing native functions. --- src/njs_function.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/njs_function.c b/src/njs_function.c index a89476d0..e5a29054 100644 --- a/src/njs_function.c +++ b/src/njs_function.c @@ -711,6 +711,17 @@ njs_function_native_call(njs_vm_t *vm) native = vm->top_frame; function = native->function; +#ifdef NJS_OPCODE_DEBUG + njs_str_t name; + + ret = njs_builtin_match_native_function(vm, function, &name); + if (ret != NJS_OK) { + name = njs_entry_unknown; + } + + njs_printf("CALL NATIVE %V\n", &name); +#endif + if (njs_fast_path(function->bound == NULL)) { call = function->u.native; -- 2.47.3