qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] target-i386:slightly refactor dr7 related f


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 3/3] target-i386:slightly refactor dr7 related function
Date: Wed, 05 Dec 2012 09:55:13 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2012-12-05 01:56, li guang wrote:
>>> @@ -1014,22 +1016,40 @@ void hw_breakpoint_remove(CPUX86State *env, int 
>>> index)
>>>  int check_hw_breakpoints(CPUX86State *env, int force_dr6_update)
>>>  {
>>>      target_ulong dr6;
>>> -    int reg, type;
>>> +    int index;
>>>      int hit_enabled = 0;
>>> +    bool bp_match = false;
>>> +    bool wp_match = false;
>>>
>>>      dr6 = env->dr[6] & ~0xf;
>>> -    for (reg = 0; reg < 4; reg++) {
>>> -        type = hw_breakpoint_type(env->dr[7], reg);
>>> -        if ((type == 0 && env->dr[reg] == env->eip) ||
>>> -            ((type & 1) && env->cpu_watchpoint[reg] &&
>>> -             (env->cpu_watchpoint[reg]->flags & BP_WATCHPOINT_HIT))) {
>>> -            dr6 |= 1 << reg;
>>> -            if (hw_breakpoint_enabled(env->dr[7], reg))
>>> +       for (index = 0; index < DR7_MAX_BP; index++) {
>>> +        switch (hw_breakpoint_type(env->dr[7], index)) {
>>> +        case DR7_BP_INST:
>>> +            if (env->dr[index] == env->eip) {
>>> +                bp_match = true;
>>> +            }
>>> +            break;
>>> +        case DR7_DATA_WR:
>>> +        case DR7_DATA_RW:
>>> +            if (env->cpu_watchpoint[index] &&
>>> +                env->cpu_watchpoint[index]->flags & BP_WATCHPOINT_HIT) {
>>> +                wp_match = true;
>>> +            }
>>
>> Also here.
>>
> 
> No, just fall through.

I told you how to clearly mark such cases.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux



reply via email to

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