Search
lxdream.org :: lxdream/src/xlat/xlatdasm.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/xlat/xlatdasm.h
changeset 1263:b3de98d19faf
prevsrc/x86dasm/x86dasm.h@1094:d2324eb67223
author nkeynes
date Tue Mar 06 09:04:34 2012 +1000 (12 years ago)
permissions -rw-r--r--
last change Break host disassembly bits out of sh4x86.in, and move the generic disasm
bits from x86dasm to xlat.
view annotate diff log raw
     1 /**
     2  * $Id$
     3  *
     4  * Wrapper around i386-dis to supply the same behaviour as the other
     5  * disassembly functions.
     6  *
     7  * Copyright (c) 2005 Nathan Keynes.
     8  *
     9  * This program is free software; you can redistribute it and/or modify
    10  * it under the terms of the GNU General Public License as published by
    11  * the Free Software Foundation; either version 2 of the License, or
    12  * (at your option) any later version.
    13  *
    14  * This program is distributed in the hope that it will be useful,
    15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17  * GNU General Public License for more details.
    18  */
    20 #include <stdio.h>
    21 #include "cpu.h"
    22 #include "mem.h"
    23 extern const struct cpu_desc_struct xlat_cpu_desc;
    25 typedef struct xlat_symbol {
    26     const char *name;
    27     void *ptr;
    28 } xlat_symbol;
    32 /**
    33  * Dump the disassembly of the specified code block to a stream
    34  * (primarily for debugging purposes)
    35  * @param out The stream to write the output to
    36  * @param code a translated block
    37  */
    38 void xlat_disasm_block( FILE *out, void *code );
    40 /**
    41  * Disassemble one host instruction
    42  * @param pc Instruction to disassemble
    43  * @param buf buffer to hold the disassembled instruction
    44  * @param len sizeof buf
    45  * @param opcode buffer to hold the raw opcodes for the instruction (must be at least
    46  *    3 * maximum number of instruction bytes)
    47  * @return next pc after the current instruction
    48  */
    49 uintptr_t xlat_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode );
    51 void xlat_disasm_region( FILE *out, void *block, uint32_t len );
    52 void xlat_disasm_init( xlat_symbol *symtab, int num_symbols );
    53 uintptr_t xlat_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode );
    55 void xlat_print_symbolic_operand( char *buf, int hex, uintptr_t disp );
.