winedbg: Fix stepping over

Eric Pouech eric.pouech at wanadoo.fr
Wed Mar 22 15:10:16 CST 2006


Petr Tesarik wrote:
> Hi,
> 
> this patch fixes a bug in winedbg, which caused it to continue
> execution at a wrong address when stepping over a function call.
> The trouble was that if there was no breakpoint found, the code at the
> end of break_should_continue reversed the PC adjustment and later the
> debugger resumed program execution AFTER the INT3 instruction, which
> is clearly wrong.

> Index: break.c
> ===================================================================
> RCS file: /home/wine/wine/programs/winedbg/break.c,v
> retrieving revision 1.17
> diff -u -r1.17 break.c
> --- break.c	27 Jan 2006 15:22:15 -0000	1.17
> +++ break.c	21 Mar 2006 10:36:07 -0000
> @@ -731,9 +731,13 @@
>      if (code == EXCEPTION_BREAKPOINT)
>          addr->Offset += be_cpu->adjust_pc_for_break(&dbg_context, TRUE);
>  
> +    dbg_curr_thread->stopped_xpoint = find_xpoint(addr, be_xpoint_break);
>      dbg_curr_process->bp[0].enabled = FALSE;  /* disable the step-over breakpoint */
>  
> -    dbg_curr_thread->stopped_xpoint = find_xpoint(addr, be_xpoint_break);
this part looks correct

> +    /* Unconditionally stop on the step-over breakpoint */
> +    if (dbg_curr_thread->stopped_xpoint == 0)
> +	    return FALSE;
> +
but this doesn't... you don't handle the count here...
what you should do is only compute dbg_curr_thread->stopped_xpoint (and 
do the appropriate handling) when its current value is -1 (not found)

A+
-- 
Eric Pouech




More information about the wine-devel mailing list