thermosphere: unfuck sw breakpoint logic

This commit is contained in:
TuxSH
2020-01-21 01:27:47 +00:00
parent 09bb173757
commit cfdf1e7ec6
4 changed files with 65 additions and 48 deletions

View File

@@ -19,16 +19,18 @@
#define _REENT_ONLY
#include <errno.h>
#include <stdatomic.h>
#include "spinlock.h"
#define MAX_SW_BREAKPOINTS 32
typedef struct SoftwareBreakpoint {
u64 address; // VA
uintptr_t address; // VA
u32 savedInstruction;
u32 uid;
bool persistent;
bool applied;
atomic_bool triedToApplyOrRevert;
} SoftwareBreakpoint;
typedef struct SoftwareBreakpointManager {
@@ -45,4 +47,4 @@ bool applyAllSoftwareBreakpoints(void);
int addSoftwareBreakpoint(u64 addr, bool persistent);
int removeSoftwareBreakpoint(u64 addr, bool keepPersistent);
int removeAllSoftwareBreakpoints(bool keepPersistent);
int removeAllSoftwareBreakpoints(bool keepPersistent);