[source debug] refine some code in source debugging (#856)

- move the wait_cond from exec_env to debug_instance, so the debug thread can be waken up by any threads
- process more general query message from debugger
- refine debug instance create/destroy mechanism
- avoid creating debug instance during module instantiating
- avoid blocking execution thread during creating debug instance
- update related documents
This commit is contained in:
Xu Jun
2021-12-06 10:25:38 +08:00
committed by GitHub
parent c8fe1004aa
commit 2af5ae5abb
18 changed files with 401 additions and 145 deletions

View File

@ -419,6 +419,20 @@ struct WASMModule {
uint64 buf_code_size;
#endif
#if WASM_ENABLE_DEBUG_INTERP != 0
/**
* Count how many instances reference this module. When source
* debugging feature enabled, the debugger may modify the code
* section of the module, so we need to report a warning if user
* create several instances based on the same module
*
* Sub_instances created by lib-pthread or spawn API will not
* influence or check the ref count
*/
uint32 ref_count;
korp_mutex ref_count_lock;
#endif
#if WASM_ENABLE_CUSTOM_NAME_SECTION != 0
const uint8 *name_section_buf;
const uint8 *name_section_buf_end;