Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
b83266a0 | 4 | Copyright 1998-1999, Free Software Foundation, Inc. |
c906108c | 5 | |
96baa820 JM |
6 | This file is part of GDB. |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
c906108c | 12 | |
96baa820 JM |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
c906108c | 17 | |
96baa820 JM |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 59 Temple Place - Suite 330, | |
21 | Boston, MA 02111-1307, USA. */ | |
adf40b2e | 22 | |
104c1213 JM |
23 | /* This file was created with the aid of ``gdbarch.sh''. |
24 | ||
25 | The bourn shell script ``gdbarch.sh'' creates the files | |
26 | ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them | |
27 | against the existing ``gdbarch.[hc]''. Any differences found | |
28 | being reported. | |
29 | ||
30 | If editing this file, please also run gdbarch.sh and merge any | |
31 | changes into that script. Conversely, when makeing sweeping changes | |
32 | to this file, modifying gdbarch.sh and using its output may prove | |
33 | easier. */ | |
c906108c | 34 | |
c906108c SS |
35 | |
36 | #include "defs.h" | |
1ad03bde | 37 | #include "arch-utils.h" |
c906108c | 38 | |
0f71a2f6 JM |
39 | #if GDB_MULTI_ARCH |
40 | #include "gdbcmd.h" | |
adf40b2e | 41 | #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */ |
0f71a2f6 | 42 | #else |
7a292a7a SS |
43 | /* Just include everything in sight so that the every old definition |
44 | of macro is visible. */ | |
45 | #include "gdb_string.h" | |
46 | #include <ctype.h> | |
47 | #include "symtab.h" | |
48 | #include "frame.h" | |
49 | #include "inferior.h" | |
50 | #include "breakpoint.h" | |
03f2053f | 51 | #include "gdb_wait.h" |
7a292a7a SS |
52 | #include "gdbcore.h" |
53 | #include "gdbcmd.h" | |
54 | #include "target.h" | |
55 | #include "gdbthread.h" | |
56 | #include "annotate.h" | |
57 | #include "symfile.h" /* for overlay functions */ | |
0f71a2f6 | 58 | #endif |
7a292a7a | 59 | #include "symcat.h" |
c906108c SS |
60 | |
61 | ||
104c1213 JM |
62 | /* Static function declarations */ |
63 | ||
64 | static void verify_gdbarch (struct gdbarch *gdbarch); | |
65 | static void init_gdbarch_data (struct gdbarch *); | |
66 | static void init_gdbarch_swap (struct gdbarch *); | |
67 | static void swapout_gdbarch_swap (struct gdbarch *); | |
68 | static void swapin_gdbarch_swap (struct gdbarch *); | |
69 | ||
0f71a2f6 JM |
70 | /* Convenience macro for allocting typesafe memory. */ |
71 | ||
72 | #ifndef XMALLOC | |
73 | #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE)) | |
74 | #endif | |
75 | ||
76 | ||
77 | /* Non-zero if we want to trace architecture code. */ | |
78 | ||
79 | #ifndef GDBARCH_DEBUG | |
80 | #define GDBARCH_DEBUG 0 | |
81 | #endif | |
82 | int gdbarch_debug = GDBARCH_DEBUG; | |
83 | ||
84 | ||
85 | /* Maintain the struct gdbarch object */ | |
86 | ||
87 | struct gdbarch | |
adf40b2e JM |
88 | { |
89 | /* basic architectural information */ | |
90 | const struct bfd_arch_info * bfd_arch_info; | |
91 | int byte_order; | |
0f71a2f6 | 92 | |
adf40b2e JM |
93 | /* target specific vector. */ |
94 | struct gdbarch_tdep *tdep; | |
0f71a2f6 | 95 | |
adf40b2e JM |
96 | /* per-architecture data-pointers */ |
97 | int nr_data; | |
98 | void **data; | |
0f71a2f6 | 99 | |
adf40b2e JM |
100 | /* per-architecture swap-regions */ |
101 | struct gdbarch_swap *swap; | |
0f71a2f6 | 102 | |
adf40b2e | 103 | /* Multi-arch values. |
0f71a2f6 | 104 | |
adf40b2e | 105 | When extending this structure you must: |
0f71a2f6 | 106 | |
adf40b2e | 107 | Add the field below. |
0f71a2f6 | 108 | |
adf40b2e JM |
109 | Declare set/get functions and define the corresponding |
110 | macro in gdbarch.h. | |
0f71a2f6 | 111 | |
adf40b2e JM |
112 | gdbarch_alloc(): If zero/NULL is not a suitable default, |
113 | initialize the new field. | |
0f71a2f6 | 114 | |
adf40b2e JM |
115 | verify_gdbarch(): Confirm that the target updated the field |
116 | correctly. | |
0f71a2f6 | 117 | |
adf40b2e JM |
118 | gdbarch_dump(): Add a fprintf_unfiltered call to so that the new |
119 | field is dumped out | |
0f71a2f6 | 120 | |
c0e8c252 | 121 | ``startup_gdbarch()'': Append an initial value to the static |
adf40b2e | 122 | variable (base values on the host's c-type system). |
0f71a2f6 | 123 | |
adf40b2e JM |
124 | get_gdbarch(): Implement the set/get functions (probably using |
125 | the macro's as shortcuts). | |
0f71a2f6 JM |
126 | |
127 | */ | |
128 | ||
c4093a6a | 129 | int bfd_vma_bit; |
adf40b2e JM |
130 | int ptr_bit; |
131 | int short_bit; | |
132 | int int_bit; | |
133 | int long_bit; | |
134 | int long_long_bit; | |
135 | int float_bit; | |
136 | int double_bit; | |
137 | int long_double_bit; | |
7355ddba | 138 | int ieee_float; |
adf40b2e JM |
139 | gdbarch_read_pc_ftype *read_pc; |
140 | gdbarch_write_pc_ftype *write_pc; | |
141 | gdbarch_read_fp_ftype *read_fp; | |
142 | gdbarch_write_fp_ftype *write_fp; | |
143 | gdbarch_read_sp_ftype *read_sp; | |
144 | gdbarch_write_sp_ftype *write_sp; | |
145 | int num_regs; | |
146 | int sp_regnum; | |
147 | int fp_regnum; | |
148 | int pc_regnum; | |
03863182 AC |
149 | int npc_regnum; |
150 | int nnpc_regnum; | |
adf40b2e JM |
151 | gdbarch_register_name_ftype *register_name; |
152 | int register_size; | |
153 | int register_bytes; | |
154 | gdbarch_register_byte_ftype *register_byte; | |
155 | gdbarch_register_raw_size_ftype *register_raw_size; | |
156 | int max_register_raw_size; | |
157 | gdbarch_register_virtual_size_ftype *register_virtual_size; | |
158 | int max_register_virtual_size; | |
159 | gdbarch_register_virtual_type_ftype *register_virtual_type; | |
160 | int use_generic_dummy_frames; | |
161 | int call_dummy_location; | |
162 | gdbarch_call_dummy_address_ftype *call_dummy_address; | |
163 | CORE_ADDR call_dummy_start_offset; | |
164 | CORE_ADDR call_dummy_breakpoint_offset; | |
165 | int call_dummy_breakpoint_offset_p; | |
166 | int call_dummy_length; | |
167 | gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy; | |
168 | int call_dummy_p; | |
169 | LONGEST * call_dummy_words; | |
170 | int sizeof_call_dummy_words; | |
171 | int call_dummy_stack_adjust_p; | |
172 | int call_dummy_stack_adjust; | |
173 | gdbarch_fix_call_dummy_ftype *fix_call_dummy; | |
174 | int believe_pcc_promotion; | |
175 | int believe_pcc_promotion_type; | |
b9a8e3bf | 176 | gdbarch_coerce_float_to_double_ftype *coerce_float_to_double; |
adf40b2e JM |
177 | gdbarch_get_saved_register_ftype *get_saved_register; |
178 | gdbarch_register_convertible_ftype *register_convertible; | |
179 | gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual; | |
180 | gdbarch_register_convert_to_raw_ftype *register_convert_to_raw; | |
4478b372 JB |
181 | gdbarch_pointer_to_address_ftype *pointer_to_address; |
182 | gdbarch_address_to_pointer_ftype *address_to_pointer; | |
71a9f22e | 183 | gdbarch_return_value_on_stack_ftype *return_value_on_stack; |
adf40b2e JM |
184 | gdbarch_extract_return_value_ftype *extract_return_value; |
185 | gdbarch_push_arguments_ftype *push_arguments; | |
186 | gdbarch_push_dummy_frame_ftype *push_dummy_frame; | |
187 | gdbarch_push_return_address_ftype *push_return_address; | |
188 | gdbarch_pop_frame_ftype *pop_frame; | |
189 | gdbarch_d10v_make_daddr_ftype *d10v_make_daddr; | |
190 | gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr; | |
191 | gdbarch_d10v_daddr_p_ftype *d10v_daddr_p; | |
192 | gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p; | |
193 | gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw; | |
194 | gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw; | |
195 | gdbarch_store_struct_return_ftype *store_struct_return; | |
196 | gdbarch_store_return_value_ftype *store_return_value; | |
197 | gdbarch_extract_struct_value_address_ftype *extract_struct_value_address; | |
198 | gdbarch_use_struct_convention_ftype *use_struct_convention; | |
199 | gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs; | |
200 | gdbarch_init_extra_frame_info_ftype *init_extra_frame_info; | |
201 | gdbarch_skip_prologue_ftype *skip_prologue; | |
dad41f9a | 202 | gdbarch_prologue_frameless_p_ftype *prologue_frameless_p; |
adf40b2e JM |
203 | gdbarch_inner_than_ftype *inner_than; |
204 | gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; | |
917317f4 JM |
205 | gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; |
206 | gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint; | |
adf40b2e JM |
207 | CORE_ADDR decr_pc_after_break; |
208 | CORE_ADDR function_start_offset; | |
209 | gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address; | |
210 | CORE_ADDR frame_args_skip; | |
211 | gdbarch_frameless_function_invocation_ftype *frameless_function_invocation; | |
212 | gdbarch_frame_chain_ftype *frame_chain; | |
213 | gdbarch_frame_chain_valid_ftype *frame_chain_valid; | |
214 | gdbarch_frame_saved_pc_ftype *frame_saved_pc; | |
215 | gdbarch_frame_args_address_ftype *frame_args_address; | |
216 | gdbarch_frame_locals_address_ftype *frame_locals_address; | |
217 | gdbarch_saved_pc_after_call_ftype *saved_pc_after_call; | |
218 | gdbarch_frame_num_args_ftype *frame_num_args; | |
2ada493a | 219 | gdbarch_stack_align_ftype *stack_align; |
d03e67c9 | 220 | gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr; |
adf40b2e | 221 | }; |
0f71a2f6 JM |
222 | |
223 | ||
224 | /* The default architecture uses host values (for want of a better | |
225 | choice). */ | |
226 | ||
227 | extern const struct bfd_arch_info bfd_default_arch_struct; | |
228 | ||
c0e8c252 | 229 | struct gdbarch startup_gdbarch = { |
0f71a2f6 JM |
230 | /* basic architecture information */ |
231 | &bfd_default_arch_struct, | |
232 | BIG_ENDIAN, | |
233 | /* target specific vector */ | |
234 | NULL, | |
235 | /*per-architecture data-pointers and swap regions */ | |
236 | 0, NULL, NULL, | |
237 | /* Multi-arch values */ | |
adf40b2e | 238 | 8 * sizeof (void*), |
c4093a6a | 239 | 8 * sizeof (void*), |
0f71a2f6 JM |
240 | 8 * sizeof (short), |
241 | 8 * sizeof (int), | |
242 | 8 * sizeof (long), | |
243 | 8 * sizeof (LONGEST), | |
244 | 8 * sizeof (float), | |
245 | 8 * sizeof (double), | |
246 | 8 * sizeof (long double), | |
247 | 0, | |
248 | 0, | |
249 | 0, | |
250 | 0, | |
251 | 0, | |
252 | 0, | |
253 | 0, | |
254 | 0, | |
255 | 0, | |
256 | 0, | |
257 | 0, | |
258 | 0, | |
259 | 0, | |
260 | 0, | |
261 | 0, | |
262 | 0, | |
263 | 0, | |
264 | 0, | |
265 | 0, | |
266 | 0, | |
267 | 0, | |
268 | 0, | |
269 | 0, | |
270 | 0, | |
271 | 0, | |
272 | 0, | |
273 | 0, | |
274 | 0, | |
275 | 0, | |
276 | 0, | |
277 | 0, | |
278 | 0, | |
279 | 0, | |
280 | 0, | |
281 | 0, | |
b9a8e3bf | 282 | 0, |
7355ddba | 283 | 0, |
03863182 AC |
284 | 0, |
285 | 0, | |
0f71a2f6 JM |
286 | generic_get_saved_register, |
287 | 0, | |
288 | 0, | |
289 | 0, | |
290 | 0, | |
291 | 0, | |
292 | 0, | |
293 | 0, | |
294 | 0, | |
295 | 0, | |
296 | 0, | |
297 | 0, | |
298 | 0, | |
299 | 0, | |
300 | 0, | |
301 | 0, | |
302 | 0, | |
303 | 0, | |
304 | 0, | |
305 | 0, | |
306 | 0, | |
307 | 0, | |
308 | 0, | |
309 | 0, | |
310 | 0, | |
311 | 0, | |
312 | 0, | |
313 | 0, | |
314 | 0, | |
315 | 0, | |
316 | 0, | |
317 | 0, | |
318 | 0, | |
319 | 0, | |
320 | 0, | |
321 | 0, | |
917317f4 JM |
322 | 0, |
323 | 0, | |
4478b372 JB |
324 | 0, |
325 | 0, | |
71a9f22e | 326 | 0, |
2ada493a | 327 | 0, |
d03e67c9 | 328 | 0, |
dad41f9a | 329 | 0, |
c0e8c252 | 330 | /* startup_gdbarch() */ |
0f71a2f6 | 331 | }; |
c0e8c252 | 332 | struct gdbarch *current_gdbarch = &startup_gdbarch; |
0f71a2f6 JM |
333 | |
334 | ||
335 | /* Create a new ``struct gdbarch'' based in information provided by | |
336 | ``struct gdbarch_info''. */ | |
337 | ||
338 | struct gdbarch * | |
104c1213 JM |
339 | gdbarch_alloc (const struct gdbarch_info *info, |
340 | struct gdbarch_tdep *tdep) | |
0f71a2f6 JM |
341 | { |
342 | struct gdbarch *gdbarch = XMALLOC (struct gdbarch); | |
343 | memset (gdbarch, 0, sizeof (*gdbarch)); | |
344 | ||
345 | gdbarch->tdep = tdep; | |
346 | ||
347 | gdbarch->bfd_arch_info = info->bfd_arch_info; | |
348 | gdbarch->byte_order = info->byte_order; | |
349 | ||
350 | /* Force the explicit initialization of these. */ | |
c4093a6a | 351 | gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; |
0f71a2f6 JM |
352 | gdbarch->num_regs = -1; |
353 | gdbarch->sp_regnum = -1; | |
354 | gdbarch->fp_regnum = -1; | |
355 | gdbarch->pc_regnum = -1; | |
03863182 AC |
356 | gdbarch->npc_regnum = -1; |
357 | gdbarch->nnpc_regnum = -1; | |
c0e8c252 | 358 | gdbarch->register_name = legacy_register_name; |
0f71a2f6 JM |
359 | gdbarch->register_size = -1; |
360 | gdbarch->register_bytes = -1; | |
361 | gdbarch->max_register_raw_size = -1; | |
362 | gdbarch->max_register_virtual_size = -1; | |
363 | gdbarch->use_generic_dummy_frames = -1; | |
364 | gdbarch->call_dummy_start_offset = -1; | |
365 | gdbarch->call_dummy_breakpoint_offset = -1; | |
366 | gdbarch->call_dummy_breakpoint_offset_p = -1; | |
367 | gdbarch->call_dummy_length = -1; | |
368 | gdbarch->call_dummy_p = -1; | |
c0e8c252 AC |
369 | gdbarch->call_dummy_words = legacy_call_dummy_words; |
370 | gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; | |
0f71a2f6 | 371 | gdbarch->call_dummy_stack_adjust_p = -1; |
b9a8e3bf | 372 | gdbarch->coerce_float_to_double = default_coerce_float_to_double; |
c0e8c252 | 373 | gdbarch->register_convertible = generic_register_convertible_not; |
4478b372 JB |
374 | gdbarch->pointer_to_address = generic_pointer_to_address; |
375 | gdbarch->address_to_pointer = generic_address_to_pointer; | |
71a9f22e | 376 | gdbarch->return_value_on_stack = generic_return_value_on_stack_not; |
dad41f9a | 377 | gdbarch->prologue_frameless_p = generic_prologue_frameless_p; |
c0e8c252 | 378 | gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; |
917317f4 JM |
379 | gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; |
380 | gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; | |
0f71a2f6 JM |
381 | gdbarch->decr_pc_after_break = -1; |
382 | gdbarch->function_start_offset = -1; | |
c0e8c252 | 383 | gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address; |
0f71a2f6 | 384 | gdbarch->frame_args_skip = -1; |
c0e8c252 | 385 | gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not; |
0f71a2f6 JM |
386 | /* gdbarch_alloc() */ |
387 | ||
388 | return gdbarch; | |
389 | } | |
390 | ||
391 | ||
058f20d5 JB |
392 | /* Free a gdbarch struct. This should never happen in normal |
393 | operation --- once you've created a gdbarch, you keep it around. | |
394 | However, if an architecture's init function encounters an error | |
395 | building the structure, it may need to clean up a partially | |
396 | constructed gdbarch. */ | |
397 | void | |
398 | gdbarch_free (struct gdbarch *arch) | |
399 | { | |
400 | /* At the moment, this is trivial. */ | |
401 | free (arch); | |
402 | } | |
403 | ||
404 | ||
0f71a2f6 JM |
405 | /* Ensure that all values in a GDBARCH are reasonable. */ |
406 | ||
0f71a2f6 | 407 | static void |
104c1213 | 408 | verify_gdbarch (struct gdbarch *gdbarch) |
0f71a2f6 JM |
409 | { |
410 | /* Only perform sanity checks on a multi-arch target. */ | |
411 | if (GDB_MULTI_ARCH <= 0) | |
412 | return; | |
413 | /* fundamental */ | |
414 | if (gdbarch->byte_order == 0) | |
96baa820 | 415 | internal_error ("verify_gdbarch: byte-order unset"); |
0f71a2f6 | 416 | if (gdbarch->bfd_arch_info == NULL) |
96baa820 | 417 | internal_error ("verify_gdbarch: bfd_arch_info unset"); |
0f71a2f6 | 418 | /* Check those that need to be defined for the given multi-arch level. */ |
c0e8c252 | 419 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
0f71a2f6 JM |
420 | if ((GDB_MULTI_ARCH >= 1) |
421 | && (gdbarch->ptr_bit == 0)) | |
96baa820 | 422 | internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid"); |
0f71a2f6 JM |
423 | if ((GDB_MULTI_ARCH >= 1) |
424 | && (gdbarch->short_bit == 0)) | |
96baa820 | 425 | internal_error ("gdbarch: verify_gdbarch: short_bit invalid"); |
0f71a2f6 JM |
426 | if ((GDB_MULTI_ARCH >= 1) |
427 | && (gdbarch->int_bit == 0)) | |
96baa820 | 428 | internal_error ("gdbarch: verify_gdbarch: int_bit invalid"); |
0f71a2f6 JM |
429 | if ((GDB_MULTI_ARCH >= 1) |
430 | && (gdbarch->long_bit == 0)) | |
96baa820 | 431 | internal_error ("gdbarch: verify_gdbarch: long_bit invalid"); |
0f71a2f6 JM |
432 | if ((GDB_MULTI_ARCH >= 1) |
433 | && (gdbarch->long_long_bit == 0)) | |
96baa820 | 434 | internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid"); |
0f71a2f6 JM |
435 | if ((GDB_MULTI_ARCH >= 1) |
436 | && (gdbarch->float_bit == 0)) | |
96baa820 | 437 | internal_error ("gdbarch: verify_gdbarch: float_bit invalid"); |
0f71a2f6 JM |
438 | if ((GDB_MULTI_ARCH >= 1) |
439 | && (gdbarch->double_bit == 0)) | |
96baa820 | 440 | internal_error ("gdbarch: verify_gdbarch: double_bit invalid"); |
0f71a2f6 JM |
441 | if ((GDB_MULTI_ARCH >= 1) |
442 | && (gdbarch->long_double_bit == 0)) | |
96baa820 | 443 | internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid"); |
7355ddba | 444 | /* Skip verify of ieee_float, invalid_p == 0 */ |
0f71a2f6 JM |
445 | if ((GDB_MULTI_ARCH >= 1) |
446 | && (gdbarch->read_pc == 0)) | |
96baa820 | 447 | internal_error ("gdbarch: verify_gdbarch: read_pc invalid"); |
0f71a2f6 JM |
448 | if ((GDB_MULTI_ARCH >= 1) |
449 | && (gdbarch->write_pc == 0)) | |
96baa820 | 450 | internal_error ("gdbarch: verify_gdbarch: write_pc invalid"); |
0f71a2f6 JM |
451 | if ((GDB_MULTI_ARCH >= 1) |
452 | && (gdbarch->read_fp == 0)) | |
96baa820 | 453 | internal_error ("gdbarch: verify_gdbarch: read_fp invalid"); |
0f71a2f6 JM |
454 | if ((GDB_MULTI_ARCH >= 1) |
455 | && (gdbarch->write_fp == 0)) | |
96baa820 | 456 | internal_error ("gdbarch: verify_gdbarch: write_fp invalid"); |
0f71a2f6 JM |
457 | if ((GDB_MULTI_ARCH >= 1) |
458 | && (gdbarch->read_sp == 0)) | |
96baa820 | 459 | internal_error ("gdbarch: verify_gdbarch: read_sp invalid"); |
0f71a2f6 JM |
460 | if ((GDB_MULTI_ARCH >= 1) |
461 | && (gdbarch->write_sp == 0)) | |
96baa820 | 462 | internal_error ("gdbarch: verify_gdbarch: write_sp invalid"); |
0f71a2f6 JM |
463 | if ((GDB_MULTI_ARCH >= 2) |
464 | && (gdbarch->num_regs == -1)) | |
96baa820 | 465 | internal_error ("gdbarch: verify_gdbarch: num_regs invalid"); |
0f71a2f6 JM |
466 | if ((GDB_MULTI_ARCH >= 2) |
467 | && (gdbarch->sp_regnum == -1)) | |
96baa820 | 468 | internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid"); |
0f71a2f6 JM |
469 | if ((GDB_MULTI_ARCH >= 2) |
470 | && (gdbarch->fp_regnum == -1)) | |
96baa820 | 471 | internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid"); |
0f71a2f6 JM |
472 | if ((GDB_MULTI_ARCH >= 2) |
473 | && (gdbarch->pc_regnum == -1)) | |
96baa820 | 474 | internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid"); |
03863182 AC |
475 | /* Skip verify of npc_regnum, invalid_p == 0 */ |
476 | /* Skip verify of nnpc_regnum, invalid_p == 0 */ | |
c0e8c252 | 477 | /* Skip verify of register_name, invalid_p == 0 */ |
0f71a2f6 JM |
478 | if ((GDB_MULTI_ARCH >= 2) |
479 | && (gdbarch->register_size == -1)) | |
96baa820 | 480 | internal_error ("gdbarch: verify_gdbarch: register_size invalid"); |
0f71a2f6 JM |
481 | if ((GDB_MULTI_ARCH >= 2) |
482 | && (gdbarch->register_bytes == -1)) | |
96baa820 | 483 | internal_error ("gdbarch: verify_gdbarch: register_bytes invalid"); |
0f71a2f6 JM |
484 | if ((GDB_MULTI_ARCH >= 2) |
485 | && (gdbarch->register_byte == 0)) | |
96baa820 | 486 | internal_error ("gdbarch: verify_gdbarch: register_byte invalid"); |
0f71a2f6 JM |
487 | if ((GDB_MULTI_ARCH >= 2) |
488 | && (gdbarch->register_raw_size == 0)) | |
96baa820 | 489 | internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid"); |
0f71a2f6 JM |
490 | if ((GDB_MULTI_ARCH >= 2) |
491 | && (gdbarch->max_register_raw_size == -1)) | |
96baa820 | 492 | internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid"); |
0f71a2f6 JM |
493 | if ((GDB_MULTI_ARCH >= 2) |
494 | && (gdbarch->register_virtual_size == 0)) | |
96baa820 | 495 | internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid"); |
0f71a2f6 JM |
496 | if ((GDB_MULTI_ARCH >= 2) |
497 | && (gdbarch->max_register_virtual_size == -1)) | |
96baa820 | 498 | internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid"); |
0f71a2f6 JM |
499 | if ((GDB_MULTI_ARCH >= 2) |
500 | && (gdbarch->register_virtual_type == 0)) | |
96baa820 | 501 | internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid"); |
0f71a2f6 JM |
502 | if ((GDB_MULTI_ARCH >= 1) |
503 | && (gdbarch->use_generic_dummy_frames == -1)) | |
96baa820 | 504 | internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid"); |
0f71a2f6 JM |
505 | if ((GDB_MULTI_ARCH >= 2) |
506 | && (gdbarch->call_dummy_location == 0)) | |
96baa820 | 507 | internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid"); |
0f71a2f6 JM |
508 | if ((GDB_MULTI_ARCH >= 2) |
509 | && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0)) | |
96baa820 | 510 | internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid"); |
0f71a2f6 JM |
511 | if ((GDB_MULTI_ARCH >= 2) |
512 | && (gdbarch->call_dummy_start_offset == -1)) | |
96baa820 | 513 | internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid"); |
0f71a2f6 JM |
514 | if ((GDB_MULTI_ARCH >= 2) |
515 | && (gdbarch->call_dummy_breakpoint_offset == -1)) | |
96baa820 | 516 | internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid"); |
0f71a2f6 JM |
517 | if ((GDB_MULTI_ARCH >= 1) |
518 | && (gdbarch->call_dummy_breakpoint_offset_p == -1)) | |
96baa820 | 519 | internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid"); |
0f71a2f6 JM |
520 | if ((GDB_MULTI_ARCH >= 2) |
521 | && (gdbarch->call_dummy_length == -1)) | |
96baa820 | 522 | internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid"); |
0f71a2f6 JM |
523 | if ((GDB_MULTI_ARCH >= 2) |
524 | && (gdbarch->pc_in_call_dummy == 0)) | |
96baa820 | 525 | internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid"); |
0f71a2f6 JM |
526 | if ((GDB_MULTI_ARCH >= 1) |
527 | && (gdbarch->call_dummy_p == -1)) | |
96baa820 | 528 | internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid"); |
c0e8c252 AC |
529 | /* Skip verify of call_dummy_words, invalid_p == 0 */ |
530 | /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ | |
0f71a2f6 JM |
531 | if ((GDB_MULTI_ARCH >= 1) |
532 | && (gdbarch->call_dummy_stack_adjust_p == -1)) | |
96baa820 | 533 | internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid"); |
0f71a2f6 JM |
534 | if ((GDB_MULTI_ARCH >= 2) |
535 | && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)) | |
96baa820 | 536 | internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid"); |
0f71a2f6 JM |
537 | if ((GDB_MULTI_ARCH >= 2) |
538 | && (gdbarch->fix_call_dummy == 0)) | |
96baa820 | 539 | internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid"); |
c0e8c252 | 540 | /* Skip verify of coerce_float_to_double, invalid_p == 0 */ |
0f71a2f6 JM |
541 | if ((GDB_MULTI_ARCH >= 1) |
542 | && (gdbarch->get_saved_register == 0)) | |
96baa820 | 543 | internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid"); |
c0e8c252 AC |
544 | /* Skip verify of register_convertible, invalid_p == 0 */ |
545 | /* Skip verify of register_convert_to_virtual, invalid_p == 0 */ | |
546 | /* Skip verify of register_convert_to_raw, invalid_p == 0 */ | |
4478b372 JB |
547 | /* Skip verify of pointer_to_address, invalid_p == 0 */ |
548 | /* Skip verify of address_to_pointer, invalid_p == 0 */ | |
71a9f22e | 549 | /* Skip verify of return_value_on_stack, invalid_p == 0 */ |
0f71a2f6 JM |
550 | if ((GDB_MULTI_ARCH >= 2) |
551 | && (gdbarch->extract_return_value == 0)) | |
96baa820 | 552 | internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid"); |
0f71a2f6 JM |
553 | if ((GDB_MULTI_ARCH >= 1) |
554 | && (gdbarch->push_arguments == 0)) | |
96baa820 | 555 | internal_error ("gdbarch: verify_gdbarch: push_arguments invalid"); |
0f71a2f6 JM |
556 | if ((GDB_MULTI_ARCH >= 2) |
557 | && (gdbarch->push_dummy_frame == 0)) | |
96baa820 | 558 | internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid"); |
0f71a2f6 JM |
559 | if ((GDB_MULTI_ARCH >= 1) |
560 | && (gdbarch->push_return_address == 0)) | |
96baa820 | 561 | internal_error ("gdbarch: verify_gdbarch: push_return_address invalid"); |
0f71a2f6 JM |
562 | if ((GDB_MULTI_ARCH >= 2) |
563 | && (gdbarch->pop_frame == 0)) | |
96baa820 | 564 | internal_error ("gdbarch: verify_gdbarch: pop_frame invalid"); |
c0e8c252 AC |
565 | /* Skip verify of d10v_make_daddr, invalid_p == 0 */ |
566 | /* Skip verify of d10v_make_iaddr, invalid_p == 0 */ | |
06b8da7d MS |
567 | /* Skip verify of d10v_daddr_p, invalid_p == 0 */ |
568 | /* Skip verify of d10v_iaddr_p, invalid_p == 0 */ | |
569 | /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */ | |
570 | /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */ | |
0f71a2f6 JM |
571 | if ((GDB_MULTI_ARCH >= 2) |
572 | && (gdbarch->store_struct_return == 0)) | |
96baa820 | 573 | internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid"); |
0f71a2f6 JM |
574 | if ((GDB_MULTI_ARCH >= 2) |
575 | && (gdbarch->store_return_value == 0)) | |
96baa820 | 576 | internal_error ("gdbarch: verify_gdbarch: store_return_value invalid"); |
0f71a2f6 JM |
577 | if ((GDB_MULTI_ARCH >= 2) |
578 | && (gdbarch->extract_struct_value_address == 0)) | |
96baa820 | 579 | internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid"); |
0f71a2f6 JM |
580 | if ((GDB_MULTI_ARCH >= 2) |
581 | && (gdbarch->use_struct_convention == 0)) | |
96baa820 | 582 | internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid"); |
0f71a2f6 JM |
583 | if ((GDB_MULTI_ARCH >= 2) |
584 | && (gdbarch->frame_init_saved_regs == 0)) | |
96baa820 | 585 | internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid"); |
0f71a2f6 JM |
586 | if ((GDB_MULTI_ARCH >= 2) |
587 | && (gdbarch->init_extra_frame_info == 0)) | |
96baa820 | 588 | internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid"); |
0f71a2f6 JM |
589 | if ((GDB_MULTI_ARCH >= 2) |
590 | && (gdbarch->skip_prologue == 0)) | |
96baa820 | 591 | internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid"); |
dad41f9a | 592 | /* Skip verify of prologue_frameless_p, invalid_p == 0 */ |
0f71a2f6 JM |
593 | if ((GDB_MULTI_ARCH >= 2) |
594 | && (gdbarch->inner_than == 0)) | |
96baa820 | 595 | internal_error ("gdbarch: verify_gdbarch: inner_than invalid"); |
c0e8c252 AC |
596 | /* Skip verify of breakpoint_from_pc, invalid_p == 0 */ |
597 | /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ | |
598 | /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ | |
0f71a2f6 JM |
599 | if ((GDB_MULTI_ARCH >= 2) |
600 | && (gdbarch->decr_pc_after_break == -1)) | |
96baa820 | 601 | internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid"); |
0f71a2f6 JM |
602 | if ((GDB_MULTI_ARCH >= 2) |
603 | && (gdbarch->function_start_offset == -1)) | |
96baa820 | 604 | internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid"); |
c0e8c252 | 605 | /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */ |
0f71a2f6 JM |
606 | if ((GDB_MULTI_ARCH >= 2) |
607 | && (gdbarch->frame_args_skip == -1)) | |
96baa820 | 608 | internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid"); |
c0e8c252 | 609 | /* Skip verify of frameless_function_invocation, invalid_p == 0 */ |
0f71a2f6 JM |
610 | if ((GDB_MULTI_ARCH >= 2) |
611 | && (gdbarch->frame_chain == 0)) | |
96baa820 | 612 | internal_error ("gdbarch: verify_gdbarch: frame_chain invalid"); |
0f71a2f6 JM |
613 | if ((GDB_MULTI_ARCH >= 1) |
614 | && (gdbarch->frame_chain_valid == 0)) | |
96baa820 | 615 | internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid"); |
0f71a2f6 JM |
616 | if ((GDB_MULTI_ARCH >= 2) |
617 | && (gdbarch->frame_saved_pc == 0)) | |
96baa820 | 618 | internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid"); |
0f71a2f6 JM |
619 | if ((GDB_MULTI_ARCH >= 2) |
620 | && (gdbarch->frame_args_address == 0)) | |
96baa820 | 621 | internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid"); |
0f71a2f6 JM |
622 | if ((GDB_MULTI_ARCH >= 2) |
623 | && (gdbarch->frame_locals_address == 0)) | |
96baa820 | 624 | internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid"); |
0f71a2f6 JM |
625 | if ((GDB_MULTI_ARCH >= 2) |
626 | && (gdbarch->saved_pc_after_call == 0)) | |
96baa820 | 627 | internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid"); |
0f71a2f6 JM |
628 | if ((GDB_MULTI_ARCH >= 2) |
629 | && (gdbarch->frame_num_args == 0)) | |
96baa820 | 630 | internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid"); |
2ada493a | 631 | /* Skip verify of stack_align, has predicate */ |
d03e67c9 | 632 | /* Skip verify of reg_struct_has_addr, has predicate */ |
0f71a2f6 JM |
633 | } |
634 | ||
635 | ||
636 | /* Print out the details of the current architecture. */ | |
637 | ||
638 | void | |
104c1213 | 639 | gdbarch_dump (void) |
0f71a2f6 JM |
640 | { |
641 | if (TARGET_ARCHITECTURE != NULL) | |
642 | fprintf_unfiltered (gdb_stdlog, | |
adf40b2e JM |
643 | "gdbarch_update: TARGET_ARCHITECTURE = %s\n", |
644 | TARGET_ARCHITECTURE->printable_name); | |
0f71a2f6 | 645 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
646 | "gdbarch_update: TARGET_BYTE_ORDER = %ld\n", |
647 | (long) TARGET_BYTE_ORDER); | |
c4093a6a JM |
648 | fprintf_unfiltered (gdb_stdlog, |
649 | "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n", | |
650 | (long) TARGET_BFD_VMA_BIT); | |
0f71a2f6 | 651 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
652 | "gdbarch_update: TARGET_PTR_BIT = %ld\n", |
653 | (long) TARGET_PTR_BIT); | |
0f71a2f6 | 654 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
655 | "gdbarch_update: TARGET_SHORT_BIT = %ld\n", |
656 | (long) TARGET_SHORT_BIT); | |
0f71a2f6 | 657 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
658 | "gdbarch_update: TARGET_INT_BIT = %ld\n", |
659 | (long) TARGET_INT_BIT); | |
0f71a2f6 | 660 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
661 | "gdbarch_update: TARGET_LONG_BIT = %ld\n", |
662 | (long) TARGET_LONG_BIT); | |
0f71a2f6 | 663 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
664 | "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n", |
665 | (long) TARGET_LONG_LONG_BIT); | |
0f71a2f6 | 666 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
667 | "gdbarch_update: TARGET_FLOAT_BIT = %ld\n", |
668 | (long) TARGET_FLOAT_BIT); | |
0f71a2f6 | 669 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
670 | "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n", |
671 | (long) TARGET_DOUBLE_BIT); | |
0f71a2f6 | 672 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
673 | "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n", |
674 | (long) TARGET_LONG_DOUBLE_BIT); | |
7355ddba JB |
675 | fprintf_unfiltered (gdb_stdlog, |
676 | "gdbarch_update: IEEE_FLOAT = %ld\n", | |
677 | (long) IEEE_FLOAT); | |
0f71a2f6 | 678 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
679 | "gdbarch_update: TARGET_READ_PC = 0x%08lx\n", |
680 | (long) current_gdbarch->read_pc | |
681 | /*TARGET_READ_PC ()*/); | |
0f71a2f6 | 682 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
683 | "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n", |
684 | (long) current_gdbarch->write_pc | |
685 | /*TARGET_WRITE_PC ()*/); | |
0f71a2f6 | 686 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
687 | "gdbarch_update: TARGET_READ_FP = 0x%08lx\n", |
688 | (long) current_gdbarch->read_fp | |
689 | /*TARGET_READ_FP ()*/); | |
0f71a2f6 | 690 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
691 | "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n", |
692 | (long) current_gdbarch->write_fp | |
693 | /*TARGET_WRITE_FP ()*/); | |
0f71a2f6 | 694 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
695 | "gdbarch_update: TARGET_READ_SP = 0x%08lx\n", |
696 | (long) current_gdbarch->read_sp | |
697 | /*TARGET_READ_SP ()*/); | |
0f71a2f6 | 698 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
699 | "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n", |
700 | (long) current_gdbarch->write_sp | |
701 | /*TARGET_WRITE_SP ()*/); | |
0f71a2f6 | 702 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
703 | "gdbarch_update: NUM_REGS = %ld\n", |
704 | (long) NUM_REGS); | |
0f71a2f6 | 705 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
706 | "gdbarch_update: SP_REGNUM = %ld\n", |
707 | (long) SP_REGNUM); | |
0f71a2f6 | 708 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
709 | "gdbarch_update: FP_REGNUM = %ld\n", |
710 | (long) FP_REGNUM); | |
0f71a2f6 | 711 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
712 | "gdbarch_update: PC_REGNUM = %ld\n", |
713 | (long) PC_REGNUM); | |
03863182 AC |
714 | fprintf_unfiltered (gdb_stdlog, |
715 | "gdbarch_update: NPC_REGNUM = %ld\n", | |
716 | (long) NPC_REGNUM); | |
717 | fprintf_unfiltered (gdb_stdlog, | |
718 | "gdbarch_update: NNPC_REGNUM = %ld\n", | |
719 | (long) NNPC_REGNUM); | |
0f71a2f6 | 720 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
721 | "gdbarch_update: REGISTER_NAME = 0x%08lx\n", |
722 | (long) current_gdbarch->register_name | |
723 | /*REGISTER_NAME ()*/); | |
0f71a2f6 | 724 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
725 | "gdbarch_update: REGISTER_SIZE = %ld\n", |
726 | (long) REGISTER_SIZE); | |
0f71a2f6 | 727 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
728 | "gdbarch_update: REGISTER_BYTES = %ld\n", |
729 | (long) REGISTER_BYTES); | |
0f71a2f6 | 730 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
731 | "gdbarch_update: REGISTER_BYTE = 0x%08lx\n", |
732 | (long) current_gdbarch->register_byte | |
733 | /*REGISTER_BYTE ()*/); | |
0f71a2f6 | 734 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
735 | "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n", |
736 | (long) current_gdbarch->register_raw_size | |
737 | /*REGISTER_RAW_SIZE ()*/); | |
0f71a2f6 | 738 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
739 | "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n", |
740 | (long) MAX_REGISTER_RAW_SIZE); | |
0f71a2f6 | 741 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
742 | "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n", |
743 | (long) current_gdbarch->register_virtual_size | |
744 | /*REGISTER_VIRTUAL_SIZE ()*/); | |
0f71a2f6 | 745 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
746 | "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n", |
747 | (long) MAX_REGISTER_VIRTUAL_SIZE); | |
0f71a2f6 | 748 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
749 | "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n", |
750 | (long) current_gdbarch->register_virtual_type | |
751 | /*REGISTER_VIRTUAL_TYPE ()*/); | |
0f71a2f6 | 752 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
753 | "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n", |
754 | (long) USE_GENERIC_DUMMY_FRAMES); | |
0f71a2f6 | 755 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
756 | "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n", |
757 | (long) CALL_DUMMY_LOCATION); | |
0f71a2f6 | 758 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
759 | "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n", |
760 | (long) current_gdbarch->call_dummy_address | |
761 | /*CALL_DUMMY_ADDRESS ()*/); | |
0f71a2f6 | 762 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
763 | "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n", |
764 | (long) CALL_DUMMY_START_OFFSET); | |
0f71a2f6 | 765 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
766 | "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n", |
767 | (long) CALL_DUMMY_BREAKPOINT_OFFSET); | |
0f71a2f6 | 768 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
769 | "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n", |
770 | (long) CALL_DUMMY_BREAKPOINT_OFFSET_P); | |
0f71a2f6 JM |
771 | if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END) |
772 | fprintf_unfiltered (gdb_stdlog, | |
adf40b2e JM |
773 | "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n", |
774 | (long) CALL_DUMMY_LENGTH); | |
0f71a2f6 | 775 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
776 | "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n", |
777 | (long) current_gdbarch->pc_in_call_dummy | |
778 | /*PC_IN_CALL_DUMMY ()*/); | |
0f71a2f6 | 779 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
780 | "gdbarch_update: CALL_DUMMY_P = %ld\n", |
781 | (long) CALL_DUMMY_P); | |
0f71a2f6 | 782 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
783 | "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n", |
784 | (long) CALL_DUMMY_WORDS); | |
0f71a2f6 | 785 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
786 | "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n", |
787 | (long) SIZEOF_CALL_DUMMY_WORDS); | |
0f71a2f6 | 788 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
789 | "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n", |
790 | (long) CALL_DUMMY_STACK_ADJUST_P); | |
0f71a2f6 JM |
791 | if (CALL_DUMMY_STACK_ADJUST_P) |
792 | fprintf_unfiltered (gdb_stdlog, | |
adf40b2e JM |
793 | "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n", |
794 | (long) CALL_DUMMY_STACK_ADJUST); | |
0f71a2f6 | 795 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
796 | "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n", |
797 | (long) current_gdbarch->fix_call_dummy | |
798 | /*FIX_CALL_DUMMY ()*/); | |
0f71a2f6 JM |
799 | #ifdef BELIEVE_PCC_PROMOTION |
800 | fprintf_unfiltered (gdb_stdlog, | |
adf40b2e JM |
801 | "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n", |
802 | (long) BELIEVE_PCC_PROMOTION); | |
0f71a2f6 JM |
803 | #endif |
804 | #ifdef BELIEVE_PCC_PROMOTION_TYPE | |
805 | fprintf_unfiltered (gdb_stdlog, | |
adf40b2e JM |
806 | "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n", |
807 | (long) BELIEVE_PCC_PROMOTION_TYPE); | |
0f71a2f6 | 808 | #endif |
b9a8e3bf JB |
809 | fprintf_unfiltered (gdb_stdlog, |
810 | "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n", | |
811 | (long) current_gdbarch->coerce_float_to_double | |
812 | /*COERCE_FLOAT_TO_DOUBLE ()*/); | |
0f71a2f6 | 813 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
814 | "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n", |
815 | (long) current_gdbarch->get_saved_register | |
816 | /*GET_SAVED_REGISTER ()*/); | |
0f71a2f6 | 817 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
818 | "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n", |
819 | (long) current_gdbarch->register_convertible | |
820 | /*REGISTER_CONVERTIBLE ()*/); | |
0f71a2f6 | 821 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
822 | "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n", |
823 | (long) current_gdbarch->register_convert_to_virtual | |
824 | /*REGISTER_CONVERT_TO_VIRTUAL ()*/); | |
0f71a2f6 | 825 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
826 | "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n", |
827 | (long) current_gdbarch->register_convert_to_raw | |
828 | /*REGISTER_CONVERT_TO_RAW ()*/); | |
4478b372 JB |
829 | fprintf_unfiltered (gdb_stdlog, |
830 | "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n", | |
831 | (long) current_gdbarch->pointer_to_address | |
832 | /*POINTER_TO_ADDRESS ()*/); | |
833 | fprintf_unfiltered (gdb_stdlog, | |
834 | "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n", | |
835 | (long) current_gdbarch->address_to_pointer | |
836 | /*ADDRESS_TO_POINTER ()*/); | |
71a9f22e JB |
837 | fprintf_unfiltered (gdb_stdlog, |
838 | "gdbarch_update: RETURN_VALUE_ON_STACK = 0x%08lx\n", | |
839 | (long) current_gdbarch->return_value_on_stack | |
840 | /*RETURN_VALUE_ON_STACK ()*/); | |
0f71a2f6 | 841 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
842 | "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n", |
843 | (long) current_gdbarch->extract_return_value | |
844 | /*EXTRACT_RETURN_VALUE ()*/); | |
0f71a2f6 | 845 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
846 | "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n", |
847 | (long) current_gdbarch->push_arguments | |
848 | /*PUSH_ARGUMENTS ()*/); | |
0f71a2f6 | 849 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
850 | "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n", |
851 | (long) current_gdbarch->push_dummy_frame | |
852 | /*PUSH_DUMMY_FRAME ()*/); | |
0f71a2f6 | 853 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
854 | "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n", |
855 | (long) current_gdbarch->push_return_address | |
856 | /*PUSH_RETURN_ADDRESS ()*/); | |
0f71a2f6 | 857 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
858 | "gdbarch_update: POP_FRAME = 0x%08lx\n", |
859 | (long) current_gdbarch->pop_frame | |
860 | /*POP_FRAME ()*/); | |
0f71a2f6 | 861 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
862 | "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n", |
863 | (long) current_gdbarch->d10v_make_daddr | |
864 | /*D10V_MAKE_DADDR ()*/); | |
0f71a2f6 | 865 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
866 | "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n", |
867 | (long) current_gdbarch->d10v_make_iaddr | |
868 | /*D10V_MAKE_IADDR ()*/); | |
0f71a2f6 | 869 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
870 | "gdbarch_update: D10V_DADDR_P = 0x%08lx\n", |
871 | (long) current_gdbarch->d10v_daddr_p | |
872 | /*D10V_DADDR_P ()*/); | |
0f71a2f6 | 873 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
874 | "gdbarch_update: D10V_IADDR_P = 0x%08lx\n", |
875 | (long) current_gdbarch->d10v_iaddr_p | |
876 | /*D10V_IADDR_P ()*/); | |
0f71a2f6 | 877 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
878 | "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n", |
879 | (long) current_gdbarch->d10v_convert_daddr_to_raw | |
880 | /*D10V_CONVERT_DADDR_TO_RAW ()*/); | |
0f71a2f6 | 881 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
882 | "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n", |
883 | (long) current_gdbarch->d10v_convert_iaddr_to_raw | |
884 | /*D10V_CONVERT_IADDR_TO_RAW ()*/); | |
0f71a2f6 | 885 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
886 | "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n", |
887 | (long) current_gdbarch->store_struct_return | |
888 | /*STORE_STRUCT_RETURN ()*/); | |
0f71a2f6 | 889 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
890 | "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n", |
891 | (long) current_gdbarch->store_return_value | |
892 | /*STORE_RETURN_VALUE ()*/); | |
0f71a2f6 | 893 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
894 | "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n", |
895 | (long) current_gdbarch->extract_struct_value_address | |
896 | /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); | |
0f71a2f6 | 897 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
898 | "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n", |
899 | (long) current_gdbarch->use_struct_convention | |
900 | /*USE_STRUCT_CONVENTION ()*/); | |
0f71a2f6 | 901 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
902 | "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n", |
903 | (long) current_gdbarch->frame_init_saved_regs | |
904 | /*FRAME_INIT_SAVED_REGS ()*/); | |
0f71a2f6 | 905 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
906 | "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n", |
907 | (long) current_gdbarch->init_extra_frame_info | |
908 | /*INIT_EXTRA_FRAME_INFO ()*/); | |
0f71a2f6 | 909 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
910 | "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n", |
911 | (long) current_gdbarch->skip_prologue | |
912 | /*SKIP_PROLOGUE ()*/); | |
dad41f9a AC |
913 | fprintf_unfiltered (gdb_stdlog, |
914 | "gdbarch_update: PROLOGUE_FRAMELESS_P = 0x%08lx\n", | |
915 | (long) current_gdbarch->prologue_frameless_p | |
916 | /*PROLOGUE_FRAMELESS_P ()*/); | |
0f71a2f6 | 917 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
918 | "gdbarch_update: INNER_THAN = 0x%08lx\n", |
919 | (long) current_gdbarch->inner_than | |
920 | /*INNER_THAN ()*/); | |
0f71a2f6 | 921 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
922 | "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n", |
923 | (long) current_gdbarch->breakpoint_from_pc | |
924 | /*BREAKPOINT_FROM_PC ()*/); | |
917317f4 JM |
925 | fprintf_unfiltered (gdb_stdlog, |
926 | "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n", | |
927 | (long) current_gdbarch->memory_insert_breakpoint | |
928 | /*MEMORY_INSERT_BREAKPOINT ()*/); | |
929 | fprintf_unfiltered (gdb_stdlog, | |
930 | "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n", | |
931 | (long) current_gdbarch->memory_remove_breakpoint | |
932 | /*MEMORY_REMOVE_BREAKPOINT ()*/); | |
0f71a2f6 | 933 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
934 | "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n", |
935 | (long) DECR_PC_AFTER_BREAK); | |
0f71a2f6 | 936 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
937 | "gdbarch_update: FUNCTION_START_OFFSET = %ld\n", |
938 | (long) FUNCTION_START_OFFSET); | |
0f71a2f6 | 939 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
940 | "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n", |
941 | (long) current_gdbarch->remote_translate_xfer_address | |
942 | /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/); | |
0f71a2f6 | 943 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
944 | "gdbarch_update: FRAME_ARGS_SKIP = %ld\n", |
945 | (long) FRAME_ARGS_SKIP); | |
0f71a2f6 | 946 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
947 | "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n", |
948 | (long) current_gdbarch->frameless_function_invocation | |
949 | /*FRAMELESS_FUNCTION_INVOCATION ()*/); | |
0f71a2f6 | 950 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
951 | "gdbarch_update: FRAME_CHAIN = 0x%08lx\n", |
952 | (long) current_gdbarch->frame_chain | |
953 | /*FRAME_CHAIN ()*/); | |
0f71a2f6 | 954 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
955 | "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n", |
956 | (long) current_gdbarch->frame_chain_valid | |
957 | /*FRAME_CHAIN_VALID ()*/); | |
0f71a2f6 | 958 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
959 | "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n", |
960 | (long) current_gdbarch->frame_saved_pc | |
961 | /*FRAME_SAVED_PC ()*/); | |
0f71a2f6 | 962 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
963 | "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n", |
964 | (long) current_gdbarch->frame_args_address | |
965 | /*FRAME_ARGS_ADDRESS ()*/); | |
0f71a2f6 | 966 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
967 | "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n", |
968 | (long) current_gdbarch->frame_locals_address | |
969 | /*FRAME_LOCALS_ADDRESS ()*/); | |
0f71a2f6 | 970 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
971 | "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n", |
972 | (long) current_gdbarch->saved_pc_after_call | |
973 | /*SAVED_PC_AFTER_CALL ()*/); | |
0f71a2f6 | 974 | fprintf_unfiltered (gdb_stdlog, |
adf40b2e JM |
975 | "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n", |
976 | (long) current_gdbarch->frame_num_args | |
977 | /*FRAME_NUM_ARGS ()*/); | |
2ada493a AC |
978 | fprintf_unfiltered (gdb_stdlog, |
979 | "gdbarch_update: STACK_ALIGN = 0x%08lx\n", | |
980 | (long) current_gdbarch->stack_align | |
981 | /*STACK_ALIGN ()*/); | |
d03e67c9 AC |
982 | fprintf_unfiltered (gdb_stdlog, |
983 | "gdbarch_update: REG_STRUCT_HAS_ADDR = 0x%08lx\n", | |
984 | (long) current_gdbarch->reg_struct_has_addr | |
985 | /*REG_STRUCT_HAS_ADDR ()*/); | |
0f71a2f6 JM |
986 | } |
987 | ||
988 | struct gdbarch_tdep * | |
104c1213 | 989 | gdbarch_tdep (struct gdbarch *gdbarch) |
0f71a2f6 JM |
990 | { |
991 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
992 | fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); |
993 | return gdbarch->tdep; | |
994 | } | |
995 | ||
996 | ||
997 | const struct bfd_arch_info * | |
104c1213 | 998 | gdbarch_bfd_arch_info (struct gdbarch *gdbarch) |
0f71a2f6 JM |
999 | { |
1000 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
1001 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n"); |
1002 | return gdbarch->bfd_arch_info; | |
1003 | } | |
1004 | ||
1005 | int | |
104c1213 | 1006 | gdbarch_byte_order (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1007 | { |
1008 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
1009 | fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n"); |
1010 | return gdbarch->byte_order; | |
1011 | } | |
1012 | ||
c4093a6a JM |
1013 | int |
1014 | gdbarch_bfd_vma_bit (struct gdbarch *gdbarch) | |
1015 | { | |
c0e8c252 | 1016 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
c4093a6a | 1017 | if (gdbarch_debug >= 2) |
c4093a6a JM |
1018 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n"); |
1019 | return gdbarch->bfd_vma_bit; | |
1020 | } | |
1021 | ||
1022 | void | |
1023 | set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, | |
1024 | int bfd_vma_bit) | |
1025 | { | |
1026 | gdbarch->bfd_vma_bit = bfd_vma_bit; | |
1027 | } | |
1028 | ||
0f71a2f6 | 1029 | int |
104c1213 | 1030 | gdbarch_ptr_bit (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1031 | { |
1032 | if (gdbarch->ptr_bit == 0) | |
96baa820 | 1033 | internal_error ("gdbarch: gdbarch_ptr_bit invalid"); |
0f71a2f6 | 1034 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1035 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n"); |
1036 | return gdbarch->ptr_bit; | |
1037 | } | |
1038 | ||
1039 | void | |
104c1213 JM |
1040 | set_gdbarch_ptr_bit (struct gdbarch *gdbarch, |
1041 | int ptr_bit) | |
0f71a2f6 JM |
1042 | { |
1043 | gdbarch->ptr_bit = ptr_bit; | |
1044 | } | |
1045 | ||
1046 | int | |
104c1213 | 1047 | gdbarch_short_bit (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1048 | { |
1049 | if (gdbarch->short_bit == 0) | |
96baa820 | 1050 | internal_error ("gdbarch: gdbarch_short_bit invalid"); |
0f71a2f6 | 1051 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1052 | fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n"); |
1053 | return gdbarch->short_bit; | |
1054 | } | |
1055 | ||
1056 | void | |
104c1213 JM |
1057 | set_gdbarch_short_bit (struct gdbarch *gdbarch, |
1058 | int short_bit) | |
0f71a2f6 JM |
1059 | { |
1060 | gdbarch->short_bit = short_bit; | |
1061 | } | |
1062 | ||
1063 | int | |
104c1213 | 1064 | gdbarch_int_bit (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1065 | { |
1066 | if (gdbarch->int_bit == 0) | |
96baa820 | 1067 | internal_error ("gdbarch: gdbarch_int_bit invalid"); |
0f71a2f6 | 1068 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1069 | fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n"); |
1070 | return gdbarch->int_bit; | |
1071 | } | |
1072 | ||
1073 | void | |
104c1213 JM |
1074 | set_gdbarch_int_bit (struct gdbarch *gdbarch, |
1075 | int int_bit) | |
0f71a2f6 JM |
1076 | { |
1077 | gdbarch->int_bit = int_bit; | |
1078 | } | |
1079 | ||
1080 | int | |
104c1213 | 1081 | gdbarch_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1082 | { |
1083 | if (gdbarch->long_bit == 0) | |
96baa820 | 1084 | internal_error ("gdbarch: gdbarch_long_bit invalid"); |
0f71a2f6 | 1085 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1086 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n"); |
1087 | return gdbarch->long_bit; | |
1088 | } | |
1089 | ||
1090 | void | |
104c1213 JM |
1091 | set_gdbarch_long_bit (struct gdbarch *gdbarch, |
1092 | int long_bit) | |
0f71a2f6 JM |
1093 | { |
1094 | gdbarch->long_bit = long_bit; | |
1095 | } | |
1096 | ||
1097 | int | |
104c1213 | 1098 | gdbarch_long_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1099 | { |
1100 | if (gdbarch->long_long_bit == 0) | |
96baa820 | 1101 | internal_error ("gdbarch: gdbarch_long_long_bit invalid"); |
0f71a2f6 | 1102 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1103 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n"); |
1104 | return gdbarch->long_long_bit; | |
1105 | } | |
1106 | ||
1107 | void | |
104c1213 JM |
1108 | set_gdbarch_long_long_bit (struct gdbarch *gdbarch, |
1109 | int long_long_bit) | |
0f71a2f6 JM |
1110 | { |
1111 | gdbarch->long_long_bit = long_long_bit; | |
1112 | } | |
1113 | ||
1114 | int | |
104c1213 | 1115 | gdbarch_float_bit (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1116 | { |
1117 | if (gdbarch->float_bit == 0) | |
96baa820 | 1118 | internal_error ("gdbarch: gdbarch_float_bit invalid"); |
0f71a2f6 | 1119 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1120 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n"); |
1121 | return gdbarch->float_bit; | |
1122 | } | |
1123 | ||
1124 | void | |
104c1213 JM |
1125 | set_gdbarch_float_bit (struct gdbarch *gdbarch, |
1126 | int float_bit) | |
0f71a2f6 JM |
1127 | { |
1128 | gdbarch->float_bit = float_bit; | |
1129 | } | |
1130 | ||
1131 | int | |
104c1213 | 1132 | gdbarch_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1133 | { |
1134 | if (gdbarch->double_bit == 0) | |
96baa820 | 1135 | internal_error ("gdbarch: gdbarch_double_bit invalid"); |
0f71a2f6 | 1136 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1137 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n"); |
1138 | return gdbarch->double_bit; | |
1139 | } | |
1140 | ||
1141 | void | |
104c1213 JM |
1142 | set_gdbarch_double_bit (struct gdbarch *gdbarch, |
1143 | int double_bit) | |
0f71a2f6 JM |
1144 | { |
1145 | gdbarch->double_bit = double_bit; | |
1146 | } | |
1147 | ||
1148 | int | |
104c1213 | 1149 | gdbarch_long_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1150 | { |
1151 | if (gdbarch->long_double_bit == 0) | |
96baa820 | 1152 | internal_error ("gdbarch: gdbarch_long_double_bit invalid"); |
0f71a2f6 | 1153 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1154 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n"); |
1155 | return gdbarch->long_double_bit; | |
1156 | } | |
1157 | ||
1158 | void | |
104c1213 JM |
1159 | set_gdbarch_long_double_bit (struct gdbarch *gdbarch, |
1160 | int long_double_bit) | |
0f71a2f6 JM |
1161 | { |
1162 | gdbarch->long_double_bit = long_double_bit; | |
1163 | } | |
1164 | ||
7355ddba JB |
1165 | int |
1166 | gdbarch_ieee_float (struct gdbarch *gdbarch) | |
1167 | { | |
1168 | /* Skip verify of ieee_float, invalid_p == 0 */ | |
1169 | if (gdbarch_debug >= 2) | |
1170 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n"); | |
1171 | return gdbarch->ieee_float; | |
1172 | } | |
1173 | ||
1174 | void | |
1175 | set_gdbarch_ieee_float (struct gdbarch *gdbarch, | |
1176 | int ieee_float) | |
1177 | { | |
1178 | gdbarch->ieee_float = ieee_float; | |
1179 | } | |
1180 | ||
0f71a2f6 JM |
1181 | CORE_ADDR |
1182 | gdbarch_read_pc (struct gdbarch *gdbarch, int pid) | |
1183 | { | |
1184 | if (gdbarch->read_pc == 0) | |
96baa820 | 1185 | internal_error ("gdbarch: gdbarch_read_pc invalid"); |
0f71a2f6 | 1186 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1187 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); |
1188 | return gdbarch->read_pc (pid); | |
1189 | } | |
1190 | ||
1191 | void | |
104c1213 JM |
1192 | set_gdbarch_read_pc (struct gdbarch *gdbarch, |
1193 | gdbarch_read_pc_ftype read_pc) | |
0f71a2f6 JM |
1194 | { |
1195 | gdbarch->read_pc = read_pc; | |
1196 | } | |
1197 | ||
1198 | void | |
1199 | gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid) | |
1200 | { | |
1201 | if (gdbarch->write_pc == 0) | |
96baa820 | 1202 | internal_error ("gdbarch: gdbarch_write_pc invalid"); |
0f71a2f6 | 1203 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1204 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); |
1205 | gdbarch->write_pc (val, pid); | |
1206 | } | |
1207 | ||
1208 | void | |
104c1213 JM |
1209 | set_gdbarch_write_pc (struct gdbarch *gdbarch, |
1210 | gdbarch_write_pc_ftype write_pc) | |
0f71a2f6 JM |
1211 | { |
1212 | gdbarch->write_pc = write_pc; | |
1213 | } | |
1214 | ||
1215 | CORE_ADDR | |
1216 | gdbarch_read_fp (struct gdbarch *gdbarch) | |
1217 | { | |
1218 | if (gdbarch->read_fp == 0) | |
96baa820 | 1219 | internal_error ("gdbarch: gdbarch_read_fp invalid"); |
0f71a2f6 | 1220 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1221 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n"); |
1222 | return gdbarch->read_fp (); | |
1223 | } | |
1224 | ||
1225 | void | |
104c1213 JM |
1226 | set_gdbarch_read_fp (struct gdbarch *gdbarch, |
1227 | gdbarch_read_fp_ftype read_fp) | |
0f71a2f6 JM |
1228 | { |
1229 | gdbarch->read_fp = read_fp; | |
1230 | } | |
1231 | ||
1232 | void | |
1233 | gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val) | |
1234 | { | |
1235 | if (gdbarch->write_fp == 0) | |
96baa820 | 1236 | internal_error ("gdbarch: gdbarch_write_fp invalid"); |
0f71a2f6 | 1237 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1238 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n"); |
1239 | gdbarch->write_fp (val); | |
1240 | } | |
1241 | ||
1242 | void | |
104c1213 JM |
1243 | set_gdbarch_write_fp (struct gdbarch *gdbarch, |
1244 | gdbarch_write_fp_ftype write_fp) | |
0f71a2f6 JM |
1245 | { |
1246 | gdbarch->write_fp = write_fp; | |
1247 | } | |
1248 | ||
1249 | CORE_ADDR | |
1250 | gdbarch_read_sp (struct gdbarch *gdbarch) | |
1251 | { | |
1252 | if (gdbarch->read_sp == 0) | |
96baa820 | 1253 | internal_error ("gdbarch: gdbarch_read_sp invalid"); |
0f71a2f6 | 1254 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1255 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); |
1256 | return gdbarch->read_sp (); | |
1257 | } | |
1258 | ||
1259 | void | |
104c1213 JM |
1260 | set_gdbarch_read_sp (struct gdbarch *gdbarch, |
1261 | gdbarch_read_sp_ftype read_sp) | |
0f71a2f6 JM |
1262 | { |
1263 | gdbarch->read_sp = read_sp; | |
1264 | } | |
1265 | ||
1266 | void | |
1267 | gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) | |
1268 | { | |
1269 | if (gdbarch->write_sp == 0) | |
96baa820 | 1270 | internal_error ("gdbarch: gdbarch_write_sp invalid"); |
0f71a2f6 | 1271 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1272 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n"); |
1273 | gdbarch->write_sp (val); | |
1274 | } | |
1275 | ||
1276 | void | |
104c1213 JM |
1277 | set_gdbarch_write_sp (struct gdbarch *gdbarch, |
1278 | gdbarch_write_sp_ftype write_sp) | |
0f71a2f6 JM |
1279 | { |
1280 | gdbarch->write_sp = write_sp; | |
1281 | } | |
1282 | ||
1283 | int | |
104c1213 | 1284 | gdbarch_num_regs (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1285 | { |
1286 | if (gdbarch->num_regs == -1) | |
96baa820 | 1287 | internal_error ("gdbarch: gdbarch_num_regs invalid"); |
0f71a2f6 | 1288 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1289 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); |
1290 | return gdbarch->num_regs; | |
1291 | } | |
1292 | ||
1293 | void | |
104c1213 JM |
1294 | set_gdbarch_num_regs (struct gdbarch *gdbarch, |
1295 | int num_regs) | |
0f71a2f6 JM |
1296 | { |
1297 | gdbarch->num_regs = num_regs; | |
1298 | } | |
1299 | ||
1300 | int | |
104c1213 | 1301 | gdbarch_sp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1302 | { |
1303 | if (gdbarch->sp_regnum == -1) | |
96baa820 | 1304 | internal_error ("gdbarch: gdbarch_sp_regnum invalid"); |
0f71a2f6 | 1305 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1306 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); |
1307 | return gdbarch->sp_regnum; | |
1308 | } | |
1309 | ||
1310 | void | |
104c1213 JM |
1311 | set_gdbarch_sp_regnum (struct gdbarch *gdbarch, |
1312 | int sp_regnum) | |
0f71a2f6 JM |
1313 | { |
1314 | gdbarch->sp_regnum = sp_regnum; | |
1315 | } | |
1316 | ||
1317 | int | |
104c1213 | 1318 | gdbarch_fp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1319 | { |
1320 | if (gdbarch->fp_regnum == -1) | |
96baa820 | 1321 | internal_error ("gdbarch: gdbarch_fp_regnum invalid"); |
0f71a2f6 | 1322 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1323 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n"); |
1324 | return gdbarch->fp_regnum; | |
1325 | } | |
1326 | ||
1327 | void | |
104c1213 JM |
1328 | set_gdbarch_fp_regnum (struct gdbarch *gdbarch, |
1329 | int fp_regnum) | |
0f71a2f6 JM |
1330 | { |
1331 | gdbarch->fp_regnum = fp_regnum; | |
1332 | } | |
1333 | ||
1334 | int | |
104c1213 | 1335 | gdbarch_pc_regnum (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1336 | { |
1337 | if (gdbarch->pc_regnum == -1) | |
96baa820 | 1338 | internal_error ("gdbarch: gdbarch_pc_regnum invalid"); |
0f71a2f6 | 1339 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1340 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); |
1341 | return gdbarch->pc_regnum; | |
1342 | } | |
1343 | ||
1344 | void | |
104c1213 JM |
1345 | set_gdbarch_pc_regnum (struct gdbarch *gdbarch, |
1346 | int pc_regnum) | |
0f71a2f6 JM |
1347 | { |
1348 | gdbarch->pc_regnum = pc_regnum; | |
1349 | } | |
1350 | ||
03863182 AC |
1351 | int |
1352 | gdbarch_npc_regnum (struct gdbarch *gdbarch) | |
1353 | { | |
1354 | /* Skip verify of npc_regnum, invalid_p == 0 */ | |
1355 | if (gdbarch_debug >= 2) | |
1356 | fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n"); | |
1357 | return gdbarch->npc_regnum; | |
1358 | } | |
1359 | ||
1360 | void | |
1361 | set_gdbarch_npc_regnum (struct gdbarch *gdbarch, | |
1362 | int npc_regnum) | |
1363 | { | |
1364 | gdbarch->npc_regnum = npc_regnum; | |
1365 | } | |
1366 | ||
1367 | int | |
1368 | gdbarch_nnpc_regnum (struct gdbarch *gdbarch) | |
1369 | { | |
1370 | /* Skip verify of nnpc_regnum, invalid_p == 0 */ | |
1371 | if (gdbarch_debug >= 2) | |
1372 | fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n"); | |
1373 | return gdbarch->nnpc_regnum; | |
1374 | } | |
1375 | ||
1376 | void | |
1377 | set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, | |
1378 | int nnpc_regnum) | |
1379 | { | |
1380 | gdbarch->nnpc_regnum = nnpc_regnum; | |
1381 | } | |
1382 | ||
0f71a2f6 JM |
1383 | char * |
1384 | gdbarch_register_name (struct gdbarch *gdbarch, int regnr) | |
1385 | { | |
7be570e7 | 1386 | if (gdbarch->register_name == 0) |
96baa820 | 1387 | internal_error ("gdbarch: gdbarch_register_name invalid"); |
0f71a2f6 | 1388 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1389 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); |
1390 | return gdbarch->register_name (regnr); | |
1391 | } | |
1392 | ||
1393 | void | |
104c1213 JM |
1394 | set_gdbarch_register_name (struct gdbarch *gdbarch, |
1395 | gdbarch_register_name_ftype register_name) | |
0f71a2f6 JM |
1396 | { |
1397 | gdbarch->register_name = register_name; | |
1398 | } | |
1399 | ||
1400 | int | |
104c1213 | 1401 | gdbarch_register_size (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1402 | { |
1403 | if (gdbarch->register_size == -1) | |
96baa820 | 1404 | internal_error ("gdbarch: gdbarch_register_size invalid"); |
0f71a2f6 | 1405 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1406 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n"); |
1407 | return gdbarch->register_size; | |
1408 | } | |
1409 | ||
1410 | void | |
104c1213 JM |
1411 | set_gdbarch_register_size (struct gdbarch *gdbarch, |
1412 | int register_size) | |
0f71a2f6 JM |
1413 | { |
1414 | gdbarch->register_size = register_size; | |
1415 | } | |
1416 | ||
1417 | int | |
104c1213 | 1418 | gdbarch_register_bytes (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1419 | { |
1420 | if (gdbarch->register_bytes == -1) | |
96baa820 | 1421 | internal_error ("gdbarch: gdbarch_register_bytes invalid"); |
0f71a2f6 | 1422 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1423 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n"); |
1424 | return gdbarch->register_bytes; | |
1425 | } | |
1426 | ||
1427 | void | |
104c1213 JM |
1428 | set_gdbarch_register_bytes (struct gdbarch *gdbarch, |
1429 | int register_bytes) | |
0f71a2f6 JM |
1430 | { |
1431 | gdbarch->register_bytes = register_bytes; | |
1432 | } | |
1433 | ||
1434 | int | |
1435 | gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr) | |
1436 | { | |
1437 | if (gdbarch->register_byte == 0) | |
96baa820 | 1438 | internal_error ("gdbarch: gdbarch_register_byte invalid"); |
0f71a2f6 | 1439 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1440 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n"); |
1441 | return gdbarch->register_byte (reg_nr); | |
1442 | } | |
1443 | ||
1444 | void | |
104c1213 JM |
1445 | set_gdbarch_register_byte (struct gdbarch *gdbarch, |
1446 | gdbarch_register_byte_ftype register_byte) | |
0f71a2f6 JM |
1447 | { |
1448 | gdbarch->register_byte = register_byte; | |
1449 | } | |
1450 | ||
1451 | int | |
1452 | gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr) | |
1453 | { | |
1454 | if (gdbarch->register_raw_size == 0) | |
96baa820 | 1455 | internal_error ("gdbarch: gdbarch_register_raw_size invalid"); |
0f71a2f6 | 1456 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1457 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n"); |
1458 | return gdbarch->register_raw_size (reg_nr); | |
1459 | } | |
1460 | ||
1461 | void | |
104c1213 JM |
1462 | set_gdbarch_register_raw_size (struct gdbarch *gdbarch, |
1463 | gdbarch_register_raw_size_ftype register_raw_size) | |
0f71a2f6 JM |
1464 | { |
1465 | gdbarch->register_raw_size = register_raw_size; | |
1466 | } | |
1467 | ||
1468 | int | |
104c1213 | 1469 | gdbarch_max_register_raw_size (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1470 | { |
1471 | if (gdbarch->max_register_raw_size == -1) | |
96baa820 | 1472 | internal_error ("gdbarch: gdbarch_max_register_raw_size invalid"); |
0f71a2f6 | 1473 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1474 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n"); |
1475 | return gdbarch->max_register_raw_size; | |
1476 | } | |
1477 | ||
1478 | void | |
104c1213 JM |
1479 | set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, |
1480 | int max_register_raw_size) | |
0f71a2f6 JM |
1481 | { |
1482 | gdbarch->max_register_raw_size = max_register_raw_size; | |
1483 | } | |
1484 | ||
1485 | int | |
1486 | gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) | |
1487 | { | |
1488 | if (gdbarch->register_virtual_size == 0) | |
96baa820 | 1489 | internal_error ("gdbarch: gdbarch_register_virtual_size invalid"); |
0f71a2f6 | 1490 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1491 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n"); |
1492 | return gdbarch->register_virtual_size (reg_nr); | |
1493 | } | |
1494 | ||
1495 | void | |
104c1213 JM |
1496 | set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, |
1497 | gdbarch_register_virtual_size_ftype register_virtual_size) | |
0f71a2f6 JM |
1498 | { |
1499 | gdbarch->register_virtual_size = register_virtual_size; | |
1500 | } | |
1501 | ||
1502 | int | |
104c1213 | 1503 | gdbarch_max_register_virtual_size (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1504 | { |
1505 | if (gdbarch->max_register_virtual_size == -1) | |
96baa820 | 1506 | internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid"); |
0f71a2f6 | 1507 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1508 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n"); |
1509 | return gdbarch->max_register_virtual_size; | |
1510 | } | |
1511 | ||
1512 | void | |
104c1213 JM |
1513 | set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, |
1514 | int max_register_virtual_size) | |
0f71a2f6 JM |
1515 | { |
1516 | gdbarch->max_register_virtual_size = max_register_virtual_size; | |
1517 | } | |
1518 | ||
1519 | struct type * | |
1520 | gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) | |
1521 | { | |
1522 | if (gdbarch->register_virtual_type == 0) | |
96baa820 | 1523 | internal_error ("gdbarch: gdbarch_register_virtual_type invalid"); |
0f71a2f6 | 1524 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1525 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n"); |
1526 | return gdbarch->register_virtual_type (reg_nr); | |
1527 | } | |
1528 | ||
1529 | void | |
104c1213 JM |
1530 | set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, |
1531 | gdbarch_register_virtual_type_ftype register_virtual_type) | |
0f71a2f6 JM |
1532 | { |
1533 | gdbarch->register_virtual_type = register_virtual_type; | |
1534 | } | |
1535 | ||
1536 | int | |
104c1213 | 1537 | gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1538 | { |
1539 | if (gdbarch->use_generic_dummy_frames == -1) | |
96baa820 | 1540 | internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid"); |
0f71a2f6 | 1541 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1542 | fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n"); |
1543 | return gdbarch->use_generic_dummy_frames; | |
1544 | } | |
1545 | ||
1546 | void | |
104c1213 JM |
1547 | set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, |
1548 | int use_generic_dummy_frames) | |
0f71a2f6 JM |
1549 | { |
1550 | gdbarch->use_generic_dummy_frames = use_generic_dummy_frames; | |
1551 | } | |
1552 | ||
1553 | int | |
104c1213 | 1554 | gdbarch_call_dummy_location (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1555 | { |
1556 | if (gdbarch->call_dummy_location == 0) | |
96baa820 | 1557 | internal_error ("gdbarch: gdbarch_call_dummy_location invalid"); |
0f71a2f6 | 1558 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1559 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); |
1560 | return gdbarch->call_dummy_location; | |
1561 | } | |
1562 | ||
1563 | void | |
104c1213 JM |
1564 | set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, |
1565 | int call_dummy_location) | |
0f71a2f6 JM |
1566 | { |
1567 | gdbarch->call_dummy_location = call_dummy_location; | |
1568 | } | |
1569 | ||
1570 | CORE_ADDR | |
1571 | gdbarch_call_dummy_address (struct gdbarch *gdbarch) | |
1572 | { | |
1573 | if (gdbarch->call_dummy_address == 0) | |
96baa820 | 1574 | internal_error ("gdbarch: gdbarch_call_dummy_address invalid"); |
0f71a2f6 | 1575 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1576 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n"); |
1577 | return gdbarch->call_dummy_address (); | |
1578 | } | |
1579 | ||
1580 | void | |
104c1213 JM |
1581 | set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, |
1582 | gdbarch_call_dummy_address_ftype call_dummy_address) | |
0f71a2f6 JM |
1583 | { |
1584 | gdbarch->call_dummy_address = call_dummy_address; | |
1585 | } | |
1586 | ||
1587 | CORE_ADDR | |
104c1213 | 1588 | gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1589 | { |
1590 | if (gdbarch->call_dummy_start_offset == -1) | |
96baa820 | 1591 | internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid"); |
0f71a2f6 | 1592 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1593 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n"); |
1594 | return gdbarch->call_dummy_start_offset; | |
1595 | } | |
1596 | ||
1597 | void | |
104c1213 JM |
1598 | set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, |
1599 | CORE_ADDR call_dummy_start_offset) | |
0f71a2f6 JM |
1600 | { |
1601 | gdbarch->call_dummy_start_offset = call_dummy_start_offset; | |
1602 | } | |
1603 | ||
1604 | CORE_ADDR | |
104c1213 | 1605 | gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1606 | { |
1607 | if (gdbarch->call_dummy_breakpoint_offset == -1) | |
96baa820 | 1608 | internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid"); |
0f71a2f6 | 1609 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1610 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n"); |
1611 | return gdbarch->call_dummy_breakpoint_offset; | |
1612 | } | |
1613 | ||
1614 | void | |
104c1213 JM |
1615 | set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, |
1616 | CORE_ADDR call_dummy_breakpoint_offset) | |
0f71a2f6 JM |
1617 | { |
1618 | gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset; | |
1619 | } | |
1620 | ||
1621 | int | |
104c1213 | 1622 | gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1623 | { |
1624 | if (gdbarch->call_dummy_breakpoint_offset_p == -1) | |
96baa820 | 1625 | internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid"); |
0f71a2f6 | 1626 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1627 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n"); |
1628 | return gdbarch->call_dummy_breakpoint_offset_p; | |
1629 | } | |
1630 | ||
1631 | void | |
104c1213 JM |
1632 | set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, |
1633 | int call_dummy_breakpoint_offset_p) | |
0f71a2f6 JM |
1634 | { |
1635 | gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p; | |
1636 | } | |
1637 | ||
1638 | int | |
104c1213 | 1639 | gdbarch_call_dummy_length (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1640 | { |
1641 | if (gdbarch->call_dummy_length == -1) | |
96baa820 | 1642 | internal_error ("gdbarch: gdbarch_call_dummy_length invalid"); |
0f71a2f6 | 1643 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1644 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n"); |
1645 | return gdbarch->call_dummy_length; | |
1646 | } | |
1647 | ||
1648 | void | |
104c1213 JM |
1649 | set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, |
1650 | int call_dummy_length) | |
0f71a2f6 JM |
1651 | { |
1652 | gdbarch->call_dummy_length = call_dummy_length; | |
1653 | } | |
1654 | ||
1655 | int | |
1656 | gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) | |
1657 | { | |
1658 | if (gdbarch->pc_in_call_dummy == 0) | |
96baa820 | 1659 | internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid"); |
0f71a2f6 | 1660 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1661 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n"); |
1662 | return gdbarch->pc_in_call_dummy (pc, sp, frame_address); | |
1663 | } | |
1664 | ||
1665 | void | |
104c1213 JM |
1666 | set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, |
1667 | gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy) | |
0f71a2f6 JM |
1668 | { |
1669 | gdbarch->pc_in_call_dummy = pc_in_call_dummy; | |
1670 | } | |
1671 | ||
1672 | int | |
104c1213 | 1673 | gdbarch_call_dummy_p (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1674 | { |
1675 | if (gdbarch->call_dummy_p == -1) | |
96baa820 | 1676 | internal_error ("gdbarch: gdbarch_call_dummy_p invalid"); |
0f71a2f6 | 1677 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1678 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n"); |
1679 | return gdbarch->call_dummy_p; | |
1680 | } | |
1681 | ||
1682 | void | |
104c1213 JM |
1683 | set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, |
1684 | int call_dummy_p) | |
0f71a2f6 JM |
1685 | { |
1686 | gdbarch->call_dummy_p = call_dummy_p; | |
1687 | } | |
1688 | ||
1689 | LONGEST * | |
104c1213 | 1690 | gdbarch_call_dummy_words (struct gdbarch *gdbarch) |
0f71a2f6 | 1691 | { |
c0e8c252 | 1692 | /* Skip verify of call_dummy_words, invalid_p == 0 */ |
0f71a2f6 | 1693 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1694 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n"); |
1695 | return gdbarch->call_dummy_words; | |
1696 | } | |
1697 | ||
1698 | void | |
104c1213 JM |
1699 | set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, |
1700 | LONGEST * call_dummy_words) | |
0f71a2f6 JM |
1701 | { |
1702 | gdbarch->call_dummy_words = call_dummy_words; | |
1703 | } | |
1704 | ||
1705 | int | |
104c1213 | 1706 | gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch) |
0f71a2f6 | 1707 | { |
c0e8c252 | 1708 | /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ |
0f71a2f6 | 1709 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1710 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n"); |
1711 | return gdbarch->sizeof_call_dummy_words; | |
1712 | } | |
1713 | ||
1714 | void | |
104c1213 JM |
1715 | set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, |
1716 | int sizeof_call_dummy_words) | |
0f71a2f6 JM |
1717 | { |
1718 | gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words; | |
1719 | } | |
1720 | ||
1721 | int | |
104c1213 | 1722 | gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1723 | { |
1724 | if (gdbarch->call_dummy_stack_adjust_p == -1) | |
96baa820 | 1725 | internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid"); |
0f71a2f6 | 1726 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1727 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n"); |
1728 | return gdbarch->call_dummy_stack_adjust_p; | |
1729 | } | |
1730 | ||
1731 | void | |
104c1213 JM |
1732 | set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, |
1733 | int call_dummy_stack_adjust_p) | |
0f71a2f6 JM |
1734 | { |
1735 | gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p; | |
1736 | } | |
1737 | ||
1738 | int | |
104c1213 | 1739 | gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1740 | { |
1741 | if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0) | |
96baa820 | 1742 | internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid"); |
0f71a2f6 | 1743 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1744 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n"); |
1745 | return gdbarch->call_dummy_stack_adjust; | |
1746 | } | |
1747 | ||
1748 | void | |
104c1213 JM |
1749 | set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, |
1750 | int call_dummy_stack_adjust) | |
0f71a2f6 JM |
1751 | { |
1752 | gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust; | |
1753 | } | |
1754 | ||
1755 | void | |
1756 | gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) | |
1757 | { | |
1758 | if (gdbarch->fix_call_dummy == 0) | |
96baa820 | 1759 | internal_error ("gdbarch: gdbarch_fix_call_dummy invalid"); |
0f71a2f6 | 1760 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1761 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n"); |
1762 | gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); | |
1763 | } | |
1764 | ||
1765 | void | |
104c1213 JM |
1766 | set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, |
1767 | gdbarch_fix_call_dummy_ftype fix_call_dummy) | |
0f71a2f6 JM |
1768 | { |
1769 | gdbarch->fix_call_dummy = fix_call_dummy; | |
1770 | } | |
1771 | ||
1772 | int | |
104c1213 | 1773 | gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1774 | { |
1775 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
1776 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n"); |
1777 | return gdbarch->believe_pcc_promotion; | |
1778 | } | |
1779 | ||
1780 | void | |
104c1213 JM |
1781 | set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, |
1782 | int believe_pcc_promotion) | |
0f71a2f6 JM |
1783 | { |
1784 | gdbarch->believe_pcc_promotion = believe_pcc_promotion; | |
1785 | } | |
1786 | ||
1787 | int | |
104c1213 | 1788 | gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1789 | { |
1790 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
1791 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n"); |
1792 | return gdbarch->believe_pcc_promotion_type; | |
1793 | } | |
1794 | ||
1795 | void | |
104c1213 JM |
1796 | set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, |
1797 | int believe_pcc_promotion_type) | |
0f71a2f6 JM |
1798 | { |
1799 | gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type; | |
1800 | } | |
1801 | ||
b9a8e3bf JB |
1802 | int |
1803 | gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual) | |
1804 | { | |
1805 | if (gdbarch->coerce_float_to_double == 0) | |
1806 | internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid"); | |
1807 | if (gdbarch_debug >= 2) | |
b9a8e3bf JB |
1808 | fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n"); |
1809 | return gdbarch->coerce_float_to_double (formal, actual); | |
1810 | } | |
1811 | ||
1812 | void | |
1813 | set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, | |
1814 | gdbarch_coerce_float_to_double_ftype coerce_float_to_double) | |
1815 | { | |
1816 | gdbarch->coerce_float_to_double = coerce_float_to_double; | |
1817 | } | |
1818 | ||
0f71a2f6 | 1819 | void |
adf40b2e | 1820 | gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval) |
0f71a2f6 JM |
1821 | { |
1822 | if (gdbarch->get_saved_register == 0) | |
96baa820 | 1823 | internal_error ("gdbarch: gdbarch_get_saved_register invalid"); |
0f71a2f6 | 1824 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1825 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n"); |
1826 | gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval); | |
1827 | } | |
1828 | ||
1829 | void | |
104c1213 JM |
1830 | set_gdbarch_get_saved_register (struct gdbarch *gdbarch, |
1831 | gdbarch_get_saved_register_ftype get_saved_register) | |
0f71a2f6 JM |
1832 | { |
1833 | gdbarch->get_saved_register = get_saved_register; | |
1834 | } | |
1835 | ||
1836 | int | |
1837 | gdbarch_register_convertible (struct gdbarch *gdbarch, int nr) | |
1838 | { | |
1839 | if (gdbarch->register_convertible == 0) | |
96baa820 | 1840 | internal_error ("gdbarch: gdbarch_register_convertible invalid"); |
0f71a2f6 | 1841 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1842 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n"); |
1843 | return gdbarch->register_convertible (nr); | |
1844 | } | |
1845 | ||
1846 | void | |
104c1213 JM |
1847 | set_gdbarch_register_convertible (struct gdbarch *gdbarch, |
1848 | gdbarch_register_convertible_ftype register_convertible) | |
0f71a2f6 JM |
1849 | { |
1850 | gdbarch->register_convertible = register_convertible; | |
1851 | } | |
1852 | ||
1853 | void | |
1854 | gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) | |
1855 | { | |
1856 | if (gdbarch->register_convert_to_virtual == 0) | |
96baa820 | 1857 | internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid"); |
0f71a2f6 | 1858 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1859 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n"); |
1860 | gdbarch->register_convert_to_virtual (regnum, type, from, to); | |
1861 | } | |
1862 | ||
1863 | void | |
104c1213 JM |
1864 | set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, |
1865 | gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual) | |
0f71a2f6 JM |
1866 | { |
1867 | gdbarch->register_convert_to_virtual = register_convert_to_virtual; | |
1868 | } | |
1869 | ||
1870 | void | |
1871 | gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to) | |
1872 | { | |
1873 | if (gdbarch->register_convert_to_raw == 0) | |
96baa820 | 1874 | internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid"); |
0f71a2f6 | 1875 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1876 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n"); |
1877 | gdbarch->register_convert_to_raw (type, regnum, from, to); | |
1878 | } | |
1879 | ||
1880 | void | |
104c1213 JM |
1881 | set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, |
1882 | gdbarch_register_convert_to_raw_ftype register_convert_to_raw) | |
0f71a2f6 JM |
1883 | { |
1884 | gdbarch->register_convert_to_raw = register_convert_to_raw; | |
1885 | } | |
1886 | ||
4478b372 JB |
1887 | CORE_ADDR |
1888 | gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, char *buf) | |
1889 | { | |
1890 | if (gdbarch->pointer_to_address == 0) | |
1891 | internal_error ("gdbarch: gdbarch_pointer_to_address invalid"); | |
1892 | if (gdbarch_debug >= 2) | |
1893 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); | |
1894 | return gdbarch->pointer_to_address (type, buf); | |
1895 | } | |
1896 | ||
1897 | void | |
1898 | set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, | |
1899 | gdbarch_pointer_to_address_ftype pointer_to_address) | |
1900 | { | |
1901 | gdbarch->pointer_to_address = pointer_to_address; | |
1902 | } | |
1903 | ||
1904 | void | |
1905 | gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, char *buf, CORE_ADDR addr) | |
1906 | { | |
1907 | if (gdbarch->address_to_pointer == 0) | |
1908 | internal_error ("gdbarch: gdbarch_address_to_pointer invalid"); | |
1909 | if (gdbarch_debug >= 2) | |
1910 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); | |
1911 | gdbarch->address_to_pointer (type, buf, addr); | |
1912 | } | |
1913 | ||
1914 | void | |
1915 | set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, | |
1916 | gdbarch_address_to_pointer_ftype address_to_pointer) | |
1917 | { | |
1918 | gdbarch->address_to_pointer = address_to_pointer; | |
1919 | } | |
1920 | ||
71a9f22e JB |
1921 | int |
1922 | gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type) | |
1923 | { | |
71a9f22e JB |
1924 | if (gdbarch->return_value_on_stack == 0) |
1925 | internal_error ("gdbarch: gdbarch_return_value_on_stack invalid"); | |
1926 | if (gdbarch_debug >= 2) | |
1927 | fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n"); | |
1928 | return gdbarch->return_value_on_stack (type); | |
1929 | } | |
1930 | ||
1931 | void | |
1932 | set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, | |
1933 | gdbarch_return_value_on_stack_ftype return_value_on_stack) | |
1934 | { | |
1935 | gdbarch->return_value_on_stack = return_value_on_stack; | |
1936 | } | |
1937 | ||
0f71a2f6 JM |
1938 | void |
1939 | gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) | |
1940 | { | |
1941 | if (gdbarch->extract_return_value == 0) | |
96baa820 | 1942 | internal_error ("gdbarch: gdbarch_extract_return_value invalid"); |
0f71a2f6 | 1943 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1944 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); |
1945 | gdbarch->extract_return_value (type, regbuf, valbuf); | |
1946 | } | |
1947 | ||
1948 | void | |
104c1213 JM |
1949 | set_gdbarch_extract_return_value (struct gdbarch *gdbarch, |
1950 | gdbarch_extract_return_value_ftype extract_return_value) | |
0f71a2f6 JM |
1951 | { |
1952 | gdbarch->extract_return_value = extract_return_value; | |
1953 | } | |
1954 | ||
1955 | CORE_ADDR | |
1956 | gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) | |
1957 | { | |
1958 | if (gdbarch->push_arguments == 0) | |
96baa820 | 1959 | internal_error ("gdbarch: gdbarch_push_arguments invalid"); |
0f71a2f6 | 1960 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1961 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n"); |
1962 | return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr); | |
1963 | } | |
1964 | ||
1965 | void | |
104c1213 JM |
1966 | set_gdbarch_push_arguments (struct gdbarch *gdbarch, |
1967 | gdbarch_push_arguments_ftype push_arguments) | |
0f71a2f6 JM |
1968 | { |
1969 | gdbarch->push_arguments = push_arguments; | |
1970 | } | |
1971 | ||
1972 | void | |
1973 | gdbarch_push_dummy_frame (struct gdbarch *gdbarch) | |
1974 | { | |
1975 | if (gdbarch->push_dummy_frame == 0) | |
96baa820 | 1976 | internal_error ("gdbarch: gdbarch_push_dummy_frame invalid"); |
0f71a2f6 | 1977 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1978 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n"); |
1979 | gdbarch->push_dummy_frame (); | |
1980 | } | |
1981 | ||
1982 | void | |
104c1213 JM |
1983 | set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, |
1984 | gdbarch_push_dummy_frame_ftype push_dummy_frame) | |
0f71a2f6 JM |
1985 | { |
1986 | gdbarch->push_dummy_frame = push_dummy_frame; | |
1987 | } | |
1988 | ||
1989 | CORE_ADDR | |
1990 | gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) | |
1991 | { | |
1992 | if (gdbarch->push_return_address == 0) | |
96baa820 | 1993 | internal_error ("gdbarch: gdbarch_push_return_address invalid"); |
0f71a2f6 | 1994 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1995 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n"); |
1996 | return gdbarch->push_return_address (pc, sp); | |
1997 | } | |
1998 | ||
1999 | void | |
104c1213 JM |
2000 | set_gdbarch_push_return_address (struct gdbarch *gdbarch, |
2001 | gdbarch_push_return_address_ftype push_return_address) | |
0f71a2f6 JM |
2002 | { |
2003 | gdbarch->push_return_address = push_return_address; | |
2004 | } | |
2005 | ||
2006 | void | |
2007 | gdbarch_pop_frame (struct gdbarch *gdbarch) | |
2008 | { | |
2009 | if (gdbarch->pop_frame == 0) | |
96baa820 | 2010 | internal_error ("gdbarch: gdbarch_pop_frame invalid"); |
0f71a2f6 | 2011 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2012 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n"); |
2013 | gdbarch->pop_frame (); | |
2014 | } | |
2015 | ||
2016 | void | |
104c1213 JM |
2017 | set_gdbarch_pop_frame (struct gdbarch *gdbarch, |
2018 | gdbarch_pop_frame_ftype pop_frame) | |
0f71a2f6 JM |
2019 | { |
2020 | gdbarch->pop_frame = pop_frame; | |
2021 | } | |
2022 | ||
2023 | CORE_ADDR | |
2024 | gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x) | |
2025 | { | |
2026 | if (gdbarch->d10v_make_daddr == 0) | |
96baa820 | 2027 | internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid"); |
0f71a2f6 | 2028 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2029 | fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n"); |
2030 | return gdbarch->d10v_make_daddr (x); | |
2031 | } | |
2032 | ||
2033 | void | |
104c1213 JM |
2034 | set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, |
2035 | gdbarch_d10v_make_daddr_ftype d10v_make_daddr) | |
0f71a2f6 JM |
2036 | { |
2037 | gdbarch->d10v_make_daddr = d10v_make_daddr; | |
2038 | } | |
2039 | ||
2040 | CORE_ADDR | |
2041 | gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x) | |
2042 | { | |
2043 | if (gdbarch->d10v_make_iaddr == 0) | |
96baa820 | 2044 | internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid"); |
0f71a2f6 | 2045 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2046 | fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n"); |
2047 | return gdbarch->d10v_make_iaddr (x); | |
2048 | } | |
2049 | ||
2050 | void | |
104c1213 JM |
2051 | set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, |
2052 | gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr) | |
0f71a2f6 JM |
2053 | { |
2054 | gdbarch->d10v_make_iaddr = d10v_make_iaddr; | |
2055 | } | |
2056 | ||
2057 | int | |
2058 | gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x) | |
2059 | { | |
2060 | if (gdbarch->d10v_daddr_p == 0) | |
96baa820 | 2061 | internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid"); |
0f71a2f6 | 2062 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2063 | fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n"); |
2064 | return gdbarch->d10v_daddr_p (x); | |
2065 | } | |
2066 | ||
2067 | void | |
104c1213 JM |
2068 | set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, |
2069 | gdbarch_d10v_daddr_p_ftype d10v_daddr_p) | |
0f71a2f6 JM |
2070 | { |
2071 | gdbarch->d10v_daddr_p = d10v_daddr_p; | |
2072 | } | |
2073 | ||
2074 | int | |
2075 | gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x) | |
2076 | { | |
2077 | if (gdbarch->d10v_iaddr_p == 0) | |
96baa820 | 2078 | internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid"); |
0f71a2f6 | 2079 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2080 | fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n"); |
2081 | return gdbarch->d10v_iaddr_p (x); | |
2082 | } | |
2083 | ||
2084 | void | |
104c1213 JM |
2085 | set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, |
2086 | gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p) | |
0f71a2f6 JM |
2087 | { |
2088 | gdbarch->d10v_iaddr_p = d10v_iaddr_p; | |
2089 | } | |
2090 | ||
2091 | CORE_ADDR | |
2092 | gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x) | |
2093 | { | |
2094 | if (gdbarch->d10v_convert_daddr_to_raw == 0) | |
96baa820 | 2095 | internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid"); |
0f71a2f6 | 2096 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2097 | fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n"); |
2098 | return gdbarch->d10v_convert_daddr_to_raw (x); | |
2099 | } | |
2100 | ||
2101 | void | |
104c1213 JM |
2102 | set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, |
2103 | gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw) | |
0f71a2f6 JM |
2104 | { |
2105 | gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw; | |
2106 | } | |
2107 | ||
2108 | CORE_ADDR | |
2109 | gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x) | |
2110 | { | |
2111 | if (gdbarch->d10v_convert_iaddr_to_raw == 0) | |
96baa820 | 2112 | internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid"); |
0f71a2f6 | 2113 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2114 | fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n"); |
2115 | return gdbarch->d10v_convert_iaddr_to_raw (x); | |
2116 | } | |
2117 | ||
2118 | void | |
104c1213 JM |
2119 | set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, |
2120 | gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw) | |
0f71a2f6 JM |
2121 | { |
2122 | gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw; | |
2123 | } | |
2124 | ||
2125 | void | |
2126 | gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) | |
2127 | { | |
2128 | if (gdbarch->store_struct_return == 0) | |
96baa820 | 2129 | internal_error ("gdbarch: gdbarch_store_struct_return invalid"); |
0f71a2f6 | 2130 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2131 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n"); |
2132 | gdbarch->store_struct_return (addr, sp); | |
2133 | } | |
2134 | ||
2135 | void | |
104c1213 JM |
2136 | set_gdbarch_store_struct_return (struct gdbarch *gdbarch, |
2137 | gdbarch_store_struct_return_ftype store_struct_return) | |
0f71a2f6 JM |
2138 | { |
2139 | gdbarch->store_struct_return = store_struct_return; | |
2140 | } | |
2141 | ||
2142 | void | |
2143 | gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) | |
2144 | { | |
2145 | if (gdbarch->store_return_value == 0) | |
96baa820 | 2146 | internal_error ("gdbarch: gdbarch_store_return_value invalid"); |
0f71a2f6 | 2147 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2148 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); |
2149 | gdbarch->store_return_value (type, valbuf); | |
2150 | } | |
2151 | ||
2152 | void | |
104c1213 JM |
2153 | set_gdbarch_store_return_value (struct gdbarch *gdbarch, |
2154 | gdbarch_store_return_value_ftype store_return_value) | |
0f71a2f6 JM |
2155 | { |
2156 | gdbarch->store_return_value = store_return_value; | |
2157 | } | |
2158 | ||
2159 | CORE_ADDR | |
2160 | gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf) | |
2161 | { | |
2162 | if (gdbarch->extract_struct_value_address == 0) | |
96baa820 | 2163 | internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid"); |
0f71a2f6 | 2164 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2165 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n"); |
2166 | return gdbarch->extract_struct_value_address (regbuf); | |
2167 | } | |
2168 | ||
2169 | void | |
104c1213 JM |
2170 | set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, |
2171 | gdbarch_extract_struct_value_address_ftype extract_struct_value_address) | |
0f71a2f6 JM |
2172 | { |
2173 | gdbarch->extract_struct_value_address = extract_struct_value_address; | |
2174 | } | |
2175 | ||
2176 | int | |
2177 | gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type) | |
2178 | { | |
2179 | if (gdbarch->use_struct_convention == 0) | |
96baa820 | 2180 | internal_error ("gdbarch: gdbarch_use_struct_convention invalid"); |
0f71a2f6 | 2181 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2182 | fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n"); |
2183 | return gdbarch->use_struct_convention (gcc_p, value_type); | |
2184 | } | |
2185 | ||
2186 | void | |
104c1213 JM |
2187 | set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, |
2188 | gdbarch_use_struct_convention_ftype use_struct_convention) | |
0f71a2f6 JM |
2189 | { |
2190 | gdbarch->use_struct_convention = use_struct_convention; | |
2191 | } | |
2192 | ||
2193 | void | |
2194 | gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) | |
2195 | { | |
2196 | if (gdbarch->frame_init_saved_regs == 0) | |
96baa820 | 2197 | internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid"); |
0f71a2f6 | 2198 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2199 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n"); |
2200 | gdbarch->frame_init_saved_regs (frame); | |
2201 | } | |
2202 | ||
2203 | void | |
104c1213 JM |
2204 | set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, |
2205 | gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs) | |
0f71a2f6 JM |
2206 | { |
2207 | gdbarch->frame_init_saved_regs = frame_init_saved_regs; | |
2208 | } | |
2209 | ||
2210 | void | |
2211 | gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame) | |
2212 | { | |
2213 | if (gdbarch->init_extra_frame_info == 0) | |
96baa820 | 2214 | internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid"); |
0f71a2f6 | 2215 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2216 | fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n"); |
2217 | gdbarch->init_extra_frame_info (fromleaf, frame); | |
2218 | } | |
2219 | ||
2220 | void | |
104c1213 JM |
2221 | set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, |
2222 | gdbarch_init_extra_frame_info_ftype init_extra_frame_info) | |
0f71a2f6 JM |
2223 | { |
2224 | gdbarch->init_extra_frame_info = init_extra_frame_info; | |
2225 | } | |
2226 | ||
2227 | CORE_ADDR | |
2228 | gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) | |
2229 | { | |
2230 | if (gdbarch->skip_prologue == 0) | |
96baa820 | 2231 | internal_error ("gdbarch: gdbarch_skip_prologue invalid"); |
0f71a2f6 | 2232 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2233 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); |
2234 | return gdbarch->skip_prologue (ip); | |
2235 | } | |
2236 | ||
2237 | void | |
104c1213 JM |
2238 | set_gdbarch_skip_prologue (struct gdbarch *gdbarch, |
2239 | gdbarch_skip_prologue_ftype skip_prologue) | |
0f71a2f6 JM |
2240 | { |
2241 | gdbarch->skip_prologue = skip_prologue; | |
2242 | } | |
2243 | ||
dad41f9a AC |
2244 | int |
2245 | gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip) | |
2246 | { | |
dad41f9a AC |
2247 | if (gdbarch->prologue_frameless_p == 0) |
2248 | internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid"); | |
2249 | if (gdbarch_debug >= 2) | |
2250 | fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n"); | |
2251 | return gdbarch->prologue_frameless_p (ip); | |
2252 | } | |
2253 | ||
2254 | void | |
2255 | set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, | |
2256 | gdbarch_prologue_frameless_p_ftype prologue_frameless_p) | |
2257 | { | |
2258 | gdbarch->prologue_frameless_p = prologue_frameless_p; | |
2259 | } | |
2260 | ||
0f71a2f6 JM |
2261 | int |
2262 | gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) | |
2263 | { | |
2264 | if (gdbarch->inner_than == 0) | |
96baa820 | 2265 | internal_error ("gdbarch: gdbarch_inner_than invalid"); |
0f71a2f6 | 2266 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2267 | fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); |
2268 | return gdbarch->inner_than (lhs, rhs); | |
2269 | } | |
2270 | ||
2271 | void | |
104c1213 JM |
2272 | set_gdbarch_inner_than (struct gdbarch *gdbarch, |
2273 | gdbarch_inner_than_ftype inner_than) | |
0f71a2f6 JM |
2274 | { |
2275 | gdbarch->inner_than = inner_than; | |
2276 | } | |
2277 | ||
2278 | unsigned char * | |
adf40b2e | 2279 | gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) |
0f71a2f6 JM |
2280 | { |
2281 | if (gdbarch->breakpoint_from_pc == 0) | |
96baa820 | 2282 | internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid"); |
0f71a2f6 | 2283 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2284 | fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); |
2285 | return gdbarch->breakpoint_from_pc (pcptr, lenptr); | |
2286 | } | |
2287 | ||
2288 | void | |
104c1213 JM |
2289 | set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, |
2290 | gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc) | |
0f71a2f6 JM |
2291 | { |
2292 | gdbarch->breakpoint_from_pc = breakpoint_from_pc; | |
2293 | } | |
2294 | ||
917317f4 JM |
2295 | int |
2296 | gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) | |
2297 | { | |
2298 | if (gdbarch->memory_insert_breakpoint == 0) | |
2299 | internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid"); | |
2300 | if (gdbarch_debug >= 2) | |
917317f4 JM |
2301 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); |
2302 | return gdbarch->memory_insert_breakpoint (addr, contents_cache); | |
2303 | } | |
2304 | ||
2305 | void | |
2306 | set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, | |
2307 | gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint) | |
2308 | { | |
2309 | gdbarch->memory_insert_breakpoint = memory_insert_breakpoint; | |
2310 | } | |
2311 | ||
2312 | int | |
2313 | gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) | |
2314 | { | |
2315 | if (gdbarch->memory_remove_breakpoint == 0) | |
2316 | internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid"); | |
2317 | if (gdbarch_debug >= 2) | |
917317f4 JM |
2318 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); |
2319 | return gdbarch->memory_remove_breakpoint (addr, contents_cache); | |
2320 | } | |
2321 | ||
2322 | void | |
2323 | set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, | |
2324 | gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint) | |
2325 | { | |
2326 | gdbarch->memory_remove_breakpoint = memory_remove_breakpoint; | |
2327 | } | |
2328 | ||
0f71a2f6 | 2329 | CORE_ADDR |
104c1213 | 2330 | gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2331 | { |
2332 | if (gdbarch->decr_pc_after_break == -1) | |
96baa820 | 2333 | internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid"); |
0f71a2f6 | 2334 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2335 | fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); |
2336 | return gdbarch->decr_pc_after_break; | |
2337 | } | |
2338 | ||
2339 | void | |
104c1213 JM |
2340 | set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, |
2341 | CORE_ADDR decr_pc_after_break) | |
0f71a2f6 JM |
2342 | { |
2343 | gdbarch->decr_pc_after_break = decr_pc_after_break; | |
2344 | } | |
2345 | ||
2346 | CORE_ADDR | |
104c1213 | 2347 | gdbarch_function_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2348 | { |
2349 | if (gdbarch->function_start_offset == -1) | |
96baa820 | 2350 | internal_error ("gdbarch: gdbarch_function_start_offset invalid"); |
0f71a2f6 | 2351 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2352 | fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n"); |
2353 | return gdbarch->function_start_offset; | |
2354 | } | |
2355 | ||
2356 | void | |
104c1213 JM |
2357 | set_gdbarch_function_start_offset (struct gdbarch *gdbarch, |
2358 | CORE_ADDR function_start_offset) | |
0f71a2f6 JM |
2359 | { |
2360 | gdbarch->function_start_offset = function_start_offset; | |
2361 | } | |
2362 | ||
2363 | void | |
adf40b2e | 2364 | gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len) |
0f71a2f6 JM |
2365 | { |
2366 | if (gdbarch->remote_translate_xfer_address == 0) | |
96baa820 | 2367 | internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid"); |
0f71a2f6 | 2368 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2369 | fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n"); |
2370 | gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len); | |
2371 | } | |
2372 | ||
2373 | void | |
104c1213 JM |
2374 | set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, |
2375 | gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address) | |
0f71a2f6 JM |
2376 | { |
2377 | gdbarch->remote_translate_xfer_address = remote_translate_xfer_address; | |
2378 | } | |
2379 | ||
2380 | CORE_ADDR | |
104c1213 | 2381 | gdbarch_frame_args_skip (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2382 | { |
2383 | if (gdbarch->frame_args_skip == -1) | |
96baa820 | 2384 | internal_error ("gdbarch: gdbarch_frame_args_skip invalid"); |
0f71a2f6 | 2385 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2386 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); |
2387 | return gdbarch->frame_args_skip; | |
2388 | } | |
2389 | ||
2390 | void | |
104c1213 JM |
2391 | set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, |
2392 | CORE_ADDR frame_args_skip) | |
0f71a2f6 JM |
2393 | { |
2394 | gdbarch->frame_args_skip = frame_args_skip; | |
2395 | } | |
2396 | ||
2397 | int | |
2398 | gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi) | |
2399 | { | |
2400 | if (gdbarch->frameless_function_invocation == 0) | |
96baa820 | 2401 | internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid"); |
0f71a2f6 | 2402 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2403 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n"); |
2404 | return gdbarch->frameless_function_invocation (fi); | |
2405 | } | |
2406 | ||
2407 | void | |
104c1213 JM |
2408 | set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, |
2409 | gdbarch_frameless_function_invocation_ftype frameless_function_invocation) | |
0f71a2f6 JM |
2410 | { |
2411 | gdbarch->frameless_function_invocation = frameless_function_invocation; | |
2412 | } | |
2413 | ||
2414 | CORE_ADDR | |
2415 | gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) | |
2416 | { | |
2417 | if (gdbarch->frame_chain == 0) | |
96baa820 | 2418 | internal_error ("gdbarch: gdbarch_frame_chain invalid"); |
0f71a2f6 | 2419 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2420 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n"); |
2421 | return gdbarch->frame_chain (frame); | |
2422 | } | |
2423 | ||
2424 | void | |
104c1213 JM |
2425 | set_gdbarch_frame_chain (struct gdbarch *gdbarch, |
2426 | gdbarch_frame_chain_ftype frame_chain) | |
0f71a2f6 JM |
2427 | { |
2428 | gdbarch->frame_chain = frame_chain; | |
2429 | } | |
2430 | ||
2431 | int | |
2432 | gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe) | |
2433 | { | |
2434 | if (gdbarch->frame_chain_valid == 0) | |
96baa820 | 2435 | internal_error ("gdbarch: gdbarch_frame_chain_valid invalid"); |
0f71a2f6 | 2436 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2437 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n"); |
2438 | return gdbarch->frame_chain_valid (chain, thisframe); | |
2439 | } | |
2440 | ||
2441 | void | |
104c1213 JM |
2442 | set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, |
2443 | gdbarch_frame_chain_valid_ftype frame_chain_valid) | |
0f71a2f6 JM |
2444 | { |
2445 | gdbarch->frame_chain_valid = frame_chain_valid; | |
2446 | } | |
2447 | ||
2448 | CORE_ADDR | |
2449 | gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi) | |
2450 | { | |
2451 | if (gdbarch->frame_saved_pc == 0) | |
96baa820 | 2452 | internal_error ("gdbarch: gdbarch_frame_saved_pc invalid"); |
0f71a2f6 | 2453 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2454 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n"); |
2455 | return gdbarch->frame_saved_pc (fi); | |
2456 | } | |
2457 | ||
2458 | void | |
104c1213 JM |
2459 | set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, |
2460 | gdbarch_frame_saved_pc_ftype frame_saved_pc) | |
0f71a2f6 JM |
2461 | { |
2462 | gdbarch->frame_saved_pc = frame_saved_pc; | |
2463 | } | |
2464 | ||
2465 | CORE_ADDR | |
2466 | gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) | |
2467 | { | |
2468 | if (gdbarch->frame_args_address == 0) | |
96baa820 | 2469 | internal_error ("gdbarch: gdbarch_frame_args_address invalid"); |
0f71a2f6 | 2470 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2471 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n"); |
2472 | return gdbarch->frame_args_address (fi); | |
2473 | } | |
2474 | ||
2475 | void | |
104c1213 JM |
2476 | set_gdbarch_frame_args_address (struct gdbarch *gdbarch, |
2477 | gdbarch_frame_args_address_ftype frame_args_address) | |
0f71a2f6 JM |
2478 | { |
2479 | gdbarch->frame_args_address = frame_args_address; | |
2480 | } | |
2481 | ||
2482 | CORE_ADDR | |
2483 | gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) | |
2484 | { | |
2485 | if (gdbarch->frame_locals_address == 0) | |
96baa820 | 2486 | internal_error ("gdbarch: gdbarch_frame_locals_address invalid"); |
0f71a2f6 | 2487 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2488 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n"); |
2489 | return gdbarch->frame_locals_address (fi); | |
2490 | } | |
2491 | ||
2492 | void | |
104c1213 JM |
2493 | set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, |
2494 | gdbarch_frame_locals_address_ftype frame_locals_address) | |
0f71a2f6 JM |
2495 | { |
2496 | gdbarch->frame_locals_address = frame_locals_address; | |
2497 | } | |
2498 | ||
2499 | CORE_ADDR | |
2500 | gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame) | |
2501 | { | |
2502 | if (gdbarch->saved_pc_after_call == 0) | |
96baa820 | 2503 | internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid"); |
0f71a2f6 | 2504 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2505 | fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n"); |
2506 | return gdbarch->saved_pc_after_call (frame); | |
2507 | } | |
2508 | ||
2509 | void | |
104c1213 JM |
2510 | set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, |
2511 | gdbarch_saved_pc_after_call_ftype saved_pc_after_call) | |
0f71a2f6 JM |
2512 | { |
2513 | gdbarch->saved_pc_after_call = saved_pc_after_call; | |
2514 | } | |
2515 | ||
2516 | int | |
2517 | gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) | |
2518 | { | |
2519 | if (gdbarch->frame_num_args == 0) | |
96baa820 | 2520 | internal_error ("gdbarch: gdbarch_frame_num_args invalid"); |
0f71a2f6 | 2521 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2522 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); |
2523 | return gdbarch->frame_num_args (frame); | |
2524 | } | |
2525 | ||
2526 | void | |
104c1213 JM |
2527 | set_gdbarch_frame_num_args (struct gdbarch *gdbarch, |
2528 | gdbarch_frame_num_args_ftype frame_num_args) | |
0f71a2f6 JM |
2529 | { |
2530 | gdbarch->frame_num_args = frame_num_args; | |
2531 | } | |
2532 | ||
2ada493a AC |
2533 | int |
2534 | gdbarch_stack_align_p (struct gdbarch *gdbarch) | |
2535 | { | |
2536 | return gdbarch->stack_align != 0; | |
2537 | } | |
2538 | ||
2539 | CORE_ADDR | |
2540 | gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp) | |
2541 | { | |
2542 | if (gdbarch->stack_align == 0) | |
2543 | internal_error ("gdbarch: gdbarch_stack_align invalid"); | |
2544 | if (gdbarch_debug >= 2) | |
2545 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n"); | |
2546 | return gdbarch->stack_align (sp); | |
2547 | } | |
2548 | ||
2549 | void | |
2550 | set_gdbarch_stack_align (struct gdbarch *gdbarch, | |
2551 | gdbarch_stack_align_ftype stack_align) | |
2552 | { | |
2553 | gdbarch->stack_align = stack_align; | |
2554 | } | |
2555 | ||
d03e67c9 AC |
2556 | int |
2557 | gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch) | |
2558 | { | |
2559 | return gdbarch->reg_struct_has_addr != 0; | |
2560 | } | |
2561 | ||
2562 | int | |
2563 | gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) | |
2564 | { | |
2565 | if (gdbarch->reg_struct_has_addr == 0) | |
2566 | internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid"); | |
2567 | if (gdbarch_debug >= 2) | |
2568 | fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n"); | |
2569 | return gdbarch->reg_struct_has_addr (gcc_p, type); | |
2570 | } | |
2571 | ||
2572 | void | |
2573 | set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, | |
2574 | gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr) | |
2575 | { | |
2576 | gdbarch->reg_struct_has_addr = reg_struct_has_addr; | |
2577 | } | |
2578 | ||
0f71a2f6 JM |
2579 | |
2580 | /* Keep a registrary of per-architecture data-pointers required by GDB | |
2581 | modules. */ | |
2582 | ||
2583 | struct gdbarch_data | |
2584 | { | |
2585 | int index; | |
2586 | }; | |
2587 | ||
2588 | struct gdbarch_data_registration | |
adf40b2e JM |
2589 | { |
2590 | gdbarch_data_ftype *init; | |
2591 | struct gdbarch_data *data; | |
2592 | struct gdbarch_data_registration *next; | |
2593 | }; | |
0f71a2f6 JM |
2594 | |
2595 | struct gdbarch_data_registrary | |
adf40b2e JM |
2596 | { |
2597 | int nr; | |
2598 | struct gdbarch_data_registration *registrations; | |
2599 | }; | |
0f71a2f6 JM |
2600 | |
2601 | struct gdbarch_data_registrary gdbarch_data_registrary = | |
2602 | { | |
2603 | 0, NULL, | |
2604 | }; | |
2605 | ||
2606 | struct gdbarch_data * | |
104c1213 | 2607 | register_gdbarch_data (gdbarch_data_ftype *init) |
0f71a2f6 JM |
2608 | { |
2609 | struct gdbarch_data_registration **curr; | |
2610 | for (curr = &gdbarch_data_registrary.registrations; | |
2611 | (*curr) != NULL; | |
2612 | curr = &(*curr)->next); | |
2613 | (*curr) = XMALLOC (struct gdbarch_data_registration); | |
2614 | (*curr)->next = NULL; | |
2615 | (*curr)->init = init; | |
2616 | (*curr)->data = XMALLOC (struct gdbarch_data); | |
2617 | (*curr)->data->index = gdbarch_data_registrary.nr++; | |
2618 | return (*curr)->data; | |
2619 | } | |
2620 | ||
2621 | ||
2622 | /* Walk through all the registered users initializing each in turn. */ | |
2623 | ||
0f71a2f6 | 2624 | static void |
104c1213 | 2625 | init_gdbarch_data (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2626 | { |
2627 | struct gdbarch_data_registration *rego; | |
2628 | gdbarch->nr_data = gdbarch_data_registrary.nr + 1; | |
adf40b2e | 2629 | gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data); |
0f71a2f6 JM |
2630 | for (rego = gdbarch_data_registrary.registrations; |
2631 | rego != NULL; | |
2632 | rego = rego->next) | |
2633 | { | |
2634 | if (rego->data->index < gdbarch->nr_data) | |
2635 | gdbarch->data[rego->data->index] = rego->init (); | |
2636 | } | |
2637 | } | |
2638 | ||
2639 | ||
2640 | /* Return the current value of the specified per-architecture | |
2641 | data-pointer. */ | |
2642 | ||
2643 | void * | |
2644 | gdbarch_data (data) | |
2645 | struct gdbarch_data *data; | |
2646 | { | |
2647 | if (data->index >= current_gdbarch->nr_data) | |
96baa820 | 2648 | internal_error ("gdbarch_data: request for non-existant data."); |
0f71a2f6 JM |
2649 | return current_gdbarch->data[data->index]; |
2650 | } | |
2651 | ||
2652 | ||
2653 | ||
2654 | /* Keep a registrary of swaped data required by GDB modules. */ | |
2655 | ||
2656 | struct gdbarch_swap | |
2657 | { | |
2658 | void *swap; | |
2659 | struct gdbarch_swap_registration *source; | |
2660 | struct gdbarch_swap *next; | |
2661 | }; | |
2662 | ||
2663 | struct gdbarch_swap_registration | |
adf40b2e JM |
2664 | { |
2665 | void *data; | |
2666 | unsigned long sizeof_data; | |
2667 | gdbarch_swap_ftype *init; | |
2668 | struct gdbarch_swap_registration *next; | |
2669 | }; | |
0f71a2f6 JM |
2670 | |
2671 | struct gdbarch_swap_registrary | |
adf40b2e JM |
2672 | { |
2673 | int nr; | |
2674 | struct gdbarch_swap_registration *registrations; | |
2675 | }; | |
0f71a2f6 | 2676 | |
adf40b2e | 2677 | struct gdbarch_swap_registrary gdbarch_swap_registrary = |
0f71a2f6 JM |
2678 | { |
2679 | 0, NULL, | |
2680 | }; | |
2681 | ||
2682 | void | |
104c1213 JM |
2683 | register_gdbarch_swap (void *data, |
2684 | unsigned long sizeof_data, | |
2685 | gdbarch_swap_ftype *init) | |
0f71a2f6 JM |
2686 | { |
2687 | struct gdbarch_swap_registration **rego; | |
2688 | for (rego = &gdbarch_swap_registrary.registrations; | |
2689 | (*rego) != NULL; | |
2690 | rego = &(*rego)->next); | |
2691 | (*rego) = XMALLOC (struct gdbarch_swap_registration); | |
2692 | (*rego)->next = NULL; | |
2693 | (*rego)->init = init; | |
2694 | (*rego)->data = data; | |
2695 | (*rego)->sizeof_data = sizeof_data; | |
2696 | } | |
2697 | ||
2698 | ||
0f71a2f6 | 2699 | static void |
104c1213 | 2700 | init_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2701 | { |
2702 | struct gdbarch_swap_registration *rego; | |
2703 | struct gdbarch_swap **curr = &gdbarch->swap; | |
2704 | for (rego = gdbarch_swap_registrary.registrations; | |
2705 | rego != NULL; | |
2706 | rego = rego->next) | |
2707 | { | |
2708 | if (rego->data != NULL) | |
2709 | { | |
2710 | (*curr) = XMALLOC (struct gdbarch_swap); | |
2711 | (*curr)->source = rego; | |
2712 | (*curr)->swap = xmalloc (rego->sizeof_data); | |
2713 | (*curr)->next = NULL; | |
2714 | memset (rego->data, 0, rego->sizeof_data); | |
2715 | curr = &(*curr)->next; | |
2716 | } | |
2717 | if (rego->init != NULL) | |
2718 | rego->init (); | |
2719 | } | |
2720 | } | |
2721 | ||
0f71a2f6 | 2722 | static void |
104c1213 | 2723 | swapout_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2724 | { |
2725 | struct gdbarch_swap *curr; | |
2726 | for (curr = gdbarch->swap; | |
2727 | curr != NULL; | |
2728 | curr = curr->next) | |
2729 | memcpy (curr->swap, curr->source->data, curr->source->sizeof_data); | |
2730 | } | |
2731 | ||
0f71a2f6 | 2732 | static void |
104c1213 | 2733 | swapin_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2734 | { |
2735 | struct gdbarch_swap *curr; | |
2736 | for (curr = gdbarch->swap; | |
2737 | curr != NULL; | |
2738 | curr = curr->next) | |
2739 | memcpy (curr->source->data, curr->swap, curr->source->sizeof_data); | |
2740 | } | |
2741 | ||
2742 | ||
2743 | /* Keep a registrary of the architectures known by GDB. */ | |
2744 | ||
2745 | struct gdbarch_init_registration | |
2746 | { | |
2747 | enum bfd_architecture bfd_architecture; | |
2748 | gdbarch_init_ftype *init; | |
2749 | struct gdbarch_list *arches; | |
2750 | struct gdbarch_init_registration *next; | |
2751 | }; | |
2752 | ||
2753 | static struct gdbarch_init_registration *gdbarch_init_registrary = NULL; | |
2754 | ||
2755 | void | |
104c1213 JM |
2756 | register_gdbarch_init (enum bfd_architecture bfd_architecture, |
2757 | gdbarch_init_ftype *init) | |
0f71a2f6 JM |
2758 | { |
2759 | struct gdbarch_init_registration **curr; | |
2760 | const struct bfd_arch_info *bfd_arch_info; | |
2761 | /* Check that BFD reconizes this architecture */ | |
2762 | bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); | |
2763 | if (bfd_arch_info == NULL) | |
2764 | { | |
96baa820 | 2765 | internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture); |
0f71a2f6 JM |
2766 | } |
2767 | /* Check that we haven't seen this architecture before */ | |
2768 | for (curr = &gdbarch_init_registrary; | |
2769 | (*curr) != NULL; | |
2770 | curr = &(*curr)->next) | |
2771 | { | |
2772 | if (bfd_architecture == (*curr)->bfd_architecture) | |
96baa820 | 2773 | internal_error ("gdbarch: Duplicate registraration of architecture (%s)", |
0f71a2f6 JM |
2774 | bfd_arch_info->printable_name); |
2775 | } | |
2776 | /* log it */ | |
2777 | if (gdbarch_debug) | |
2778 | fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n", | |
2779 | bfd_arch_info->printable_name, | |
2780 | (long) init); | |
2781 | /* Append it */ | |
2782 | (*curr) = XMALLOC (struct gdbarch_init_registration); | |
2783 | (*curr)->bfd_architecture = bfd_architecture; | |
2784 | (*curr)->init = init; | |
2785 | (*curr)->arches = NULL; | |
2786 | (*curr)->next = NULL; | |
2787 | } | |
adf40b2e | 2788 | |
0f71a2f6 JM |
2789 | |
2790 | ||
2791 | /* Look for an architecture using gdbarch_info. Base search on only | |
2792 | BFD_ARCH_INFO and BYTE_ORDER. */ | |
2793 | ||
2794 | struct gdbarch_list * | |
104c1213 JM |
2795 | gdbarch_list_lookup_by_info (struct gdbarch_list *arches, |
2796 | const struct gdbarch_info *info) | |
0f71a2f6 JM |
2797 | { |
2798 | for (; arches != NULL; arches = arches->next) | |
2799 | { | |
2800 | if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info) | |
2801 | continue; | |
2802 | if (info->byte_order != arches->gdbarch->byte_order) | |
2803 | continue; | |
2804 | return arches; | |
2805 | } | |
2806 | return NULL; | |
2807 | } | |
2808 | ||
2809 | ||
2810 | /* Update the current architecture. Return ZERO if the update request | |
2811 | failed. */ | |
2812 | ||
2813 | int | |
104c1213 | 2814 | gdbarch_update (struct gdbarch_info info) |
0f71a2f6 JM |
2815 | { |
2816 | struct gdbarch *new_gdbarch; | |
2817 | struct gdbarch_list **list; | |
2818 | struct gdbarch_init_registration *rego; | |
2819 | ||
2820 | /* Fill in any missing bits. Most important is the bfd_architecture | |
2821 | which is used to select the target architecture. */ | |
2822 | if (info.bfd_architecture == bfd_arch_unknown) | |
2823 | { | |
2824 | if (info.bfd_arch_info != NULL) | |
2825 | info.bfd_architecture = info.bfd_arch_info->arch; | |
2826 | else if (info.abfd != NULL) | |
2827 | info.bfd_architecture = bfd_get_arch (info.abfd); | |
2828 | /* FIXME - should query BFD for its default architecture. */ | |
2829 | else | |
2830 | info.bfd_architecture = current_gdbarch->bfd_arch_info->arch; | |
2831 | } | |
2832 | if (info.bfd_arch_info == NULL) | |
2833 | { | |
2834 | if (target_architecture_auto && info.abfd != NULL) | |
2835 | info.bfd_arch_info = bfd_get_arch_info (info.abfd); | |
2836 | else | |
2837 | info.bfd_arch_info = current_gdbarch->bfd_arch_info; | |
2838 | } | |
2839 | if (info.byte_order == 0) | |
2840 | { | |
2841 | if (target_byte_order_auto && info.abfd != NULL) | |
2842 | info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN | |
2843 | : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN | |
2844 | : 0); | |
2845 | else | |
2846 | info.byte_order = current_gdbarch->byte_order; | |
2847 | /* FIXME - should query BFD for its default byte-order. */ | |
2848 | } | |
2849 | /* A default for abfd? */ | |
2850 | ||
2851 | /* Find the target that knows about this architecture. */ | |
2852 | for (rego = gdbarch_init_registrary; | |
2853 | rego != NULL && rego->bfd_architecture != info.bfd_architecture; | |
2854 | rego = rego->next); | |
2855 | if (rego == NULL) | |
2856 | { | |
2857 | if (gdbarch_debug) | |
2858 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n"); | |
2859 | return 0; | |
2860 | } | |
2861 | ||
2862 | if (gdbarch_debug) | |
2863 | { | |
2864 | fprintf_unfiltered (gdb_stdlog, | |
2865 | "gdbarch_update: info.bfd_architecture %d (%s)\n", | |
2866 | info.bfd_architecture, | |
adf40b2e | 2867 | bfd_lookup_arch (info.bfd_architecture, 0)->printable_name); |
0f71a2f6 JM |
2868 | fprintf_unfiltered (gdb_stdlog, |
2869 | "gdbarch_update: info.bfd_arch_info %s\n", | |
2870 | (info.bfd_arch_info != NULL | |
2871 | ? info.bfd_arch_info->printable_name | |
2872 | : "(null)")); | |
2873 | fprintf_unfiltered (gdb_stdlog, | |
2874 | "gdbarch_update: info.byte_order %d (%s)\n", | |
2875 | info.byte_order, | |
2876 | (info.byte_order == BIG_ENDIAN ? "big" | |
2877 | : info.byte_order == LITTLE_ENDIAN ? "little" | |
2878 | : "default")); | |
2879 | fprintf_unfiltered (gdb_stdlog, | |
2880 | "gdbarch_update: info.abfd 0x%lx\n", | |
2881 | (long) info.abfd); | |
2882 | fprintf_unfiltered (gdb_stdlog, | |
2883 | "gdbarch_update: info.tdep_info 0x%lx\n", | |
2884 | (long) info.tdep_info); | |
2885 | } | |
2886 | ||
2887 | /* Ask the target for a replacement architecture. */ | |
2888 | new_gdbarch = rego->init (info, rego->arches); | |
2889 | ||
2890 | /* Did the target like it? No. Reject the change. */ | |
2891 | if (new_gdbarch == NULL) | |
2892 | { | |
2893 | if (gdbarch_debug) | |
2894 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n"); | |
2895 | return 0; | |
2896 | } | |
2897 | ||
2898 | /* Did the architecture change? No. Do nothing. */ | |
2899 | if (current_gdbarch == new_gdbarch) | |
2900 | { | |
2901 | if (gdbarch_debug) | |
2902 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n", | |
2903 | (long) new_gdbarch, | |
2904 | new_gdbarch->bfd_arch_info->printable_name); | |
2905 | return 1; | |
2906 | } | |
2907 | ||
2908 | /* Swap all data belonging to the old target out */ | |
2909 | swapout_gdbarch_swap (current_gdbarch); | |
2910 | ||
2911 | /* Is this a pre-existing architecture? Yes. Swap it in. */ | |
2912 | for (list = ®o->arches; | |
2913 | (*list) != NULL; | |
2914 | list = &(*list)->next) | |
2915 | { | |
2916 | if ((*list)->gdbarch == new_gdbarch) | |
2917 | { | |
2918 | if (gdbarch_debug) | |
2919 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n", | |
2920 | (long) new_gdbarch, | |
2921 | new_gdbarch->bfd_arch_info->printable_name); | |
2922 | current_gdbarch = new_gdbarch; | |
2923 | swapin_gdbarch_swap (new_gdbarch); | |
2924 | return 1; | |
2925 | } | |
2926 | } | |
adf40b2e | 2927 | |
0f71a2f6 JM |
2928 | /* Append this new architecture to this targets list. */ |
2929 | (*list) = XMALLOC (struct gdbarch_list); | |
2930 | (*list)->next = NULL; | |
2931 | (*list)->gdbarch = new_gdbarch; | |
2932 | ||
2933 | /* Switch to this new architecture. Dump it out. */ | |
2934 | current_gdbarch = new_gdbarch; | |
2935 | if (gdbarch_debug) | |
2936 | { | |
2937 | fprintf_unfiltered (gdb_stdlog, | |
adf40b2e | 2938 | "gdbarch_update: New architecture 0x%08lx (%s) selected\n", |
0f71a2f6 JM |
2939 | (long) new_gdbarch, |
2940 | new_gdbarch->bfd_arch_info->printable_name); | |
2941 | gdbarch_dump (); | |
2942 | } | |
adf40b2e | 2943 | |
0f71a2f6 JM |
2944 | /* Check that the newly installed architecture is valid. */ |
2945 | verify_gdbarch (new_gdbarch); | |
2946 | ||
2947 | /* Initialize the per-architecture memory (swap) areas. | |
2948 | CURRENT_GDBARCH must be update before these modules are | |
2949 | called. */ | |
2950 | init_gdbarch_swap (new_gdbarch); | |
adf40b2e | 2951 | |
0f71a2f6 JM |
2952 | /* Initialize the per-architecture data-pointer of all parties that |
2953 | registered an interest in this architecture. CURRENT_GDBARCH | |
2954 | must be updated before these modules are called. */ | |
2955 | init_gdbarch_data (new_gdbarch); | |
adf40b2e | 2956 | |
0f71a2f6 JM |
2957 | return 1; |
2958 | } | |
c906108c | 2959 | |
c906108c SS |
2960 | |
2961 | ||
2962 | /* Functions to manipulate the endianness of the target. */ | |
2963 | ||
2964 | #ifdef TARGET_BYTE_ORDER_SELECTABLE | |
2965 | /* compat - Catch old targets that expect a selectable byte-order to | |
2966 | default to BIG_ENDIAN */ | |
2967 | #ifndef TARGET_BYTE_ORDER_DEFAULT | |
2968 | #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN | |
2969 | #endif | |
2970 | #endif | |
7a292a7a | 2971 | #if !TARGET_BYTE_ORDER_SELECTABLE_P |
c906108c SS |
2972 | #ifndef TARGET_BYTE_ORDER_DEFAULT |
2973 | /* compat - Catch old non byte-order selectable targets that do not | |
2974 | define TARGET_BYTE_ORDER_DEFAULT and instead expect | |
2975 | TARGET_BYTE_ORDER to be used as the default. For targets that | |
2976 | defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the | |
2977 | below will get a strange compiler warning. */ | |
2978 | #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER | |
2979 | #endif | |
7a292a7a SS |
2980 | #endif |
2981 | #ifndef TARGET_BYTE_ORDER_DEFAULT | |
adf40b2e | 2982 | #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */ |
7a292a7a | 2983 | #endif |
c906108c SS |
2984 | int target_byte_order = TARGET_BYTE_ORDER_DEFAULT; |
2985 | int target_byte_order_auto = 1; | |
2986 | ||
2987 | /* Chain containing the \"set endian\" commands. */ | |
2988 | static struct cmd_list_element *endianlist = NULL; | |
2989 | ||
2990 | /* Called by ``show endian''. */ | |
c906108c | 2991 | static void |
104c1213 | 2992 | show_endian (char *args, int from_tty) |
c906108c SS |
2993 | { |
2994 | char *msg = | |
adf40b2e JM |
2995 | (TARGET_BYTE_ORDER_AUTO |
2996 | ? "The target endianness is set automatically (currently %s endian)\n" | |
2997 | : "The target is assumed to be %s endian\n"); | |
c906108c SS |
2998 | printf_unfiltered (msg, (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little")); |
2999 | } | |
3000 | ||
3001 | /* Called if the user enters ``set endian'' without an argument. */ | |
c906108c | 3002 | static void |
104c1213 | 3003 | set_endian (char *args, int from_tty) |
c906108c SS |
3004 | { |
3005 | printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n"); | |
3006 | show_endian (args, from_tty); | |
3007 | } | |
3008 | ||
3009 | /* Called by ``set endian big''. */ | |
c906108c | 3010 | static void |
104c1213 | 3011 | set_endian_big (char *args, int from_tty) |
c906108c SS |
3012 | { |
3013 | if (TARGET_BYTE_ORDER_SELECTABLE_P) | |
3014 | { | |
3015 | target_byte_order = BIG_ENDIAN; | |
3016 | target_byte_order_auto = 0; | |
0f71a2f6 JM |
3017 | if (GDB_MULTI_ARCH) |
3018 | { | |
3019 | struct gdbarch_info info; | |
3020 | memset (&info, 0, sizeof info); | |
3021 | info.byte_order = BIG_ENDIAN; | |
3022 | gdbarch_update (info); | |
3023 | } | |
c906108c SS |
3024 | } |
3025 | else | |
3026 | { | |
3027 | printf_unfiltered ("Byte order is not selectable."); | |
3028 | show_endian (args, from_tty); | |
3029 | } | |
3030 | } | |
3031 | ||
3032 | /* Called by ``set endian little''. */ | |
c906108c | 3033 | static void |
104c1213 | 3034 | set_endian_little (char *args, int from_tty) |
c906108c SS |
3035 | { |
3036 | if (TARGET_BYTE_ORDER_SELECTABLE_P) | |
3037 | { | |
3038 | target_byte_order = LITTLE_ENDIAN; | |
3039 | target_byte_order_auto = 0; | |
0f71a2f6 JM |
3040 | if (GDB_MULTI_ARCH) |
3041 | { | |
3042 | struct gdbarch_info info; | |
3043 | memset (&info, 0, sizeof info); | |
3044 | info.byte_order = LITTLE_ENDIAN; | |
3045 | gdbarch_update (info); | |
3046 | } | |
c906108c SS |
3047 | } |
3048 | else | |
3049 | { | |
3050 | printf_unfiltered ("Byte order is not selectable."); | |
3051 | show_endian (args, from_tty); | |
3052 | } | |
3053 | } | |
3054 | ||
3055 | /* Called by ``set endian auto''. */ | |
c906108c | 3056 | static void |
104c1213 | 3057 | set_endian_auto (char *args, int from_tty) |
c906108c SS |
3058 | { |
3059 | if (TARGET_BYTE_ORDER_SELECTABLE_P) | |
3060 | { | |
3061 | target_byte_order_auto = 1; | |
3062 | } | |
3063 | else | |
3064 | { | |
3065 | printf_unfiltered ("Byte order is not selectable."); | |
3066 | show_endian (args, from_tty); | |
3067 | } | |
3068 | } | |
3069 | ||
3070 | /* Set the endianness from a BFD. */ | |
c906108c | 3071 | static void |
104c1213 | 3072 | set_endian_from_file (bfd *abfd) |
c906108c SS |
3073 | { |
3074 | if (TARGET_BYTE_ORDER_SELECTABLE_P) | |
3075 | { | |
3076 | int want; | |
adf40b2e | 3077 | |
c906108c SS |
3078 | if (bfd_big_endian (abfd)) |
3079 | want = BIG_ENDIAN; | |
3080 | else | |
3081 | want = LITTLE_ENDIAN; | |
3082 | if (TARGET_BYTE_ORDER_AUTO) | |
3083 | target_byte_order = want; | |
3084 | else if (TARGET_BYTE_ORDER != want) | |
3085 | warning ("%s endian file does not match %s endian target.", | |
3086 | want == BIG_ENDIAN ? "big" : "little", | |
3087 | TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"); | |
3088 | } | |
3089 | else | |
3090 | { | |
3091 | if (bfd_big_endian (abfd) | |
3092 | ? TARGET_BYTE_ORDER != BIG_ENDIAN | |
3093 | : TARGET_BYTE_ORDER == BIG_ENDIAN) | |
3094 | warning ("%s endian file does not match %s endian target.", | |
3095 | bfd_big_endian (abfd) ? "big" : "little", | |
3096 | TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"); | |
3097 | } | |
3098 | } | |
3099 | ||
3100 | ||
3101 | ||
3102 | /* Functions to manipulate the architecture of the target */ | |
3103 | ||
104c1213 JM |
3104 | enum set_arch { set_arch_auto, set_arch_manual }; |
3105 | ||
c906108c SS |
3106 | int target_architecture_auto = 1; |
3107 | extern const struct bfd_arch_info bfd_default_arch_struct; | |
3108 | const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct; | |
104c1213 JM |
3109 | int (*target_architecture_hook) (const struct bfd_arch_info *ap); |
3110 | ||
3111 | static void show_endian (char *, int); | |
3112 | static void set_endian (char *, int); | |
3113 | static void set_endian_big (char *, int); | |
3114 | static void set_endian_little (char *, int); | |
3115 | static void set_endian_auto (char *, int); | |
3116 | static void set_endian_from_file (bfd *); | |
3117 | static int arch_ok (const struct bfd_arch_info *arch); | |
3118 | static void set_arch (const struct bfd_arch_info *arch, enum set_arch type); | |
3119 | static void show_architecture (char *, int); | |
3120 | static void set_architecture (char *, int); | |
3121 | static void info_architecture (char *, int); | |
3122 | static void set_architecture_from_file (bfd *); | |
c906108c SS |
3123 | |
3124 | /* Do the real work of changing the current architecture */ | |
b83266a0 | 3125 | |
b83266a0 | 3126 | static int |
104c1213 | 3127 | arch_ok (const struct bfd_arch_info *arch) |
b83266a0 SS |
3128 | { |
3129 | /* Should be performing the more basic check that the binary is | |
3130 | compatible with GDB. */ | |
3131 | /* Check with the target that the architecture is valid. */ | |
3132 | return (target_architecture_hook == NULL | |
3133 | || target_architecture_hook (arch)); | |
3134 | } | |
3135 | ||
c906108c | 3136 | static void |
104c1213 JM |
3137 | set_arch (const struct bfd_arch_info *arch, |
3138 | enum set_arch type) | |
c906108c | 3139 | { |
7a292a7a | 3140 | switch (type) |
c906108c | 3141 | { |
7a292a7a | 3142 | case set_arch_auto: |
b83266a0 | 3143 | if (!arch_ok (arch)) |
7a292a7a SS |
3144 | warning ("Target may not support %s architecture", |
3145 | arch->printable_name); | |
c906108c | 3146 | target_architecture = arch; |
7a292a7a SS |
3147 | break; |
3148 | case set_arch_manual: | |
b83266a0 | 3149 | if (!arch_ok (arch)) |
7a292a7a SS |
3150 | { |
3151 | printf_unfiltered ("Target does not support `%s' architecture.\n", | |
3152 | arch->printable_name); | |
3153 | } | |
3154 | else | |
3155 | { | |
3156 | target_architecture_auto = 0; | |
3157 | target_architecture = arch; | |
3158 | } | |
3159 | break; | |
c906108c | 3160 | } |
0f71a2f6 JM |
3161 | if (gdbarch_debug) |
3162 | gdbarch_dump (); | |
c906108c SS |
3163 | } |
3164 | ||
3165 | /* Called if the user enters ``show architecture'' without an argument. */ | |
c906108c | 3166 | static void |
104c1213 | 3167 | show_architecture (char *args, int from_tty) |
c906108c SS |
3168 | { |
3169 | const char *arch; | |
3170 | arch = TARGET_ARCHITECTURE->printable_name; | |
3171 | if (target_architecture_auto) | |
3172 | printf_filtered ("The target architecture is set automatically (currently %s)\n", arch); | |
3173 | else | |
3174 | printf_filtered ("The target architecture is assumed to be %s\n", arch); | |
3175 | } | |
3176 | ||
3177 | /* Called if the user enters ``set architecture'' with or without an | |
3178 | argument. */ | |
c906108c | 3179 | static void |
104c1213 | 3180 | set_architecture (char *args, int from_tty) |
c906108c SS |
3181 | { |
3182 | if (args == NULL) | |
3183 | { | |
3184 | printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n"); | |
3185 | } | |
3186 | else if (strcmp (args, "auto") == 0) | |
3187 | { | |
3188 | target_architecture_auto = 1; | |
3189 | } | |
0f71a2f6 JM |
3190 | else if (GDB_MULTI_ARCH) |
3191 | { | |
3192 | const struct bfd_arch_info *arch = bfd_scan_arch (args); | |
3193 | if (arch == NULL) | |
3194 | printf_unfiltered ("Architecture `%s' not reconized.\n", args); | |
3195 | else | |
3196 | { | |
3197 | struct gdbarch_info info; | |
3198 | memset (&info, 0, sizeof info); | |
3199 | info.bfd_arch_info = arch; | |
3200 | if (gdbarch_update (info)) | |
3201 | target_architecture_auto = 0; | |
3202 | else | |
3203 | printf_unfiltered ("Architecture `%s' not reconized.\n", args); | |
3204 | } | |
3205 | } | |
c906108c SS |
3206 | else |
3207 | { | |
3208 | const struct bfd_arch_info *arch = bfd_scan_arch (args); | |
3209 | if (arch != NULL) | |
7a292a7a | 3210 | set_arch (arch, set_arch_manual); |
c906108c SS |
3211 | else |
3212 | printf_unfiltered ("Architecture `%s' not reconized.\n", args); | |
3213 | } | |
3214 | } | |
3215 | ||
3216 | /* Called if the user enters ``info architecture'' without an argument. */ | |
c906108c | 3217 | static void |
104c1213 | 3218 | info_architecture (char *args, int from_tty) |
c906108c SS |
3219 | { |
3220 | enum bfd_architecture a; | |
0f71a2f6 JM |
3221 | if (GDB_MULTI_ARCH) |
3222 | { | |
3223 | if (gdbarch_init_registrary != NULL) | |
3224 | { | |
3225 | struct gdbarch_init_registration *rego; | |
3226 | printf_filtered ("Available architectures are:\n"); | |
3227 | for (rego = gdbarch_init_registrary; | |
3228 | rego != NULL; | |
3229 | rego = rego->next) | |
3230 | { | |
3231 | const struct bfd_arch_info *ap; | |
3232 | ap = bfd_lookup_arch (rego->bfd_architecture, 0); | |
3233 | if (ap != NULL) | |
3234 | { | |
3235 | do | |
3236 | { | |
3237 | printf_filtered (" %s", ap->printable_name); | |
3238 | ap = ap->next; | |
3239 | } | |
3240 | while (ap != NULL); | |
3241 | printf_filtered ("\n"); | |
3242 | } | |
3243 | } | |
3244 | } | |
3245 | else | |
3246 | { | |
3247 | printf_filtered ("There are no available architectures.\n"); | |
3248 | } | |
3249 | return; | |
3250 | } | |
c906108c SS |
3251 | printf_filtered ("Available architectures are:\n"); |
3252 | for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++) | |
3253 | { | |
3254 | const struct bfd_arch_info *ap = bfd_lookup_arch (a, 0); | |
3255 | if (ap != NULL) | |
3256 | { | |
3257 | do | |
3258 | { | |
3259 | printf_filtered (" %s", ap->printable_name); | |
3260 | ap = ap->next; | |
3261 | } | |
3262 | while (ap != NULL); | |
3263 | printf_filtered ("\n"); | |
3264 | } | |
3265 | } | |
3266 | } | |
3267 | ||
3268 | /* Set the architecture from arch/machine */ | |
3269 | void | |
3270 | set_architecture_from_arch_mach (arch, mach) | |
3271 | enum bfd_architecture arch; | |
3272 | unsigned long mach; | |
3273 | { | |
3274 | const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach); | |
3275 | if (wanted != NULL) | |
7a292a7a | 3276 | set_arch (wanted, set_arch_manual); |
c906108c | 3277 | else |
96baa820 | 3278 | internal_error ("gdbarch: hardwired architecture/machine not reconized"); |
c906108c SS |
3279 | } |
3280 | ||
3281 | /* Set the architecture from a BFD */ | |
c906108c | 3282 | static void |
104c1213 | 3283 | set_architecture_from_file (bfd *abfd) |
c906108c SS |
3284 | { |
3285 | const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd); | |
3286 | if (target_architecture_auto) | |
3287 | { | |
7a292a7a | 3288 | set_arch (wanted, set_arch_auto); |
c906108c SS |
3289 | } |
3290 | else if (wanted != target_architecture) | |
3291 | { | |
3292 | warning ("%s architecture file may be incompatible with %s target.", | |
3293 | wanted->printable_name, | |
3294 | target_architecture->printable_name); | |
3295 | } | |
3296 | } | |
3297 | ||
3298 | ||
cce74817 JM |
3299 | /* Misc helper functions for targets. */ |
3300 | ||
3301 | int | |
3302 | frame_num_args_unknown (fi) | |
3303 | struct frame_info *fi; | |
3304 | { | |
3305 | return -1; | |
3306 | } | |
3307 | ||
c906108c | 3308 | |
0f71a2f6 JM |
3309 | int |
3310 | generic_register_convertible_not (num) | |
3311 | int num; | |
3312 | { | |
3313 | return 0; | |
3314 | } | |
adf40b2e | 3315 | |
4478b372 | 3316 | |
c906108c SS |
3317 | /* Disassembler */ |
3318 | ||
3319 | /* Pointer to the target-dependent disassembly function. */ | |
104c1213 | 3320 | int (*tm_print_insn) (bfd_vma, disassemble_info *); |
c906108c SS |
3321 | disassemble_info tm_print_insn_info; |
3322 | ||
3323 | ||
3324 | ||
3325 | /* Set the dynamic target-system-dependant parameters (architecture, | |
3326 | byte-order) using information found in the BFD */ | |
3327 | ||
3328 | void | |
3329 | set_gdbarch_from_file (abfd) | |
3330 | bfd *abfd; | |
3331 | { | |
0f71a2f6 JM |
3332 | if (GDB_MULTI_ARCH) |
3333 | { | |
3334 | struct gdbarch_info info; | |
3335 | memset (&info, 0, sizeof info); | |
3336 | info.abfd = abfd; | |
3337 | gdbarch_update (info); | |
3338 | return; | |
3339 | } | |
c906108c SS |
3340 | set_architecture_from_file (abfd); |
3341 | set_endian_from_file (abfd); | |
3342 | } | |
3343 | ||
3344 | ||
e514a9d6 JM |
3345 | /* Initialize the current architecture. */ |
3346 | void | |
3347 | initialize_current_architecture () | |
3348 | { | |
3349 | if (GDB_MULTI_ARCH) | |
3350 | { | |
3351 | struct gdbarch_init_registration *rego; | |
3352 | const struct bfd_arch_info *chosen = NULL; | |
3353 | for (rego = gdbarch_init_registrary; rego != NULL; rego = rego->next) | |
3354 | { | |
3355 | const struct bfd_arch_info *ap | |
3356 | = bfd_lookup_arch (rego->bfd_architecture, 0); | |
3357 | ||
3358 | /* Choose the first architecture alphabetically. */ | |
3359 | if (chosen == NULL | |
3360 | || strcmp (ap->printable_name, chosen->printable_name) < 0) | |
3361 | chosen = ap; | |
3362 | } | |
3363 | ||
3364 | if (chosen != NULL) | |
3365 | { | |
3366 | struct gdbarch_info info; | |
3367 | memset (&info, 0, sizeof info); | |
3368 | info.bfd_arch_info = chosen; | |
3369 | gdbarch_update (info); | |
3370 | } | |
3371 | } | |
3372 | } | |
3373 | ||
104c1213 | 3374 | extern void _initialize_gdbarch (void); |
c906108c SS |
3375 | void |
3376 | _initialize_gdbarch () | |
3377 | { | |
5d161b24 DB |
3378 | struct cmd_list_element *c; |
3379 | ||
c906108c SS |
3380 | add_prefix_cmd ("endian", class_support, set_endian, |
3381 | "Set endianness of target.", | |
3382 | &endianlist, "set endian ", 0, &setlist); | |
3383 | add_cmd ("big", class_support, set_endian_big, | |
3384 | "Set target as being big endian.", &endianlist); | |
3385 | add_cmd ("little", class_support, set_endian_little, | |
3386 | "Set target as being little endian.", &endianlist); | |
3387 | add_cmd ("auto", class_support, set_endian_auto, | |
3388 | "Select target endianness automatically.", &endianlist); | |
3389 | add_cmd ("endian", class_support, show_endian, | |
3390 | "Show endianness of target.", &showlist); | |
3391 | ||
3392 | add_cmd ("architecture", class_support, set_architecture, | |
3393 | "Set architecture of target.", &setlist); | |
3394 | add_alias_cmd ("processor", "architecture", class_support, 1, &setlist); | |
3395 | add_cmd ("architecture", class_support, show_architecture, | |
3396 | "Show architecture of target.", &showlist); | |
3397 | add_cmd ("architecture", class_support, info_architecture, | |
3398 | "List supported target architectures", &infolist); | |
3399 | ||
adf40b2e | 3400 | INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered); |
c906108c SS |
3401 | tm_print_insn_info.flavour = bfd_target_unknown_flavour; |
3402 | tm_print_insn_info.read_memory_func = dis_asm_read_memory; | |
3403 | tm_print_insn_info.memory_error_func = dis_asm_memory_error; | |
3404 | tm_print_insn_info.print_address_func = dis_asm_print_address; | |
3405 | ||
5d161b24 | 3406 | add_show_from_set (add_set_cmd ("arch", |
c906108c SS |
3407 | class_maintenance, |
3408 | var_zinteger, | |
adf40b2e | 3409 | (char *)&gdbarch_debug, |
c906108c | 3410 | "Set architecture debugging.\n\ |
5d161b24 DB |
3411 | When non-zero, architecture debugging is enabled.", &setdebuglist), |
3412 | &showdebuglist); | |
59233f88 AC |
3413 | c = add_set_cmd ("archdebug", |
3414 | class_maintenance, | |
3415 | var_zinteger, | |
3416 | (char *)&gdbarch_debug, | |
3417 | "Set architecture debugging.\n\ | |
5d161b24 DB |
3418 | When non-zero, architecture debugging is enabled.", &setlist); |
3419 | ||
59233f88 AC |
3420 | deprecate_cmd (c, "set debug arch"); |
3421 | deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch"); | |
c906108c | 3422 | } |