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