2016-12-02 00:38:48 +00:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "DebuggerTypes.h"
|
|
|
|
#include "IMemoryHandler.h"
|
|
|
|
#include <unordered_set>
|
2016-12-09 05:02:56 +00:00
|
|
|
class Debugger;
|
2016-12-02 00:38:48 +00:00
|
|
|
|
|
|
|
class MemoryAccessCounter
|
|
|
|
{
|
|
|
|
private:
|
2016-12-09 05:02:56 +00:00
|
|
|
Debugger* _debugger;
|
2017-03-02 01:52:15 +00:00
|
|
|
vector<int32_t> _readCounts[4];
|
|
|
|
vector<int32_t> _writeCounts[4];
|
|
|
|
vector<int32_t> _execCounts[4];
|
2016-12-02 00:38:48 +00:00
|
|
|
|
2017-03-02 01:52:15 +00:00
|
|
|
vector<int32_t> _readStamps[4];
|
|
|
|
vector<int32_t> _writeStamps[4];
|
|
|
|
vector<int32_t> _execStamps[4];
|
2016-12-02 00:38:48 +00:00
|
|
|
|
2017-03-02 01:52:15 +00:00
|
|
|
std::unordered_set<int32_t> _initWrites[4];
|
|
|
|
std::unordered_set<int32_t> _uninitReads[4];
|
|
|
|
|
|
|
|
vector<int32_t>& GetArray(MemoryOperationType operationType, AddressType addressType, bool stampArray);
|
2016-12-09 05:02:56 +00:00
|
|
|
|
2016-12-02 00:38:48 +00:00
|
|
|
public:
|
2016-12-09 05:02:56 +00:00
|
|
|
MemoryAccessCounter(Debugger* debugger);
|
|
|
|
|
2017-03-02 01:52:15 +00:00
|
|
|
void ProcessMemoryAccess(AddressTypeInfo &addressInfo, MemoryOperationType operation, int32_t cpuCycle);
|
2016-12-02 00:38:48 +00:00
|
|
|
void ResetCounts();
|
|
|
|
|
|
|
|
void GetAccessCounts(AddressType memoryType, MemoryOperationType operationType, uint32_t counts[], bool forUninitReads);
|
2017-03-05 04:15:50 +00:00
|
|
|
void GetAccessCountsEx(uint32_t offset, uint32_t length, DebugMemoryType memoryType, MemoryOperationType operationType, int32_t counts[]);
|
2017-03-02 01:52:15 +00:00
|
|
|
void GetAccessStamps(uint32_t offset, uint32_t length, DebugMemoryType memoryType, MemoryOperationType operationType, uint32_t stamps[]);
|
2016-12-02 00:38:48 +00:00
|
|
|
};
|