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
|
|
|
|
2014-10-21 06:53:01 +00:00
|
|
|
#include <disasm.h> // Bochs
|
|
|
|
#include <memory>
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <vector>
|
2014-10-21 06:53:01 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include <wx/listctrl.h>
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/panel.h>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
2009-08-27 15:53:19 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
class wxButton;
|
|
|
|
class wxListBox;
|
|
|
|
class wxTextCtrl;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
class JitBlockList : public wxListCtrl
|
|
|
|
{
|
|
|
|
std::vector<int> block_ranking;
|
|
|
|
public:
|
|
|
|
JitBlockList(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
|
|
|
|
void Init();
|
2014-03-08 00:54:44 +00:00
|
|
|
void Update() override;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|
|
|
|
|
2014-10-21 06:53:01 +00:00
|
|
|
class HostDisassembler
|
|
|
|
{
|
|
|
|
public:
|
2015-05-20 16:27:44 +00:00
|
|
|
virtual ~HostDisassembler() {}
|
2014-10-21 06:53:01 +00:00
|
|
|
std::string DisassembleBlock(u32* address, u32* host_instructions_count, u32* code_size);
|
|
|
|
|
|
|
|
private:
|
2014-10-21 10:56:01 +00:00
|
|
|
virtual std::string DisassembleHostBlock(const u8* code_start, const u32 code_size, u32* host_instructions_count) { return "(No disassembler)"; }
|
2014-10-21 06:53:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class HostDisassemblerX86 : public HostDisassembler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
HostDisassemblerX86();
|
|
|
|
|
|
|
|
private:
|
|
|
|
disassembler m_disasm;
|
|
|
|
|
|
|
|
std::string DisassembleHostBlock(const u8* code_start, const u32 code_size, u32* host_instructions_count) override;
|
|
|
|
};
|
|
|
|
|
2009-09-07 20:51:02 +00:00
|
|
|
class CJitWindow : public wxPanel
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CJitWindow(wxWindow* parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
2010-07-22 02:05:28 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2010-07-27 02:39:12 +00:00
|
|
|
long style = wxTAB_TRAVERSAL | wxBORDER_NONE,
|
2011-01-05 04:35:46 +00:00
|
|
|
const wxString& name = _("JIT block viewer"));
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2011-02-25 03:56:14 +00:00
|
|
|
void ViewAddr(u32 em_address);
|
2014-03-08 00:54:44 +00:00
|
|
|
void Update() override;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void OnRefresh(wxCommandEvent& /*event*/);
|
|
|
|
void Compare(u32 em_address);
|
|
|
|
|
|
|
|
JitBlockList* block_list;
|
2014-10-21 06:53:01 +00:00
|
|
|
std::unique_ptr<HostDisassembler> m_disassembler;
|
2008-12-08 04:46:09 +00:00
|
|
|
wxButton* button_refresh;
|
|
|
|
wxTextCtrl* ppc_box;
|
|
|
|
wxTextCtrl* x86_box;
|
|
|
|
wxListBox* top_instructions;
|
|
|
|
|
|
|
|
void OnSymbolListChange(wxCommandEvent& event);
|
|
|
|
void OnCallstackListChange(wxCommandEvent& event);
|
|
|
|
void OnAddrBoxChange(wxCommandEvent& event);
|
|
|
|
void OnHostMessage(wxCommandEvent& event);
|
|
|
|
};
|