mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Added a RAM Watch window to the debugger
Conflicts: Source/Core/Core/HW/Memmap.cpp Source/Core/Core/HW/Memmap.h Source/Core/DolphinWX/Debugger/CodeWindow.h
This commit is contained in:
@ -52,6 +52,7 @@
|
||||
#include "DolphinWX/Debugger/DebuggerUIUtil.h"
|
||||
#include "DolphinWX/Debugger/JitWindow.h"
|
||||
#include "DolphinWX/Debugger/RegisterWindow.h"
|
||||
#include "DolphinWX/Debugger/WatchWindow.h"
|
||||
|
||||
extern "C" // Bitmaps
|
||||
{
|
||||
@ -93,6 +94,7 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
|
||||
: wxPanel(parent, id, position, size, style, name)
|
||||
, Parent(parent)
|
||||
, m_RegisterWindow(nullptr)
|
||||
, m_WatchWindow(nullptr)
|
||||
, m_BreakpointWindow(nullptr)
|
||||
, m_MemoryWindow(nullptr)
|
||||
, m_JitWindow(nullptr)
|
||||
@ -152,6 +154,7 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event)
|
||||
Update();
|
||||
if (codeview) codeview->Center(PC);
|
||||
if (m_RegisterWindow) m_RegisterWindow->NotifyUpdate();
|
||||
if (m_WatchWindow) m_WatchWindow->NotifyUpdate();
|
||||
break;
|
||||
|
||||
case IDM_UPDATEBREAKPOINTS:
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
class CFrame;
|
||||
class CRegisterWindow;
|
||||
class CWatchWindow;
|
||||
class CBreakPointWindow;
|
||||
class CMemoryWindow;
|
||||
class CJitWindow;
|
||||
@ -35,111 +36,113 @@ class wxMenuBar;
|
||||
class CCodeWindow : public wxPanel
|
||||
{
|
||||
public:
|
||||
CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter,
|
||||
CFrame * parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxBORDER_NONE,
|
||||
CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter,
|
||||
CFrame * parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxBORDER_NONE,
|
||||
const wxString& name = _("Code"));
|
||||
|
||||
void Load();
|
||||
void Save();
|
||||
void Load();
|
||||
void Save();
|
||||
|
||||
// Parent interaction
|
||||
CFrame *Parent;
|
||||
wxMenuBar * GetMenuBar();
|
||||
wxToolBar * GetToolBar();
|
||||
wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
|
||||
// Parent interaction
|
||||
CFrame *Parent;
|
||||
wxMenuBar * GetMenuBar();
|
||||
wxToolBar * GetToolBar();
|
||||
wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
|
||||
|
||||
bool UseInterpreter();
|
||||
bool BootToPause();
|
||||
bool AutomaticStart();
|
||||
bool JITNoBlockCache();
|
||||
bool JITNoBlockLinking();
|
||||
bool JumpToAddress(u32 address);
|
||||
bool UseInterpreter();
|
||||
bool BootToPause();
|
||||
bool AutomaticStart();
|
||||
bool JITNoBlockCache();
|
||||
bool JITNoBlockLinking();
|
||||
bool JumpToAddress(u32 address);
|
||||
|
||||
void Update() override;
|
||||
void NotifyMapLoaded();
|
||||
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar);
|
||||
void CreateMenuOptions(wxMenu *pMenu);
|
||||
void CreateMenuSymbols(wxMenuBar *pMenuBar);
|
||||
void RecreateToolbar(wxToolBar*);
|
||||
void PopulateToolbar(wxToolBar* toolBar);
|
||||
void UpdateButtonStates();
|
||||
void OpenPages();
|
||||
void UpdateManager();
|
||||
void Update() override;
|
||||
void NotifyMapLoaded();
|
||||
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar);
|
||||
void CreateMenuOptions(wxMenu *pMenu);
|
||||
void CreateMenuSymbols(wxMenuBar *pMenuBar);
|
||||
void RecreateToolbar(wxToolBar*);
|
||||
void PopulateToolbar(wxToolBar* toolBar);
|
||||
void UpdateButtonStates();
|
||||
void OpenPages();
|
||||
void UpdateManager();
|
||||
|
||||
// Menu bar
|
||||
// -------------------
|
||||
void OnCPUMode(wxCommandEvent& event); // CPU Mode menu
|
||||
void OnJITOff(wxCommandEvent& event);
|
||||
// Menu bar
|
||||
// -------------------
|
||||
void OnCPUMode(wxCommandEvent& event); // CPU Mode menu
|
||||
void OnJITOff(wxCommandEvent& event);
|
||||
|
||||
void ToggleCodeWindow(bool bShow);
|
||||
void ToggleRegisterWindow(bool bShow);
|
||||
void ToggleBreakPointWindow(bool bShow);
|
||||
void ToggleMemoryWindow(bool bShow);
|
||||
void ToggleJitWindow(bool bShow);
|
||||
void ToggleSoundWindow(bool bShow);
|
||||
void ToggleVideoWindow(bool bShow);
|
||||
void ToggleCodeWindow(bool bShow);
|
||||
void ToggleRegisterWindow(bool bShow);
|
||||
void ToggleWatchWindow(bool bShow);
|
||||
void ToggleBreakPointWindow(bool bShow);
|
||||
void ToggleMemoryWindow(bool bShow);
|
||||
void ToggleJitWindow(bool bShow);
|
||||
void ToggleSoundWindow(bool bShow);
|
||||
void ToggleVideoWindow(bool bShow);
|
||||
|
||||
void OnChangeFont(wxCommandEvent& event);
|
||||
void OnChangeFont(wxCommandEvent& event);
|
||||
|
||||
void OnCodeStep(wxCommandEvent& event);
|
||||
void OnAddrBoxChange(wxCommandEvent& event);
|
||||
void OnSymbolsMenu(wxCommandEvent& event);
|
||||
void OnJitMenu(wxCommandEvent& event);
|
||||
void OnProfilerMenu(wxCommandEvent& event);
|
||||
void OnCodeStep(wxCommandEvent& event);
|
||||
void OnAddrBoxChange(wxCommandEvent& event);
|
||||
void OnSymbolsMenu(wxCommandEvent& event);
|
||||
void OnJitMenu(wxCommandEvent& event);
|
||||
void OnProfilerMenu(wxCommandEvent& event);
|
||||
|
||||
// Sub dialogs
|
||||
CRegisterWindow* m_RegisterWindow;
|
||||
CBreakPointWindow* m_BreakpointWindow;
|
||||
CMemoryWindow* m_MemoryWindow;
|
||||
CJitWindow* m_JitWindow;
|
||||
DSPDebuggerLLE* m_SoundWindow;
|
||||
GFXDebuggerPanel* m_VideoWindow;
|
||||
// Sub dialogs
|
||||
CRegisterWindow* m_RegisterWindow;
|
||||
CWatchWindow* m_WatchWindow;
|
||||
CBreakPointWindow* m_BreakpointWindow;
|
||||
CMemoryWindow* m_MemoryWindow;
|
||||
CJitWindow* m_JitWindow;
|
||||
DSPDebuggerLLE* m_SoundWindow;
|
||||
GFXDebuggerPanel* m_VideoWindow;
|
||||
|
||||
// Settings
|
||||
bool bAutomaticStart; bool bBootToPause;
|
||||
bool bShowOnStart[IDM_VIDEOWINDOW - IDM_LOGWINDOW + 1];
|
||||
int iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
|
||||
// Settings
|
||||
bool bAutomaticStart; bool bBootToPause;
|
||||
bool bShowOnStart[IDM_VIDEOWINDOW - IDM_LOGWINDOW + 1];
|
||||
int iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
// Debugger GUI Objects
|
||||
ID_CODEVIEW,
|
||||
ID_CALLSTACKLIST,
|
||||
ID_CALLERSLIST,
|
||||
ID_CALLSLIST,
|
||||
ID_SYMBOLLIST
|
||||
};
|
||||
enum
|
||||
{
|
||||
// Debugger GUI Objects
|
||||
ID_CODEVIEW,
|
||||
ID_CALLSTACKLIST,
|
||||
ID_CALLERSLIST,
|
||||
ID_CALLSLIST,
|
||||
ID_SYMBOLLIST
|
||||
};
|
||||
|
||||
void OnSymbolListChange(wxCommandEvent& event);
|
||||
void OnSymbolListContextMenu(wxContextMenuEvent& event);
|
||||
void OnCallstackListChange(wxCommandEvent& event);
|
||||
void OnCallersListChange(wxCommandEvent& event);
|
||||
void OnCallsListChange(wxCommandEvent& event);
|
||||
void OnCodeViewChange(wxCommandEvent &event);
|
||||
void OnHostMessage(wxCommandEvent& event);
|
||||
void OnSymbolListChange(wxCommandEvent& event);
|
||||
void OnSymbolListContextMenu(wxContextMenuEvent& 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();
|
||||
// Debugger functions
|
||||
void SingleStep();
|
||||
void StepOver();
|
||||
void StepOut();
|
||||
void ToggleBreakpoint();
|
||||
|
||||
void UpdateLists();
|
||||
void UpdateCallstack();
|
||||
void UpdateLists();
|
||||
void UpdateCallstack();
|
||||
|
||||
void InitBitmaps();
|
||||
void InitBitmaps();
|
||||
|
||||
CCodeView* codeview;
|
||||
wxListBox* callstack;
|
||||
wxListBox* symbols;
|
||||
wxListBox* callers;
|
||||
wxListBox* calls;
|
||||
Common::Event sync_event;
|
||||
CCodeView* codeview;
|
||||
wxListBox* callstack;
|
||||
wxListBox* symbols;
|
||||
wxListBox* callers;
|
||||
wxListBox* calls;
|
||||
Common::Event sync_event;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "DolphinWX/Debugger/JitWindow.h"
|
||||
#include "DolphinWX/Debugger/MemoryWindow.h"
|
||||
#include "DolphinWX/Debugger/RegisterWindow.h"
|
||||
#include "DolphinWX/Debugger/WatchWindow.h"
|
||||
|
||||
|
||||
// Save and load settings
|
||||
@ -421,6 +422,8 @@ void CCodeWindow::OpenPages()
|
||||
Parent->ToggleLogConfigWindow(true);
|
||||
if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW])
|
||||
ToggleRegisterWindow(true);
|
||||
if (bShowOnStart[IDM_WATCHWINDOW - IDM_LOGWINDOW])
|
||||
ToggleWatchWindow(true);
|
||||
if (bShowOnStart[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW])
|
||||
ToggleBreakPointWindow(true);
|
||||
if (bShowOnStart[IDM_MEMORYWINDOW - IDM_LOGWINDOW])
|
||||
@ -461,6 +464,24 @@ void CCodeWindow::ToggleRegisterWindow(bool bShow)
|
||||
}
|
||||
}
|
||||
|
||||
void CCodeWindow::ToggleWatchWindow(bool bShow)
|
||||
{
|
||||
GetMenuBar()->FindItem(IDM_WATCHWINDOW)->Check(bShow);
|
||||
if (bShow)
|
||||
{
|
||||
if (!m_WatchWindow)
|
||||
m_WatchWindow = new CWatchWindow(Parent, IDM_WATCHWINDOW);
|
||||
Parent->DoAddPage(m_WatchWindow,
|
||||
iNbAffiliation[IDM_WATCHWINDOW - IDM_LOGWINDOW],
|
||||
Parent->bFloatWindow[IDM_WATCHWINDOW - IDM_LOGWINDOW]);
|
||||
}
|
||||
else // Close
|
||||
{
|
||||
Parent->DoRemovePage(m_WatchWindow, false);
|
||||
m_WatchWindow = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void CCodeWindow::ToggleBreakPointWindow(bool bShow)
|
||||
{
|
||||
GetMenuBar()->FindItem(IDM_BREAKPOINTWINDOW)->Check(bShow);
|
||||
|
@ -38,6 +38,7 @@ enum
|
||||
IDM_COPYCODE,
|
||||
IDM_RUNTOHERE,
|
||||
IDM_DYNARECRESULTS,
|
||||
IDM_WATCHADDRESS,
|
||||
IDM_TOGGLEMEMORY,
|
||||
IDM_VIEWASFP,
|
||||
IDM_VIEWASASCII,
|
||||
@ -180,6 +181,11 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case IDM_WATCHADDRESS:
|
||||
debugger->AddWatch(selection);
|
||||
Refresh();
|
||||
break;
|
||||
|
||||
case IDM_TOGGLEMEMORY:
|
||||
memory ^= 1;
|
||||
Refresh();
|
||||
@ -215,6 +221,7 @@ void CMemoryView::OnMouseDownR(wxMouseEvent& event)
|
||||
menu->Append(IDM_COPYADDRESS, _("Copy &address"));
|
||||
menu->Append(IDM_COPYHEX, _("Copy &hex"));
|
||||
#endif
|
||||
menu->Append(IDM_WATCHADDRESS, _("Add to &watch"));
|
||||
menu->Append(IDM_TOGGLEMEMORY, _("Toggle &memory"));
|
||||
|
||||
wxMenu* viewAsSubMenu = new wxMenu;
|
||||
|
212
Source/Core/DolphinWX/Debugger/WatchView.cpp
Normal file
212
Source/Core/DolphinWX/Debugger/WatchView.cpp
Normal file
@ -0,0 +1,212 @@
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <wx/chartype.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/defs.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/windowid.h>
|
||||
|
||||
#include "Common/GekkoDisassembler.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
#include "DolphinWX/Debugger/DebuggerUIUtil.h"
|
||||
#include "DolphinWX/Debugger/WatchView.h"
|
||||
|
||||
class wxWindow;
|
||||
|
||||
static std::string GetWatchName(int count)
|
||||
{
|
||||
return PowerPC::watches.GetWatches().at(count - 1).name;
|
||||
}
|
||||
|
||||
static u32 GetWatchAddr(int count)
|
||||
{
|
||||
return PowerPC::watches.GetWatches().at(count - 1).iAddress;
|
||||
}
|
||||
|
||||
static u32 GetWatchValue(int count)
|
||||
{
|
||||
return Memory::ReadUnchecked_U32(GetWatchAddr(count));
|
||||
}
|
||||
|
||||
static void AddWatchAddr(int count, u32 value)
|
||||
{
|
||||
PowerPC::watches.Add(value);
|
||||
}
|
||||
|
||||
static void UpdateWatchAddr(int count, u32 value)
|
||||
{
|
||||
PowerPC::watches.Update(count - 1, value);
|
||||
}
|
||||
|
||||
static void SetWatchName(int count, std::string value)
|
||||
{
|
||||
PowerPC::watches.UpdateName(count - 1, value);
|
||||
}
|
||||
|
||||
static void SetWatchValue(int count, u32 value)
|
||||
{
|
||||
Memory::WriteUnchecked_U32(value, GetWatchAddr(count));
|
||||
}
|
||||
|
||||
wxString CWatchTable::GetValue(int row, int col)
|
||||
{
|
||||
if (row == 0)
|
||||
{
|
||||
// Column Labels
|
||||
switch (col)
|
||||
{
|
||||
case 0: return wxString::Format("Label");
|
||||
case 1: return wxString::Format("Addr");
|
||||
case 2: return wxString::Format("Hex");
|
||||
case 3: return wxString::Format("Dec");
|
||||
case 4: return wxString::Format("Str");
|
||||
default: return wxEmptyString;
|
||||
}
|
||||
}
|
||||
else if (row <= PowerPC::watches.GetWatches().size())
|
||||
{
|
||||
if (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
|
||||
{
|
||||
switch (col)
|
||||
{
|
||||
case 0: return wxString::Format("%s", GetWatchName(row));
|
||||
case 1: return wxString::Format("%08x", GetWatchAddr(row));
|
||||
case 2: return wxString::Format("%08x", GetWatchValue(row));
|
||||
case 3: return wxString::Format("%lu", GetWatchValue(row));
|
||||
case 4:
|
||||
{
|
||||
u32 addr = GetWatchAddr(row);
|
||||
if (Memory::IsRAMAddress(addr))
|
||||
return Memory::GetString(addr, 32).c_str();
|
||||
else
|
||||
return wxEmptyString;
|
||||
}
|
||||
default: return wxEmptyString;
|
||||
}
|
||||
}
|
||||
}
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
void CWatchTable::SetValue(int row, int col, const wxString& strNewVal)
|
||||
{
|
||||
u32 newVal = 0;
|
||||
if (col == 0 || TryParse("0x" + WxStrToStr(strNewVal), &newVal))
|
||||
{
|
||||
if (row > 0)
|
||||
{
|
||||
switch (col)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
SetWatchName(row, std::string(WxStrToStr(strNewVal)));
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (row > (int)PowerPC::watches.GetWatches().size())
|
||||
{
|
||||
AddWatchAddr(row, newVal);
|
||||
row = (int)PowerPC::watches.GetWatches().size();
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateWatchAddr(row, newVal);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
SetWatchValue(row, newVal);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CWatchTable::UpdateWatch()
|
||||
{
|
||||
for (int i = 0; i < (int)PowerPC::watches.GetWatches().size(); ++i)
|
||||
{
|
||||
m_CachedWatchHasChanged[i] = (m_CachedWatch[i] != GetWatchValue(i + 1));
|
||||
m_CachedWatch[i] = GetWatchValue(i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
wxGridCellAttr *CWatchTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind)
|
||||
{
|
||||
wxGridCellAttr *attr = new wxGridCellAttr();
|
||||
|
||||
attr->SetBackgroundColour(*wxWHITE);
|
||||
attr->SetFont(DebuggerFont);
|
||||
|
||||
switch (col)
|
||||
{
|
||||
case 1:
|
||||
attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
|
||||
break;
|
||||
default:
|
||||
attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
|
||||
break;
|
||||
}
|
||||
|
||||
if (row == 0)
|
||||
{
|
||||
attr->SetReadOnly(true);
|
||||
attr->SetBackgroundColour(*wxBLACK);
|
||||
attr->SetTextColour(*wxWHITE);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool red = false;
|
||||
switch (col)
|
||||
{
|
||||
case 1: red = m_CachedWatchHasChanged[row]; break;
|
||||
}
|
||||
|
||||
attr->SetTextColour(red ? *wxRED : *wxBLACK);
|
||||
|
||||
if (row > (int)(PowerPC::watches.GetWatches().size() + 1))
|
||||
{
|
||||
attr->SetReadOnly(true);
|
||||
attr->SetBackgroundColour(*wxLIGHT_GREY);
|
||||
}
|
||||
}
|
||||
attr->IncRef();
|
||||
return attr;
|
||||
}
|
||||
|
||||
CWatchView::CWatchView(wxWindow *parent, wxWindowID id)
|
||||
: wxGrid(parent, id)
|
||||
{
|
||||
SetTable(new CWatchTable(), false);
|
||||
SetRowLabelSize(0);
|
||||
SetColLabelSize(0);
|
||||
DisableDragRowSize();
|
||||
|
||||
if (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
|
||||
{
|
||||
AutoSizeColumns();
|
||||
}
|
||||
}
|
||||
|
||||
void CWatchView::Update()
|
||||
{
|
||||
if (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
|
||||
{
|
||||
ForceRefresh();
|
||||
((CWatchTable *)GetTable())->UpdateWatch();
|
||||
}
|
||||
}
|
50
Source/Core/DolphinWX/Debugger/WatchView.h
Normal file
50
Source/Core/DolphinWX/Debugger/WatchView.h
Normal file
@ -0,0 +1,50 @@
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <wx/defs.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/windowid.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
class wxWindow;
|
||||
|
||||
class CWatchTable : public wxGridTableBase
|
||||
{
|
||||
enum
|
||||
{
|
||||
NUM_SPECIALS = 1,
|
||||
MAX_SPECIALS = 256,
|
||||
};
|
||||
|
||||
public:
|
||||
CWatchTable()
|
||||
{
|
||||
}
|
||||
|
||||
int GetNumberCols() override { return 5; }
|
||||
int GetNumberRows() override { return MAX_SPECIALS; }
|
||||
wxString GetValue(int row, int col) override;
|
||||
void SetValue(int row, int col, const wxString &) override;
|
||||
wxGridCellAttr *GetAttr(int, int, wxGridCellAttr::wxAttrKind) override;
|
||||
void UpdateWatch();
|
||||
|
||||
private:
|
||||
std::array<u32, MAX_SPECIALS> m_CachedWatch;
|
||||
std::array<bool, MAX_SPECIALS> m_CachedWatchHasChanged;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(CWatchTable);
|
||||
};
|
||||
|
||||
class CWatchView : public wxGrid
|
||||
{
|
||||
public:
|
||||
CWatchView(wxWindow* parent, wxWindowID id);
|
||||
void Update() override;
|
||||
};
|
46
Source/Core/DolphinWX/Debugger/WatchWindow.cpp
Normal file
46
Source/Core/DolphinWX/Debugger/WatchWindow.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cstddef>
|
||||
#include <wx/defs.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/windowid.h>
|
||||
|
||||
#include "DolphinWX/Debugger/WatchView.h"
|
||||
#include "DolphinWX/Debugger/WatchWindow.h"
|
||||
|
||||
class wxWindow;
|
||||
|
||||
BEGIN_EVENT_TABLE(CWatchWindow, wxPanel)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
CWatchWindow::CWatchWindow(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& position, const wxSize& size,
|
||||
long style, const wxString& name)
|
||||
: wxPanel(parent, id, position, size, style, name)
|
||||
, m_GPRGridView(nullptr)
|
||||
{
|
||||
CreateGUIControls();
|
||||
}
|
||||
|
||||
void CWatchWindow::CreateGUIControls()
|
||||
{
|
||||
wxBoxSizer *sGrid = new wxBoxSizer(wxVERTICAL);
|
||||
m_GPRGridView = new CWatchView(this, ID_GPR);
|
||||
sGrid->Add(m_GPRGridView, 1, wxGROW);
|
||||
SetSizer(sGrid);
|
||||
|
||||
NotifyUpdate();
|
||||
}
|
||||
|
||||
void CWatchWindow::NotifyUpdate()
|
||||
{
|
||||
if (m_GPRGridView != nullptr)
|
||||
m_GPRGridView->Update();
|
||||
}
|
42
Source/Core/DolphinWX/Debugger/WatchWindow.h
Normal file
42
Source/Core/DolphinWX/Debugger/WatchWindow.h
Normal file
@ -0,0 +1,42 @@
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wx/defs.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/translation.h>
|
||||
#include <wx/windowid.h>
|
||||
|
||||
class CWatchView;
|
||||
class wxWindow;
|
||||
|
||||
class CWatchWindow
|
||||
: public wxPanel
|
||||
{
|
||||
public:
|
||||
CWatchWindow(wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = _("Watch"));
|
||||
|
||||
void NotifyUpdate();
|
||||
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
enum
|
||||
{
|
||||
ID_GPR = 1002
|
||||
};
|
||||
|
||||
CWatchView* m_GPRGridView;
|
||||
void CreateGUIControls();
|
||||
};
|
Reference in New Issue
Block a user