debug-engine: Fix process_port handling (#1415)

process_port=1 means "use port 1"
This commit is contained in:
YAMAMOTO Takashi 2022-08-25 21:03:44 +09:00 committed by GitHub
parent 7c75f6cf63
commit ee98b583d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,7 @@ control_thread_routine(void *arg)
control_thread->port =
(g_debug_engine->process_base_port == 0)
? 0
: g_debug_engine->process_base_port + debug_inst->id;
: g_debug_engine->process_base_port + debug_inst->id - 1;
LOG_WARNING("control thread of debug object %p start\n", debug_inst);
@ -290,7 +290,6 @@ wasm_debug_engine_init(char *ip_addr, int32 process_port)
}
if (g_debug_engine) {
process_port -= 1;
g_debug_engine->process_base_port =
(process_port > 0) ? process_port : 0;
if (ip_addr)