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
|
2017-11-23 21:15:06 +00:00
|
|
|
#include <Common\stdtypes.h>
|
|
|
|
#include <map>
|
2017-08-18 05:08:22 +00:00
|
|
|
|
2017-12-12 10:15:34 +00:00
|
|
|
class CBreakpoints :
|
|
|
|
private CDebugSettings
|
2017-11-23 21:15:06 +00:00
|
|
|
{
|
2017-09-13 10:36:03 +00:00
|
|
|
public:
|
2017-11-23 21:15:06 +00:00
|
|
|
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
|
|
|
|
2017-11-23 21:15:06 +00:00
|
|
|
enum BPSTATE
|
|
|
|
{
|
|
|
|
BP_NOT_SET,
|
2017-09-13 10:36:03 +00:00
|
|
|
BP_SET,
|
|
|
|
BP_SET_TEMP
|
|
|
|
};
|
|
|
|
|
|
|
|
CBreakpoints();
|
|
|
|
|
2017-11-23 21:15:06 +00:00
|
|
|
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);
|
2018-01-24 10:51:04 +00:00
|
|
|
BPSTATE WriteBPExists8(uint32_t address);
|
2018-02-01 17:28:08 +00:00
|
|
|
BPSTATE WriteBPExists16(uint32_t address);
|
|
|
|
BPSTATE WriteBPExists32(uint32_t address);
|
|
|
|
BPSTATE WriteBPExists64(uint32_t address);
|
2017-11-23 21:15:06 +00:00
|
|
|
BPSTATE ExecutionBPExists(uint32_t address, bool bRemoveTemp = false);
|
2017-09-13 10:36:03 +00:00
|
|
|
|
2018-01-24 10:51:04 +00:00
|
|
|
bool RBPAdd(uint32_t address);
|
2017-09-13 10:36:03 +00:00
|
|
|
void RBPRemove(uint32_t address);
|
2018-01-24 10:51:04 +00:00
|
|
|
void RBPToggle(uint32_t address);
|
2017-09-13 10:36:03 +00:00
|
|
|
void RBPClear();
|
|
|
|
|
2018-01-24 10:51:04 +00:00
|
|
|
bool WBPAdd(uint32_t address);
|
2017-09-13 10:36:03 +00:00
|
|
|
void WBPRemove(uint32_t address);
|
2018-01-24 10:51:04 +00:00
|
|
|
void WBPToggle(uint32_t address);
|
2017-09-13 10:36:03 +00:00
|
|
|
void WBPClear();
|
|
|
|
|
2017-12-04 06:41:27 +00:00
|
|
|
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();
|
|
|
|
|
2017-11-23 21:15:06 +00:00
|
|
|
private:
|
2018-02-01 17:28:08 +00:00
|
|
|
void UpdateAlignedWriteBP(void);
|
2018-02-05 20:25:53 +00:00
|
|
|
void UpdateAlignedReadBP(void);
|
2018-02-01 17:28:08 +00:00
|
|
|
|
2018-02-05 20:25:53 +00:00
|
|
|
breakpoints_t m_ReadMem, m_ReadMem16, m_ReadMem32, m_ReadMem64;
|
2018-02-01 17:28:08 +00:00
|
|
|
breakpoints_t m_WriteMem, m_WriteMem16, m_WriteMem32, m_WriteMem64;
|
2017-11-23 21:15:06 +00:00
|
|
|
breakpoints_t m_Execution;
|
2017-08-18 05:08:22 +00:00
|
|
|
};
|