winedbg: Only check for break/watch points on first chance exceptions.
This commit is contained in:
parent
0bfb26aa99
commit
394a36c25a
|
@ -775,15 +775,22 @@ BOOL break_should_continue(ADDRESS64* addr, DWORD code)
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* break_ajust_pc
|
||||
* break_adjust_pc
|
||||
*
|
||||
* Adjust PC to the address where the trap (if any) actually occurred
|
||||
* Also sets dbg_curr_thread->stopped_xpoint
|
||||
*/
|
||||
void break_adjust_pc(ADDRESS64* addr, DWORD code, BOOL* is_break)
|
||||
void break_adjust_pc(ADDRESS64* addr, DWORD code, BOOL first_chance, BOOL* is_break)
|
||||
{
|
||||
DWORD oldval = 0;
|
||||
|
||||
/* break / watch points are handled on first chance */
|
||||
if ( !first_chance )
|
||||
{
|
||||
*is_break = TRUE;
|
||||
dbg_curr_thread->stopped_xpoint = -1;
|
||||
return;
|
||||
}
|
||||
*is_break = FALSE;
|
||||
|
||||
/* If not single-stepping, back up to the break instruction */
|
||||
|
|
|
@ -288,7 +288,7 @@ extern void break_delete_xpoint(int num);
|
|||
extern void break_delete_xpoints_from_module(unsigned long base);
|
||||
extern void break_enable_xpoint(int num, BOOL enable);
|
||||
extern void break_info(void);
|
||||
extern void break_adjust_pc(ADDRESS64* addr, DWORD code, BOOL* is_break);
|
||||
extern void break_adjust_pc(ADDRESS64* addr, DWORD code, BOOL first_chance, BOOL* is_break);
|
||||
extern BOOL break_should_continue(ADDRESS64* addr, DWORD code);
|
||||
extern void break_suspend_execution(void);
|
||||
extern void break_restart_execution(int count);
|
||||
|
|
|
@ -107,7 +107,14 @@ static unsigned dbg_fetch_context(void)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static unsigned dbg_exception_prolog(BOOL is_debug, const EXCEPTION_RECORD* rec)
|
||||
/***********************************************************************
|
||||
* dbg_exception_prolog
|
||||
*
|
||||
* Examine exception and decide if interactive mode is entered(return TRUE)
|
||||
* or exception is silently continued(return FALSE)
|
||||
* is_debug means the exception is a breakpoint or single step exception
|
||||
*/
|
||||
static unsigned dbg_exception_prolog(BOOL is_debug, BOOL first_chance, const EXCEPTION_RECORD* rec)
|
||||
{
|
||||
ADDRESS64 addr;
|
||||
BOOL is_break;
|
||||
|
@ -143,7 +150,7 @@ static unsigned dbg_exception_prolog(BOOL is_debug, const EXCEPTION_RECORD* rec)
|
|||
/* this will resynchronize builtin dbghelp's internal ELF module list */
|
||||
SymLoadModule(dbg_curr_process->handle, 0, 0, 0, 0, 0);
|
||||
|
||||
if (is_debug) break_adjust_pc(&addr, rec->ExceptionCode, &is_break);
|
||||
if (is_debug) break_adjust_pc(&addr, rec->ExceptionCode, first_chance, &is_break);
|
||||
/*
|
||||
* Do a quiet backtrace so that we have an idea of what the situation
|
||||
* is WRT the source files.
|
||||
|
@ -398,7 +405,7 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance
|
|||
dbg_printf( ", invalid program stack" );
|
||||
}
|
||||
|
||||
if (dbg_exception_prolog(is_debug, rec))
|
||||
if (dbg_exception_prolog(is_debug, first_chance, rec))
|
||||
{
|
||||
dbg_interactiveP = TRUE;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue