[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 04/22] target-*: Introduce and use cpu_breakp
From: |
Sergey Fedorov |
Subject: |
Re: [Qemu-devel] [PATCH v2 04/22] target-*: Introduce and use cpu_breakpoint_test |
Date: |
Fri, 18 Sep 2015 15:48:04 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 18.09.2015 13:32, Peter Maydell wrote:
>> +/* Return true if PC matches an installed breakpoint. */
>> > +static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask)
>> > +{
>> > + CPUBreakpoint *bp;
>> > +
>> > + if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) {
>> > + QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
>> > + if (bp->pc == pc && (bp->flags & mask)) {
>> > + return true;
>> > + }
>> > + }
>> > + }
>> > + return false;
>> > +}
> This won't work with the fix for ARM breakpoints Sergey currently has
> on list: http://patchwork.ozlabs.org/patch/517359/
> where we need to behave differently for "there's a GDB breakpoint
> here" and "there's a CPU breakpoint here" (because the complex
> conditions on the latter require us to call a helper function to
> see if we need to actually generate an EXCP_DEBUG exception).
>
This is actually a good idea to move this boilerplate code into a single
function. I think the problem can be solved by simply adding an optional
parameter to get a reference to the matched breakpoint back from this
function.
Best regards,
Sergey
- [Qemu-devel] [PATCH v2 01/22] tcg: Rename debug_insn_start to insn_start, (continued)
- [Qemu-devel] [PATCH v2 01/22] tcg: Rename debug_insn_start to insn_start, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 02/22] target-*: Unconditionally emit tcg_gen_insn_start, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 08/22] target-mips: Add delayed branch state to insn_start, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 07/22] target-i386: Add cc_op state to insn_start, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 04/22] target-*: Introduce and use cpu_breakpoint_test, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 09/22] target-s390x: Add cc_op state to insn_start, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 10/22] target-sh4: Add flags state to insn_start, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 11/22] target-cris: Mirror gen_opc_pc into insn_start, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 12/22] target-sparc: Tidy gen_branch_a interface, Richard Henderson, 2015/09/18
- [Qemu-devel] [PATCH v2 15/22] target-sparc: Add npc state to insn_start, Richard Henderson, 2015/09/18