Preserve execution memory for debug instance (#1072)

During debugging, the debug client may request to malloc a memory space
to evaluate the user expressions. If we malloc memory from the linear memory,
it may fail when the thread is in stop status. We preserve a buffer during
creating debug instance, and use a simple bump pointer allocator to serve lldb's
memory request.
This commit is contained in:
Xu Jun
2022-04-04 08:23:55 +08:00
committed by GitHub
parent f0dc6a3015
commit 24afd4e7cb
3 changed files with 63 additions and 18 deletions

View File

@ -155,6 +155,15 @@
#define WASM_ENABLE_DEBUG_INTERP 0
#endif
#if WASM_ENABLE_DEBUG_INTERP != 0
#ifndef DEBUG_EXECUTION_MEMORY_SIZE
/* 0x85000 is the size required by lldb, if this is changed to a smaller value,
* then the debugger will not be able to evaluate user expressions, other
* functionality such as breakpoint and stepping are not influenced by this */
#define DEBUG_EXECUTION_MEMORY_SIZE 0x85000
#endif
#endif /* end of WASM_ENABLE_DEBUG_INTERP != 0 */
#ifndef WASM_ENABLE_DEBUG_AOT
#define WASM_ENABLE_DEBUG_AOT 0
#endif