2006-06-15 04:19:30 +00:00
|
|
|
#include "DebugView.h"
|
|
|
|
|
2012-05-24 05:57:31 +00:00
|
|
|
CDebugView::CDebugView(HWND hParent, CVirtualMachine& virtualMachine, CMIPS* pCtx,
|
|
|
|
const StepFunction& stepFunction, CBiosDebugInfoProvider* biosDebugInfoProvider, const char* sName)
|
2012-05-12 04:31:40 +00:00
|
|
|
: m_virtualMachine(virtualMachine)
|
|
|
|
, m_pCtx(pCtx)
|
|
|
|
, m_name(sName)
|
|
|
|
, m_stepFunction(stepFunction)
|
2012-05-24 05:57:31 +00:00
|
|
|
, m_pDisAsmWnd(nullptr)
|
|
|
|
, m_pRegViewWnd(nullptr)
|
|
|
|
, m_pMemoryViewWnd(nullptr)
|
|
|
|
, m_pCallStackWnd(nullptr)
|
|
|
|
, m_biosDebugInfoProvider(biosDebugInfoProvider)
|
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
|
|
|
|
2012-05-24 05:57:31 +00:00
|
|
|
m_pCallStackWnd = new CCallStackWnd(hParent, virtualMachine, m_pCtx, m_biosDebugInfoProvider);
|
|
|
|
m_pCallStackWnd->OnFunctionDblClick.connect(boost::bind(&CDebugView::OnCallStackWndFunctionDblClick, this, _1));
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
Hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
CDebugView::~CDebugView()
|
|
|
|
{
|
2012-05-12 04:31:40 +00:00
|
|
|
delete m_pDisAsmWnd;
|
|
|
|
delete m_pRegViewWnd;
|
|
|
|
delete m_pMemoryViewWnd;
|
|
|
|
delete m_pCallStackWnd;
|
2006-06-15 04:19:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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()
|
|
|
|
{
|
2012-05-12 04:31:40 +00:00
|
|
|
m_stepFunction();
|
2008-11-28 02:56:27 +00:00
|
|
|
}
|
|
|
|
|
2012-05-24 05:57:31 +00:00
|
|
|
CBiosDebugInfoProvider* CDebugView::GetBiosDebugInfoProvider() const
|
|
|
|
{
|
|
|
|
return m_biosDebugInfoProvider;
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
2012-05-24 05:57:31 +00:00
|
|
|
m_pDisAsmWnd->SetCenterAtAddress(nAddress);
|
|
|
|
m_pDisAsmWnd->SetSelectedAddress(nAddress);
|
2006-06-15 04:19:30 +00:00
|
|
|
}
|