minor groundwork for future jit breakpoint support

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2054 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-02-01 14:23:11 +00:00
parent 411fdca4fd
commit 7299ed4ad6
3 changed files with 15 additions and 22 deletions

View File

@ -15,20 +15,11 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
// Lame slow breakpoint system
// TODO: a real one
//
// [F|RES]: this class isn't really nice... for a better management we should use a base class for
// breakpoints and memory checks. but probably this will be slower too
//
#include "Common.h"
#include "../HW/CPU.h"
#include "../Host.h"
#include "../PowerPC/SymbolDB.h"
#include "../PowerPC/Jit64/Jit.h"
#include "Debugger_BreakPoints.h"
BreakPoints::TBreakPoints BreakPoints::m_BreakPoints;
@ -55,11 +46,9 @@ void TMemCheck::Action(u32 iValue, u32 addr, bool write, int size, u32 pc)
bool BreakPoints::IsAddressBreakPoint(u32 _iAddress)
{
std::vector<TBreakPoint>::iterator iter;
for (iter = m_BreakPoints.begin(); iter != m_BreakPoints.end(); ++iter)
if ((*iter).iAddress == _iAddress)
return true;
return false;
}
@ -74,7 +63,7 @@ bool BreakPoints::IsTempBreakPoint(u32 _iAddress)
return false;
}
void BreakPoints::Add(u32 em_address, bool temp)
bool BreakPoints::Add(u32 em_address, bool temp)
{
if (!IsAddressBreakPoint(em_address)) // only add new addresses
{
@ -84,23 +73,24 @@ void BreakPoints::Add(u32 em_address, bool temp)
pt.iAddress = em_address;
m_BreakPoints.push_back(pt);
// jit.NotifyBreakpoint(em_address, true);
return true;
} else {
return false;
}
}
void BreakPoints::Remove(u32 _iAddress)
bool BreakPoints::Remove(u32 _iAddress)
{
std::vector<TBreakPoint>::iterator iter;
for (iter = m_BreakPoints.begin(); iter != m_BreakPoints.end(); ++iter)
{
if ((*iter).iAddress == _iAddress)
{
m_BreakPoints.erase(iter);
// jit.NotifyBreakpoint(em_address, false);
break;
return true;
}
}
return false;
}
void BreakPoints::Clear()

View File

@ -65,10 +65,10 @@ public:
static bool IsTempBreakPoint(u32 _iAddress);
// AddBreakPoint
static void Add(u32 em_address, bool temp=false);
static bool Add(u32 em_address, bool temp=false);
// Remove Breakpoint
static void Remove(u32 _iAddress);
static bool Remove(u32 _iAddress);
static void Clear();
static void UpdateBreakPointView();

View File

@ -23,6 +23,7 @@
#include "../Core.h"
#include "../HW/Memmap.h"
#include "../PowerPC/PowerPC.h"
#include "../PowerPC/Jit64/Jit.h"
#include "../PowerPC/SymbolDB.h"
void PPCDebugInterface::disasm(unsigned int address, char *dest, int max_size)
@ -91,12 +92,14 @@ bool PPCDebugInterface::isBreakpoint(unsigned int address)
void PPCDebugInterface::setBreakpoint(unsigned int address)
{
BreakPoints::Add(address);
if (BreakPoints::Add(address))
jit.NotifyBreakpoint(address, true);
}
void PPCDebugInterface::clearBreakpoint(unsigned int address)
{
BreakPoints::Remove(address);
if (BreakPoints::Remove(address))
jit.NotifyBreakpoint(address, false);
}
void PPCDebugInterface::clearAllBreakpoints() {}