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