Skip to content

Commit

Permalink
wasm_runtime_start_debug_instance: Don't create debug instance for AOT (
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt authored Aug 19, 2022
1 parent 0ec99e9 commit ccd664b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/iwasm/common/wasm_runtime_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,17 @@ wasm_runtime_is_xip_file(const uint8 *buf, uint32 size)
uint32
wasm_runtime_start_debug_instance(WASMExecEnv *exec_env)
{
WASMModuleInstanceCommon *module_inst =
wasm_runtime_get_module_inst(exec_env);
WASMCluster *cluster = wasm_exec_env_get_cluster(exec_env);
bh_assert(module_inst);
bh_assert(cluster);

if (module_inst->module_type != Wasm_Module_Bytecode) {
LOG_WARNING("Attempt to create a debug instance for an AOT module");
return 0;
}

if (cluster->debug_inst) {
LOG_WARNING("Cluster already bind to a debug instance");
return cluster->debug_inst->control_thread->port;
Expand Down Expand Up @@ -5041,4 +5049,4 @@ wasm_runtime_get_version(uint32_t *major, uint32_t *minor, uint32_t *patch)
*major = WAMR_VERSION_MAJOR;
*minor = WAMR_VERSION_MINOR;
*patch = WAMR_VERSION_PATCH;
}
}

0 comments on commit ccd664b

Please sign in to comment.