On 6/20/24 16:46, YunQiang Su wrote:
@@ -4553,7 +4559,7 @@ static void gen_trap(DisasContext *ctx, uint32_t opc, if (ctx->hflags != ctx->saved_hflags) { tcg_gen_movi_i32(hflags, ctx->hflags); } - generate_exception(ctx, EXCP_TRAP); + generate_exception_with_code(ctx, EXCP_TRAP, code); gen_set_label(l1); } }
There are two instances within gen_trap, one of which *does* store into error_code, but that gets overwritten by do_raise_exception_err.
Search for EXCP_TRAP. r~