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