1 /* src/vm/jit/disass.h - disassembler header
3 Copyright (C) 1996-2005, 2006, 2007, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
35 #if defined(WITH_BINUTILS_DISASSEMBLER)
41 #include "vm/global.h"
43 #if defined(ENABLE_DISASSEMBLER)
45 /* some macros ****************************************************************/
47 #if defined(ENABLE_JIT)
48 # if defined(ENABLE_INTRP)
50 #define DISASSINSTR(code) \
53 (code) = intrp_disassinstr((code)); \
55 (code) = disassinstr((code)); \
58 #define DISASSEMBLE(start,end) \
61 intrp_disassemble((start), (end)); \
63 disassemble((start), (end)); \
66 # else /* defined(ENABLE_INTRP) */
68 #define DISASSINSTR(code) \
69 (code) = disassinstr((code))
71 #define DISASSEMBLE(start,end) \
72 disassemble((start), (end))
74 # endif /* defined(ENABLE_INTRP) */
75 #else /* defined(ENABLE_JIT) */
77 #define DISASSINSTR(code) \
78 (code) = intrp_disassinstr((code))
80 #define DISASSEMBLE(start,end) \
81 intrp_disassemble((start), (end))
83 #endif /* defined(ENABLE_JIT) */
86 /* export global variables ****************************************************/
88 #if defined(WITH_BINUTILS_DISASSEMBLER)
89 extern disassemble_info info;
90 extern bool disass_initialized;
93 #if defined(__I386__) || defined(__X86_64__) || defined(__S390__) || defined(__M68K__)
94 extern char disass_buf[512];
99 /* function prototypes *******************************************************/
101 #if defined(ENABLE_JIT)
102 void disassemble(u1 *start, u1 *end);
105 #if defined(WITH_BINUTILS_DISASSEMBLER)
106 void disass_printf(PTR p, const char *fmt, ...);
108 int disass_buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info);
111 /* machine dependent functions */
113 #if defined(ENABLE_JIT)
114 u1 *disassinstr(u1 *code);
117 #if defined(ENABLE_INTRP)
118 u1 *intrp_disassinstr(u1 *code);
119 void intrp_disassemble(u1 *start, u1 *end);
122 #endif /* defined(ENABLE_DISASSEMBLER) */
132 * These are local overrides for various environment variables in Emacs.
133 * Please do not remove this and leave it at the end of the file, where
134 * Emacs will automagically detect them.
135 * ---------------------------------------------------------------------
138 * indent-tabs-mode: t