Since d10v is public now, remove all sanitization statements
[deliverable/binutils-gdb.git] / opcodes / disassemble.c
1 /* Select disassembly routine for specified architecture.
2 Copyright (C) 1994, 1995 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
17
18 #include "ansidecl.h"
19 #include "dis-asm.h"
20
21 #ifdef ARCH_all
22 #define ARCH_a29k
23 #define ARCH_alpha
24 /* start-sanitize-arc */
25 #define ARCH_arc
26 /* end-sanitize-arc */
27 #define ARCH_arm
28 #define ARCH_d10v
29 /* start-sanitize-d30v */
30 #define ARCH_d30v
31 /* end-sanitize-d30v */
32 #define ARCH_h8300
33 #define ARCH_h8500
34 #define ARCH_hppa
35 #define ARCH_i386
36 #define ARCH_i960
37 #define ARCH_m68k
38 #define ARCH_m88k
39 #define ARCH_mips
40 #define ARCH_mn10200
41 #define ARCH_mn10300
42 #define ARCH_ns32k
43 #define ARCH_powerpc
44 #define ARCH_rs6000
45 #define ARCH_sh
46 #define ARCH_sparc
47 /* start-sanitize-tic80 */
48 #define ARCH_tic80
49 /* end-sanitize-tic80 */
50 /* start-sanitize-v850 */
51 #define ARCH_v850
52 /* end-sanitize-v850 */
53 #define ARCH_w65
54 #define ARCH_z8k
55 #endif
56
57 disassembler_ftype
58 disassembler (abfd)
59 bfd *abfd;
60 {
61 enum bfd_architecture a = bfd_get_arch (abfd);
62 disassembler_ftype disassemble;
63
64 switch (a)
65 {
66 /* If you add a case to this table, also add it to the
67 ARCH_all definition right above this function. */
68 #ifdef ARCH_a29k
69 case bfd_arch_a29k:
70 /* As far as I know we only handle big-endian 29k objects. */
71 disassemble = print_insn_big_a29k;
72 break;
73 #endif
74 #ifdef ARCH_alpha
75 case bfd_arch_alpha:
76 disassemble = print_insn_alpha;
77 break;
78 #endif
79 /* start-sanitize-arc */
80 #ifdef ARCH_arc
81 case bfd_arch_arc:
82 {
83 disassemble = arc_get_disassembler (bfd_get_mach (abfd),
84 bfd_big_endian (abfd));
85 break;
86 }
87 #endif
88 /* end-sanitize-arc */
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
97 #ifdef ARCH_d10v
98 case bfd_arch_d10v:
99 disassemble = print_insn_d10v;
100 break;
101 #endif
102 /* start-sanitize-d30v */
103 #ifdef ARCH_d30v
104 case bfd_arch_d30v:
105 disassemble = print_insn_d30v;
106 break;
107 #endif
108 /* end-sanitize-d30v */
109 #ifdef ARCH_h8300
110 case bfd_arch_h8300:
111 if (bfd_get_mach(abfd) == bfd_mach_h8300h)
112 disassemble = print_insn_h8300h;
113 else if (bfd_get_mach(abfd) == bfd_mach_h8300s)
114 disassemble = print_insn_h8300s;
115 else
116 disassemble = print_insn_h8300;
117 break;
118 #endif
119 #ifdef ARCH_h8500
120 case bfd_arch_h8500:
121 disassemble = print_insn_h8500;
122 break;
123 #endif
124 #ifdef ARCH_hppa
125 case bfd_arch_hppa:
126 disassemble = print_insn_hppa;
127 break;
128 #endif
129 #ifdef ARCH_i386
130 case bfd_arch_i386:
131 disassemble = print_insn_i386;
132 break;
133 #endif
134 #ifdef ARCH_i960
135 case bfd_arch_i960:
136 disassemble = print_insn_i960;
137 break;
138 #endif
139 #ifdef ARCH_m68k
140 case bfd_arch_m68k:
141 disassemble = print_insn_m68k;
142 break;
143 #endif
144 #ifdef ARCH_m88k
145 case bfd_arch_m88k:
146 disassemble = print_insn_m88k;
147 break;
148 #endif
149 #ifdef ARCH_ns32k
150 case bfd_arch_ns32k:
151 disassemble = print_insn_ns32k;
152 break;
153 #endif
154 #ifdef ARCH_mips
155 case bfd_arch_mips:
156 if (bfd_big_endian (abfd))
157 disassemble = print_insn_big_mips;
158 else
159 disassemble = print_insn_little_mips;
160 break;
161 #endif
162 #ifdef ARCH_mn10200
163 case bfd_arch_mn10200:
164 disassemble = print_insn_mn10200;
165 break;
166 #endif
167 #ifdef ARCH_mn10300
168 case bfd_arch_mn10300:
169 disassemble = print_insn_mn10300;
170 break;
171 #endif
172 #ifdef ARCH_powerpc
173 case bfd_arch_powerpc:
174 if (bfd_big_endian (abfd))
175 disassemble = print_insn_big_powerpc;
176 else
177 disassemble = print_insn_little_powerpc;
178 break;
179 #endif
180 #ifdef ARCH_rs6000
181 case bfd_arch_rs6000:
182 disassemble = print_insn_rs6000;
183 break;
184 #endif
185 #ifdef ARCH_sh
186 case bfd_arch_sh:
187 if (bfd_big_endian (abfd))
188 disassemble = print_insn_sh;
189 else
190 disassemble = print_insn_shl;
191 break;
192 #endif
193 #ifdef ARCH_sparc
194 case bfd_arch_sparc:
195 disassemble = print_insn_sparc;
196 break;
197 #endif
198 /* start-sanitize-tic80 */
199 #ifdef ARCH_tic80
200 case bfd_arch_tic80:
201 disassemble = print_insn_tic80;
202 break;
203 #endif
204 /* end-sanitize-tic80 */
205 /* start-sanitize-v850 */
206 #ifdef ARCH_v850
207 case bfd_arch_v850:
208 disassemble = print_insn_v850;
209 break;
210 #endif
211 /* end-sanitize-v850 */
212 #ifdef ARCH_w65
213 case bfd_arch_w65:
214 disassemble = print_insn_w65;
215 break;
216 #endif
217 #ifdef ARCH_z8k
218 case bfd_arch_z8k:
219 if (bfd_get_mach(abfd) == bfd_mach_z8001)
220 disassemble = print_insn_z8001;
221 else
222 disassemble = print_insn_z8002;
223 break;
224 #endif
225 default:
226 return 0;
227 }
228 return disassemble;
229 }
This page took 0.035259 seconds and 5 git commands to generate.