WX: HiDPI: FrameAUI / Debugger

Changes:
  - MemoryWindow was cleaned up and gives more feedback on searches.

Some bugs were fixed as well:
  - A complex bug that allowed tearing off tabs and opening multiple
    copies of a debug panel which lead to segfaults
  - Another segfault related to right-click menus on code/memory views
    when those tools were floating in their own window.
This commit is contained in:
EmptyChaos
2016-10-03 07:29:50 +00:00
parent f39c301579
commit 27d295ec7e
40 changed files with 1108 additions and 1179 deletions

View File

@ -44,6 +44,7 @@
#include "DolphinWX/Debugger/CodeWindow.h"
#include "DolphinWX/Debugger/DebuggerUIUtil.h"
#include "DolphinWX/Debugger/JitWindow.h"
#include "DolphinWX/Debugger/MemoryWindow.h"
#include "DolphinWX/Debugger/RegisterWindow.h"
#include "DolphinWX/Debugger/WatchWindow.h"
#include "DolphinWX/AuiToolBar.h"
@ -54,9 +55,8 @@
CCodeWindow::CCodeWindow(const SConfig& _LocalCoreStartupParameter, CFrame* parent, wxWindowID id,
const wxPoint& position, const wxSize& size, long style,
const wxString& name)
: wxPanel(parent, id, position, size, style, name), Parent(parent), m_RegisterWindow(nullptr),
m_WatchWindow(nullptr), m_BreakpointWindow(nullptr), m_MemoryWindow(nullptr),
m_JitWindow(nullptr), m_SoundWindow(nullptr), m_VideoWindow(nullptr), codeview(nullptr)
: wxPanel(parent, id, position, size, style, name), m_sibling_panels(), Parent(parent),
codeview(nullptr)
{
InitBitmaps();
@ -88,21 +88,31 @@ CCodeWindow::CCodeWindow(const SConfig& _LocalCoreStartupParameter, CFrame* pare
m_aui_manager.SetManagedWindow(this);
m_aui_manager.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
m_aui_manager.AddPane(m_aui_toolbar,
wxAuiPaneInfo().MinSize(150, -1).ToolbarPane().Top().Floatable(false));
m_aui_manager.AddPane(
callstack,
wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(
_("Callstack")));
m_aui_manager.AddPane(
symbols, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(
_("Symbols")));
m_aui_manager.AddPane(
calls, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(
_("Function calls")));
m_aui_manager.AddPane(
callers, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(
_("Function callers")));
m_aui_manager.AddPane(m_aui_toolbar, wxAuiPaneInfo().ToolbarPane().Top().Floatable(false));
m_aui_manager.AddPane(callstack, wxAuiPaneInfo()
.MinSize(FromDIP(wxSize(150, 100)))
.Left()
.CloseButton(false)
.Floatable(false)
.Caption(_("Callstack")));
m_aui_manager.AddPane(symbols, wxAuiPaneInfo()
.MinSize(FromDIP(wxSize(150, 100)))
.Left()
.CloseButton(false)
.Floatable(false)
.Caption(_("Symbols")));
m_aui_manager.AddPane(calls, wxAuiPaneInfo()
.MinSize(FromDIP(wxSize(150, 100)))
.Left()
.CloseButton(false)
.Floatable(false)
.Caption(_("Function calls")));
m_aui_manager.AddPane(callers, wxAuiPaneInfo()
.MinSize(FromDIP(wxSize(150, 100)))
.Left()
.CloseButton(false)
.Floatable(false)
.Caption(_("Function callers")));
m_aui_manager.AddPane(codeview, wxAuiPaneInfo().CenterPane().CloseButton(false).Floatable(false));
m_aui_manager.Update();
@ -144,30 +154,30 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event)
{
case IDM_NOTIFY_MAP_LOADED:
NotifyMapLoaded();
if (m_BreakpointWindow)
m_BreakpointWindow->NotifyUpdate();
if (HasPanel<CBreakPointWindow>())
GetPanel<CBreakPointWindow>()->NotifyUpdate();
break;
case IDM_UPDATE_DISASM_DIALOG:
Update();
if (CPU::IsStepping())
Parent->UpdateGUI();
if (m_RegisterWindow)
m_RegisterWindow->NotifyUpdate();
if (m_WatchWindow)
m_WatchWindow->NotifyUpdate();
Repopulate();
if (HasPanel<CRegisterWindow>())
GetPanel<CRegisterWindow>()->NotifyUpdate();
if (HasPanel<CWatchWindow>())
GetPanel<CWatchWindow>()->NotifyUpdate();
if (HasPanel<CMemoryWindow>())
GetPanel<CMemoryWindow>()->Refresh();
break;
case IDM_UPDATE_BREAKPOINTS:
if (m_BreakpointWindow)
m_BreakpointWindow->NotifyUpdate();
Repopulate();
if (HasPanel<CBreakPointWindow>())
GetPanel<CBreakPointWindow>()->NotifyUpdate();
if (HasPanel<CMemoryWindow>())
GetPanel<CMemoryWindow>()->Refresh();
break;
case IDM_UPDATE_JIT_PANE:
// Check if the JIT pane is in the AUI notebook. If not, add it and switch to it.
if (!m_JitWindow)
ToggleJitWindow(true);
m_JitWindow->ViewAddr(codeview->GetSelection());
RequirePanel<CJitWindow>()->ViewAddr(codeview->GetSelection());
break;
}
}
@ -195,12 +205,12 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event)
case IDM_SKIP:
PC += 4;
Update();
Repopulate();
break;
case IDM_SETPC:
PC = codeview->GetSelection();
Update();
Repopulate();
break;
case IDM_GOTOPC:
@ -373,8 +383,12 @@ void CCodeWindow::StepOut()
PowerPC::SetMode(old_mode);
CPU::PauseAndLock(false, false);
Host_UpdateDisasmDialog();
UpdateButtonStates();
JumpToAddress(PC);
{
wxCommandEvent ev(wxEVT_HOST_COMMAND, IDM_UPDATE_DISASM_DIALOG);
GetEventHandler()->ProcessEvent(ev);
}
// Update all toolbars in the aui manager
Parent->UpdateGUI();
}
@ -386,7 +400,7 @@ void CCodeWindow::ToggleBreakpoint()
{
if (codeview)
codeview->ToggleBreakpoint(codeview->GetSelection());
Update();
Repopulate();
}
}
@ -695,7 +709,7 @@ void CCodeWindow::PopulateToolbar(wxToolBar* toolBar)
}
// Update GUI
void CCodeWindow::Update()
void CCodeWindow::Repopulate()
{
if (!codeview)
return;
@ -714,41 +728,28 @@ void CCodeWindow::UpdateButtonStates()
bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED);
bool Pause = (Core::GetState() == Core::CORE_PAUSE);
bool Stepping = CPU::IsStepping();
bool can_step = Initialized && Stepping;
wxToolBar* ToolBar = GetToolBar();
// Toolbar
if (!ToolBar)
return;
if (!Initialized)
{
ToolBar->EnableTool(IDM_STEPOVER, false);
ToolBar->EnableTool(IDM_STEPOUT, false);
ToolBar->EnableTool(IDM_SKIP, false);
}
else
{
if (!Stepping)
{
ToolBar->EnableTool(IDM_STEPOVER, false);
ToolBar->EnableTool(IDM_STEPOUT, false);
ToolBar->EnableTool(IDM_SKIP, false);
}
else
{
ToolBar->EnableTool(IDM_STEPOVER, true);
ToolBar->EnableTool(IDM_STEPOUT, true);
ToolBar->EnableTool(IDM_SKIP, true);
}
}
ToolBar->EnableTool(IDM_STEP, Initialized && Stepping);
ToolBar->EnableTool(IDM_STEP, can_step);
ToolBar->EnableTool(IDM_STEPOVER, can_step);
ToolBar->EnableTool(IDM_STEPOUT, can_step);
ToolBar->EnableTool(IDM_SKIP, can_step);
ToolBar->EnableTool(IDM_SETPC, Pause);
ToolBar->Realize();
// Menu bar
// ------------------
GetMenuBar()->Enable(IDM_INTERPRETER, Pause); // CPU Mode
GetMenuBar()->Enable(IDM_STEP, can_step);
GetMenuBar()->Enable(IDM_STEPOVER, can_step);
GetMenuBar()->Enable(IDM_STEPOUT, can_step);
GetMenuBar()->Enable(IDM_JIT_NO_BLOCK_CACHE, !Initialized);
GetMenuBar()->Enable(IDM_JIT_OFF, Pause);