Implement source debugging for interpreter and AOT (#769)

Implement source debugging feature for classic interpreter and AOT:
- use `cmake -DWAMR_BUILD_DEBUG_INTERP=1` to enable interpreter debugging
- use `cmake -DWAMR_BUILD_DEBUG_AOT=1` to enable AOT debugging

See doc/source_debugging.md for more details.
This commit is contained in:
Wenyong Huang
2021-09-29 13:36:46 +08:00
committed by GitHub
parent b5a67cb91e
commit 9ef37dd781
55 changed files with 10092 additions and 63 deletions

View File

@ -15,7 +15,63 @@
#ifdef __cplusplus
extern "C" {
#endif
#if WASM_ENABLE_DEBUG_INTERP != 0
#define WAMR_SIG_TRAP (5)
#define WAMR_SIG_STOP (19)
#define WAMR_SIG_TERM (15)
#define WAMR_SIG_SINGSTEP (0x1ff)
#define STATUS_RUNNING (0)
#define STATUS_STOP (1)
#define STATUS_EXIT (2)
#define STATUS_STEP (3)
#define IS_WAMR_TERM_SIG(signo) \
((signo) == WAMR_SIG_TERM)
#define IS_WAMR_STOP_SIG(signo) \
((signo) == WAMR_SIG_STOP || (signo) == WAMR_SIG_TRAP)
typedef struct WASMCurrentEnvStatus
{
uint64 signal_flag:32;
uint64 step_count:16;
uint64 running_status:16;
korp_mutex wait_lock;
korp_cond wait_cond;
}WASMCurrentEnvStatus;
WASMCurrentEnvStatus *
wasm_cluster_create_exenv_status();
void
wasm_cluster_destroy_exenv_status(WASMCurrentEnvStatus *status);
void
wasm_cluster_send_signal_all(WASMCluster *cluster, uint32 signo);
void
wasm_cluster_thread_stopped(WASMExecEnv *exec_env);
void
wasm_cluster_thread_waiting_run(WASMExecEnv *exec_env);
void
wasm_cluster_wait_thread_status(WASMExecEnv *exec_env, uint32 * status);
void
wasm_cluster_thread_exited(WASMExecEnv *exec_env);
void
wasm_cluster_thread_continue(WASMExecEnv *exec_env);
void
wasm_cluster_thread_send_signal(WASMExecEnv *exec_env, uint32 signo);
void
wasm_cluster_thread_step(WASMExecEnv *exec_env);
#endif
typedef struct WASMCluster
{
struct WASMCluster *next;