qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] target-arm: fix CPU breakpoint handling


From: Sergey Fedorov
Subject: Re: [Qemu-devel] [PATCH] target-arm: fix CPU breakpoint handling
Date: Fri, 25 Sep 2015 14:42:54 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 25.09.2015 14:34, Sergey Fedorov wrote:
> On 18.09.2015 17:07, Sergey Fedorov wrote:
>> On 18.09.2015 16:50, Peter Maydell wrote:
>>> On 14 September 2015 at 11:51, Sergey Fedorov <address@hidden> wrote:
>>> @@ -904,7 +913,16 @@ void arm_debug_excp_handler(CPUState *cs)
>>>                      arm_debug_target_el(env));
>>>          }
>>>      } else {
>>> -        if (check_breakpoints(cpu)) {
>>> +        CPUBreakpoint *bp;
>>> +        uint64_t pc = is_a64(env) ? env->pc : env->regs[15];
>>> +
>>> +        QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {
>>> +            if (bp->pc == pc && !(bp->flags & BP_CPU)) {
>>> +                return;
>>> +            }
>>> +        }
>>> This extra code looks right, but isn't it fixing a different bug?
>> You are right, it would better come to separate patch.
> Actually, I can't think of it as a separate patch. This change is really
> required only if we remove check_breakpoints() here. Otherwise
> check_breakpoints() calls bp_wp_matches() which do the necessary check.
>
...but considering the order of breakpoint enumeration it is not so
simple. The difference is when we have GDB and CPU breakpoint to the
same address. In this case check_breakpoints() returns true, but we
should handle GDB breakpoints first. Sorry for my misunderstanding, I
will split this patch as you suggested.

Best regards,
Sergey



reply via email to

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