diff options
author | Richard Henderson <rth@twiddle.net> | 2015-09-17 15:58:10 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2015-10-07 20:36:28 +1100 |
commit | b933066ae03d924a92b2616b4a24e7d91cd5b841 (patch) | |
tree | a5475afc2a27a25b4f91c8376d68daec05183e2e /target-s390x | |
parent | 959082fc4a93a016a6b697e1e0c2b373d8a3a373 (diff) |
target-*: Introduce and use cpu_breakpoint_test
Reduce the boilerplate required for each target. At the same time,
move the test for breakpoint after calling tcg_gen_insn_start.
Note that arm and aarch64 do not use cpu_breakpoint_test, but still
move the inline test down after tcg_gen_insn_start.
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-s390x')
-rw-r--r-- | target-s390x/translate.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/target-s390x/translate.c b/target-s390x/translate.c index 58cf365c5f..4959828111 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -5330,7 +5330,6 @@ static inline void gen_intermediate_code_internal(S390CPU *cpu, uint64_t next_page_start; int j, lj = -1; int num_insns, max_insns; - CPUBreakpoint *bp; ExitStatus status; bool do_debug; @@ -5373,20 +5372,17 @@ static inline void gen_intermediate_code_internal(S390CPU *cpu, tcg_gen_insn_start(dc.pc); num_insns++; + if (unlikely(cpu_breakpoint_test(cs, dc.pc, BP_ANY))) { + status = EXIT_PC_STALE; + do_debug = true; + break; + } + if (num_insns == max_insns && (tb->cflags & CF_LAST_IO)) { gen_io_start(); } status = NO_EXIT; - if (unlikely(!QTAILQ_EMPTY(&cs->breakpoints))) { - QTAILQ_FOREACH(bp, &cs->breakpoints, entry) { - if (bp->pc == dc.pc) { - status = EXIT_PC_STALE; - do_debug = true; - break; - } - } - } if (status == NO_EXIT) { status = translate_one(env, &dc); } |