More work on the FrameAui:

Added a default perspective for the debugger.
Save all perspectives, and not just the active one.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5979 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-07-26 03:46:14 +00:00
parent 37217d7857
commit 0eaa7352fd
16 changed files with 425 additions and 496 deletions

View File

@ -26,7 +26,6 @@
#include "FileUtil.h"
BEGIN_EVENT_TABLE(CBreakPointWindow, wxPanel)
EVT_CLOSE(CBreakPointWindow::OnClose)
EVT_LIST_ITEM_ACTIVATED(ID_BPS, CBreakPointWindow::OnActivated)
EVT_LIST_ITEM_SELECTED(ID_TOOLBAR, CBreakPointWindow::OnSelectItem)
END_EVENT_TABLE()
@ -34,7 +33,7 @@ END_EVENT_TABLE()
CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
: wxPanel(parent, id, position, size, style, title)
, m_BreakPointListView(NULL)
, m_pCodeWindow(_pCodeWindow)
, m_pCodeWindow(_pCodeWindow)
{
CreateGUIControls();
}
@ -84,11 +83,6 @@ void CBreakPointWindow::OnSelectItem(wxListEvent& event)
}
}
void CBreakPointWindow::OnClose(wxCloseEvent& /*event*/)
{
Hide();
}
void CBreakPointWindow::NotifyUpdate()
{
if (m_BreakPointListView != NULL) m_BreakPointListView->Update();
@ -104,18 +98,17 @@ void CBreakPointWindow::OnDelete()
void CBreakPointWindow::OnActivated(wxListEvent& event)
{
long Index = event.GetIndex();
if (Index >= 0)
{
u32 Address = (u32)m_BreakPointListView->GetItemData(Index);
if (m_pCodeWindow != NULL)
{
m_pCodeWindow->JumpToAddress(Address);
}
}
long Index = event.GetIndex();
if (Index >= 0)
{
u32 Address = (u32)m_BreakPointListView->GetItemData(Index);
if (m_pCodeWindow != NULL)
{
m_pCodeWindow->JumpToAddress(Address);
}
}
}
// Breakpoint actions
// ---------------------
@ -126,12 +119,14 @@ void CBreakPointWindow::OnClear()
PowerPC::memchecks.Clear();
NotifyUpdate();
}
// Add one breakpoint
void CBreakPointWindow::OnAddBreakPoint()
{
BreakPointDlg bpDlg(this, this);
bpDlg.ShowModal();
}
// Load breakpoints from file
void CBreakPointWindow::OnAddBreakPointMany()
{
@ -168,10 +163,9 @@ void CBreakPointWindow::OnAddBreakPointMany()
}
// Memory check actions
// ---------------------
void
void
CBreakPointWindow::OnAddMemoryCheck()
{
MemoryCheckDlg memDlg(this);
@ -215,7 +209,7 @@ void CBreakPointWindow::OnAddMemoryCheckMany()
&& pieces[0].size() == 8
)
{
// address range
// address range
MemCheck.StartAddress = sAddress;
MemCheck.EndAddress = sAddress;
doCommon = true;
@ -227,7 +221,7 @@ void CBreakPointWindow::OnAddMemoryCheckMany()
&& pieces[0].size() == 8 && pieces[1].size() == 8
)
{
// address range
// address range
MemCheck.StartAddress = sAddress;
MemCheck.EndAddress = eAddress;
doCommon = true;
@ -239,7 +233,7 @@ void CBreakPointWindow::OnAddMemoryCheckMany()
&& pieces[0].size() == 8 && pieces[1].size() == 8 && pieces[2].size() == 1
)
{
// address range
// address range
MemCheck.StartAddress = sAddress;
MemCheck.EndAddress = eAddress;
doCommon = true;
@ -248,13 +242,13 @@ void CBreakPointWindow::OnAddMemoryCheckMany()
if (doCommon)
{
// settings for the memory check
// settings for the memory check
MemCheck.OnRead = true;
MemCheck.OnWrite = true;
MemCheck.Log = true;
//MemCheck.Break = false; // this is also what sets Active "on" in the breakpoint window
// so don't think it's off because we are only writing this to the log
PowerPC::memchecks.Add(MemCheck);
PowerPC::memchecks.Add(MemCheck);
}
}
// Update after we are done with the loop

View File

