2006-06-15 04:19:30 +00:00
|
|
|
#include "DebugView.h"
|
|
|
|
#include "PtrMacro.h"
|
2008-12-24 01:39:03 +00:00
|
|
|
#include "placeholder_def.h"
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
using namespace Framework;
|
2008-12-02 03:10:37 +00:00
|
|
|
using namespace std::tr1;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2008-11-28 02:56:27 +00:00
|
|
|
CDebugView::CDebugView(HWND hParent, CVirtualMachine& virtualMachine, CMIPS* pCtx, const StepFunction& stepFunction, const char* sName) :
|
|
|
|
m_virtualMachine(virtualMachine),
|
2007-12-01 04:08:34 +00:00
|
|
|
m_pCtx(pCtx),
|
2008-11-28 02:56:27 +00:00
|
|
|
m_name(sName),
|
|
|
|
m_stepFunction(stepFunction)
|
2006-06-15 04:19:30 +00:00
|
|
|
{
|
2007-12-01 04:08:34 +00:00
|
|
|
m_pDisAsmWnd = new CDisAsmWnd(hParent, virtualMachine, m_pCtx);
|
|
|
|
m_pRegViewWnd = new CRegViewWnd(hParent, virtualMachine, m_pCtx);
|
|
|
|
m_pMemoryViewWnd = new CMemoryViewMIPSWnd(hParent, virtualMachine, m_pCtx);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2007-12-01 04:08:34 +00:00
|
|
|
m_pCallStackWnd = new CCallStackWnd(hParent, virtualMachine, m_pCtx);
|
2008-12-24 01:39:03 +00:00
|
|
|
m_pCallStackWnd->m_OnFunctionDblClick.connect(bind(&CDebugView::OnCallStackWndFunctionDblClick, this, PLACEHOLDER_1));
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
Hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
CDebugView::~CDebugView()
|
|
|
|
{
|
|
|
|
DELETEPTR(m_pDisAsmWnd);
|
|
|
|
DELETEPTR(m_pRegViewWnd);
|
|
|
|
DELETEPTR(m_pMemoryViewWnd);
|
|
|
|
DELETEPTR(m_pCallStackWnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* CDebugView::GetName() const
|
|
|
|
{
|
2007-12-01 04:08:34 +00:00
|
|
|
return m_name.c_str();
|
2006-06-15 04:19:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CDebugView::Hide()
|
|
|
|
{
|
2008-11-28 02:56:27 +00:00
|
|
|
int nMethod = SW_HIDE;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
m_pDisAsmWnd->Show(nMethod);
|
|
|
|
m_pMemoryViewWnd->Show(nMethod);
|
|
|
|
m_pRegViewWnd->Show(nMethod);
|
|
|
|
m_pCallStackWnd->Show(nMethod);
|
|
|
|
}
|
|
|
|
|
2008-11-28 02:56:27 +00:00
|
|
|
void CDebugView::Step()
|
|
|
|
{
|
|
|
|
m_stepFunction();
|
|
|
|
}
|
|
|
|
|
2006-06-15 04:19:30 +00:00
|
|
|
CMIPS* CDebugView::GetContext()
|
|
|
|
{
|
|
|
|
return m_pCtx;
|
|
|
|
}
|
|
|
|
|
|
|
|
CDisAsmWnd* CDebugView::GetDisassemblyWindow()
|
|
|
|
{
|
|
|
|
return m_pDisAsmWnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
CMemoryViewMIPSWnd* CDebugView::GetMemoryViewWindow()
|
|
|
|
{
|
|
|
|
return m_pMemoryViewWnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
CRegViewWnd* CDebugView::GetRegisterViewWindow()
|
|
|
|
{
|
|
|
|
return m_pRegViewWnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
CCallStackWnd* CDebugView::GetCallStackWindow()
|
|
|
|
{
|
|
|
|
return m_pCallStackWnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CDebugView::OnCallStackWndFunctionDblClick(uint32 nAddress)
|
|
|
|
{
|
|
|
|
m_pDisAsmWnd->SetAddress(nAddress);
|
|
|
|
}
|