project64/Source/Project64/UserInterface/Debugger/Breakpoints.h

69 lines
2.5 KiB
C
Raw Normal View History

2017-08-18 05:08:22 +00:00
/****************************************************************************
* *
* Project64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#pragma once
#include <Common\stdtypes.h>
#include <map>
2017-08-18 05:08:22 +00:00
class CBreakpoints :
private CDebugSettings
{
2017-09-13 10:36:03 +00:00
public:
typedef std::map<uint32_t /*address*/, bool /*bTemporary*/> breakpoints_t;
typedef breakpoints_t::const_iterator breakpoint_t;
2017-09-13 10:36:03 +00:00
enum BPSTATE
{
BP_NOT_SET,
2017-09-13 10:36:03 +00:00
BP_SET,
BP_SET_TEMP
};
CBreakpoints();
const breakpoints_t & ReadMem(void) const { return m_ReadMem; }
const breakpoints_t & WriteMem(void) const { return m_WriteMem; }
const breakpoints_t & Execution(void) const { return m_Execution; }
2017-09-13 10:36:03 +00:00
2018-02-05 20:25:53 +00:00
BPSTATE ReadBPExists8(uint32_t address);
BPSTATE ReadBPExists16(uint32_t address);
BPSTATE ReadBPExists32(uint32_t address);
BPSTATE ReadBPExists64(uint32_t address);
BPSTATE WriteBPExists8(uint32_t address);
BPSTATE WriteBPExists16(uint32_t address);
BPSTATE WriteBPExists32(uint32_t address);
BPSTATE WriteBPExists64(uint32_t address);
BPSTATE ExecutionBPExists(uint32_t address, bool bRemoveTemp = false);
2017-09-13 10:36:03 +00:00
bool RBPAdd(uint32_t address);
2017-09-13 10:36:03 +00:00
void RBPRemove(uint32_t address);
void RBPToggle(uint32_t address);
2017-09-13 10:36:03 +00:00
void RBPClear();
bool WBPAdd(uint32_t address);
2017-09-13 10:36:03 +00:00
void WBPRemove(uint32_t address);
void WBPToggle(uint32_t address);
2017-09-13 10:36:03 +00:00
void WBPClear();
bool AddExecution(uint32_t address, bool bTemporary = false);
void RemoveExecution(uint32_t address);
2017-09-13 10:36:03 +00:00
void EBPToggle(uint32_t address, bool bTemporary = false);
void EBPClear();
void BPClear();
private:
void UpdateAlignedWriteBP(void);
2018-02-05 20:25:53 +00:00
void UpdateAlignedReadBP(void);
2018-02-05 20:25:53 +00:00
breakpoints_t m_ReadMem, m_ReadMem16, m_ReadMem32, m_ReadMem64;
breakpoints_t m_WriteMem, m_WriteMem16, m_WriteMem32, m_WriteMem64;
breakpoints_t m_Execution;
2017-08-18 05:08:22 +00:00
};