2019-03-01 20:27:49 -05:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "Breakpoint.h"
|
2019-07-25 22:22:09 -04:00
|
|
|
#include "DebugTypes.h"
|
2019-07-30 22:34:52 -04:00
|
|
|
#include "DebugUtilities.h"
|
2019-03-01 20:27:49 -05:00
|
|
|
|
|
|
|
class ExpressionEvaluator;
|
|
|
|
class Debugger;
|
|
|
|
struct ExpressionData;
|
|
|
|
enum class MemoryOperationType;
|
|
|
|
|
|
|
|
class BreakpointManager
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static constexpr int BreakpointTypeCount = 3; //Read, Write, Exec
|
|
|
|
|
|
|
|
Debugger *_debugger;
|
|
|
|
|
2019-07-30 22:34:52 -04:00
|
|
|
vector<Breakpoint> _breakpoints[(int)DebugUtilities::GetLastCpuType() + 1][BreakpointTypeCount];
|
|
|
|
vector<ExpressionData> _rpnList[(int)DebugUtilities::GetLastCpuType() + 1][BreakpointTypeCount];
|
|
|
|
bool _hasBreakpoint[(int)DebugUtilities::GetLastCpuType() + 1][BreakpointTypeCount] = {};
|
2019-03-01 20:27:49 -05:00
|
|
|
|
2019-07-30 22:34:52 -04:00
|
|
|
unique_ptr<ExpressionEvaluator> _bpExpEval[(int)DebugUtilities::GetLastCpuType() + 1];
|
2019-03-01 20:27:49 -05:00
|
|
|
|
|
|
|
BreakpointType GetBreakpointType(MemoryOperationType type);
|
|
|
|
|
|
|
|
public:
|
|
|
|
BreakpointManager(Debugger *debugger);
|
|
|
|
|
|
|
|
void SetBreakpoints(Breakpoint breakpoints[], uint32_t count);
|
2019-07-25 22:22:09 -04:00
|
|
|
int CheckBreakpoint(CpuType cpuType, MemoryOperationInfo operationInfo, AddressInfo &address);
|
2019-03-01 20:27:49 -05:00
|
|
|
};
|