mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Cleans up the JIT block viewer in the WX UI.
This code was an absolute mess. It had allocated an arbitrarily large string buffer to hold instructions that were disassembled. Strip out all of the nasty raw C string manipulation and replaces it with ostringstream usage. Fixes an issue where if you didn't have a JIT recompiler running then Dolphin would instantly crash if you tried comparing PPC to x86 code. Changed the disassembly of the host side code from being inline to the function to instead being in a class, this will be required when I add support for ARMv7 and AArch64 to this window.
This commit is contained in:
@ -4,7 +4,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <disasm.h> // Bochs
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <wx/defs.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/gdicmn.h>
|
||||
@ -30,6 +33,26 @@ public:
|
||||
void Update() override;
|
||||
};
|
||||
|
||||
class HostDisassembler
|
||||
{
|
||||
public:
|
||||
std::string DisassembleBlock(u32* address, u32* host_instructions_count, u32* code_size);
|
||||
|
||||
private:
|
||||
virtual std::string DisassembleHostBlock(const u8* code_start, const u32 code_size, u32* host_instructions_count) { return ""; }
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
class CJitWindow : public wxPanel
|
||||
{
|
||||
public:
|
||||
@ -48,6 +71,7 @@ private:
|
||||
void Compare(u32 em_address);
|
||||
|
||||
JitBlockList* block_list;
|
||||
std::unique_ptr<HostDisassembler> m_disassembler;
|
||||
wxButton* button_refresh;
|
||||
wxTextCtrl* ppc_box;
|
||||
wxTextCtrl* x86_box;
|
||||
|
Reference in New Issue
Block a user