Permalink
Browse files

Debugger: Fix initialization issues.

Sometimes temp breakpoints had log set by accident.
  • Loading branch information...
unknownbrackets committed Apr 30, 2018
1 parent 2e2d8f2 commit 3c8cc5ab6488e63c7d15d691bddfe18331538e51
Showing with 17 additions and 34 deletions.
  1. +0 −5 Core/Debugger/Breakpoints.cpp
  2. +17 −29 Core/Debugger/Breakpoints.h
@@ -33,11 +33,6 @@ u64 CBreakPoints::breakSkipFirstTicks_ = 0;
std::vector<MemCheck> CBreakPoints::memChecks_;
std::vector<MemCheck *> CBreakPoints::cleanupMemChecks_;
MemCheck::MemCheck()
{
numHits = 0;
}
void MemCheck::Log(u32 addr, bool write, int size, u32 pc) {
if (result & BREAK_ACTION_LOG) {
if (logFormat.empty()) {
@@ -21,8 +21,7 @@
#include "Core/Debugger/DebugInterface.h"
enum BreakAction
{
enum BreakAction {
BREAK_ACTION_IGNORE = 0x00,
BREAK_ACTION_LOG = 0x01,
BREAK_ACTION_PAUSE = 0x02,
@@ -37,35 +36,27 @@ static inline BreakAction operator | (const BreakAction &lhs, const BreakAction
return BreakAction((u32)lhs | (u32)rhs);
}
struct BreakPointCond
{
DebugInterface *debug;
struct BreakPointCond {
DebugInterface *debug = nullptr;
PostfixExpression expression;
std::string expressionString;
BreakPointCond() : debug(nullptr)
{
}
u32 Evaluate()
{
u32 Evaluate() {
u32 result;
if (debug->parseExpression(expression,result) == false) return 0;
if (debug->parseExpression(expression, result) == false)
return 0;
return result;
}
};
struct BreakPoint
{
BreakPoint() : hasCond(false) {}
struct BreakPoint {
u32 addr;
bool temporary;
BreakAction result;
BreakAction result = BREAK_ACTION_IGNORE;
std::string logFormat;
bool hasCond;
bool hasCond = false;
BreakPointCond cond;
bool IsEnabled() const {
@@ -80,30 +71,27 @@ struct BreakPoint
}
};
enum MemCheckCondition
{
enum MemCheckCondition {
MEMCHECK_READ = 0x01,
MEMCHECK_WRITE = 0x02,
MEMCHECK_WRITE_ONCHANGE = 0x04,
MEMCHECK_READWRITE = 0x03,
};
struct MemCheck
{
MemCheck();
struct MemCheck {
u32 start;
u32 end;
MemCheckCondition cond;
BreakAction result;
MemCheckCondition cond = MEMCHECK_READ;
BreakAction result = BREAK_ACTION_IGNORE;
std::string logFormat;
u32 numHits;
u32 numHits = 0;
u32 lastPC;
u32 lastAddr;
int lastSize;
u32 lastPC = 0;
u32 lastAddr = 0;
int lastSize = 0;
BreakAction Action(u32 addr, bool write, int size, u32 pc);
void JitBefore(u32 addr, bool write, int size, u32 pc);

0 comments on commit 3c8cc5a

Please sign in to comment.