2015-05-31 16:21:47 -05:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2015-05-31 16:21:47 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-03-02 21:21:03 -05:00
|
|
|
#include <memory>
|
2019-11-23 19:15:52 -05:00
|
|
|
#include <string>
|
2015-05-31 16:21:47 -05:00
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
class HostDisassembler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~HostDisassembler() {}
|
2015-08-07 02:43:54 -05:00
|
|
|
virtual std::string DisassembleHostBlock(const u8* code_start, const u32 code_size,
|
|
|
|
u32* host_instructions_count, u64 starting_pc)
|
|
|
|
{
|
|
|
|
return "(No disassembler)";
|
|
|
|
}
|
2015-05-31 16:21:47 -05:00
|
|
|
};
|
|
|
|
|
2022-12-01 17:16:11 -08:00
|
|
|
struct DisassembleResult
|
|
|
|
{
|
|
|
|
std::string text;
|
2023-02-15 19:18:39 -08:00
|
|
|
u32 entry_address = 0;
|
|
|
|
u32 instruction_count = 0;
|
|
|
|
u32 code_size = 0;
|
2022-12-01 17:16:11 -08:00
|
|
|
};
|
|
|
|
|
2017-03-02 21:21:03 -05:00
|
|
|
std::unique_ptr<HostDisassembler> GetNewDisassembler(const std::string& arch);
|
2022-12-01 17:16:11 -08:00
|
|
|
DisassembleResult DisassembleBlock(HostDisassembler* disasm, u32 address);
|