[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 35/50] target/i386: Simplify gen_debug usage
From: |
Richard Henderson |
Subject: |
[PATCH 35/50] target/i386: Simplify gen_debug usage |
Date: |
Sun, 28 Feb 2021 15:23:06 -0800 |
Both invocations pass the start of the current instruction,
which is available as s->base.pc_next. The function sets
is_jmp, so we can eliminate a second setting.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/tcg/translate.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index c2bc3c4b22..c135be9063 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -2614,10 +2614,10 @@ static void gen_interrupt(DisasContext *s, int intno,
s->base.is_jmp = DISAS_NORETURN;
}
-static void gen_debug(DisasContext *s, target_ulong cur_eip)
+static void gen_debug(DisasContext *s)
{
gen_update_cc_op(s);
- gen_jmp_im(s, cur_eip);
+ gen_jmp_im(s, s->base.pc_next - s->cs_base);
gen_helper_debug(cpu_env);
s->base.is_jmp = DISAS_NORETURN;
}
@@ -7146,7 +7146,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState
*cpu)
#ifdef WANT_ICEBP
case 0xf1: /* icebp (undocumented, exits to external debugger) */
gen_svm_check_intercept(s, pc_start, SVM_EXIT_ICEBP);
- gen_debug(s, pc_start - s->cs_base);
+ gen_debug(s);
break;
#endif
case 0xfa: /* cli */
@@ -8586,8 +8586,7 @@ static bool i386_tr_breakpoint_check(DisasContextBase
*dcbase, CPUState *cpu,
/* If RF is set, suppress an internally generated breakpoint. */
int flags = dc->base.tb->flags & HF_RF_MASK ? BP_GDB : BP_ANY;
if (bp->flags & flags) {
- gen_debug(dc, dc->base.pc_next - dc->cs_base);
- dc->base.is_jmp = DISAS_NORETURN;
+ gen_debug(dc);
/* The address covered by the breakpoint must be included in
[tb->pc, tb->pc + tb->size) in order to for it to be
properly cleared -- thus we increment the PC here so that
--
2.25.1
- [PATCH 22/50] target/i386: Reduce DisasContext.prefix to uint8_t, (continued)
- [PATCH 22/50] target/i386: Reduce DisasContext.prefix to uint8_t, Richard Henderson, 2021/02/28
- [PATCH 27/50] target/i386: Fix the comment for repz_opt, Richard Henderson, 2021/02/28
- [PATCH 28/50] target/i386: Reorder DisasContext members, Richard Henderson, 2021/02/28
- [PATCH 29/50] target/i386: Add stub generator for helper_set_dr, Richard Henderson, 2021/02/28
- [PATCH 36/50] target/i386: Tidy svm_check_intercept from tcg, Richard Henderson, 2021/02/28
- [PATCH 25/50] target/i386: Leave TF in DisasContext.flags, Richard Henderson, 2021/02/28
- [PATCH 32/50] target/i386: Implement skinit in translate.c, Richard Henderson, 2021/02/28
- [PATCH 30/50] target/i386: Assert !SVME for user-only, Richard Henderson, 2021/02/28
- [PATCH 31/50] target/i386: Assert !GUEST for user-only, Richard Henderson, 2021/02/28
- [PATCH 33/50] target/i386: Eliminate SVM helpers for user-only, Richard Henderson, 2021/02/28
- [PATCH 35/50] target/i386: Simplify gen_debug usage,
Richard Henderson <=
- [PATCH 34/50] target/i386: Mark some helpers as noreturn, Richard Henderson, 2021/02/28
- [PATCH 38/50] target/i386: Remove user stub for cpu_vmexit, Richard Henderson, 2021/02/28
- [PATCH 37/50] target/i386: Remove pc_start argument to gen_svm_check_intercept, Richard Henderson, 2021/02/28
- [PATCH 39/50] target/i386: Cleanup read_crN, write_crN, lmsw, Richard Henderson, 2021/02/28
- [PATCH 40/50] target/i386: Pass env to do_pause and do_hlt, Richard Henderson, 2021/02/28
- [PATCH 41/50] target/i386: Move invlpg, hlt, monitor, mwait to sysemu, Richard Henderson, 2021/02/28
- [PATCH 43/50] target/i386: Inline user cpu_svm_check_intercept_param, Richard Henderson, 2021/02/28
- [PATCH 44/50] target/i386: Eliminate user stubs for read/write_crN, rd/wrmsr, Richard Henderson, 2021/02/28
- [PATCH 45/50] target/i386: Exit tb after wrmsr, Richard Henderson, 2021/02/28
- [PATCH 42/50] target/i386: Unify invlpg, invlpga, Richard Henderson, 2021/02/28