From f3e27ad9ddd0aa43860d9841516b9224e6a8377c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 30 Jun 2013 16:22:07 -0700 Subject: [PATCH] Ensure only the very next instruction is skipped. --- Core/Debugger/Breakpoints.cpp | 25 ++++++++++++++++++++----- Core/Debugger/Breakpoints.h | 6 +++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Core/Debugger/Breakpoints.cpp b/Core/Debugger/Breakpoints.cpp index 0912c76cb5..e7eefc426b 100644 --- a/Core/Debugger/Breakpoints.cpp +++ b/Core/Debugger/Breakpoints.cpp @@ -15,16 +15,17 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "../Core.h" -#include "Breakpoints.h" -#include "SymbolMap.h" -#include "FixedSizeUnorderedSet.h" +#include "Core/Core.h" +#include "Core/Debugger/Breakpoints.h" +#include "Core/Debugger/SymbolMap.h" #include "Core/Host.h" -#include "../MIPS/JitCommon/JitCommon.h" +#include "Core/MIPS/JitCommon/JitCommon.h" +#include "Core/CoreTiming.h" #include std::vector CBreakPoints::breakPoints_; u32 CBreakPoints::breakSkipFirstAt_ = 0; +u64 CBreakPoints::breakSkipFirstTicks_ = 0; std::vector CBreakPoints::memChecks_; MemCheck::MemCheck(void) @@ -260,6 +261,20 @@ MemCheck *CBreakPoints::GetMemCheck(u32 address, int size) return 0; } +void CBreakPoints::SetSkipFirst(u32 pc) +{ + breakSkipFirstAt_ = pc; + breakSkipFirstTicks_ = CoreTiming::GetTicks(); +} +u32 CBreakPoints::CheckSkipFirst() +{ + u32 pc = breakSkipFirstAt_; + breakSkipFirstAt_ = 0; + if (breakSkipFirstTicks_ == CoreTiming::GetTicks()) + return pc; + return 0; +} + const std::vector CBreakPoints::GetMemChecks() { return memChecks_; diff --git a/Core/Debugger/Breakpoints.h b/Core/Debugger/Breakpoints.h index 85241c2edc..b08ddbb8cb 100644 --- a/Core/Debugger/Breakpoints.h +++ b/Core/Debugger/Breakpoints.h @@ -114,9 +114,8 @@ public: static MemCheck *GetMemCheck(u32 address, int size); - // TODO: MemChecks somehow too? - static void SetSkipFirst(u32 pc) { breakSkipFirstAt_ = pc; } - static u32 CheckSkipFirst() { u32 pc = breakSkipFirstAt_; breakSkipFirstAt_ = 0; return pc; } + static void SetSkipFirst(u32 pc); + static u32 CheckSkipFirst(); static const std::vector GetMemChecks(); static const std::vector GetBreakpoints(); @@ -130,6 +129,7 @@ private: static std::vector breakPoints_; static u32 breakSkipFirstAt_; + static u64 breakSkipFirstTicks_; static std::vector memChecks_; };