@ -45,15 +45,15 @@ class CBreakPointWindow
public:
CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, wxWindowID id = 1, const wxString& title = wxT("Breakpoints"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400, 250),
CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, wxWindowID id = 1, const wxString& title = wxT("Breakpoints"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400, 250),
long style = wxNO_BORDER);
void NotifyUpdate();
void OnDelete();
void OnClear();
void OnAddBreakPoint();
void OnAddBreakPointMany();
void OnAddBreakPointMany();
void OnAddMemoryCheck();
void OnAddMemoryCheckMany();
@ -75,7 +75,6 @@ class CBreakPointWindow
void CreateGUIControls();
void OnSelectItem(wxListEvent& event);
void OnClose(wxCloseEvent& event);
void OnActivated(wxListEvent& event);
};

View File

@ -100,13 +100,6 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxPanel)
EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleWindow) // View
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_SCANFUNCTIONS, CCodeWindow::OnSymbolsMenu)
@ -392,10 +385,8 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
// Create CPU Mode menus
void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter,
wxMenuBar * _pMenuBar)
wxMenuBar *pMenuBar)
{
pMenuBar = _pMenuBar;
// CPU Mode
wxMenu* pCoreMenu = new wxMenu;
@ -448,39 +439,16 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
pMenuBar->Append(pCoreMenu, _T("&JIT"));
CreateMenuSymbols();
CreateMenuSymbols(pMenuBar);
}
// Create View menu
void CCodeWindow::CreateMenuView(wxMenuBar * _pMenuBar, wxMenu* _pMenu)
void CCodeWindow::CreateMenuOptions(wxMenu* pMenu)
{
wxMenuItem* pRegister = _pMenu->Append(IDM_REGISTERWINDOW, _T("&Registers"),
wxEmptyString, wxITEM_CHECK);
pRegister->Check(bRegisterWindow);
wxMenuItem* pBreakPoints = _pMenu->Append(IDM_BREAKPOINTWINDOW, _T("&BreakPoints"),
wxEmptyString, wxITEM_CHECK);
pBreakPoints->Check(bBreakpointWindow);
wxMenuItem* pMemory = _pMenu->Append(IDM_MEMORYWINDOW, _T("&Memory"),
wxEmptyString, wxITEM_CHECK);
pMemory->Check(bMemoryWindow);
wxMenuItem* pJit = _pMenu->Append(IDM_JITWINDOW, _T("&Jit"),
wxEmptyString, wxITEM_CHECK);
pJit->Check(bJitWindow);
wxMenuItem* pSound = _pMenu->Append(IDM_SOUNDWINDOW, _T("&Sound"),
wxEmptyString, wxITEM_CHECK);
pSound->Check(bSoundWindow);
wxMenuItem* pVideo = _pMenu->Append(IDM_VIDEOWINDOW, _T("&Video"),
wxEmptyString, wxITEM_CHECK);
pVideo->Check(bVideoWindow);
}
void CCodeWindow::CreateMenuOptions(wxMenuBar * _pMenuBar, wxMenu* _pMenu)
{
wxMenuItem* boottopause = _pMenu->Append(IDM_BOOTTOPAUSE, _T("Boot to pause"),
wxMenuItem* boottopause = pMenu->Append(IDM_BOOTTOPAUSE, _T("Boot to pause"),
wxT("Start the game directly instead of booting to pause"), wxITEM_CHECK);
boottopause->Check(bBootToPause);
wxMenuItem* automaticstart = _pMenu->Append(IDM_AUTOMATICSTART, _T("&Automatic start")
wxMenuItem* automaticstart = pMenu->Append(IDM_AUTOMATICSTART, _T("&Automatic start")
, wxString::FromAscii(
"Automatically load the Default ISO when Dolphin starts, or the last game you loaded,"
" if you have not given it an elf file with the --elf command line. [This can be"
@ -490,7 +458,7 @@ void CCodeWindow::CreateMenuOptions(wxMenuBar * _pMenuBar, wxMenu* _pMenu)
, wxITEM_CHECK);
automaticstart->Check(bAutomaticStart);
_pMenu->Append(IDM_FONTPICKER, _T("&Font..."), wxEmptyString, wxITEM_NORMAL);
pMenu->Append(IDM_FONTPICKER, _T("&Font..."), wxEmptyString, wxITEM_NORMAL);
}
// CPU Mode and JIT Menu

View File

@ -71,10 +71,9 @@ class CCodeWindow
void Update();
void NotifyMapLoaded();
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter,
wxMenuBar * pMenuBar);
void CreateMenuView(wxMenuBar * pMenuBar, wxMenu*);
void CreateMenuOptions(wxMenuBar * pMenuBar, wxMenu*);
void CreateMenuSymbols();
wxMenuBar *pMenuBar);
void CreateMenuOptions(wxMenu *pMenu);
void CreateMenuSymbols(wxMenuBar *pMenuBar);
void RecreateToolbar(wxAuiToolBar*);
void PopulateToolbar(wxAuiToolBar* toolBar);
void UpdateButtonStates();
@ -86,7 +85,6 @@ class CCodeWindow
void OnCPUMode(wxCommandEvent& event); // CPU Mode menu
void OnJITOff(wxCommandEvent& event);
void OnToggleWindow(wxCommandEvent& event);
void ToggleCodeWindow(bool bShow);
void ToggleRegisterWindow(bool bShow);
void ToggleBreakPointWindow(bool bShow);
@ -103,7 +101,6 @@ class CCodeWindow
void OnProfilerMenu(wxCommandEvent& event);
// Sub dialogs
wxMenuBar* pMenuBar;
CRegisterWindow* m_RegisterWindow;
CBreakPointWindow* m_BreakpointWindow;
CMemoryWindow* m_MemoryWindow;
@ -111,15 +108,8 @@ class CCodeWindow
// Settings
bool bAutomaticStart; bool bBootToPause;
int iLogWindow;
int iConsoleWindow;
bool bCodeWindow; int iCodeWindow;
bool bRegisterWindow; int iRegisterWindow;
bool bBreakpointWindow; int iBreakpointWindow;
bool bMemoryWindow; int iMemoryWindow;
bool bJitWindow; int iJitWindow;
bool bSoundWindow; int iSoundWindow;
bool bVideoWindow; int iVideoWindow;
bool bShowOnStart[IDM_VIDEOWINDOW - IDM_LOGWINDOW + 1];
int iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
private:
@ -158,8 +148,6 @@ class CCodeWindow
wxMenuItem* jitpoff;
wxMenuItem* jitsroff;
std::string fontDesc;
CCodeView* codeview;
wxListBox* callstack;
wxListBox* symbols;

View File

@ -79,47 +79,42 @@ void CCodeWindow::Load()
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
// The font to override DebuggerFont with
ini.Get("ShowOnStart", "DebuggerFont", &fontDesc);
std::string fontDesc;
ini.Get("General", "DebuggerFont", &fontDesc);
if (!fontDesc.empty())
DebuggerFont.SetNativeFontInfoUserDesc(wxString::FromAscii(fontDesc.c_str()));
// Decide what windows to use
// This stuff really doesn't belong in CodeWindow anymore, does it? It should be
// in Frame.cpp somewhere, even though it's debugger stuff.
ini.Get("ShowOnStart", "Code", &bCodeWindow, true);
ini.Get("ShowOnStart", "Registers", &bRegisterWindow, false);
ini.Get("ShowOnStart", "Breakpoints", &bBreakpointWindow, false);
ini.Get("ShowOnStart", "Memory", &bMemoryWindow, false);
ini.Get("ShowOnStart", "JIT", &bJitWindow, false);
ini.Get("ShowOnStart", "Sound", &bSoundWindow, false);
ini.Get("ShowOnStart", "Video", &bVideoWindow, false);
// Get notebook affiliation
std::string _Section = StringFromFormat("P - %s",
(Parent->ActivePerspective < Parent->Perspectives.size())
? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "");
ini.Get(_Section.c_str(), "Log", &iLogWindow, 1);
ini.Get(_Section.c_str(), "Console", &iConsoleWindow, 1);
ini.Get(_Section.c_str(), "Code", &iCodeWindow, 1);
ini.Get(_Section.c_str(), "Registers", &iRegisterWindow, 1);
ini.Get(_Section.c_str(), "Breakpoints", &iBreakpointWindow, 0);
ini.Get(_Section.c_str(), "Memory", &iMemoryWindow, 1);
ini.Get(_Section.c_str(), "JIT", &iJitWindow, 1);
ini.Get(_Section.c_str(), "Sound", &iSoundWindow, 0);
ini.Get(_Section.c_str(), "Video", &iVideoWindow, 0);
// Get floating setting
ini.Get("Float", "Log", &Parent->bFloatWindow[0], false);
ini.Get("Float", "Console", &Parent->bFloatWindow[1], false);
ini.Get("Float", "Code", &Parent->bFloatWindow[2], false);
ini.Get("Float", "Registers", &Parent->bFloatWindow[3], false);
ini.Get("Float", "Breakpoints", &Parent->bFloatWindow[4], false);
ini.Get("Float", "Memory", &Parent->bFloatWindow[5], false);
ini.Get("Float", "JIT", &Parent->bFloatWindow[6], false);
ini.Get("Float", "Sound", &Parent->bFloatWindow[7], false);
ini.Get("Float", "Video", &Parent->bFloatWindow[8], false);
// Boot to pause or not
ini.Get("ShowOnStart", "AutomaticStart", &bAutomaticStart, false);
ini.Get("ShowOnStart", "BootToPause", &bBootToPause, true);
ini.Get("General", "AutomaticStart", &bAutomaticStart, false);
ini.Get("General", "BootToPause", &bBootToPause, true);
const char* SettingName[] = {
"Log",
"Console",
"Registers",
"Breakpoints",
"Memory",
"JIT",
"Sound",
"Video",
"Code"
};
// Decide what windows to show
for (int i = 0; i <= IDM_VIDEOWINDOW - IDM_LOGWINDOW; i++)
ini.Get("ShowOnStart", SettingName[i], &bShowOnStart[i], false);
// Get notebook affiliation
std::string _Section = "P - " +
((Parent->ActivePerspective < Parent->Perspectives.size())
? Parent->Perspectives.at(Parent->ActivePerspective).Name : "Perspective 1");
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
ini.Get(_Section.c_str(), SettingName[i], &iNbAffiliation[i], 0);
// Get floating setting
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
ini.Get("Float", SettingName[i], &Parent->bFloatWindow[i], false);
}
void CCodeWindow::Save()
@ -127,49 +122,44 @@ void CCodeWindow::Save()
IniFile ini;
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
ini.Set("ShowOnStart", "DebuggerFont", fontDesc);
ini.Set("General", "DebuggerFont",
std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str()));
// Boot to pause or not
ini.Set("ShowOnStart", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
ini.Set("ShowOnStart", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
ini.Set("General", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
ini.Set("General", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
const char* SettingName[] = {
"Log",
"Console",
"Registers",
"Breakpoints",
"Memory",
"JIT",
"Sound",
"Video",
"Code"
};
// Save windows settings
//ini.Set("ShowOnStart", "Code", GetMenuBar()->IsChecked(IDM_CODEWINDOW));
ini.Set("ShowOnStart", "Registers", GetMenuBar()->IsChecked(IDM_REGISTERWINDOW));
ini.Set("ShowOnStart", "Breakpoints", GetMenuBar()->IsChecked(IDM_BREAKPOINTWINDOW));
ini.Set("ShowOnStart", "Memory", GetMenuBar()->IsChecked(IDM_MEMORYWINDOW));
ini.Set("ShowOnStart", "JIT", GetMenuBar()->IsChecked(IDM_JITWINDOW));
ini.Set("ShowOnStart", "Sound", GetMenuBar()->IsChecked(IDM_SOUNDWINDOW));
ini.Set("ShowOnStart", "Video", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW));
std::string _Section = StringFromFormat("P - %s",
(Parent->ActivePerspective < Parent->Perspectives.size())
? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "");
ini.Set(_Section.c_str(), "Log", iLogWindow);
ini.Set(_Section.c_str(), "Console", iConsoleWindow);
ini.Set(_Section.c_str(), "Code", iCodeWindow);
ini.Set(_Section.c_str(), "Registers", iRegisterWindow);
ini.Set(_Section.c_str(), "Breakpoints", iBreakpointWindow);
ini.Set(_Section.c_str(), "Memory", iMemoryWindow);
ini.Set(_Section.c_str(), "JIT", iJitWindow);
ini.Set(_Section.c_str(), "Sound", iSoundWindow);
ini.Set(_Section.c_str(), "Video", iVideoWindow);
for (int i = IDM_LOGWINDOW; i <= IDM_VIDEOWINDOW; i++)
ini.Set("ShowOnStart", SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i));
// Save notebook affiliations
std::string _Section = "P - " + Parent->Perspectives.at(Parent->ActivePerspective).Name;
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
ini.Set(_Section.c_str(), SettingName[i], iNbAffiliation[i]);
// Save floating setting
ini.Set("Float", "Log", !!FindWindowById(IDM_LOGWINDOW_PARENT));
ini.Set("Float", "Console", !!FindWindowById(IDM_CONSOLEWINDOW_PARENT));
ini.Set("Float", "Code", !!FindWindowById(IDM_CODEWINDOW_PARENT));
ini.Set("Float", "Registers", !!FindWindowById(IDM_REGISTERWINDOW_PARENT));
ini.Set("Float", "Breakpoints", !!FindWindowById(IDM_BREAKPOINTWINDOW_PARENT));
ini.Set("Float", "Memory", !!FindWindowById(IDM_MEMORYWINDOW_PARENT));
ini.Set("Float", "JIT", !!FindWindowById(IDM_JITWINDOW_PARENT));
ini.Set("Float", "Sound", !!FindWindowById(IDM_SOUNDWINDOW_PARENT));
ini.Set("Float", "Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT));
for (int i = IDM_LOGWINDOW_PARENT; i <= IDM_CODEWINDOW_PARENT; i++)
ini.Set("Float", SettingName[i - IDM_LOGWINDOW_PARENT], !!FindWindowById(i));
ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
}
// Symbols, JIT, Profiler
// ----------------
void CCodeWindow::CreateMenuSymbols()
void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar)
{
wxMenu *pSymbolsMenu = new wxMenu;
pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _T("&Clear symbols"));
@ -411,14 +401,11 @@ void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
void CCodeWindow::OnChangeFont(wxCommandEvent& event)
{
wxFontData data;
data.SetInitialFont(GetFont());
data.SetInitialFont(DebuggerFont);
wxFontDialog dialog(this, data);
if ( dialog.ShowModal() == wxID_OK )
{
DebuggerFont = dialog.GetFontData().GetChosenFont();
fontDesc = std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str());
}
}
// Toogle windows
@ -426,52 +413,29 @@ void CCodeWindow::OnChangeFont(wxCommandEvent& event)
void CCodeWindow::OpenPages()
{
ToggleCodeWindow(true);
if (bRegisterWindow)
if (bShowOnStart[0])
Parent->ToggleLogWindow(true);
if (bShowOnStart[IDM_CONSOLEWINDOW - IDM_LOGWINDOW])
Parent->ToggleConsole(true);
if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW])
ToggleRegisterWindow(true);
if (bBreakpointWindow)
if (bShowOnStart[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW])
ToggleBreakPointWindow(true);
if (bMemoryWindow)
if (bShowOnStart[IDM_MEMORYWINDOW - IDM_LOGWINDOW])
ToggleMemoryWindow(true);
if (bJitWindow)
if (bShowOnStart[IDM_JITWINDOW - IDM_LOGWINDOW])
ToggleJitWindow(true);
if (bSoundWindow)
if (bShowOnStart[IDM_SOUNDWINDOW - IDM_LOGWINDOW])
ToggleDLLWindow(IDM_SOUNDWINDOW, true);
if (bVideoWindow)
if (bShowOnStart[IDM_VIDEOWINDOW - IDM_LOGWINDOW])
ToggleDLLWindow(IDM_VIDEOWINDOW, true);
}
void CCodeWindow::OnToggleWindow(wxCommandEvent& event)
{
bool bShow = GetMenuBar()->IsChecked(event.GetId());
switch(event.GetId())
{
case IDM_REGISTERWINDOW:
ToggleRegisterWindow(bShow);
break;
case IDM_BREAKPOINTWINDOW:
ToggleBreakPointWindow(bShow);
break;
case IDM_MEMORYWINDOW:
ToggleMemoryWindow(bShow);
break;
case IDM_JITWINDOW:
ToggleJitWindow(bShow);
break;
case IDM_SOUNDWINDOW:
ToggleDLLWindow(IDM_SOUNDWINDOW, bShow);
break;
case IDM_VIDEOWINDOW:
ToggleDLLWindow(IDM_VIDEOWINDOW, bShow);
break;
}
event.Skip();
}
void CCodeWindow::ToggleCodeWindow(bool bShow)
{
if (bShow)
Parent->DoAddPage(this, iCodeWindow,
Parent->DoAddPage(this,
iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW],
Parent->bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW]);
else // Hide
Parent->DoRemovePage(this);
@ -484,11 +448,15 @@ void CCodeWindow::ToggleRegisterWindow(bool bShow)
{
if (!m_RegisterWindow)
m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTERWINDOW);
Parent->DoAddPage(m_RegisterWindow, iRegisterWindow,
Parent->DoAddPage(m_RegisterWindow,
iNbAffiliation[IDM_REGISTERWINDOW - IDM_LOGWINDOW],
Parent->bFloatWindow[IDM_REGISTERWINDOW - IDM_LOGWINDOW]);
}
else // Close
{
Parent->DoRemovePage(m_RegisterWindow, false);
m_RegisterWindow = NULL;
}
}
void CCodeWindow::ToggleBreakPointWindow(bool bShow)
@ -498,11 +466,15 @@ void CCodeWindow::ToggleBreakPointWindow(bool bShow)
{
if (!m_BreakpointWindow)
m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW);
Parent->DoAddPage(m_BreakpointWindow, iBreakpointWindow,
Parent->DoAddPage(m_BreakpointWindow,
iNbAffiliation[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW],
Parent->bFloatWindow[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]);
}
else // Close
{
Parent->DoRemovePage(m_BreakpointWindow, false);
m_BreakpointWindow = NULL;
}
}
void CCodeWindow::ToggleMemoryWindow(bool bShow)
@ -512,11 +484,15 @@ void CCodeWindow::ToggleMemoryWindow(bool bShow)
{
if (!m_MemoryWindow)
m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW);
Parent->DoAddPage(m_MemoryWindow, iMemoryWindow,
Parent->DoAddPage(m_MemoryWindow,
iNbAffiliation[IDM_MEMORYWINDOW - IDM_LOGWINDOW],
Parent->bFloatWindow[IDM_MEMORYWINDOW - IDM_LOGWINDOW]);
}
else // Close
{
Parent->DoRemovePage(m_MemoryWindow, false);
m_MemoryWindow = NULL;
}
}
void CCodeWindow::ToggleJitWindow(bool bShow)
@ -526,11 +502,15 @@ void CCodeWindow::ToggleJitWindow(bool bShow)
{
if (!m_JitWindow)
m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW);
Parent->DoAddPage(m_JitWindow, iJitWindow,
Parent->DoAddPage(m_JitWindow,
iNbAffiliation[IDM_JITWINDOW - IDM_LOGWINDOW],
Parent->bFloatWindow[IDM_JITWINDOW - IDM_LOGWINDOW]);
}
else // Close
{
Parent->DoRemovePage(m_JitWindow, false);
m_JitWindow = NULL;
}
}
// Notice: This windows docking will produce several wx debugging messages for plugin
@ -541,8 +521,7 @@ void CCodeWindow::ToggleJitWindow(bool bShow)
void CCodeWindow::ToggleDLLWindow(int Id, bool bShow)
{
std::string DLLName;
int PluginType, i;
bool bFloat;
int PluginType;
wxPanel *Win;
switch(Id)
@ -550,14 +529,10 @@ void CCodeWindow::ToggleDLLWindow(int Id, bool bShow)
case IDM_SOUNDWINDOW:
DLLName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str();
PluginType = PLUGIN_TYPE_DSP;
i = iSoundWindow;
bFloat = Parent->bFloatWindow[IDM_SOUNDWINDOW - IDM_LOGWINDOW];
break;
case IDM_VIDEOWINDOW:
DLLName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str();
PluginType = PLUGIN_TYPE_VIDEO;
i = iVideoWindow;
bFloat = Parent->bFloatWindow[IDM_VIDEOWINDOW - IDM_LOGWINDOW];
break;
default:
PanicAlert("CCodeWindow::ToggleDLLWindow called with invalid Id");
@ -574,7 +549,9 @@ void CCodeWindow::ToggleDLLWindow(int Id, bool bShow)
{
Win->Show();
Win->SetId(Id);
Parent->DoAddPage(Win, i, bFloat);
Parent->DoAddPage(Win,
iNbAffiliation[Id - IDM_LOGWINDOW],
Parent->bFloatWindow[Id - IDM_LOGWINDOW]);
}
}
else

