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
33 #if defined(WITH_BINUTILS_DISASSEMBLER)
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((code)); \
51 (code) = disassinstr((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((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((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 *******************************************************/
97 #if defined(ENABLE_JIT)
98 void disassemble(u1 *start, u1 *end);
101 #if defined(WITH_BINUTILS_DISASSEMBLER)
102 void disass_printf(PTR p, const char *fmt, ...);
104 int disass_buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info);
107 /* machine dependent functions */
109 #if defined(ENABLE_JIT)
110 u1 *disassinstr(u1 *code);
113 #if defined(ENABLE_INTRP)
114 u1 *intrp_disassinstr(u1 *code);
115 void intrp_disassemble(u1 *start, u1 *end);
118 #endif /* defined(ENABLE_DISASSEMBLER) */
120 #endif /* _DISASS_H */
124 * These are local overrides for various environment variables in Emacs.
125 * Please do not remove this and leave it at the end of the file, where
126 * Emacs will automagically detect them.
127 * ---------------------------------------------------------------------
130 * indent-tabs-mode: t