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
31 #if defined(WITH_BINUTILS_DISASSEMBLER)
37 #include "vm/global.h"
39 #if defined(ENABLE_DISASSEMBLER)
41 /* some macros ****************************************************************/
43 #if defined(ENABLE_JIT)
44 # if defined(ENABLE_INTRP)
46 #define DISASSINSTR(code) \
49 (code) = intrp_disassinstr((u1*) (code)); \
51 (code) = disassinstr((u1*) (code)); \
54 #define DISASSEMBLE(start,end) \
57 intrp_disassemble((start), (end)); \
59 disassemble((start), (end)); \
62 # else /* defined(ENABLE_INTRP) */
64 #define DISASSINSTR(code) \
65 (code) = disassinstr((u1*) (code))
67 #define DISASSEMBLE(start,end) \
68 disassemble((start), (end))
70 # endif /* defined(ENABLE_INTRP) */
71 #else /* defined(ENABLE_JIT) */
73 #define DISASSINSTR(code) \
74 (code) = intrp_disassinstr((u1*) (code))
76 #define DISASSEMBLE(start,end) \
77 intrp_disassemble((start), (end))
79 #endif /* defined(ENABLE_JIT) */
82 /* export global variables ****************************************************/
84 #if defined(WITH_BINUTILS_DISASSEMBLER)
85 extern disassemble_info info;
86 extern bool disass_initialized;
89 #if defined(__I386__) || defined(__X86_64__) || defined(__S390__) || defined(__M68K__)
90 extern char disass_buf[512];
95 /* 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);
126 #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