View File

@ -17,7 +17,6 @@
#include "Debugger.h"
#include <wx/button.h>
#include <wx/textctrl.h>
#include <wx/listctrl.h>
@ -44,7 +43,7 @@
// ugly that this lib included code from the main
#include "../../DolphinWX/Src/Globals.h"
// UGLY
// TODO: Fix this ugly hack
namespace {
CJitWindow *the_jit_window;
}
@ -60,25 +59,27 @@ enum
};
BEGIN_EVENT_TABLE(CJitWindow, wxPanel)
// EVT_TEXT(IDM_ADDRBOX, CJitWindow::OnAddrBoxChange)
// EVT_LISTBOX(IDM_SYMBOLLIST, CJitWindow::OnSymbolListChange)
//EVT_HOST_COMMAND(wxID_ANY, CJitWindow::OnHostMessage)
//EVT_TEXT(IDM_ADDRBOX, CJitWindow::OnAddrBoxChange)
//EVT_LISTBOX(IDM_SYMBOLLIST, CJitWindow::OnSymbolListChange)
//EVT_HOST_COMMAND(wxID_ANY, CJitWindow::OnHostMessage)
EVT_BUTTON(IDM_REFRESH_LIST, CJitWindow::OnRefresh)
END_EVENT_TABLE()
CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos,
const wxSize& size, long style, const wxString& name)
: wxPanel(parent, id, pos, size, style, name)
{
{
the_jit_window = this;
wxBoxSizer* sizerBig = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* sizerSplit = new wxBoxSizer(wxHORIZONTAL);
sizerSplit->Add(ppc_box = new wxTextCtrl(this, IDM_PPC_BOX, _T("(ppc)"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
sizerSplit->Add(x86_box = new wxTextCtrl(this, IDM_X86_BOX, _T("(x86)"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
sizerSplit->Add(ppc_box = new wxTextCtrl(this, IDM_PPC_BOX, _T("(ppc)"),
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
sizerSplit->Add(x86_box = new wxTextCtrl(this, IDM_X86_BOX, _T("(x86)"),
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
sizerBig->Add(block_list = new JitBlockList(this, IDM_BLOCKLIST,
wxDefaultPosition, wxSize(100, 140),
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING), 0, wxEXPAND);
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING),
0, wxEXPAND);
sizerBig->Add(sizerSplit, 2, wxEXPAND);
// sizerBig->Add(memview, 5, wxEXPAND);
// sizerBig->Add(sizerRight, 0, wxEXPAND | wxALL, 3);
@ -94,12 +95,6 @@ CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos,
sizerBig->Fit(this);
}
CJitWindow::~CJitWindow()
{
}
void CJitWindow::OnRefresh(wxCommandEvent& /*event*/) {
block_list->Update();
}
@ -110,7 +105,7 @@ void CJitWindow::ViewAddr(u32 em_address)
{
the_jit_window->Show(true);
the_jit_window->Compare(em_address);
the_jit_window->SetFocus();
the_jit_window->SetFocus();
}
else
{
@ -136,19 +131,21 @@ void CJitWindow::Compare(u32 em_address)
}
if (block_num >= 0) {
JitBlock *block = jit->GetBlockCache()->GetBlock(block_num);
if (!(block->originalAddress <= em_address && block->originalSize + block->originalAddress >= em_address))
if (!(block->originalAddress <= em_address &&
block->originalSize + block->originalAddress >= em_address))
block_num = -1;
}
// Do not merge this "if" with the above - block_num changes inside it.
if (block_num < 0) {
ppc_box->SetValue(wxString::FromAscii(StringFromFormat("(non-code address: %08x)", em_address).c_str()));
ppc_box->SetValue(wxString::FromAscii(StringFromFormat("(non-code address: %08x)",
em_address).c_str()));
x86_box->SetValue(wxString::FromAscii(StringFromFormat("(no translation)").c_str()));
delete[] xDis;
return;
}
}
JitBlock *block = jit->GetBlockCache()->GetBlock(block_num);
// 800031f0
// == Fill in x86 box
@ -201,15 +198,17 @@ void CJitWindow::Compare(u32 em_address)
sptr += sprintf(sptr, "%i estimated cycles\n", st.numCycles);
sptr += sprintf(sptr, "Num instr: PPC: %i x86: %i (blowup: %i%%)\n", size, num_x86_instructions, 100 * (num_x86_instructions / size - 1));
sptr += sprintf(sptr, "Num bytes: PPC: %i x86: %i (blowup: %i%%)\n", size * 4, block->codeSize, 100 * (block->codeSize / (4 * size) - 1));
sptr += sprintf(sptr, "Num instr: PPC: %i x86: %i (blowup: %i%%)\n",
size, num_x86_instructions, 100 * (num_x86_instructions / size - 1));
sptr += sprintf(sptr, "Num bytes: PPC: %i x86: %i (blowup: %i%%)\n",
size * 4, block->codeSize, 100 * (block->codeSize / (4 * size) - 1));
ppc_box->SetValue(wxString::FromAscii((char*)xDis));
} else {
ppc_box->SetValue(wxString::FromAscii(StringFromFormat("(non-code address: %08x)", em_address).c_str()));
ppc_box->SetValue(wxString::FromAscii(StringFromFormat(
"(non-code address: %08x)", em_address).c_str()));
x86_box->SetValue(wxString::FromAscii("---"));
}
delete[] xDis;
}
@ -229,8 +228,6 @@ void CJitWindow::OnHostMessage(wxCommandEvent& event)
}
}
// JitBlockList
//================
@ -244,10 +241,11 @@ enum {
COLUMN_COST, // (estimated as x86size * numexec)
};
JitBlockList::JitBlockList(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: wxListCtrl(parent, id, pos, size, style) // | wxLC_VIRTUAL)
JitBlockList::JitBlockList(wxWindow* parent, const wxWindowID id,
const wxPoint& pos, const wxSize& size, long style)
: wxListCtrl(parent, id, pos, size, style) // | wxLC_VIRTUAL)
{
Init();
Init();
}
void JitBlockList::Init()

View File

@ -30,7 +30,6 @@
#include "Thread.h"
#include "CoreParameter.h"
class JitBlockList : public wxListCtrl
{
std::vector<int> block_ranking;
@ -40,7 +39,6 @@ public:
void Update();
};
class CJitWindow : public wxPanel
{
public:
@ -50,7 +48,6 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL,
const wxString& title = _T("JIT block viewer"));
~CJitWindow();
static void ViewAddr(u32 em_address);
void Update();

View File

@ -119,10 +119,6 @@ CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
sizerBig->Fit(this);
}
CMemoryWindow::~CMemoryWindow()
{
}
void CMemoryWindow::Save(IniFile& _IniFile) const
{
// Prevent these bad values that can happen after a crash or hanging
@ -158,13 +154,13 @@ void CMemoryWindow::SetMemoryValue(wxCommandEvent& event)
u32 val;
if (!TryParseUInt(std::string("0x") + str_addr, &addr))
{
{
PanicAlert("Invalid Address: %s", str_addr.c_str());
return;
}
if (!TryParseUInt(std::string("0x") + str_val, &val))
{
{
PanicAlert("Invalid Value: %s", str_val.c_str());
return;
}
@ -214,7 +210,7 @@ void CMemoryWindow::OnSymbolListChange(wxCommandEvent& event)
{
int index = symbols->GetSelection();
if (index >= 0)
{
{
Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
if (pSymbol != NULL)
{

View File

@ -43,7 +43,6 @@ class CMemoryWindow
long style = wxNO_BORDER,
const wxString& name = _T("Memory"));
~CMemoryWindow();
wxCheckBox* chk8;
wxCheckBox* chk16;
wxCheckBox* chk32;
@ -59,6 +58,8 @@ class CMemoryWindow
void JumpToAddress(u32 _Address);
private:
DECLARE_EVENT_TABLE()
CMemoryView* memview;
wxListBox* symbols;
@ -66,9 +67,6 @@ class CMemoryWindow
wxTextCtrl* addrbox;
wxTextCtrl* valbox;
DECLARE_EVENT_TABLE()
void U8(wxCommandEvent& event);
void U16(wxCommandEvent& event);
void U32(wxCommandEvent& event);

View File

@ -23,7 +23,6 @@
extern const char* GetGRPName(unsigned int index);
BEGIN_EVENT_TABLE(CRegisterWindow, wxPanel)
EVT_CLOSE(CRegisterWindow::OnClose)
END_EVENT_TABLE()
@ -34,17 +33,8 @@ CRegisterWindow::CRegisterWindow(wxWindow* parent, wxWindowID id, const wxString
CreateGUIControls();
}
CRegisterWindow::~CRegisterWindow()
{
}
void CRegisterWindow::CreateGUIControls()
{
//SetTitle(wxT("Registers"));
//SetIcon(wxNullIcon);
//Center();
wxBoxSizer *sGrid = new wxBoxSizer(wxVERTICAL);
m_GPRGridView = new CRegisterView(this, ID_GPR);
sGrid->Add(m_GPRGridView, 1, wxGROW);
@ -54,13 +44,8 @@ void CRegisterWindow::CreateGUIControls()
NotifyUpdate();
}
void CRegisterWindow::OnClose(wxCloseEvent& WXUNUSED (event))
{
Hide();
}
void CRegisterWindow::NotifyUpdate()
{
{
if (m_GPRGridView != NULL)
{
m_GPRGridView->Update();

View File

@ -30,11 +30,9 @@ public:
const wxString& name = wxT("Registers"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER
long style = wxTAB_TRAVERSAL | wxNO_BORDER
);
virtual ~CRegisterWindow();
void NotifyUpdate();
@ -47,7 +45,6 @@ private:
};
CRegisterView* m_GPRGridView;
void OnClose(wxCloseEvent& event);
void CreateGUIControls();
};