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