[quickjs] Debugger

This commit is contained in:
John Doty 2023-09-22 13:26:33 -05:00
parent c96a1a4979
commit 6fa3e64b8d
3 changed files with 265 additions and 11 deletions

View file

@ -1050,6 +1050,34 @@ typedef void JSMapSourceFunc(JSContext *ctx, void *opaque, JSAtom file, int line
void JS_SetSourceMapFunc(JSRuntime *rt, JSMapSourceFunc *map_func, void *opaque);
/* Debugger support */
typedef struct JSDebugContext JSDebugContext;
JSContext *JS_DebugGetContext(JSDebugContext *ctx);
typedef enum JSResumeMode {
JS_RESUME_MODE_CONTINUE,
JS_RESUME_MODE_STEP_OVER,
JS_RESUME_MODE_STEP_INTO,
} JSResumeMode;
typedef enum JSBreakReason {
JS_BREAK_BREAKPOINT,
JS_BREAK_STEP,
} JSBreakReason;
typedef struct JSBreakpoint JSBreakpoint;
typedef JSResumeMode JSDebugCallbackFunc(JSDebugContext *ctx, JSBreakReason reason, JSBreakpoint *breakpoint, void *opaque);
void JS_SetDebugCallbackFunc(JSRuntime *rt, JSDebugCallbackFunc *bp_func, void *opqaue);
JSBreakpoint *JS_SetBreakpoint(JSContext *ctx, JSAtom file, int line);
JSBreakpoint *JS_DupBreakpoint(JSBreakpoint *breakpoint);
void JS_DeleteBreakpoint(JSBreakpoint *breakpoint);
JS_BOOL JS_GetBreakpointEnabled(JSBreakpoint *breakpoint);
void JS_SetBreakpointEnabled(JSBreakpoint *breakpoint, JS_BOOL enabled);
void JS_GetBreakpointLocation(JSBreakpoint *breakpoint, JSAtom *file, int *line);
#undef js_unlikely
#undef js_force_inline