mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Capstone disassembler
-----BEGIN PGP SIGNATURE----- iQEcBAABAgAGBQJZ8bGHAAoJEGTfOOivfiFfOXQH/jc3BbQ+ulxvQSgA3rI2JE1e Ww5FK5HEs4qZU3hz4EtE2Cd5p7qV5I4tWRtbxzc6BGBwLsfz3a60Abx7726sZiH0 ZuULTsWXQ/71XfZHQysgOSoy36G8xj/1yvrMWHjDCfWp/pzz479YXWSSn2TWEHpI jI6nKP5ALdv5XTAaglGaNzqVeWgjKXJn4O8qZFS7axj7hndzLFguymfm8rV8DAdd LRuYWOizzzJ0dcaO/HHyLTzSl7rR0g+DmcOAuFCREy4f+r6tXijwiirB5f7ZJiqc hgEBq/6NfztW2+pAUSxqI2Kuq1zVETTpZORH1+UxvVk9GPu1ouYldMx0NrYhDtc= =fC5W -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/rth/tags/pull-dis-20171026' into staging Capstone disassembler # gpg: Signature made Thu 26 Oct 2017 10:57:27 BST # gpg: using RSA key 0x64DF38E8AF7E215F # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-dis-20171026: disas: Add capstone as submodule disas: Remove monitor_disas_is_physical ppc: Support Capstone in disas_set_info arm: Support Capstone in disas_set_info i386: Support Capstone in disas_set_info disas: Support the Capstone disassembler library disas: Remove unused flags arguments target/arm: Don't set INSN_ARM_BE32 for CONFIG_USER_ONLY target/arm: Move BE32 disassembler fixup target/ppc: Convert to disas_set_info hook target/i386: Convert to disas_set_info hook Signed-off-by: Peter Maydell <peter.maydell@linaro.org> # Conflicts: # target/i386/cpu.c # target/ppc/translate_init.c
This commit is contained in:
commit
6e6430a821
33 changed files with 468 additions and 185 deletions
|
@ -7397,12 +7397,9 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
|
|||
#if defined(DEBUG_DISAS)
|
||||
if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
|
||||
&& qemu_log_in_addr_range(pc_start)) {
|
||||
int flags;
|
||||
flags = env->bfd_mach;
|
||||
flags |= ctx.le_mode << 16;
|
||||
qemu_log_lock();
|
||||
qemu_log("IN: %s\n", lookup_symbol(pc_start));
|
||||
log_target_disas(cs, pc_start, ctx.nip - pc_start, flags);
|
||||
log_target_disas(cs, pc_start, ctx.nip - pc_start);
|
||||
qemu_log("\n");
|
||||
qemu_log_unlock();
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "mmu-book3s-v3.h"
|
||||
#include "sysemu/qtest.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "disas/capstone.h"
|
||||
|
||||
//#define PPC_DUMP_CPU
|
||||
//#define PPC_DEBUG_SPR
|
||||
|
@ -10515,6 +10516,31 @@ static gchar *ppc_gdb_arch_name(CPUState *cs)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void ppc_disas_set_info(CPUState *cs, disassemble_info *info)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
|
||||
if ((env->hflags >> MSR_LE) & 1) {
|
||||
info->endian = BFD_ENDIAN_LITTLE;
|
||||
}
|
||||
info->mach = env->bfd_mach;
|
||||
if (!env->bfd_mach) {
|
||||
#ifdef TARGET_PPC64
|
||||
info->mach = bfd_mach_ppc64;
|
||||
#else
|
||||
info->mach = bfd_mach_ppc;
|
||||
#endif
|
||||
}
|
||||
info->disassembler_options = (char *)"any";
|
||||
info->print_insn = print_insn_ppc;
|
||||
|
||||
info->cap_arch = CS_ARCH_PPC;
|
||||
#ifdef TARGET_PPC64
|
||||
info->cap_mode = CS_MODE_64;
|
||||
#endif
|
||||
}
|
||||
|
||||
static Property ppc_cpu_properties[] = {
|
||||
DEFINE_PROP_BOOL("pre-2.8-migration", PowerPCCPU, pre_2_8_migration, false),
|
||||
DEFINE_PROP_BOOL("pre-2.10-migration", PowerPCCPU, pre_2_10_migration,
|
||||
|
@ -10581,7 +10607,8 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
|
|||
#ifdef CONFIG_TCG
|
||||
cc->tcg_initialize = ppc_translate_init;
|
||||
#endif
|
||||
|
||||
cc->disas_set_info = ppc_disas_set_info;
|
||||
|
||||
dc->fw_name = "PowerPC,UNKNOWN";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue