qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 3/3] target-i386:slightly refactor dr7 relate


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3 3/3] target-i386:slightly refactor dr7 related function
Date: Fri, 7 Dec 2012 10:27:20 +0000

On 7 December 2012 01:25, liguang <address@hidden> wrote:
> diff --git a/target-i386/seg_helper.c b/target-i386/seg_helper.c
> index ff93374..16d489a 100644
> --- a/target-i386/seg_helper.c
> +++ b/target-i386/seg_helper.c
> @@ -465,9 +465,9 @@ static void switch_tss(CPUX86State *env, int tss_selector,
>
>  #ifndef CONFIG_USER_ONLY
>      /* reset local breakpoints */
> -    if (env->dr[7] & 0x55) {
> -        for (i = 0; i < 4; i++) {
> -            if (hw_breakpoint_enabled(env->dr[7], i) == 0x1) {
> +    if (env->dr[7] & DR7_LOCAL_BP_MASK) {
> +        for (i = 0; i < DR7_MAX_BP; i++) {
> +            if (hw_local_breakpoint_enabled(env->dr[7], i)) {
>                  hw_breakpoint_remove(env, i);
>              }
>          }

No, this is still wrong. The check we are making here is
"is local bp enabled and global bp disabled?", not "is
local bp enabled?", so at a minimum your function is
badly misnamed.

-- PMM



reply via email to

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