diff --git a/debugger/break.c b/debugger/break.c index 311746516b01ed300b2a78c760e7a3a2020cc2b0..b3a07ba7982c3e706d9c6470d8dcf927249ecf79 100644 --- a/debugger/break.c +++ b/debugger/break.c @@ -695,9 +695,8 @@ static BOOL DEBUG_ShallBreak( int bpnum ) * Determine if we should continue execution after a SIGTRAP signal when * executing in the given mode. */ -BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count ) +BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, enum exec_mode mode, int * count ) { - DBG_ADDR addr; int bpnum; DWORD oldval; int wpnum; @@ -706,12 +705,14 @@ BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count ) #ifdef __i386__ /* If not single-stepping, back up over the int3 instruction */ - if (code == EXCEPTION_BREAKPOINT) + if (code == EXCEPTION_BREAKPOINT) + { DEBUG_context.Eip--; + addr->off--; + } #endif - DEBUG_GetCurrentAddress( &addr ); - bpnum = DEBUG_FindBreakpoint( &addr, DBG_BREAK ); + bpnum = DEBUG_FindBreakpoint( addr, DBG_BREAK ); breakpoints[0].enabled = FALSE; /* disable the step-over breakpoint */ if ((bpnum != 0) && (bpnum != -1)) @@ -736,16 +737,16 @@ BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count ) { #ifdef __i386__ DEBUG_context.Eip++; - addr.off++; + addr->off++; #endif } if (!DEBUG_ShallBreak(wpnum)) return TRUE; #ifdef __i386__ - if (addr.seg) addrlen = DEBUG_GetSelectorType( addr.seg ); + if (addr->seg) addrlen = DEBUG_GetSelectorType( addr->seg ); #endif DEBUG_Printf(DBG_CHN_MESG, "Stopped on watchpoint %d at ", wpnum); - syminfo = DEBUG_PrintAddress( &addr, addrlen, TRUE ); + syminfo = DEBUG_PrintAddress( addr, addrlen, TRUE ); DEBUG_Printf(DBG_CHN_MESG, " values: old=%lu new=%lu\n", oldval, breakpoints[wpnum].u.w.oldval); @@ -761,7 +762,7 @@ BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count ) */ if( mode == EXEC_STEP_OVER || mode == EXEC_STEP_INSTR ) { - if( DEBUG_CheckLinenoStatus(&addr) == AT_LINENUMBER ) + if( DEBUG_CheckLinenoStatus(addr) == AT_LINENUMBER ) { (*count)--; } @@ -785,7 +786,7 @@ BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count ) */ if (mode != EXEC_CONT && mode != EXEC_PASS && mode != EXEC_FINISH) { - DEBUG_FindNearestSymbol( &addr, TRUE, NULL, 0, &syminfo.list); + DEBUG_FindNearestSymbol( addr, TRUE, NULL, 0, &syminfo.list); if( syminfo.list.sourcefile != NULL ) { DEBUG_List(&syminfo.list, NULL, 0); @@ -796,7 +797,10 @@ BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count ) /* If there's no breakpoint and we are not single-stepping, then we */ /* must have encountered an int3 in the Windows program; let's skip it. */ if ((bpnum == -1) && code == EXCEPTION_BREAKPOINT) + { DEBUG_context.Eip++; + addr->off++; + } #endif /* no breakpoint, continue if in continuous mode */ diff --git a/debugger/debugger.h b/debugger/debugger.h index 9a7adec897b5f8f61b0012437f6b22f887ea89be..b5c021e78c3eee6a6bb63e08b9085f8e50ac07f7 100644 --- a/debugger/debugger.h +++ b/debugger/debugger.h @@ -241,7 +241,7 @@ extern void DEBUG_DelBreakpoint( int num ); extern void DEBUG_EnableBreakpoint( int num, BOOL enable ); extern void DEBUG_InfoBreakpoints(void); extern BOOL DEBUG_HandleTrap(void); -extern BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count ); +extern BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, enum exec_mode mode, int * count ); extern void DEBUG_SuspendExecution( void ); extern enum exec_mode DEBUG_RestartExecution( enum exec_mode mode, int count ); extern BOOL DEBUG_IsFctReturn(void); diff --git a/debugger/winedbg.c b/debugger/winedbg.c index c5fb9ce5283c49b2514250b13d40dc273a12e980..8825b7041e4b02f4c39f7fbe02ba84032db4fc2f 100644 --- a/debugger/winedbg.c +++ b/debugger/winedbg.c @@ -296,7 +296,8 @@ static BOOL DEBUG_ExceptionProlog(BOOL is_debug, BOOL force, DWORD code) DEBUG_LoadEntryPoints("Loading new modules symbols:\n"); if (!force && is_debug && - DEBUG_ShouldContinue(code, + DEBUG_ShouldContinue(&addr, + code, DEBUG_CurrThread->dbg_exec_mode, &DEBUG_CurrThread->dbg_exec_count)) return FALSE;