2009-04-02 06:50:47 -06:00
|
|
|
// Copyright (C) 2003-2009 Dolphin Project.
|
2009-03-30 07:21:22 -06:00
|
|
|
|
2009-04-02 06:50:47 -06:00
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
#ifndef _DSP_DEBUGGER_LLE_H
|
|
|
|
#define _DSP_DEBUGGER_LLE_H
|
2009-03-30 07:21:22 -06:00
|
|
|
|
|
|
|
// general things
|
|
|
|
#include <iostream>
|
|
|
|
#include <vector>
|
2009-04-02 06:50:47 -06:00
|
|
|
#include <list>
|
|
|
|
#include <map>
|
|
|
|
#include <algorithm>
|
2009-03-30 07:21:22 -06:00
|
|
|
|
|
|
|
#include <wx/wx.h>
|
2009-04-02 06:50:47 -06:00
|
|
|
#include <wx/frame.h>
|
2009-03-30 07:21:22 -06:00
|
|
|
#include <wx/button.h>
|
|
|
|
#include <wx/stattext.h>
|
|
|
|
#include <wx/statbox.h>
|
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/listctrl.h>
|
2009-04-02 06:50:47 -06:00
|
|
|
#include <wx/statline.h>
|
2009-03-30 07:21:22 -06:00
|
|
|
|
2009-04-12 04:21:40 -06:00
|
|
|
#include "disassemble.h"
|
2009-06-28 04:24:44 -06:00
|
|
|
#include "DSPInterpreter.h"
|
2009-06-28 04:00:25 -06:00
|
|
|
#include "DSPMemoryMap.h"
|
2009-06-21 02:39:21 -06:00
|
|
|
#include "../DSPDebugInterface.h"
|
2009-03-30 07:21:22 -06:00
|
|
|
|
2009-04-02 06:50:47 -06:00
|
|
|
class DSPRegisterView;
|
2009-06-21 02:39:21 -06:00
|
|
|
class CCodeView;
|
2009-03-30 07:21:22 -06:00
|
|
|
|
2009-04-02 06:50:47 -06:00
|
|
|
class DSPDebuggerLLE : public wxFrame
|
2009-03-30 07:21:22 -06:00
|
|
|
{
|
2009-04-02 06:50:47 -06:00
|
|
|
public:
|
|
|
|
DSPDebuggerLLE(wxWindow *parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString &title = wxT("DSP LLE Debugger"),
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE);
|
|
|
|
|
|
|
|
virtual ~DSPDebuggerLLE();
|
|
|
|
|
2009-04-18 13:06:47 -06:00
|
|
|
void Refresh();
|
2009-04-02 06:50:47 -06:00
|
|
|
|
2009-03-30 07:21:22 -06:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
|
|
|
2009-04-02 06:50:47 -06:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
// Toolbar
|
|
|
|
ID_TOOLBAR = 1000,
|
|
|
|
ID_RUNTOOL,
|
|
|
|
ID_STEPTOOL,
|
2009-04-03 12:04:08 -06:00
|
|
|
ID_SHOWPCTOOL,
|
2009-06-21 02:39:21 -06:00
|
|
|
ID_ADDRBOX,
|
2009-04-02 06:50:47 -06:00
|
|
|
ID_JUMPTOTOOL,
|
2009-04-03 13:29:15 -06:00
|
|
|
ID_DISASMDUMPTOOL,
|
2009-04-02 06:50:47 -06:00
|
|
|
ID_CHECK_ASSERTINT,
|
|
|
|
ID_CHECK_HALT,
|
|
|
|
ID_CHECK_INIT,
|
2009-06-21 02:39:21 -06:00
|
|
|
ID_SYMBOLLIST,
|
2009-03-30 07:21:22 -06:00
|
|
|
|
2009-06-21 02:39:21 -06:00
|
|
|
// Code view
|
|
|
|
ID_CODEVIEW,
|
2009-03-30 07:21:22 -06:00
|
|
|
|
2009-04-02 06:50:47 -06:00
|
|
|
// Register View
|
|
|
|
ID_DSP_REGS,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Disasm listctrl columns
|
2009-03-30 07:21:22 -06:00
|
|
|
enum
|
|
|
|
{
|
2009-04-02 06:50:47 -06:00
|
|
|
COLUMN_BP,
|
|
|
|
COLUMN_FUNCTION,
|
|
|
|
COLUMN_ADDRESS,
|
|
|
|
COLUMN_MNEMONIC,
|
|
|
|
COLUMN_OPCODE,
|
|
|
|
COLUMN_EXT,
|
|
|
|
COLUMN_PARAM,
|
|
|
|
};
|
|
|
|
|
2009-06-21 02:39:21 -06:00
|
|
|
DSPDebugInterface debug_interface;
|
2009-04-02 06:50:47 -06:00
|
|
|
u64 m_CachedStepCounter;
|
|
|
|
|
|
|
|
// GUI updaters
|
|
|
|
void UpdateDisAsmListView();
|
|
|
|
void UpdateRegisterFlags();
|
|
|
|
void UpdateSymbolMap();
|
2009-04-06 14:32:37 -06:00
|
|
|
void UpdateState();
|
2009-04-02 06:50:47 -06:00
|
|
|
|
|
|
|
// GUI items
|
|
|
|
wxToolBar* m_Toolbar;
|
2009-06-21 02:39:21 -06:00
|
|
|
CCodeView* m_CodeView;
|
2009-04-02 06:50:47 -06:00
|
|
|
DSPRegisterView* m_Regs;
|
2009-06-21 02:39:21 -06:00
|
|
|
wxListBox* m_SymbolList;
|
2009-04-02 06:50:47 -06:00
|
|
|
|
|
|
|
void OnClose(wxCloseEvent& event);
|
2009-04-03 12:04:08 -06:00
|
|
|
void OnChangeState(wxCommandEvent& event);
|
2009-04-06 14:32:37 -06:00
|
|
|
void OnShowPC(wxCommandEvent& event);
|
2009-04-03 12:04:08 -06:00
|
|
|
void OnRightClick(wxListEvent& event);
|
|
|
|
void OnDoubleClick(wxListEvent& event);
|
2009-06-21 02:39:21 -06:00
|
|
|
void OnAddrBoxChange(wxCommandEvent& event);
|
|
|
|
void OnSymbolListChange(wxCommandEvent& event);
|
|
|
|
|
|
|
|
bool JumpToAddress(u16 addr);
|
2009-03-30 07:21:22 -06:00
|
|
|
|
2009-04-02 06:50:47 -06:00
|
|
|
void CreateGUIControls();
|
2009-04-06 14:32:37 -06:00
|
|
|
void FocusOnPC();
|
|
|
|
void UnselectAll();
|
2009-03-30 07:21:22 -06:00
|
|
|
};
|
|
|
|
|
2009-04-02 06:50:47 -06:00
|
|
|
#endif //_DSP_DEBUGGER_LLE_H
|