Files
dolphin/Source/Core/Common/BreakPoints.h
T

99 lines
1.8 KiB
C++
Raw Normal View History

// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
2008-12-08 04:46:09 +00:00
#pragma once
2008-12-08 04:46:09 +00:00
#include <string>
2014-02-17 05:18:15 -05:00
#include <vector>
2008-12-08 04:46:09 +00:00
2014-02-17 05:18:15 -05:00
#include "Common/CommonTypes.h"
2008-12-08 04:46:09 +00:00
class DebugInterface;
2008-12-08 04:46:09 +00:00
struct TBreakPoint
{
2014-02-09 18:29:13 -05:00
u32 iAddress;
bool bOn;
bool bTemporary;
2008-12-08 04:46:09 +00:00
};
struct TMemCheck
{
TMemCheck() {
numHits = 0;
StartAddress = EndAddress = 0;
bRange = OnRead = OnWrite = Log = Break = false;
}
2008-12-08 04:46:09 +00:00
u32 StartAddress;
u32 EndAddress;
2014-02-09 18:29:13 -05:00
bool bRange;
2008-12-08 04:46:09 +00:00
2014-02-09 18:29:13 -05:00
bool OnRead;
bool OnWrite;
2008-12-08 04:46:09 +00:00
2014-02-09 18:29:13 -05:00
bool Log;
bool Break;
2008-12-08 04:46:09 +00:00
2014-02-09 18:29:13 -05:00
u32 numHits;
2008-12-08 04:46:09 +00:00
void Action(DebugInterface *dbg_interface, u32 _iValue, u32 addr,
2014-02-09 18:29:13 -05:00
bool write, int size, u32 pc);
2008-12-08 04:46:09 +00:00
};
// Code breakpoints.
class BreakPoints
2008-12-08 04:46:09 +00:00
{
public:
typedef std::vector<TBreakPoint> TBreakPoints;
typedef std::vector<std::string> TBreakPointsStr;
2008-12-08 04:46:09 +00:00
const TBreakPoints& GetBreakPoints() { return m_BreakPoints; }
2008-12-08 04:46:09 +00:00
TBreakPointsStr GetStrings() const;
void AddFromStrings(const TBreakPointsStr& bps);
2008-12-08 04:46:09 +00:00
// is address breakpoint
bool IsAddressBreakPoint(u32 _iAddress);
bool IsTempBreakPoint(u32 _iAddress);
2008-12-08 04:46:09 +00:00
// Add BreakPoint
void Add(u32 em_address, bool temp=false);
void Add(const TBreakPoint& bp);
2008-12-08 04:46:09 +00:00
// Remove Breakpoint
void Remove(u32 _iAddress);
void Clear();
2008-12-08 04:46:09 +00:00
void DeleteByAddress(u32 _Address);
2008-12-08 04:46:09 +00:00
private:
TBreakPoints m_BreakPoints;
2014-02-09 18:29:13 -05:00
u32 m_iBreakOnCount;
};
2008-12-08 04:46:09 +00:00
// Memory breakpoints
class MemChecks
{
public:
typedef std::vector<TMemCheck> TMemChecks;
typedef std::vector<std::string> TMemChecksStr;
TMemChecks m_MemChecks;
const TMemChecks& GetMemChecks() { return m_MemChecks; }
TMemChecksStr GetStrings() const;
void AddFromStrings(const TMemChecksStr& mcs);
void Add(const TMemCheck& _rMemoryCheck);
// memory breakpoint
TMemCheck *GetMemCheck(u32 address);
void Remove(u32 _Address);
void Clear() { m_MemChecks.clear(); };
2008-12-08 04:46:09 +00:00
};