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:
@ -44,6 +44,12 @@ typedef enum debug_state_t {
|
||||
APP_STOPPED
|
||||
} debug_state_t;
|
||||
|
||||
typedef struct WASMDebugExecutionMemory {
|
||||
uint32 start_offset;
|
||||
uint32 size;
|
||||
uint32 current_pos;
|
||||
} WASMDebugExecutionMemory;
|
||||
|
||||
typedef struct WASMDebugInstance {
|
||||
struct WASMDebugInstance *next;
|
||||
WASMDebugControlThread *control_thread;
|
||||
@ -60,6 +66,11 @@ typedef struct WASMDebugInstance {
|
||||
* RUNNING when receiving STEP/CONTINUE commands, and set to
|
||||
* STOPPED when any thread stopped */
|
||||
volatile debug_state_t current_state;
|
||||
/* Execution memory info. During debugging, the debug client may request to
|
||||
* malloc a memory space to evaluate user expressions. We preserve a buffer
|
||||
* during creating debug instance, and use a simple bump pointer allocator
|
||||
* to serve lldb's memory request */
|
||||
WASMDebugExecutionMemory exec_mem_info;
|
||||
} WASMDebugInstance;
|
||||
|
||||
typedef enum WASMDebugEventKind {
|
||||
|
||||
Reference in New Issue
Block a user