1 /* src/vm/jit/disass.h - disassembler header
3 Copyright (C) 1996-2005, 2006, 2007 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 $Id: disass.h 7596 2007-03-28 21:05:53Z twisti $
35 #if defined(WITH_BINUTILS_DISASSEMBLER)
41 #if defined(ENABLE_DISASSEMBLER)
43 /* some macros ****************************************************************/
45 #if defined(ENABLE_JIT)
46 # if defined(ENABLE_INTRP)
48 #define DISASSINSTR(code) \
51 (code) = intrp_disassinstr((code)); \
53 (code) = disassinstr((code)); \
56 #define DISASSEMBLE(start,end) \
59 intrp_disassemble((start), (end)); \
61 disassemble((start), (end)); \
64 # else /* defined(ENABLE_INTRP) */
66 #define DISASSINSTR(code) \
67 (code) = disassinstr((code))
69 #define DISASSEMBLE(start,end) \
70 disassemble((start), (end))
72 # endif /* defined(ENABLE_INTRP) */
73 #else /* defined(ENABLE_JIT) */
75 #define DISASSINSTR(code) \
76 (code) = intrp_disassinstr((code))
78 #define DISASSEMBLE(start,end) \
79 intrp_disassemble((start), (end))
81 #endif /* defined(ENABLE_JIT) */
84 /* export global variables ****************************************************/
86 #if defined(WITH_BINUTILS_DISASSEMBLER)
87 extern disassemble_info info;
88 extern bool disass_initialized;
91 #if defined(__I386__) || defined(__X86_64__) || defined(__S390__) || defined(__M68K__)
92 extern char disass_buf[512];
97 /* function prototypes *******************************************************/
99 #if defined(ENABLE_JIT)
100 void disassemble(u1 *start, u1 *end);
103 #if defined(WITH_BINUTILS_DISASSEMBLER)
104 void disass_printf(PTR p, const char *fmt, ...);
106 int disass_buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info);
109 /* machine dependent functions */
111 #if defined(ENABLE_JIT)
112 u1 *disassinstr(u1 *code);
115 #if defined(ENABLE_INTRP)
116 u1 *intrp_disassinstr(u1 *code);
117 void intrp_disassemble(u1 *start, u1 *end);
120 #endif /* defined(ENABLE_DISASSEMBLER) */
122 #endif /* _DISASS_H */
126 * These are local overrides for various environment variables in Emacs.
127 * Please do not remove this and leave it at the end of the file, where
128 * Emacs will automagically detect them.
129 * ---------------------------------------------------------------------
132 * indent-tabs-mode: t