summaryrefslogtreecommitdiffstats
path: root/src/common/break_points.h
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-04-09 01:25:03 +0200
committerbunnei <ericbunnie@gmail.com>2014-04-09 01:25:03 +0200
commit63e46abdb8764bc97e91bae862c8d461e61b1965 (patch)
treee73f4aa25d7b4015a265e7bbfb6004dab7561027 /src/common/break_points.h
parentfixed some license headers that I missed (diff)
downloadyuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar
yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.gz
yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.bz2
yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.lz
yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.xz
yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.zst
yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.zip
Diffstat (limited to 'src/common/break_points.h')
-rw-r--r--src/common/break_points.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/common/break_points.h b/src/common/break_points.h
new file mode 100644
index 000000000..dc771ba01
--- /dev/null
+++ b/src/common/break_points.h
@@ -0,0 +1,102 @@
+// 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
+{
+ u32 iAddress;
+ bool bOn;
+ bool bTemporary;
+};
+
+struct TMemCheck
+{
+ TMemCheck() {
+ numHits = 0;
+ StartAddress = EndAddress = 0;
+ bRange = OnRead = OnWrite = Log = Break = false;
+ }
+ u32 StartAddress;
+ u32 EndAddress;
+
+ bool bRange;
+
+ bool OnRead;
+ bool OnWrite;
+
+ bool Log;
+ bool Break;
+
+ u32 numHits;
+
+ void Action(DebugInterface *dbg_interface, u32 _iValue, u32 addr,
+ bool write, int size, u32 pc);
+};
+
+// Code breakpoints.
+class BreakPoints
+{
+public:
+ typedef std::vector<TBreakPoint> TBreakPoints;
+ typedef std::vector<std::string> TBreakPointsStr;
+
+ const TBreakPoints& GetBreakPoints() { return m_BreakPoints; }
+
+ TBreakPointsStr GetStrings() const;
+ void AddFromStrings(const TBreakPointsStr& bps);
+
+ // is address breakpoint
+ bool IsAddressBreakPoint(u32 _iAddress);
+ bool IsTempBreakPoint(u32 _iAddress);
+
+ // Add BreakPoint
+ void Add(u32 em_address, bool temp=false);
+ void Add(const TBreakPoint& bp);
+
+ // Remove Breakpoint
+ void Remove(u32 _iAddress);
+ void Clear();
+
+ void DeleteByAddress(u32 _Address);
+
+private:
+ TBreakPoints m_BreakPoints;
+ u32 m_iBreakOnCount;
+};
+
+
+// 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(); };
+};
+
+#endif
+