Support dynamic aot debug (#3788)

Enable dynamic aot debug feature which debugs the aot file
and is able to set the break point and do single step. Refer to
the README for the detailed steps.

Signed-off-by: zhangliangyu3 <zhangliangyu3@xiaomi.com>
This commit is contained in:
Liangyu Zhang
2024-09-18 11:02:10 +08:00
committed by GitHub
parent e9cc8731da
commit 51a71092bf
9 changed files with 307 additions and 0 deletions

View File

@ -49,6 +49,12 @@ else()
add_definitions(-DWASM_ENABLE_WORD_ALIGN_READ=0)
endif()
if(CONFIG_INTERPRETERS_WAMR_DYNAMIC_AOT_DEBUG)
add_definitions(-DWASM_ENABLE_DYNAMIC_AOT_DEBUG=1)
else()
add_definitions(-DWASM_ENABLE_DYNAMIC_AOT_DEBUG=0)
endif()
if(CONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE)
add_definitions(-DWASM_STACK_GUARD_SIZE=0)
else()

View File

@ -148,6 +148,12 @@ else
CFLAGS += -DWASM_ENABLE_WORD_ALIGN_READ=0
endif
ifeq ($(CONFIG_INTERPRETERS_WAMR_DYNAMIC_AOT_DEBUG),y)
CFLAGS += -DWASM_ENABLE_DYNAMIC_AOT_DEBUG=1
else
CFLAGS += -DWASM_ENABLE_DYNAMIC_AOT_DEBUG=0
endif
ifeq ($(CONFIG_INTERPRETERS_WAMR_MEM_DUAL_BUS_MIRROR),y)
CFLAGS += -DWASM_MEM_DUAL_BUS_MIRROR=1
else

View File

@ -928,6 +928,15 @@ main(int argc, char *argv[])
goto fail2;
}
#if WASM_ENABLE_DYNAMIC_AOT_DEBUG != 0
if (!wasm_runtime_set_module_name(wasm_module, wasm_file, error_buf,
sizeof(error_buf))) {
printf("set aot module name failed in dynamic aot debug mode, %s\n",
error_buf);
goto fail3;
}
#endif
#if WASM_ENABLE_LIBC_WASI != 0
libc_wasi_init(wasm_module, argc, argv, &wasi_parse_ctx);
#endif