Merge main into dev/socket
This commit is contained in:
@ -290,11 +290,7 @@ moudle_destroyer(uint8 *buffer, uint32 size)
|
||||
#endif /* WASM_ENABLE_MULTI_MODULE */
|
||||
|
||||
#if WASM_ENABLE_GLOBAL_HEAP_POOL != 0
|
||||
#ifdef __NuttX__
|
||||
static char global_heap_buf[WASM_GLOBAL_HEAP_SIZE * BH_KB] = { 0 };
|
||||
#else
|
||||
static char global_heap_buf[10 * 1024 * 1024] = { 0 };
|
||||
#endif
|
||||
static char global_heap_buf[WASM_GLOBAL_HEAP_SIZE] = { 0 };
|
||||
#endif
|
||||
|
||||
int
|
||||
@ -336,7 +332,6 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
#if WASM_ENABLE_DEBUG_INTERP != 0
|
||||
char *ip_addr = NULL;
|
||||
/* int platform_port = 0; */
|
||||
int instance_port = 0;
|
||||
#endif
|
||||
|
||||
@ -484,7 +479,8 @@ main(int argc, char *argv[])
|
||||
else if (!strncmp(argv[0], "--version", 9)) {
|
||||
uint32 major, minor, patch;
|
||||
wasm_runtime_get_version(&major, &minor, &patch);
|
||||
printf("iwasm %u.%u.%u\n", major, minor, patch);
|
||||
printf("iwasm %" PRIu32 ".%" PRIu32 ".%" PRIu32 "\n", major, minor,
|
||||
patch);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@ -516,7 +512,6 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_DEBUG_INTERP != 0
|
||||
init_args.platform_port = 0;
|
||||
init_args.instance_port = instance_port;
|
||||
if (ip_addr)
|
||||
strcpy(init_args.ip_addr, ip_addr);
|
||||
@ -591,6 +586,23 @@ main(int argc, char *argv[])
|
||||
goto fail3;
|
||||
}
|
||||
|
||||
#if WASM_ENABLE_DEBUG_INTERP != 0
|
||||
if (ip_addr != NULL) {
|
||||
wasm_exec_env_t exec_env =
|
||||
wasm_runtime_get_exec_env_singleton(wasm_module_inst);
|
||||
uint32_t debug_port;
|
||||
if (exec_env == NULL) {
|
||||
printf("%s\n", wasm_runtime_get_exception(wasm_module_inst));
|
||||
goto fail4;
|
||||
}
|
||||
debug_port = wasm_runtime_start_debug_instance(exec_env);
|
||||
if (debug_port == 0) {
|
||||
printf("Failed to start debug instance\n");
|
||||
goto fail4;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (is_repl_mode)
|
||||
app_instance_repl(wasm_module_inst);
|
||||
else if (func_name)
|
||||
@ -600,6 +612,9 @@ main(int argc, char *argv[])
|
||||
|
||||
ret = 0;
|
||||
|
||||
#if WASM_ENABLE_DEBUG_INTERP != 0
|
||||
fail4:
|
||||
#endif
|
||||
/* destroy the module instance */
|
||||
wasm_runtime_deinstantiate(wasm_module_inst);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user