1 /* src/vm/jit/disass.h - disassembler header
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Christian Thalinger
31 $Id: disass.h 4709 2006-03-30 10:14:22Z twisti $
41 #if defined(WITH_BINUTILS_DISASSEMBLER)
47 #if defined(ENABLE_DISASSEMBLER)
49 /* some macros ****************************************************************/
51 #if defined(ENABLE_JIT)
52 # if defined(ENABLE_INTRP)
54 #define DISASSINSTR(code) \
57 (code) = intrp_disassinstr((code)); \
59 (code) = disassinstr((code)); \
62 #define DISASSEMBLE(start,end) \
65 intrp_disassemble((start), (end)); \
67 disassemble((start), (end)); \
70 # else /* defined(ENABLE_INTRP) */
72 #define DISASSINSTR(code) \
73 (code) = disassinstr((code))
75 #define DISASSEMBLE(start,end) \
76 disassemble((start), (end))
78 # endif /* defined(ENABLE_INTRP) */
79 #else /* defined(ENABLE_JIT) */
81 #define DISASSINSTR(code) \
82 (code) = intrp_disassinstr((code))
84 #define DISASSEMBLE(start,end) \
85 intrp_disassemble((start), (end))
87 #endif /* defined(ENABLE_JIT) */
90 /* export global variables ****************************************************/
92 #if defined(WITH_BINUTILS_DISASSEMBLER)
93 extern disassemble_info info;
94 extern bool disass_initialized;
99 #if defined(__I386__) || defined(__X86_64__)
100 extern char disass_buf[512];
101 extern s4 disass_len;
105 /* function prototypes *******************************************************/
107 #if defined(ENABLE_JIT)
108 void disassemble(u1 *start, u1 *end);
111 #if defined(WITH_BINUTILS_DISASSEMBLER)
112 void disass_printf(PTR p, const char *fmt, ...);
114 int disass_buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info);
117 /* machine dependent functions */
119 #if defined(ENABLE_JIT)
120 u1 *disassinstr(u1 *code);
123 #if defined(ENABLE_INTRP)
124 u1 *intrp_disassinstr(u1 *code);
125 void intrp_disassemble(u1 *start, u1 *end);
128 #endif /* defined(ENABLE_DISASSEMBLER) */
130 #endif /* _DISASS_H */
134 * These are local overrides for various environment variables in Emacs.
135 * Please do not remove this and leave it at the end of the file, where
136 * Emacs will automagically detect them.
137 * ---------------------------------------------------------------------
140 * indent-tabs-mode: t