thermosphere: add watchpoint + watchpoint merging code

This commit is contained in:
TuxSH
2019-08-07 21:38:40 +02:00
parent 9bc0ed2f70
commit 83c6e2f0e7
5 changed files with 278 additions and 8 deletions

View File

@@ -58,7 +58,7 @@ static void freeBreakpoint(u32 pos)
static DebugRegisterPair *findBreakpoint(u64 addr)
{
u16 bitmap = g_breakpointManager.allocationBitmap;
u16 bitmap = ~g_breakpointManager.allocationBitmap & 0xFFFF;
while (bitmap != 0) {
u32 pos = __builtin_ffs(bitmap);
if (pos == 0) {
@@ -119,6 +119,7 @@ bool removeBreakpoint(u64 addr)
DebugRegisterPair *regs = findBreakpoint(addr);
if (findBreakpoint(addr) == NULL) {
recursiveSpinlockUnlock(&g_breakpointManager.lock);
return false;
}
@@ -128,4 +129,4 @@ bool removeBreakpoint(u64 addr)
// TODO commit & broadcast
return true;
}
}