summaryrefslogtreecommitdiffstats
path: root/debugger.h
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2024-04-27 12:53:38 -0400
committerMalfurious <m@lfurio.us>2024-04-27 12:53:38 -0400
commitac95555111931d77b46ca6ad9fff51ae7db61be9 (patch)
tree3a95a169608dca3740f21af2cdb3dc0df545ed56 /debugger.h
parentb3adf1817b24bdcff3b2ecc1128ec5fa9e57fd23 (diff)
downloadmisplays-ac95555111931d77b46ca6ad9fff51ae7db61be9.tar.gz
misplays-ac95555111931d77b46ca6ad9fff51ae7db61be9.zip
Fix removal of temporary breakpoints when rapidly restarting thread
This bug would occur when the debugger keeps rapidly hitting a breakpoint and restarting execution (and the breakpoint is temporary / one-time). For example, stepping over a long recursive call. It would be possible for the user to manually interrupt execution at the precise moment that the debugee was returning from a single step over the breakpoint. In this scenario, the thread would correctly remain stopped as requested, however the temporary breakpoint would incorrectly remain in the breakpoint list. The cause of this issue is that uninstall_breakpoints only considered removing temporaries if they were currently installed for use. This makes sense, as we have used the b->installed flag as a sort of check to see if we have YET installed the breakpoint (rather than "is it STILL installed?") to ensure that we don't remove it too soon. The more accurate logic here is to acctually check whether the breakpoint has EVER been installed and only then consider it for removal if it is temporary. This fixes the case in question without breaking behavior when performing an initial run single step. Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'debugger.h')
-rw-r--r--debugger.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/debugger.h b/debugger.h
index cea3bba..f14459f 100644
--- a/debugger.h
+++ b/debugger.h
@@ -11,6 +11,7 @@ struct breakpoint {
unsigned long address;
unsigned long text;
int installed;
+ int previously_installed;
int hits;
int user;