thermosphere: sw breakpoint code, etc.

This commit is contained in:
TuxSH
2019-08-08 21:38:13 +02:00
parent f8266775f6
commit 6289d2e398
12 changed files with 403 additions and 28 deletions

View File

@@ -16,22 +16,26 @@
#pragma once
#define _REENT_ONLY
#include <errno.h>
#include "breakpoints_watchpoints_common.h"
#include "spinlock.h"
/// Structure to synchronize and keep track of watchpoints
typedef struct WatchpointManager {
DebugRegisterPair splitWatchpoints[16 * 8];
RecursiveSpinlock lock;
u32 numSplitWatchpoints;
u32 maxWatchpoints;
u32 maxSplitWatchpoints;
u16 allocationBitmap;
DebugRegisterPair splitWatchpoints[16 * 8];
} WatchpointManager;
extern WatchpointManager g_watchpointManager;
void initWatchpoints(void);
DebugRegisterPair *findSplitWatchpoint(u64 addr, size_t size, WatchpointLoadStoreControl direction, bool strict);
bool addWatchpoint(u64 addr, size_t size, WatchpointLoadStoreControl direction);
bool removeWatchpoint(u64 addr, size_t size, WatchpointLoadStoreControl direction);
int addWatchpoint(u64 addr, size_t size, WatchpointLoadStoreControl direction);
int removeWatchpoint(u64 addr, size_t size, WatchpointLoadStoreControl direction);
int removeAllWatchpoints(void);