2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:43:35 +00:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
#include <array>
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
#include <wx/aui/framemanager.h>
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/panel.h>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-04-13 23:15:23 +00:00
|
|
|
#include "Common/Event.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "DolphinWX/Globals.h"
|
2009-08-27 07:33:07 +00:00
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
class CCodeView;
|
2009-08-27 10:10:07 +00:00
|
|
|
class CFrame;
|
2016-10-03 07:29:50 +00:00
|
|
|
struct SConfig;
|
|
|
|
class CBreakPointWindow;
|
2008-12-08 04:46:09 +00:00
|
|
|
class CRegisterWindow;
|
2014-10-19 10:45:40 +00:00
|
|
|
class CWatchWindow;
|
2008-12-08 04:46:09 +00:00
|
|
|
class CMemoryWindow;
|
|
|
|
class CJitWindow;
|
2011-01-31 04:36:49 +00:00
|
|
|
class DSPDebuggerLLE;
|
2011-01-31 02:39:25 +00:00
|
|
|
class GFXDebuggerPanel;
|
2014-02-22 22:36:30 +00:00
|
|
|
|
2016-07-15 21:59:05 +00:00
|
|
|
class DolphinAuiToolBar;
|
2014-02-22 22:36:30 +00:00
|
|
|
class wxListBox;
|
|
|
|
class wxMenu;
|
|
|
|
class wxMenuBar;
|
2016-12-04 13:47:08 +00:00
|
|
|
class wxSearchCtrl;
|
2015-02-25 05:06:45 +00:00
|
|
|
class wxToolBar;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
namespace Details
|
|
|
|
{
|
|
|
|
template <class T>
|
|
|
|
struct DebugPanelToID;
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct DebugPanelToID<CBreakPointWindow>
|
|
|
|
{
|
|
|
|
static constexpr int ID = IDM_BREAKPOINT_WINDOW;
|
|
|
|
};
|
|
|
|
template <>
|
|
|
|
struct DebugPanelToID<CRegisterWindow>
|
|
|
|
{
|
|
|
|
static constexpr int ID = IDM_REGISTER_WINDOW;
|
|
|
|
};
|
|
|
|
template <>
|
|
|
|
struct DebugPanelToID<CWatchWindow>
|
|
|
|
{
|
|
|
|
static constexpr int ID = IDM_WATCH_WINDOW;
|
|
|
|
};
|
|
|
|
template <>
|
|
|
|
struct DebugPanelToID<CMemoryWindow>
|
|
|
|
{
|
|
|
|
static constexpr int ID = IDM_MEMORY_WINDOW;
|
|
|
|
};
|
|
|
|
template <>
|
|
|
|
struct DebugPanelToID<CJitWindow>
|
|
|
|
{
|
|
|
|
static constexpr int ID = IDM_JIT_WINDOW;
|
|
|
|
};
|
|
|
|
template <>
|
|
|
|
struct DebugPanelToID<DSPDebuggerLLE>
|
|
|
|
{
|
|
|
|
static constexpr int ID = IDM_SOUND_WINDOW;
|
|
|
|
};
|
|
|
|
template <>
|
|
|
|
struct DebugPanelToID<GFXDebuggerPanel>
|
|
|
|
{
|
|
|
|
static constexpr int ID = IDM_VIDEO_WINDOW;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2014-10-19 02:55:23 +00:00
|
|
|
class CCodeWindow : public wxPanel
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
2014-10-19 02:55:23 +00:00
|
|
|
public:
|
2016-11-11 18:20:47 +00:00
|
|
|
explicit CCodeWindow(CFrame* parent, wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxTAB_TRAVERSAL | wxBORDER_NONE,
|
|
|
|
const wxString& name = _("Code"));
|
2016-06-24 08:43:46 +00:00
|
|
|
~CCodeWindow();
|
|
|
|
|
|
|
|
void Load();
|
|
|
|
void Save();
|
|
|
|
|
|
|
|
bool JumpToAddress(u32 address);
|
|
|
|
|
2016-10-22 21:20:06 +00:00
|
|
|
void Repopulate(bool refresh_codeview = true);
|
2016-06-24 08:43:46 +00:00
|
|
|
void NotifyMapLoaded();
|
|
|
|
void OpenPages();
|
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
// FIXME: This belongs in a separate class.
|
|
|
|
void TogglePanel(int id, bool show);
|
|
|
|
wxPanel* GetUntypedPanel(int id) const;
|
|
|
|
bool HasUntypedPanel(int id) const { return GetUntypedPanel(id) != nullptr; }
|
|
|
|
template <class T>
|
|
|
|
T* GetPanel() const
|
|
|
|
{
|
|
|
|
return static_cast<T*>(GetUntypedPanel(Details::DebugPanelToID<T>::ID));
|
|
|
|
}
|
|
|
|
template <class T>
|
|
|
|
bool HasPanel() const
|
|
|
|
{
|
|
|
|
return HasUntypedPanel(Details::DebugPanelToID<T>::ID);
|
|
|
|
}
|
|
|
|
template <class T>
|
|
|
|
T* RequirePanel()
|
|
|
|
{
|
|
|
|
if (T* p = GetPanel<T>())
|
|
|
|
return p;
|
|
|
|
|
|
|
|
TogglePanel(Details::DebugPanelToID<T>::ID, true);
|
|
|
|
return GetPanel<T>();
|
|
|
|
}
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
// Settings
|
2016-10-03 07:29:50 +00:00
|
|
|
bool bShowOnStart[IDM_DEBUG_WINDOW_LIST_END - IDM_DEBUG_WINDOW_LIST_START];
|
|
|
|
int iNbAffiliation[IDM_DEBUG_WINDOW_LIST_END - IDM_DEBUG_WINDOW_LIST_START];
|
2014-10-19 02:55:23 +00:00
|
|
|
|
|
|
|
private:
|
2016-11-05 02:02:36 +00:00
|
|
|
wxMenuBar* GetParentMenuBar();
|
2016-11-04 03:43:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void OnCPUMode(wxCommandEvent& event);
|
|
|
|
|
|
|
|
void OnChangeFont(wxCommandEvent& event);
|
|
|
|
|
|
|
|
void OnCodeStep(wxCommandEvent& event);
|
|
|
|
void OnAddrBoxChange(wxCommandEvent& event);
|
2016-12-04 13:47:08 +00:00
|
|
|
void OnSymbolFilterText(wxCommandEvent& event);
|
2016-06-24 08:43:46 +00:00
|
|
|
void OnSymbolsMenu(wxCommandEvent& event);
|
|
|
|
void OnJitMenu(wxCommandEvent& event);
|
|
|
|
void OnProfilerMenu(wxCommandEvent& event);
|
|
|
|
|
|
|
|
void OnSymbolListChange(wxCommandEvent& event);
|
|
|
|
void OnCallstackListChange(wxCommandEvent& event);
|
|
|
|
void OnCallersListChange(wxCommandEvent& event);
|
|
|
|
void OnCallsListChange(wxCommandEvent& event);
|
|
|
|
void OnCodeViewChange(wxCommandEvent& event);
|
|
|
|
void OnHostMessage(wxCommandEvent& event);
|
|
|
|
|
|
|
|
// Debugger functions
|
|
|
|
void SingleStep();
|
|
|
|
void StepOver();
|
|
|
|
void StepOut();
|
|
|
|
void ToggleBreakpoint();
|
|
|
|
|
2016-11-03 22:02:53 +00:00
|
|
|
void UpdateFonts();
|
2016-06-24 08:43:46 +00:00
|
|
|
void UpdateLists();
|
|
|
|
void UpdateCallstack();
|
|
|
|
|
2016-12-04 13:47:08 +00:00
|
|
|
void ReloadSymbolListBox();
|
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
wxPanel* CreateSiblingPanel(int id);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
// Sibling debugger panels
|
|
|
|
// FIXME: This obviously belongs in some manager class above this one.
|
2016-11-11 18:31:36 +00:00
|
|
|
std::array<wxPanel*, IDM_DEBUG_WINDOW_LIST_END - IDM_DEBUG_WINDOW_LIST_START> m_sibling_panels{};
|
2016-10-03 07:29:50 +00:00
|
|
|
|
|
|
|
CFrame* Parent;
|
2016-06-24 08:43:46 +00:00
|
|
|
CCodeView* codeview;
|
2016-12-04 13:47:08 +00:00
|
|
|
wxSearchCtrl* m_symbol_filter_ctrl;
|
2016-06-24 08:43:46 +00:00
|
|
|
wxListBox* callstack;
|
|
|
|
wxListBox* symbols;
|
|
|
|
wxListBox* callers;
|
|
|
|
wxListBox* calls;
|
|
|
|
Common::Event sync_event;
|
|
|
|
|
|
|
|
wxAuiManager m_aui_manager;
|
2016-07-15 21:59:05 +00:00
|
|
|
DolphinAuiToolBar* m_aui_toolbar;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|