Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
338d7c5c | 4 | Copyright 1998, 1999, 2000, 2001 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 | ||
52204a0b | 25 | The Bourne shell script ``gdbarch.sh'' creates the files |
104c1213 JM |
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 | |
52204a0b | 31 | changes into that script. Conversely, when making sweeping changes |
104c1213 JM |
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 | 60 | |
f0d4cc9e | 61 | #include "floatformat.h" |
c906108c | 62 | |
95160752 | 63 | #include "gdb_assert.h" |
67c2c32c | 64 | #include "gdb-events.h" |
95160752 | 65 | |
104c1213 JM |
66 | /* Static function declarations */ |
67 | ||
68 | static void verify_gdbarch (struct gdbarch *gdbarch); | |
b3cc3077 JB |
69 | static void alloc_gdbarch_data (struct gdbarch *); |
70 | static void init_gdbarch_data (struct gdbarch *); | |
95160752 | 71 | static void free_gdbarch_data (struct gdbarch *); |
104c1213 JM |
72 | static void init_gdbarch_swap (struct gdbarch *); |
73 | static void swapout_gdbarch_swap (struct gdbarch *); | |
74 | static void swapin_gdbarch_swap (struct gdbarch *); | |
75 | ||
0f71a2f6 JM |
76 | /* Convenience macro for allocting typesafe memory. */ |
77 | ||
78 | #ifndef XMALLOC | |
79 | #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE)) | |
80 | #endif | |
81 | ||
82 | ||
83 | /* Non-zero if we want to trace architecture code. */ | |
84 | ||
85 | #ifndef GDBARCH_DEBUG | |
86 | #define GDBARCH_DEBUG 0 | |
87 | #endif | |
88 | int gdbarch_debug = GDBARCH_DEBUG; | |
89 | ||
90 | ||
91 | /* Maintain the struct gdbarch object */ | |
92 | ||
93 | struct gdbarch | |
adf40b2e JM |
94 | { |
95 | /* basic architectural information */ | |
96 | const struct bfd_arch_info * bfd_arch_info; | |
97 | int byte_order; | |
0f71a2f6 | 98 | |
adf40b2e JM |
99 | /* target specific vector. */ |
100 | struct gdbarch_tdep *tdep; | |
4b9b3959 | 101 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 102 | |
adf40b2e | 103 | /* per-architecture data-pointers */ |
95160752 | 104 | unsigned nr_data; |
adf40b2e | 105 | void **data; |
0f71a2f6 | 106 | |
adf40b2e JM |
107 | /* per-architecture swap-regions */ |
108 | struct gdbarch_swap *swap; | |
0f71a2f6 | 109 | |
adf40b2e | 110 | /* Multi-arch values. |
0f71a2f6 | 111 | |
adf40b2e | 112 | When extending this structure you must: |
0f71a2f6 | 113 | |
adf40b2e | 114 | Add the field below. |
0f71a2f6 | 115 | |
adf40b2e JM |
116 | Declare set/get functions and define the corresponding |
117 | macro in gdbarch.h. | |
0f71a2f6 | 118 | |
adf40b2e JM |
119 | gdbarch_alloc(): If zero/NULL is not a suitable default, |
120 | initialize the new field. | |
0f71a2f6 | 121 | |
adf40b2e JM |
122 | verify_gdbarch(): Confirm that the target updated the field |
123 | correctly. | |
0f71a2f6 | 124 | |
7e73cedf | 125 | gdbarch_dump(): Add a fprintf_unfiltered call so that the new |
adf40b2e | 126 | field is dumped out |
0f71a2f6 | 127 | |
c0e8c252 | 128 | ``startup_gdbarch()'': Append an initial value to the static |
adf40b2e | 129 | variable (base values on the host's c-type system). |
0f71a2f6 | 130 | |
adf40b2e JM |
131 | get_gdbarch(): Implement the set/get functions (probably using |
132 | the macro's as shortcuts). | |
0f71a2f6 JM |
133 | |
134 | */ | |
135 | ||
adf40b2e JM |
136 | int short_bit; |
137 | int int_bit; | |
138 | int long_bit; | |
139 | int long_long_bit; | |
140 | int float_bit; | |
141 | int double_bit; | |
142 | int long_double_bit; | |
66b43ecb | 143 | int ptr_bit; |
52204a0b | 144 | int addr_bit; |
66b43ecb | 145 | int bfd_vma_bit; |
7355ddba | 146 | int ieee_float; |
adf40b2e JM |
147 | gdbarch_read_pc_ftype *read_pc; |
148 | gdbarch_write_pc_ftype *write_pc; | |
149 | gdbarch_read_fp_ftype *read_fp; | |
150 | gdbarch_write_fp_ftype *write_fp; | |
151 | gdbarch_read_sp_ftype *read_sp; | |
152 | gdbarch_write_sp_ftype *write_sp; | |
39d4ef09 | 153 | gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; |
61a0eb5b AC |
154 | gdbarch_register_read_ftype *register_read; |
155 | gdbarch_register_write_ftype *register_write; | |
adf40b2e | 156 | int num_regs; |
0aba1244 | 157 | int num_pseudo_regs; |
adf40b2e JM |
158 | int sp_regnum; |
159 | int fp_regnum; | |
160 | int pc_regnum; | |
60054393 | 161 | int fp0_regnum; |
03863182 AC |
162 | int npc_regnum; |
163 | int nnpc_regnum; | |
88c72b7d AC |
164 | gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum; |
165 | gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum; | |
166 | gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum; | |
167 | gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum; | |
168 | gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum; | |
adf40b2e JM |
169 | gdbarch_register_name_ftype *register_name; |
170 | int register_size; | |
171 | int register_bytes; | |
172 | gdbarch_register_byte_ftype *register_byte; | |
173 | gdbarch_register_raw_size_ftype *register_raw_size; | |
174 | int max_register_raw_size; | |
175 | gdbarch_register_virtual_size_ftype *register_virtual_size; | |
176 | int max_register_virtual_size; | |
177 | gdbarch_register_virtual_type_ftype *register_virtual_type; | |
666e11c5 | 178 | gdbarch_do_registers_info_ftype *do_registers_info; |
7c7651b2 | 179 | gdbarch_register_sim_regno_ftype *register_sim_regno; |
2649061d | 180 | gdbarch_register_bytes_ok_ftype *register_bytes_ok; |
01fb7433 AC |
181 | gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; |
182 | gdbarch_cannot_store_register_ftype *cannot_store_register; | |
adf40b2e JM |
183 | int use_generic_dummy_frames; |
184 | int call_dummy_location; | |
185 | gdbarch_call_dummy_address_ftype *call_dummy_address; | |
186 | CORE_ADDR call_dummy_start_offset; | |
187 | CORE_ADDR call_dummy_breakpoint_offset; | |
188 | int call_dummy_breakpoint_offset_p; | |
189 | int call_dummy_length; | |
190 | gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy; | |
191 | int call_dummy_p; | |
192 | LONGEST * call_dummy_words; | |
193 | int sizeof_call_dummy_words; | |
194 | int call_dummy_stack_adjust_p; | |
195 | int call_dummy_stack_adjust; | |
196 | gdbarch_fix_call_dummy_ftype *fix_call_dummy; | |
10312cc4 AC |
197 | gdbarch_init_frame_pc_first_ftype *init_frame_pc_first; |
198 | gdbarch_init_frame_pc_ftype *init_frame_pc; | |
adf40b2e JM |
199 | int believe_pcc_promotion; |
200 | int believe_pcc_promotion_type; | |
b9a8e3bf | 201 | gdbarch_coerce_float_to_double_ftype *coerce_float_to_double; |
adf40b2e JM |
202 | gdbarch_get_saved_register_ftype *get_saved_register; |
203 | gdbarch_register_convertible_ftype *register_convertible; | |
204 | gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual; | |
205 | gdbarch_register_convert_to_raw_ftype *register_convert_to_raw; | |
7f1b2585 EZ |
206 | gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register; |
207 | gdbarch_store_pseudo_register_ftype *store_pseudo_register; | |
4478b372 JB |
208 | gdbarch_pointer_to_address_ftype *pointer_to_address; |
209 | gdbarch_address_to_pointer_ftype *address_to_pointer; | |
71a9f22e | 210 | gdbarch_return_value_on_stack_ftype *return_value_on_stack; |
adf40b2e JM |
211 | gdbarch_extract_return_value_ftype *extract_return_value; |
212 | gdbarch_push_arguments_ftype *push_arguments; | |
213 | gdbarch_push_dummy_frame_ftype *push_dummy_frame; | |
214 | gdbarch_push_return_address_ftype *push_return_address; | |
215 | gdbarch_pop_frame_ftype *pop_frame; | |
adf40b2e JM |
216 | gdbarch_store_struct_return_ftype *store_struct_return; |
217 | gdbarch_store_return_value_ftype *store_return_value; | |
218 | gdbarch_extract_struct_value_address_ftype *extract_struct_value_address; | |
219 | gdbarch_use_struct_convention_ftype *use_struct_convention; | |
220 | gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs; | |
221 | gdbarch_init_extra_frame_info_ftype *init_extra_frame_info; | |
222 | gdbarch_skip_prologue_ftype *skip_prologue; | |
dad41f9a | 223 | gdbarch_prologue_frameless_p_ftype *prologue_frameless_p; |
adf40b2e JM |
224 | gdbarch_inner_than_ftype *inner_than; |
225 | gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; | |
917317f4 JM |
226 | gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; |
227 | gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint; | |
adf40b2e | 228 | CORE_ADDR decr_pc_after_break; |
e02bc4cc | 229 | gdbarch_prepare_to_proceed_ftype *prepare_to_proceed; |
adf40b2e JM |
230 | CORE_ADDR function_start_offset; |
231 | gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address; | |
232 | CORE_ADDR frame_args_skip; | |
233 | gdbarch_frameless_function_invocation_ftype *frameless_function_invocation; | |
234 | gdbarch_frame_chain_ftype *frame_chain; | |
235 | gdbarch_frame_chain_valid_ftype *frame_chain_valid; | |
236 | gdbarch_frame_saved_pc_ftype *frame_saved_pc; | |
237 | gdbarch_frame_args_address_ftype *frame_args_address; | |
238 | gdbarch_frame_locals_address_ftype *frame_locals_address; | |
239 | gdbarch_saved_pc_after_call_ftype *saved_pc_after_call; | |
240 | gdbarch_frame_num_args_ftype *frame_num_args; | |
2ada493a | 241 | gdbarch_stack_align_ftype *stack_align; |
1dd4193b | 242 | int extra_stack_alignment_needed; |
d03e67c9 | 243 | gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr; |
d1e3cf49 | 244 | gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos; |
58d5518e | 245 | int parm_boundary; |
f0d4cc9e AC |
246 | const struct floatformat * float_format; |
247 | const struct floatformat * double_format; | |
248 | const struct floatformat * long_double_format; | |
f517ea4e | 249 | gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr; |
875e1767 | 250 | gdbarch_addr_bits_remove_ftype *addr_bits_remove; |
64c4637f | 251 | gdbarch_software_single_step_ftype *software_single_step; |
bdcd319a | 252 | gdbarch_skip_trampoline_code_ftype *skip_trampoline_code; |
adf40b2e | 253 | }; |
0f71a2f6 JM |
254 | |
255 | ||
256 | /* The default architecture uses host values (for want of a better | |
257 | choice). */ | |
258 | ||
259 | extern const struct bfd_arch_info bfd_default_arch_struct; | |
260 | ||
4b9b3959 AC |
261 | struct gdbarch startup_gdbarch = |
262 | { | |
0f71a2f6 JM |
263 | /* basic architecture information */ |
264 | &bfd_default_arch_struct, | |
265 | BIG_ENDIAN, | |
4b9b3959 AC |
266 | /* target specific vector and its dump routine */ |
267 | NULL, NULL, | |
0f71a2f6 JM |
268 | /*per-architecture data-pointers and swap regions */ |
269 | 0, NULL, NULL, | |
270 | /* Multi-arch values */ | |
0f71a2f6 JM |
271 | 8 * sizeof (short), |
272 | 8 * sizeof (int), | |
273 | 8 * sizeof (long), | |
274 | 8 * sizeof (LONGEST), | |
275 | 8 * sizeof (float), | |
276 | 8 * sizeof (double), | |
277 | 8 * sizeof (long double), | |
66b43ecb AC |
278 | 8 * sizeof (void*), |
279 | 8 * sizeof (void*), | |
52204a0b | 280 | 8 * sizeof (void*), |
0f71a2f6 JM |
281 | 0, |
282 | 0, | |
283 | 0, | |
284 | 0, | |
285 | 0, | |
286 | 0, | |
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, | |
b9a8e3bf | 316 | 0, |
7355ddba | 317 | 0, |
03863182 AC |
318 | 0, |
319 | 0, | |
60054393 | 320 | 0, |
0aba1244 | 321 | 0, |
666e11c5 | 322 | 0, |
7c7651b2 | 323 | 0, |
88c72b7d AC |
324 | 0, |
325 | 0, | |
326 | 0, | |
327 | 0, | |
328 | 0, | |
2649061d | 329 | 0, |
61a0eb5b AC |
330 | 0, |
331 | 0, | |
10312cc4 AC |
332 | 0, |
333 | 0, | |
01fb7433 AC |
334 | 0, |
335 | 0, | |
39d4ef09 | 336 | 0, |
0f71a2f6 JM |
337 | generic_get_saved_register, |
338 | 0, | |
339 | 0, | |
340 | 0, | |
341 | 0, | |
342 | 0, | |
343 | 0, | |
344 | 0, | |
345 | 0, | |
346 | 0, | |
347 | 0, | |
348 | 0, | |
349 | 0, | |
350 | 0, | |
351 | 0, | |
352 | 0, | |
353 | 0, | |
354 | 0, | |
355 | 0, | |
356 | 0, | |
357 | 0, | |
358 | 0, | |
359 | 0, | |
360 | 0, | |
361 | 0, | |
362 | 0, | |
363 | 0, | |
364 | 0, | |
365 | 0, | |
366 | 0, | |
367 | 0, | |
368 | 0, | |
369 | 0, | |
370 | 0, | |
371 | 0, | |
372 | 0, | |
917317f4 JM |
373 | 0, |
374 | 0, | |
4478b372 JB |
375 | 0, |
376 | 0, | |
71a9f22e | 377 | 0, |
2ada493a | 378 | 0, |
d03e67c9 | 379 | 0, |
dad41f9a | 380 | 0, |
d1e3cf49 | 381 | 0, |
f0d4cc9e AC |
382 | 0, |
383 | 0, | |
384 | 0, | |
7f1b2585 EZ |
385 | 0, |
386 | 0, | |
bdcd319a | 387 | 0, |
c0e8c252 | 388 | /* startup_gdbarch() */ |
0f71a2f6 | 389 | }; |
4b9b3959 | 390 | |
c0e8c252 | 391 | struct gdbarch *current_gdbarch = &startup_gdbarch; |
0f71a2f6 | 392 | |
ceaa8edf JB |
393 | /* Do any initialization needed for a non-multiarch configuration |
394 | after the _initialize_MODULE functions have been run. */ | |
395 | void | |
396 | initialize_non_multiarch () | |
397 | { | |
398 | alloc_gdbarch_data (&startup_gdbarch); | |
399 | init_gdbarch_data (&startup_gdbarch); | |
400 | } | |
401 | ||
0f71a2f6 | 402 | |
66b43ecb | 403 | /* Create a new ``struct gdbarch'' based on information provided by |
0f71a2f6 JM |
404 | ``struct gdbarch_info''. */ |
405 | ||
406 | struct gdbarch * | |
104c1213 JM |
407 | gdbarch_alloc (const struct gdbarch_info *info, |
408 | struct gdbarch_tdep *tdep) | |
0f71a2f6 JM |
409 | { |
410 | struct gdbarch *gdbarch = XMALLOC (struct gdbarch); | |
411 | memset (gdbarch, 0, sizeof (*gdbarch)); | |
412 | ||
b3cc3077 JB |
413 | alloc_gdbarch_data (gdbarch); |
414 | ||
0f71a2f6 JM |
415 | gdbarch->tdep = tdep; |
416 | ||
417 | gdbarch->bfd_arch_info = info->bfd_arch_info; | |
418 | gdbarch->byte_order = info->byte_order; | |
419 | ||
420 | /* Force the explicit initialization of these. */ | |
66b43ecb AC |
421 | gdbarch->short_bit = 2*TARGET_CHAR_BIT; |
422 | gdbarch->int_bit = 4*TARGET_CHAR_BIT; | |
423 | gdbarch->long_bit = 4*TARGET_CHAR_BIT; | |
424 | gdbarch->long_long_bit = 2*TARGET_LONG_BIT; | |
425 | gdbarch->float_bit = 4*TARGET_CHAR_BIT; | |
426 | gdbarch->double_bit = 8*TARGET_CHAR_BIT; | |
427 | gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT; | |
428 | gdbarch->ptr_bit = TARGET_INT_BIT; | |
c4093a6a | 429 | gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; |
be8dfb87 AC |
430 | gdbarch->read_pc = generic_target_read_pc; |
431 | gdbarch->write_pc = generic_target_write_pc; | |
432 | gdbarch->read_fp = generic_target_read_fp; | |
433 | gdbarch->write_fp = generic_target_write_fp; | |
434 | gdbarch->read_sp = generic_target_read_sp; | |
435 | gdbarch->write_sp = generic_target_write_sp; | |
39d4ef09 | 436 | gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; |
0f71a2f6 JM |
437 | gdbarch->num_regs = -1; |
438 | gdbarch->sp_regnum = -1; | |
439 | gdbarch->fp_regnum = -1; | |
440 | gdbarch->pc_regnum = -1; | |
60054393 | 441 | gdbarch->fp0_regnum = -1; |
03863182 AC |
442 | gdbarch->npc_regnum = -1; |
443 | gdbarch->nnpc_regnum = -1; | |
88c72b7d AC |
444 | gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum; |
445 | gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum; | |
446 | gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum; | |
447 | gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum; | |
448 | gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum; | |
c0e8c252 | 449 | gdbarch->register_name = legacy_register_name; |
0f71a2f6 JM |
450 | gdbarch->register_size = -1; |
451 | gdbarch->register_bytes = -1; | |
452 | gdbarch->max_register_raw_size = -1; | |
453 | gdbarch->max_register_virtual_size = -1; | |
666e11c5 | 454 | gdbarch->do_registers_info = do_registers_info; |
7c7651b2 | 455 | gdbarch->register_sim_regno = default_register_sim_regno; |
01fb7433 AC |
456 | gdbarch->cannot_fetch_register = cannot_register_not; |
457 | gdbarch->cannot_store_register = cannot_register_not; | |
0f71a2f6 JM |
458 | gdbarch->use_generic_dummy_frames = -1; |
459 | gdbarch->call_dummy_start_offset = -1; | |
460 | gdbarch->call_dummy_breakpoint_offset = -1; | |
461 | gdbarch->call_dummy_breakpoint_offset_p = -1; | |
462 | gdbarch->call_dummy_length = -1; | |
463 | gdbarch->call_dummy_p = -1; | |
c0e8c252 AC |
464 | gdbarch->call_dummy_words = legacy_call_dummy_words; |
465 | gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; | |
0f71a2f6 | 466 | gdbarch->call_dummy_stack_adjust_p = -1; |
10312cc4 | 467 | gdbarch->init_frame_pc_first = init_frame_pc_noop; |
7824d2f2 | 468 | gdbarch->init_frame_pc = init_frame_pc_default; |
b9a8e3bf | 469 | gdbarch->coerce_float_to_double = default_coerce_float_to_double; |
c0e8c252 | 470 | gdbarch->register_convertible = generic_register_convertible_not; |
ac2e2ef7 AC |
471 | gdbarch->pointer_to_address = unsigned_pointer_to_address; |
472 | gdbarch->address_to_pointer = unsigned_address_to_pointer; | |
71a9f22e | 473 | gdbarch->return_value_on_stack = generic_return_value_on_stack_not; |
dad41f9a | 474 | gdbarch->prologue_frameless_p = generic_prologue_frameless_p; |
c0e8c252 | 475 | gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; |
917317f4 JM |
476 | gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; |
477 | gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; | |
0f71a2f6 | 478 | gdbarch->decr_pc_after_break = -1; |
e02bc4cc | 479 | gdbarch->prepare_to_proceed = default_prepare_to_proceed; |
0f71a2f6 | 480 | gdbarch->function_start_offset = -1; |
c0e8c252 | 481 | gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address; |
0f71a2f6 | 482 | gdbarch->frame_args_skip = -1; |
c0e8c252 | 483 | gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not; |
1dd4193b | 484 | gdbarch->extra_stack_alignment_needed = 1; |
875e1767 AC |
485 | gdbarch->convert_from_func_ptr_addr = core_addr_identity; |
486 | gdbarch->addr_bits_remove = core_addr_identity; | |
bdcd319a | 487 | gdbarch->skip_trampoline_code = generic_skip_trampoline_code; |
0f71a2f6 JM |
488 | /* gdbarch_alloc() */ |
489 | ||
490 | return gdbarch; | |
491 | } | |
492 | ||
493 | ||
058f20d5 JB |
494 | /* Free a gdbarch struct. This should never happen in normal |
495 | operation --- once you've created a gdbarch, you keep it around. | |
496 | However, if an architecture's init function encounters an error | |
497 | building the structure, it may need to clean up a partially | |
498 | constructed gdbarch. */ | |
4b9b3959 | 499 | |
058f20d5 JB |
500 | void |
501 | gdbarch_free (struct gdbarch *arch) | |
502 | { | |
95160752 AC |
503 | gdb_assert (arch != NULL); |
504 | free_gdbarch_data (arch); | |
338d7c5c | 505 | xfree (arch); |
058f20d5 JB |
506 | } |
507 | ||
508 | ||
0f71a2f6 JM |
509 | /* Ensure that all values in a GDBARCH are reasonable. */ |
510 | ||
0f71a2f6 | 511 | static void |
104c1213 | 512 | verify_gdbarch (struct gdbarch *gdbarch) |
0f71a2f6 JM |
513 | { |
514 | /* Only perform sanity checks on a multi-arch target. */ | |
6166d547 | 515 | if (!GDB_MULTI_ARCH) |
0f71a2f6 JM |
516 | return; |
517 | /* fundamental */ | |
518 | if (gdbarch->byte_order == 0) | |
8e65ff28 AC |
519 | internal_error (__FILE__, __LINE__, |
520 | "verify_gdbarch: byte-order unset"); | |
0f71a2f6 | 521 | if (gdbarch->bfd_arch_info == NULL) |
8e65ff28 AC |
522 | internal_error (__FILE__, __LINE__, |
523 | "verify_gdbarch: bfd_arch_info unset"); | |
0f71a2f6 | 524 | /* Check those that need to be defined for the given multi-arch level. */ |
66b43ecb AC |
525 | /* Skip verify of short_bit, invalid_p == 0 */ |
526 | /* Skip verify of int_bit, invalid_p == 0 */ | |
527 | /* Skip verify of long_bit, invalid_p == 0 */ | |
528 | /* Skip verify of long_long_bit, invalid_p == 0 */ | |
529 | /* Skip verify of float_bit, invalid_p == 0 */ | |
530 | /* Skip verify of double_bit, invalid_p == 0 */ | |
531 | /* Skip verify of long_double_bit, invalid_p == 0 */ | |
532 | /* Skip verify of ptr_bit, invalid_p == 0 */ | |
52204a0b DT |
533 | if (gdbarch->addr_bit == 0) |
534 | gdbarch->addr_bit = TARGET_PTR_BIT; | |
c0e8c252 | 535 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
7355ddba | 536 | /* Skip verify of ieee_float, invalid_p == 0 */ |
be8dfb87 AC |
537 | /* Skip verify of read_pc, invalid_p == 0 */ |
538 | /* Skip verify of write_pc, invalid_p == 0 */ | |
539 | /* Skip verify of read_fp, invalid_p == 0 */ | |
540 | /* Skip verify of write_fp, invalid_p == 0 */ | |
541 | /* Skip verify of read_sp, invalid_p == 0 */ | |
542 | /* Skip verify of write_sp, invalid_p == 0 */ | |
39d4ef09 | 543 | /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ |
61a0eb5b AC |
544 | /* Skip verify of register_read, has predicate */ |
545 | /* Skip verify of register_write, has predicate */ | |
0f71a2f6 JM |
546 | if ((GDB_MULTI_ARCH >= 2) |
547 | && (gdbarch->num_regs == -1)) | |
8e65ff28 AC |
548 | internal_error (__FILE__, __LINE__, |
549 | "gdbarch: verify_gdbarch: num_regs invalid"); | |
0aba1244 | 550 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
0f71a2f6 JM |
551 | if ((GDB_MULTI_ARCH >= 2) |
552 | && (gdbarch->sp_regnum == -1)) | |
8e65ff28 AC |
553 | internal_error (__FILE__, __LINE__, |
554 | "gdbarch: verify_gdbarch: sp_regnum invalid"); | |
0f71a2f6 JM |
555 | if ((GDB_MULTI_ARCH >= 2) |
556 | && (gdbarch->fp_regnum == -1)) | |
8e65ff28 AC |
557 | internal_error (__FILE__, __LINE__, |
558 | "gdbarch: verify_gdbarch: fp_regnum invalid"); | |
0f71a2f6 JM |
559 | if ((GDB_MULTI_ARCH >= 2) |
560 | && (gdbarch->pc_regnum == -1)) | |
8e65ff28 AC |
561 | internal_error (__FILE__, __LINE__, |
562 | "gdbarch: verify_gdbarch: pc_regnum invalid"); | |
60054393 | 563 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
03863182 AC |
564 | /* Skip verify of npc_regnum, invalid_p == 0 */ |
565 | /* Skip verify of nnpc_regnum, invalid_p == 0 */ | |
88c72b7d AC |
566 | /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */ |
567 | /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */ | |
568 | /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */ | |
569 | /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */ | |
570 | /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */ | |
c0e8c252 | 571 | /* Skip verify of register_name, invalid_p == 0 */ |
0f71a2f6 JM |
572 | if ((GDB_MULTI_ARCH >= 2) |
573 | && (gdbarch->register_size == -1)) | |
8e65ff28 AC |
574 | internal_error (__FILE__, __LINE__, |
575 | "gdbarch: verify_gdbarch: register_size invalid"); | |
0f71a2f6 JM |
576 | if ((GDB_MULTI_ARCH >= 2) |
577 | && (gdbarch->register_bytes == -1)) | |
8e65ff28 AC |
578 | internal_error (__FILE__, __LINE__, |
579 | "gdbarch: verify_gdbarch: register_bytes invalid"); | |
0f71a2f6 JM |
580 | if ((GDB_MULTI_ARCH >= 2) |
581 | && (gdbarch->register_byte == 0)) | |
8e65ff28 AC |
582 | internal_error (__FILE__, __LINE__, |
583 | "gdbarch: verify_gdbarch: register_byte invalid"); | |
0f71a2f6 JM |
584 | if ((GDB_MULTI_ARCH >= 2) |
585 | && (gdbarch->register_raw_size == 0)) | |
8e65ff28 AC |
586 | internal_error (__FILE__, __LINE__, |
587 | "gdbarch: verify_gdbarch: register_raw_size invalid"); | |
0f71a2f6 JM |
588 | if ((GDB_MULTI_ARCH >= 2) |
589 | && (gdbarch->max_register_raw_size == -1)) | |
8e65ff28 AC |
590 | internal_error (__FILE__, __LINE__, |
591 | "gdbarch: verify_gdbarch: max_register_raw_size invalid"); | |
0f71a2f6 JM |
592 | if ((GDB_MULTI_ARCH >= 2) |
593 | && (gdbarch->register_virtual_size == 0)) | |
8e65ff28 AC |
594 | internal_error (__FILE__, __LINE__, |
595 | "gdbarch: verify_gdbarch: register_virtual_size invalid"); | |
0f71a2f6 JM |
596 | if ((GDB_MULTI_ARCH >= 2) |
597 | && (gdbarch->max_register_virtual_size == -1)) | |
8e65ff28 AC |
598 | internal_error (__FILE__, __LINE__, |
599 | "gdbarch: verify_gdbarch: max_register_virtual_size invalid"); | |
0f71a2f6 JM |
600 | if ((GDB_MULTI_ARCH >= 2) |
601 | && (gdbarch->register_virtual_type == 0)) | |
8e65ff28 AC |
602 | internal_error (__FILE__, __LINE__, |
603 | "gdbarch: verify_gdbarch: register_virtual_type invalid"); | |
666e11c5 | 604 | /* Skip verify of do_registers_info, invalid_p == 0 */ |
7c7651b2 | 605 | /* Skip verify of register_sim_regno, invalid_p == 0 */ |
2649061d | 606 | /* Skip verify of register_bytes_ok, has predicate */ |
01fb7433 AC |
607 | /* Skip verify of cannot_fetch_register, invalid_p == 0 */ |
608 | /* Skip verify of cannot_store_register, invalid_p == 0 */ | |
0f71a2f6 JM |
609 | if ((GDB_MULTI_ARCH >= 1) |
610 | && (gdbarch->use_generic_dummy_frames == -1)) | |
8e65ff28 AC |
611 | internal_error (__FILE__, __LINE__, |
612 | "gdbarch: verify_gdbarch: use_generic_dummy_frames invalid"); | |
0f71a2f6 JM |
613 | if ((GDB_MULTI_ARCH >= 2) |
614 | && (gdbarch->call_dummy_location == 0)) | |
8e65ff28 AC |
615 | internal_error (__FILE__, __LINE__, |
616 | "gdbarch: verify_gdbarch: call_dummy_location invalid"); | |
0f71a2f6 JM |
617 | if ((GDB_MULTI_ARCH >= 2) |
618 | && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0)) | |
8e65ff28 AC |
619 | internal_error (__FILE__, __LINE__, |
620 | "gdbarch: verify_gdbarch: call_dummy_address invalid"); | |
0f71a2f6 JM |
621 | if ((GDB_MULTI_ARCH >= 2) |
622 | && (gdbarch->call_dummy_start_offset == -1)) | |
8e65ff28 AC |
623 | internal_error (__FILE__, __LINE__, |
624 | "gdbarch: verify_gdbarch: call_dummy_start_offset invalid"); | |
0f71a2f6 JM |
625 | if ((GDB_MULTI_ARCH >= 2) |
626 | && (gdbarch->call_dummy_breakpoint_offset == -1)) | |
8e65ff28 AC |
627 | internal_error (__FILE__, __LINE__, |
628 | "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid"); | |
0f71a2f6 JM |
629 | if ((GDB_MULTI_ARCH >= 1) |
630 | && (gdbarch->call_dummy_breakpoint_offset_p == -1)) | |
8e65ff28 AC |
631 | internal_error (__FILE__, __LINE__, |
632 | "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid"); | |
0f71a2f6 JM |
633 | if ((GDB_MULTI_ARCH >= 2) |
634 | && (gdbarch->call_dummy_length == -1)) | |
8e65ff28 AC |
635 | internal_error (__FILE__, __LINE__, |
636 | "gdbarch: verify_gdbarch: call_dummy_length invalid"); | |
0f71a2f6 JM |
637 | if ((GDB_MULTI_ARCH >= 2) |
638 | && (gdbarch->pc_in_call_dummy == 0)) | |
8e65ff28 AC |
639 | internal_error (__FILE__, __LINE__, |
640 | "gdbarch: verify_gdbarch: pc_in_call_dummy invalid"); | |
0f71a2f6 JM |
641 | if ((GDB_MULTI_ARCH >= 1) |
642 | && (gdbarch->call_dummy_p == -1)) | |
8e65ff28 AC |
643 | internal_error (__FILE__, __LINE__, |
644 | "gdbarch: verify_gdbarch: call_dummy_p invalid"); | |
c0e8c252 AC |
645 | /* Skip verify of call_dummy_words, invalid_p == 0 */ |
646 | /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ | |
0f71a2f6 JM |
647 | if ((GDB_MULTI_ARCH >= 1) |
648 | && (gdbarch->call_dummy_stack_adjust_p == -1)) | |
8e65ff28 AC |
649 | internal_error (__FILE__, __LINE__, |
650 | "gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid"); | |
0f71a2f6 JM |
651 | if ((GDB_MULTI_ARCH >= 2) |
652 | && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)) | |
8e65ff28 AC |
653 | internal_error (__FILE__, __LINE__, |
654 | "gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid"); | |
0f71a2f6 JM |
655 | if ((GDB_MULTI_ARCH >= 2) |
656 | && (gdbarch->fix_call_dummy == 0)) | |
8e65ff28 AC |
657 | internal_error (__FILE__, __LINE__, |
658 | "gdbarch: verify_gdbarch: fix_call_dummy invalid"); | |
10312cc4 AC |
659 | /* Skip verify of init_frame_pc_first, invalid_p == 0 */ |
660 | /* Skip verify of init_frame_pc, invalid_p == 0 */ | |
c0e8c252 | 661 | /* Skip verify of coerce_float_to_double, invalid_p == 0 */ |
0f71a2f6 JM |
662 | if ((GDB_MULTI_ARCH >= 1) |
663 | && (gdbarch->get_saved_register == 0)) | |
8e65ff28 AC |
664 | internal_error (__FILE__, __LINE__, |
665 | "gdbarch: verify_gdbarch: get_saved_register invalid"); | |
c0e8c252 AC |
666 | /* Skip verify of register_convertible, invalid_p == 0 */ |
667 | /* Skip verify of register_convert_to_virtual, invalid_p == 0 */ | |
668 | /* Skip verify of register_convert_to_raw, invalid_p == 0 */ | |
7f1b2585 EZ |
669 | /* Skip verify of fetch_pseudo_register, invalid_p == 0 */ |
670 | /* Skip verify of store_pseudo_register, invalid_p == 0 */ | |
4478b372 JB |
671 | /* Skip verify of pointer_to_address, invalid_p == 0 */ |
672 | /* Skip verify of address_to_pointer, invalid_p == 0 */ | |
71a9f22e | 673 | /* Skip verify of return_value_on_stack, invalid_p == 0 */ |
0f71a2f6 JM |
674 | if ((GDB_MULTI_ARCH >= 2) |
675 | && (gdbarch->extract_return_value == 0)) | |
8e65ff28 AC |
676 | internal_error (__FILE__, __LINE__, |
677 | "gdbarch: verify_gdbarch: extract_return_value invalid"); | |
0f71a2f6 JM |
678 | if ((GDB_MULTI_ARCH >= 1) |
679 | && (gdbarch->push_arguments == 0)) | |
8e65ff28 AC |
680 | internal_error (__FILE__, __LINE__, |
681 | "gdbarch: verify_gdbarch: push_arguments invalid"); | |
0f71a2f6 JM |
682 | if ((GDB_MULTI_ARCH >= 2) |
683 | && (gdbarch->push_dummy_frame == 0)) | |
8e65ff28 AC |
684 | internal_error (__FILE__, __LINE__, |
685 | "gdbarch: verify_gdbarch: push_dummy_frame invalid"); | |
0f71a2f6 JM |
686 | if ((GDB_MULTI_ARCH >= 1) |
687 | && (gdbarch->push_return_address == 0)) | |
8e65ff28 AC |
688 | internal_error (__FILE__, __LINE__, |
689 | "gdbarch: verify_gdbarch: push_return_address invalid"); | |
0f71a2f6 JM |
690 | if ((GDB_MULTI_ARCH >= 2) |
691 | && (gdbarch->pop_frame == 0)) | |
8e65ff28 AC |
692 | internal_error (__FILE__, __LINE__, |
693 | "gdbarch: verify_gdbarch: pop_frame invalid"); | |
0f71a2f6 JM |
694 | if ((GDB_MULTI_ARCH >= 2) |
695 | && (gdbarch->store_struct_return == 0)) | |
8e65ff28 AC |
696 | internal_error (__FILE__, __LINE__, |
697 | "gdbarch: verify_gdbarch: store_struct_return invalid"); | |
0f71a2f6 JM |
698 | if ((GDB_MULTI_ARCH >= 2) |
699 | && (gdbarch->store_return_value == 0)) | |
8e65ff28 AC |
700 | internal_error (__FILE__, __LINE__, |
701 | "gdbarch: verify_gdbarch: store_return_value invalid"); | |
d6dd581e | 702 | /* Skip verify of extract_struct_value_address, has predicate */ |
0f71a2f6 JM |
703 | if ((GDB_MULTI_ARCH >= 2) |
704 | && (gdbarch->use_struct_convention == 0)) | |
8e65ff28 AC |
705 | internal_error (__FILE__, __LINE__, |
706 | "gdbarch: verify_gdbarch: use_struct_convention invalid"); | |
0f71a2f6 JM |
707 | if ((GDB_MULTI_ARCH >= 2) |
708 | && (gdbarch->frame_init_saved_regs == 0)) | |
8e65ff28 AC |
709 | internal_error (__FILE__, __LINE__, |
710 | "gdbarch: verify_gdbarch: frame_init_saved_regs invalid"); | |
0f71a2f6 JM |
711 | if ((GDB_MULTI_ARCH >= 2) |
712 | && (gdbarch->init_extra_frame_info == 0)) | |
8e65ff28 AC |
713 | internal_error (__FILE__, __LINE__, |
714 | "gdbarch: verify_gdbarch: init_extra_frame_info invalid"); | |
0f71a2f6 JM |
715 | if ((GDB_MULTI_ARCH >= 2) |
716 | && (gdbarch->skip_prologue == 0)) | |
8e65ff28 AC |
717 | internal_error (__FILE__, __LINE__, |
718 | "gdbarch: verify_gdbarch: skip_prologue invalid"); | |
dad41f9a | 719 | /* Skip verify of prologue_frameless_p, invalid_p == 0 */ |
0f71a2f6 JM |
720 | if ((GDB_MULTI_ARCH >= 2) |
721 | && (gdbarch->inner_than == 0)) | |
8e65ff28 AC |
722 | internal_error (__FILE__, __LINE__, |
723 | "gdbarch: verify_gdbarch: inner_than invalid"); | |
c0e8c252 AC |
724 | /* Skip verify of breakpoint_from_pc, invalid_p == 0 */ |
725 | /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ | |
726 | /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ | |
0f71a2f6 JM |
727 | if ((GDB_MULTI_ARCH >= 2) |
728 | && (gdbarch->decr_pc_after_break == -1)) | |
8e65ff28 AC |
729 | internal_error (__FILE__, __LINE__, |
730 | "gdbarch: verify_gdbarch: decr_pc_after_break invalid"); | |
e02bc4cc | 731 | /* Skip verify of prepare_to_proceed, invalid_p == 0 */ |
0f71a2f6 JM |
732 | if ((GDB_MULTI_ARCH >= 2) |
733 | && (gdbarch->function_start_offset == -1)) | |
8e65ff28 AC |
734 | internal_error (__FILE__, __LINE__, |
735 | "gdbarch: verify_gdbarch: function_start_offset invalid"); | |
c0e8c252 | 736 | /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */ |
0f71a2f6 JM |
737 | if ((GDB_MULTI_ARCH >= 2) |
738 | && (gdbarch->frame_args_skip == -1)) | |
8e65ff28 AC |
739 | internal_error (__FILE__, __LINE__, |
740 | "gdbarch: verify_gdbarch: frame_args_skip invalid"); | |
c0e8c252 | 741 | /* Skip verify of frameless_function_invocation, invalid_p == 0 */ |
0f71a2f6 JM |
742 | if ((GDB_MULTI_ARCH >= 2) |
743 | && (gdbarch->frame_chain == 0)) | |
8e65ff28 AC |
744 | internal_error (__FILE__, __LINE__, |
745 | "gdbarch: verify_gdbarch: frame_chain invalid"); | |
0f71a2f6 JM |
746 | if ((GDB_MULTI_ARCH >= 1) |
747 | && (gdbarch->frame_chain_valid == 0)) | |
8e65ff28 AC |
748 | internal_error (__FILE__, __LINE__, |
749 | "gdbarch: verify_gdbarch: frame_chain_valid invalid"); | |
0f71a2f6 JM |
750 | if ((GDB_MULTI_ARCH >= 2) |
751 | && (gdbarch->frame_saved_pc == 0)) | |
8e65ff28 AC |
752 | internal_error (__FILE__, __LINE__, |
753 | "gdbarch: verify_gdbarch: frame_saved_pc invalid"); | |
0f71a2f6 JM |
754 | if ((GDB_MULTI_ARCH >= 2) |
755 | && (gdbarch->frame_args_address == 0)) | |
8e65ff28 AC |
756 | internal_error (__FILE__, __LINE__, |
757 | "gdbarch: verify_gdbarch: frame_args_address invalid"); | |
0f71a2f6 JM |
758 | if ((GDB_MULTI_ARCH >= 2) |
759 | && (gdbarch->frame_locals_address == 0)) | |
8e65ff28 AC |
760 | internal_error (__FILE__, __LINE__, |
761 | "gdbarch: verify_gdbarch: frame_locals_address invalid"); | |
0f71a2f6 JM |
762 | if ((GDB_MULTI_ARCH >= 2) |
763 | && (gdbarch->saved_pc_after_call == 0)) | |
8e65ff28 AC |
764 | internal_error (__FILE__, __LINE__, |
765 | "gdbarch: verify_gdbarch: saved_pc_after_call invalid"); | |
0f71a2f6 JM |
766 | if ((GDB_MULTI_ARCH >= 2) |
767 | && (gdbarch->frame_num_args == 0)) | |
8e65ff28 AC |
768 | internal_error (__FILE__, __LINE__, |
769 | "gdbarch: verify_gdbarch: frame_num_args invalid"); | |
2ada493a | 770 | /* Skip verify of stack_align, has predicate */ |
1dd4193b | 771 | /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ |
d03e67c9 | 772 | /* Skip verify of reg_struct_has_addr, has predicate */ |
d1e3cf49 | 773 | /* Skip verify of save_dummy_frame_tos, has predicate */ |
f0d4cc9e AC |
774 | if (gdbarch->float_format == 0) |
775 | gdbarch->float_format = default_float_format (gdbarch); | |
776 | if (gdbarch->double_format == 0) | |
777 | gdbarch->double_format = default_double_format (gdbarch); | |
778 | if (gdbarch->long_double_format == 0) | |
779 | gdbarch->long_double_format = &floatformat_unknown; | |
f517ea4e | 780 | /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ |
875e1767 | 781 | /* Skip verify of addr_bits_remove, invalid_p == 0 */ |
64c4637f | 782 | /* Skip verify of software_single_step, has predicate */ |
bdcd319a | 783 | /* Skip verify of skip_trampoline_code, invalid_p == 0 */ |
0f71a2f6 JM |
784 | } |
785 | ||
786 | ||
787 | /* Print out the details of the current architecture. */ | |
788 | ||
4b9b3959 AC |
789 | /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it |
790 | just happens to match the global variable ``current_gdbarch''. That | |
791 | way macros refering to that variable get the local and not the global | |
792 | version - ulgh. Once everything is parameterised with gdbarch, this | |
793 | will go away. */ | |
794 | ||
0f71a2f6 | 795 | void |
4b9b3959 | 796 | gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) |
0f71a2f6 | 797 | { |
4b9b3959 AC |
798 | fprintf_unfiltered (file, |
799 | "gdbarch_dump: GDB_MULTI_ARCH = %d\n", | |
800 | GDB_MULTI_ARCH); | |
801 | #ifdef TARGET_ARCHITECTURE | |
802 | fprintf_unfiltered (file, | |
803 | "gdbarch_dump: TARGET_ARCHITECTURE # %s\n", | |
804 | XSTRING (TARGET_ARCHITECTURE)); | |
805 | #endif | |
806 | #ifdef TARGET_BYTE_ORDER | |
807 | fprintf_unfiltered (file, | |
808 | "gdbarch_dump: TARGET_BYTE_ORDER # %s\n", | |
809 | XSTRING (TARGET_BYTE_ORDER)); | |
810 | #endif | |
4b9b3959 AC |
811 | #ifdef TARGET_SHORT_BIT |
812 | fprintf_unfiltered (file, | |
813 | "gdbarch_dump: TARGET_SHORT_BIT # %s\n", | |
814 | XSTRING (TARGET_SHORT_BIT)); | |
815 | #endif | |
816 | #ifdef TARGET_INT_BIT | |
817 | fprintf_unfiltered (file, | |
818 | "gdbarch_dump: TARGET_INT_BIT # %s\n", | |
819 | XSTRING (TARGET_INT_BIT)); | |
820 | #endif | |
821 | #ifdef TARGET_LONG_BIT | |
822 | fprintf_unfiltered (file, | |
823 | "gdbarch_dump: TARGET_LONG_BIT # %s\n", | |
824 | XSTRING (TARGET_LONG_BIT)); | |
825 | #endif | |
826 | #ifdef TARGET_LONG_LONG_BIT | |
827 | fprintf_unfiltered (file, | |
828 | "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n", | |
829 | XSTRING (TARGET_LONG_LONG_BIT)); | |
830 | #endif | |
831 | #ifdef TARGET_FLOAT_BIT | |
832 | fprintf_unfiltered (file, | |
833 | "gdbarch_dump: TARGET_FLOAT_BIT # %s\n", | |
834 | XSTRING (TARGET_FLOAT_BIT)); | |
835 | #endif | |
836 | #ifdef TARGET_DOUBLE_BIT | |
837 | fprintf_unfiltered (file, | |
838 | "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n", | |
839 | XSTRING (TARGET_DOUBLE_BIT)); | |
840 | #endif | |
841 | #ifdef TARGET_LONG_DOUBLE_BIT | |
842 | fprintf_unfiltered (file, | |
843 | "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n", | |
844 | XSTRING (TARGET_LONG_DOUBLE_BIT)); | |
845 | #endif | |
66b43ecb AC |
846 | #ifdef TARGET_PTR_BIT |
847 | fprintf_unfiltered (file, | |
848 | "gdbarch_dump: TARGET_PTR_BIT # %s\n", | |
849 | XSTRING (TARGET_PTR_BIT)); | |
850 | #endif | |
52204a0b DT |
851 | #ifdef TARGET_ADDR_BIT |
852 | fprintf_unfiltered (file, | |
853 | "gdbarch_dump: TARGET_ADDR_BIT # %s\n", | |
854 | XSTRING (TARGET_ADDR_BIT)); | |
855 | #endif | |
66b43ecb AC |
856 | #ifdef TARGET_BFD_VMA_BIT |
857 | fprintf_unfiltered (file, | |
858 | "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n", | |
859 | XSTRING (TARGET_BFD_VMA_BIT)); | |
860 | #endif | |
4b9b3959 AC |
861 | #ifdef IEEE_FLOAT |
862 | fprintf_unfiltered (file, | |
863 | "gdbarch_dump: IEEE_FLOAT # %s\n", | |
864 | XSTRING (IEEE_FLOAT)); | |
865 | #endif | |
866 | #ifdef TARGET_READ_PC | |
867 | fprintf_unfiltered (file, | |
868 | "gdbarch_dump: %s # %s\n", | |
39f77062 KB |
869 | "TARGET_READ_PC(ptid)", |
870 | XSTRING (TARGET_READ_PC (ptid))); | |
4b9b3959 | 871 | #endif |
63e69063 AC |
872 | #if defined (TARGET_WRITE_PC) && GDB_MULTI_ARCH |
873 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
874 | fprintf_unfiltered (file, |
875 | "gdbarch_dump: %s # %s\n", | |
39f77062 KB |
876 | "TARGET_WRITE_PC(val, ptid)", |
877 | XSTRING (TARGET_WRITE_PC (val, ptid))); | |
4b9b3959 AC |
878 | #endif |
879 | #ifdef TARGET_READ_FP | |
880 | fprintf_unfiltered (file, | |
881 | "gdbarch_dump: %s # %s\n", | |
882 | "TARGET_READ_FP()", | |
883 | XSTRING (TARGET_READ_FP ())); | |
884 | #endif | |
63e69063 AC |
885 | #if defined (TARGET_WRITE_FP) && GDB_MULTI_ARCH |
886 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
887 | fprintf_unfiltered (file, |
888 | "gdbarch_dump: %s # %s\n", | |
889 | "TARGET_WRITE_FP(val)", | |
890 | XSTRING (TARGET_WRITE_FP (val))); | |
891 | #endif | |
892 | #ifdef TARGET_READ_SP | |
893 | fprintf_unfiltered (file, | |
894 | "gdbarch_dump: %s # %s\n", | |
895 | "TARGET_READ_SP()", | |
896 | XSTRING (TARGET_READ_SP ())); | |
897 | #endif | |
63e69063 AC |
898 | #if defined (TARGET_WRITE_SP) && GDB_MULTI_ARCH |
899 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
900 | fprintf_unfiltered (file, |
901 | "gdbarch_dump: %s # %s\n", | |
902 | "TARGET_WRITE_SP(val)", | |
903 | XSTRING (TARGET_WRITE_SP (val))); | |
904 | #endif | |
39d4ef09 AC |
905 | #if defined (TARGET_VIRTUAL_FRAME_POINTER) && GDB_MULTI_ARCH |
906 | /* Macro might contain `[{}]' when not multi-arch */ | |
907 | fprintf_unfiltered (file, | |
908 | "gdbarch_dump: %s # %s\n", | |
909 | "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)", | |
910 | XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset))); | |
911 | #endif | |
4b9b3959 AC |
912 | #ifdef NUM_REGS |
913 | fprintf_unfiltered (file, | |
914 | "gdbarch_dump: NUM_REGS # %s\n", | |
915 | XSTRING (NUM_REGS)); | |
916 | #endif | |
0aba1244 EZ |
917 | #ifdef NUM_PSEUDO_REGS |
918 | fprintf_unfiltered (file, | |
919 | "gdbarch_dump: NUM_PSEUDO_REGS # %s\n", | |
920 | XSTRING (NUM_PSEUDO_REGS)); | |
921 | #endif | |
4b9b3959 AC |
922 | #ifdef SP_REGNUM |
923 | fprintf_unfiltered (file, | |
924 | "gdbarch_dump: SP_REGNUM # %s\n", | |
925 | XSTRING (SP_REGNUM)); | |
926 | #endif | |
927 | #ifdef FP_REGNUM | |
928 | fprintf_unfiltered (file, | |
929 | "gdbarch_dump: FP_REGNUM # %s\n", | |
930 | XSTRING (FP_REGNUM)); | |
931 | #endif | |
932 | #ifdef PC_REGNUM | |
933 | fprintf_unfiltered (file, | |
934 | "gdbarch_dump: PC_REGNUM # %s\n", | |
935 | XSTRING (PC_REGNUM)); | |
936 | #endif | |
937 | #ifdef FP0_REGNUM | |
938 | fprintf_unfiltered (file, | |
939 | "gdbarch_dump: FP0_REGNUM # %s\n", | |
940 | XSTRING (FP0_REGNUM)); | |
941 | #endif | |
942 | #ifdef NPC_REGNUM | |
943 | fprintf_unfiltered (file, | |
944 | "gdbarch_dump: NPC_REGNUM # %s\n", | |
945 | XSTRING (NPC_REGNUM)); | |
946 | #endif | |
947 | #ifdef NNPC_REGNUM | |
948 | fprintf_unfiltered (file, | |
949 | "gdbarch_dump: NNPC_REGNUM # %s\n", | |
950 | XSTRING (NNPC_REGNUM)); | |
951 | #endif | |
88c72b7d AC |
952 | #ifdef STAB_REG_TO_REGNUM |
953 | fprintf_unfiltered (file, | |
954 | "gdbarch_dump: %s # %s\n", | |
955 | "STAB_REG_TO_REGNUM(stab_regnr)", | |
956 | XSTRING (STAB_REG_TO_REGNUM (stab_regnr))); | |
957 | #endif | |
958 | #ifdef ECOFF_REG_TO_REGNUM | |
959 | fprintf_unfiltered (file, | |
960 | "gdbarch_dump: %s # %s\n", | |
961 | "ECOFF_REG_TO_REGNUM(ecoff_regnr)", | |
962 | XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr))); | |
963 | #endif | |
964 | #ifdef DWARF_REG_TO_REGNUM | |
965 | fprintf_unfiltered (file, | |
966 | "gdbarch_dump: %s # %s\n", | |
967 | "DWARF_REG_TO_REGNUM(dwarf_regnr)", | |
968 | XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr))); | |
969 | #endif | |
970 | #ifdef SDB_REG_TO_REGNUM | |
971 | fprintf_unfiltered (file, | |
972 | "gdbarch_dump: %s # %s\n", | |
973 | "SDB_REG_TO_REGNUM(sdb_regnr)", | |
974 | XSTRING (SDB_REG_TO_REGNUM (sdb_regnr))); | |
975 | #endif | |
976 | #ifdef DWARF2_REG_TO_REGNUM | |
977 | fprintf_unfiltered (file, | |
978 | "gdbarch_dump: %s # %s\n", | |
979 | "DWARF2_REG_TO_REGNUM(dwarf2_regnr)", | |
980 | XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr))); | |
981 | #endif | |
4b9b3959 AC |
982 | #ifdef REGISTER_NAME |
983 | fprintf_unfiltered (file, | |
984 | "gdbarch_dump: %s # %s\n", | |
985 | "REGISTER_NAME(regnr)", | |
986 | XSTRING (REGISTER_NAME (regnr))); | |
987 | #endif | |
988 | #ifdef REGISTER_SIZE | |
989 | fprintf_unfiltered (file, | |
990 | "gdbarch_dump: REGISTER_SIZE # %s\n", | |
991 | XSTRING (REGISTER_SIZE)); | |
992 | #endif | |
993 | #ifdef REGISTER_BYTES | |
994 | fprintf_unfiltered (file, | |
995 | "gdbarch_dump: REGISTER_BYTES # %s\n", | |
996 | XSTRING (REGISTER_BYTES)); | |
997 | #endif | |
998 | #ifdef REGISTER_BYTE | |
999 | fprintf_unfiltered (file, | |
1000 | "gdbarch_dump: %s # %s\n", | |
1001 | "REGISTER_BYTE(reg_nr)", | |
1002 | XSTRING (REGISTER_BYTE (reg_nr))); | |
1003 | #endif | |
1004 | #ifdef REGISTER_RAW_SIZE | |
1005 | fprintf_unfiltered (file, | |
1006 | "gdbarch_dump: %s # %s\n", | |
1007 | "REGISTER_RAW_SIZE(reg_nr)", | |
1008 | XSTRING (REGISTER_RAW_SIZE (reg_nr))); | |
1009 | #endif | |
1010 | #ifdef MAX_REGISTER_RAW_SIZE | |
1011 | fprintf_unfiltered (file, | |
1012 | "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n", | |
1013 | XSTRING (MAX_REGISTER_RAW_SIZE)); | |
1014 | #endif | |
1015 | #ifdef REGISTER_VIRTUAL_SIZE | |
1016 | fprintf_unfiltered (file, | |
1017 | "gdbarch_dump: %s # %s\n", | |
1018 | "REGISTER_VIRTUAL_SIZE(reg_nr)", | |
1019 | XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr))); | |
1020 | #endif | |
1021 | #ifdef MAX_REGISTER_VIRTUAL_SIZE | |
1022 | fprintf_unfiltered (file, | |
1023 | "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n", | |
1024 | XSTRING (MAX_REGISTER_VIRTUAL_SIZE)); | |
1025 | #endif | |
1026 | #ifdef REGISTER_VIRTUAL_TYPE | |
1027 | fprintf_unfiltered (file, | |
1028 | "gdbarch_dump: %s # %s\n", | |
1029 | "REGISTER_VIRTUAL_TYPE(reg_nr)", | |
1030 | XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr))); | |
1031 | #endif | |
666e11c5 EZ |
1032 | #if defined (DO_REGISTERS_INFO) && GDB_MULTI_ARCH |
1033 | /* Macro might contain `[{}]' when not multi-arch */ | |
1034 | fprintf_unfiltered (file, | |
1035 | "gdbarch_dump: %s # %s\n", | |
1036 | "DO_REGISTERS_INFO(reg_nr, fpregs)", | |
1037 | XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs))); | |
1038 | #endif | |
7c7651b2 AC |
1039 | #ifdef REGISTER_SIM_REGNO |
1040 | fprintf_unfiltered (file, | |
1041 | "gdbarch_dump: %s # %s\n", | |
1042 | "REGISTER_SIM_REGNO(reg_nr)", | |
1043 | XSTRING (REGISTER_SIM_REGNO (reg_nr))); | |
1044 | #endif | |
2649061d AC |
1045 | #ifdef REGISTER_BYTES_OK |
1046 | fprintf_unfiltered (file, | |
1047 | "gdbarch_dump: %s # %s\n", | |
1048 | "REGISTER_BYTES_OK(nr_bytes)", | |
1049 | XSTRING (REGISTER_BYTES_OK (nr_bytes))); | |
1050 | #endif | |
01fb7433 AC |
1051 | #ifdef CANNOT_FETCH_REGISTER |
1052 | fprintf_unfiltered (file, | |
1053 | "gdbarch_dump: %s # %s\n", | |
1622c8f7 AC |
1054 | "CANNOT_FETCH_REGISTER(regnum)", |
1055 | XSTRING (CANNOT_FETCH_REGISTER (regnum))); | |
01fb7433 AC |
1056 | #endif |
1057 | #ifdef CANNOT_STORE_REGISTER | |
1058 | fprintf_unfiltered (file, | |
1059 | "gdbarch_dump: %s # %s\n", | |
1622c8f7 AC |
1060 | "CANNOT_STORE_REGISTER(regnum)", |
1061 | XSTRING (CANNOT_STORE_REGISTER (regnum))); | |
01fb7433 | 1062 | #endif |
4b9b3959 AC |
1063 | #ifdef USE_GENERIC_DUMMY_FRAMES |
1064 | fprintf_unfiltered (file, | |
1065 | "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n", | |
1066 | XSTRING (USE_GENERIC_DUMMY_FRAMES)); | |
1067 | #endif | |
1068 | #ifdef CALL_DUMMY_LOCATION | |
1069 | fprintf_unfiltered (file, | |
1070 | "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n", | |
1071 | XSTRING (CALL_DUMMY_LOCATION)); | |
1072 | #endif | |
1073 | #ifdef CALL_DUMMY_ADDRESS | |
1074 | fprintf_unfiltered (file, | |
1075 | "gdbarch_dump: %s # %s\n", | |
1076 | "CALL_DUMMY_ADDRESS()", | |
1077 | XSTRING (CALL_DUMMY_ADDRESS ())); | |
1078 | #endif | |
1079 | #ifdef CALL_DUMMY_START_OFFSET | |
1080 | fprintf_unfiltered (file, | |
1081 | "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n", | |
1082 | XSTRING (CALL_DUMMY_START_OFFSET)); | |
1083 | #endif | |
1084 | #ifdef CALL_DUMMY_BREAKPOINT_OFFSET | |
1085 | fprintf_unfiltered (file, | |
1086 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n", | |
1087 | XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET)); | |
1088 | #endif | |
1089 | #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P | |
1090 | fprintf_unfiltered (file, | |
1091 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n", | |
1092 | XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P)); | |
1093 | #endif | |
1094 | #ifdef CALL_DUMMY_LENGTH | |
1095 | fprintf_unfiltered (file, | |
1096 | "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n", | |
1097 | XSTRING (CALL_DUMMY_LENGTH)); | |
1098 | #endif | |
1099 | #ifdef PC_IN_CALL_DUMMY | |
1100 | fprintf_unfiltered (file, | |
1101 | "gdbarch_dump: %s # %s\n", | |
1102 | "PC_IN_CALL_DUMMY(pc, sp, frame_address)", | |
1103 | XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address))); | |
1104 | #endif | |
1105 | #ifdef CALL_DUMMY_P | |
1106 | fprintf_unfiltered (file, | |
1107 | "gdbarch_dump: CALL_DUMMY_P # %s\n", | |
1108 | XSTRING (CALL_DUMMY_P)); | |
1109 | #endif | |
1110 | #ifdef CALL_DUMMY_WORDS | |
1111 | fprintf_unfiltered (file, | |
1112 | "gdbarch_dump: CALL_DUMMY_WORDS # %s\n", | |
1113 | XSTRING (CALL_DUMMY_WORDS)); | |
1114 | #endif | |
1115 | #ifdef SIZEOF_CALL_DUMMY_WORDS | |
1116 | fprintf_unfiltered (file, | |
1117 | "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n", | |
1118 | XSTRING (SIZEOF_CALL_DUMMY_WORDS)); | |
1119 | #endif | |
1120 | #ifdef CALL_DUMMY_STACK_ADJUST_P | |
1121 | fprintf_unfiltered (file, | |
1122 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n", | |
1123 | XSTRING (CALL_DUMMY_STACK_ADJUST_P)); | |
1124 | #endif | |
1125 | #ifdef CALL_DUMMY_STACK_ADJUST | |
1126 | fprintf_unfiltered (file, | |
1127 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n", | |
1128 | XSTRING (CALL_DUMMY_STACK_ADJUST)); | |
1129 | #endif | |
63e69063 AC |
1130 | #if defined (FIX_CALL_DUMMY) && GDB_MULTI_ARCH |
1131 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1132 | fprintf_unfiltered (file, |
1133 | "gdbarch_dump: %s # %s\n", | |
1134 | "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)", | |
1135 | XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p))); | |
1136 | #endif | |
10312cc4 AC |
1137 | #if defined (INIT_FRAME_PC_FIRST) && GDB_MULTI_ARCH |
1138 | /* Macro might contain `[{}]' when not multi-arch */ | |
1139 | fprintf_unfiltered (file, | |
1140 | "gdbarch_dump: %s # %s\n", | |
1141 | "INIT_FRAME_PC_FIRST(fromleaf, prev)", | |
1142 | XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev))); | |
1143 | #endif | |
1144 | #if defined (INIT_FRAME_PC) && GDB_MULTI_ARCH | |
1145 | /* Macro might contain `[{}]' when not multi-arch */ | |
1146 | fprintf_unfiltered (file, | |
1147 | "gdbarch_dump: %s # %s\n", | |
1148 | "INIT_FRAME_PC(fromleaf, prev)", | |
1149 | XSTRING (INIT_FRAME_PC (fromleaf, prev))); | |
1150 | #endif | |
4b9b3959 AC |
1151 | #ifdef BELIEVE_PCC_PROMOTION |
1152 | fprintf_unfiltered (file, | |
1153 | "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n", | |
1154 | XSTRING (BELIEVE_PCC_PROMOTION)); | |
1155 | #endif | |
1156 | #ifdef BELIEVE_PCC_PROMOTION_TYPE | |
1157 | fprintf_unfiltered (file, | |
1158 | "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n", | |
1159 | XSTRING (BELIEVE_PCC_PROMOTION_TYPE)); | |
1160 | #endif | |
1161 | #ifdef COERCE_FLOAT_TO_DOUBLE | |
1162 | fprintf_unfiltered (file, | |
1163 | "gdbarch_dump: %s # %s\n", | |
1164 | "COERCE_FLOAT_TO_DOUBLE(formal, actual)", | |
1165 | XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual))); | |
1166 | #endif | |
63e69063 AC |
1167 | #if defined (GET_SAVED_REGISTER) && GDB_MULTI_ARCH |
1168 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1169 | fprintf_unfiltered (file, |
1170 | "gdbarch_dump: %s # %s\n", | |
1171 | "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)", | |
1172 | XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval))); | |
1173 | #endif | |
1174 | #ifdef REGISTER_CONVERTIBLE | |
1175 | fprintf_unfiltered (file, | |
1176 | "gdbarch_dump: %s # %s\n", | |
1177 | "REGISTER_CONVERTIBLE(nr)", | |
1178 | XSTRING (REGISTER_CONVERTIBLE (nr))); | |
1179 | #endif | |
63e69063 AC |
1180 | #if defined (REGISTER_CONVERT_TO_VIRTUAL) && GDB_MULTI_ARCH |
1181 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1182 | fprintf_unfiltered (file, |
1183 | "gdbarch_dump: %s # %s\n", | |
1184 | "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)", | |
1185 | XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to))); | |
1186 | #endif | |
63e69063 AC |
1187 | #if defined (REGISTER_CONVERT_TO_RAW) && GDB_MULTI_ARCH |
1188 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1189 | fprintf_unfiltered (file, |
1190 | "gdbarch_dump: %s # %s\n", | |
1191 | "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)", | |
1192 | XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to))); | |
1193 | #endif | |
7f1b2585 EZ |
1194 | #if defined (FETCH_PSEUDO_REGISTER) && GDB_MULTI_ARCH |
1195 | /* Macro might contain `[{}]' when not multi-arch */ | |
1196 | fprintf_unfiltered (file, | |
1197 | "gdbarch_dump: %s # %s\n", | |
1198 | "FETCH_PSEUDO_REGISTER(regnum)", | |
1199 | XSTRING (FETCH_PSEUDO_REGISTER (regnum))); | |
1200 | #endif | |
1201 | #if defined (STORE_PSEUDO_REGISTER) && GDB_MULTI_ARCH | |
1202 | /* Macro might contain `[{}]' when not multi-arch */ | |
1203 | fprintf_unfiltered (file, | |
1204 | "gdbarch_dump: %s # %s\n", | |
1205 | "STORE_PSEUDO_REGISTER(regnum)", | |
1206 | XSTRING (STORE_PSEUDO_REGISTER (regnum))); | |
1207 | #endif | |
4b9b3959 AC |
1208 | #ifdef POINTER_TO_ADDRESS |
1209 | fprintf_unfiltered (file, | |
1210 | "gdbarch_dump: %s # %s\n", | |
1211 | "POINTER_TO_ADDRESS(type, buf)", | |
1212 | XSTRING (POINTER_TO_ADDRESS (type, buf))); | |
1213 | #endif | |
63e69063 AC |
1214 | #if defined (ADDRESS_TO_POINTER) && GDB_MULTI_ARCH |
1215 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1216 | fprintf_unfiltered (file, |
1217 | "gdbarch_dump: %s # %s\n", | |
1218 | "ADDRESS_TO_POINTER(type, buf, addr)", | |
1219 | XSTRING (ADDRESS_TO_POINTER (type, buf, addr))); | |
1220 | #endif | |
1221 | #ifdef RETURN_VALUE_ON_STACK | |
1222 | fprintf_unfiltered (file, | |
1223 | "gdbarch_dump: %s # %s\n", | |
1224 | "RETURN_VALUE_ON_STACK(type)", | |
1225 | XSTRING (RETURN_VALUE_ON_STACK (type))); | |
1226 | #endif | |
63e69063 AC |
1227 | #if defined (EXTRACT_RETURN_VALUE) && GDB_MULTI_ARCH |
1228 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1229 | fprintf_unfiltered (file, |
1230 | "gdbarch_dump: %s # %s\n", | |
1231 | "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)", | |
1232 | XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf))); | |
1233 | #endif | |
1234 | #ifdef PUSH_ARGUMENTS | |
1235 | fprintf_unfiltered (file, | |
1236 | "gdbarch_dump: %s # %s\n", | |
1237 | "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)", | |
1238 | XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr))); | |
1239 | #endif | |
63e69063 AC |
1240 | #if defined (PUSH_DUMMY_FRAME) && GDB_MULTI_ARCH |
1241 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1242 | fprintf_unfiltered (file, |
1243 | "gdbarch_dump: %s # %s\n", | |
1244 | "PUSH_DUMMY_FRAME(-)", | |
1245 | XSTRING (PUSH_DUMMY_FRAME (-))); | |
1246 | #endif | |
1247 | #ifdef PUSH_RETURN_ADDRESS | |
1248 | fprintf_unfiltered (file, | |
1249 | "gdbarch_dump: %s # %s\n", | |
1250 | "PUSH_RETURN_ADDRESS(pc, sp)", | |
1251 | XSTRING (PUSH_RETURN_ADDRESS (pc, sp))); | |
1252 | #endif | |
63e69063 AC |
1253 | #if defined (POP_FRAME) && GDB_MULTI_ARCH |
1254 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1255 | fprintf_unfiltered (file, |
1256 | "gdbarch_dump: %s # %s\n", | |
1257 | "POP_FRAME(-)", | |
1258 | XSTRING (POP_FRAME (-))); | |
1259 | #endif | |
63e69063 AC |
1260 | #if defined (STORE_STRUCT_RETURN) && GDB_MULTI_ARCH |
1261 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1262 | fprintf_unfiltered (file, |
1263 | "gdbarch_dump: %s # %s\n", | |
1264 | "STORE_STRUCT_RETURN(addr, sp)", | |
1265 | XSTRING (STORE_STRUCT_RETURN (addr, sp))); | |
1266 | #endif | |
63e69063 AC |
1267 | #if defined (STORE_RETURN_VALUE) && GDB_MULTI_ARCH |
1268 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1269 | fprintf_unfiltered (file, |
1270 | "gdbarch_dump: %s # %s\n", | |
1271 | "STORE_RETURN_VALUE(type, valbuf)", | |
1272 | XSTRING (STORE_RETURN_VALUE (type, valbuf))); | |
1273 | #endif | |
1274 | #ifdef EXTRACT_STRUCT_VALUE_ADDRESS | |
1275 | fprintf_unfiltered (file, | |
1276 | "gdbarch_dump: %s # %s\n", | |
1277 | "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)", | |
1278 | XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf))); | |
1279 | #endif | |
1280 | #ifdef USE_STRUCT_CONVENTION | |
1281 | fprintf_unfiltered (file, | |
1282 | "gdbarch_dump: %s # %s\n", | |
1283 | "USE_STRUCT_CONVENTION(gcc_p, value_type)", | |
1284 | XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type))); | |
1285 | #endif | |
63e69063 AC |
1286 | #if defined (FRAME_INIT_SAVED_REGS) && GDB_MULTI_ARCH |
1287 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1288 | fprintf_unfiltered (file, |
1289 | "gdbarch_dump: %s # %s\n", | |
1290 | "FRAME_INIT_SAVED_REGS(frame)", | |
1291 | XSTRING (FRAME_INIT_SAVED_REGS (frame))); | |
1292 | #endif | |
63e69063 AC |
1293 | #if defined (INIT_EXTRA_FRAME_INFO) && GDB_MULTI_ARCH |
1294 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1295 | fprintf_unfiltered (file, |
1296 | "gdbarch_dump: %s # %s\n", | |
1297 | "INIT_EXTRA_FRAME_INFO(fromleaf, frame)", | |
1298 | XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame))); | |
1299 | #endif | |
1300 | #ifdef SKIP_PROLOGUE | |
1301 | fprintf_unfiltered (file, | |
1302 | "gdbarch_dump: %s # %s\n", | |
1303 | "SKIP_PROLOGUE(ip)", | |
1304 | XSTRING (SKIP_PROLOGUE (ip))); | |
1305 | #endif | |
1306 | #ifdef PROLOGUE_FRAMELESS_P | |
1307 | fprintf_unfiltered (file, | |
1308 | "gdbarch_dump: %s # %s\n", | |
1309 | "PROLOGUE_FRAMELESS_P(ip)", | |
1310 | XSTRING (PROLOGUE_FRAMELESS_P (ip))); | |
1311 | #endif | |
1312 | #ifdef INNER_THAN | |
1313 | fprintf_unfiltered (file, | |
1314 | "gdbarch_dump: %s # %s\n", | |
1315 | "INNER_THAN(lhs, rhs)", | |
1316 | XSTRING (INNER_THAN (lhs, rhs))); | |
1317 | #endif | |
1318 | #ifdef BREAKPOINT_FROM_PC | |
1319 | fprintf_unfiltered (file, | |
1320 | "gdbarch_dump: %s # %s\n", | |
1321 | "BREAKPOINT_FROM_PC(pcptr, lenptr)", | |
1322 | XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr))); | |
1323 | #endif | |
1324 | #ifdef MEMORY_INSERT_BREAKPOINT | |
1325 | fprintf_unfiltered (file, | |
1326 | "gdbarch_dump: %s # %s\n", | |
1327 | "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)", | |
1328 | XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache))); | |
1329 | #endif | |
1330 | #ifdef MEMORY_REMOVE_BREAKPOINT | |
1331 | fprintf_unfiltered (file, | |
1332 | "gdbarch_dump: %s # %s\n", | |
1333 | "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)", | |
1334 | XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache))); | |
1335 | #endif | |
1336 | #ifdef DECR_PC_AFTER_BREAK | |
1337 | fprintf_unfiltered (file, | |
1338 | "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n", | |
1339 | XSTRING (DECR_PC_AFTER_BREAK)); | |
1340 | #endif | |
e02bc4cc DS |
1341 | #ifdef PREPARE_TO_PROCEED |
1342 | fprintf_unfiltered (file, | |
1343 | "gdbarch_dump: %s # %s\n", | |
1344 | "PREPARE_TO_PROCEED(select_it)", | |
1345 | XSTRING (PREPARE_TO_PROCEED (select_it))); | |
1346 | #endif | |
4b9b3959 AC |
1347 | #ifdef FUNCTION_START_OFFSET |
1348 | fprintf_unfiltered (file, | |
1349 | "gdbarch_dump: FUNCTION_START_OFFSET # %s\n", | |
1350 | XSTRING (FUNCTION_START_OFFSET)); | |
1351 | #endif | |
63e69063 AC |
1352 | #if defined (REMOTE_TRANSLATE_XFER_ADDRESS) && GDB_MULTI_ARCH |
1353 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1354 | fprintf_unfiltered (file, |
1355 | "gdbarch_dump: %s # %s\n", | |
1356 | "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)", | |
1357 | XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len))); | |
1358 | #endif | |
1359 | #ifdef FRAME_ARGS_SKIP | |
1360 | fprintf_unfiltered (file, | |
1361 | "gdbarch_dump: FRAME_ARGS_SKIP # %s\n", | |
1362 | XSTRING (FRAME_ARGS_SKIP)); | |
1363 | #endif | |
1364 | #ifdef FRAMELESS_FUNCTION_INVOCATION | |
1365 | fprintf_unfiltered (file, | |
1366 | "gdbarch_dump: %s # %s\n", | |
1367 | "FRAMELESS_FUNCTION_INVOCATION(fi)", | |
1368 | XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi))); | |
1369 | #endif | |
1370 | #ifdef FRAME_CHAIN | |
1371 | fprintf_unfiltered (file, | |
1372 | "gdbarch_dump: %s # %s\n", | |
1373 | "FRAME_CHAIN(frame)", | |
1374 | XSTRING (FRAME_CHAIN (frame))); | |
1375 | #endif | |
1376 | #ifdef FRAME_CHAIN_VALID | |
1377 | fprintf_unfiltered (file, | |
1378 | "gdbarch_dump: %s # %s\n", | |
1379 | "FRAME_CHAIN_VALID(chain, thisframe)", | |
1380 | XSTRING (FRAME_CHAIN_VALID (chain, thisframe))); | |
1381 | #endif | |
1382 | #ifdef FRAME_SAVED_PC | |
1383 | fprintf_unfiltered (file, | |
1384 | "gdbarch_dump: %s # %s\n", | |
1385 | "FRAME_SAVED_PC(fi)", | |
1386 | XSTRING (FRAME_SAVED_PC (fi))); | |
1387 | #endif | |
1388 | #ifdef FRAME_ARGS_ADDRESS | |
1389 | fprintf_unfiltered (file, | |
1390 | "gdbarch_dump: %s # %s\n", | |
1391 | "FRAME_ARGS_ADDRESS(fi)", | |
1392 | XSTRING (FRAME_ARGS_ADDRESS (fi))); | |
1393 | #endif | |
1394 | #ifdef FRAME_LOCALS_ADDRESS | |
1395 | fprintf_unfiltered (file, | |
1396 | "gdbarch_dump: %s # %s\n", | |
1397 | "FRAME_LOCALS_ADDRESS(fi)", | |
1398 | XSTRING (FRAME_LOCALS_ADDRESS (fi))); | |
1399 | #endif | |
1400 | #ifdef SAVED_PC_AFTER_CALL | |
1401 | fprintf_unfiltered (file, | |
1402 | "gdbarch_dump: %s # %s\n", | |
1403 | "SAVED_PC_AFTER_CALL(frame)", | |
1404 | XSTRING (SAVED_PC_AFTER_CALL (frame))); | |
1405 | #endif | |
1406 | #ifdef FRAME_NUM_ARGS | |
1407 | fprintf_unfiltered (file, | |
1408 | "gdbarch_dump: %s # %s\n", | |
1409 | "FRAME_NUM_ARGS(frame)", | |
1410 | XSTRING (FRAME_NUM_ARGS (frame))); | |
1411 | #endif | |
1412 | #ifdef STACK_ALIGN | |
1413 | fprintf_unfiltered (file, | |
1414 | "gdbarch_dump: %s # %s\n", | |
1415 | "STACK_ALIGN(sp)", | |
1416 | XSTRING (STACK_ALIGN (sp))); | |
1417 | #endif | |
1dd4193b AC |
1418 | #ifdef EXTRA_STACK_ALIGNMENT_NEEDED |
1419 | fprintf_unfiltered (file, | |
1420 | "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n", | |
1421 | XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED)); | |
1422 | #endif | |
4b9b3959 AC |
1423 | #ifdef REG_STRUCT_HAS_ADDR |
1424 | fprintf_unfiltered (file, | |
1425 | "gdbarch_dump: %s # %s\n", | |
1426 | "REG_STRUCT_HAS_ADDR(gcc_p, type)", | |
1427 | XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type))); | |
1428 | #endif | |
63e69063 AC |
1429 | #if defined (SAVE_DUMMY_FRAME_TOS) && GDB_MULTI_ARCH |
1430 | /* Macro might contain `[{}]' when not multi-arch */ | |
4b9b3959 AC |
1431 | fprintf_unfiltered (file, |
1432 | "gdbarch_dump: %s # %s\n", | |
1433 | "SAVE_DUMMY_FRAME_TOS(sp)", | |
1434 | XSTRING (SAVE_DUMMY_FRAME_TOS (sp))); | |
1435 | #endif | |
58d5518e ND |
1436 | #ifdef PARM_BOUNDARY |
1437 | fprintf_unfiltered (file, | |
1438 | "gdbarch_dump: PARM_BOUNDARY # %s\n", | |
1439 | XSTRING (PARM_BOUNDARY)); | |
1440 | #endif | |
4b9b3959 AC |
1441 | #ifdef TARGET_FLOAT_FORMAT |
1442 | fprintf_unfiltered (file, | |
1443 | "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n", | |
1444 | XSTRING (TARGET_FLOAT_FORMAT)); | |
1445 | #endif | |
1446 | #ifdef TARGET_DOUBLE_FORMAT | |
1447 | fprintf_unfiltered (file, | |
1448 | "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n", | |
1449 | XSTRING (TARGET_DOUBLE_FORMAT)); | |
1450 | #endif | |
1451 | #ifdef TARGET_LONG_DOUBLE_FORMAT | |
1452 | fprintf_unfiltered (file, | |
1453 | "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n", | |
1454 | XSTRING (TARGET_LONG_DOUBLE_FORMAT)); | |
1455 | #endif | |
f517ea4e PS |
1456 | #ifdef CONVERT_FROM_FUNC_PTR_ADDR |
1457 | fprintf_unfiltered (file, | |
1458 | "gdbarch_dump: %s # %s\n", | |
1459 | "CONVERT_FROM_FUNC_PTR_ADDR(addr)", | |
1460 | XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr))); | |
1461 | #endif | |
875e1767 AC |
1462 | #ifdef ADDR_BITS_REMOVE |
1463 | fprintf_unfiltered (file, | |
1464 | "gdbarch_dump: %s # %s\n", | |
1465 | "ADDR_BITS_REMOVE(addr)", | |
1466 | XSTRING (ADDR_BITS_REMOVE (addr))); | |
1467 | #endif | |
64c4637f AC |
1468 | #if defined (SOFTWARE_SINGLE_STEP) && GDB_MULTI_ARCH |
1469 | /* Macro might contain `[{}]' when not multi-arch */ | |
1470 | fprintf_unfiltered (file, | |
1471 | "gdbarch_dump: %s # %s\n", | |
1472 | "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)", | |
1473 | XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p))); | |
1474 | #endif | |
bdcd319a CV |
1475 | #ifdef SKIP_TRAMPOLINE_CODE |
1476 | fprintf_unfiltered (file, | |
1477 | "gdbarch_dump: %s # %s\n", | |
1478 | "SKIP_TRAMPOLINE_CODE(pc)", | |
1479 | XSTRING (SKIP_TRAMPOLINE_CODE (pc))); | |
1480 | #endif | |
381323f4 | 1481 | #ifdef TARGET_ARCHITECTURE |
0f71a2f6 | 1482 | if (TARGET_ARCHITECTURE != NULL) |
4b9b3959 AC |
1483 | fprintf_unfiltered (file, |
1484 | "gdbarch_dump: TARGET_ARCHITECTURE = %s\n", | |
adf40b2e | 1485 | TARGET_ARCHITECTURE->printable_name); |
381323f4 AC |
1486 | #endif |
1487 | #ifdef TARGET_BYTE_ORDER | |
4b9b3959 AC |
1488 | fprintf_unfiltered (file, |
1489 | "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n", | |
adf40b2e | 1490 | (long) TARGET_BYTE_ORDER); |
381323f4 | 1491 | #endif |
381323f4 | 1492 | #ifdef TARGET_SHORT_BIT |
4b9b3959 AC |
1493 | fprintf_unfiltered (file, |
1494 | "gdbarch_dump: TARGET_SHORT_BIT = %ld\n", | |
adf40b2e | 1495 | (long) TARGET_SHORT_BIT); |
381323f4 AC |
1496 | #endif |
1497 | #ifdef TARGET_INT_BIT | |
4b9b3959 AC |
1498 | fprintf_unfiltered (file, |
1499 | "gdbarch_dump: TARGET_INT_BIT = %ld\n", | |
adf40b2e | 1500 | (long) TARGET_INT_BIT); |
381323f4 AC |
1501 | #endif |
1502 | #ifdef TARGET_LONG_BIT | |
4b9b3959 AC |
1503 | fprintf_unfiltered (file, |
1504 | "gdbarch_dump: TARGET_LONG_BIT = %ld\n", | |
adf40b2e | 1505 | (long) TARGET_LONG_BIT); |
381323f4 AC |
1506 | #endif |
1507 | #ifdef TARGET_LONG_LONG_BIT | |
4b9b3959 AC |
1508 | fprintf_unfiltered (file, |
1509 | "gdbarch_dump: TARGET_LONG_LONG_BIT = %ld\n", | |
adf40b2e | 1510 | (long) TARGET_LONG_LONG_BIT); |
381323f4 AC |
1511 | #endif |
1512 | #ifdef TARGET_FLOAT_BIT | |
4b9b3959 AC |
1513 | fprintf_unfiltered (file, |
1514 | "gdbarch_dump: TARGET_FLOAT_BIT = %ld\n", | |
adf40b2e | 1515 | (long) TARGET_FLOAT_BIT); |
381323f4 AC |
1516 | #endif |
1517 | #ifdef TARGET_DOUBLE_BIT | |
4b9b3959 AC |
1518 | fprintf_unfiltered (file, |
1519 | "gdbarch_dump: TARGET_DOUBLE_BIT = %ld\n", | |
adf40b2e | 1520 | (long) TARGET_DOUBLE_BIT); |
381323f4 AC |
1521 | #endif |
1522 | #ifdef TARGET_LONG_DOUBLE_BIT | |
4b9b3959 AC |
1523 | fprintf_unfiltered (file, |
1524 | "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %ld\n", | |
adf40b2e | 1525 | (long) TARGET_LONG_DOUBLE_BIT); |
381323f4 | 1526 | #endif |
66b43ecb AC |
1527 | #ifdef TARGET_PTR_BIT |
1528 | fprintf_unfiltered (file, | |
1529 | "gdbarch_dump: TARGET_PTR_BIT = %ld\n", | |
1530 | (long) TARGET_PTR_BIT); | |
1531 | #endif | |
52204a0b DT |
1532 | #ifdef TARGET_ADDR_BIT |
1533 | fprintf_unfiltered (file, | |
1534 | "gdbarch_dump: TARGET_ADDR_BIT = %ld\n", | |
1535 | (long) TARGET_ADDR_BIT); | |
1536 | #endif | |
66b43ecb AC |
1537 | #ifdef TARGET_BFD_VMA_BIT |
1538 | fprintf_unfiltered (file, | |
1539 | "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n", | |
1540 | (long) TARGET_BFD_VMA_BIT); | |
1541 | #endif | |
381323f4 | 1542 | #ifdef IEEE_FLOAT |
4b9b3959 AC |
1543 | fprintf_unfiltered (file, |
1544 | "gdbarch_dump: IEEE_FLOAT = %ld\n", | |
7355ddba | 1545 | (long) IEEE_FLOAT); |
381323f4 AC |
1546 | #endif |
1547 | #ifdef TARGET_READ_PC | |
4b9b3959 AC |
1548 | if (GDB_MULTI_ARCH) |
1549 | fprintf_unfiltered (file, | |
1550 | "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n", | |
1551 | (long) current_gdbarch->read_pc | |
1552 | /*TARGET_READ_PC ()*/); | |
381323f4 AC |
1553 | #endif |
1554 | #ifdef TARGET_WRITE_PC | |
4b9b3959 AC |
1555 | if (GDB_MULTI_ARCH) |
1556 | fprintf_unfiltered (file, | |
1557 | "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n", | |
1558 | (long) current_gdbarch->write_pc | |
1559 | /*TARGET_WRITE_PC ()*/); | |
381323f4 AC |
1560 | #endif |
1561 | #ifdef TARGET_READ_FP | |
4b9b3959 AC |
1562 | if (GDB_MULTI_ARCH) |
1563 | fprintf_unfiltered (file, | |
1564 | "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n", | |
1565 | (long) current_gdbarch->read_fp | |
1566 | /*TARGET_READ_FP ()*/); | |
381323f4 AC |
1567 | #endif |
1568 | #ifdef TARGET_WRITE_FP | |
4b9b3959 AC |
1569 | if (GDB_MULTI_ARCH) |
1570 | fprintf_unfiltered (file, | |
1571 | "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n", | |
1572 | (long) current_gdbarch->write_fp | |
1573 | /*TARGET_WRITE_FP ()*/); | |
381323f4 AC |
1574 | #endif |
1575 | #ifdef TARGET_READ_SP | |
4b9b3959 AC |
1576 | if (GDB_MULTI_ARCH) |
1577 | fprintf_unfiltered (file, | |
1578 | "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n", | |
1579 | (long) current_gdbarch->read_sp | |
1580 | /*TARGET_READ_SP ()*/); | |
381323f4 AC |
1581 | #endif |
1582 | #ifdef TARGET_WRITE_SP | |
4b9b3959 AC |
1583 | if (GDB_MULTI_ARCH) |
1584 | fprintf_unfiltered (file, | |
1585 | "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n", | |
1586 | (long) current_gdbarch->write_sp | |
1587 | /*TARGET_WRITE_SP ()*/); | |
39d4ef09 AC |
1588 | #endif |
1589 | #ifdef TARGET_VIRTUAL_FRAME_POINTER | |
1590 | if (GDB_MULTI_ARCH) | |
1591 | fprintf_unfiltered (file, | |
1592 | "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = 0x%08lx\n", | |
1593 | (long) current_gdbarch->virtual_frame_pointer | |
1594 | /*TARGET_VIRTUAL_FRAME_POINTER ()*/); | |
381323f4 | 1595 | #endif |
61a0eb5b AC |
1596 | if (GDB_MULTI_ARCH) |
1597 | fprintf_unfiltered (file, | |
1598 | "gdbarch_dump: register_read = 0x%08lx\n", | |
1599 | (long) current_gdbarch->register_read); | |
1600 | if (GDB_MULTI_ARCH) | |
1601 | fprintf_unfiltered (file, | |
1602 | "gdbarch_dump: register_write = 0x%08lx\n", | |
1603 | (long) current_gdbarch->register_write); | |
381323f4 | 1604 | #ifdef NUM_REGS |
4b9b3959 AC |
1605 | fprintf_unfiltered (file, |
1606 | "gdbarch_dump: NUM_REGS = %ld\n", | |
adf40b2e | 1607 | (long) NUM_REGS); |
381323f4 | 1608 | #endif |
0aba1244 EZ |
1609 | #ifdef NUM_PSEUDO_REGS |
1610 | fprintf_unfiltered (file, | |
1611 | "gdbarch_dump: NUM_PSEUDO_REGS = %ld\n", | |
1612 | (long) NUM_PSEUDO_REGS); | |
1613 | #endif | |
381323f4 | 1614 | #ifdef SP_REGNUM |
4b9b3959 AC |
1615 | fprintf_unfiltered (file, |
1616 | "gdbarch_dump: SP_REGNUM = %ld\n", | |
adf40b2e | 1617 | (long) SP_REGNUM); |
381323f4 AC |
1618 | #endif |
1619 | #ifdef FP_REGNUM | |
4b9b3959 AC |
1620 | fprintf_unfiltered (file, |
1621 | "gdbarch_dump: FP_REGNUM = %ld\n", | |
adf40b2e | 1622 | (long) FP_REGNUM); |
381323f4 AC |
1623 | #endif |
1624 | #ifdef PC_REGNUM | |
4b9b3959 AC |
1625 | fprintf_unfiltered (file, |
1626 | "gdbarch_dump: PC_REGNUM = %ld\n", | |
adf40b2e | 1627 | (long) PC_REGNUM); |
381323f4 AC |
1628 | #endif |
1629 | #ifdef FP0_REGNUM | |
4b9b3959 AC |
1630 | fprintf_unfiltered (file, |
1631 | "gdbarch_dump: FP0_REGNUM = %ld\n", | |
60054393 | 1632 | (long) FP0_REGNUM); |
381323f4 AC |
1633 | #endif |
1634 | #ifdef NPC_REGNUM | |
4b9b3959 AC |
1635 | fprintf_unfiltered (file, |
1636 | "gdbarch_dump: NPC_REGNUM = %ld\n", | |
03863182 | 1637 | (long) NPC_REGNUM); |
381323f4 AC |
1638 | #endif |
1639 | #ifdef NNPC_REGNUM | |
4b9b3959 AC |
1640 | fprintf_unfiltered (file, |
1641 | "gdbarch_dump: NNPC_REGNUM = %ld\n", | |
03863182 | 1642 | (long) NNPC_REGNUM); |
381323f4 | 1643 | #endif |
88c72b7d AC |
1644 | #ifdef STAB_REG_TO_REGNUM |
1645 | if (GDB_MULTI_ARCH) | |
1646 | fprintf_unfiltered (file, | |
1647 | "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n", | |
1648 | (long) current_gdbarch->stab_reg_to_regnum | |
1649 | /*STAB_REG_TO_REGNUM ()*/); | |
1650 | #endif | |
1651 | #ifdef ECOFF_REG_TO_REGNUM | |
1652 | if (GDB_MULTI_ARCH) | |
1653 | fprintf_unfiltered (file, | |
1654 | "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n", | |
1655 | (long) current_gdbarch->ecoff_reg_to_regnum | |
1656 | /*ECOFF_REG_TO_REGNUM ()*/); | |
1657 | #endif | |
1658 | #ifdef DWARF_REG_TO_REGNUM | |
1659 | if (GDB_MULTI_ARCH) | |
1660 | fprintf_unfiltered (file, | |
1661 | "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n", | |
1662 | (long) current_gdbarch->dwarf_reg_to_regnum | |
1663 | /*DWARF_REG_TO_REGNUM ()*/); | |
1664 | #endif | |
1665 | #ifdef SDB_REG_TO_REGNUM | |
1666 | if (GDB_MULTI_ARCH) | |
1667 | fprintf_unfiltered (file, | |
1668 | "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n", | |
1669 | (long) current_gdbarch->sdb_reg_to_regnum | |
1670 | /*SDB_REG_TO_REGNUM ()*/); | |
1671 | #endif | |
1672 | #ifdef DWARF2_REG_TO_REGNUM | |
1673 | if (GDB_MULTI_ARCH) | |
1674 | fprintf_unfiltered (file, | |
1675 | "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n", | |
1676 | (long) current_gdbarch->dwarf2_reg_to_regnum | |
1677 | /*DWARF2_REG_TO_REGNUM ()*/); | |
1678 | #endif | |
381323f4 | 1679 | #ifdef REGISTER_NAME |
4b9b3959 AC |
1680 | if (GDB_MULTI_ARCH) |
1681 | fprintf_unfiltered (file, | |
1682 | "gdbarch_dump: REGISTER_NAME = 0x%08lx\n", | |
1683 | (long) current_gdbarch->register_name | |
1684 | /*REGISTER_NAME ()*/); | |
381323f4 AC |
1685 | #endif |
1686 | #ifdef REGISTER_SIZE | |
4b9b3959 AC |
1687 | fprintf_unfiltered (file, |
1688 | "gdbarch_dump: REGISTER_SIZE = %ld\n", | |
adf40b2e | 1689 | (long) REGISTER_SIZE); |
381323f4 AC |
1690 | #endif |
1691 | #ifdef REGISTER_BYTES | |
4b9b3959 AC |
1692 | fprintf_unfiltered (file, |
1693 | "gdbarch_dump: REGISTER_BYTES = %ld\n", | |
adf40b2e | 1694 | (long) REGISTER_BYTES); |
381323f4 AC |
1695 | #endif |
1696 | #ifdef REGISTER_BYTE | |
4b9b3959 AC |
1697 | if (GDB_MULTI_ARCH) |
1698 | fprintf_unfiltered (file, | |
1699 | "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n", | |
1700 | (long) current_gdbarch->register_byte | |
1701 | /*REGISTER_BYTE ()*/); | |
381323f4 AC |
1702 | #endif |
1703 | #ifdef REGISTER_RAW_SIZE | |
4b9b3959 AC |
1704 | if (GDB_MULTI_ARCH) |
1705 | fprintf_unfiltered (file, | |
1706 | "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n", | |
1707 | (long) current_gdbarch->register_raw_size | |
1708 | /*REGISTER_RAW_SIZE ()*/); | |
381323f4 AC |
1709 | #endif |
1710 | #ifdef MAX_REGISTER_RAW_SIZE | |
4b9b3959 AC |
1711 | fprintf_unfiltered (file, |
1712 | "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %ld\n", | |
adf40b2e | 1713 | (long) MAX_REGISTER_RAW_SIZE); |
381323f4 AC |
1714 | #endif |
1715 | #ifdef REGISTER_VIRTUAL_SIZE | |
4b9b3959 AC |
1716 | if (GDB_MULTI_ARCH) |
1717 | fprintf_unfiltered (file, | |
1718 | "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n", | |
1719 | (long) current_gdbarch->register_virtual_size | |
1720 | /*REGISTER_VIRTUAL_SIZE ()*/); | |
381323f4 AC |
1721 | #endif |
1722 | #ifdef MAX_REGISTER_VIRTUAL_SIZE | |
4b9b3959 AC |
1723 | fprintf_unfiltered (file, |
1724 | "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %ld\n", | |
adf40b2e | 1725 | (long) MAX_REGISTER_VIRTUAL_SIZE); |
381323f4 AC |
1726 | #endif |
1727 | #ifdef REGISTER_VIRTUAL_TYPE | |
4b9b3959 AC |
1728 | if (GDB_MULTI_ARCH) |
1729 | fprintf_unfiltered (file, | |
1730 | "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n", | |
1731 | (long) current_gdbarch->register_virtual_type | |
1732 | /*REGISTER_VIRTUAL_TYPE ()*/); | |
381323f4 | 1733 | #endif |
666e11c5 EZ |
1734 | #ifdef DO_REGISTERS_INFO |
1735 | if (GDB_MULTI_ARCH) | |
1736 | fprintf_unfiltered (file, | |
1737 | "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n", | |
1738 | (long) current_gdbarch->do_registers_info | |
1739 | /*DO_REGISTERS_INFO ()*/); | |
1740 | #endif | |
7c7651b2 AC |
1741 | #ifdef REGISTER_SIM_REGNO |
1742 | if (GDB_MULTI_ARCH) | |
1743 | fprintf_unfiltered (file, | |
1744 | "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n", | |
1745 | (long) current_gdbarch->register_sim_regno | |
1746 | /*REGISTER_SIM_REGNO ()*/); | |
1747 | #endif | |
2649061d AC |
1748 | #ifdef REGISTER_BYTES_OK |
1749 | if (GDB_MULTI_ARCH) | |
1750 | fprintf_unfiltered (file, | |
1751 | "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n", | |
1752 | (long) current_gdbarch->register_bytes_ok | |
1753 | /*REGISTER_BYTES_OK ()*/); | |
1754 | #endif | |
01fb7433 AC |
1755 | #ifdef CANNOT_FETCH_REGISTER |
1756 | if (GDB_MULTI_ARCH) | |
1757 | fprintf_unfiltered (file, | |
1758 | "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n", | |
1759 | (long) current_gdbarch->cannot_fetch_register | |
1760 | /*CANNOT_FETCH_REGISTER ()*/); | |
1761 | #endif | |
1762 | #ifdef CANNOT_STORE_REGISTER | |
1763 | if (GDB_MULTI_ARCH) | |
1764 | fprintf_unfiltered (file, | |
1765 | "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n", | |
1766 | (long) current_gdbarch->cannot_store_register | |
1767 | /*CANNOT_STORE_REGISTER ()*/); | |
1768 | #endif | |
381323f4 | 1769 | #ifdef USE_GENERIC_DUMMY_FRAMES |
4b9b3959 AC |
1770 | fprintf_unfiltered (file, |
1771 | "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n", | |
adf40b2e | 1772 | (long) USE_GENERIC_DUMMY_FRAMES); |
381323f4 AC |
1773 | #endif |
1774 | #ifdef CALL_DUMMY_LOCATION | |
4b9b3959 AC |
1775 | fprintf_unfiltered (file, |
1776 | "gdbarch_dump: CALL_DUMMY_LOCATION = %ld\n", | |
adf40b2e | 1777 | (long) CALL_DUMMY_LOCATION); |
381323f4 AC |
1778 | #endif |
1779 | #ifdef CALL_DUMMY_ADDRESS | |
4b9b3959 AC |
1780 | if (GDB_MULTI_ARCH) |
1781 | fprintf_unfiltered (file, | |
1782 | "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n", | |
1783 | (long) current_gdbarch->call_dummy_address | |
1784 | /*CALL_DUMMY_ADDRESS ()*/); | |
381323f4 AC |
1785 | #endif |
1786 | #ifdef CALL_DUMMY_START_OFFSET | |
4b9b3959 AC |
1787 | fprintf_unfiltered (file, |
1788 | "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n", | |
adf40b2e | 1789 | (long) CALL_DUMMY_START_OFFSET); |
381323f4 AC |
1790 | #endif |
1791 | #ifdef CALL_DUMMY_BREAKPOINT_OFFSET | |
7861024d JG |
1792 | if (CALL_DUMMY_BREAKPOINT_OFFSET_P) |
1793 | fprintf_unfiltered (file, | |
1794 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n", | |
1795 | (long) CALL_DUMMY_BREAKPOINT_OFFSET); | |
381323f4 AC |
1796 | #endif |
1797 | #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P | |
4b9b3959 AC |
1798 | fprintf_unfiltered (file, |
1799 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n", | |
adf40b2e | 1800 | (long) CALL_DUMMY_BREAKPOINT_OFFSET_P); |
381323f4 AC |
1801 | #endif |
1802 | #ifdef CALL_DUMMY_LENGTH | |
0f71a2f6 | 1803 | if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END) |
4b9b3959 AC |
1804 | fprintf_unfiltered (file, |
1805 | "gdbarch_dump: CALL_DUMMY_LENGTH = %ld\n", | |
adf40b2e | 1806 | (long) CALL_DUMMY_LENGTH); |
381323f4 AC |
1807 | #endif |
1808 | #ifdef PC_IN_CALL_DUMMY | |
4b9b3959 AC |
1809 | if (GDB_MULTI_ARCH) |
1810 | fprintf_unfiltered (file, | |
1811 | "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n", | |
1812 | (long) current_gdbarch->pc_in_call_dummy | |
1813 | /*PC_IN_CALL_DUMMY ()*/); | |
381323f4 AC |
1814 | #endif |
1815 | #ifdef CALL_DUMMY_P | |
4b9b3959 AC |
1816 | fprintf_unfiltered (file, |
1817 | "gdbarch_dump: CALL_DUMMY_P = %ld\n", | |
adf40b2e | 1818 | (long) CALL_DUMMY_P); |
381323f4 AC |
1819 | #endif |
1820 | #ifdef CALL_DUMMY_WORDS | |
4b9b3959 AC |
1821 | fprintf_unfiltered (file, |
1822 | "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n", | |
adf40b2e | 1823 | (long) CALL_DUMMY_WORDS); |
381323f4 AC |
1824 | #endif |
1825 | #ifdef SIZEOF_CALL_DUMMY_WORDS | |
4b9b3959 AC |
1826 | fprintf_unfiltered (file, |
1827 | "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n", | |
adf40b2e | 1828 | (long) SIZEOF_CALL_DUMMY_WORDS); |
381323f4 AC |
1829 | #endif |
1830 | #ifdef CALL_DUMMY_STACK_ADJUST_P | |
4b9b3959 AC |
1831 | fprintf_unfiltered (file, |
1832 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n", | |
adf40b2e | 1833 | (long) CALL_DUMMY_STACK_ADJUST_P); |
381323f4 AC |
1834 | #endif |
1835 | #ifdef CALL_DUMMY_STACK_ADJUST | |
0f71a2f6 | 1836 | if (CALL_DUMMY_STACK_ADJUST_P) |
4b9b3959 AC |
1837 | fprintf_unfiltered (file, |
1838 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n", | |
adf40b2e | 1839 | (long) CALL_DUMMY_STACK_ADJUST); |
381323f4 AC |
1840 | #endif |
1841 | #ifdef FIX_CALL_DUMMY | |
4b9b3959 AC |
1842 | if (GDB_MULTI_ARCH) |
1843 | fprintf_unfiltered (file, | |
1844 | "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n", | |
1845 | (long) current_gdbarch->fix_call_dummy | |
1846 | /*FIX_CALL_DUMMY ()*/); | |
381323f4 | 1847 | #endif |
10312cc4 AC |
1848 | #ifdef INIT_FRAME_PC_FIRST |
1849 | if (GDB_MULTI_ARCH) | |
1850 | fprintf_unfiltered (file, | |
1851 | "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n", | |
1852 | (long) current_gdbarch->init_frame_pc_first | |
1853 | /*INIT_FRAME_PC_FIRST ()*/); | |
1854 | #endif | |
1855 | #ifdef INIT_FRAME_PC | |
1856 | if (GDB_MULTI_ARCH) | |
1857 | fprintf_unfiltered (file, | |
1858 | "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n", | |
1859 | (long) current_gdbarch->init_frame_pc | |
1860 | /*INIT_FRAME_PC ()*/); | |
1861 | #endif | |
0f71a2f6 | 1862 | #ifdef BELIEVE_PCC_PROMOTION |
4b9b3959 AC |
1863 | fprintf_unfiltered (file, |
1864 | "gdbarch_dump: BELIEVE_PCC_PROMOTION = %ld\n", | |
adf40b2e | 1865 | (long) BELIEVE_PCC_PROMOTION); |
0f71a2f6 JM |
1866 | #endif |
1867 | #ifdef BELIEVE_PCC_PROMOTION_TYPE | |
4b9b3959 AC |
1868 | fprintf_unfiltered (file, |
1869 | "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %ld\n", | |
adf40b2e | 1870 | (long) BELIEVE_PCC_PROMOTION_TYPE); |
0f71a2f6 | 1871 | #endif |
381323f4 | 1872 | #ifdef COERCE_FLOAT_TO_DOUBLE |
4b9b3959 AC |
1873 | if (GDB_MULTI_ARCH) |
1874 | fprintf_unfiltered (file, | |
1875 | "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n", | |
1876 | (long) current_gdbarch->coerce_float_to_double | |
1877 | /*COERCE_FLOAT_TO_DOUBLE ()*/); | |
381323f4 AC |
1878 | #endif |
1879 | #ifdef GET_SAVED_REGISTER | |
4b9b3959 AC |
1880 | if (GDB_MULTI_ARCH) |
1881 | fprintf_unfiltered (file, | |
1882 | "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n", | |
1883 | (long) current_gdbarch->get_saved_register | |
1884 | /*GET_SAVED_REGISTER ()*/); | |
381323f4 AC |
1885 | #endif |
1886 | #ifdef REGISTER_CONVERTIBLE | |
4b9b3959 AC |
1887 | if (GDB_MULTI_ARCH) |
1888 | fprintf_unfiltered (file, | |
1889 | "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n", | |
1890 | (long) current_gdbarch->register_convertible | |
1891 | /*REGISTER_CONVERTIBLE ()*/); | |
381323f4 AC |
1892 | #endif |
1893 | #ifdef REGISTER_CONVERT_TO_VIRTUAL | |
4b9b3959 AC |
1894 | if (GDB_MULTI_ARCH) |
1895 | fprintf_unfiltered (file, | |
1896 | "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n", | |
1897 | (long) current_gdbarch->register_convert_to_virtual | |
1898 | /*REGISTER_CONVERT_TO_VIRTUAL ()*/); | |
381323f4 AC |
1899 | #endif |
1900 | #ifdef REGISTER_CONVERT_TO_RAW | |
4b9b3959 AC |
1901 | if (GDB_MULTI_ARCH) |
1902 | fprintf_unfiltered (file, | |
1903 | "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n", | |
1904 | (long) current_gdbarch->register_convert_to_raw | |
1905 | /*REGISTER_CONVERT_TO_RAW ()*/); | |
381323f4 | 1906 | #endif |
7f1b2585 EZ |
1907 | #ifdef FETCH_PSEUDO_REGISTER |
1908 | if (GDB_MULTI_ARCH) | |
1909 | fprintf_unfiltered (file, | |
1910 | "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n", | |
1911 | (long) current_gdbarch->fetch_pseudo_register | |
1912 | /*FETCH_PSEUDO_REGISTER ()*/); | |
1913 | #endif | |
1914 | #ifdef STORE_PSEUDO_REGISTER | |
1915 | if (GDB_MULTI_ARCH) | |
1916 | fprintf_unfiltered (file, | |
1917 | "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n", | |
1918 | (long) current_gdbarch->store_pseudo_register | |
1919 | /*STORE_PSEUDO_REGISTER ()*/); | |
1920 | #endif | |
381323f4 | 1921 | #ifdef POINTER_TO_ADDRESS |
4b9b3959 AC |
1922 | if (GDB_MULTI_ARCH) |
1923 | fprintf_unfiltered (file, | |
1924 | "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n", | |
1925 | (long) current_gdbarch->pointer_to_address | |
1926 | /*POINTER_TO_ADDRESS ()*/); | |
381323f4 AC |
1927 | #endif |
1928 | #ifdef ADDRESS_TO_POINTER | |
4b9b3959 AC |
1929 | if (GDB_MULTI_ARCH) |
1930 | fprintf_unfiltered (file, | |
1931 | "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n", | |
1932 | (long) current_gdbarch->address_to_pointer | |
1933 | /*ADDRESS_TO_POINTER ()*/); | |
381323f4 AC |
1934 | #endif |
1935 | #ifdef RETURN_VALUE_ON_STACK | |
4b9b3959 AC |
1936 | if (GDB_MULTI_ARCH) |
1937 | fprintf_unfiltered (file, | |
1938 | "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n", | |
1939 | (long) current_gdbarch->return_value_on_stack | |
1940 | /*RETURN_VALUE_ON_STACK ()*/); | |
381323f4 AC |
1941 | #endif |
1942 | #ifdef EXTRACT_RETURN_VALUE | |
4b9b3959 AC |
1943 | if (GDB_MULTI_ARCH) |
1944 | fprintf_unfiltered (file, | |
1945 | "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n", | |
1946 | (long) current_gdbarch->extract_return_value | |
1947 | /*EXTRACT_RETURN_VALUE ()*/); | |
381323f4 AC |
1948 | #endif |
1949 | #ifdef PUSH_ARGUMENTS | |
4b9b3959 AC |
1950 | if (GDB_MULTI_ARCH) |
1951 | fprintf_unfiltered (file, | |
1952 | "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n", | |
1953 | (long) current_gdbarch->push_arguments | |
1954 | /*PUSH_ARGUMENTS ()*/); | |
381323f4 AC |
1955 | #endif |
1956 | #ifdef PUSH_DUMMY_FRAME | |
4b9b3959 AC |
1957 | if (GDB_MULTI_ARCH) |
1958 | fprintf_unfiltered (file, | |
1959 | "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n", | |
1960 | (long) current_gdbarch->push_dummy_frame | |
1961 | /*PUSH_DUMMY_FRAME ()*/); | |
381323f4 AC |
1962 | #endif |
1963 | #ifdef PUSH_RETURN_ADDRESS | |
4b9b3959 AC |
1964 | if (GDB_MULTI_ARCH) |
1965 | fprintf_unfiltered (file, | |
1966 | "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n", | |
1967 | (long) current_gdbarch->push_return_address | |
1968 | /*PUSH_RETURN_ADDRESS ()*/); | |
381323f4 AC |
1969 | #endif |
1970 | #ifdef POP_FRAME | |
4b9b3959 AC |
1971 | if (GDB_MULTI_ARCH) |
1972 | fprintf_unfiltered (file, | |
1973 | "gdbarch_dump: POP_FRAME = 0x%08lx\n", | |
1974 | (long) current_gdbarch->pop_frame | |
1975 | /*POP_FRAME ()*/); | |
381323f4 | 1976 | #endif |
381323f4 | 1977 | #ifdef STORE_STRUCT_RETURN |
4b9b3959 AC |
1978 | if (GDB_MULTI_ARCH) |
1979 | fprintf_unfiltered (file, | |
1980 | "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n", | |
1981 | (long) current_gdbarch->store_struct_return | |
1982 | /*STORE_STRUCT_RETURN ()*/); | |
381323f4 AC |
1983 | #endif |
1984 | #ifdef STORE_RETURN_VALUE | |
4b9b3959 AC |
1985 | if (GDB_MULTI_ARCH) |
1986 | fprintf_unfiltered (file, | |
1987 | "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n", | |
1988 | (long) current_gdbarch->store_return_value | |
1989 | /*STORE_RETURN_VALUE ()*/); | |
381323f4 AC |
1990 | #endif |
1991 | #ifdef EXTRACT_STRUCT_VALUE_ADDRESS | |
4b9b3959 AC |
1992 | if (GDB_MULTI_ARCH) |
1993 | fprintf_unfiltered (file, | |
1994 | "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n", | |
1995 | (long) current_gdbarch->extract_struct_value_address | |
1996 | /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); | |
381323f4 AC |
1997 | #endif |
1998 | #ifdef USE_STRUCT_CONVENTION | |
4b9b3959 AC |
1999 | if (GDB_MULTI_ARCH) |
2000 | fprintf_unfiltered (file, | |
2001 | "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n", | |
2002 | (long) current_gdbarch->use_struct_convention | |
2003 | /*USE_STRUCT_CONVENTION ()*/); | |
381323f4 AC |
2004 | #endif |
2005 | #ifdef FRAME_INIT_SAVED_REGS | |
4b9b3959 AC |
2006 | if (GDB_MULTI_ARCH) |
2007 | fprintf_unfiltered (file, | |
2008 | "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n", | |
2009 | (long) current_gdbarch->frame_init_saved_regs | |
2010 | /*FRAME_INIT_SAVED_REGS ()*/); | |
381323f4 AC |
2011 | #endif |
2012 | #ifdef INIT_EXTRA_FRAME_INFO | |
4b9b3959 AC |
2013 | if (GDB_MULTI_ARCH) |
2014 | fprintf_unfiltered (file, | |
2015 | "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n", | |
2016 | (long) current_gdbarch->init_extra_frame_info | |
2017 | /*INIT_EXTRA_FRAME_INFO ()*/); | |
381323f4 AC |
2018 | #endif |
2019 | #ifdef SKIP_PROLOGUE | |
4b9b3959 AC |
2020 | if (GDB_MULTI_ARCH) |
2021 | fprintf_unfiltered (file, | |
2022 | "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n", | |
2023 | (long) current_gdbarch->skip_prologue | |
2024 | /*SKIP_PROLOGUE ()*/); | |
381323f4 AC |
2025 | #endif |
2026 | #ifdef PROLOGUE_FRAMELESS_P | |
4b9b3959 AC |
2027 | if (GDB_MULTI_ARCH) |
2028 | fprintf_unfiltered (file, | |
2029 | "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n", | |
2030 | (long) current_gdbarch->prologue_frameless_p | |
2031 | /*PROLOGUE_FRAMELESS_P ()*/); | |
381323f4 AC |
2032 | #endif |
2033 | #ifdef INNER_THAN | |
4b9b3959 AC |
2034 | if (GDB_MULTI_ARCH) |
2035 | fprintf_unfiltered (file, | |
2036 | "gdbarch_dump: INNER_THAN = 0x%08lx\n", | |
2037 | (long) current_gdbarch->inner_than | |
2038 | /*INNER_THAN ()*/); | |
381323f4 AC |
2039 | #endif |
2040 | #ifdef BREAKPOINT_FROM_PC | |
4b9b3959 AC |
2041 | if (GDB_MULTI_ARCH) |
2042 | fprintf_unfiltered (file, | |
2043 | "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n", | |
2044 | (long) current_gdbarch->breakpoint_from_pc | |
2045 | /*BREAKPOINT_FROM_PC ()*/); | |
381323f4 AC |
2046 | #endif |
2047 | #ifdef MEMORY_INSERT_BREAKPOINT | |
4b9b3959 AC |
2048 | if (GDB_MULTI_ARCH) |
2049 | fprintf_unfiltered (file, | |
2050 | "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n", | |
2051 | (long) current_gdbarch->memory_insert_breakpoint | |
2052 | /*MEMORY_INSERT_BREAKPOINT ()*/); | |
381323f4 AC |
2053 | #endif |
2054 | #ifdef MEMORY_REMOVE_BREAKPOINT | |
4b9b3959 AC |
2055 | if (GDB_MULTI_ARCH) |
2056 | fprintf_unfiltered (file, | |
2057 | "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n", | |
2058 | (long) current_gdbarch->memory_remove_breakpoint | |
2059 | /*MEMORY_REMOVE_BREAKPOINT ()*/); | |
381323f4 AC |
2060 | #endif |
2061 | #ifdef DECR_PC_AFTER_BREAK | |
4b9b3959 AC |
2062 | fprintf_unfiltered (file, |
2063 | "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n", | |
adf40b2e | 2064 | (long) DECR_PC_AFTER_BREAK); |
381323f4 | 2065 | #endif |
e02bc4cc DS |
2066 | #ifdef PREPARE_TO_PROCEED |
2067 | if (GDB_MULTI_ARCH) | |
2068 | fprintf_unfiltered (file, | |
2069 | "gdbarch_dump: PREPARE_TO_PROCEED = 0x%08lx\n", | |
2070 | (long) current_gdbarch->prepare_to_proceed | |
2071 | /*PREPARE_TO_PROCEED ()*/); | |
2072 | #endif | |
381323f4 | 2073 | #ifdef FUNCTION_START_OFFSET |
4b9b3959 AC |
2074 | fprintf_unfiltered (file, |
2075 | "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n", | |
adf40b2e | 2076 | (long) FUNCTION_START_OFFSET); |
381323f4 AC |
2077 | #endif |
2078 | #ifdef REMOTE_TRANSLATE_XFER_ADDRESS | |
4b9b3959 AC |
2079 | if (GDB_MULTI_ARCH) |
2080 | fprintf_unfiltered (file, | |
2081 | "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n", | |
2082 | (long) current_gdbarch->remote_translate_xfer_address | |
2083 | /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/); | |
381323f4 AC |
2084 | #endif |
2085 | #ifdef FRAME_ARGS_SKIP | |
4b9b3959 AC |
2086 | fprintf_unfiltered (file, |
2087 | "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n", | |
adf40b2e | 2088 | (long) FRAME_ARGS_SKIP); |
381323f4 AC |
2089 | #endif |
2090 | #ifdef FRAMELESS_FUNCTION_INVOCATION | |
4b9b3959 AC |
2091 | if (GDB_MULTI_ARCH) |
2092 | fprintf_unfiltered (file, | |
2093 | "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n", | |
2094 | (long) current_gdbarch->frameless_function_invocation | |
2095 | /*FRAMELESS_FUNCTION_INVOCATION ()*/); | |
381323f4 AC |
2096 | #endif |
2097 | #ifdef FRAME_CHAIN | |
4b9b3959 AC |
2098 | if (GDB_MULTI_ARCH) |
2099 | fprintf_unfiltered (file, | |
2100 | "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n", | |
2101 | (long) current_gdbarch->frame_chain | |
2102 | /*FRAME_CHAIN ()*/); | |
381323f4 AC |
2103 | #endif |
2104 | #ifdef FRAME_CHAIN_VALID | |
4b9b3959 AC |
2105 | if (GDB_MULTI_ARCH) |
2106 | fprintf_unfiltered (file, | |
2107 | "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n", | |
2108 | (long) current_gdbarch->frame_chain_valid | |
2109 | /*FRAME_CHAIN_VALID ()*/); | |
381323f4 AC |
2110 | #endif |
2111 | #ifdef FRAME_SAVED_PC | |
4b9b3959 AC |
2112 | if (GDB_MULTI_ARCH) |
2113 | fprintf_unfiltered (file, | |
2114 | "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n", | |
2115 | (long) current_gdbarch->frame_saved_pc | |
2116 | /*FRAME_SAVED_PC ()*/); | |
381323f4 AC |
2117 | #endif |
2118 | #ifdef FRAME_ARGS_ADDRESS | |
4b9b3959 AC |
2119 | if (GDB_MULTI_ARCH) |
2120 | fprintf_unfiltered (file, | |
2121 | "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n", | |
2122 | (long) current_gdbarch->frame_args_address | |
2123 | /*FRAME_ARGS_ADDRESS ()*/); | |
381323f4 AC |
2124 | #endif |
2125 | #ifdef FRAME_LOCALS_ADDRESS | |
4b9b3959 AC |
2126 | if (GDB_MULTI_ARCH) |
2127 | fprintf_unfiltered (file, | |
2128 | "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n", | |
2129 | (long) current_gdbarch->frame_locals_address | |
2130 | /*FRAME_LOCALS_ADDRESS ()*/); | |
381323f4 AC |
2131 | #endif |
2132 | #ifdef SAVED_PC_AFTER_CALL | |
4b9b3959 AC |
2133 | if (GDB_MULTI_ARCH) |
2134 | fprintf_unfiltered (file, | |
2135 | "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n", | |
2136 | (long) current_gdbarch->saved_pc_after_call | |
2137 | /*SAVED_PC_AFTER_CALL ()*/); | |
381323f4 AC |
2138 | #endif |
2139 | #ifdef FRAME_NUM_ARGS | |
4b9b3959 AC |
2140 | if (GDB_MULTI_ARCH) |
2141 | fprintf_unfiltered (file, | |
2142 | "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n", | |
2143 | (long) current_gdbarch->frame_num_args | |
2144 | /*FRAME_NUM_ARGS ()*/); | |
381323f4 AC |
2145 | #endif |
2146 | #ifdef STACK_ALIGN | |
4b9b3959 AC |
2147 | if (GDB_MULTI_ARCH) |
2148 | fprintf_unfiltered (file, | |
2149 | "gdbarch_dump: STACK_ALIGN = 0x%08lx\n", | |
2150 | (long) current_gdbarch->stack_align | |
2151 | /*STACK_ALIGN ()*/); | |
381323f4 | 2152 | #endif |
1dd4193b AC |
2153 | #ifdef EXTRA_STACK_ALIGNMENT_NEEDED |
2154 | fprintf_unfiltered (file, | |
2155 | "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %ld\n", | |
2156 | (long) EXTRA_STACK_ALIGNMENT_NEEDED); | |
2157 | #endif | |
381323f4 | 2158 | #ifdef REG_STRUCT_HAS_ADDR |
4b9b3959 AC |
2159 | if (GDB_MULTI_ARCH) |
2160 | fprintf_unfiltered (file, | |
2161 | "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n", | |
2162 | (long) current_gdbarch->reg_struct_has_addr | |
2163 | /*REG_STRUCT_HAS_ADDR ()*/); | |
d1e3cf49 AC |
2164 | #endif |
2165 | #ifdef SAVE_DUMMY_FRAME_TOS | |
4b9b3959 AC |
2166 | if (GDB_MULTI_ARCH) |
2167 | fprintf_unfiltered (file, | |
2168 | "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n", | |
2169 | (long) current_gdbarch->save_dummy_frame_tos | |
2170 | /*SAVE_DUMMY_FRAME_TOS ()*/); | |
f0d4cc9e | 2171 | #endif |
58d5518e ND |
2172 | #ifdef PARM_BOUNDARY |
2173 | fprintf_unfiltered (file, | |
2174 | "gdbarch_dump: PARM_BOUNDARY = %ld\n", | |
2175 | (long) PARM_BOUNDARY); | |
2176 | #endif | |
f0d4cc9e | 2177 | #ifdef TARGET_FLOAT_FORMAT |
4b9b3959 AC |
2178 | fprintf_unfiltered (file, |
2179 | "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n", | |
f0d4cc9e AC |
2180 | (long) TARGET_FLOAT_FORMAT); |
2181 | #endif | |
2182 | #ifdef TARGET_DOUBLE_FORMAT | |
4b9b3959 AC |
2183 | fprintf_unfiltered (file, |
2184 | "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n", | |
f0d4cc9e AC |
2185 | (long) TARGET_DOUBLE_FORMAT); |
2186 | #endif | |
2187 | #ifdef TARGET_LONG_DOUBLE_FORMAT | |
4b9b3959 AC |
2188 | fprintf_unfiltered (file, |
2189 | "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n", | |
f0d4cc9e | 2190 | (long) TARGET_LONG_DOUBLE_FORMAT); |
f517ea4e PS |
2191 | #endif |
2192 | #ifdef CONVERT_FROM_FUNC_PTR_ADDR | |
2193 | if (GDB_MULTI_ARCH) | |
2194 | fprintf_unfiltered (file, | |
2195 | "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n", | |
2196 | (long) current_gdbarch->convert_from_func_ptr_addr | |
2197 | /*CONVERT_FROM_FUNC_PTR_ADDR ()*/); | |
64c4637f | 2198 | #endif |
875e1767 AC |
2199 | #ifdef ADDR_BITS_REMOVE |
2200 | if (GDB_MULTI_ARCH) | |
2201 | fprintf_unfiltered (file, | |
2202 | "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n", | |
2203 | (long) current_gdbarch->addr_bits_remove | |
2204 | /*ADDR_BITS_REMOVE ()*/); | |
2205 | #endif | |
64c4637f AC |
2206 | #ifdef SOFTWARE_SINGLE_STEP |
2207 | if (GDB_MULTI_ARCH) | |
2208 | fprintf_unfiltered (file, | |
2209 | "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n", | |
2210 | (long) current_gdbarch->software_single_step | |
2211 | /*SOFTWARE_SINGLE_STEP ()*/); | |
bdcd319a CV |
2212 | #endif |
2213 | #ifdef SKIP_TRAMPOLINE_CODE | |
2214 | if (GDB_MULTI_ARCH) | |
2215 | fprintf_unfiltered (file, | |
2216 | "gdbarch_dump: SKIP_TRAMPOLINE_CODE = 0x%08lx\n", | |
2217 | (long) current_gdbarch->skip_trampoline_code | |
2218 | /*SKIP_TRAMPOLINE_CODE ()*/); | |
381323f4 | 2219 | #endif |
4b9b3959 AC |
2220 | if (current_gdbarch->dump_tdep != NULL) |
2221 | current_gdbarch->dump_tdep (current_gdbarch, file); | |
0f71a2f6 JM |
2222 | } |
2223 | ||
2224 | struct gdbarch_tdep * | |
104c1213 | 2225 | gdbarch_tdep (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2226 | { |
2227 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
2228 | fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); |
2229 | return gdbarch->tdep; | |
2230 | } | |
2231 | ||
2232 | ||
2233 | const struct bfd_arch_info * | |
104c1213 | 2234 | gdbarch_bfd_arch_info (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2235 | { |
2236 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
2237 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n"); |
2238 | return gdbarch->bfd_arch_info; | |
2239 | } | |
2240 | ||
2241 | int | |
104c1213 | 2242 | gdbarch_byte_order (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2243 | { |
2244 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
2245 | fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n"); |
2246 | return gdbarch->byte_order; | |
2247 | } | |
2248 | ||
0f71a2f6 | 2249 | int |
104c1213 | 2250 | gdbarch_short_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2251 | { |
66b43ecb | 2252 | /* Skip verify of short_bit, invalid_p == 0 */ |
0f71a2f6 | 2253 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2254 | fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n"); |
2255 | return gdbarch->short_bit; | |
2256 | } | |
2257 | ||
2258 | void | |
104c1213 JM |
2259 | set_gdbarch_short_bit (struct gdbarch *gdbarch, |
2260 | int short_bit) | |
0f71a2f6 JM |
2261 | { |
2262 | gdbarch->short_bit = short_bit; | |
2263 | } | |
2264 | ||
2265 | int | |
104c1213 | 2266 | gdbarch_int_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2267 | { |
66b43ecb | 2268 | /* Skip verify of int_bit, invalid_p == 0 */ |
0f71a2f6 | 2269 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2270 | fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n"); |
2271 | return gdbarch->int_bit; | |
2272 | } | |
2273 | ||
2274 | void | |
104c1213 JM |
2275 | set_gdbarch_int_bit (struct gdbarch *gdbarch, |
2276 | int int_bit) | |
0f71a2f6 JM |
2277 | { |
2278 | gdbarch->int_bit = int_bit; | |
2279 | } | |
2280 | ||
2281 | int | |
104c1213 | 2282 | gdbarch_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2283 | { |
66b43ecb | 2284 | /* Skip verify of long_bit, invalid_p == 0 */ |
0f71a2f6 | 2285 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2286 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n"); |
2287 | return gdbarch->long_bit; | |
2288 | } | |
2289 | ||
2290 | void | |
104c1213 JM |
2291 | set_gdbarch_long_bit (struct gdbarch *gdbarch, |
2292 | int long_bit) | |
0f71a2f6 JM |
2293 | { |
2294 | gdbarch->long_bit = long_bit; | |
2295 | } | |
2296 | ||
2297 | int | |
104c1213 | 2298 | gdbarch_long_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2299 | { |
66b43ecb | 2300 | /* Skip verify of long_long_bit, invalid_p == 0 */ |
0f71a2f6 | 2301 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2302 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n"); |
2303 | return gdbarch->long_long_bit; | |
2304 | } | |
2305 | ||
2306 | void | |
104c1213 JM |
2307 | set_gdbarch_long_long_bit (struct gdbarch *gdbarch, |
2308 | int long_long_bit) | |
0f71a2f6 JM |
2309 | { |
2310 | gdbarch->long_long_bit = long_long_bit; | |
2311 | } | |
2312 | ||
2313 | int | |
104c1213 | 2314 | gdbarch_float_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2315 | { |
66b43ecb | 2316 | /* Skip verify of float_bit, invalid_p == 0 */ |
0f71a2f6 | 2317 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2318 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n"); |
2319 | return gdbarch->float_bit; | |
2320 | } | |
2321 | ||
2322 | void | |
104c1213 JM |
2323 | set_gdbarch_float_bit (struct gdbarch *gdbarch, |
2324 | int float_bit) | |
0f71a2f6 JM |
2325 | { |
2326 | gdbarch->float_bit = float_bit; | |
2327 | } | |
2328 | ||
2329 | int | |
104c1213 | 2330 | gdbarch_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2331 | { |
66b43ecb | 2332 | /* Skip verify of double_bit, invalid_p == 0 */ |
0f71a2f6 | 2333 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2334 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n"); |
2335 | return gdbarch->double_bit; | |
2336 | } | |
2337 | ||
2338 | void | |
104c1213 JM |
2339 | set_gdbarch_double_bit (struct gdbarch *gdbarch, |
2340 | int double_bit) | |
0f71a2f6 JM |
2341 | { |
2342 | gdbarch->double_bit = double_bit; | |
2343 | } | |
2344 | ||
2345 | int | |
104c1213 | 2346 | gdbarch_long_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 2347 | { |
66b43ecb | 2348 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
0f71a2f6 | 2349 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2350 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n"); |
2351 | return gdbarch->long_double_bit; | |
2352 | } | |
2353 | ||
2354 | void | |
104c1213 JM |
2355 | set_gdbarch_long_double_bit (struct gdbarch *gdbarch, |
2356 | int long_double_bit) | |
0f71a2f6 JM |
2357 | { |
2358 | gdbarch->long_double_bit = long_double_bit; | |
2359 | } | |
2360 | ||
66b43ecb AC |
2361 | int |
2362 | gdbarch_ptr_bit (struct gdbarch *gdbarch) | |
2363 | { | |
2364 | /* Skip verify of ptr_bit, invalid_p == 0 */ | |
2365 | if (gdbarch_debug >= 2) | |
2366 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n"); | |
2367 | return gdbarch->ptr_bit; | |
2368 | } | |
2369 | ||
2370 | void | |
2371 | set_gdbarch_ptr_bit (struct gdbarch *gdbarch, | |
2372 | int ptr_bit) | |
2373 | { | |
2374 | gdbarch->ptr_bit = ptr_bit; | |
2375 | } | |
2376 | ||
52204a0b DT |
2377 | int |
2378 | gdbarch_addr_bit (struct gdbarch *gdbarch) | |
2379 | { | |
2380 | if (gdbarch->addr_bit == 0) | |
8e65ff28 AC |
2381 | internal_error (__FILE__, __LINE__, |
2382 | "gdbarch: gdbarch_addr_bit invalid"); | |
52204a0b DT |
2383 | if (gdbarch_debug >= 2) |
2384 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n"); | |
2385 | return gdbarch->addr_bit; | |
2386 | } | |
2387 | ||
2388 | void | |
2389 | set_gdbarch_addr_bit (struct gdbarch *gdbarch, | |
2390 | int addr_bit) | |
2391 | { | |
2392 | gdbarch->addr_bit = addr_bit; | |
2393 | } | |
2394 | ||
66b43ecb AC |
2395 | int |
2396 | gdbarch_bfd_vma_bit (struct gdbarch *gdbarch) | |
2397 | { | |
2398 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ | |
2399 | if (gdbarch_debug >= 2) | |
2400 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n"); | |
2401 | return gdbarch->bfd_vma_bit; | |
2402 | } | |
2403 | ||
2404 | void | |
2405 | set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, | |
2406 | int bfd_vma_bit) | |
2407 | { | |
2408 | gdbarch->bfd_vma_bit = bfd_vma_bit; | |
2409 | } | |
2410 | ||
7355ddba JB |
2411 | int |
2412 | gdbarch_ieee_float (struct gdbarch *gdbarch) | |
2413 | { | |
2414 | /* Skip verify of ieee_float, invalid_p == 0 */ | |
2415 | if (gdbarch_debug >= 2) | |
2416 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n"); | |
2417 | return gdbarch->ieee_float; | |
2418 | } | |
2419 | ||
2420 | void | |
2421 | set_gdbarch_ieee_float (struct gdbarch *gdbarch, | |
2422 | int ieee_float) | |
2423 | { | |
2424 | gdbarch->ieee_float = ieee_float; | |
2425 | } | |
2426 | ||
0f71a2f6 | 2427 | CORE_ADDR |
39f77062 | 2428 | gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid) |
0f71a2f6 JM |
2429 | { |
2430 | if (gdbarch->read_pc == 0) | |
8e65ff28 AC |
2431 | internal_error (__FILE__, __LINE__, |
2432 | "gdbarch: gdbarch_read_pc invalid"); | |
0f71a2f6 | 2433 | if (gdbarch_debug >= 2) |
0f71a2f6 | 2434 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); |
39f77062 | 2435 | return gdbarch->read_pc (ptid); |
0f71a2f6 JM |
2436 | } |
2437 | ||
2438 | void | |
104c1213 JM |
2439 | set_gdbarch_read_pc (struct gdbarch *gdbarch, |
2440 | gdbarch_read_pc_ftype read_pc) | |
0f71a2f6 JM |
2441 | { |
2442 | gdbarch->read_pc = read_pc; | |
2443 | } | |
2444 | ||
2445 | void | |
39f77062 | 2446 | gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid) |
0f71a2f6 JM |
2447 | { |
2448 | if (gdbarch->write_pc == 0) | |
8e65ff28 AC |
2449 | internal_error (__FILE__, __LINE__, |
2450 | "gdbarch: gdbarch_write_pc invalid"); | |
0f71a2f6 | 2451 | if (gdbarch_debug >= 2) |
0f71a2f6 | 2452 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); |
39f77062 | 2453 | gdbarch->write_pc (val, ptid); |
0f71a2f6 JM |
2454 | } |
2455 | ||
2456 | void | |
104c1213 JM |
2457 | set_gdbarch_write_pc (struct gdbarch *gdbarch, |
2458 | gdbarch_write_pc_ftype write_pc) | |
0f71a2f6 JM |
2459 | { |
2460 | gdbarch->write_pc = write_pc; | |
2461 | } | |
2462 | ||
2463 | CORE_ADDR | |
2464 | gdbarch_read_fp (struct gdbarch *gdbarch) | |
2465 | { | |
2466 | if (gdbarch->read_fp == 0) | |
8e65ff28 AC |
2467 | internal_error (__FILE__, __LINE__, |
2468 | "gdbarch: gdbarch_read_fp invalid"); | |
0f71a2f6 | 2469 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2470 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n"); |
2471 | return gdbarch->read_fp (); | |
2472 | } | |
2473 | ||
2474 | void | |
104c1213 JM |
2475 | set_gdbarch_read_fp (struct gdbarch *gdbarch, |
2476 | gdbarch_read_fp_ftype read_fp) | |
0f71a2f6 JM |
2477 | { |
2478 | gdbarch->read_fp = read_fp; | |
2479 | } | |
2480 | ||
2481 | void | |
2482 | gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val) | |
2483 | { | |
2484 | if (gdbarch->write_fp == 0) | |
8e65ff28 AC |
2485 | internal_error (__FILE__, __LINE__, |
2486 | "gdbarch: gdbarch_write_fp invalid"); | |
0f71a2f6 | 2487 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2488 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n"); |
2489 | gdbarch->write_fp (val); | |
2490 | } | |
2491 | ||
2492 | void | |
104c1213 JM |
2493 | set_gdbarch_write_fp (struct gdbarch *gdbarch, |
2494 | gdbarch_write_fp_ftype write_fp) | |
0f71a2f6 JM |
2495 | { |
2496 | gdbarch->write_fp = write_fp; | |
2497 | } | |
2498 | ||
2499 | CORE_ADDR | |
2500 | gdbarch_read_sp (struct gdbarch *gdbarch) | |
2501 | { | |
2502 | if (gdbarch->read_sp == 0) | |
8e65ff28 AC |
2503 | internal_error (__FILE__, __LINE__, |
2504 | "gdbarch: gdbarch_read_sp invalid"); | |
0f71a2f6 | 2505 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2506 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); |
2507 | return gdbarch->read_sp (); | |
2508 | } | |
2509 | ||
2510 | void | |
104c1213 JM |
2511 | set_gdbarch_read_sp (struct gdbarch *gdbarch, |
2512 | gdbarch_read_sp_ftype read_sp) | |
0f71a2f6 JM |
2513 | { |
2514 | gdbarch->read_sp = read_sp; | |
2515 | } | |
2516 | ||
2517 | void | |
2518 | gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) | |
2519 | { | |
2520 | if (gdbarch->write_sp == 0) | |
8e65ff28 AC |
2521 | internal_error (__FILE__, __LINE__, |
2522 | "gdbarch: gdbarch_write_sp invalid"); | |
0f71a2f6 | 2523 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2524 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n"); |
2525 | gdbarch->write_sp (val); | |
2526 | } | |
2527 | ||
2528 | void | |
104c1213 JM |
2529 | set_gdbarch_write_sp (struct gdbarch *gdbarch, |
2530 | gdbarch_write_sp_ftype write_sp) | |
0f71a2f6 JM |
2531 | { |
2532 | gdbarch->write_sp = write_sp; | |
2533 | } | |
2534 | ||
39d4ef09 AC |
2535 | void |
2536 | gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) | |
2537 | { | |
2538 | if (gdbarch->virtual_frame_pointer == 0) | |
2539 | internal_error (__FILE__, __LINE__, | |
2540 | "gdbarch: gdbarch_virtual_frame_pointer invalid"); | |
2541 | if (gdbarch_debug >= 2) | |
2542 | fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); | |
2543 | gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset); | |
2544 | } | |
2545 | ||
2546 | void | |
2547 | set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, | |
2548 | gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer) | |
2549 | { | |
2550 | gdbarch->virtual_frame_pointer = virtual_frame_pointer; | |
2551 | } | |
2552 | ||
61a0eb5b AC |
2553 | int |
2554 | gdbarch_register_read_p (struct gdbarch *gdbarch) | |
2555 | { | |
2556 | return gdbarch->register_read != 0; | |
2557 | } | |
2558 | ||
2559 | void | |
2560 | gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf) | |
2561 | { | |
2562 | if (gdbarch->register_read == 0) | |
2563 | internal_error (__FILE__, __LINE__, | |
2564 | "gdbarch: gdbarch_register_read invalid"); | |
2565 | if (gdbarch_debug >= 2) | |
2566 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_read called\n"); | |
2567 | gdbarch->register_read (gdbarch, regnum, buf); | |
2568 | } | |
2569 | ||
2570 | void | |
2571 | set_gdbarch_register_read (struct gdbarch *gdbarch, | |
2572 | gdbarch_register_read_ftype register_read) | |
2573 | { | |
2574 | gdbarch->register_read = register_read; | |
2575 | } | |
2576 | ||
2577 | int | |
2578 | gdbarch_register_write_p (struct gdbarch *gdbarch) | |
2579 | { | |
2580 | return gdbarch->register_write != 0; | |
2581 | } | |
2582 | ||
2583 | void | |
2584 | gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf) | |
2585 | { | |
2586 | if (gdbarch->register_write == 0) | |
2587 | internal_error (__FILE__, __LINE__, | |
2588 | "gdbarch: gdbarch_register_write invalid"); | |
2589 | if (gdbarch_debug >= 2) | |
2590 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_write called\n"); | |
2591 | gdbarch->register_write (gdbarch, regnum, buf); | |
2592 | } | |
2593 | ||
2594 | void | |
2595 | set_gdbarch_register_write (struct gdbarch *gdbarch, | |
2596 | gdbarch_register_write_ftype register_write) | |
2597 | { | |
2598 | gdbarch->register_write = register_write; | |
2599 | } | |
2600 | ||
0f71a2f6 | 2601 | int |
104c1213 | 2602 | gdbarch_num_regs (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2603 | { |
2604 | if (gdbarch->num_regs == -1) | |
8e65ff28 AC |
2605 | internal_error (__FILE__, __LINE__, |
2606 | "gdbarch: gdbarch_num_regs invalid"); | |
0f71a2f6 | 2607 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2608 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); |
2609 | return gdbarch->num_regs; | |
2610 | } | |
2611 | ||
2612 | void | |
104c1213 JM |
2613 | set_gdbarch_num_regs (struct gdbarch *gdbarch, |
2614 | int num_regs) | |
0f71a2f6 JM |
2615 | { |
2616 | gdbarch->num_regs = num_regs; | |
2617 | } | |
2618 | ||
0aba1244 EZ |
2619 | int |
2620 | gdbarch_num_pseudo_regs (struct gdbarch *gdbarch) | |
2621 | { | |
2622 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ | |
2623 | if (gdbarch_debug >= 2) | |
2624 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n"); | |
2625 | return gdbarch->num_pseudo_regs; | |
2626 | } | |
2627 | ||
2628 | void | |
2629 | set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, | |
2630 | int num_pseudo_regs) | |
2631 | { | |
2632 | gdbarch->num_pseudo_regs = num_pseudo_regs; | |
2633 | } | |
2634 | ||
0f71a2f6 | 2635 | int |
104c1213 | 2636 | gdbarch_sp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2637 | { |
2638 | if (gdbarch->sp_regnum == -1) | |
8e65ff28 AC |
2639 | internal_error (__FILE__, __LINE__, |
2640 | "gdbarch: gdbarch_sp_regnum invalid"); | |
0f71a2f6 | 2641 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2642 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); |
2643 | return gdbarch->sp_regnum; | |
2644 | } | |
2645 | ||
2646 | void | |
104c1213 JM |
2647 | set_gdbarch_sp_regnum (struct gdbarch *gdbarch, |
2648 | int sp_regnum) | |
0f71a2f6 JM |
2649 | { |
2650 | gdbarch->sp_regnum = sp_regnum; | |
2651 | } | |
2652 | ||
2653 | int | |
104c1213 | 2654 | gdbarch_fp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2655 | { |
2656 | if (gdbarch->fp_regnum == -1) | |
8e65ff28 AC |
2657 | internal_error (__FILE__, __LINE__, |
2658 | "gdbarch: gdbarch_fp_regnum invalid"); | |
0f71a2f6 | 2659 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2660 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n"); |
2661 | return gdbarch->fp_regnum; | |
2662 | } | |
2663 | ||
2664 | void | |
104c1213 JM |
2665 | set_gdbarch_fp_regnum (struct gdbarch *gdbarch, |
2666 | int fp_regnum) | |
0f71a2f6 JM |
2667 | { |
2668 | gdbarch->fp_regnum = fp_regnum; | |
2669 | } | |
2670 | ||
2671 | int | |
104c1213 | 2672 | gdbarch_pc_regnum (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2673 | { |
2674 | if (gdbarch->pc_regnum == -1) | |
8e65ff28 AC |
2675 | internal_error (__FILE__, __LINE__, |
2676 | "gdbarch: gdbarch_pc_regnum invalid"); | |
0f71a2f6 | 2677 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2678 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); |
2679 | return gdbarch->pc_regnum; | |
2680 | } | |
2681 | ||
2682 | void | |
104c1213 JM |
2683 | set_gdbarch_pc_regnum (struct gdbarch *gdbarch, |
2684 | int pc_regnum) | |
0f71a2f6 JM |
2685 | { |
2686 | gdbarch->pc_regnum = pc_regnum; | |
2687 | } | |
2688 | ||
60054393 MS |
2689 | int |
2690 | gdbarch_fp0_regnum (struct gdbarch *gdbarch) | |
2691 | { | |
2692 | /* Skip verify of fp0_regnum, invalid_p == 0 */ | |
2693 | if (gdbarch_debug >= 2) | |
2694 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n"); | |
2695 | return gdbarch->fp0_regnum; | |
2696 | } | |
2697 | ||
2698 | void | |
2699 | set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, | |
2700 | int fp0_regnum) | |
2701 | { | |
2702 | gdbarch->fp0_regnum = fp0_regnum; | |
2703 | } | |
2704 | ||
03863182 AC |
2705 | int |
2706 | gdbarch_npc_regnum (struct gdbarch *gdbarch) | |
2707 | { | |
2708 | /* Skip verify of npc_regnum, invalid_p == 0 */ | |
2709 | if (gdbarch_debug >= 2) | |
2710 | fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n"); | |
2711 | return gdbarch->npc_regnum; | |
2712 | } | |
2713 | ||
2714 | void | |
2715 | set_gdbarch_npc_regnum (struct gdbarch *gdbarch, | |
2716 | int npc_regnum) | |
2717 | { | |
2718 | gdbarch->npc_regnum = npc_regnum; | |
2719 | } | |
2720 | ||
2721 | int | |
2722 | gdbarch_nnpc_regnum (struct gdbarch *gdbarch) | |
2723 | { | |
2724 | /* Skip verify of nnpc_regnum, invalid_p == 0 */ | |
2725 | if (gdbarch_debug >= 2) | |
2726 | fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n"); | |
2727 | return gdbarch->nnpc_regnum; | |
2728 | } | |
2729 | ||
2730 | void | |
2731 | set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, | |
2732 | int nnpc_regnum) | |
2733 | { | |
2734 | gdbarch->nnpc_regnum = nnpc_regnum; | |
2735 | } | |
2736 | ||
88c72b7d AC |
2737 | int |
2738 | gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr) | |
2739 | { | |
2740 | if (gdbarch->stab_reg_to_regnum == 0) | |
8e65ff28 AC |
2741 | internal_error (__FILE__, __LINE__, |
2742 | "gdbarch: gdbarch_stab_reg_to_regnum invalid"); | |
88c72b7d AC |
2743 | if (gdbarch_debug >= 2) |
2744 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n"); | |
2745 | return gdbarch->stab_reg_to_regnum (stab_regnr); | |
2746 | } | |
2747 | ||
2748 | void | |
2749 | set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, | |
2750 | gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum) | |
2751 | { | |
2752 | gdbarch->stab_reg_to_regnum = stab_reg_to_regnum; | |
2753 | } | |
2754 | ||
2755 | int | |
2756 | gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr) | |
2757 | { | |
2758 | if (gdbarch->ecoff_reg_to_regnum == 0) | |
8e65ff28 AC |
2759 | internal_error (__FILE__, __LINE__, |
2760 | "gdbarch: gdbarch_ecoff_reg_to_regnum invalid"); | |
88c72b7d AC |
2761 | if (gdbarch_debug >= 2) |
2762 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n"); | |
2763 | return gdbarch->ecoff_reg_to_regnum (ecoff_regnr); | |
2764 | } | |
2765 | ||
2766 | void | |
2767 | set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, | |
2768 | gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum) | |
2769 | { | |
2770 | gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum; | |
2771 | } | |
2772 | ||
2773 | int | |
2774 | gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr) | |
2775 | { | |
2776 | if (gdbarch->dwarf_reg_to_regnum == 0) | |
8e65ff28 AC |
2777 | internal_error (__FILE__, __LINE__, |
2778 | "gdbarch: gdbarch_dwarf_reg_to_regnum invalid"); | |
88c72b7d AC |
2779 | if (gdbarch_debug >= 2) |
2780 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n"); | |
2781 | return gdbarch->dwarf_reg_to_regnum (dwarf_regnr); | |
2782 | } | |
2783 | ||
2784 | void | |
2785 | set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, | |
2786 | gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum) | |
2787 | { | |
2788 | gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum; | |
2789 | } | |
2790 | ||
2791 | int | |
2792 | gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr) | |
2793 | { | |
2794 | if (gdbarch->sdb_reg_to_regnum == 0) | |
8e65ff28 AC |
2795 | internal_error (__FILE__, __LINE__, |
2796 | "gdbarch: gdbarch_sdb_reg_to_regnum invalid"); | |
88c72b7d AC |
2797 | if (gdbarch_debug >= 2) |
2798 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n"); | |
2799 | return gdbarch->sdb_reg_to_regnum (sdb_regnr); | |
2800 | } | |
2801 | ||
2802 | void | |
2803 | set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, | |
2804 | gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum) | |
2805 | { | |
2806 | gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum; | |
2807 | } | |
2808 | ||
2809 | int | |
2810 | gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr) | |
2811 | { | |
2812 | if (gdbarch->dwarf2_reg_to_regnum == 0) | |
8e65ff28 AC |
2813 | internal_error (__FILE__, __LINE__, |
2814 | "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid"); | |
88c72b7d AC |
2815 | if (gdbarch_debug >= 2) |
2816 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n"); | |
2817 | return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr); | |
2818 | } | |
2819 | ||
2820 | void | |
2821 | set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, | |
2822 | gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum) | |
2823 | { | |
2824 | gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum; | |
2825 | } | |
2826 | ||
0f71a2f6 JM |
2827 | char * |
2828 | gdbarch_register_name (struct gdbarch *gdbarch, int regnr) | |
2829 | { | |
7be570e7 | 2830 | if (gdbarch->register_name == 0) |
8e65ff28 AC |
2831 | internal_error (__FILE__, __LINE__, |
2832 | "gdbarch: gdbarch_register_name invalid"); | |
0f71a2f6 | 2833 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2834 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); |
2835 | return gdbarch->register_name (regnr); | |
2836 | } | |
2837 | ||
2838 | void | |
104c1213 JM |
2839 | set_gdbarch_register_name (struct gdbarch *gdbarch, |
2840 | gdbarch_register_name_ftype register_name) | |
0f71a2f6 JM |
2841 | { |
2842 | gdbarch->register_name = register_name; | |
2843 | } | |
2844 | ||
2845 | int | |
104c1213 | 2846 | gdbarch_register_size (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2847 | { |
2848 | if (gdbarch->register_size == -1) | |
8e65ff28 AC |
2849 | internal_error (__FILE__, __LINE__, |
2850 | "gdbarch: gdbarch_register_size invalid"); | |
0f71a2f6 | 2851 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2852 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n"); |
2853 | return gdbarch->register_size; | |
2854 | } | |
2855 | ||
2856 | void | |
104c1213 JM |
2857 | set_gdbarch_register_size (struct gdbarch *gdbarch, |
2858 | int register_size) | |
0f71a2f6 JM |
2859 | { |
2860 | gdbarch->register_size = register_size; | |
2861 | } | |
2862 | ||
2863 | int | |
104c1213 | 2864 | gdbarch_register_bytes (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2865 | { |
2866 | if (gdbarch->register_bytes == -1) | |
8e65ff28 AC |
2867 | internal_error (__FILE__, __LINE__, |
2868 | "gdbarch: gdbarch_register_bytes invalid"); | |
0f71a2f6 | 2869 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2870 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n"); |
2871 | return gdbarch->register_bytes; | |
2872 | } | |
2873 | ||
2874 | void | |
104c1213 JM |
2875 | set_gdbarch_register_bytes (struct gdbarch *gdbarch, |
2876 | int register_bytes) | |
0f71a2f6 JM |
2877 | { |
2878 | gdbarch->register_bytes = register_bytes; | |
2879 | } | |
2880 | ||
2881 | int | |
2882 | gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr) | |
2883 | { | |
2884 | if (gdbarch->register_byte == 0) | |
8e65ff28 AC |
2885 | internal_error (__FILE__, __LINE__, |
2886 | "gdbarch: gdbarch_register_byte invalid"); | |
0f71a2f6 | 2887 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2888 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n"); |
2889 | return gdbarch->register_byte (reg_nr); | |
2890 | } | |
2891 | ||
2892 | void | |
104c1213 JM |
2893 | set_gdbarch_register_byte (struct gdbarch *gdbarch, |
2894 | gdbarch_register_byte_ftype register_byte) | |
0f71a2f6 JM |
2895 | { |
2896 | gdbarch->register_byte = register_byte; | |
2897 | } | |
2898 | ||
2899 | int | |
2900 | gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr) | |
2901 | { | |
2902 | if (gdbarch->register_raw_size == 0) | |
8e65ff28 AC |
2903 | internal_error (__FILE__, __LINE__, |
2904 | "gdbarch: gdbarch_register_raw_size invalid"); | |
0f71a2f6 | 2905 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2906 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n"); |
2907 | return gdbarch->register_raw_size (reg_nr); | |
2908 | } | |
2909 | ||
2910 | void | |
104c1213 JM |
2911 | set_gdbarch_register_raw_size (struct gdbarch *gdbarch, |
2912 | gdbarch_register_raw_size_ftype register_raw_size) | |
0f71a2f6 JM |
2913 | { |
2914 | gdbarch->register_raw_size = register_raw_size; | |
2915 | } | |
2916 | ||
2917 | int | |
104c1213 | 2918 | gdbarch_max_register_raw_size (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2919 | { |
2920 | if (gdbarch->max_register_raw_size == -1) | |
8e65ff28 AC |
2921 | internal_error (__FILE__, __LINE__, |
2922 | "gdbarch: gdbarch_max_register_raw_size invalid"); | |
0f71a2f6 | 2923 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2924 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n"); |
2925 | return gdbarch->max_register_raw_size; | |
2926 | } | |
2927 | ||
2928 | void | |
104c1213 JM |
2929 | set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, |
2930 | int max_register_raw_size) | |
0f71a2f6 JM |
2931 | { |
2932 | gdbarch->max_register_raw_size = max_register_raw_size; | |
2933 | } | |
2934 | ||
2935 | int | |
2936 | gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) | |
2937 | { | |
2938 | if (gdbarch->register_virtual_size == 0) | |
8e65ff28 AC |
2939 | internal_error (__FILE__, __LINE__, |
2940 | "gdbarch: gdbarch_register_virtual_size invalid"); | |
0f71a2f6 | 2941 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2942 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n"); |
2943 | return gdbarch->register_virtual_size (reg_nr); | |
2944 | } | |
2945 | ||
2946 | void | |
104c1213 JM |
2947 | set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, |
2948 | gdbarch_register_virtual_size_ftype register_virtual_size) | |
0f71a2f6 JM |
2949 | { |
2950 | gdbarch->register_virtual_size = register_virtual_size; | |
2951 | } | |
2952 | ||
2953 | int | |
104c1213 | 2954 | gdbarch_max_register_virtual_size (struct gdbarch *gdbarch) |
0f71a2f6 JM |
2955 | { |
2956 | if (gdbarch->max_register_virtual_size == -1) | |
8e65ff28 AC |
2957 | internal_error (__FILE__, __LINE__, |
2958 | "gdbarch: gdbarch_max_register_virtual_size invalid"); | |
0f71a2f6 | 2959 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2960 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n"); |
2961 | return gdbarch->max_register_virtual_size; | |
2962 | } | |
2963 | ||
2964 | void | |
104c1213 JM |
2965 | set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, |
2966 | int max_register_virtual_size) | |
0f71a2f6 JM |
2967 | { |
2968 | gdbarch->max_register_virtual_size = max_register_virtual_size; | |
2969 | } | |
2970 | ||
2971 | struct type * | |
2972 | gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) | |
2973 | { | |
2974 | if (gdbarch->register_virtual_type == 0) | |
8e65ff28 AC |
2975 | internal_error (__FILE__, __LINE__, |
2976 | "gdbarch: gdbarch_register_virtual_type invalid"); | |
0f71a2f6 | 2977 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2978 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n"); |
2979 | return gdbarch->register_virtual_type (reg_nr); | |
2980 | } | |
2981 | ||
2982 | void | |
104c1213 JM |
2983 | set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, |
2984 | gdbarch_register_virtual_type_ftype register_virtual_type) | |
0f71a2f6 JM |
2985 | { |
2986 | gdbarch->register_virtual_type = register_virtual_type; | |
2987 | } | |
2988 | ||
666e11c5 EZ |
2989 | void |
2990 | gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs) | |
2991 | { | |
2992 | if (gdbarch->do_registers_info == 0) | |
8e65ff28 AC |
2993 | internal_error (__FILE__, __LINE__, |
2994 | "gdbarch: gdbarch_do_registers_info invalid"); | |
666e11c5 EZ |
2995 | if (gdbarch_debug >= 2) |
2996 | fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n"); | |
2997 | gdbarch->do_registers_info (reg_nr, fpregs); | |
2998 | } | |
2999 | ||
3000 | void | |
3001 | set_gdbarch_do_registers_info (struct gdbarch *gdbarch, | |
3002 | gdbarch_do_registers_info_ftype do_registers_info) | |
3003 | { | |
3004 | gdbarch->do_registers_info = do_registers_info; | |
3005 | } | |
3006 | ||
7c7651b2 AC |
3007 | int |
3008 | gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) | |
3009 | { | |
3010 | if (gdbarch->register_sim_regno == 0) | |
8e65ff28 AC |
3011 | internal_error (__FILE__, __LINE__, |
3012 | "gdbarch: gdbarch_register_sim_regno invalid"); | |
7c7651b2 AC |
3013 | if (gdbarch_debug >= 2) |
3014 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); | |
3015 | return gdbarch->register_sim_regno (reg_nr); | |
3016 | } | |
3017 | ||
3018 | void | |
3019 | set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, | |
3020 | gdbarch_register_sim_regno_ftype register_sim_regno) | |
3021 | { | |
3022 | gdbarch->register_sim_regno = register_sim_regno; | |
3023 | } | |
3024 | ||
2649061d AC |
3025 | int |
3026 | gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch) | |
3027 | { | |
3028 | return gdbarch->register_bytes_ok != 0; | |
3029 | } | |
3030 | ||
3031 | int | |
3032 | gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes) | |
3033 | { | |
3034 | if (gdbarch->register_bytes_ok == 0) | |
8e65ff28 AC |
3035 | internal_error (__FILE__, __LINE__, |
3036 | "gdbarch: gdbarch_register_bytes_ok invalid"); | |
2649061d AC |
3037 | if (gdbarch_debug >= 2) |
3038 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n"); | |
3039 | return gdbarch->register_bytes_ok (nr_bytes); | |
3040 | } | |
3041 | ||
3042 | void | |
3043 | set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, | |
3044 | gdbarch_register_bytes_ok_ftype register_bytes_ok) | |
3045 | { | |
3046 | gdbarch->register_bytes_ok = register_bytes_ok; | |
3047 | } | |
3048 | ||
01fb7433 | 3049 | int |
1622c8f7 | 3050 | gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) |
01fb7433 AC |
3051 | { |
3052 | if (gdbarch->cannot_fetch_register == 0) | |
3053 | internal_error (__FILE__, __LINE__, | |
3054 | "gdbarch: gdbarch_cannot_fetch_register invalid"); | |
3055 | if (gdbarch_debug >= 2) | |
3056 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); | |
1622c8f7 | 3057 | return gdbarch->cannot_fetch_register (regnum); |
01fb7433 AC |
3058 | } |
3059 | ||
3060 | void | |
3061 | set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, | |
3062 | gdbarch_cannot_fetch_register_ftype cannot_fetch_register) | |
3063 | { | |
3064 | gdbarch->cannot_fetch_register = cannot_fetch_register; | |
3065 | } | |
3066 | ||
3067 | int | |
1622c8f7 | 3068 | gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) |
01fb7433 AC |
3069 | { |
3070 | if (gdbarch->cannot_store_register == 0) | |
3071 | internal_error (__FILE__, __LINE__, | |
3072 | "gdbarch: gdbarch_cannot_store_register invalid"); | |
3073 | if (gdbarch_debug >= 2) | |
3074 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); | |
1622c8f7 | 3075 | return gdbarch->cannot_store_register (regnum); |
01fb7433 AC |
3076 | } |
3077 | ||
3078 | void | |
3079 | set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, | |
3080 | gdbarch_cannot_store_register_ftype cannot_store_register) | |
3081 | { | |
3082 | gdbarch->cannot_store_register = cannot_store_register; | |
3083 | } | |
3084 | ||
0f71a2f6 | 3085 | int |
104c1213 | 3086 | gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3087 | { |
3088 | if (gdbarch->use_generic_dummy_frames == -1) | |
8e65ff28 AC |
3089 | internal_error (__FILE__, __LINE__, |
3090 | "gdbarch: gdbarch_use_generic_dummy_frames invalid"); | |
0f71a2f6 | 3091 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3092 | fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n"); |
3093 | return gdbarch->use_generic_dummy_frames; | |
3094 | } | |
3095 | ||
3096 | void | |
104c1213 JM |
3097 | set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, |
3098 | int use_generic_dummy_frames) | |
0f71a2f6 JM |
3099 | { |
3100 | gdbarch->use_generic_dummy_frames = use_generic_dummy_frames; | |
3101 | } | |
3102 | ||
3103 | int | |
104c1213 | 3104 | gdbarch_call_dummy_location (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3105 | { |
3106 | if (gdbarch->call_dummy_location == 0) | |
8e65ff28 AC |
3107 | internal_error (__FILE__, __LINE__, |
3108 | "gdbarch: gdbarch_call_dummy_location invalid"); | |
0f71a2f6 | 3109 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3110 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); |
3111 | return gdbarch->call_dummy_location; | |
3112 | } | |
3113 | ||
3114 | void | |
104c1213 JM |
3115 | set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, |
3116 | int call_dummy_location) | |
0f71a2f6 JM |
3117 | { |
3118 | gdbarch->call_dummy_location = call_dummy_location; | |
3119 | } | |
3120 | ||
3121 | CORE_ADDR | |
3122 | gdbarch_call_dummy_address (struct gdbarch *gdbarch) | |
3123 | { | |
3124 | if (gdbarch->call_dummy_address == 0) | |
8e65ff28 AC |
3125 | internal_error (__FILE__, __LINE__, |
3126 | "gdbarch: gdbarch_call_dummy_address invalid"); | |
0f71a2f6 | 3127 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3128 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n"); |
3129 | return gdbarch->call_dummy_address (); | |
3130 | } | |
3131 | ||
3132 | void | |
104c1213 JM |
3133 | set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, |
3134 | gdbarch_call_dummy_address_ftype call_dummy_address) | |
0f71a2f6 JM |
3135 | { |
3136 | gdbarch->call_dummy_address = call_dummy_address; | |
3137 | } | |
3138 | ||
3139 | CORE_ADDR | |
104c1213 | 3140 | gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3141 | { |
3142 | if (gdbarch->call_dummy_start_offset == -1) | |
8e65ff28 AC |
3143 | internal_error (__FILE__, __LINE__, |
3144 | "gdbarch: gdbarch_call_dummy_start_offset invalid"); | |
0f71a2f6 | 3145 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3146 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n"); |
3147 | return gdbarch->call_dummy_start_offset; | |
3148 | } | |
3149 | ||
3150 | void | |
104c1213 JM |
3151 | set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, |
3152 | CORE_ADDR call_dummy_start_offset) | |
0f71a2f6 JM |
3153 | { |
3154 | gdbarch->call_dummy_start_offset = call_dummy_start_offset; | |
3155 | } | |
3156 | ||
3157 | CORE_ADDR | |
104c1213 | 3158 | gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3159 | { |
3160 | if (gdbarch->call_dummy_breakpoint_offset == -1) | |
8e65ff28 AC |
3161 | internal_error (__FILE__, __LINE__, |
3162 | "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid"); | |
0f71a2f6 | 3163 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3164 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n"); |
3165 | return gdbarch->call_dummy_breakpoint_offset; | |
3166 | } | |
3167 | ||
3168 | void | |
104c1213 JM |
3169 | set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, |
3170 | CORE_ADDR call_dummy_breakpoint_offset) | |
0f71a2f6 JM |
3171 | { |
3172 | gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset; | |
3173 | } | |
3174 | ||
3175 | int | |
104c1213 | 3176 | gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3177 | { |
3178 | if (gdbarch->call_dummy_breakpoint_offset_p == -1) | |
8e65ff28 AC |
3179 | internal_error (__FILE__, __LINE__, |
3180 | "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid"); | |
0f71a2f6 | 3181 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3182 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n"); |
3183 | return gdbarch->call_dummy_breakpoint_offset_p; | |
3184 | } | |
3185 | ||
3186 | void | |
104c1213 JM |
3187 | set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, |
3188 | int call_dummy_breakpoint_offset_p) | |
0f71a2f6 JM |
3189 | { |
3190 | gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p; | |
3191 | } | |
3192 | ||
3193 | int | |
104c1213 | 3194 | gdbarch_call_dummy_length (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3195 | { |
3196 | if (gdbarch->call_dummy_length == -1) | |
8e65ff28 AC |
3197 | internal_error (__FILE__, __LINE__, |
3198 | "gdbarch: gdbarch_call_dummy_length invalid"); | |
0f71a2f6 | 3199 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3200 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n"); |
3201 | return gdbarch->call_dummy_length; | |
3202 | } | |
3203 | ||
3204 | void | |
104c1213 JM |
3205 | set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, |
3206 | int call_dummy_length) | |
0f71a2f6 JM |
3207 | { |
3208 | gdbarch->call_dummy_length = call_dummy_length; | |
3209 | } | |
3210 | ||
3211 | int | |
3212 | gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) | |
3213 | { | |
3214 | if (gdbarch->pc_in_call_dummy == 0) | |
8e65ff28 AC |
3215 | internal_error (__FILE__, __LINE__, |
3216 | "gdbarch: gdbarch_pc_in_call_dummy invalid"); | |
0f71a2f6 | 3217 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3218 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n"); |
3219 | return gdbarch->pc_in_call_dummy (pc, sp, frame_address); | |
3220 | } | |
3221 | ||
3222 | void | |
104c1213 JM |
3223 | set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, |
3224 | gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy) | |
0f71a2f6 JM |
3225 | { |
3226 | gdbarch->pc_in_call_dummy = pc_in_call_dummy; | |
3227 | } | |
3228 | ||
3229 | int | |
104c1213 | 3230 | gdbarch_call_dummy_p (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3231 | { |
3232 | if (gdbarch->call_dummy_p == -1) | |
8e65ff28 AC |
3233 | internal_error (__FILE__, __LINE__, |
3234 | "gdbarch: gdbarch_call_dummy_p invalid"); | |
0f71a2f6 | 3235 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3236 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n"); |
3237 | return gdbarch->call_dummy_p; | |
3238 | } | |
3239 | ||
3240 | void | |
104c1213 JM |
3241 | set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, |
3242 | int call_dummy_p) | |
0f71a2f6 JM |
3243 | { |
3244 | gdbarch->call_dummy_p = call_dummy_p; | |
3245 | } | |
3246 | ||
3247 | LONGEST * | |
104c1213 | 3248 | gdbarch_call_dummy_words (struct gdbarch *gdbarch) |
0f71a2f6 | 3249 | { |
c0e8c252 | 3250 | /* Skip verify of call_dummy_words, invalid_p == 0 */ |
0f71a2f6 | 3251 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3252 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n"); |
3253 | return gdbarch->call_dummy_words; | |
3254 | } | |
3255 | ||
3256 | void | |
104c1213 JM |
3257 | set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, |
3258 | LONGEST * call_dummy_words) | |
0f71a2f6 JM |
3259 | { |
3260 | gdbarch->call_dummy_words = call_dummy_words; | |
3261 | } | |
3262 | ||
3263 | int | |
104c1213 | 3264 | gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch) |
0f71a2f6 | 3265 | { |
c0e8c252 | 3266 | /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ |
0f71a2f6 | 3267 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3268 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n"); |
3269 | return gdbarch->sizeof_call_dummy_words; | |
3270 | } | |
3271 | ||
3272 | void | |
104c1213 JM |
3273 | set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, |
3274 | int sizeof_call_dummy_words) | |
0f71a2f6 JM |
3275 | { |
3276 | gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words; | |
3277 | } | |
3278 | ||
3279 | int | |
104c1213 | 3280 | gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3281 | { |
3282 | if (gdbarch->call_dummy_stack_adjust_p == -1) | |
8e65ff28 AC |
3283 | internal_error (__FILE__, __LINE__, |
3284 | "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid"); | |
0f71a2f6 | 3285 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3286 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n"); |
3287 | return gdbarch->call_dummy_stack_adjust_p; | |
3288 | } | |
3289 | ||
3290 | void | |
104c1213 JM |
3291 | set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, |
3292 | int call_dummy_stack_adjust_p) | |
0f71a2f6 JM |
3293 | { |
3294 | gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p; | |
3295 | } | |
3296 | ||
3297 | int | |
104c1213 | 3298 | gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3299 | { |
3300 | if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0) | |
8e65ff28 AC |
3301 | internal_error (__FILE__, __LINE__, |
3302 | "gdbarch: gdbarch_call_dummy_stack_adjust invalid"); | |
0f71a2f6 | 3303 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3304 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n"); |
3305 | return gdbarch->call_dummy_stack_adjust; | |
3306 | } | |
3307 | ||
3308 | void | |
104c1213 JM |
3309 | set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, |
3310 | int call_dummy_stack_adjust) | |
0f71a2f6 JM |
3311 | { |
3312 | gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust; | |
3313 | } | |
3314 | ||
3315 | void | |
3316 | 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) | |
3317 | { | |
3318 | if (gdbarch->fix_call_dummy == 0) | |
8e65ff28 AC |
3319 | internal_error (__FILE__, __LINE__, |
3320 | "gdbarch: gdbarch_fix_call_dummy invalid"); | |
0f71a2f6 | 3321 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3322 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n"); |
3323 | gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); | |
3324 | } | |
3325 | ||
3326 | void | |
104c1213 JM |
3327 | set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, |
3328 | gdbarch_fix_call_dummy_ftype fix_call_dummy) | |
0f71a2f6 JM |
3329 | { |
3330 | gdbarch->fix_call_dummy = fix_call_dummy; | |
3331 | } | |
3332 | ||
10312cc4 AC |
3333 | void |
3334 | gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) | |
3335 | { | |
3336 | if (gdbarch->init_frame_pc_first == 0) | |
3337 | internal_error (__FILE__, __LINE__, | |
3338 | "gdbarch: gdbarch_init_frame_pc_first invalid"); | |
3339 | if (gdbarch_debug >= 2) | |
3340 | fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n"); | |
3341 | gdbarch->init_frame_pc_first (fromleaf, prev); | |
3342 | } | |
3343 | ||
3344 | void | |
3345 | set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, | |
3346 | gdbarch_init_frame_pc_first_ftype init_frame_pc_first) | |
3347 | { | |
3348 | gdbarch->init_frame_pc_first = init_frame_pc_first; | |
3349 | } | |
3350 | ||
3351 | void | |
3352 | gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) | |
3353 | { | |
3354 | if (gdbarch->init_frame_pc == 0) | |
3355 | internal_error (__FILE__, __LINE__, | |
3356 | "gdbarch: gdbarch_init_frame_pc invalid"); | |
3357 | if (gdbarch_debug >= 2) | |
3358 | fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n"); | |
3359 | gdbarch->init_frame_pc (fromleaf, prev); | |
3360 | } | |
3361 | ||
3362 | void | |
3363 | set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, | |
3364 | gdbarch_init_frame_pc_ftype init_frame_pc) | |
3365 | { | |
3366 | gdbarch->init_frame_pc = init_frame_pc; | |
3367 | } | |
3368 | ||
0f71a2f6 | 3369 | int |
104c1213 | 3370 | gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3371 | { |
3372 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
3373 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n"); |
3374 | return gdbarch->believe_pcc_promotion; | |
3375 | } | |
3376 | ||
3377 | void | |
104c1213 JM |
3378 | set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, |
3379 | int believe_pcc_promotion) | |
0f71a2f6 JM |
3380 | { |
3381 | gdbarch->believe_pcc_promotion = believe_pcc_promotion; | |
3382 | } | |
3383 | ||
3384 | int | |
104c1213 | 3385 | gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3386 | { |
3387 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
3388 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n"); |
3389 | return gdbarch->believe_pcc_promotion_type; | |
3390 | } | |
3391 | ||
3392 | void | |
104c1213 JM |
3393 | set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, |
3394 | int believe_pcc_promotion_type) | |
0f71a2f6 JM |
3395 | { |
3396 | gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type; | |
3397 | } | |
3398 | ||
b9a8e3bf JB |
3399 | int |
3400 | gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual) | |
3401 | { | |
3402 | if (gdbarch->coerce_float_to_double == 0) | |
8e65ff28 AC |
3403 | internal_error (__FILE__, __LINE__, |
3404 | "gdbarch: gdbarch_coerce_float_to_double invalid"); | |
b9a8e3bf | 3405 | if (gdbarch_debug >= 2) |
b9a8e3bf JB |
3406 | fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n"); |
3407 | return gdbarch->coerce_float_to_double (formal, actual); | |
3408 | } | |
3409 | ||
3410 | void | |
3411 | set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, | |
3412 | gdbarch_coerce_float_to_double_ftype coerce_float_to_double) | |
3413 | { | |
3414 | gdbarch->coerce_float_to_double = coerce_float_to_double; | |
3415 | } | |
3416 | ||
0f71a2f6 | 3417 | void |
adf40b2e | 3418 | 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 |
3419 | { |
3420 | if (gdbarch->get_saved_register == 0) | |
8e65ff28 AC |
3421 | internal_error (__FILE__, __LINE__, |
3422 | "gdbarch: gdbarch_get_saved_register invalid"); | |
0f71a2f6 | 3423 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3424 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n"); |
3425 | gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval); | |
3426 | } | |
3427 | ||
3428 | void | |
104c1213 JM |
3429 | set_gdbarch_get_saved_register (struct gdbarch *gdbarch, |
3430 | gdbarch_get_saved_register_ftype get_saved_register) | |
0f71a2f6 JM |
3431 | { |
3432 | gdbarch->get_saved_register = get_saved_register; | |
3433 | } | |
3434 | ||
3435 | int | |
3436 | gdbarch_register_convertible (struct gdbarch *gdbarch, int nr) | |
3437 | { | |
3438 | if (gdbarch->register_convertible == 0) | |
8e65ff28 AC |
3439 | internal_error (__FILE__, __LINE__, |
3440 | "gdbarch: gdbarch_register_convertible invalid"); | |
0f71a2f6 | 3441 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3442 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n"); |
3443 | return gdbarch->register_convertible (nr); | |
3444 | } | |
3445 | ||
3446 | void | |
104c1213 JM |
3447 | set_gdbarch_register_convertible (struct gdbarch *gdbarch, |
3448 | gdbarch_register_convertible_ftype register_convertible) | |
0f71a2f6 JM |
3449 | { |
3450 | gdbarch->register_convertible = register_convertible; | |
3451 | } | |
3452 | ||
3453 | void | |
3454 | gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) | |
3455 | { | |
3456 | if (gdbarch->register_convert_to_virtual == 0) | |
8e65ff28 AC |
3457 | internal_error (__FILE__, __LINE__, |
3458 | "gdbarch: gdbarch_register_convert_to_virtual invalid"); | |
0f71a2f6 | 3459 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3460 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n"); |
3461 | gdbarch->register_convert_to_virtual (regnum, type, from, to); | |
3462 | } | |
3463 | ||
3464 | void | |
104c1213 JM |
3465 | set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, |
3466 | gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual) | |
0f71a2f6 JM |
3467 | { |
3468 | gdbarch->register_convert_to_virtual = register_convert_to_virtual; | |
3469 | } | |
3470 | ||
3471 | void | |
3472 | gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to) | |
3473 | { | |
3474 | if (gdbarch->register_convert_to_raw == 0) | |
8e65ff28 AC |
3475 | internal_error (__FILE__, __LINE__, |
3476 | "gdbarch: gdbarch_register_convert_to_raw invalid"); | |
0f71a2f6 | 3477 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3478 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n"); |
3479 | gdbarch->register_convert_to_raw (type, regnum, from, to); | |
3480 | } | |
3481 | ||
3482 | void | |
104c1213 JM |
3483 | set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, |
3484 | gdbarch_register_convert_to_raw_ftype register_convert_to_raw) | |
0f71a2f6 JM |
3485 | { |
3486 | gdbarch->register_convert_to_raw = register_convert_to_raw; | |
3487 | } | |
3488 | ||
7f1b2585 EZ |
3489 | void |
3490 | gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum) | |
3491 | { | |
3492 | if (gdbarch->fetch_pseudo_register == 0) | |
8e65ff28 AC |
3493 | internal_error (__FILE__, __LINE__, |
3494 | "gdbarch: gdbarch_fetch_pseudo_register invalid"); | |
7f1b2585 EZ |
3495 | if (gdbarch_debug >= 2) |
3496 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n"); | |
3497 | gdbarch->fetch_pseudo_register (regnum); | |
3498 | } | |
3499 | ||
3500 | void | |
3501 | set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, | |
3502 | gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register) | |
3503 | { | |
3504 | gdbarch->fetch_pseudo_register = fetch_pseudo_register; | |
3505 | } | |
3506 | ||
3507 | void | |
3508 | gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum) | |
3509 | { | |
3510 | if (gdbarch->store_pseudo_register == 0) | |
8e65ff28 AC |
3511 | internal_error (__FILE__, __LINE__, |
3512 | "gdbarch: gdbarch_store_pseudo_register invalid"); | |
7f1b2585 EZ |
3513 | if (gdbarch_debug >= 2) |
3514 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n"); | |
3515 | gdbarch->store_pseudo_register (regnum); | |
3516 | } | |
3517 | ||
3518 | void | |
3519 | set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, | |
3520 | gdbarch_store_pseudo_register_ftype store_pseudo_register) | |
3521 | { | |
3522 | gdbarch->store_pseudo_register = store_pseudo_register; | |
3523 | } | |
3524 | ||
4478b372 | 3525 | CORE_ADDR |
ac2e2ef7 | 3526 | gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) |
4478b372 JB |
3527 | { |
3528 | if (gdbarch->pointer_to_address == 0) | |
8e65ff28 AC |
3529 | internal_error (__FILE__, __LINE__, |
3530 | "gdbarch: gdbarch_pointer_to_address invalid"); | |
4478b372 JB |
3531 | if (gdbarch_debug >= 2) |
3532 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); | |
3533 | return gdbarch->pointer_to_address (type, buf); | |
3534 | } | |
3535 | ||
3536 | void | |
3537 | set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, | |
3538 | gdbarch_pointer_to_address_ftype pointer_to_address) | |
3539 | { | |
3540 | gdbarch->pointer_to_address = pointer_to_address; | |
3541 | } | |
3542 | ||
3543 | void | |
ac2e2ef7 | 3544 | gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr) |
4478b372 JB |
3545 | { |
3546 | if (gdbarch->address_to_pointer == 0) | |
8e65ff28 AC |
3547 | internal_error (__FILE__, __LINE__, |
3548 | "gdbarch: gdbarch_address_to_pointer invalid"); | |
4478b372 JB |
3549 | if (gdbarch_debug >= 2) |
3550 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); | |
3551 | gdbarch->address_to_pointer (type, buf, addr); | |
3552 | } | |
3553 | ||
3554 | void | |
3555 | set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, | |
3556 | gdbarch_address_to_pointer_ftype address_to_pointer) | |
3557 | { | |
3558 | gdbarch->address_to_pointer = address_to_pointer; | |
3559 | } | |
3560 | ||
71a9f22e JB |
3561 | int |
3562 | gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type) | |
3563 | { | |
71a9f22e | 3564 | if (gdbarch->return_value_on_stack == 0) |
8e65ff28 AC |
3565 | internal_error (__FILE__, __LINE__, |
3566 | "gdbarch: gdbarch_return_value_on_stack invalid"); | |
71a9f22e JB |
3567 | if (gdbarch_debug >= 2) |
3568 | fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n"); | |
3569 | return gdbarch->return_value_on_stack (type); | |
3570 | } | |
3571 | ||
3572 | void | |
3573 | set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, | |
3574 | gdbarch_return_value_on_stack_ftype return_value_on_stack) | |
3575 | { | |
3576 | gdbarch->return_value_on_stack = return_value_on_stack; | |
3577 | } | |
3578 | ||
0f71a2f6 JM |
3579 | void |
3580 | gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) | |
3581 | { | |
3582 | if (gdbarch->extract_return_value == 0) | |
8e65ff28 AC |
3583 | internal_error (__FILE__, __LINE__, |
3584 | "gdbarch: gdbarch_extract_return_value invalid"); | |
0f71a2f6 | 3585 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3586 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); |
3587 | gdbarch->extract_return_value (type, regbuf, valbuf); | |
3588 | } | |
3589 | ||
3590 | void | |
104c1213 JM |
3591 | set_gdbarch_extract_return_value (struct gdbarch *gdbarch, |
3592 | gdbarch_extract_return_value_ftype extract_return_value) | |
0f71a2f6 JM |
3593 | { |
3594 | gdbarch->extract_return_value = extract_return_value; | |
3595 | } | |
3596 | ||
3597 | CORE_ADDR | |
3598 | gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) | |
3599 | { | |
3600 | if (gdbarch->push_arguments == 0) | |
8e65ff28 AC |
3601 | internal_error (__FILE__, __LINE__, |
3602 | "gdbarch: gdbarch_push_arguments invalid"); | |
0f71a2f6 | 3603 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3604 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n"); |
3605 | return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr); | |
3606 | } | |
3607 | ||
3608 | void | |
104c1213 JM |
3609 | set_gdbarch_push_arguments (struct gdbarch *gdbarch, |
3610 | gdbarch_push_arguments_ftype push_arguments) | |
0f71a2f6 JM |
3611 | { |
3612 | gdbarch->push_arguments = push_arguments; | |
3613 | } | |
3614 | ||
3615 | void | |
3616 | gdbarch_push_dummy_frame (struct gdbarch *gdbarch) | |
3617 | { | |
3618 | if (gdbarch->push_dummy_frame == 0) | |
8e65ff28 AC |
3619 | internal_error (__FILE__, __LINE__, |
3620 | "gdbarch: gdbarch_push_dummy_frame invalid"); | |
0f71a2f6 | 3621 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3622 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n"); |
3623 | gdbarch->push_dummy_frame (); | |
3624 | } | |
3625 | ||
3626 | void | |
104c1213 JM |
3627 | set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, |
3628 | gdbarch_push_dummy_frame_ftype push_dummy_frame) | |
0f71a2f6 JM |
3629 | { |
3630 | gdbarch->push_dummy_frame = push_dummy_frame; | |
3631 | } | |
3632 | ||
3633 | CORE_ADDR | |
3634 | gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) | |
3635 | { | |
3636 | if (gdbarch->push_return_address == 0) | |
8e65ff28 AC |
3637 | internal_error (__FILE__, __LINE__, |
3638 | "gdbarch: gdbarch_push_return_address invalid"); | |
0f71a2f6 | 3639 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3640 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n"); |
3641 | return gdbarch->push_return_address (pc, sp); | |
3642 | } | |
3643 | ||
3644 | void | |
104c1213 JM |
3645 | set_gdbarch_push_return_address (struct gdbarch *gdbarch, |
3646 | gdbarch_push_return_address_ftype push_return_address) | |
0f71a2f6 JM |
3647 | { |
3648 | gdbarch->push_return_address = push_return_address; | |
3649 | } | |
3650 | ||
3651 | void | |
3652 | gdbarch_pop_frame (struct gdbarch *gdbarch) | |
3653 | { | |
3654 | if (gdbarch->pop_frame == 0) | |
8e65ff28 AC |
3655 | internal_error (__FILE__, __LINE__, |
3656 | "gdbarch: gdbarch_pop_frame invalid"); | |
0f71a2f6 | 3657 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3658 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n"); |
3659 | gdbarch->pop_frame (); | |
3660 | } | |
3661 | ||
3662 | void | |
104c1213 JM |
3663 | set_gdbarch_pop_frame (struct gdbarch *gdbarch, |
3664 | gdbarch_pop_frame_ftype pop_frame) | |
0f71a2f6 JM |
3665 | { |
3666 | gdbarch->pop_frame = pop_frame; | |
3667 | } | |
3668 | ||
0f71a2f6 JM |
3669 | void |
3670 | gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) | |
3671 | { | |
3672 | if (gdbarch->store_struct_return == 0) | |
8e65ff28 AC |
3673 | internal_error (__FILE__, __LINE__, |
3674 | "gdbarch: gdbarch_store_struct_return invalid"); | |
0f71a2f6 | 3675 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3676 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n"); |
3677 | gdbarch->store_struct_return (addr, sp); | |
3678 | } | |
3679 | ||
3680 | void | |
104c1213 JM |
3681 | set_gdbarch_store_struct_return (struct gdbarch *gdbarch, |
3682 | gdbarch_store_struct_return_ftype store_struct_return) | |
0f71a2f6 JM |
3683 | { |
3684 | gdbarch->store_struct_return = store_struct_return; | |
3685 | } | |
3686 | ||
3687 | void | |
3688 | gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) | |
3689 | { | |
3690 | if (gdbarch->store_return_value == 0) | |
8e65ff28 AC |
3691 | internal_error (__FILE__, __LINE__, |
3692 | "gdbarch: gdbarch_store_return_value invalid"); | |
0f71a2f6 | 3693 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3694 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); |
3695 | gdbarch->store_return_value (type, valbuf); | |
3696 | } | |
3697 | ||
3698 | void | |
104c1213 JM |
3699 | set_gdbarch_store_return_value (struct gdbarch *gdbarch, |
3700 | gdbarch_store_return_value_ftype store_return_value) | |
0f71a2f6 JM |
3701 | { |
3702 | gdbarch->store_return_value = store_return_value; | |
3703 | } | |
3704 | ||
d6dd581e AC |
3705 | int |
3706 | gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch) | |
3707 | { | |
3708 | return gdbarch->extract_struct_value_address != 0; | |
3709 | } | |
3710 | ||
0f71a2f6 JM |
3711 | CORE_ADDR |
3712 | gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf) | |
3713 | { | |
3714 | if (gdbarch->extract_struct_value_address == 0) | |
8e65ff28 AC |
3715 | internal_error (__FILE__, __LINE__, |
3716 | "gdbarch: gdbarch_extract_struct_value_address invalid"); | |
0f71a2f6 | 3717 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3718 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n"); |
3719 | return gdbarch->extract_struct_value_address (regbuf); | |
3720 | } | |
3721 | ||
3722 | void | |
104c1213 JM |
3723 | set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, |
3724 | gdbarch_extract_struct_value_address_ftype extract_struct_value_address) | |
0f71a2f6 JM |
3725 | { |
3726 | gdbarch->extract_struct_value_address = extract_struct_value_address; | |
3727 | } | |
3728 | ||
3729 | int | |
3730 | gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type) | |
3731 | { | |
3732 | if (gdbarch->use_struct_convention == 0) | |
8e65ff28 AC |
3733 | internal_error (__FILE__, __LINE__, |
3734 | "gdbarch: gdbarch_use_struct_convention invalid"); | |
0f71a2f6 | 3735 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3736 | fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n"); |
3737 | return gdbarch->use_struct_convention (gcc_p, value_type); | |
3738 | } | |
3739 | ||
3740 | void | |
104c1213 JM |
3741 | set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, |
3742 | gdbarch_use_struct_convention_ftype use_struct_convention) | |
0f71a2f6 JM |
3743 | { |
3744 | gdbarch->use_struct_convention = use_struct_convention; | |
3745 | } | |
3746 | ||
3747 | void | |
3748 | gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) | |
3749 | { | |
3750 | if (gdbarch->frame_init_saved_regs == 0) | |
8e65ff28 AC |
3751 | internal_error (__FILE__, __LINE__, |
3752 | "gdbarch: gdbarch_frame_init_saved_regs invalid"); | |
0f71a2f6 | 3753 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3754 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n"); |
3755 | gdbarch->frame_init_saved_regs (frame); | |
3756 | } | |
3757 | ||
3758 | void | |
104c1213 JM |
3759 | set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, |
3760 | gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs) | |
0f71a2f6 JM |
3761 | { |
3762 | gdbarch->frame_init_saved_regs = frame_init_saved_regs; | |
3763 | } | |
3764 | ||
3765 | void | |
3766 | gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame) | |
3767 | { | |
3768 | if (gdbarch->init_extra_frame_info == 0) | |
8e65ff28 AC |
3769 | internal_error (__FILE__, __LINE__, |
3770 | "gdbarch: gdbarch_init_extra_frame_info invalid"); | |
0f71a2f6 | 3771 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3772 | fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n"); |
3773 | gdbarch->init_extra_frame_info (fromleaf, frame); | |
3774 | } | |
3775 | ||
3776 | void | |
104c1213 JM |
3777 | set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, |
3778 | gdbarch_init_extra_frame_info_ftype init_extra_frame_info) | |
0f71a2f6 JM |
3779 | { |
3780 | gdbarch->init_extra_frame_info = init_extra_frame_info; | |
3781 | } | |
3782 | ||
3783 | CORE_ADDR | |
3784 | gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) | |
3785 | { | |
3786 | if (gdbarch->skip_prologue == 0) | |
8e65ff28 AC |
3787 | internal_error (__FILE__, __LINE__, |
3788 | "gdbarch: gdbarch_skip_prologue invalid"); | |
0f71a2f6 | 3789 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3790 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); |
3791 | return gdbarch->skip_prologue (ip); | |
3792 | } | |
3793 | ||
3794 | void | |
104c1213 JM |
3795 | set_gdbarch_skip_prologue (struct gdbarch *gdbarch, |
3796 | gdbarch_skip_prologue_ftype skip_prologue) | |
0f71a2f6 JM |
3797 | { |
3798 | gdbarch->skip_prologue = skip_prologue; | |
3799 | } | |
3800 | ||
dad41f9a AC |
3801 | int |
3802 | gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip) | |
3803 | { | |
dad41f9a | 3804 | if (gdbarch->prologue_frameless_p == 0) |
8e65ff28 AC |
3805 | internal_error (__FILE__, __LINE__, |
3806 | "gdbarch: gdbarch_prologue_frameless_p invalid"); | |
dad41f9a AC |
3807 | if (gdbarch_debug >= 2) |
3808 | fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n"); | |
3809 | return gdbarch->prologue_frameless_p (ip); | |
3810 | } | |
3811 | ||
3812 | void | |
3813 | set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, | |
3814 | gdbarch_prologue_frameless_p_ftype prologue_frameless_p) | |
3815 | { | |
3816 | gdbarch->prologue_frameless_p = prologue_frameless_p; | |
3817 | } | |
3818 | ||
0f71a2f6 JM |
3819 | int |
3820 | gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) | |
3821 | { | |
3822 | if (gdbarch->inner_than == 0) | |
8e65ff28 AC |
3823 | internal_error (__FILE__, __LINE__, |
3824 | "gdbarch: gdbarch_inner_than invalid"); | |
0f71a2f6 | 3825 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3826 | fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); |
3827 | return gdbarch->inner_than (lhs, rhs); | |
3828 | } | |
3829 | ||
3830 | void | |
104c1213 JM |
3831 | set_gdbarch_inner_than (struct gdbarch *gdbarch, |
3832 | gdbarch_inner_than_ftype inner_than) | |
0f71a2f6 JM |
3833 | { |
3834 | gdbarch->inner_than = inner_than; | |
3835 | } | |
3836 | ||
3837 | unsigned char * | |
adf40b2e | 3838 | gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) |
0f71a2f6 JM |
3839 | { |
3840 | if (gdbarch->breakpoint_from_pc == 0) | |
8e65ff28 AC |
3841 | internal_error (__FILE__, __LINE__, |
3842 | "gdbarch: gdbarch_breakpoint_from_pc invalid"); | |
0f71a2f6 | 3843 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3844 | fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); |
3845 | return gdbarch->breakpoint_from_pc (pcptr, lenptr); | |
3846 | } | |
3847 | ||
3848 | void | |
104c1213 JM |
3849 | set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, |
3850 | gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc) | |
0f71a2f6 JM |
3851 | { |
3852 | gdbarch->breakpoint_from_pc = breakpoint_from_pc; | |
3853 | } | |
3854 | ||
917317f4 JM |
3855 | int |
3856 | gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) | |
3857 | { | |
3858 | if (gdbarch->memory_insert_breakpoint == 0) | |
8e65ff28 AC |
3859 | internal_error (__FILE__, __LINE__, |
3860 | "gdbarch: gdbarch_memory_insert_breakpoint invalid"); | |
917317f4 | 3861 | if (gdbarch_debug >= 2) |
917317f4 JM |
3862 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); |
3863 | return gdbarch->memory_insert_breakpoint (addr, contents_cache); | |
3864 | } | |
3865 | ||
3866 | void | |
3867 | set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, | |
3868 | gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint) | |
3869 | { | |
3870 | gdbarch->memory_insert_breakpoint = memory_insert_breakpoint; | |
3871 | } | |
3872 | ||
3873 | int | |
3874 | gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) | |
3875 | { | |
3876 | if (gdbarch->memory_remove_breakpoint == 0) | |
8e65ff28 AC |
3877 | internal_error (__FILE__, __LINE__, |
3878 | "gdbarch: gdbarch_memory_remove_breakpoint invalid"); | |
917317f4 | 3879 | if (gdbarch_debug >= 2) |
917317f4 JM |
3880 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); |
3881 | return gdbarch->memory_remove_breakpoint (addr, contents_cache); | |
3882 | } | |
3883 | ||
3884 | void | |
3885 | set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, | |
3886 | gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint) | |
3887 | { | |
3888 | gdbarch->memory_remove_breakpoint = memory_remove_breakpoint; | |
3889 | } | |
3890 | ||
0f71a2f6 | 3891 | CORE_ADDR |
104c1213 | 3892 | gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3893 | { |
3894 | if (gdbarch->decr_pc_after_break == -1) | |
8e65ff28 AC |
3895 | internal_error (__FILE__, __LINE__, |
3896 | "gdbarch: gdbarch_decr_pc_after_break invalid"); | |
0f71a2f6 | 3897 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3898 | fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); |
3899 | return gdbarch->decr_pc_after_break; | |
3900 | } | |
3901 | ||
3902 | void | |
104c1213 JM |
3903 | set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, |
3904 | CORE_ADDR decr_pc_after_break) | |
0f71a2f6 JM |
3905 | { |
3906 | gdbarch->decr_pc_after_break = decr_pc_after_break; | |
3907 | } | |
3908 | ||
e02bc4cc DS |
3909 | int |
3910 | gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it) | |
3911 | { | |
3912 | if (gdbarch->prepare_to_proceed == 0) | |
3913 | internal_error (__FILE__, __LINE__, | |
3914 | "gdbarch: gdbarch_prepare_to_proceed invalid"); | |
3915 | if (gdbarch_debug >= 2) | |
3916 | fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n"); | |
3917 | return gdbarch->prepare_to_proceed (select_it); | |
3918 | } | |
3919 | ||
3920 | void | |
3921 | set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, | |
3922 | gdbarch_prepare_to_proceed_ftype prepare_to_proceed) | |
3923 | { | |
3924 | gdbarch->prepare_to_proceed = prepare_to_proceed; | |
3925 | } | |
3926 | ||
0f71a2f6 | 3927 | CORE_ADDR |
104c1213 | 3928 | gdbarch_function_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3929 | { |
3930 | if (gdbarch->function_start_offset == -1) | |
8e65ff28 AC |
3931 | internal_error (__FILE__, __LINE__, |
3932 | "gdbarch: gdbarch_function_start_offset invalid"); | |
0f71a2f6 | 3933 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3934 | fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n"); |
3935 | return gdbarch->function_start_offset; | |
3936 | } | |
3937 | ||
3938 | void | |
104c1213 JM |
3939 | set_gdbarch_function_start_offset (struct gdbarch *gdbarch, |
3940 | CORE_ADDR function_start_offset) | |
0f71a2f6 JM |
3941 | { |
3942 | gdbarch->function_start_offset = function_start_offset; | |
3943 | } | |
3944 | ||
3945 | void | |
adf40b2e | 3946 | gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len) |
0f71a2f6 JM |
3947 | { |
3948 | if (gdbarch->remote_translate_xfer_address == 0) | |
8e65ff28 AC |
3949 | internal_error (__FILE__, __LINE__, |
3950 | "gdbarch: gdbarch_remote_translate_xfer_address invalid"); | |
0f71a2f6 | 3951 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3952 | fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n"); |
3953 | gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len); | |
3954 | } | |
3955 | ||
3956 | void | |
104c1213 JM |
3957 | set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, |
3958 | gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address) | |
0f71a2f6 JM |
3959 | { |
3960 | gdbarch->remote_translate_xfer_address = remote_translate_xfer_address; | |
3961 | } | |
3962 | ||
3963 | CORE_ADDR | |
104c1213 | 3964 | gdbarch_frame_args_skip (struct gdbarch *gdbarch) |
0f71a2f6 JM |
3965 | { |
3966 | if (gdbarch->frame_args_skip == -1) | |
8e65ff28 AC |
3967 | internal_error (__FILE__, __LINE__, |
3968 | "gdbarch: gdbarch_frame_args_skip invalid"); | |
0f71a2f6 | 3969 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3970 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); |
3971 | return gdbarch->frame_args_skip; | |
3972 | } | |
3973 | ||
3974 | void | |
104c1213 JM |
3975 | set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, |
3976 | CORE_ADDR frame_args_skip) | |
0f71a2f6 JM |
3977 | { |
3978 | gdbarch->frame_args_skip = frame_args_skip; | |
3979 | } | |
3980 | ||
3981 | int | |
3982 | gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi) | |
3983 | { | |
3984 | if (gdbarch->frameless_function_invocation == 0) | |
8e65ff28 AC |
3985 | internal_error (__FILE__, __LINE__, |
3986 | "gdbarch: gdbarch_frameless_function_invocation invalid"); | |
0f71a2f6 | 3987 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3988 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n"); |
3989 | return gdbarch->frameless_function_invocation (fi); | |
3990 | } | |
3991 | ||
3992 | void | |
104c1213 JM |
3993 | set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, |
3994 | gdbarch_frameless_function_invocation_ftype frameless_function_invocation) | |
0f71a2f6 JM |
3995 | { |
3996 | gdbarch->frameless_function_invocation = frameless_function_invocation; | |
3997 | } | |
3998 | ||
3999 | CORE_ADDR | |
4000 | gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) | |
4001 | { | |
4002 | if (gdbarch->frame_chain == 0) | |
8e65ff28 AC |
4003 | internal_error (__FILE__, __LINE__, |
4004 | "gdbarch: gdbarch_frame_chain invalid"); | |
0f71a2f6 | 4005 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4006 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n"); |
4007 | return gdbarch->frame_chain (frame); | |
4008 | } | |
4009 | ||
4010 | void | |
104c1213 JM |
4011 | set_gdbarch_frame_chain (struct gdbarch *gdbarch, |
4012 | gdbarch_frame_chain_ftype frame_chain) | |
0f71a2f6 JM |
4013 | { |
4014 | gdbarch->frame_chain = frame_chain; | |
4015 | } | |
4016 | ||
4017 | int | |
4018 | gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe) | |
4019 | { | |
4020 | if (gdbarch->frame_chain_valid == 0) | |
8e65ff28 AC |
4021 | internal_error (__FILE__, __LINE__, |
4022 | "gdbarch: gdbarch_frame_chain_valid invalid"); | |
0f71a2f6 | 4023 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4024 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n"); |
4025 | return gdbarch->frame_chain_valid (chain, thisframe); | |
4026 | } | |
4027 | ||
4028 | void | |
104c1213 JM |
4029 | set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, |
4030 | gdbarch_frame_chain_valid_ftype frame_chain_valid) | |
0f71a2f6 JM |
4031 | { |
4032 | gdbarch->frame_chain_valid = frame_chain_valid; | |
4033 | } | |
4034 | ||
4035 | CORE_ADDR | |
4036 | gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi) | |
4037 | { | |
4038 | if (gdbarch->frame_saved_pc == 0) | |
8e65ff28 AC |
4039 | internal_error (__FILE__, __LINE__, |
4040 | "gdbarch: gdbarch_frame_saved_pc invalid"); | |
0f71a2f6 | 4041 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4042 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n"); |
4043 | return gdbarch->frame_saved_pc (fi); | |
4044 | } | |
4045 | ||
4046 | void | |
104c1213 JM |
4047 | set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, |
4048 | gdbarch_frame_saved_pc_ftype frame_saved_pc) | |
0f71a2f6 JM |
4049 | { |
4050 | gdbarch->frame_saved_pc = frame_saved_pc; | |
4051 | } | |
4052 | ||
4053 | CORE_ADDR | |
4054 | gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) | |
4055 | { | |
4056 | if (gdbarch->frame_args_address == 0) | |
8e65ff28 AC |
4057 | internal_error (__FILE__, __LINE__, |
4058 | "gdbarch: gdbarch_frame_args_address invalid"); | |
0f71a2f6 | 4059 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4060 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n"); |
4061 | return gdbarch->frame_args_address (fi); | |
4062 | } | |
4063 | ||
4064 | void | |
104c1213 JM |
4065 | set_gdbarch_frame_args_address (struct gdbarch *gdbarch, |
4066 | gdbarch_frame_args_address_ftype frame_args_address) | |
0f71a2f6 JM |
4067 | { |
4068 | gdbarch->frame_args_address = frame_args_address; | |
4069 | } | |
4070 | ||
4071 | CORE_ADDR | |
4072 | gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) | |
4073 | { | |
4074 | if (gdbarch->frame_locals_address == 0) | |
8e65ff28 AC |
4075 | internal_error (__FILE__, __LINE__, |
4076 | "gdbarch: gdbarch_frame_locals_address invalid"); | |
0f71a2f6 | 4077 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4078 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n"); |
4079 | return gdbarch->frame_locals_address (fi); | |
4080 | } | |
4081 | ||
4082 | void | |
104c1213 JM |
4083 | set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, |
4084 | gdbarch_frame_locals_address_ftype frame_locals_address) | |
0f71a2f6 JM |
4085 | { |
4086 | gdbarch->frame_locals_address = frame_locals_address; | |
4087 | } | |
4088 | ||
4089 | CORE_ADDR | |
4090 | gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame) | |
4091 | { | |
4092 | if (gdbarch->saved_pc_after_call == 0) | |
8e65ff28 AC |
4093 | internal_error (__FILE__, __LINE__, |
4094 | "gdbarch: gdbarch_saved_pc_after_call invalid"); | |
0f71a2f6 | 4095 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4096 | fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n"); |
4097 | return gdbarch->saved_pc_after_call (frame); | |
4098 | } | |
4099 | ||
4100 | void | |
104c1213 JM |
4101 | set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, |
4102 | gdbarch_saved_pc_after_call_ftype saved_pc_after_call) | |
0f71a2f6 JM |
4103 | { |
4104 | gdbarch->saved_pc_after_call = saved_pc_after_call; | |
4105 | } | |
4106 | ||
4107 | int | |
4108 | gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) | |
4109 | { | |
4110 | if (gdbarch->frame_num_args == 0) | |
8e65ff28 AC |
4111 | internal_error (__FILE__, __LINE__, |
4112 | "gdbarch: gdbarch_frame_num_args invalid"); | |
0f71a2f6 | 4113 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
4114 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); |
4115 | return gdbarch->frame_num_args (frame); | |
4116 | } | |
4117 | ||
4118 | void | |
104c1213 JM |
4119 | set_gdbarch_frame_num_args (struct gdbarch *gdbarch, |
4120 | gdbarch_frame_num_args_ftype frame_num_args) | |
0f71a2f6 JM |
4121 | { |
4122 | gdbarch->frame_num_args = frame_num_args; | |
4123 | } | |
4124 | ||
2ada493a AC |
4125 | int |
4126 | gdbarch_stack_align_p (struct gdbarch *gdbarch) | |
4127 | { | |
4128 | return gdbarch->stack_align != 0; | |
4129 | } | |
4130 | ||
4131 | CORE_ADDR | |
4132 | gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp) | |
4133 | { | |
4134 | if (gdbarch->stack_align == 0) | |
8e65ff28 AC |
4135 | internal_error (__FILE__, __LINE__, |
4136 | "gdbarch: gdbarch_stack_align invalid"); | |
2ada493a AC |
4137 | if (gdbarch_debug >= 2) |
4138 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n"); | |
4139 | return gdbarch->stack_align (sp); | |
4140 | } | |
4141 | ||
4142 | void | |
4143 | set_gdbarch_stack_align (struct gdbarch *gdbarch, | |
4144 | gdbarch_stack_align_ftype stack_align) | |
4145 | { | |
4146 | gdbarch->stack_align = stack_align; | |
4147 | } | |
4148 | ||
1dd4193b AC |
4149 | int |
4150 | gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch) | |
4151 | { | |
4152 | /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ | |
4153 | if (gdbarch_debug >= 2) | |
4154 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n"); | |
4155 | return gdbarch->extra_stack_alignment_needed; | |
4156 | } | |
4157 | ||
4158 | void | |
4159 | set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, | |
4160 | int extra_stack_alignment_needed) | |
4161 | { | |
4162 | gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed; | |
4163 | } | |
4164 | ||
d03e67c9 AC |
4165 | int |
4166 | gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch) | |
4167 | { | |
4168 | return gdbarch->reg_struct_has_addr != 0; | |
4169 | } | |
4170 | ||
4171 | int | |
4172 | gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) | |
4173 | { | |
4174 | if (gdbarch->reg_struct_has_addr == 0) | |
8e65ff28 AC |
4175 | internal_error (__FILE__, __LINE__, |
4176 | "gdbarch: gdbarch_reg_struct_has_addr invalid"); | |
d03e67c9 AC |
4177 | if (gdbarch_debug >= 2) |
4178 | fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n"); | |
4179 | return gdbarch->reg_struct_has_addr (gcc_p, type); | |
4180 | } | |
4181 | ||
4182 | void | |
4183 | set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, | |
4184 | gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr) | |
4185 | { | |
4186 | gdbarch->reg_struct_has_addr = reg_struct_has_addr; | |
4187 | } | |
4188 | ||
d1e3cf49 AC |
4189 | int |
4190 | gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch) | |
4191 | { | |
4192 | return gdbarch->save_dummy_frame_tos != 0; | |
4193 | } | |
4194 | ||
4195 | void | |
4196 | gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp) | |
4197 | { | |
4198 | if (gdbarch->save_dummy_frame_tos == 0) | |
8e65ff28 AC |
4199 | internal_error (__FILE__, __LINE__, |
4200 | "gdbarch: gdbarch_save_dummy_frame_tos invalid"); | |
d1e3cf49 AC |
4201 | if (gdbarch_debug >= 2) |
4202 | fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n"); | |
4203 | gdbarch->save_dummy_frame_tos (sp); | |
4204 | } | |
4205 | ||
4206 | void | |
4207 | set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, | |
4208 | gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos) | |
4209 | { | |
4210 | gdbarch->save_dummy_frame_tos = save_dummy_frame_tos; | |
4211 | } | |
4212 | ||
58d5518e ND |
4213 | int |
4214 | gdbarch_parm_boundary (struct gdbarch *gdbarch) | |
4215 | { | |
4216 | if (gdbarch_debug >= 2) | |
4217 | fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n"); | |
4218 | return gdbarch->parm_boundary; | |
4219 | } | |
4220 | ||
4221 | void | |
4222 | set_gdbarch_parm_boundary (struct gdbarch *gdbarch, | |
4223 | int parm_boundary) | |
4224 | { | |
4225 | gdbarch->parm_boundary = parm_boundary; | |
4226 | } | |
4227 | ||
f0d4cc9e AC |
4228 | const struct floatformat * |
4229 | gdbarch_float_format (struct gdbarch *gdbarch) | |
4230 | { | |
4231 | if (gdbarch_debug >= 2) | |
4232 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n"); | |
4233 | return gdbarch->float_format; | |
4234 | } | |
4235 | ||
4236 | void | |
4237 | set_gdbarch_float_format (struct gdbarch *gdbarch, | |
4238 | const struct floatformat * float_format) | |
4239 | { | |
4240 | gdbarch->float_format = float_format; | |
4241 | } | |
4242 | ||
4243 | const struct floatformat * | |
4244 | gdbarch_double_format (struct gdbarch *gdbarch) | |
4245 | { | |
4246 | if (gdbarch_debug >= 2) | |
4247 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n"); | |
4248 | return gdbarch->double_format; | |
4249 | } | |
4250 | ||
4251 | void | |
4252 | set_gdbarch_double_format (struct gdbarch *gdbarch, | |
4253 | const struct floatformat * double_format) | |
4254 | { | |
4255 | gdbarch->double_format = double_format; | |
4256 | } | |
4257 | ||
4258 | const struct floatformat * | |
4259 | gdbarch_long_double_format (struct gdbarch *gdbarch) | |
4260 | { | |
4261 | if (gdbarch_debug >= 2) | |
4262 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n"); | |
4263 | return gdbarch->long_double_format; | |
4264 | } | |
4265 | ||
4266 | void | |
4267 | set_gdbarch_long_double_format (struct gdbarch *gdbarch, | |
4268 | const struct floatformat * long_double_format) | |
4269 | { | |
4270 | gdbarch->long_double_format = long_double_format; | |
4271 | } | |
4272 | ||
f517ea4e PS |
4273 | CORE_ADDR |
4274 | gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr) | |
4275 | { | |
4276 | if (gdbarch->convert_from_func_ptr_addr == 0) | |
8e65ff28 AC |
4277 | internal_error (__FILE__, __LINE__, |
4278 | "gdbarch: gdbarch_convert_from_func_ptr_addr invalid"); | |
f517ea4e PS |
4279 | if (gdbarch_debug >= 2) |
4280 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n"); | |
4281 | return gdbarch->convert_from_func_ptr_addr (addr); | |
4282 | } | |
4283 | ||
4284 | void | |
4285 | set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, | |
4286 | gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr) | |
4287 | { | |
4288 | gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr; | |
4289 | } | |
4290 | ||
875e1767 AC |
4291 | CORE_ADDR |
4292 | gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) | |
4293 | { | |
4294 | if (gdbarch->addr_bits_remove == 0) | |
4295 | internal_error (__FILE__, __LINE__, | |
4296 | "gdbarch: gdbarch_addr_bits_remove invalid"); | |
4297 | if (gdbarch_debug >= 2) | |
4298 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n"); | |
4299 | return gdbarch->addr_bits_remove (addr); | |
4300 | } | |
4301 | ||
4302 | void | |
4303 | set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, | |
4304 | gdbarch_addr_bits_remove_ftype addr_bits_remove) | |
4305 | { | |
4306 | gdbarch->addr_bits_remove = addr_bits_remove; | |
4307 | } | |
4308 | ||
64c4637f AC |
4309 | int |
4310 | gdbarch_software_single_step_p (struct gdbarch *gdbarch) | |
4311 | { | |
4312 | return gdbarch->software_single_step != 0; | |
4313 | } | |
4314 | ||
4315 | void | |
4316 | gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p) | |
4317 | { | |
4318 | if (gdbarch->software_single_step == 0) | |
4319 | internal_error (__FILE__, __LINE__, | |
4320 | "gdbarch: gdbarch_software_single_step invalid"); | |
4321 | if (gdbarch_debug >= 2) | |
4322 | fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n"); | |
4323 | gdbarch->software_single_step (sig, insert_breakpoints_p); | |
4324 | } | |
4325 | ||
4326 | void | |
4327 | set_gdbarch_software_single_step (struct gdbarch *gdbarch, | |
4328 | gdbarch_software_single_step_ftype software_single_step) | |
4329 | { | |
4330 | gdbarch->software_single_step = software_single_step; | |
4331 | } | |
4332 | ||
bdcd319a CV |
4333 | CORE_ADDR |
4334 | gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc) | |
4335 | { | |
4336 | if (gdbarch->skip_trampoline_code == 0) | |
4337 | internal_error (__FILE__, __LINE__, | |
4338 | "gdbarch: gdbarch_skip_trampoline_code invalid"); | |
4339 | if (gdbarch_debug >= 2) | |
4340 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n"); | |
4341 | return gdbarch->skip_trampoline_code (pc); | |
4342 | } | |
4343 | ||
4344 | void | |
4345 | set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, | |
4346 | gdbarch_skip_trampoline_code_ftype skip_trampoline_code) | |
4347 | { | |
4348 | gdbarch->skip_trampoline_code = skip_trampoline_code; | |
4349 | } | |
4350 | ||
0f71a2f6 | 4351 | |
be5a57e1 | 4352 | /* Keep a registry of per-architecture data-pointers required by GDB |
0f71a2f6 JM |
4353 | modules. */ |
4354 | ||
4355 | struct gdbarch_data | |
4356 | { | |
95160752 AC |
4357 | unsigned index; |
4358 | gdbarch_data_init_ftype *init; | |
4359 | gdbarch_data_free_ftype *free; | |
0f71a2f6 JM |
4360 | }; |
4361 | ||
4362 | struct gdbarch_data_registration | |
adf40b2e | 4363 | { |
adf40b2e JM |
4364 | struct gdbarch_data *data; |
4365 | struct gdbarch_data_registration *next; | |
4366 | }; | |
0f71a2f6 | 4367 | |
be5a57e1 | 4368 | struct gdbarch_data_registry |
adf40b2e | 4369 | { |
95160752 | 4370 | unsigned nr; |
adf40b2e JM |
4371 | struct gdbarch_data_registration *registrations; |
4372 | }; | |
0f71a2f6 | 4373 | |
be5a57e1 | 4374 | struct gdbarch_data_registry gdbarch_data_registry = |
0f71a2f6 JM |
4375 | { |
4376 | 0, NULL, | |
4377 | }; | |
4378 | ||
4379 | struct gdbarch_data * | |
95160752 AC |
4380 | register_gdbarch_data (gdbarch_data_init_ftype *init, |
4381 | gdbarch_data_free_ftype *free) | |
0f71a2f6 JM |
4382 | { |
4383 | struct gdbarch_data_registration **curr; | |
be5a57e1 | 4384 | for (curr = &gdbarch_data_registry.registrations; |
0f71a2f6 JM |
4385 | (*curr) != NULL; |
4386 | curr = &(*curr)->next); | |
4387 | (*curr) = XMALLOC (struct gdbarch_data_registration); | |
4388 | (*curr)->next = NULL; | |
0f71a2f6 | 4389 | (*curr)->data = XMALLOC (struct gdbarch_data); |
be5a57e1 | 4390 | (*curr)->data->index = gdbarch_data_registry.nr++; |
95160752 AC |
4391 | (*curr)->data->init = init; |
4392 | (*curr)->data->free = free; | |
0f71a2f6 JM |
4393 | return (*curr)->data; |
4394 | } | |
4395 | ||
4396 | ||
b3cc3077 | 4397 | /* Walk through all the registered users initializing each in turn. */ |
0f71a2f6 | 4398 | |
0f71a2f6 | 4399 | static void |
b3cc3077 | 4400 | init_gdbarch_data (struct gdbarch *gdbarch) |
0f71a2f6 | 4401 | { |
b3cc3077 JB |
4402 | struct gdbarch_data_registration *rego; |
4403 | for (rego = gdbarch_data_registry.registrations; | |
4404 | rego != NULL; | |
4405 | rego = rego->next) | |
0f71a2f6 | 4406 | { |
b3cc3077 JB |
4407 | struct gdbarch_data *data = rego->data; |
4408 | gdb_assert (data->index < gdbarch->nr_data); | |
4409 | if (data->init != NULL) | |
95160752 | 4410 | { |
b3cc3077 JB |
4411 | void *pointer = data->init (gdbarch); |
4412 | set_gdbarch_data (gdbarch, data, pointer); | |
95160752 AC |
4413 | } |
4414 | } | |
4415 | } | |
4416 | ||
b3cc3077 | 4417 | /* Create/delete the gdbarch data vector. */ |
95160752 AC |
4418 | |
4419 | static void | |
b3cc3077 | 4420 | alloc_gdbarch_data (struct gdbarch *gdbarch) |
95160752 | 4421 | { |
b3cc3077 JB |
4422 | gdb_assert (gdbarch->data == NULL); |
4423 | gdbarch->nr_data = gdbarch_data_registry.nr; | |
4424 | gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*)); | |
4425 | } | |
3c875b6f | 4426 | |
b3cc3077 JB |
4427 | static void |
4428 | free_gdbarch_data (struct gdbarch *gdbarch) | |
4429 | { | |
4430 | struct gdbarch_data_registration *rego; | |
4431 | gdb_assert (gdbarch->data != NULL); | |
4432 | for (rego = gdbarch_data_registry.registrations; | |
4433 | rego != NULL; | |
4434 | rego = rego->next) | |
95160752 | 4435 | { |
b3cc3077 JB |
4436 | struct gdbarch_data *data = rego->data; |
4437 | gdb_assert (data->index < gdbarch->nr_data); | |
4438 | if (data->free != NULL && gdbarch->data[data->index] != NULL) | |
95160752 | 4439 | { |
b3cc3077 JB |
4440 | data->free (gdbarch, gdbarch->data[data->index]); |
4441 | gdbarch->data[data->index] = NULL; | |
95160752 | 4442 | } |
0f71a2f6 | 4443 | } |
b3cc3077 JB |
4444 | xfree (gdbarch->data); |
4445 | gdbarch->data = NULL; | |
0f71a2f6 JM |
4446 | } |
4447 | ||
4448 | ||
b3cc3077 JB |
4449 | /* Initialize the current value of thee specified per-architecture |
4450 | data-pointer. */ | |
4451 | ||
95160752 AC |
4452 | void |
4453 | set_gdbarch_data (struct gdbarch *gdbarch, | |
4454 | struct gdbarch_data *data, | |
4455 | void *pointer) | |
4456 | { | |
4457 | gdb_assert (data->index < gdbarch->nr_data); | |
4458 | if (data->free != NULL && gdbarch->data[data->index] != NULL) | |
4459 | data->free (gdbarch, gdbarch->data[data->index]); | |
4460 | gdbarch->data[data->index] = pointer; | |
4461 | } | |
4462 | ||
0f71a2f6 JM |
4463 | /* Return the current value of the specified per-architecture |
4464 | data-pointer. */ | |
4465 | ||
4466 | void * | |
7c7651b2 | 4467 | gdbarch_data (struct gdbarch_data *data) |
0f71a2f6 | 4468 | { |
95160752 | 4469 | gdb_assert (data->index < current_gdbarch->nr_data); |
0f71a2f6 JM |
4470 | return current_gdbarch->data[data->index]; |
4471 | } | |
4472 | ||
4473 | ||
4474 | ||
be5a57e1 | 4475 | /* Keep a registry of swapped data required by GDB modules. */ |
0f71a2f6 JM |
4476 | |
4477 | struct gdbarch_swap | |
4478 | { | |
4479 | void *swap; | |
4480 | struct gdbarch_swap_registration *source; | |
4481 | struct gdbarch_swap *next; | |
4482 | }; | |
4483 | ||
4484 | struct gdbarch_swap_registration | |
adf40b2e JM |
4485 | { |
4486 | void *data; | |
4487 | unsigned long sizeof_data; | |
4488 | gdbarch_swap_ftype *init; | |
4489 | struct gdbarch_swap_registration *next; | |
4490 | }; | |
0f71a2f6 | 4491 | |
be5a57e1 | 4492 | struct gdbarch_swap_registry |
adf40b2e JM |
4493 | { |
4494 | int nr; | |
4495 | struct gdbarch_swap_registration *registrations; | |
4496 | }; | |
0f71a2f6 | 4497 | |
be5a57e1 | 4498 | struct gdbarch_swap_registry gdbarch_swap_registry = |
0f71a2f6 JM |
4499 | { |
4500 | 0, NULL, | |
4501 | }; | |
4502 | ||
4503 | void | |
104c1213 JM |
4504 | register_gdbarch_swap (void *data, |
4505 | unsigned long sizeof_data, | |
4506 | gdbarch_swap_ftype *init) | |
0f71a2f6 JM |
4507 | { |
4508 | struct gdbarch_swap_registration **rego; | |
be5a57e1 | 4509 | for (rego = &gdbarch_swap_registry.registrations; |
0f71a2f6 JM |
4510 | (*rego) != NULL; |
4511 | rego = &(*rego)->next); | |
4512 | (*rego) = XMALLOC (struct gdbarch_swap_registration); | |
4513 | (*rego)->next = NULL; | |
4514 | (*rego)->init = init; | |
4515 | (*rego)->data = data; | |
4516 | (*rego)->sizeof_data = sizeof_data; | |
4517 | } | |
4518 | ||
4519 | ||
0f71a2f6 | 4520 | static void |
104c1213 | 4521 | init_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
4522 | { |
4523 | struct gdbarch_swap_registration *rego; | |
4524 | struct gdbarch_swap **curr = &gdbarch->swap; | |
be5a57e1 | 4525 | for (rego = gdbarch_swap_registry.registrations; |
0f71a2f6 JM |
4526 | rego != NULL; |
4527 | rego = rego->next) | |
4528 | { | |
4529 | if (rego->data != NULL) | |
4530 | { | |
4531 | (*curr) = XMALLOC (struct gdbarch_swap); | |
4532 | (*curr)->source = rego; | |
4533 | (*curr)->swap = xmalloc (rego->sizeof_data); | |
4534 | (*curr)->next = NULL; | |
4535 | memset (rego->data, 0, rego->sizeof_data); | |
4536 | curr = &(*curr)->next; | |
4537 | } | |
4538 | if (rego->init != NULL) | |
4539 | rego->init (); | |
4540 | } | |
4541 | } | |
4542 | ||
0f71a2f6 | 4543 | static void |
104c1213 | 4544 | swapout_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
4545 | { |
4546 | struct gdbarch_swap *curr; | |
4547 | for (curr = gdbarch->swap; | |
4548 | curr != NULL; | |
4549 | curr = curr->next) | |
4550 | memcpy (curr->swap, curr->source->data, curr->source->sizeof_data); | |
4551 | } | |
4552 | ||
0f71a2f6 | 4553 | static void |
104c1213 | 4554 | swapin_gdbarch_swap (struct gdbarch *gdbarch) |
0f71a2f6 JM |
4555 | { |
4556 | struct gdbarch_swap *curr; | |
4557 | for (curr = gdbarch->swap; | |
4558 | curr != NULL; | |
4559 | curr = curr->next) | |
4560 | memcpy (curr->source->data, curr->swap, curr->source->sizeof_data); | |
4561 | } | |
4562 | ||
4563 | ||
be5a57e1 | 4564 | /* Keep a registry of the architectures known by GDB. */ |
0f71a2f6 | 4565 | |
4b9b3959 | 4566 | struct gdbarch_registration |
0f71a2f6 JM |
4567 | { |
4568 | enum bfd_architecture bfd_architecture; | |
4569 | gdbarch_init_ftype *init; | |
4b9b3959 | 4570 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 4571 | struct gdbarch_list *arches; |
4b9b3959 | 4572 | struct gdbarch_registration *next; |
0f71a2f6 JM |
4573 | }; |
4574 | ||
be5a57e1 | 4575 | static struct gdbarch_registration *gdbarch_registry = NULL; |
0f71a2f6 | 4576 | |
b4a20239 AC |
4577 | static void |
4578 | append_name (const char ***buf, int *nr, const char *name) | |
4579 | { | |
4580 | *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1)); | |
4581 | (*buf)[*nr] = name; | |
4582 | *nr += 1; | |
4583 | } | |
4584 | ||
4585 | const char ** | |
4586 | gdbarch_printable_names (void) | |
4587 | { | |
4588 | if (GDB_MULTI_ARCH) | |
4589 | { | |
4590 | /* Accumulate a list of names based on the registed list of | |
4591 | architectures. */ | |
4592 | enum bfd_architecture a; | |
4593 | int nr_arches = 0; | |
4594 | const char **arches = NULL; | |
4b9b3959 | 4595 | struct gdbarch_registration *rego; |
be5a57e1 | 4596 | for (rego = gdbarch_registry; |
b4a20239 AC |
4597 | rego != NULL; |
4598 | rego = rego->next) | |
4599 | { | |
4600 | const struct bfd_arch_info *ap; | |
4601 | ap = bfd_lookup_arch (rego->bfd_architecture, 0); | |
4602 | if (ap == NULL) | |
8e65ff28 AC |
4603 | internal_error (__FILE__, __LINE__, |
4604 | "gdbarch_architecture_names: multi-arch unknown"); | |
b4a20239 AC |
4605 | do |
4606 | { | |
4607 | append_name (&arches, &nr_arches, ap->printable_name); | |
4608 | ap = ap->next; | |
4609 | } | |
4610 | while (ap != NULL); | |
4611 | } | |
4612 | append_name (&arches, &nr_arches, NULL); | |
4613 | return arches; | |
4614 | } | |
4615 | else | |
4616 | /* Just return all the architectures that BFD knows. Assume that | |
4617 | the legacy architecture framework supports them. */ | |
4618 | return bfd_arch_list (); | |
4619 | } | |
4620 | ||
4621 | ||
0f71a2f6 | 4622 | void |
4b9b3959 AC |
4623 | gdbarch_register (enum bfd_architecture bfd_architecture, |
4624 | gdbarch_init_ftype *init, | |
4625 | gdbarch_dump_tdep_ftype *dump_tdep) | |
0f71a2f6 | 4626 | { |
4b9b3959 | 4627 | struct gdbarch_registration **curr; |
0f71a2f6 | 4628 | const struct bfd_arch_info *bfd_arch_info; |
ec3d358c | 4629 | /* Check that BFD recognizes this architecture */ |
0f71a2f6 JM |
4630 | bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); |
4631 | if (bfd_arch_info == NULL) | |
4632 | { | |
8e65ff28 AC |
4633 | internal_error (__FILE__, __LINE__, |
4634 | "gdbarch: Attempt to register unknown architecture (%d)", | |
4635 | bfd_architecture); | |
0f71a2f6 JM |
4636 | } |
4637 | /* Check that we haven't seen this architecture before */ | |
be5a57e1 | 4638 | for (curr = &gdbarch_registry; |
0f71a2f6 JM |
4639 | (*curr) != NULL; |
4640 | curr = &(*curr)->next) | |
4641 | { | |
4642 | if (bfd_architecture == (*curr)->bfd_architecture) | |
8e65ff28 AC |
4643 | internal_error (__FILE__, __LINE__, |
4644 | "gdbarch: Duplicate registraration of architecture (%s)", | |
4645 | bfd_arch_info->printable_name); | |
0f71a2f6 JM |
4646 | } |
4647 | /* log it */ | |
4648 | if (gdbarch_debug) | |
4649 | fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n", | |
4650 | bfd_arch_info->printable_name, | |
4651 | (long) init); | |
4652 | /* Append it */ | |
4b9b3959 | 4653 | (*curr) = XMALLOC (struct gdbarch_registration); |
0f71a2f6 JM |
4654 | (*curr)->bfd_architecture = bfd_architecture; |
4655 | (*curr)->init = init; | |
4b9b3959 | 4656 | (*curr)->dump_tdep = dump_tdep; |
0f71a2f6 JM |
4657 | (*curr)->arches = NULL; |
4658 | (*curr)->next = NULL; | |
8e1a459b C |
4659 | /* When non- multi-arch, install whatever target dump routine we've |
4660 | been provided - hopefully that routine has been written correctly | |
4b9b3959 AC |
4661 | and works regardless of multi-arch. */ |
4662 | if (!GDB_MULTI_ARCH && dump_tdep != NULL | |
4663 | && startup_gdbarch.dump_tdep == NULL) | |
4664 | startup_gdbarch.dump_tdep = dump_tdep; | |
4665 | } | |
4666 | ||
4667 | void | |
4668 | register_gdbarch_init (enum bfd_architecture bfd_architecture, | |
4669 | gdbarch_init_ftype *init) | |
4670 | { | |
4671 | gdbarch_register (bfd_architecture, init, NULL); | |
0f71a2f6 | 4672 | } |
0f71a2f6 JM |
4673 | |
4674 | ||
4675 | /* Look for an architecture using gdbarch_info. Base search on only | |
4676 | BFD_ARCH_INFO and BYTE_ORDER. */ | |
4677 | ||
4678 | struct gdbarch_list * | |
104c1213 JM |
4679 | gdbarch_list_lookup_by_info (struct gdbarch_list *arches, |
4680 | const struct gdbarch_info *info) | |
0f71a2f6 JM |
4681 | { |
4682 | for (; arches != NULL; arches = arches->next) | |
4683 | { | |
4684 | if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info) | |
4685 | continue; | |
4686 | if (info->byte_order != arches->gdbarch->byte_order) | |
4687 | continue; | |
4688 | return arches; | |
4689 | } | |
4690 | return NULL; | |
4691 | } | |
4692 | ||
4693 | ||
4694 | /* Update the current architecture. Return ZERO if the update request | |
4695 | failed. */ | |
4696 | ||
4697 | int | |
16f33e29 | 4698 | gdbarch_update_p (struct gdbarch_info info) |
0f71a2f6 JM |
4699 | { |
4700 | struct gdbarch *new_gdbarch; | |
4701 | struct gdbarch_list **list; | |
4b9b3959 | 4702 | struct gdbarch_registration *rego; |
0f71a2f6 | 4703 | |
b732d07d AC |
4704 | /* Fill in missing parts of the INFO struct using a number of |
4705 | sources: ``set ...''; INFOabfd supplied; existing target. */ | |
4706 | ||
4707 | /* ``(gdb) set architecture ...'' */ | |
4708 | if (info.bfd_arch_info == NULL | |
4709 | && !TARGET_ARCHITECTURE_AUTO) | |
4710 | info.bfd_arch_info = TARGET_ARCHITECTURE; | |
4711 | if (info.bfd_arch_info == NULL | |
4712 | && info.abfd != NULL | |
4713 | && bfd_get_arch (info.abfd) != bfd_arch_unknown | |
4714 | && bfd_get_arch (info.abfd) != bfd_arch_obscure) | |
4715 | info.bfd_arch_info = bfd_get_arch_info (info.abfd); | |
0f71a2f6 | 4716 | if (info.bfd_arch_info == NULL) |
b732d07d AC |
4717 | info.bfd_arch_info = TARGET_ARCHITECTURE; |
4718 | ||
4719 | /* ``(gdb) set byte-order ...'' */ | |
4720 | if (info.byte_order == 0 | |
4721 | && !TARGET_BYTE_ORDER_AUTO) | |
4722 | info.byte_order = TARGET_BYTE_ORDER; | |
4723 | /* From the INFO struct. */ | |
4724 | if (info.byte_order == 0 | |
4725 | && info.abfd != NULL) | |
4726 | info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN | |
4727 | : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN | |
4728 | : 0); | |
4729 | /* From the current target. */ | |
0f71a2f6 | 4730 | if (info.byte_order == 0) |
b732d07d | 4731 | info.byte_order = TARGET_BYTE_ORDER; |
0f71a2f6 | 4732 | |
b732d07d AC |
4733 | /* Must have found some sort of architecture. */ |
4734 | gdb_assert (info.bfd_arch_info != NULL); | |
0f71a2f6 JM |
4735 | |
4736 | if (gdbarch_debug) | |
4737 | { | |
0f71a2f6 JM |
4738 | fprintf_unfiltered (gdb_stdlog, |
4739 | "gdbarch_update: info.bfd_arch_info %s\n", | |
4740 | (info.bfd_arch_info != NULL | |
4741 | ? info.bfd_arch_info->printable_name | |
4742 | : "(null)")); | |
4743 | fprintf_unfiltered (gdb_stdlog, | |
4744 | "gdbarch_update: info.byte_order %d (%s)\n", | |
4745 | info.byte_order, | |
4746 | (info.byte_order == BIG_ENDIAN ? "big" | |
4747 | : info.byte_order == LITTLE_ENDIAN ? "little" | |
4748 | : "default")); | |
4749 | fprintf_unfiltered (gdb_stdlog, | |
4750 | "gdbarch_update: info.abfd 0x%lx\n", | |
4751 | (long) info.abfd); | |
4752 | fprintf_unfiltered (gdb_stdlog, | |
4753 | "gdbarch_update: info.tdep_info 0x%lx\n", | |
4754 | (long) info.tdep_info); | |
4755 | } | |
4756 | ||
b732d07d AC |
4757 | /* Find the target that knows about this architecture. */ |
4758 | for (rego = gdbarch_registry; | |
4759 | rego != NULL; | |
4760 | rego = rego->next) | |
4761 | if (rego->bfd_architecture == info.bfd_arch_info->arch) | |
4762 | break; | |
4763 | if (rego == NULL) | |
4764 | { | |
4765 | if (gdbarch_debug) | |
4766 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n"); | |
4767 | return 0; | |
4768 | } | |
4769 | ||
0f71a2f6 JM |
4770 | /* Ask the target for a replacement architecture. */ |
4771 | new_gdbarch = rego->init (info, rego->arches); | |
4772 | ||
4773 | /* Did the target like it? No. Reject the change. */ | |
4774 | if (new_gdbarch == NULL) | |
4775 | { | |
4776 | if (gdbarch_debug) | |
4777 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n"); | |
4778 | return 0; | |
4779 | } | |
4780 | ||
4781 | /* Did the architecture change? No. Do nothing. */ | |
4782 | if (current_gdbarch == new_gdbarch) | |
4783 | { | |
4784 | if (gdbarch_debug) | |
4785 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n", | |
4786 | (long) new_gdbarch, | |
4787 | new_gdbarch->bfd_arch_info->printable_name); | |
4788 | return 1; | |
4789 | } | |
4790 | ||
4791 | /* Swap all data belonging to the old target out */ | |
4792 | swapout_gdbarch_swap (current_gdbarch); | |
4793 | ||
4794 | /* Is this a pre-existing architecture? Yes. Swap it in. */ | |
4795 | for (list = ®o->arches; | |
4796 | (*list) != NULL; | |
4797 | list = &(*list)->next) | |
4798 | { | |
4799 | if ((*list)->gdbarch == new_gdbarch) | |
4800 | { | |
4801 | if (gdbarch_debug) | |
4b9b3959 AC |
4802 | fprintf_unfiltered (gdb_stdlog, |
4803 | "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n", | |
0f71a2f6 JM |
4804 | (long) new_gdbarch, |
4805 | new_gdbarch->bfd_arch_info->printable_name); | |
4806 | current_gdbarch = new_gdbarch; | |
4807 | swapin_gdbarch_swap (new_gdbarch); | |
67c2c32c | 4808 | architecture_changed_event (); |
0f71a2f6 JM |
4809 | return 1; |
4810 | } | |
4811 | } | |
4b9b3959 | 4812 | |
0f71a2f6 JM |
4813 | /* Append this new architecture to this targets list. */ |
4814 | (*list) = XMALLOC (struct gdbarch_list); | |
4815 | (*list)->next = NULL; | |
4816 | (*list)->gdbarch = new_gdbarch; | |
4817 | ||
4818 | /* Switch to this new architecture. Dump it out. */ | |
4819 | current_gdbarch = new_gdbarch; | |
4820 | if (gdbarch_debug) | |
4821 | { | |
4822 | fprintf_unfiltered (gdb_stdlog, | |
adf40b2e | 4823 | "gdbarch_update: New architecture 0x%08lx (%s) selected\n", |
0f71a2f6 JM |
4824 | (long) new_gdbarch, |
4825 | new_gdbarch->bfd_arch_info->printable_name); | |
0f71a2f6 | 4826 | } |
adf40b2e | 4827 | |
4b9b3959 AC |
4828 | /* Check that the newly installed architecture is valid. Plug in |
4829 | any post init values. */ | |
4830 | new_gdbarch->dump_tdep = rego->dump_tdep; | |
0f71a2f6 JM |
4831 | verify_gdbarch (new_gdbarch); |
4832 | ||
4833 | /* Initialize the per-architecture memory (swap) areas. | |
4834 | CURRENT_GDBARCH must be update before these modules are | |
4835 | called. */ | |
4836 | init_gdbarch_swap (new_gdbarch); | |
adf40b2e | 4837 | |
b3cc3077 JB |
4838 | /* Initialize the per-architecture data-pointer of all parties that |
4839 | registered an interest in this architecture. CURRENT_GDBARCH | |
4840 | must be updated before these modules are called. */ | |
4841 | init_gdbarch_data (new_gdbarch); | |
67c2c32c KS |
4842 | architecture_changed_event (); |
4843 | ||
4b9b3959 AC |
4844 | if (gdbarch_debug) |
4845 | gdbarch_dump (current_gdbarch, gdb_stdlog); | |
4846 | ||
0f71a2f6 JM |
4847 | return 1; |
4848 | } | |
c906108c | 4849 | |
c906108c | 4850 | |
c906108c SS |
4851 | /* Disassembler */ |
4852 | ||
4853 | /* Pointer to the target-dependent disassembly function. */ | |
104c1213 | 4854 | int (*tm_print_insn) (bfd_vma, disassemble_info *); |
c906108c SS |
4855 | disassemble_info tm_print_insn_info; |
4856 | ||
4857 | ||
104c1213 | 4858 | extern void _initialize_gdbarch (void); |
b4a20239 | 4859 | |
c906108c | 4860 | void |
7c7651b2 | 4861 | _initialize_gdbarch (void) |
c906108c | 4862 | { |
5d161b24 DB |
4863 | struct cmd_list_element *c; |
4864 | ||
adf40b2e | 4865 | INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered); |
c906108c SS |
4866 | tm_print_insn_info.flavour = bfd_target_unknown_flavour; |
4867 | tm_print_insn_info.read_memory_func = dis_asm_read_memory; | |
4868 | tm_print_insn_info.memory_error_func = dis_asm_memory_error; | |
4869 | tm_print_insn_info.print_address_func = dis_asm_print_address; | |
4870 | ||
5d161b24 | 4871 | add_show_from_set (add_set_cmd ("arch", |
c906108c SS |
4872 | class_maintenance, |
4873 | var_zinteger, | |
adf40b2e | 4874 | (char *)&gdbarch_debug, |
c906108c | 4875 | "Set architecture debugging.\n\ |
5d161b24 DB |
4876 | When non-zero, architecture debugging is enabled.", &setdebuglist), |
4877 | &showdebuglist); | |
59233f88 AC |
4878 | c = add_set_cmd ("archdebug", |
4879 | class_maintenance, | |
4880 | var_zinteger, | |
4881 | (char *)&gdbarch_debug, | |
4882 | "Set architecture debugging.\n\ | |
5d161b24 DB |
4883 | When non-zero, architecture debugging is enabled.", &setlist); |
4884 | ||
59233f88 AC |
4885 | deprecate_cmd (c, "set debug arch"); |
4886 | deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch"); | |
c906108c | 4887 | } |