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