mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DSPLLE: sort of semi-working breakpoints and stepping, if you flip an #ifdef. more work to do, for some reason it gets very slow when you enable it atm
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3573 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -39,8 +39,6 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow *parent, wxWindowID id, const wxString &
|
||||
const wxPoint &position, const wxSize& size, long style)
|
||||
: wxFrame(parent, id, title, position, size, style)
|
||||
, m_CachedStepCounter(-1)
|
||||
, m_CachedCR(-1)
|
||||
, m_State(RUN)
|
||||
{
|
||||
CreateGUIControls();
|
||||
}
|
||||
@ -87,6 +85,8 @@ void DSPDebuggerLLE::CreateGUIControls()
|
||||
|
||||
this->SetSizer(sMain);
|
||||
this->Layout();
|
||||
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
void DSPDebuggerLLE::OnClose(wxCloseEvent& event)
|
||||
@ -99,15 +99,17 @@ void DSPDebuggerLLE::OnChangeState(wxCommandEvent& event)
|
||||
switch (event.GetId())
|
||||
{
|
||||
case ID_RUNTOOL:
|
||||
if ((m_State == RUN) || (m_State == RUN_START))
|
||||
m_State = PAUSE;
|
||||
if (DSPCore_GetState() == DSPCORE_RUNNING)
|
||||
DSPCore_SetState(DSPCORE_STEPPING);
|
||||
else
|
||||
m_State = RUN_START;
|
||||
DSPCore_SetState(DSPCORE_RUNNING);
|
||||
break;
|
||||
|
||||
case ID_STEPTOOL:
|
||||
m_State = STEP;
|
||||
if (DSPCore_GetState() == DSPCORE_STEPPING)
|
||||
DSPCore_Step();
|
||||
break;
|
||||
|
||||
case ID_SHOWPCTOOL:
|
||||
FocusOnPC();
|
||||
break;
|
||||
@ -137,10 +139,14 @@ void DSPDebuggerLLE::FocusOnPC()
|
||||
|
||||
void DSPDebuggerLLE::UpdateState()
|
||||
{
|
||||
if ((m_State == RUN) || (m_State == RUN_START))
|
||||
if (DSPCore_GetState() == DSPCORE_RUNNING) {
|
||||
m_Toolbar->FindById(ID_RUNTOOL)->SetLabel(wxT("Pause"));
|
||||
else
|
||||
m_Toolbar->FindById(ID_STEPTOOL)->Enable(false);
|
||||
}
|
||||
else {
|
||||
m_Toolbar->FindById(ID_RUNTOOL)->SetLabel(wxT("Run"));
|
||||
m_Toolbar->FindById(ID_STEPTOOL)->Enable(true);
|
||||
}
|
||||
m_Toolbar->Realize();
|
||||
}
|
||||
|
||||
@ -188,54 +194,7 @@ void DSPDebuggerLLE::OnSymbolListChange(wxCommandEvent& event)
|
||||
|
||||
void DSPDebuggerLLE::UpdateRegisterFlags()
|
||||
{
|
||||
if (m_CachedCR == g_dsp.cr)
|
||||
return;
|
||||
|
||||
// m_Toolbar->ToggleTool(ID_CHECK_ASSERTINT, g_dsp.cr & 0x02 ? true : false);
|
||||
// m_Toolbar->ToggleTool(ID_CHECK_HALT, g_dsp.cr & 0x04 ? true : false);
|
||||
// m_Toolbar->ToggleTool(ID_CHECK_INIT, g_dsp.cr & 0x800 ? true : false);
|
||||
|
||||
m_CachedCR = g_dsp.cr;
|
||||
}
|
||||
|
||||
bool DSPDebuggerLLE::CanDoStep()
|
||||
{
|
||||
// update the symbols all the time because they're script cmds like bps
|
||||
UpdateSymbolMap();
|
||||
|
||||
switch (m_State)
|
||||
{
|
||||
case RUN_START:
|
||||
m_State = RUN;
|
||||
return true;
|
||||
|
||||
case RUN:
|
||||
/*
|
||||
if (IsBreakPoint(g_dsp.pc))
|
||||
{
|
||||
Refresh();
|
||||
m_State = PAUSE;
|
||||
return false;
|
||||
}*/
|
||||
|
||||
return true;
|
||||
|
||||
case PAUSE:
|
||||
Refresh();
|
||||
return false;
|
||||
|
||||
case STEP:
|
||||
Refresh();
|
||||
m_State = PAUSE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void DSPDebuggerLLE::DebugBreak()
|
||||
{
|
||||
m_State = PAUSE;
|
||||
}
|
||||
|
||||
void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event)
|
||||
|
@ -54,8 +54,6 @@ public:
|
||||
|
||||
virtual ~DSPDebuggerLLE();
|
||||
|
||||
bool CanDoStep();
|
||||
void DebugBreak();
|
||||
void Refresh();
|
||||
|
||||
private:
|
||||
@ -95,18 +93,8 @@ private:
|
||||
COLUMN_PARAM,
|
||||
};
|
||||
|
||||
enum EState
|
||||
{
|
||||
PAUSE,
|
||||
STEP,
|
||||
RUN,
|
||||
RUN_START // ignores breakpoints and switches after one step to RUN
|
||||
};
|
||||
EState m_State;
|
||||
|
||||
DSPDebugInterface debug_interface;
|
||||
u64 m_CachedStepCounter;
|
||||
u16 m_CachedCR;
|
||||
|
||||
// GUI updaters
|
||||
void UpdateDisAsmListView();
|
||||
|
Reference in New Issue
Block a user