]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - opcodes/disassemble.c
* scripttempl/elfd30v.sc: Place .gcc_except_table.
[thirdparty/binutils-gdb.git] / opcodes / disassemble.c
CommitLineData
252b5132 1/* Select disassembly routine for specified architecture.
5b93d8bb
AM
2 Copyright (C) 1994, 95, 96, 97, 98, 99, 2000
3 Free Software Foundation, Inc.
252b5132
RH
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18
0d8dfecf 19#include "sysdep.h"
252b5132
RH
20#include "dis-asm.h"
21
22#ifdef ARCH_all
23#define ARCH_a29k
24#define ARCH_alpha
25#define ARCH_arc
26#define ARCH_arm
adde6300 27#define ARCH_avr
252b5132
RH
28#define ARCH_d10v
29#define ARCH_d30v
30#define ARCH_h8300
31#define ARCH_h8500
32#define ARCH_hppa
5b93d8bb 33#define ARCH_i370
252b5132
RH
34#define ARCH_i386
35#define ARCH_i960
36#define ARCH_fr30
37#define ARCH_m32r
38#define ARCH_m68k
39#define ARCH_m88k
40#define ARCH_mcore
41#define ARCH_mips
42#define ARCH_mn10200
43#define ARCH_mn10300
44#define ARCH_ns32k
1e608f98 45#define ARCH_pj
252b5132
RH
46#define ARCH_powerpc
47#define ARCH_rs6000
48#define ARCH_sh
49#define ARCH_sparc
50#define ARCH_tic30
51#define ARCH_tic80
52#define ARCH_v850
53#define ARCH_vax
54#define ARCH_w65
55#define ARCH_z8k
56#endif
57
58
59disassembler_ftype
60disassembler (abfd)
61 bfd *abfd;
62{
63 enum bfd_architecture a = bfd_get_arch (abfd);
64 disassembler_ftype disassemble;
65
66 switch (a)
67 {
68 /* If you add a case to this table, also add it to the
69 ARCH_all definition right above this function. */
70#ifdef ARCH_a29k
71 case bfd_arch_a29k:
72 /* As far as I know we only handle big-endian 29k objects. */
73 disassemble = print_insn_big_a29k;
74 break;
75#endif
76#ifdef ARCH_alpha
77 case bfd_arch_alpha:
78 disassemble = print_insn_alpha;
79 break;
80#endif
81#ifdef ARCH_arc
82 case bfd_arch_arc:
83 {
84 disassemble = arc_get_disassembler (bfd_get_mach (abfd),
85 bfd_big_endian (abfd));
86 break;
87 }
88#endif
89#ifdef ARCH_arm
90 case bfd_arch_arm:
91 if (bfd_big_endian (abfd))
92 disassemble = print_insn_big_arm;
93 else
94 disassemble = print_insn_little_arm;
95 break;
96#endif
adde6300
AM
97#ifdef ARCH_avr
98 case bfd_arch_avr:
99 disassemble = print_insn_avr;
100 break;
101#endif
252b5132
RH
102#ifdef ARCH_d10v
103 case bfd_arch_d10v:
104 disassemble = print_insn_d10v;
105 break;
106#endif
107#ifdef ARCH_d30v
108 case bfd_arch_d30v:
109 disassemble = print_insn_d30v;
110 break;
111#endif
112#ifdef ARCH_h8300
113 case bfd_arch_h8300:
114 if (bfd_get_mach(abfd) == bfd_mach_h8300h)
115 disassemble = print_insn_h8300h;
116 else if (bfd_get_mach(abfd) == bfd_mach_h8300s)
117 disassemble = print_insn_h8300s;
118 else
119 disassemble = print_insn_h8300;
120 break;
121#endif
122#ifdef ARCH_h8500
123 case bfd_arch_h8500:
124 disassemble = print_insn_h8500;
125 break;
126#endif
127#ifdef ARCH_hppa
128 case bfd_arch_hppa:
129 disassemble = print_insn_hppa;
130 break;
131#endif
5b93d8bb
AM
132#ifdef ARCH_i370
133 case bfd_arch_i370:
134 disassemble = print_insn_i370;
135 break;
136#endif
252b5132
RH
137#ifdef ARCH_i386
138 case bfd_arch_i386:
139 if (bfd_get_mach (abfd) == bfd_mach_i386_i386_intel_syntax)
140 disassemble = print_insn_i386_intel;
141 else
142 disassemble = print_insn_i386_att;
143 break;
144#endif
145#ifdef ARCH_i960
146 case bfd_arch_i960:
147 disassemble = print_insn_i960;
148 break;
149#endif
150#ifdef ARCH_fr30
151 case bfd_arch_fr30:
152 disassemble = print_insn_fr30;
153 break;
154#endif
155#ifdef ARCH_m32r
156 case bfd_arch_m32r:
157 disassemble = print_insn_m32r;
158 break;
159#endif
160#ifdef ARCH_m68k
161 case bfd_arch_m68k:
162 disassemble = print_insn_m68k;
163 break;
164#endif
165#ifdef ARCH_m88k
166 case bfd_arch_m88k:
167 disassemble = print_insn_m88k;
168 break;
169#endif
170#ifdef ARCH_ns32k
171 case bfd_arch_ns32k:
172 disassemble = print_insn_ns32k;
173 break;
174#endif
175#ifdef ARCH_mcore
176 case bfd_arch_mcore:
177 disassemble = print_insn_mcore;
178 break;
179#endif
180#ifdef ARCH_mips
181 case bfd_arch_mips:
182 if (bfd_big_endian (abfd))
183 disassemble = print_insn_big_mips;
184 else
185 disassemble = print_insn_little_mips;
186 break;
187#endif
188#ifdef ARCH_mn10200
189 case bfd_arch_mn10200:
190 disassemble = print_insn_mn10200;
191 break;
192#endif
193#ifdef ARCH_mn10300
194 case bfd_arch_mn10300:
195 disassemble = print_insn_mn10300;
196 break;
197#endif
1e608f98
ILT
198#ifdef ARCH_pj
199 case bfd_arch_pj:
200 disassemble = print_insn_pj;
201 break;
202#endif
252b5132
RH
203#ifdef ARCH_powerpc
204 case bfd_arch_powerpc:
205 if (bfd_big_endian (abfd))
206 disassemble = print_insn_big_powerpc;
207 else
208 disassemble = print_insn_little_powerpc;
209 break;
210#endif
211#ifdef ARCH_rs6000
212 case bfd_arch_rs6000:
213 disassemble = print_insn_rs6000;
214 break;
215#endif
216#ifdef ARCH_sh
217 case bfd_arch_sh:
218 if (bfd_big_endian (abfd))
219 disassemble = print_insn_sh;
220 else
221 disassemble = print_insn_shl;
222 break;
223#endif
224#ifdef ARCH_sparc
225 case bfd_arch_sparc:
226 disassemble = print_insn_sparc;
227 break;
228#endif
229#ifdef ARCH_tic30
230 case bfd_arch_tic30:
231 disassemble = print_insn_tic30;
232 break;
233#endif
234#ifdef ARCH_tic80
235 case bfd_arch_tic80:
236 disassemble = print_insn_tic80;
237 break;
238#endif
239#ifdef ARCH_v850
240 case bfd_arch_v850:
241 disassemble = print_insn_v850;
242 break;
243#endif
244#ifdef ARCH_w65
245 case bfd_arch_w65:
246 disassemble = print_insn_w65;
247 break;
248#endif
249#ifdef ARCH_z8k
250 case bfd_arch_z8k:
251 if (bfd_get_mach(abfd) == bfd_mach_z8001)
252 disassemble = print_insn_z8001;
253 else
254 disassemble = print_insn_z8002;
255 break;
256#endif
257#ifdef ARCH_vax
258 case bfd_arch_vax:
259 disassemble = print_insn_vax;
260 break;
261#endif
262 default:
263 return 0;
264 }
265 return disassemble;
266}
94470b23
NC
267
268void
9aaaa291
ILT
269disassembler_usage (stream)
270 FILE *stream ATTRIBUTE_UNUSED;
94470b23 271{
58efb6c0
NC
272#ifdef ARCH_arm
273 print_arm_disassembler_options (stream);
274#endif
275
94470b23
NC
276 return;
277}