// The Play, Stop, Step, Skip, Go to PC and Show PC buttons go here void CCodeWindow::OnCodeStep(wxCommandEvent& event) { switch (event.GetId()) { case IDM_STEP: SingleStep(); break; case IDM_STEPOVER: StepOver(); break; case IDM_TOGGLE_BREAKPOINT: ToggleBreakpoint(); break; case IDM_SKIP: PC += 4; Update(); break; case IDM_SETPC: PC = codeview->GetSelection(); Update(); break; case IDM_GOTOPC: JumpToAddress(PC); break; } UpdateButtonStates(); // Update all toolbars in the aui manager Parent->UpdateGUI(); }
void CCodeWindow::OnCallsListChange(wxCommandEvent& event) { int index = calls->GetSelection(); if (index >= 0) { u32 address = (u32)(u64)(calls->GetClientData(index)); if (address) JumpToAddress(address); } }
void CCodeWindow::SingleStep() { if (CCPU::IsStepping()) { JitInterface::InvalidateICache(PC, 4); CCPU::StepOpcode(&sync_event); wxThread::Sleep(20); // need a short wait here JumpToAddress(PC); Update(); Host_UpdateLogDisplay(); } }
void CCodeWindow::SingleStep() { if (CPU::IsStepping()) { PowerPC::breakpoints.ClearAllTemporary(); JitInterface::InvalidateICache(PC, 4, true); CPU::StepOpcode(&sync_event); wxThread::Sleep(20); // need a short wait here JumpToAddress(PC); Update(); } }
void DSPDebuggerLLE::OnSymbolListChange(wxCommandEvent& event) { int index = m_SymbolList->GetSelection(); if (index >= 0) { Symbol* pSymbol = static_cast<Symbol *>(m_SymbolList->GetClientData(index)); if (pSymbol != NULL) { if (pSymbol->type == Symbol::SYMBOL_FUNCTION) { JumpToAddress(pSymbol->address); } } } }
void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event) { wxString txt = m_addr_txtctrl->GetValue(); auto text = StripSpaces(WxStrToStr(txt)); if (text.size()) { u32 addr; sscanf(text.c_str(), "%04x", &addr); if (JumpToAddress(addr)) m_addr_txtctrl->SetBackgroundColour(*wxWHITE); else m_addr_txtctrl->SetBackgroundColour(*wxRED); } event.Skip(); }
void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event) { wxTextCtrl* pAddrCtrl = (wxTextCtrl*)m_Toolbar->FindControl(ID_ADDRBOX); wxString txt = pAddrCtrl->GetValue(); auto text = StripSpaces(WxStrToStr(txt)); if (text.size()) { u32 addr; sscanf(text.c_str(), "%04x", &addr); if (JumpToAddress(addr)) pAddrCtrl->SetBackgroundColour(*wxWHITE); else pAddrCtrl->SetBackgroundColour(*wxRED); } event.Skip(); }
void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) { if (!GetToolBar()) return; wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX); wxString txt = pAddrCtrl->GetValue(); std::string text(WxStrToStr(txt)); text = StripSpaces(text); if (text.size() == 8) { u32 addr; sscanf(text.c_str(), "%08x", &addr); JumpToAddress(addr); } event.Skip(1); }
void CCodeWindow::StepOut() { if (CPU::IsStepping()) { PowerPC::breakpoints.ClearAllTemporary(); // Keep stepping until the next blr or timeout after one second u64 timeout = SystemTimers::GetTicksPerSecond(); u64 steps = 0; PowerPC::CoreMode oldMode = PowerPC::GetMode(); PowerPC::SetMode(PowerPC::MODE_INTERPRETER); UGeckoInstruction inst = PowerPC::HostRead_Instruction(PC); while (inst.hex != 0x4e800020 && steps < timeout) // check for blr { if (inst.LK) { // Step over branches u32 next_pc = PC + 4; while (PC != next_pc && steps < timeout) { PowerPC::SingleStep(); ++steps; } } else { PowerPC::SingleStep(); ++steps; } inst = PowerPC::HostRead_Instruction(PC); } PowerPC::SingleStep(); PowerPC::SetMode(oldMode); JumpToAddress(PC); Update(); UpdateButtonStates(); // Update all toolbars in the aui manager Parent->UpdateGUI(); } }
void CCodeWindow::StepOver() { if (CCPU::IsStepping()) { UGeckoInstruction inst = Memory::Read_Instruction(PC); if (inst.LK) { PowerPC::breakpoints.Add(PC + 4, true); CCPU::EnableStepping(false); JumpToAddress(PC); Update(); } else SingleStep(); UpdateButtonStates(); // Update all toolbars in the aui manager Parent->UpdateGUI(); } }
void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) { wxSearchCtrl* pAddrCtrl = (wxSearchCtrl*)m_aui_toolbar->FindControl(IDM_ADDRBOX); // Trim leading and trailing whitespace. wxString txt = pAddrCtrl->GetValue().Trim().Trim(false); bool success = false; unsigned long addr; if (txt.ToULong(&addr, 16)) { if (JumpToAddress(addr)) success = true; } if (success) pAddrCtrl->SetBackgroundColour(wxNullColour); else if (!txt.empty()) pAddrCtrl->SetBackgroundColour(*wxRED); pAddrCtrl->Refresh(); event.Skip(); }
void DSPDebuggerLLE::FocusOnPC() { JumpToAddress(g_dsp.pc); }