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 4357 2006-01-22 23:33:38Z twisti $
41 #if defined(WITH_BINUTILS_DISASSEMBLER)
48 /* some macros ****************************************************************/
50 #if defined(ENABLE_JIT)
51 # if defined(ENABLE_INTRP)
53 #define DISASSINSTR(code) \
56 (code) = intrp_disassinstr((code)); \
58 (code) = disassinstr((code)); \
61 #define DISASSEMBLE(start,end) \
64 intrp_disassemble((start), (end)); \
66 disassemble((start), (end)); \
69 # else /* defined(ENABLE_INTRP) */
71 #define DISASSINSTR(code) \
72 (code) = disassinstr((code))
74 #define DISASSEMBLE(start,end) \
75 disassemble((start), (end))
77 # endif /* defined(ENABLE_INTRP) */
78 #else /* defined(ENABLE_JIT) */
80 #define DISASSINSTR(code) \
81 (code) = intrp_disassinstr((code))
83 #define DISASSEMBLE(start,end) \
84 intrp_disassemble((start), (end))
86 #endif /* defined(ENABLE_JIT) */
89 /* export global variables ****************************************************/
91 #if defined(WITH_BINUTILS_DISASSEMBLER)
92 extern disassemble_info info;
93 extern bool disass_initialized;
98 #if defined(__I386__) || defined(__X86_64__)
99 extern char disass_buf[512];
100 extern s4 disass_len;
104 /* function prototypes *******************************************************/
106 #if defined(ENABLE_JIT)
107 void disassemble(u1 *start, u1 *end);
110 #if defined(WITH_BINUTILS_DISASSEMBLER)
111 void disass_printf(PTR p, const char *fmt, ...);
113 int disass_buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info);
116 /* machine dependent functions */
118 #if defined(ENABLE_JIT)
119 u1 *disassinstr(u1 *code);
122 #if defined(ENABLE_INTRP)
123 u1 *intrp_disassinstr(u1 *code);
124 void intrp_disassemble(u1 *start, u1 *end);
127 #endif /* _DISASS_H */
131 * These are local overrides for various environment variables in Emacs.
132 * Please do not remove this and leave it at the end of the file, where
133 * Emacs will automagically detect them.
134 * ---------------------------------------------------------------------
137 * indent-tabs-mode: t