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