mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
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:
@ -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()
|
||||
|
Reference in New Issue
Block a user