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