qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]