Fix for debugger disassembly being off by one byte after using nexti
on a "call" instruction.
This commit is contained in:
parent
ec6f37bf3e
commit
ebef9a9519
@ -695,9 +695,8 @@ static BOOL DEBUG_ShallBreak( int bpnum )
|
|||||||
* Determine if we should continue execution after a SIGTRAP signal when
|
* Determine if we should continue execution after a SIGTRAP signal when
|
||||||
* executing in the given mode.
|
* 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;
|
int bpnum;
|
||||||
DWORD oldval;
|
DWORD oldval;
|
||||||
int wpnum;
|
int wpnum;
|
||||||
@ -706,12 +705,14 @@ BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count )
|
|||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
/* If not single-stepping, back up over the int3 instruction */
|
/* If not single-stepping, back up over the int3 instruction */
|
||||||
if (code == EXCEPTION_BREAKPOINT)
|
if (code == EXCEPTION_BREAKPOINT)
|
||||||
|
{
|
||||||
DEBUG_context.Eip--;
|
DEBUG_context.Eip--;
|
||||||
|
addr->off--;
|
||||||
|
}
|
||||||
#endif
|
#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 */
|
breakpoints[0].enabled = FALSE; /* disable the step-over breakpoint */
|
||||||
|
|
||||||
if ((bpnum != 0) && (bpnum != -1))
|
if ((bpnum != 0) && (bpnum != -1))
|
||||||
@ -736,16 +737,16 @@ BOOL DEBUG_ShouldContinue( DWORD code, enum exec_mode mode, int * count )
|
|||||||
{
|
{
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
DEBUG_context.Eip++;
|
DEBUG_context.Eip++;
|
||||||
addr.off++;
|
addr->off++;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!DEBUG_ShallBreak(wpnum)) return TRUE;
|
if (!DEBUG_ShallBreak(wpnum)) return TRUE;
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
if (addr.seg) addrlen = DEBUG_GetSelectorType( addr.seg );
|
if (addr->seg) addrlen = DEBUG_GetSelectorType( addr->seg );
|
||||||
#endif
|
#endif
|
||||||
DEBUG_Printf(DBG_CHN_MESG, "Stopped on watchpoint %d at ", wpnum);
|
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",
|
DEBUG_Printf(DBG_CHN_MESG, " values: old=%lu new=%lu\n",
|
||||||
oldval, breakpoints[wpnum].u.w.oldval);
|
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( mode == EXEC_STEP_OVER || mode == EXEC_STEP_INSTR )
|
||||||
{
|
{
|
||||||
if( DEBUG_CheckLinenoStatus(&addr) == AT_LINENUMBER )
|
if( DEBUG_CheckLinenoStatus(addr) == AT_LINENUMBER )
|
||||||
{
|
{
|
||||||
(*count)--;
|
(*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)
|
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 )
|
if( syminfo.list.sourcefile != NULL )
|
||||||
{
|
{
|
||||||
DEBUG_List(&syminfo.list, NULL, 0);
|
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 */
|
/* 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. */
|
/* must have encountered an int3 in the Windows program; let's skip it. */
|
||||||
if ((bpnum == -1) && code == EXCEPTION_BREAKPOINT)
|
if ((bpnum == -1) && code == EXCEPTION_BREAKPOINT)
|
||||||
|
{
|
||||||
DEBUG_context.Eip++;
|
DEBUG_context.Eip++;
|
||||||
|
addr->off++;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* no breakpoint, continue if in continuous mode */
|
/* no breakpoint, continue if in continuous mode */
|
||||||
|
@ -241,7 +241,7 @@ extern void DEBUG_DelBreakpoint( int num );
|
|||||||
extern void DEBUG_EnableBreakpoint( int num, BOOL enable );
|
extern void DEBUG_EnableBreakpoint( int num, BOOL enable );
|
||||||
extern void DEBUG_InfoBreakpoints(void);
|
extern void DEBUG_InfoBreakpoints(void);
|
||||||
extern BOOL DEBUG_HandleTrap(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 void DEBUG_SuspendExecution( void );
|
||||||
extern enum exec_mode DEBUG_RestartExecution( enum exec_mode mode, int count );
|
extern enum exec_mode DEBUG_RestartExecution( enum exec_mode mode, int count );
|
||||||
extern BOOL DEBUG_IsFctReturn(void);
|
extern BOOL DEBUG_IsFctReturn(void);
|
||||||
|
@ -296,7 +296,8 @@ static BOOL DEBUG_ExceptionProlog(BOOL is_debug, BOOL force, DWORD code)
|
|||||||
DEBUG_LoadEntryPoints("Loading new modules symbols:\n");
|
DEBUG_LoadEntryPoints("Loading new modules symbols:\n");
|
||||||
|
|
||||||
if (!force && is_debug &&
|
if (!force && is_debug &&
|
||||||
DEBUG_ShouldContinue(code,
|
DEBUG_ShouldContinue(&addr,
|
||||||
|
code,
|
||||||
DEBUG_CurrThread->dbg_exec_mode,
|
DEBUG_CurrThread->dbg_exec_mode,
|
||||||
&DEBUG_CurrThread->dbg_exec_count))
|
&DEBUG_CurrThread->dbg_exec_count))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user