[User Interface] Make breakpoints use std::map
This commit is contained in:
parent
4fe7d938bb
commit
52693ae92d
|
@ -30,161 +30,200 @@
|
|||
|
||||
CBreakpoints::CBreakpoints()
|
||||
{
|
||||
m_Debugging = FALSE;
|
||||
m_Skipping = FALSE;
|
||||
m_nRBP = 0;
|
||||
m_nWBP = 0;
|
||||
m_nEBP = 0;
|
||||
m_Debugging = FALSE;
|
||||
m_Skipping = FALSE;
|
||||
}
|
||||
|
||||
void CBreakpoints::Pause()
|
||||
{
|
||||
KeepDebugging();
|
||||
g_System->Pause();
|
||||
KeepDebugging();
|
||||
g_System->Pause();
|
||||
}
|
||||
|
||||
void CBreakpoints::Resume()
|
||||
{
|
||||
g_System->ExternalEvent(SysEvent_ResumeCPU_FromMenu);
|
||||
g_System->ExternalEvent(SysEvent_ResumeCPU_FromMenu);
|
||||
}
|
||||
|
||||
BOOL CBreakpoints::isDebugging()
|
||||
bool CBreakpoints::isDebugging()
|
||||
{
|
||||
return m_Debugging;
|
||||
return m_Debugging;
|
||||
}
|
||||
|
||||
void CBreakpoints::KeepDebugging()
|
||||
{
|
||||
m_Debugging = TRUE;
|
||||
m_Debugging = true;
|
||||
}
|
||||
|
||||
void CBreakpoints::StopDebugging()
|
||||
{
|
||||
m_Debugging = FALSE;
|
||||
m_Debugging = false;
|
||||
}
|
||||
|
||||
bool CBreakpoints::isSkipping()
|
||||
{
|
||||
bool ret = m_Skipping;
|
||||
m_Skipping = FALSE;
|
||||
return ret;
|
||||
}
|
||||
void CBreakpoints::Skip()
|
||||
{
|
||||
m_Skipping = TRUE;
|
||||
m_Skipping = true;
|
||||
}
|
||||
|
||||
bool CBreakpoints::RBPAdd(uint32_t address, bool bTemporary)
|
||||
{
|
||||
if (!RBPExists(address))
|
||||
{
|
||||
m_RBP.push_back({ address, bTemporary });
|
||||
m_nRBP = m_RBP.size();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (!ReadBPExists(address))
|
||||
{
|
||||
m_ReadMem.insert(breakpoints_t::value_type(address, bTemporary));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CBreakpoints::WBPAdd(uint32_t address, bool bTemporary)
|
||||
{
|
||||
if (!WBPExists(address))
|
||||
{
|
||||
m_WBP.push_back({ address, bTemporary });
|
||||
m_nWBP = m_WBP.size();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (!WriteBPExists(address))
|
||||
{
|
||||
m_WriteMem.insert(breakpoints_t::value_type(address, bTemporary));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CBreakpoints::EBPAdd(uint32_t address, bool bTemporary)
|
||||
{
|
||||
if (!EBPExists(address))
|
||||
{
|
||||
m_EBP.push_back({ address, bTemporary });
|
||||
m_nEBP = m_EBP.size();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (!ExecutionBPExists(address))
|
||||
{
|
||||
m_Execution.insert(breakpoints_t::value_type(address, bTemporary));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CBreakpoints::RBPRemove(uint32_t address)
|
||||
{
|
||||
for (int i = 0; i < m_nRBP; i++)
|
||||
{
|
||||
if (m_RBP[i].address == address)
|
||||
{
|
||||
m_RBP.erase(m_RBP.begin() + i);
|
||||
m_nRBP = m_RBP.size();
|
||||
return;
|
||||
}
|
||||
}
|
||||
breakpoints_t::iterator itr = m_ReadMem.find(address);
|
||||
if (itr != m_ReadMem.end())
|
||||
{
|
||||
m_ReadMem.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
void CBreakpoints::WBPRemove(uint32_t address)
|
||||
{
|
||||
for (int i = 0; i < m_nWBP; i++)
|
||||
{
|
||||
if (m_WBP[i].address == address)
|
||||
{
|
||||
m_WBP.erase(m_WBP.begin() + i);
|
||||
m_nWBP = m_WBP.size();
|
||||
return;
|
||||
}
|
||||
}
|
||||
breakpoints_t::iterator itr = m_WriteMem.find(address);
|
||||
if (itr != m_WriteMem.end())
|
||||
{
|
||||
m_WriteMem.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
void CBreakpoints::EBPRemove(uint32_t address)
|
||||
{
|
||||
for (int i = 0; i < m_nEBP; i++)
|
||||
{
|
||||
if (m_EBP[i].address == address)
|
||||
{
|
||||
m_EBP.erase(m_EBP.begin() + i);
|
||||
m_nEBP = m_EBP.size();
|
||||
return;
|
||||
}
|
||||
}
|
||||
breakpoints_t::iterator itr = m_Execution.find(address);
|
||||
if (itr != m_Execution.end())
|
||||
{
|
||||
m_Execution.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
void CBreakpoints::RBPToggle(uint32_t address, bool bTemporary)
|
||||
{
|
||||
if (RBPAdd(address, bTemporary) == false)
|
||||
{
|
||||
RBPRemove(address);
|
||||
}
|
||||
if (RBPAdd(address, bTemporary) == false)
|
||||
{
|
||||
RBPRemove(address);
|
||||
}
|
||||
}
|
||||
|
||||
void CBreakpoints::WBPToggle(uint32_t address, bool bTemporary)
|
||||
{
|
||||
if (WBPAdd(address, bTemporary) == false)
|
||||
{
|
||||
WBPRemove(address);
|
||||
}
|
||||
if (WBPAdd(address, bTemporary) == false)
|
||||
{
|
||||
WBPRemove(address);
|
||||
}
|
||||
}
|
||||
|
||||
void CBreakpoints::EBPToggle(uint32_t address, bool bTemporary)
|
||||
{
|
||||
if (EBPAdd(address, bTemporary) == false)
|
||||
{
|
||||
EBPRemove(address);
|
||||
}
|
||||
if (EBPAdd(address, bTemporary) == false)
|
||||
{
|
||||
EBPRemove(address);
|
||||
}
|
||||
}
|
||||
|
||||
void CBreakpoints::RBPClear()
|
||||
{
|
||||
m_RBP.clear();
|
||||
m_nRBP = 0;
|
||||
m_ReadMem.clear();
|
||||
}
|
||||
|
||||
void CBreakpoints::WBPClear()
|
||||
{
|
||||
m_WBP.clear();
|
||||
m_nWBP = 0;
|
||||
m_WriteMem.clear();
|
||||
}
|
||||
|
||||
void CBreakpoints::EBPClear()
|
||||
{
|
||||
m_EBP.clear();
|
||||
m_nEBP = 0;
|
||||
m_Execution.clear();
|
||||
}
|
||||
|
||||
void CBreakpoints::BPClear()
|
||||
{
|
||||
RBPClear();
|
||||
WBPClear();
|
||||
EBPClear();
|
||||
RBPClear();
|
||||
WBPClear();
|
||||
EBPClear();
|
||||
}
|
||||
|
||||
CBreakpoints::BPSTATE CBreakpoints::ReadBPExists(uint32_t address, bool bRemoveTemp)
|
||||
{
|
||||
breakpoints_t::const_iterator itr = m_ReadMem.find(address);
|
||||
if (itr != m_ReadMem.end())
|
||||
{
|
||||
if (itr->second)
|
||||
{
|
||||
if (bRemoveTemp)
|
||||
{
|
||||
m_ReadMem.erase(itr);
|
||||
}
|
||||
return BP_SET_TEMP;
|
||||
}
|
||||
return BP_SET;
|
||||
}
|
||||
return BP_NOT_SET;
|
||||
}
|
||||
|
||||
CBreakpoints::BPSTATE CBreakpoints::WriteBPExists(uint32_t address, bool bRemoveTemp)
|
||||
{
|
||||
breakpoints_t::const_iterator itr = m_WriteMem.find(address);
|
||||
if (itr != m_WriteMem.end())
|
||||
{
|
||||
if (itr->second)
|
||||
{
|
||||
if (bRemoveTemp)
|
||||
{
|
||||
m_ReadMem.erase(itr);
|
||||
}
|
||||
return BP_SET_TEMP;
|
||||
}
|
||||
return BP_SET;
|
||||
}
|
||||
return BP_NOT_SET;
|
||||
}
|
||||
|
||||
CBreakpoints::BPSTATE CBreakpoints::ExecutionBPExists(uint32_t address, bool bRemoveTemp)
|
||||
{
|
||||
breakpoints_t::const_iterator itr = m_Execution.find(address);
|
||||
if (itr != m_Execution.end())
|
||||
{
|
||||
if (itr->second)
|
||||
{
|
||||
if (bRemoveTemp)
|
||||
{
|
||||
m_ReadMem.erase(itr);
|
||||
}
|
||||
return BP_SET_TEMP;
|
||||
}
|
||||
return BP_SET;
|
||||
}
|
||||
return BP_NOT_SET;
|
||||
}
|
|
@ -8,52 +8,41 @@
|
|||
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include <Common\stdtypes.h>
|
||||
#include <map>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
class CBreakpoints {
|
||||
private:
|
||||
|
||||
class CBreakpoints
|
||||
{
|
||||
public:
|
||||
typedef struct {
|
||||
uint32_t address;
|
||||
bool bTemporary;
|
||||
} BREAKPOINT;
|
||||
typedef std::map<uint32_t /*address*/, bool /*bTemporary*/> breakpoints_t;
|
||||
typedef breakpoints_t::const_iterator breakpoint_t;
|
||||
|
||||
enum BPSTATE {
|
||||
BP_NOT_SET = FALSE,
|
||||
enum BPSTATE
|
||||
{
|
||||
BP_NOT_SET,
|
||||
BP_SET,
|
||||
BP_SET_TEMP
|
||||
};
|
||||
|
||||
CBreakpoints();
|
||||
|
||||
BOOL m_Debugging;
|
||||
BOOL m_Skipping;
|
||||
const breakpoints_t & ReadMem(void) const { return m_ReadMem; }
|
||||
const breakpoints_t & WriteMem(void) const { return m_WriteMem; }
|
||||
const breakpoints_t & Execution(void) const { return m_Execution; }
|
||||
|
||||
std::vector<BREAKPOINT> m_RBP;
|
||||
std::vector<BREAKPOINT> m_WBP;
|
||||
std::vector<BREAKPOINT> m_EBP;
|
||||
|
||||
int m_nRBP;
|
||||
int m_nWBP;
|
||||
int m_nEBP;
|
||||
BPSTATE ReadBPExists(uint32_t address, bool bRemoveTemp = false);
|
||||
BPSTATE WriteBPExists(uint32_t address, bool bRemoveTemp = false);
|
||||
BPSTATE ExecutionBPExists(uint32_t address, bool bRemoveTemp = false);
|
||||
|
||||
void Pause();
|
||||
void Resume();
|
||||
void Skip();
|
||||
|
||||
BOOL isDebugging();
|
||||
bool isDebugging();
|
||||
void KeepDebugging();
|
||||
void StopDebugging();
|
||||
inline BOOL isSkipping()
|
||||
{
|
||||
BOOL ret = m_Skipping;
|
||||
m_Skipping = FALSE;
|
||||
return ret;
|
||||
}
|
||||
bool isSkipping();
|
||||
|
||||
bool RBPAdd(uint32_t address, bool bTemporary = false);
|
||||
void RBPRemove(uint32_t address);
|
||||
|
@ -72,71 +61,11 @@ public:
|
|||
|
||||
void BPClear();
|
||||
|
||||
// inlines
|
||||
private:
|
||||
breakpoints_t m_ReadMem;
|
||||
breakpoints_t m_WriteMem;
|
||||
breakpoints_t m_Execution;
|
||||
|
||||
inline BPSTATE RBPExists(uint32_t address, bool bRemoveTemp = false)
|
||||
{
|
||||
for (int i = 0; i < m_nRBP; i++)
|
||||
{
|
||||
if (m_RBP[i].address != address)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_RBP[i].bTemporary)
|
||||
{
|
||||
if (bRemoveTemp)
|
||||
{
|
||||
RBPRemove(address);
|
||||
}
|
||||
return BP_SET_TEMP;
|
||||
}
|
||||
return BP_SET;
|
||||
}
|
||||
return BP_NOT_SET;
|
||||
}
|
||||
|
||||
inline BPSTATE WBPExists(uint32_t address, bool bRemoveTemp = false)
|
||||
{
|
||||
for (int i = 0; i < m_nWBP; i++)
|
||||
{
|
||||
if (m_WBP[i].address != address)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_WBP[i].bTemporary)
|
||||
{
|
||||
if (bRemoveTemp)
|
||||
{
|
||||
WBPRemove(address);
|
||||
}
|
||||
return BP_SET_TEMP;
|
||||
}
|
||||
return BP_SET;
|
||||
}
|
||||
return BP_NOT_SET;
|
||||
}
|
||||
|
||||
inline BPSTATE EBPExists(uint32_t address, bool bRemoveTemp = false)
|
||||
{
|
||||
for (int i = 0; i < m_nEBP; i++)
|
||||
{
|
||||
if (m_EBP[i].address != address)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_EBP[i].bTemporary)
|
||||
{
|
||||
if (bRemoveTemp)
|
||||
{
|
||||
EBPRemove(address);
|
||||
}
|
||||
return BP_SET_TEMP;
|
||||
}
|
||||
return BP_SET;
|
||||
}
|
||||
return BP_NOT_SET;
|
||||
}
|
||||
bool m_Debugging;
|
||||
bool m_Skipping;
|
||||
};
|
|
@ -285,7 +285,7 @@ void CDebugCommandsView::AddBranchArrow(int startPos, int endPos)
|
|||
int endMargin = 0;
|
||||
int margin = 0;
|
||||
|
||||
for (int j = 0; j < m_BranchArrows.size(); j++)
|
||||
for (size_t j = 0; j < m_BranchArrows.size(); j++)
|
||||
{
|
||||
BRANCHARROW arrow = m_BranchArrows[j];
|
||||
|
||||
|
@ -590,15 +590,15 @@ void CDebugCommandsView::ShowAddress(DWORD address, BOOL top)
|
|||
|
||||
if (OpInfo.IsLoadStore())
|
||||
{
|
||||
for (int i = -4; i > -24; i -= 4)
|
||||
for (int offset = -4; offset > -24; offset -= 4)
|
||||
{
|
||||
if (!AddressSafe(opAddr + i))
|
||||
if (!AddressSafe(opAddr + offset))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
OPCODE OpCodeTest;
|
||||
bAddrOkay = g_MMU->LW_VAddr(opAddr + i, OpCodeTest.Hex);
|
||||
bAddrOkay = g_MMU->LW_VAddr(opAddr + offset, OpCodeTest.Hex);
|
||||
|
||||
if (!bAddrOkay)
|
||||
{
|
||||
|
@ -734,7 +734,7 @@ LRESULT CDebugCommandsView::OnCustomDrawList(NMHDR* pNMHDR)
|
|||
|
||||
if (nSubItem == CCommandList::COL_ADDRESS) // addr
|
||||
{
|
||||
CBreakpoints::BPSTATE bpState = m_Breakpoints->EBPExists(address);
|
||||
CBreakpoints::BPSTATE bpState = m_Breakpoints->ExecutionBPExists(address);
|
||||
|
||||
if (bpState == CBreakpoints::BP_SET)
|
||||
{
|
||||
|
@ -947,7 +947,7 @@ void CDebugCommandsView::DrawBranchArrows(HDC listDC)
|
|||
CBrush hBrushBg(CreateSolidBrush(bgColor));
|
||||
FillRect(listDC, &paneRect, hBrushBg);
|
||||
|
||||
for (int i = 0; i < m_BranchArrows.size(); i++)
|
||||
for (size_t i = 0; i < m_BranchArrows.size(); i++)
|
||||
{
|
||||
int colorIdx = i % nColors;
|
||||
COLORREF color = colors[colorIdx];
|
||||
|
@ -1022,29 +1022,29 @@ void CDebugCommandsView::RefreshBreakpointList()
|
|||
{
|
||||
m_BreakpointList.ResetContent();
|
||||
char rowStr[16];
|
||||
for (int i = 0; i < m_Breakpoints->m_nRBP; i++)
|
||||
|
||||
CBreakpoints::breakpoints_t ReadBreakPoints = m_Breakpoints->ReadMem();
|
||||
for (CBreakpoints::breakpoints_t::iterator itr = ReadBreakPoints.begin(); itr != ReadBreakPoints.end(); itr++)
|
||||
{
|
||||
CBreakpoints::BREAKPOINT breakpoint = m_Breakpoints->m_RBP[i];
|
||||
bool bTemp = breakpoint.bTemporary;
|
||||
sprintf(rowStr, "R %s%08X", bTemp ? "T " : "", breakpoint.address);
|
||||
sprintf(rowStr, "R %s%08X", itr->second ? "T " : "", itr->first);
|
||||
int index = m_BreakpointList.AddString(rowStr);
|
||||
m_BreakpointList.SetItemData(index, breakpoint.address);
|
||||
m_BreakpointList.SetItemData(index, itr->first);
|
||||
}
|
||||
for (int i = 0; i < m_Breakpoints->m_nWBP; i++)
|
||||
|
||||
CBreakpoints::breakpoints_t WriteBreakPoints = m_Breakpoints->WriteMem();
|
||||
for (CBreakpoints::breakpoints_t::iterator itr = WriteBreakPoints.begin(); itr != WriteBreakPoints.end(); itr++)
|
||||
{
|
||||
CBreakpoints::BREAKPOINT breakpoint = m_Breakpoints->m_WBP[i];
|
||||
bool bTemp = breakpoint.bTemporary;
|
||||
sprintf(rowStr, "W %s%08X", bTemp ? "T " : "", breakpoint.address);
|
||||
sprintf(rowStr, "W %s%08X", itr->second ? "T " : "", itr->first);
|
||||
int index = m_BreakpointList.AddString(rowStr);
|
||||
m_BreakpointList.SetItemData(index, breakpoint.address);
|
||||
m_BreakpointList.SetItemData(index, itr->first);
|
||||
}
|
||||
for (int i = 0; i < m_Breakpoints->m_nEBP; i++)
|
||||
|
||||
CBreakpoints::breakpoints_t ExecutionBreakPoints = m_Breakpoints->Execution();
|
||||
for (CBreakpoints::breakpoints_t::iterator itr = ExecutionBreakPoints.begin(); itr != ExecutionBreakPoints.end(); itr++)
|
||||
{
|
||||
CBreakpoints::BREAKPOINT breakpoint = m_Breakpoints->m_EBP[i];
|
||||
bool bTemp = breakpoint.bTemporary;
|
||||
sprintf(rowStr, "E %s%08X", bTemp ? "T " : "", breakpoint.address);
|
||||
sprintf(rowStr, "E %s%08X", itr->second ? "T " : "", itr->first);
|
||||
int index = m_BreakpointList.AddString(rowStr);
|
||||
m_BreakpointList.SetItemData(index, breakpoint.address);
|
||||
m_BreakpointList.SetItemData(index, itr->first);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1117,7 +1117,7 @@ LRESULT CDebugCommandsView::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWn
|
|||
}
|
||||
break;
|
||||
case IDC_FORWARD_BTN:
|
||||
if (m_History.size() > 0 && m_HistoryIndex < m_History.size() - 1)
|
||||
if (m_History.size() > 0 && m_HistoryIndex < (int)m_History.size() - 1)
|
||||
{
|
||||
m_HistoryIndex++;
|
||||
m_AddressEdit.SetValue(m_History[m_HistoryIndex], false, true);
|
||||
|
@ -1278,7 +1278,7 @@ LRESULT CDebugCommandsView::OnPCChanged(WORD /*wNotifyCode*/, WORD /*wID*/, HWND
|
|||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CDebugCommandsView::OnCommandListClicked(NMHDR* pNMHDR)
|
||||
LRESULT CDebugCommandsView::OnCommandListClicked(NMHDR* /*pNMHDR*/)
|
||||
{
|
||||
EndOpEdit();
|
||||
return 0;
|
||||
|
@ -1291,7 +1291,7 @@ LRESULT CDebugCommandsView::OnCommandListDblClicked(NMHDR* pNMHDR)
|
|||
int nItem = pIA->iItem;
|
||||
|
||||
uint32_t address = m_StartAddress + nItem * 4;
|
||||
if (m_Breakpoints->EBPExists(address))
|
||||
if (m_Breakpoints->ExecutionBPExists(address))
|
||||
{
|
||||
m_Breakpoints->EBPRemove(address);
|
||||
}
|
||||
|
@ -1363,7 +1363,7 @@ LRESULT CDebugCommandsView::OnCommandListRightClicked(NMHDR* pNMHDR)
|
|||
EnableMenuItem(hPopupMenu, ID_POPUPMENU_INSERTNOP, MF_DISABLED | MF_GRAYED);
|
||||
}
|
||||
|
||||
if (m_Breakpoints->m_nEBP == 0)
|
||||
if (m_Breakpoints->Execution().size() == 0)
|
||||
{
|
||||
EnableMenuItem(hPopupMenu, ID_POPUPMENU_CLEARBPS, MF_DISABLED | MF_GRAYED);
|
||||
}
|
||||
|
@ -1484,7 +1484,7 @@ void CDebugCommandsView::ClearEditedOps()
|
|||
|
||||
BOOL CDebugCommandsView::IsOpEdited(uint32_t address)
|
||||
{
|
||||
for (int i = 0; i < m_EditedOps.size(); i++)
|
||||
for (size_t i = 0; i < m_EditedOps.size(); i++)
|
||||
{
|
||||
if (m_EditedOps[i].address == address)
|
||||
{
|
||||
|
@ -1516,7 +1516,7 @@ void CDebugCommandsView::EditOp(uint32_t address, uint32_t op)
|
|||
|
||||
void CDebugCommandsView::RestoreOp(uint32_t address)
|
||||
{
|
||||
for (int i = 0; i < m_EditedOps.size(); i++)
|
||||
for (size_t i = 0; i < m_EditedOps.size(); i++)
|
||||
{
|
||||
if (m_EditedOps[i].address == address)
|
||||
{
|
||||
|
|
|
@ -242,7 +242,7 @@ LRESULT CDebugMemoryView::OnMemoryRightClicked(LPNMHDR lpNMHDR)
|
|||
HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MEM_BP_POPUP));
|
||||
HMENU hPopupMenu = GetSubMenu(hMenu, 0);
|
||||
|
||||
if (m_Breakpoints->m_RBP.size() == 0 && m_Breakpoints->m_WBP.size() == 0)
|
||||
if (m_Breakpoints->ReadMem().size() == 0 && m_Breakpoints->WriteMem().size() == 0)
|
||||
{
|
||||
EnableMenuItem(hPopupMenu, ID_POPUPMENU_CLEARALLBPS, MF_DISABLED | MF_GRAYED);
|
||||
}
|
||||
|
@ -697,8 +697,8 @@ void CDebugMemoryView::SelectColors(uint32_t vaddr, bool changed, COLORREF& bgCo
|
|||
|
||||
CSymbols::LeaveCriticalSection();
|
||||
|
||||
bool bHaveReadBP = m_Breakpoints->RBPExists(vaddr) == CBreakpoints::BP_SET;
|
||||
bool bHaveWriteBP = m_Breakpoints->WBPExists(vaddr) == CBreakpoints::BP_SET;
|
||||
bool bHaveReadBP = m_Breakpoints->ReadBPExists(vaddr) == CBreakpoints::BP_SET;
|
||||
bool bHaveWriteBP = m_Breakpoints->WriteBPExists(vaddr) == CBreakpoints::BP_SET;
|
||||
|
||||
fgHiColor = RGB(0x00, 0x00, 0x00);
|
||||
|
||||
|
|
|
@ -367,11 +367,15 @@ CDMALog* CDebuggerUI::DMALog()
|
|||
|
||||
void CDebuggerUI::BreakpointHit()
|
||||
{
|
||||
#ifdef tofix
|
||||
m_Breakpoints->KeepDebugging();
|
||||
#endif
|
||||
Debug_ShowCommandsLocation(g_Reg->m_PROGRAM_COUNTER, false);
|
||||
Debug_RefreshStackWindow();
|
||||
Debug_RefreshStackTraceWindow();
|
||||
#ifdef tofix
|
||||
m_Breakpoints->Pause();
|
||||
#endif
|
||||
}
|
||||
|
||||
// CDebugger implementation
|
||||
|
@ -392,7 +396,7 @@ bool CDebuggerUI::CPUStepStarted()
|
|||
|
||||
// PC breakpoints
|
||||
|
||||
if (m_Breakpoints->EBPExists(PROGRAM_COUNTER, true))
|
||||
if (m_Breakpoints->ExecutionBPExists(PROGRAM_COUNTER, true))
|
||||
{
|
||||
goto breakpoint_hit;
|
||||
}
|
||||
|
@ -410,7 +414,7 @@ bool CDebuggerUI::CPUStepStarted()
|
|||
{
|
||||
m_ScriptSystem->HookCPURead()->InvokeByParamInRange(memoryAddress);
|
||||
|
||||
if (m_Breakpoints->RBPExists(memoryAddress))
|
||||
if (m_Breakpoints->ReadBPExists(memoryAddress))
|
||||
{
|
||||
goto breakpoint_hit;
|
||||
}
|
||||
|
@ -419,7 +423,7 @@ bool CDebuggerUI::CPUStepStarted()
|
|||
{
|
||||
m_ScriptSystem->HookCPUWrite()->InvokeByParamInRange(memoryAddress);
|
||||
|
||||
if (m_Breakpoints->WBPExists(memoryAddress))
|
||||
if (m_Breakpoints->WriteBPExists(memoryAddress))
|
||||
{
|
||||
goto breakpoint_hit;
|
||||
}
|
||||
|
@ -434,9 +438,10 @@ bool CDebuggerUI::CPUStepStarted()
|
|||
|
||||
m_DMALog->AddEntry(dmaRomAddr, dmaRamAddr, dmaLen);
|
||||
|
||||
for (int i = 0; i < m_Breakpoints->m_nWBP; i++)
|
||||
CBreakpoints::breakpoints_t breakpoints = m_Breakpoints->WriteMem();
|
||||
for (CBreakpoints::breakpoints_t::iterator breakpoint = breakpoints.begin(); breakpoint != breakpoints.end(); breakpoint++)
|
||||
{
|
||||
uint32_t wbpAddr = m_Breakpoints->m_WBP[i].address;
|
||||
uint32_t wbpAddr = breakpoint->first;
|
||||
if (wbpAddr >= dmaRamAddr && wbpAddr < endAddr)
|
||||
{
|
||||
goto breakpoint_hit;
|
||||
|
|
Loading…
Reference in New Issue