mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-24 12:44:59 -07:00
demon/win32: roll back on all hit traps, even if explicit. the previous implementation would silently skip threads past explicit traps that they hit, as a way of implicitly storing the fact that trap exceptions had been reported, and the user could continue past them. this resulted in incorrect instruction pointer display in those circumstances. this change adjusts this, so that after a trap exception of any kind, the instruction pointer is ALWAYS rolled back. to ensure that the trap is not repeatedly hit, if the associated exception has already been reported, to allow the user to e.g. step over traps (this is the behavior of Visual Studio), additional state is stored per-thread-entity, which allows a subsequent demon_os_run to adjust RIPs past their previously reported traps before running again.
This commit is contained in:
@@ -2266,6 +2266,31 @@ debug_string_tests(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Interrupt Stepping Tests
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static void
|
||||
interrupt_stepping_tests(void)
|
||||
{
|
||||
for(int i = 0; i < 1000; i += 1)
|
||||
{
|
||||
if(i == 999)
|
||||
{
|
||||
__debugbreak();
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < 1000; i += 1)
|
||||
{
|
||||
if(i == 999)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
int x = 0;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
// NOTE(allen): Exception Stepping
|
||||
|
||||
@@ -2561,6 +2586,8 @@ mule_main(int argc, char** argv){
|
||||
|
||||
debug_string_tests();
|
||||
|
||||
interrupt_stepping_tests();
|
||||
|
||||
exception_stepping_tests();
|
||||
|
||||
return(0);
|
||||
|
||||
Reference in New Issue
Block a user