[quickjs] Warnings and debug qjsc

This commit is contained in:
John Doty 2023-09-23 08:48:33 -05:00
parent de77e9e6b9
commit c4142cce60
2 changed files with 28 additions and 26 deletions

View file

@ -6512,7 +6512,6 @@ static void get_frame_debug_position(JSContext *ctx, JSStackFrame *sf,
p = JS_VALUE_GET_OBJ(sf->cur_func);
if (js_class_has_bytecode(p->class_id)) {
JSFunctionBytecode *b;
const char *atom_str;
int line_num1;
b = p->u.func.function_bytecode;
@ -6559,7 +6558,6 @@ static void build_backtrace(JSContext *ctx, JSValueConst error_obj,
const char *file_name_str;
int line_num1;
const char *str1;
JSObject *p;
BOOL backtrace_barrier;
js_dbuf_init(ctx, &dbuf);
@ -6592,12 +6590,13 @@ static void build_backtrace(JSContext *ctx, JSValueConst error_obj,
JS_FreeCString(ctx, func_name_str);
if (file_name_str && file_name_str[0]) {
dbuf_printf(&dbuf, " (%s");
dbuf_printf(&dbuf, " (%s", file_name_str);
if (line_num1 >= 0) {
dbuf_printf(&dbuf, ":%d", line_num1);
}
dbuf_putc(&dbuf, ')');
}
JS_FreeCString(ctx, file_name_str);
dbuf_putc(&dbuf, '\n');
/* stop backtrace if JS_EVAL_FLAG_BACKTRACE_BARRIER was used */
@ -54224,7 +54223,7 @@ typedef struct JSDebugContext {
static int js_handle_breakpoint(JSContext *ctx, JSFunctionBytecode *b, int code_offset) {
int next_op;
JSResumeMode resume = JS_RESUME_MODE_CONTINUE;
/* JSResumeMode resume = JS_RESUME_MODE_CONTINUE; */
JSRuntime *rt = ctx->rt;
JSBreakpoint *bp = find_existing_breakpoint(ctx, b, code_offset);
if (bp) {
@ -54234,7 +54233,7 @@ static int js_handle_breakpoint(JSContext *ctx, JSFunctionBytecode *b, int code_
dctx.ctx = ctx;
dctx.sf = ctx->rt->current_stack_frame;
resume = rt->debug_callback(&dctx, JS_BREAK_BREAKPOINT, bp, rt->debug_opaque);
/* resume = */rt->debug_callback(&dctx, JS_BREAK_BREAKPOINT, bp, rt->debug_opaque);
}
}
next_op = bp->replaced_byte;
@ -54249,7 +54248,7 @@ static int js_handle_breakpoint(JSContext *ctx, JSFunctionBytecode *b, int code_
dctx.ctx = ctx;
dctx.sf = ctx->rt->current_stack_frame;
resume = rt->debug_callback(&dctx, JS_BREAK_STEP, NULL, rt->debug_opaque);
/* resume = */rt->debug_callback(&dctx, JS_BREAK_STEP, NULL, rt->debug_opaque);
}
}