1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
4 /* Dynamic architecture support for GDB, the GNU debugger.
6 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
7 2007, 2008, 2009 Free Software Foundation, Inc.
9 This file is part of GDB.
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 /* This file was created with the aid of ``gdbarch.sh''.
26 The Bourne shell script ``gdbarch.sh'' creates the files
27 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
28 against the existing ``gdbarch.[hc]''. Any differences found
31 If editing this file, please also run gdbarch.sh and merge any
32 changes into that script. Conversely, when making sweeping changes
33 to this file, modifying gdbarch.sh and using its output may prove
38 #include "arch-utils.h"
44 #include "floatformat.h"
46 #include "gdb_assert.h"
47 #include "gdb_string.h"
48 #include "reggroups.h"
50 #include "gdb_obstack.h"
55 /* Static function declarations */
57 static void alloc_gdbarch_data (struct gdbarch
*);
59 /* Non-zero if we want to trace architecture code. */
62 #define GDBARCH_DEBUG 0
64 int gdbarch_debug
= GDBARCH_DEBUG
;
66 show_gdbarch_debug (struct ui_file
*file
, int from_tty
,
67 struct cmd_list_element
*c
, const char *value
)
69 fprintf_filtered (file
, _("Architecture debugging is %s.\n"), value
);
73 pformat (const struct floatformat
**format
)
78 /* Just print out one of them - this is only for diagnostics. */
79 return format
[0]->name
;
83 pstring (const char *string
)
91 /* Maintain the struct gdbarch object. */
95 /* Has this architecture been fully initialized? */
98 /* An obstack bound to the lifetime of the architecture. */
99 struct obstack
*obstack
;
101 /* basic architectural information. */
102 const struct bfd_arch_info
* bfd_arch_info
;
104 int byte_order_for_code
;
105 enum gdb_osabi osabi
;
106 const struct target_desc
* target_desc
;
108 /* target specific vector. */
109 struct gdbarch_tdep
*tdep
;
110 gdbarch_dump_tdep_ftype
*dump_tdep
;
112 /* per-architecture data-pointers. */
116 /* per-architecture swap-regions. */
117 struct gdbarch_swap
*swap
;
119 /* Multi-arch values.
121 When extending this structure you must:
125 Declare set/get functions and define the corresponding
128 gdbarch_alloc(): If zero/NULL is not a suitable default,
129 initialize the new field.
131 verify_gdbarch(): Confirm that the target updated the field
134 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
137 ``startup_gdbarch()'': Append an initial value to the static
138 variable (base values on the host's c-type system).
140 get_gdbarch(): Implement the set/get functions (probably using
141 the macro's as shortcuts).
150 int long_long_align_bit
;
152 const struct floatformat
** half_format
;
154 const struct floatformat
** float_format
;
156 const struct floatformat
** double_format
;
158 const struct floatformat
** long_double_format
;
161 int dwarf2_addr_size
;
163 gdbarch_read_pc_ftype
*read_pc
;
164 gdbarch_write_pc_ftype
*write_pc
;
165 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
166 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
167 gdbarch_pseudo_register_read_value_ftype
*pseudo_register_read_value
;
168 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
171 gdbarch_ax_pseudo_register_collect_ftype
*ax_pseudo_register_collect
;
172 gdbarch_ax_pseudo_register_push_stack_ftype
*ax_pseudo_register_push_stack
;
177 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
178 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
179 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
180 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
181 gdbarch_register_name_ftype
*register_name
;
182 gdbarch_register_type_ftype
*register_type
;
183 gdbarch_dummy_id_ftype
*dummy_id
;
184 int deprecated_fp_regnum
;
185 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
186 int call_dummy_location
;
187 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
188 gdbarch_print_registers_info_ftype
*print_registers_info
;
189 gdbarch_print_float_info_ftype
*print_float_info
;
190 gdbarch_print_vector_info_ftype
*print_vector_info
;
191 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
192 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
193 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
194 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
195 int believe_pcc_promotion
;
196 gdbarch_convert_register_p_ftype
*convert_register_p
;
197 gdbarch_register_to_value_ftype
*register_to_value
;
198 gdbarch_value_to_register_ftype
*value_to_register
;
199 gdbarch_value_from_register_ftype
*value_from_register
;
200 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
201 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
202 gdbarch_integer_to_address_ftype
*integer_to_address
;
203 gdbarch_return_value_ftype
*return_value
;
204 gdbarch_return_in_first_hidden_param_p_ftype
*return_in_first_hidden_param_p
;
205 gdbarch_skip_prologue_ftype
*skip_prologue
;
206 gdbarch_skip_main_prologue_ftype
*skip_main_prologue
;
207 gdbarch_inner_than_ftype
*inner_than
;
208 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
209 gdbarch_remote_breakpoint_from_pc_ftype
*remote_breakpoint_from_pc
;
210 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
211 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
212 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
213 CORE_ADDR decr_pc_after_break
;
214 CORE_ADDR deprecated_function_start_offset
;
215 gdbarch_remote_register_number_ftype
*remote_register_number
;
216 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
217 CORE_ADDR frame_args_skip
;
218 gdbarch_unwind_pc_ftype
*unwind_pc
;
219 gdbarch_unwind_sp_ftype
*unwind_sp
;
220 gdbarch_frame_num_args_ftype
*frame_num_args
;
221 gdbarch_frame_align_ftype
*frame_align
;
222 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
223 int frame_red_zone_size
;
224 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
225 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
226 gdbarch_smash_text_address_ftype
*smash_text_address
;
227 gdbarch_software_single_step_ftype
*software_single_step
;
228 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
229 gdbarch_print_insn_ftype
*print_insn
;
230 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
231 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
232 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
233 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
234 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
235 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
236 int cannot_step_breakpoint
;
237 int have_nonsteppable_watchpoint
;
238 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
239 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
240 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
241 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
242 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
243 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
244 struct core_regset_section
* core_regset_sections
;
245 gdbarch_make_corefile_notes_ftype
*make_corefile_notes
;
246 gdbarch_find_memory_regions_ftype
*find_memory_regions
;
247 gdbarch_core_xfer_shared_libraries_ftype
*core_xfer_shared_libraries
;
248 gdbarch_core_pid_to_str_ftype
*core_pid_to_str
;
249 const char * gcore_bfd_target
;
250 int vtable_function_descriptors
;
252 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
253 ULONGEST max_insn_length
;
254 gdbarch_displaced_step_copy_insn_ftype
*displaced_step_copy_insn
;
255 gdbarch_displaced_step_hw_singlestep_ftype
*displaced_step_hw_singlestep
;
256 gdbarch_displaced_step_fixup_ftype
*displaced_step_fixup
;
257 gdbarch_displaced_step_free_closure_ftype
*displaced_step_free_closure
;
258 gdbarch_displaced_step_location_ftype
*displaced_step_location
;
259 gdbarch_relocate_instruction_ftype
*relocate_instruction
;
260 gdbarch_overlay_update_ftype
*overlay_update
;
261 gdbarch_core_read_description_ftype
*core_read_description
;
262 gdbarch_static_transform_name_ftype
*static_transform_name
;
263 int sofun_address_maybe_missing
;
264 gdbarch_process_record_ftype
*process_record
;
265 gdbarch_process_record_signal_ftype
*process_record_signal
;
266 gdbarch_gdb_signal_from_target_ftype
*gdb_signal_from_target
;
267 gdbarch_get_siginfo_type_ftype
*get_siginfo_type
;
268 gdbarch_record_special_symbol_ftype
*record_special_symbol
;
269 gdbarch_get_syscall_number_ftype
*get_syscall_number
;
270 const char * stap_integer_prefix
;
271 const char * stap_integer_suffix
;
272 const char * stap_register_prefix
;
273 const char * stap_register_suffix
;
274 const char * stap_register_indirection_prefix
;
275 const char * stap_register_indirection_suffix
;
276 const char * stap_gdb_register_prefix
;
277 const char * stap_gdb_register_suffix
;
278 gdbarch_stap_is_single_operand_ftype
*stap_is_single_operand
;
279 gdbarch_stap_parse_special_token_ftype
*stap_parse_special_token
;
280 int has_global_solist
;
281 int has_global_breakpoints
;
282 gdbarch_has_shared_address_space_ftype
*has_shared_address_space
;
283 gdbarch_fast_tracepoint_valid_at_ftype
*fast_tracepoint_valid_at
;
284 gdbarch_auto_charset_ftype
*auto_charset
;
285 gdbarch_auto_wide_charset_ftype
*auto_wide_charset
;
286 const char * solib_symbols_extension
;
287 int has_dos_based_file_system
;
288 gdbarch_gen_return_address_ftype
*gen_return_address
;
289 gdbarch_info_proc_ftype
*info_proc
;
290 gdbarch_iterate_over_objfiles_in_search_order_ftype
*iterate_over_objfiles_in_search_order
;
294 /* The default architecture uses host values (for want of a better
297 extern const struct bfd_arch_info bfd_default_arch_struct
;
299 struct gdbarch startup_gdbarch
=
301 1, /* Always initialized. */
302 NULL
, /* The obstack. */
303 /* basic architecture information. */
304 &bfd_default_arch_struct
, /* bfd_arch_info */
305 BFD_ENDIAN_BIG
, /* byte_order */
306 BFD_ENDIAN_BIG
, /* byte_order_for_code */
307 GDB_OSABI_UNKNOWN
, /* osabi */
309 /* target specific vector and its dump routine. */
311 /*per-architecture data-pointers and swap regions. */
313 /* Multi-arch values */
314 1, /* bits_big_endian */
315 8 * sizeof (short), /* short_bit */
316 8 * sizeof (int), /* int_bit */
317 8 * sizeof (long), /* long_bit */
318 8 * sizeof (LONGEST
), /* long_long_bit */
319 8 * sizeof (LONGEST
), /* long_long_align_bit */
322 8 * sizeof (float), /* float_bit */
323 0, /* float_format */
324 8 * sizeof (double), /* double_bit */
325 0, /* double_format */
326 8 * sizeof (long double), /* long_double_bit */
327 0, /* long_double_format */
328 8 * sizeof (void*), /* ptr_bit */
329 8 * sizeof (void*), /* addr_bit */
330 sizeof (void*), /* dwarf2_addr_size */
334 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
335 0, /* pseudo_register_read */
336 0, /* pseudo_register_read_value */
337 0, /* pseudo_register_write */
339 0, /* num_pseudo_regs */
340 0, /* ax_pseudo_register_collect */
341 0, /* ax_pseudo_register_push_stack */
346 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
347 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
348 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
349 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
350 0, /* register_name */
351 0, /* register_type */
353 -1, /* deprecated_fp_regnum */
354 0, /* push_dummy_call */
355 0, /* call_dummy_location */
356 0, /* push_dummy_code */
357 default_print_registers_info
, /* print_registers_info */
358 0, /* print_float_info */
359 0, /* print_vector_info */
360 legacy_register_sim_regno
, /* register_sim_regno */
361 cannot_register_not
, /* cannot_fetch_register */
362 cannot_register_not
, /* cannot_store_register */
363 0, /* get_longjmp_target */
364 0, /* believe_pcc_promotion */
365 generic_convert_register_p
, /* convert_register_p */
366 0, /* register_to_value */
367 0, /* value_to_register */
368 0, /* value_from_register */
369 unsigned_pointer_to_address
, /* pointer_to_address */
370 unsigned_address_to_pointer
, /* address_to_pointer */
371 0, /* integer_to_address */
372 0, /* return_value */
373 default_return_in_first_hidden_param_p
, /* return_in_first_hidden_param_p */
374 0, /* skip_prologue */
375 0, /* skip_main_prologue */
377 0, /* breakpoint_from_pc */
378 default_remote_breakpoint_from_pc
, /* remote_breakpoint_from_pc */
379 0, /* adjust_breakpoint_address */
380 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
381 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
382 0, /* decr_pc_after_break */
383 0, /* deprecated_function_start_offset */
384 default_remote_register_number
, /* remote_register_number */
385 0, /* fetch_tls_load_module_address */
386 0, /* frame_args_skip */
389 0, /* frame_num_args */
391 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
392 0, /* frame_red_zone_size */
393 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
394 core_addr_identity
, /* addr_bits_remove */
395 core_addr_identity
, /* smash_text_address */
396 0, /* software_single_step */
397 0, /* single_step_through_delay */
399 0, /* skip_trampoline_code */
400 generic_skip_solib_resolver
, /* skip_solib_resolver */
401 generic_in_solib_return_trampoline
, /* in_solib_return_trampoline */
402 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
403 0, /* elf_make_msymbol_special */
404 0, /* coff_make_msymbol_special */
405 0, /* cannot_step_breakpoint */
406 0, /* have_nonsteppable_watchpoint */
407 0, /* address_class_type_flags */
408 0, /* address_class_type_flags_to_name */
409 0, /* address_class_name_to_type_flags */
410 default_register_reggroup_p
, /* register_reggroup_p */
411 0, /* fetch_pointer_argument */
412 0, /* regset_from_core_section */
413 0, /* core_regset_sections */
414 0, /* make_corefile_notes */
415 0, /* find_memory_regions */
416 0, /* core_xfer_shared_libraries */
417 0, /* core_pid_to_str */
418 0, /* gcore_bfd_target */
419 0, /* vtable_function_descriptors */
420 0, /* vbit_in_delta */
421 0, /* skip_permanent_breakpoint */
422 0, /* max_insn_length */
423 0, /* displaced_step_copy_insn */
424 default_displaced_step_hw_singlestep
, /* displaced_step_hw_singlestep */
425 0, /* displaced_step_fixup */
426 NULL
, /* displaced_step_free_closure */
427 NULL
, /* displaced_step_location */
428 0, /* relocate_instruction */
429 0, /* overlay_update */
430 0, /* core_read_description */
431 0, /* static_transform_name */
432 0, /* sofun_address_maybe_missing */
433 0, /* process_record */
434 0, /* process_record_signal */
435 0, /* gdb_signal_from_target */
436 0, /* get_siginfo_type */
437 0, /* record_special_symbol */
438 0, /* get_syscall_number */
439 0, /* stap_integer_prefix */
440 0, /* stap_integer_suffix */
441 0, /* stap_register_prefix */
442 0, /* stap_register_suffix */
443 0, /* stap_register_indirection_prefix */
444 0, /* stap_register_indirection_suffix */
445 0, /* stap_gdb_register_prefix */
446 0, /* stap_gdb_register_suffix */
447 0, /* stap_is_single_operand */
448 0, /* stap_parse_special_token */
449 0, /* has_global_solist */
450 0, /* has_global_breakpoints */
451 default_has_shared_address_space
, /* has_shared_address_space */
452 default_fast_tracepoint_valid_at
, /* fast_tracepoint_valid_at */
453 default_auto_charset
, /* auto_charset */
454 default_auto_wide_charset
, /* auto_wide_charset */
455 0, /* solib_symbols_extension */
456 0, /* has_dos_based_file_system */
457 default_gen_return_address
, /* gen_return_address */
459 default_iterate_over_objfiles_in_search_order
, /* iterate_over_objfiles_in_search_order */
460 /* startup_gdbarch() */
463 struct gdbarch
*target_gdbarch
= &startup_gdbarch
;
465 /* Create a new ``struct gdbarch'' based on information provided by
466 ``struct gdbarch_info''. */
469 gdbarch_alloc (const struct gdbarch_info
*info
,
470 struct gdbarch_tdep
*tdep
)
472 struct gdbarch
*gdbarch
;
474 /* Create an obstack for allocating all the per-architecture memory,
475 then use that to allocate the architecture vector. */
476 struct obstack
*obstack
= XMALLOC (struct obstack
);
477 obstack_init (obstack
);
478 gdbarch
= obstack_alloc (obstack
, sizeof (*gdbarch
));
479 memset (gdbarch
, 0, sizeof (*gdbarch
));
480 gdbarch
->obstack
= obstack
;
482 alloc_gdbarch_data (gdbarch
);
484 gdbarch
->tdep
= tdep
;
486 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
487 gdbarch
->byte_order
= info
->byte_order
;
488 gdbarch
->byte_order_for_code
= info
->byte_order_for_code
;
489 gdbarch
->osabi
= info
->osabi
;
490 gdbarch
->target_desc
= info
->target_desc
;
492 /* Force the explicit initialization of these. */
493 gdbarch
->bits_big_endian
= (gdbarch
->byte_order
== BFD_ENDIAN_BIG
);
494 gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
495 gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
496 gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
497 gdbarch
->long_long_bit
= 2*gdbarch
->long_bit
;
498 gdbarch
->long_long_align_bit
= 2*gdbarch
->long_bit
;
499 gdbarch
->half_bit
= 2*TARGET_CHAR_BIT
;
500 gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
501 gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
502 gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
503 gdbarch
->ptr_bit
= gdbarch
->int_bit
;
504 gdbarch
->char_signed
= -1;
505 gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
506 gdbarch
->num_regs
= -1;
507 gdbarch
->sp_regnum
= -1;
508 gdbarch
->pc_regnum
= -1;
509 gdbarch
->ps_regnum
= -1;
510 gdbarch
->fp0_regnum
= -1;
511 gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
512 gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
513 gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
514 gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
515 gdbarch
->deprecated_fp_regnum
= -1;
516 gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
517 gdbarch
->print_registers_info
= default_print_registers_info
;
518 gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
519 gdbarch
->cannot_fetch_register
= cannot_register_not
;
520 gdbarch
->cannot_store_register
= cannot_register_not
;
521 gdbarch
->convert_register_p
= generic_convert_register_p
;
522 gdbarch
->value_from_register
= default_value_from_register
;
523 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
524 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
525 gdbarch
->return_in_first_hidden_param_p
= default_return_in_first_hidden_param_p
;
526 gdbarch
->remote_breakpoint_from_pc
= default_remote_breakpoint_from_pc
;
527 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
528 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
529 gdbarch
->remote_register_number
= default_remote_register_number
;
530 gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
531 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
532 gdbarch
->addr_bits_remove
= core_addr_identity
;
533 gdbarch
->smash_text_address
= core_addr_identity
;
534 gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
535 gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
536 gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
537 gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
538 gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
539 gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
540 gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
541 gdbarch
->displaced_step_hw_singlestep
= default_displaced_step_hw_singlestep
;
542 gdbarch
->displaced_step_fixup
= NULL
;
543 gdbarch
->displaced_step_free_closure
= NULL
;
544 gdbarch
->displaced_step_location
= NULL
;
545 gdbarch
->relocate_instruction
= NULL
;
546 gdbarch
->has_shared_address_space
= default_has_shared_address_space
;
547 gdbarch
->fast_tracepoint_valid_at
= default_fast_tracepoint_valid_at
;
548 gdbarch
->auto_charset
= default_auto_charset
;
549 gdbarch
->auto_wide_charset
= default_auto_wide_charset
;
550 gdbarch
->gen_return_address
= default_gen_return_address
;
551 gdbarch
->iterate_over_objfiles_in_search_order
= default_iterate_over_objfiles_in_search_order
;
552 /* gdbarch_alloc() */
558 /* Allocate extra space using the per-architecture obstack. */
561 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
563 void *data
= obstack_alloc (arch
->obstack
, size
);
565 memset (data
, 0, size
);
570 /* Free a gdbarch struct. This should never happen in normal
571 operation --- once you've created a gdbarch, you keep it around.
572 However, if an architecture's init function encounters an error
573 building the structure, it may need to clean up a partially
574 constructed gdbarch. */
577 gdbarch_free (struct gdbarch
*arch
)
579 struct obstack
*obstack
;
581 gdb_assert (arch
!= NULL
);
582 gdb_assert (!arch
->initialized_p
);
583 obstack
= arch
->obstack
;
584 obstack_free (obstack
, 0); /* Includes the ARCH. */
589 /* Ensure that all values in a GDBARCH are reasonable. */
592 verify_gdbarch (struct gdbarch
*gdbarch
)
595 struct cleanup
*cleanups
;
599 log
= mem_fileopen ();
600 cleanups
= make_cleanup_ui_file_delete (log
);
602 if (gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
603 fprintf_unfiltered (log
, "\n\tbyte-order");
604 if (gdbarch
->bfd_arch_info
== NULL
)
605 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
606 /* Check those that need to be defined for the given multi-arch level. */
607 /* Skip verify of bits_big_endian, invalid_p == 0 */
608 /* Skip verify of short_bit, invalid_p == 0 */
609 /* Skip verify of int_bit, invalid_p == 0 */
610 /* Skip verify of long_bit, invalid_p == 0 */
611 /* Skip verify of long_long_bit, invalid_p == 0 */
612 /* Skip verify of long_long_align_bit, invalid_p == 0 */
613 /* Skip verify of half_bit, invalid_p == 0 */
614 if (gdbarch
->half_format
== 0)
615 gdbarch
->half_format
= floatformats_ieee_half
;
616 /* Skip verify of float_bit, invalid_p == 0 */
617 if (gdbarch
->float_format
== 0)
618 gdbarch
->float_format
= floatformats_ieee_single
;
619 /* Skip verify of double_bit, invalid_p == 0 */
620 if (gdbarch
->double_format
== 0)
621 gdbarch
->double_format
= floatformats_ieee_double
;
622 /* Skip verify of long_double_bit, invalid_p == 0 */
623 if (gdbarch
->long_double_format
== 0)
624 gdbarch
->long_double_format
= floatformats_ieee_double
;
625 /* Skip verify of ptr_bit, invalid_p == 0 */
626 if (gdbarch
->addr_bit
== 0)
627 gdbarch
->addr_bit
= gdbarch_ptr_bit (gdbarch
);
628 if (gdbarch
->dwarf2_addr_size
== 0)
629 gdbarch
->dwarf2_addr_size
= gdbarch_ptr_bit (gdbarch
) / TARGET_CHAR_BIT
;
630 if (gdbarch
->char_signed
== -1)
631 gdbarch
->char_signed
= 1;
632 /* Skip verify of read_pc, has predicate. */
633 /* Skip verify of write_pc, has predicate. */
634 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
635 /* Skip verify of pseudo_register_read, has predicate. */
636 /* Skip verify of pseudo_register_read_value, has predicate. */
637 /* Skip verify of pseudo_register_write, has predicate. */
638 if (gdbarch
->num_regs
== -1)
639 fprintf_unfiltered (log
, "\n\tnum_regs");
640 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
641 /* Skip verify of ax_pseudo_register_collect, has predicate. */
642 /* Skip verify of ax_pseudo_register_push_stack, has predicate. */
643 /* Skip verify of sp_regnum, invalid_p == 0 */
644 /* Skip verify of pc_regnum, invalid_p == 0 */
645 /* Skip verify of ps_regnum, invalid_p == 0 */
646 /* Skip verify of fp0_regnum, invalid_p == 0 */
647 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
648 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
649 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
650 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
651 if (gdbarch
->register_name
== 0)
652 fprintf_unfiltered (log
, "\n\tregister_name");
653 /* Skip verify of register_type, has predicate. */
654 /* Skip verify of dummy_id, has predicate. */
655 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
656 /* Skip verify of push_dummy_call, has predicate. */
657 /* Skip verify of call_dummy_location, invalid_p == 0 */
658 /* Skip verify of push_dummy_code, has predicate. */
659 /* Skip verify of print_registers_info, invalid_p == 0 */
660 /* Skip verify of print_float_info, has predicate. */
661 /* Skip verify of print_vector_info, has predicate. */
662 /* Skip verify of register_sim_regno, invalid_p == 0 */
663 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
664 /* Skip verify of cannot_store_register, invalid_p == 0 */
665 /* Skip verify of get_longjmp_target, has predicate. */
666 /* Skip verify of convert_register_p, invalid_p == 0 */
667 /* Skip verify of value_from_register, invalid_p == 0 */
668 /* Skip verify of pointer_to_address, invalid_p == 0 */
669 /* Skip verify of address_to_pointer, invalid_p == 0 */
670 /* Skip verify of integer_to_address, has predicate. */
671 /* Skip verify of return_value, has predicate. */
672 /* Skip verify of return_in_first_hidden_param_p, invalid_p == 0 */
673 if (gdbarch
->skip_prologue
== 0)
674 fprintf_unfiltered (log
, "\n\tskip_prologue");
675 /* Skip verify of skip_main_prologue, has predicate. */
676 if (gdbarch
->inner_than
== 0)
677 fprintf_unfiltered (log
, "\n\tinner_than");
678 if (gdbarch
->breakpoint_from_pc
== 0)
679 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
680 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
681 /* Skip verify of adjust_breakpoint_address, has predicate. */
682 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
683 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
684 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
685 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
686 /* Skip verify of remote_register_number, invalid_p == 0 */
687 /* Skip verify of fetch_tls_load_module_address, has predicate. */
688 /* Skip verify of frame_args_skip, invalid_p == 0 */
689 /* Skip verify of unwind_pc, has predicate. */
690 /* Skip verify of unwind_sp, has predicate. */
691 /* Skip verify of frame_num_args, has predicate. */
692 /* Skip verify of frame_align, has predicate. */
693 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
694 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
695 /* Skip verify of addr_bits_remove, invalid_p == 0 */
696 /* Skip verify of smash_text_address, invalid_p == 0 */
697 /* Skip verify of software_single_step, has predicate. */
698 /* Skip verify of single_step_through_delay, has predicate. */
699 if (gdbarch
->print_insn
== 0)
700 fprintf_unfiltered (log
, "\n\tprint_insn");
701 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
702 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
703 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
704 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
705 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
706 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
707 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
708 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
709 /* Skip verify of address_class_type_flags, has predicate. */
710 /* Skip verify of address_class_type_flags_to_name, has predicate. */
711 /* Skip verify of address_class_name_to_type_flags, has predicate. */
712 /* Skip verify of register_reggroup_p, invalid_p == 0 */
713 /* Skip verify of fetch_pointer_argument, has predicate. */
714 /* Skip verify of regset_from_core_section, has predicate. */
715 /* Skip verify of make_corefile_notes, has predicate. */
716 /* Skip verify of find_memory_regions, has predicate. */
717 /* Skip verify of core_xfer_shared_libraries, has predicate. */
718 /* Skip verify of core_pid_to_str, has predicate. */
719 /* Skip verify of gcore_bfd_target, has predicate. */
720 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
721 /* Skip verify of vbit_in_delta, invalid_p == 0 */
722 /* Skip verify of skip_permanent_breakpoint, has predicate. */
723 /* Skip verify of max_insn_length, has predicate. */
724 /* Skip verify of displaced_step_copy_insn, has predicate. */
725 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
726 /* Skip verify of displaced_step_fixup, has predicate. */
727 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
728 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
729 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
730 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
731 /* Skip verify of relocate_instruction, has predicate. */
732 /* Skip verify of overlay_update, has predicate. */
733 /* Skip verify of core_read_description, has predicate. */
734 /* Skip verify of static_transform_name, has predicate. */
735 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
736 /* Skip verify of process_record, has predicate. */
737 /* Skip verify of process_record_signal, has predicate. */
738 /* Skip verify of gdb_signal_from_target, has predicate. */
739 /* Skip verify of get_siginfo_type, has predicate. */
740 /* Skip verify of record_special_symbol, has predicate. */
741 /* Skip verify of get_syscall_number, has predicate. */
742 /* Skip verify of stap_integer_prefix, invalid_p == 0 */
743 /* Skip verify of stap_integer_suffix, invalid_p == 0 */
744 /* Skip verify of stap_register_prefix, invalid_p == 0 */
745 /* Skip verify of stap_register_suffix, invalid_p == 0 */
746 /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */
747 /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */
748 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
749 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
750 /* Skip verify of stap_is_single_operand, has predicate. */
751 /* Skip verify of stap_parse_special_token, has predicate. */
752 /* Skip verify of has_global_solist, invalid_p == 0 */
753 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
754 /* Skip verify of has_shared_address_space, invalid_p == 0 */
755 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
756 /* Skip verify of auto_charset, invalid_p == 0 */
757 /* Skip verify of auto_wide_charset, invalid_p == 0 */
758 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
759 /* Skip verify of gen_return_address, invalid_p == 0 */
760 /* Skip verify of info_proc, has predicate. */
761 /* Skip verify of iterate_over_objfiles_in_search_order, invalid_p == 0 */
762 buf
= ui_file_xstrdup (log
, &length
);
763 make_cleanup (xfree
, buf
);
765 internal_error (__FILE__
, __LINE__
,
766 _("verify_gdbarch: the following are invalid ...%s"),
768 do_cleanups (cleanups
);
772 /* Print out the details of the current architecture. */
775 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
777 const char *gdb_nm_file
= "<not-defined>";
779 #if defined (GDB_NM_FILE)
780 gdb_nm_file
= GDB_NM_FILE
;
782 fprintf_unfiltered (file
,
783 "gdbarch_dump: GDB_NM_FILE = %s\n",
785 fprintf_unfiltered (file
,
786 "gdbarch_dump: addr_bit = %s\n",
787 plongest (gdbarch
->addr_bit
));
788 fprintf_unfiltered (file
,
789 "gdbarch_dump: addr_bits_remove = <%s>\n",
790 host_address_to_string (gdbarch
->addr_bits_remove
));
791 fprintf_unfiltered (file
,
792 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
793 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
794 fprintf_unfiltered (file
,
795 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
796 host_address_to_string (gdbarch
->address_class_name_to_type_flags
));
797 fprintf_unfiltered (file
,
798 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
799 gdbarch_address_class_type_flags_p (gdbarch
));
800 fprintf_unfiltered (file
,
801 "gdbarch_dump: address_class_type_flags = <%s>\n",
802 host_address_to_string (gdbarch
->address_class_type_flags
));
803 fprintf_unfiltered (file
,
804 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
805 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
806 fprintf_unfiltered (file
,
807 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
808 host_address_to_string (gdbarch
->address_class_type_flags_to_name
));
809 fprintf_unfiltered (file
,
810 "gdbarch_dump: address_to_pointer = <%s>\n",
811 host_address_to_string (gdbarch
->address_to_pointer
));
812 fprintf_unfiltered (file
,
813 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
814 gdbarch_adjust_breakpoint_address_p (gdbarch
));
815 fprintf_unfiltered (file
,
816 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
817 host_address_to_string (gdbarch
->adjust_breakpoint_address
));
818 fprintf_unfiltered (file
,
819 "gdbarch_dump: auto_charset = <%s>\n",
820 host_address_to_string (gdbarch
->auto_charset
));
821 fprintf_unfiltered (file
,
822 "gdbarch_dump: auto_wide_charset = <%s>\n",
823 host_address_to_string (gdbarch
->auto_wide_charset
));
824 fprintf_unfiltered (file
,
825 "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
826 gdbarch_ax_pseudo_register_collect_p (gdbarch
));
827 fprintf_unfiltered (file
,
828 "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
829 host_address_to_string (gdbarch
->ax_pseudo_register_collect
));
830 fprintf_unfiltered (file
,
831 "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
832 gdbarch_ax_pseudo_register_push_stack_p (gdbarch
));
833 fprintf_unfiltered (file
,
834 "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
835 host_address_to_string (gdbarch
->ax_pseudo_register_push_stack
));
836 fprintf_unfiltered (file
,
837 "gdbarch_dump: believe_pcc_promotion = %s\n",
838 plongest (gdbarch
->believe_pcc_promotion
));
839 fprintf_unfiltered (file
,
840 "gdbarch_dump: bfd_arch_info = %s\n",
841 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
842 fprintf_unfiltered (file
,
843 "gdbarch_dump: bits_big_endian = %s\n",
844 plongest (gdbarch
->bits_big_endian
));
845 fprintf_unfiltered (file
,
846 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
847 host_address_to_string (gdbarch
->breakpoint_from_pc
));
848 fprintf_unfiltered (file
,
849 "gdbarch_dump: byte_order = %s\n",
850 plongest (gdbarch
->byte_order
));
851 fprintf_unfiltered (file
,
852 "gdbarch_dump: byte_order_for_code = %s\n",
853 plongest (gdbarch
->byte_order_for_code
));
854 fprintf_unfiltered (file
,
855 "gdbarch_dump: call_dummy_location = %s\n",
856 plongest (gdbarch
->call_dummy_location
));
857 fprintf_unfiltered (file
,
858 "gdbarch_dump: cannot_fetch_register = <%s>\n",
859 host_address_to_string (gdbarch
->cannot_fetch_register
));
860 fprintf_unfiltered (file
,
861 "gdbarch_dump: cannot_step_breakpoint = %s\n",
862 plongest (gdbarch
->cannot_step_breakpoint
));
863 fprintf_unfiltered (file
,
864 "gdbarch_dump: cannot_store_register = <%s>\n",
865 host_address_to_string (gdbarch
->cannot_store_register
));
866 fprintf_unfiltered (file
,
867 "gdbarch_dump: char_signed = %s\n",
868 plongest (gdbarch
->char_signed
));
869 fprintf_unfiltered (file
,
870 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
871 host_address_to_string (gdbarch
->coff_make_msymbol_special
));
872 fprintf_unfiltered (file
,
873 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
874 host_address_to_string (gdbarch
->convert_from_func_ptr_addr
));
875 fprintf_unfiltered (file
,
876 "gdbarch_dump: convert_register_p = <%s>\n",
877 host_address_to_string (gdbarch
->convert_register_p
));
878 fprintf_unfiltered (file
,
879 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
880 gdbarch_core_pid_to_str_p (gdbarch
));
881 fprintf_unfiltered (file
,
882 "gdbarch_dump: core_pid_to_str = <%s>\n",
883 host_address_to_string (gdbarch
->core_pid_to_str
));
884 fprintf_unfiltered (file
,
885 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
886 gdbarch_core_read_description_p (gdbarch
));
887 fprintf_unfiltered (file
,
888 "gdbarch_dump: core_read_description = <%s>\n",
889 host_address_to_string (gdbarch
->core_read_description
));
890 fprintf_unfiltered (file
,
891 "gdbarch_dump: core_regset_sections = %s\n",
892 host_address_to_string (gdbarch
->core_regset_sections
));
893 fprintf_unfiltered (file
,
894 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
895 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
896 fprintf_unfiltered (file
,
897 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
898 host_address_to_string (gdbarch
->core_xfer_shared_libraries
));
899 fprintf_unfiltered (file
,
900 "gdbarch_dump: decr_pc_after_break = %s\n",
901 core_addr_to_string_nz (gdbarch
->decr_pc_after_break
));
902 fprintf_unfiltered (file
,
903 "gdbarch_dump: deprecated_fp_regnum = %s\n",
904 plongest (gdbarch
->deprecated_fp_regnum
));
905 fprintf_unfiltered (file
,
906 "gdbarch_dump: deprecated_function_start_offset = %s\n",
907 core_addr_to_string_nz (gdbarch
->deprecated_function_start_offset
));
908 fprintf_unfiltered (file
,
909 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
910 gdbarch_displaced_step_copy_insn_p (gdbarch
));
911 fprintf_unfiltered (file
,
912 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
913 host_address_to_string (gdbarch
->displaced_step_copy_insn
));
914 fprintf_unfiltered (file
,
915 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
916 gdbarch_displaced_step_fixup_p (gdbarch
));
917 fprintf_unfiltered (file
,
918 "gdbarch_dump: displaced_step_fixup = <%s>\n",
919 host_address_to_string (gdbarch
->displaced_step_fixup
));
920 fprintf_unfiltered (file
,
921 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
922 host_address_to_string (gdbarch
->displaced_step_free_closure
));
923 fprintf_unfiltered (file
,
924 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
925 host_address_to_string (gdbarch
->displaced_step_hw_singlestep
));
926 fprintf_unfiltered (file
,
927 "gdbarch_dump: displaced_step_location = <%s>\n",
928 host_address_to_string (gdbarch
->displaced_step_location
));
929 fprintf_unfiltered (file
,
930 "gdbarch_dump: double_bit = %s\n",
931 plongest (gdbarch
->double_bit
));
932 fprintf_unfiltered (file
,
933 "gdbarch_dump: double_format = %s\n",
934 pformat (gdbarch
->double_format
));
935 fprintf_unfiltered (file
,
936 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
937 gdbarch_dummy_id_p (gdbarch
));
938 fprintf_unfiltered (file
,
939 "gdbarch_dump: dummy_id = <%s>\n",
940 host_address_to_string (gdbarch
->dummy_id
));
941 fprintf_unfiltered (file
,
942 "gdbarch_dump: dwarf2_addr_size = %s\n",
943 plongest (gdbarch
->dwarf2_addr_size
));
944 fprintf_unfiltered (file
,
945 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
946 host_address_to_string (gdbarch
->dwarf2_reg_to_regnum
));
947 fprintf_unfiltered (file
,
948 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
949 host_address_to_string (gdbarch
->ecoff_reg_to_regnum
));
950 fprintf_unfiltered (file
,
951 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
952 host_address_to_string (gdbarch
->elf_make_msymbol_special
));
953 fprintf_unfiltered (file
,
954 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
955 host_address_to_string (gdbarch
->fast_tracepoint_valid_at
));
956 fprintf_unfiltered (file
,
957 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
958 gdbarch_fetch_pointer_argument_p (gdbarch
));
959 fprintf_unfiltered (file
,
960 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
961 host_address_to_string (gdbarch
->fetch_pointer_argument
));
962 fprintf_unfiltered (file
,
963 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
964 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
965 fprintf_unfiltered (file
,
966 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
967 host_address_to_string (gdbarch
->fetch_tls_load_module_address
));
968 fprintf_unfiltered (file
,
969 "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n",
970 gdbarch_find_memory_regions_p (gdbarch
));
971 fprintf_unfiltered (file
,
972 "gdbarch_dump: find_memory_regions = <%s>\n",
973 host_address_to_string (gdbarch
->find_memory_regions
));
974 fprintf_unfiltered (file
,
975 "gdbarch_dump: float_bit = %s\n",
976 plongest (gdbarch
->float_bit
));
977 fprintf_unfiltered (file
,
978 "gdbarch_dump: float_format = %s\n",
979 pformat (gdbarch
->float_format
));
980 fprintf_unfiltered (file
,
981 "gdbarch_dump: fp0_regnum = %s\n",
982 plongest (gdbarch
->fp0_regnum
));
983 fprintf_unfiltered (file
,
984 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
985 gdbarch_frame_align_p (gdbarch
));
986 fprintf_unfiltered (file
,
987 "gdbarch_dump: frame_align = <%s>\n",
988 host_address_to_string (gdbarch
->frame_align
));
989 fprintf_unfiltered (file
,
990 "gdbarch_dump: frame_args_skip = %s\n",
991 core_addr_to_string_nz (gdbarch
->frame_args_skip
));
992 fprintf_unfiltered (file
,
993 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
994 gdbarch_frame_num_args_p (gdbarch
));
995 fprintf_unfiltered (file
,
996 "gdbarch_dump: frame_num_args = <%s>\n",
997 host_address_to_string (gdbarch
->frame_num_args
));
998 fprintf_unfiltered (file
,
999 "gdbarch_dump: frame_red_zone_size = %s\n",
1000 plongest (gdbarch
->frame_red_zone_size
));
1001 fprintf_unfiltered (file
,
1002 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
1003 gdbarch_gcore_bfd_target_p (gdbarch
));
1004 fprintf_unfiltered (file
,
1005 "gdbarch_dump: gcore_bfd_target = %s\n",
1006 pstring (gdbarch
->gcore_bfd_target
));
1007 fprintf_unfiltered (file
,
1008 "gdbarch_dump: gdbarch_gdb_signal_from_target_p() = %d\n",
1009 gdbarch_gdb_signal_from_target_p (gdbarch
));
1010 fprintf_unfiltered (file
,
1011 "gdbarch_dump: gdb_signal_from_target = <%s>\n",
1012 host_address_to_string (gdbarch
->gdb_signal_from_target
));
1013 fprintf_unfiltered (file
,
1014 "gdbarch_dump: gen_return_address = <%s>\n",
1015 host_address_to_string (gdbarch
->gen_return_address
));
1016 fprintf_unfiltered (file
,
1017 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1018 gdbarch_get_longjmp_target_p (gdbarch
));
1019 fprintf_unfiltered (file
,
1020 "gdbarch_dump: get_longjmp_target = <%s>\n",
1021 host_address_to_string (gdbarch
->get_longjmp_target
));
1022 fprintf_unfiltered (file
,
1023 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
1024 gdbarch_get_siginfo_type_p (gdbarch
));
1025 fprintf_unfiltered (file
,
1026 "gdbarch_dump: get_siginfo_type = <%s>\n",
1027 host_address_to_string (gdbarch
->get_siginfo_type
));
1028 fprintf_unfiltered (file
,
1029 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
1030 gdbarch_get_syscall_number_p (gdbarch
));
1031 fprintf_unfiltered (file
,
1032 "gdbarch_dump: get_syscall_number = <%s>\n",
1033 host_address_to_string (gdbarch
->get_syscall_number
));
1034 fprintf_unfiltered (file
,
1035 "gdbarch_dump: half_bit = %s\n",
1036 plongest (gdbarch
->half_bit
));
1037 fprintf_unfiltered (file
,
1038 "gdbarch_dump: half_format = %s\n",
1039 pformat (gdbarch
->half_format
));
1040 fprintf_unfiltered (file
,
1041 "gdbarch_dump: has_dos_based_file_system = %s\n",
1042 plongest (gdbarch
->has_dos_based_file_system
));
1043 fprintf_unfiltered (file
,
1044 "gdbarch_dump: has_global_breakpoints = %s\n",
1045 plongest (gdbarch
->has_global_breakpoints
));
1046 fprintf_unfiltered (file
,
1047 "gdbarch_dump: has_global_solist = %s\n",
1048 plongest (gdbarch
->has_global_solist
));
1049 fprintf_unfiltered (file
,
1050 "gdbarch_dump: has_shared_address_space = <%s>\n",
1051 host_address_to_string (gdbarch
->has_shared_address_space
));
1052 fprintf_unfiltered (file
,
1053 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1054 plongest (gdbarch
->have_nonsteppable_watchpoint
));
1055 fprintf_unfiltered (file
,
1056 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
1057 host_address_to_string (gdbarch
->in_function_epilogue_p
));
1058 fprintf_unfiltered (file
,
1059 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
1060 host_address_to_string (gdbarch
->in_solib_return_trampoline
));
1061 fprintf_unfiltered (file
,
1062 "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
1063 gdbarch_info_proc_p (gdbarch
));
1064 fprintf_unfiltered (file
,
1065 "gdbarch_dump: info_proc = <%s>\n",
1066 host_address_to_string (gdbarch
->info_proc
));
1067 fprintf_unfiltered (file
,
1068 "gdbarch_dump: inner_than = <%s>\n",
1069 host_address_to_string (gdbarch
->inner_than
));
1070 fprintf_unfiltered (file
,
1071 "gdbarch_dump: int_bit = %s\n",
1072 plongest (gdbarch
->int_bit
));
1073 fprintf_unfiltered (file
,
1074 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1075 gdbarch_integer_to_address_p (gdbarch
));
1076 fprintf_unfiltered (file
,
1077 "gdbarch_dump: integer_to_address = <%s>\n",
1078 host_address_to_string (gdbarch
->integer_to_address
));
1079 fprintf_unfiltered (file
,
1080 "gdbarch_dump: iterate_over_objfiles_in_search_order = <%s>\n",
1081 host_address_to_string (gdbarch
->iterate_over_objfiles_in_search_order
));
1082 fprintf_unfiltered (file
,
1083 "gdbarch_dump: long_bit = %s\n",
1084 plongest (gdbarch
->long_bit
));
1085 fprintf_unfiltered (file
,
1086 "gdbarch_dump: long_double_bit = %s\n",
1087 plongest (gdbarch
->long_double_bit
));
1088 fprintf_unfiltered (file
,
1089 "gdbarch_dump: long_double_format = %s\n",
1090 pformat (gdbarch
->long_double_format
));
1091 fprintf_unfiltered (file
,
1092 "gdbarch_dump: long_long_align_bit = %s\n",
1093 plongest (gdbarch
->long_long_align_bit
));
1094 fprintf_unfiltered (file
,
1095 "gdbarch_dump: long_long_bit = %s\n",
1096 plongest (gdbarch
->long_long_bit
));
1097 fprintf_unfiltered (file
,
1098 "gdbarch_dump: gdbarch_make_corefile_notes_p() = %d\n",
1099 gdbarch_make_corefile_notes_p (gdbarch
));
1100 fprintf_unfiltered (file
,
1101 "gdbarch_dump: make_corefile_notes = <%s>\n",
1102 host_address_to_string (gdbarch
->make_corefile_notes
));
1103 fprintf_unfiltered (file
,
1104 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
1105 gdbarch_max_insn_length_p (gdbarch
));
1106 fprintf_unfiltered (file
,
1107 "gdbarch_dump: max_insn_length = %s\n",
1108 plongest (gdbarch
->max_insn_length
));
1109 fprintf_unfiltered (file
,
1110 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1111 host_address_to_string (gdbarch
->memory_insert_breakpoint
));
1112 fprintf_unfiltered (file
,
1113 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1114 host_address_to_string (gdbarch
->memory_remove_breakpoint
));
1115 fprintf_unfiltered (file
,
1116 "gdbarch_dump: num_pseudo_regs = %s\n",
1117 plongest (gdbarch
->num_pseudo_regs
));
1118 fprintf_unfiltered (file
,
1119 "gdbarch_dump: num_regs = %s\n",
1120 plongest (gdbarch
->num_regs
));
1121 fprintf_unfiltered (file
,
1122 "gdbarch_dump: osabi = %s\n",
1123 plongest (gdbarch
->osabi
));
1124 fprintf_unfiltered (file
,
1125 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1126 gdbarch_overlay_update_p (gdbarch
));
1127 fprintf_unfiltered (file
,
1128 "gdbarch_dump: overlay_update = <%s>\n",
1129 host_address_to_string (gdbarch
->overlay_update
));
1130 fprintf_unfiltered (file
,
1131 "gdbarch_dump: pc_regnum = %s\n",
1132 plongest (gdbarch
->pc_regnum
));
1133 fprintf_unfiltered (file
,
1134 "gdbarch_dump: pointer_to_address = <%s>\n",
1135 host_address_to_string (gdbarch
->pointer_to_address
));
1136 fprintf_unfiltered (file
,
1137 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1138 gdbarch_print_float_info_p (gdbarch
));
1139 fprintf_unfiltered (file
,
1140 "gdbarch_dump: print_float_info = <%s>\n",
1141 host_address_to_string (gdbarch
->print_float_info
));
1142 fprintf_unfiltered (file
,
1143 "gdbarch_dump: print_insn = <%s>\n",
1144 host_address_to_string (gdbarch
->print_insn
));
1145 fprintf_unfiltered (file
,
1146 "gdbarch_dump: print_registers_info = <%s>\n",
1147 host_address_to_string (gdbarch
->print_registers_info
));
1148 fprintf_unfiltered (file
,
1149 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1150 gdbarch_print_vector_info_p (gdbarch
));
1151 fprintf_unfiltered (file
,
1152 "gdbarch_dump: print_vector_info = <%s>\n",
1153 host_address_to_string (gdbarch
->print_vector_info
));
1154 fprintf_unfiltered (file
,
1155 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1156 gdbarch_process_record_p (gdbarch
));
1157 fprintf_unfiltered (file
,
1158 "gdbarch_dump: process_record = <%s>\n",
1159 host_address_to_string (gdbarch
->process_record
));
1160 fprintf_unfiltered (file
,
1161 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1162 gdbarch_process_record_signal_p (gdbarch
));
1163 fprintf_unfiltered (file
,
1164 "gdbarch_dump: process_record_signal = <%s>\n",
1165 host_address_to_string (gdbarch
->process_record_signal
));
1166 fprintf_unfiltered (file
,
1167 "gdbarch_dump: ps_regnum = %s\n",
1168 plongest (gdbarch
->ps_regnum
));
1169 fprintf_unfiltered (file
,
1170 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1171 gdbarch_pseudo_register_read_p (gdbarch
));
1172 fprintf_unfiltered (file
,
1173 "gdbarch_dump: pseudo_register_read = <%s>\n",
1174 host_address_to_string (gdbarch
->pseudo_register_read
));
1175 fprintf_unfiltered (file
,
1176 "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
1177 gdbarch_pseudo_register_read_value_p (gdbarch
));
1178 fprintf_unfiltered (file
,
1179 "gdbarch_dump: pseudo_register_read_value = <%s>\n",
1180 host_address_to_string (gdbarch
->pseudo_register_read_value
));
1181 fprintf_unfiltered (file
,
1182 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1183 gdbarch_pseudo_register_write_p (gdbarch
));
1184 fprintf_unfiltered (file
,
1185 "gdbarch_dump: pseudo_register_write = <%s>\n",
1186 host_address_to_string (gdbarch
->pseudo_register_write
));
1187 fprintf_unfiltered (file
,
1188 "gdbarch_dump: ptr_bit = %s\n",
1189 plongest (gdbarch
->ptr_bit
));
1190 fprintf_unfiltered (file
,
1191 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1192 gdbarch_push_dummy_call_p (gdbarch
));
1193 fprintf_unfiltered (file
,
1194 "gdbarch_dump: push_dummy_call = <%s>\n",
1195 host_address_to_string (gdbarch
->push_dummy_call
));
1196 fprintf_unfiltered (file
,
1197 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1198 gdbarch_push_dummy_code_p (gdbarch
));
1199 fprintf_unfiltered (file
,
1200 "gdbarch_dump: push_dummy_code = <%s>\n",
1201 host_address_to_string (gdbarch
->push_dummy_code
));
1202 fprintf_unfiltered (file
,
1203 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1204 gdbarch_read_pc_p (gdbarch
));
1205 fprintf_unfiltered (file
,
1206 "gdbarch_dump: read_pc = <%s>\n",
1207 host_address_to_string (gdbarch
->read_pc
));
1208 fprintf_unfiltered (file
,
1209 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1210 gdbarch_record_special_symbol_p (gdbarch
));
1211 fprintf_unfiltered (file
,
1212 "gdbarch_dump: record_special_symbol = <%s>\n",
1213 host_address_to_string (gdbarch
->record_special_symbol
));
1214 fprintf_unfiltered (file
,
1215 "gdbarch_dump: register_name = <%s>\n",
1216 host_address_to_string (gdbarch
->register_name
));
1217 fprintf_unfiltered (file
,
1218 "gdbarch_dump: register_reggroup_p = <%s>\n",
1219 host_address_to_string (gdbarch
->register_reggroup_p
));
1220 fprintf_unfiltered (file
,
1221 "gdbarch_dump: register_sim_regno = <%s>\n",
1222 host_address_to_string (gdbarch
->register_sim_regno
));
1223 fprintf_unfiltered (file
,
1224 "gdbarch_dump: register_to_value = <%s>\n",
1225 host_address_to_string (gdbarch
->register_to_value
));
1226 fprintf_unfiltered (file
,
1227 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1228 gdbarch_register_type_p (gdbarch
));
1229 fprintf_unfiltered (file
,
1230 "gdbarch_dump: register_type = <%s>\n",
1231 host_address_to_string (gdbarch
->register_type
));
1232 fprintf_unfiltered (file
,
1233 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1234 gdbarch_regset_from_core_section_p (gdbarch
));
1235 fprintf_unfiltered (file
,
1236 "gdbarch_dump: regset_from_core_section = <%s>\n",
1237 host_address_to_string (gdbarch
->regset_from_core_section
));
1238 fprintf_unfiltered (file
,
1239 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1240 gdbarch_relocate_instruction_p (gdbarch
));
1241 fprintf_unfiltered (file
,
1242 "gdbarch_dump: relocate_instruction = <%s>\n",
1243 host_address_to_string (gdbarch
->relocate_instruction
));
1244 fprintf_unfiltered (file
,
1245 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1246 host_address_to_string (gdbarch
->remote_breakpoint_from_pc
));
1247 fprintf_unfiltered (file
,
1248 "gdbarch_dump: remote_register_number = <%s>\n",
1249 host_address_to_string (gdbarch
->remote_register_number
));
1250 fprintf_unfiltered (file
,
1251 "gdbarch_dump: return_in_first_hidden_param_p = <%s>\n",
1252 host_address_to_string (gdbarch
->return_in_first_hidden_param_p
));
1253 fprintf_unfiltered (file
,
1254 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1255 gdbarch_return_value_p (gdbarch
));
1256 fprintf_unfiltered (file
,
1257 "gdbarch_dump: return_value = <%s>\n",
1258 host_address_to_string (gdbarch
->return_value
));
1259 fprintf_unfiltered (file
,
1260 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1261 host_address_to_string (gdbarch
->sdb_reg_to_regnum
));
1262 fprintf_unfiltered (file
,
1263 "gdbarch_dump: short_bit = %s\n",
1264 plongest (gdbarch
->short_bit
));
1265 fprintf_unfiltered (file
,
1266 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1267 gdbarch_single_step_through_delay_p (gdbarch
));
1268 fprintf_unfiltered (file
,
1269 "gdbarch_dump: single_step_through_delay = <%s>\n",
1270 host_address_to_string (gdbarch
->single_step_through_delay
));
1271 fprintf_unfiltered (file
,
1272 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1273 gdbarch_skip_main_prologue_p (gdbarch
));
1274 fprintf_unfiltered (file
,
1275 "gdbarch_dump: skip_main_prologue = <%s>\n",
1276 host_address_to_string (gdbarch
->skip_main_prologue
));
1277 fprintf_unfiltered (file
,
1278 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1279 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1280 fprintf_unfiltered (file
,
1281 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1282 host_address_to_string (gdbarch
->skip_permanent_breakpoint
));
1283 fprintf_unfiltered (file
,
1284 "gdbarch_dump: skip_prologue = <%s>\n",
1285 host_address_to_string (gdbarch
->skip_prologue
));
1286 fprintf_unfiltered (file
,
1287 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1288 host_address_to_string (gdbarch
->skip_solib_resolver
));
1289 fprintf_unfiltered (file
,
1290 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1291 host_address_to_string (gdbarch
->skip_trampoline_code
));
1292 fprintf_unfiltered (file
,
1293 "gdbarch_dump: smash_text_address = <%s>\n",
1294 host_address_to_string (gdbarch
->smash_text_address
));
1295 fprintf_unfiltered (file
,
1296 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1297 gdbarch_software_single_step_p (gdbarch
));
1298 fprintf_unfiltered (file
,
1299 "gdbarch_dump: software_single_step = <%s>\n",
1300 host_address_to_string (gdbarch
->software_single_step
));
1301 fprintf_unfiltered (file
,
1302 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1303 plongest (gdbarch
->sofun_address_maybe_missing
));
1304 fprintf_unfiltered (file
,
1305 "gdbarch_dump: solib_symbols_extension = %s\n",
1306 pstring (gdbarch
->solib_symbols_extension
));
1307 fprintf_unfiltered (file
,
1308 "gdbarch_dump: sp_regnum = %s\n",
1309 plongest (gdbarch
->sp_regnum
));
1310 fprintf_unfiltered (file
,
1311 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1312 host_address_to_string (gdbarch
->stab_reg_to_regnum
));
1313 fprintf_unfiltered (file
,
1314 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1315 host_address_to_string (gdbarch
->stabs_argument_has_addr
));
1316 fprintf_unfiltered (file
,
1317 "gdbarch_dump: stap_gdb_register_prefix = %s\n",
1318 gdbarch
->stap_gdb_register_prefix
);
1319 fprintf_unfiltered (file
,
1320 "gdbarch_dump: stap_gdb_register_suffix = %s\n",
1321 gdbarch
->stap_gdb_register_suffix
);
1322 fprintf_unfiltered (file
,
1323 "gdbarch_dump: stap_integer_prefix = %s\n",
1324 gdbarch
->stap_integer_prefix
);
1325 fprintf_unfiltered (file
,
1326 "gdbarch_dump: stap_integer_suffix = %s\n",
1327 gdbarch
->stap_integer_suffix
);
1328 fprintf_unfiltered (file
,
1329 "gdbarch_dump: gdbarch_stap_is_single_operand_p() = %d\n",
1330 gdbarch_stap_is_single_operand_p (gdbarch
));
1331 fprintf_unfiltered (file
,
1332 "gdbarch_dump: stap_is_single_operand = <%s>\n",
1333 host_address_to_string (gdbarch
->stap_is_single_operand
));
1334 fprintf_unfiltered (file
,
1335 "gdbarch_dump: gdbarch_stap_parse_special_token_p() = %d\n",
1336 gdbarch_stap_parse_special_token_p (gdbarch
));
1337 fprintf_unfiltered (file
,
1338 "gdbarch_dump: stap_parse_special_token = <%s>\n",
1339 host_address_to_string (gdbarch
->stap_parse_special_token
));
1340 fprintf_unfiltered (file
,
1341 "gdbarch_dump: stap_register_indirection_prefix = %s\n",
1342 gdbarch
->stap_register_indirection_prefix
);
1343 fprintf_unfiltered (file
,
1344 "gdbarch_dump: stap_register_indirection_suffix = %s\n",
1345 gdbarch
->stap_register_indirection_suffix
);
1346 fprintf_unfiltered (file
,
1347 "gdbarch_dump: stap_register_prefix = %s\n",
1348 gdbarch
->stap_register_prefix
);
1349 fprintf_unfiltered (file
,
1350 "gdbarch_dump: stap_register_suffix = %s\n",
1351 gdbarch
->stap_register_suffix
);
1352 fprintf_unfiltered (file
,
1353 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1354 gdbarch_static_transform_name_p (gdbarch
));
1355 fprintf_unfiltered (file
,
1356 "gdbarch_dump: static_transform_name = <%s>\n",
1357 host_address_to_string (gdbarch
->static_transform_name
));
1358 fprintf_unfiltered (file
,
1359 "gdbarch_dump: target_desc = %s\n",
1360 host_address_to_string (gdbarch
->target_desc
));
1361 fprintf_unfiltered (file
,
1362 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1363 gdbarch_unwind_pc_p (gdbarch
));
1364 fprintf_unfiltered (file
,
1365 "gdbarch_dump: unwind_pc = <%s>\n",
1366 host_address_to_string (gdbarch
->unwind_pc
));
1367 fprintf_unfiltered (file
,
1368 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1369 gdbarch_unwind_sp_p (gdbarch
));
1370 fprintf_unfiltered (file
,
1371 "gdbarch_dump: unwind_sp = <%s>\n",
1372 host_address_to_string (gdbarch
->unwind_sp
));
1373 fprintf_unfiltered (file
,
1374 "gdbarch_dump: value_from_register = <%s>\n",
1375 host_address_to_string (gdbarch
->value_from_register
));
1376 fprintf_unfiltered (file
,
1377 "gdbarch_dump: value_to_register = <%s>\n",
1378 host_address_to_string (gdbarch
->value_to_register
));
1379 fprintf_unfiltered (file
,
1380 "gdbarch_dump: vbit_in_delta = %s\n",
1381 plongest (gdbarch
->vbit_in_delta
));
1382 fprintf_unfiltered (file
,
1383 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1384 host_address_to_string (gdbarch
->virtual_frame_pointer
));
1385 fprintf_unfiltered (file
,
1386 "gdbarch_dump: vtable_function_descriptors = %s\n",
1387 plongest (gdbarch
->vtable_function_descriptors
));
1388 fprintf_unfiltered (file
,
1389 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1390 gdbarch_write_pc_p (gdbarch
));
1391 fprintf_unfiltered (file
,
1392 "gdbarch_dump: write_pc = <%s>\n",
1393 host_address_to_string (gdbarch
->write_pc
));
1394 if (gdbarch
->dump_tdep
!= NULL
)
1395 gdbarch
->dump_tdep (gdbarch
, file
);
1398 struct gdbarch_tdep
*
1399 gdbarch_tdep (struct gdbarch
*gdbarch
)
1401 if (gdbarch_debug
>= 2)
1402 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1403 return gdbarch
->tdep
;
1407 const struct bfd_arch_info
*
1408 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1410 gdb_assert (gdbarch
!= NULL
);
1411 if (gdbarch_debug
>= 2)
1412 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1413 return gdbarch
->bfd_arch_info
;
1417 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1419 gdb_assert (gdbarch
!= NULL
);
1420 if (gdbarch_debug
>= 2)
1421 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1422 return gdbarch
->byte_order
;
1426 gdbarch_byte_order_for_code (struct gdbarch
*gdbarch
)
1428 gdb_assert (gdbarch
!= NULL
);
1429 if (gdbarch_debug
>= 2)
1430 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order_for_code called\n");
1431 return gdbarch
->byte_order_for_code
;
1435 gdbarch_osabi (struct gdbarch
*gdbarch
)
1437 gdb_assert (gdbarch
!= NULL
);
1438 if (gdbarch_debug
>= 2)
1439 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1440 return gdbarch
->osabi
;
1443 const struct target_desc
*
1444 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1446 gdb_assert (gdbarch
!= NULL
);
1447 if (gdbarch_debug
>= 2)
1448 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1449 return gdbarch
->target_desc
;
1453 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1455 gdb_assert (gdbarch
!= NULL
);
1456 /* Skip verify of bits_big_endian, invalid_p == 0 */
1457 if (gdbarch_debug
>= 2)
1458 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1459 return gdbarch
->bits_big_endian
;
1463 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1464 int bits_big_endian
)
1466 gdbarch
->bits_big_endian
= bits_big_endian
;
1470 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1472 gdb_assert (gdbarch
!= NULL
);
1473 /* Skip verify of short_bit, invalid_p == 0 */
1474 if (gdbarch_debug
>= 2)
1475 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1476 return gdbarch
->short_bit
;
1480 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1483 gdbarch
->short_bit
= short_bit
;
1487 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1489 gdb_assert (gdbarch
!= NULL
);
1490 /* Skip verify of int_bit, invalid_p == 0 */
1491 if (gdbarch_debug
>= 2)
1492 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1493 return gdbarch
->int_bit
;
1497 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1500 gdbarch
->int_bit
= int_bit
;
1504 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1506 gdb_assert (gdbarch
!= NULL
);
1507 /* Skip verify of long_bit, invalid_p == 0 */
1508 if (gdbarch_debug
>= 2)
1509 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1510 return gdbarch
->long_bit
;
1514 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1517 gdbarch
->long_bit
= long_bit
;
1521 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1523 gdb_assert (gdbarch
!= NULL
);
1524 /* Skip verify of long_long_bit, invalid_p == 0 */
1525 if (gdbarch_debug
>= 2)
1526 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1527 return gdbarch
->long_long_bit
;
1531 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1534 gdbarch
->long_long_bit
= long_long_bit
;
1538 gdbarch_long_long_align_bit (struct gdbarch
*gdbarch
)
1540 gdb_assert (gdbarch
!= NULL
);
1541 /* Skip verify of long_long_align_bit, invalid_p == 0 */
1542 if (gdbarch_debug
>= 2)
1543 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_align_bit called\n");
1544 return gdbarch
->long_long_align_bit
;
1548 set_gdbarch_long_long_align_bit (struct gdbarch
*gdbarch
,
1549 int long_long_align_bit
)
1551 gdbarch
->long_long_align_bit
= long_long_align_bit
;
1555 gdbarch_half_bit (struct gdbarch
*gdbarch
)
1557 gdb_assert (gdbarch
!= NULL
);
1558 /* Skip verify of half_bit, invalid_p == 0 */
1559 if (gdbarch_debug
>= 2)
1560 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_bit called\n");
1561 return gdbarch
->half_bit
;
1565 set_gdbarch_half_bit (struct gdbarch
*gdbarch
,
1568 gdbarch
->half_bit
= half_bit
;
1571 const struct floatformat
**
1572 gdbarch_half_format (struct gdbarch
*gdbarch
)
1574 gdb_assert (gdbarch
!= NULL
);
1575 if (gdbarch_debug
>= 2)
1576 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_format called\n");
1577 return gdbarch
->half_format
;
1581 set_gdbarch_half_format (struct gdbarch
*gdbarch
,
1582 const struct floatformat
** half_format
)
1584 gdbarch
->half_format
= half_format
;
1588 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1590 gdb_assert (gdbarch
!= NULL
);
1591 /* Skip verify of float_bit, invalid_p == 0 */
1592 if (gdbarch_debug
>= 2)
1593 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1594 return gdbarch
->float_bit
;
1598 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1601 gdbarch
->float_bit
= float_bit
;
1604 const struct floatformat
**
1605 gdbarch_float_format (struct gdbarch
*gdbarch
)
1607 gdb_assert (gdbarch
!= NULL
);
1608 if (gdbarch_debug
>= 2)
1609 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1610 return gdbarch
->float_format
;
1614 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1615 const struct floatformat
** float_format
)
1617 gdbarch
->float_format
= float_format
;
1621 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1623 gdb_assert (gdbarch
!= NULL
);
1624 /* Skip verify of double_bit, invalid_p == 0 */
1625 if (gdbarch_debug
>= 2)
1626 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1627 return gdbarch
->double_bit
;
1631 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1634 gdbarch
->double_bit
= double_bit
;
1637 const struct floatformat
**
1638 gdbarch_double_format (struct gdbarch
*gdbarch
)
1640 gdb_assert (gdbarch
!= NULL
);
1641 if (gdbarch_debug
>= 2)
1642 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1643 return gdbarch
->double_format
;
1647 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1648 const struct floatformat
** double_format
)
1650 gdbarch
->double_format
= double_format
;
1654 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1656 gdb_assert (gdbarch
!= NULL
);
1657 /* Skip verify of long_double_bit, invalid_p == 0 */
1658 if (gdbarch_debug
>= 2)
1659 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1660 return gdbarch
->long_double_bit
;
1664 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1665 int long_double_bit
)
1667 gdbarch
->long_double_bit
= long_double_bit
;
1670 const struct floatformat
**
1671 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1673 gdb_assert (gdbarch
!= NULL
);
1674 if (gdbarch_debug
>= 2)
1675 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1676 return gdbarch
->long_double_format
;
1680 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1681 const struct floatformat
** long_double_format
)
1683 gdbarch
->long_double_format
= long_double_format
;
1687 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1689 gdb_assert (gdbarch
!= NULL
);
1690 /* Skip verify of ptr_bit, invalid_p == 0 */
1691 if (gdbarch_debug
>= 2)
1692 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1693 return gdbarch
->ptr_bit
;
1697 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1700 gdbarch
->ptr_bit
= ptr_bit
;
1704 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1706 gdb_assert (gdbarch
!= NULL
);
1707 /* Check variable changed from pre-default. */
1708 gdb_assert (gdbarch
->addr_bit
!= 0);
1709 if (gdbarch_debug
>= 2)
1710 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1711 return gdbarch
->addr_bit
;
1715 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1718 gdbarch
->addr_bit
= addr_bit
;
1722 gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
)
1724 gdb_assert (gdbarch
!= NULL
);
1725 /* Check variable changed from pre-default. */
1726 gdb_assert (gdbarch
->dwarf2_addr_size
!= 0);
1727 if (gdbarch_debug
>= 2)
1728 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_addr_size called\n");
1729 return gdbarch
->dwarf2_addr_size
;
1733 set_gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
,
1734 int dwarf2_addr_size
)
1736 gdbarch
->dwarf2_addr_size
= dwarf2_addr_size
;
1740 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1742 gdb_assert (gdbarch
!= NULL
);
1743 /* Check variable changed from pre-default. */
1744 gdb_assert (gdbarch
->char_signed
!= -1);
1745 if (gdbarch_debug
>= 2)
1746 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1747 return gdbarch
->char_signed
;
1751 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1754 gdbarch
->char_signed
= char_signed
;
1758 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1760 gdb_assert (gdbarch
!= NULL
);
1761 return gdbarch
->read_pc
!= NULL
;
1765 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1767 gdb_assert (gdbarch
!= NULL
);
1768 gdb_assert (gdbarch
->read_pc
!= NULL
);
1769 if (gdbarch_debug
>= 2)
1770 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1771 return gdbarch
->read_pc (regcache
);
1775 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1776 gdbarch_read_pc_ftype read_pc
)
1778 gdbarch
->read_pc
= read_pc
;
1782 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1784 gdb_assert (gdbarch
!= NULL
);
1785 return gdbarch
->write_pc
!= NULL
;
1789 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1791 gdb_assert (gdbarch
!= NULL
);
1792 gdb_assert (gdbarch
->write_pc
!= NULL
);
1793 if (gdbarch_debug
>= 2)
1794 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1795 gdbarch
->write_pc (regcache
, val
);
1799 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1800 gdbarch_write_pc_ftype write_pc
)
1802 gdbarch
->write_pc
= write_pc
;
1806 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1808 gdb_assert (gdbarch
!= NULL
);
1809 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1810 if (gdbarch_debug
>= 2)
1811 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1812 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1816 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1817 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1819 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1823 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1825 gdb_assert (gdbarch
!= NULL
);
1826 return gdbarch
->pseudo_register_read
!= NULL
;
1829 enum register_status
1830 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1832 gdb_assert (gdbarch
!= NULL
);
1833 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1834 if (gdbarch_debug
>= 2)
1835 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1836 return gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1840 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1841 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1843 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1847 gdbarch_pseudo_register_read_value_p (struct gdbarch
*gdbarch
)
1849 gdb_assert (gdbarch
!= NULL
);
1850 return gdbarch
->pseudo_register_read_value
!= NULL
;
1854 gdbarch_pseudo_register_read_value (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
)
1856 gdb_assert (gdbarch
!= NULL
);
1857 gdb_assert (gdbarch
->pseudo_register_read_value
!= NULL
);
1858 if (gdbarch_debug
>= 2)
1859 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read_value called\n");
1860 return gdbarch
->pseudo_register_read_value (gdbarch
, regcache
, cookednum
);
1864 set_gdbarch_pseudo_register_read_value (struct gdbarch
*gdbarch
,
1865 gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value
)
1867 gdbarch
->pseudo_register_read_value
= pseudo_register_read_value
;
1871 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1873 gdb_assert (gdbarch
!= NULL
);
1874 return gdbarch
->pseudo_register_write
!= NULL
;
1878 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1880 gdb_assert (gdbarch
!= NULL
);
1881 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1882 if (gdbarch_debug
>= 2)
1883 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1884 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1888 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1889 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1891 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1895 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1897 gdb_assert (gdbarch
!= NULL
);
1898 /* Check variable changed from pre-default. */
1899 gdb_assert (gdbarch
->num_regs
!= -1);
1900 if (gdbarch_debug
>= 2)
1901 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1902 return gdbarch
->num_regs
;
1906 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1909 gdbarch
->num_regs
= num_regs
;
1913 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1915 gdb_assert (gdbarch
!= NULL
);
1916 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1917 if (gdbarch_debug
>= 2)
1918 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1919 return gdbarch
->num_pseudo_regs
;
1923 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1924 int num_pseudo_regs
)
1926 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1930 gdbarch_ax_pseudo_register_collect_p (struct gdbarch
*gdbarch
)
1932 gdb_assert (gdbarch
!= NULL
);
1933 return gdbarch
->ax_pseudo_register_collect
!= NULL
;
1937 gdbarch_ax_pseudo_register_collect (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, int reg
)
1939 gdb_assert (gdbarch
!= NULL
);
1940 gdb_assert (gdbarch
->ax_pseudo_register_collect
!= NULL
);
1941 if (gdbarch_debug
>= 2)
1942 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ax_pseudo_register_collect called\n");
1943 return gdbarch
->ax_pseudo_register_collect (gdbarch
, ax
, reg
);
1947 set_gdbarch_ax_pseudo_register_collect (struct gdbarch
*gdbarch
,
1948 gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect
)
1950 gdbarch
->ax_pseudo_register_collect
= ax_pseudo_register_collect
;
1954 gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch
*gdbarch
)
1956 gdb_assert (gdbarch
!= NULL
);
1957 return gdbarch
->ax_pseudo_register_push_stack
!= NULL
;
1961 gdbarch_ax_pseudo_register_push_stack (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, int reg
)
1963 gdb_assert (gdbarch
!= NULL
);
1964 gdb_assert (gdbarch
->ax_pseudo_register_push_stack
!= NULL
);
1965 if (gdbarch_debug
>= 2)
1966 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ax_pseudo_register_push_stack called\n");
1967 return gdbarch
->ax_pseudo_register_push_stack (gdbarch
, ax
, reg
);
1971 set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch
*gdbarch
,
1972 gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack
)
1974 gdbarch
->ax_pseudo_register_push_stack
= ax_pseudo_register_push_stack
;
1978 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1980 gdb_assert (gdbarch
!= NULL
);
1981 /* Skip verify of sp_regnum, invalid_p == 0 */
1982 if (gdbarch_debug
>= 2)
1983 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1984 return gdbarch
->sp_regnum
;
1988 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1991 gdbarch
->sp_regnum
= sp_regnum
;
1995 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1997 gdb_assert (gdbarch
!= NULL
);
1998 /* Skip verify of pc_regnum, invalid_p == 0 */
1999 if (gdbarch_debug
>= 2)
2000 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
2001 return gdbarch
->pc_regnum
;
2005 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
2008 gdbarch
->pc_regnum
= pc_regnum
;
2012 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
2014 gdb_assert (gdbarch
!= NULL
);
2015 /* Skip verify of ps_regnum, invalid_p == 0 */
2016 if (gdbarch_debug
>= 2)
2017 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
2018 return gdbarch
->ps_regnum
;
2022 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
2025 gdbarch
->ps_regnum
= ps_regnum
;
2029 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
2031 gdb_assert (gdbarch
!= NULL
);
2032 /* Skip verify of fp0_regnum, invalid_p == 0 */
2033 if (gdbarch_debug
>= 2)
2034 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
2035 return gdbarch
->fp0_regnum
;
2039 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
2042 gdbarch
->fp0_regnum
= fp0_regnum
;
2046 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
2048 gdb_assert (gdbarch
!= NULL
);
2049 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
2050 if (gdbarch_debug
>= 2)
2051 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
2052 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
2056 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
2057 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
2059 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
2063 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
2065 gdb_assert (gdbarch
!= NULL
);
2066 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
2067 if (gdbarch_debug
>= 2)
2068 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
2069 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
2073 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
2074 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
2076 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
2080 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
2082 gdb_assert (gdbarch
!= NULL
);
2083 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
2084 if (gdbarch_debug
>= 2)
2085 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
2086 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
2090 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
2091 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
2093 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
2097 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
2099 gdb_assert (gdbarch
!= NULL
);
2100 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
2101 if (gdbarch_debug
>= 2)
2102 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
2103 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
2107 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
2108 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
2110 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
2114 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
2116 gdb_assert (gdbarch
!= NULL
);
2117 gdb_assert (gdbarch
->register_name
!= NULL
);
2118 if (gdbarch_debug
>= 2)
2119 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
2120 return gdbarch
->register_name (gdbarch
, regnr
);
2124 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
2125 gdbarch_register_name_ftype register_name
)
2127 gdbarch
->register_name
= register_name
;
2131 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
2133 gdb_assert (gdbarch
!= NULL
);
2134 return gdbarch
->register_type
!= NULL
;
2138 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
2140 gdb_assert (gdbarch
!= NULL
);
2141 gdb_assert (gdbarch
->register_type
!= NULL
);
2142 if (gdbarch_debug
>= 2)
2143 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
2144 return gdbarch
->register_type (gdbarch
, reg_nr
);
2148 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
2149 gdbarch_register_type_ftype register_type
)
2151 gdbarch
->register_type
= register_type
;
2155 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
2157 gdb_assert (gdbarch
!= NULL
);
2158 return gdbarch
->dummy_id
!= NULL
;
2162 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
2164 gdb_assert (gdbarch
!= NULL
);
2165 gdb_assert (gdbarch
->dummy_id
!= NULL
);
2166 if (gdbarch_debug
>= 2)
2167 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
2168 return gdbarch
->dummy_id (gdbarch
, this_frame
);
2172 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
2173 gdbarch_dummy_id_ftype dummy_id
)
2175 gdbarch
->dummy_id
= dummy_id
;
2179 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
2181 gdb_assert (gdbarch
!= NULL
);
2182 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2183 if (gdbarch_debug
>= 2)
2184 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
2185 return gdbarch
->deprecated_fp_regnum
;
2189 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
2190 int deprecated_fp_regnum
)
2192 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
2196 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
2198 gdb_assert (gdbarch
!= NULL
);
2199 return gdbarch
->push_dummy_call
!= NULL
;
2203 gdbarch_push_dummy_call (struct gdbarch
*gdbarch
, struct value
*function
, struct regcache
*regcache
, CORE_ADDR bp_addr
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
2205 gdb_assert (gdbarch
!= NULL
);
2206 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
2207 if (gdbarch_debug
>= 2)
2208 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
2209 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
2213 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
2214 gdbarch_push_dummy_call_ftype push_dummy_call
)
2216 gdbarch
->push_dummy_call
= push_dummy_call
;
2220 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
2222 gdb_assert (gdbarch
!= NULL
);
2223 /* Skip verify of call_dummy_location, invalid_p == 0 */
2224 if (gdbarch_debug
>= 2)
2225 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
2226 return gdbarch
->call_dummy_location
;
2230 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
2231 int call_dummy_location
)
2233 gdbarch
->call_dummy_location
= call_dummy_location
;
2237 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2239 gdb_assert (gdbarch
!= NULL
);
2240 return gdbarch
->push_dummy_code
!= NULL
;
2244 gdbarch_push_dummy_code (struct gdbarch
*gdbarch
, CORE_ADDR sp
, CORE_ADDR funaddr
, struct value
**args
, int nargs
, struct type
*value_type
, CORE_ADDR
*real_pc
, CORE_ADDR
*bp_addr
, struct regcache
*regcache
)
2246 gdb_assert (gdbarch
!= NULL
);
2247 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2248 if (gdbarch_debug
>= 2)
2249 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2250 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
2254 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2255 gdbarch_push_dummy_code_ftype push_dummy_code
)
2257 gdbarch
->push_dummy_code
= push_dummy_code
;
2261 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2263 gdb_assert (gdbarch
!= NULL
);
2264 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2265 if (gdbarch_debug
>= 2)
2266 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2267 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2271 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2272 gdbarch_print_registers_info_ftype print_registers_info
)
2274 gdbarch
->print_registers_info
= print_registers_info
;
2278 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2280 gdb_assert (gdbarch
!= NULL
);
2281 return gdbarch
->print_float_info
!= NULL
;
2285 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2287 gdb_assert (gdbarch
!= NULL
);
2288 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2289 if (gdbarch_debug
>= 2)
2290 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2291 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2295 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2296 gdbarch_print_float_info_ftype print_float_info
)
2298 gdbarch
->print_float_info
= print_float_info
;
2302 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2304 gdb_assert (gdbarch
!= NULL
);
2305 return gdbarch
->print_vector_info
!= NULL
;
2309 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2311 gdb_assert (gdbarch
!= NULL
);
2312 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2313 if (gdbarch_debug
>= 2)
2314 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2315 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2319 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2320 gdbarch_print_vector_info_ftype print_vector_info
)
2322 gdbarch
->print_vector_info
= print_vector_info
;
2326 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2328 gdb_assert (gdbarch
!= NULL
);
2329 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2330 if (gdbarch_debug
>= 2)
2331 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2332 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
2336 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2337 gdbarch_register_sim_regno_ftype register_sim_regno
)
2339 gdbarch
->register_sim_regno
= register_sim_regno
;
2343 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2345 gdb_assert (gdbarch
!= NULL
);
2346 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2347 if (gdbarch_debug
>= 2)
2348 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2349 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
2353 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2354 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2356 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2360 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2362 gdb_assert (gdbarch
!= NULL
);
2363 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2364 if (gdbarch_debug
>= 2)
2365 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2366 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
2370 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2371 gdbarch_cannot_store_register_ftype cannot_store_register
)
2373 gdbarch
->cannot_store_register
= cannot_store_register
;
2377 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2379 gdb_assert (gdbarch
!= NULL
);
2380 return gdbarch
->get_longjmp_target
!= NULL
;
2384 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
2386 gdb_assert (gdbarch
!= NULL
);
2387 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2388 if (gdbarch_debug
>= 2)
2389 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2390 return gdbarch
->get_longjmp_target (frame
, pc
);
2394 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2395 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2397 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2401 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2403 gdb_assert (gdbarch
!= NULL
);
2404 if (gdbarch_debug
>= 2)
2405 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2406 return gdbarch
->believe_pcc_promotion
;
2410 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2411 int believe_pcc_promotion
)
2413 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2417 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2419 gdb_assert (gdbarch
!= NULL
);
2420 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2421 if (gdbarch_debug
>= 2)
2422 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2423 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
2427 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2428 gdbarch_convert_register_p_ftype convert_register_p
)
2430 gdbarch
->convert_register_p
= convert_register_p
;
2434 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
, int *optimizedp
, int *unavailablep
)
2436 gdb_assert (gdbarch
!= NULL
);
2437 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2438 if (gdbarch_debug
>= 2)
2439 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2440 return gdbarch
->register_to_value (frame
, regnum
, type
, buf
, optimizedp
, unavailablep
);
2444 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2445 gdbarch_register_to_value_ftype register_to_value
)
2447 gdbarch
->register_to_value
= register_to_value
;
2451 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2453 gdb_assert (gdbarch
!= NULL
);
2454 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2455 if (gdbarch_debug
>= 2)
2456 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2457 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2461 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2462 gdbarch_value_to_register_ftype value_to_register
)
2464 gdbarch
->value_to_register
= value_to_register
;
2468 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2470 gdb_assert (gdbarch
!= NULL
);
2471 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2472 if (gdbarch_debug
>= 2)
2473 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2474 return gdbarch
->value_from_register (type
, regnum
, frame
);
2478 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2479 gdbarch_value_from_register_ftype value_from_register
)
2481 gdbarch
->value_from_register
= value_from_register
;
2485 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2487 gdb_assert (gdbarch
!= NULL
);
2488 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2489 if (gdbarch_debug
>= 2)
2490 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2491 return gdbarch
->pointer_to_address (gdbarch
, type
, buf
);
2495 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2496 gdbarch_pointer_to_address_ftype pointer_to_address
)
2498 gdbarch
->pointer_to_address
= pointer_to_address
;
2502 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2504 gdb_assert (gdbarch
!= NULL
);
2505 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2506 if (gdbarch_debug
>= 2)
2507 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2508 gdbarch
->address_to_pointer (gdbarch
, type
, buf
, addr
);
2512 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2513 gdbarch_address_to_pointer_ftype address_to_pointer
)
2515 gdbarch
->address_to_pointer
= address_to_pointer
;
2519 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2521 gdb_assert (gdbarch
!= NULL
);
2522 return gdbarch
->integer_to_address
!= NULL
;
2526 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2528 gdb_assert (gdbarch
!= NULL
);
2529 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2530 if (gdbarch_debug
>= 2)
2531 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2532 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2536 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2537 gdbarch_integer_to_address_ftype integer_to_address
)
2539 gdbarch
->integer_to_address
= integer_to_address
;
2543 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2545 gdb_assert (gdbarch
!= NULL
);
2546 return gdbarch
->return_value
!= NULL
;
2549 enum return_value_convention
2550 gdbarch_return_value (struct gdbarch
*gdbarch
, struct value
*function
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2552 gdb_assert (gdbarch
!= NULL
);
2553 gdb_assert (gdbarch
->return_value
!= NULL
);
2554 if (gdbarch_debug
>= 2)
2555 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2556 return gdbarch
->return_value (gdbarch
, function
, valtype
, regcache
, readbuf
, writebuf
);
2560 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2561 gdbarch_return_value_ftype return_value
)
2563 gdbarch
->return_value
= return_value
;
2567 gdbarch_return_in_first_hidden_param_p (struct gdbarch
*gdbarch
, struct type
*type
)
2569 gdb_assert (gdbarch
!= NULL
);
2570 gdb_assert (gdbarch
->return_in_first_hidden_param_p
!= NULL
);
2571 if (gdbarch_debug
>= 2)
2572 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_in_first_hidden_param_p called\n");
2573 return gdbarch
->return_in_first_hidden_param_p (gdbarch
, type
);
2577 set_gdbarch_return_in_first_hidden_param_p (struct gdbarch
*gdbarch
,
2578 gdbarch_return_in_first_hidden_param_p_ftype return_in_first_hidden_param_p
)
2580 gdbarch
->return_in_first_hidden_param_p
= return_in_first_hidden_param_p
;
2584 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2586 gdb_assert (gdbarch
!= NULL
);
2587 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2588 if (gdbarch_debug
>= 2)
2589 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2590 return gdbarch
->skip_prologue (gdbarch
, ip
);
2594 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2595 gdbarch_skip_prologue_ftype skip_prologue
)
2597 gdbarch
->skip_prologue
= skip_prologue
;
2601 gdbarch_skip_main_prologue_p (struct gdbarch
*gdbarch
)
2603 gdb_assert (gdbarch
!= NULL
);
2604 return gdbarch
->skip_main_prologue
!= NULL
;
2608 gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2610 gdb_assert (gdbarch
!= NULL
);
2611 gdb_assert (gdbarch
->skip_main_prologue
!= NULL
);
2612 if (gdbarch_debug
>= 2)
2613 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_main_prologue called\n");
2614 return gdbarch
->skip_main_prologue (gdbarch
, ip
);
2618 set_gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
,
2619 gdbarch_skip_main_prologue_ftype skip_main_prologue
)
2621 gdbarch
->skip_main_prologue
= skip_main_prologue
;
2625 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2627 gdb_assert (gdbarch
!= NULL
);
2628 gdb_assert (gdbarch
->inner_than
!= NULL
);
2629 if (gdbarch_debug
>= 2)
2630 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2631 return gdbarch
->inner_than (lhs
, rhs
);
2635 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2636 gdbarch_inner_than_ftype inner_than
)
2638 gdbarch
->inner_than
= inner_than
;
2642 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2644 gdb_assert (gdbarch
!= NULL
);
2645 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2646 if (gdbarch_debug
>= 2)
2647 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2648 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2652 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2653 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2655 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2659 gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *kindptr
)
2661 gdb_assert (gdbarch
!= NULL
);
2662 gdb_assert (gdbarch
->remote_breakpoint_from_pc
!= NULL
);
2663 if (gdbarch_debug
>= 2)
2664 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_breakpoint_from_pc called\n");
2665 gdbarch
->remote_breakpoint_from_pc (gdbarch
, pcptr
, kindptr
);
2669 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2670 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc
)
2672 gdbarch
->remote_breakpoint_from_pc
= remote_breakpoint_from_pc
;
2676 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2678 gdb_assert (gdbarch
!= NULL
);
2679 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2683 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2685 gdb_assert (gdbarch
!= NULL
);
2686 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2687 if (gdbarch_debug
>= 2)
2688 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2689 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2693 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2694 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2696 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2700 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2702 gdb_assert (gdbarch
!= NULL
);
2703 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2704 if (gdbarch_debug
>= 2)
2705 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2706 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2710 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2711 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2713 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2717 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2719 gdb_assert (gdbarch
!= NULL
);
2720 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2721 if (gdbarch_debug
>= 2)
2722 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2723 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2727 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2728 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2730 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2734 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2736 gdb_assert (gdbarch
!= NULL
);
2737 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2738 if (gdbarch_debug
>= 2)
2739 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2740 return gdbarch
->decr_pc_after_break
;
2744 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2745 CORE_ADDR decr_pc_after_break
)
2747 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2751 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2753 gdb_assert (gdbarch
!= NULL
);
2754 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2755 if (gdbarch_debug
>= 2)
2756 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2757 return gdbarch
->deprecated_function_start_offset
;
2761 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2762 CORE_ADDR deprecated_function_start_offset
)
2764 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2768 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2770 gdb_assert (gdbarch
!= NULL
);
2771 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2772 if (gdbarch_debug
>= 2)
2773 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2774 return gdbarch
->remote_register_number (gdbarch
, regno
);
2778 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2779 gdbarch_remote_register_number_ftype remote_register_number
)
2781 gdbarch
->remote_register_number
= remote_register_number
;
2785 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2787 gdb_assert (gdbarch
!= NULL
);
2788 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2792 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2794 gdb_assert (gdbarch
!= NULL
);
2795 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2796 if (gdbarch_debug
>= 2)
2797 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2798 return gdbarch
->fetch_tls_load_module_address (objfile
);
2802 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2803 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2805 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2809 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2811 gdb_assert (gdbarch
!= NULL
);
2812 /* Skip verify of frame_args_skip, invalid_p == 0 */
2813 if (gdbarch_debug
>= 2)
2814 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2815 return gdbarch
->frame_args_skip
;
2819 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2820 CORE_ADDR frame_args_skip
)
2822 gdbarch
->frame_args_skip
= frame_args_skip
;
2826 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2828 gdb_assert (gdbarch
!= NULL
);
2829 return gdbarch
->unwind_pc
!= NULL
;
2833 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2835 gdb_assert (gdbarch
!= NULL
);
2836 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2837 if (gdbarch_debug
>= 2)
2838 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2839 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2843 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2844 gdbarch_unwind_pc_ftype unwind_pc
)
2846 gdbarch
->unwind_pc
= unwind_pc
;
2850 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2852 gdb_assert (gdbarch
!= NULL
);
2853 return gdbarch
->unwind_sp
!= NULL
;
2857 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2859 gdb_assert (gdbarch
!= NULL
);
2860 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2861 if (gdbarch_debug
>= 2)
2862 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2863 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2867 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2868 gdbarch_unwind_sp_ftype unwind_sp
)
2870 gdbarch
->unwind_sp
= unwind_sp
;
2874 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2876 gdb_assert (gdbarch
!= NULL
);
2877 return gdbarch
->frame_num_args
!= NULL
;
2881 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2883 gdb_assert (gdbarch
!= NULL
);
2884 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2885 if (gdbarch_debug
>= 2)
2886 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2887 return gdbarch
->frame_num_args (frame
);
2891 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2892 gdbarch_frame_num_args_ftype frame_num_args
)
2894 gdbarch
->frame_num_args
= frame_num_args
;
2898 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2900 gdb_assert (gdbarch
!= NULL
);
2901 return gdbarch
->frame_align
!= NULL
;
2905 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2907 gdb_assert (gdbarch
!= NULL
);
2908 gdb_assert (gdbarch
->frame_align
!= NULL
);
2909 if (gdbarch_debug
>= 2)
2910 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2911 return gdbarch
->frame_align (gdbarch
, address
);
2915 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2916 gdbarch_frame_align_ftype frame_align
)
2918 gdbarch
->frame_align
= frame_align
;
2922 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2924 gdb_assert (gdbarch
!= NULL
);
2925 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2926 if (gdbarch_debug
>= 2)
2927 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2928 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2932 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2933 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2935 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2939 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2941 gdb_assert (gdbarch
!= NULL
);
2942 if (gdbarch_debug
>= 2)
2943 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2944 return gdbarch
->frame_red_zone_size
;
2948 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2949 int frame_red_zone_size
)
2951 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2955 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2957 gdb_assert (gdbarch
!= NULL
);
2958 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2959 if (gdbarch_debug
>= 2)
2960 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2961 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2965 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2966 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2968 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2972 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2974 gdb_assert (gdbarch
!= NULL
);
2975 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2976 if (gdbarch_debug
>= 2)
2977 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2978 return gdbarch
->addr_bits_remove (gdbarch
, addr
);
2982 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2983 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2985 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2989 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2991 gdb_assert (gdbarch
!= NULL
);
2992 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2993 if (gdbarch_debug
>= 2)
2994 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2995 return gdbarch
->smash_text_address (gdbarch
, addr
);
2999 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
3000 gdbarch_smash_text_address_ftype smash_text_address
)
3002 gdbarch
->smash_text_address
= smash_text_address
;
3006 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
3008 gdb_assert (gdbarch
!= NULL
);
3009 return gdbarch
->software_single_step
!= NULL
;
3013 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3015 gdb_assert (gdbarch
!= NULL
);
3016 gdb_assert (gdbarch
->software_single_step
!= NULL
);
3017 if (gdbarch_debug
>= 2)
3018 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
3019 return gdbarch
->software_single_step (frame
);
3023 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
3024 gdbarch_software_single_step_ftype software_single_step
)
3026 gdbarch
->software_single_step
= software_single_step
;
3030 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
3032 gdb_assert (gdbarch
!= NULL
);
3033 return gdbarch
->single_step_through_delay
!= NULL
;
3037 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3039 gdb_assert (gdbarch
!= NULL
);
3040 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
3041 if (gdbarch_debug
>= 2)
3042 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
3043 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
3047 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
3048 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
3050 gdbarch
->single_step_through_delay
= single_step_through_delay
;
3054 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
3056 gdb_assert (gdbarch
!= NULL
);
3057 gdb_assert (gdbarch
->print_insn
!= NULL
);
3058 if (gdbarch_debug
>= 2)
3059 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
3060 return gdbarch
->print_insn (vma
, info
);
3064 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
3065 gdbarch_print_insn_ftype print_insn
)
3067 gdbarch
->print_insn
= print_insn
;
3071 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
3073 gdb_assert (gdbarch
!= NULL
);
3074 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
3075 if (gdbarch_debug
>= 2)
3076 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
3077 return gdbarch
->skip_trampoline_code (frame
, pc
);
3081 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
3082 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
3084 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
3088 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3090 gdb_assert (gdbarch
!= NULL
);
3091 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
3092 if (gdbarch_debug
>= 2)
3093 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
3094 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
3098 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
3099 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
3101 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
3105 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, const char *name
)
3107 gdb_assert (gdbarch
!= NULL
);
3108 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
3109 if (gdbarch_debug
>= 2)
3110 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
3111 return gdbarch
->in_solib_return_trampoline (gdbarch
, pc
, name
);
3115 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
3116 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
3118 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
3122 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3124 gdb_assert (gdbarch
!= NULL
);
3125 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
3126 if (gdbarch_debug
>= 2)
3127 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
3128 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
3132 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
3133 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
3135 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
3139 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
3141 gdb_assert (gdbarch
!= NULL
);
3142 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
3143 if (gdbarch_debug
>= 2)
3144 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
3145 gdbarch
->elf_make_msymbol_special (sym
, msym
);
3149 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
3150 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
3152 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
3156 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
3158 gdb_assert (gdbarch
!= NULL
);
3159 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
3160 if (gdbarch_debug
>= 2)
3161 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
3162 gdbarch
->coff_make_msymbol_special (val
, msym
);
3166 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
3167 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
3169 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
3173 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
3175 gdb_assert (gdbarch
!= NULL
);
3176 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3177 if (gdbarch_debug
>= 2)
3178 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
3179 return gdbarch
->cannot_step_breakpoint
;
3183 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
3184 int cannot_step_breakpoint
)
3186 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
3190 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
3192 gdb_assert (gdbarch
!= NULL
);
3193 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3194 if (gdbarch_debug
>= 2)
3195 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
3196 return gdbarch
->have_nonsteppable_watchpoint
;
3200 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
3201 int have_nonsteppable_watchpoint
)
3203 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
3207 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
3209 gdb_assert (gdbarch
!= NULL
);
3210 return gdbarch
->address_class_type_flags
!= NULL
;
3214 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
3216 gdb_assert (gdbarch
!= NULL
);
3217 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
3218 if (gdbarch_debug
>= 2)
3219 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
3220 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
3224 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
3225 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
3227 gdbarch
->address_class_type_flags
= address_class_type_flags
;
3231 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
3233 gdb_assert (gdbarch
!= NULL
);
3234 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
3238 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
3240 gdb_assert (gdbarch
!= NULL
);
3241 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
3242 if (gdbarch_debug
>= 2)
3243 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
3244 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
3248 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
3249 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3251 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3255 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3257 gdb_assert (gdbarch
!= NULL
);
3258 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3262 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3264 gdb_assert (gdbarch
!= NULL
);
3265 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3266 if (gdbarch_debug
>= 2)
3267 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3268 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3272 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3273 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3275 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3279 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3281 gdb_assert (gdbarch
!= NULL
);
3282 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3283 if (gdbarch_debug
>= 2)
3284 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3285 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3289 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3290 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3292 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3296 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3298 gdb_assert (gdbarch
!= NULL
);
3299 return gdbarch
->fetch_pointer_argument
!= NULL
;
3303 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3305 gdb_assert (gdbarch
!= NULL
);
3306 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3307 if (gdbarch_debug
>= 2)
3308 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3309 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3313 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3314 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3316 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3320 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3322 gdb_assert (gdbarch
!= NULL
);
3323 return gdbarch
->regset_from_core_section
!= NULL
;
3326 const struct regset
*
3327 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3329 gdb_assert (gdbarch
!= NULL
);
3330 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3331 if (gdbarch_debug
>= 2)
3332 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3333 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3337 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3338 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3340 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3343 struct core_regset_section
*
3344 gdbarch_core_regset_sections (struct gdbarch
*gdbarch
)
3346 gdb_assert (gdbarch
!= NULL
);
3347 if (gdbarch_debug
>= 2)
3348 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_regset_sections called\n");
3349 return gdbarch
->core_regset_sections
;
3353 set_gdbarch_core_regset_sections (struct gdbarch
*gdbarch
,
3354 struct core_regset_section
* core_regset_sections
)
3356 gdbarch
->core_regset_sections
= core_regset_sections
;
3360 gdbarch_make_corefile_notes_p (struct gdbarch
*gdbarch
)
3362 gdb_assert (gdbarch
!= NULL
);
3363 return gdbarch
->make_corefile_notes
!= NULL
;
3367 gdbarch_make_corefile_notes (struct gdbarch
*gdbarch
, bfd
*obfd
, int *note_size
)
3369 gdb_assert (gdbarch
!= NULL
);
3370 gdb_assert (gdbarch
->make_corefile_notes
!= NULL
);
3371 if (gdbarch_debug
>= 2)
3372 fprintf_unfiltered (gdb_stdlog
, "gdbarch_make_corefile_notes called\n");
3373 return gdbarch
->make_corefile_notes (gdbarch
, obfd
, note_size
);
3377 set_gdbarch_make_corefile_notes (struct gdbarch
*gdbarch
,
3378 gdbarch_make_corefile_notes_ftype make_corefile_notes
)
3380 gdbarch
->make_corefile_notes
= make_corefile_notes
;
3384 gdbarch_find_memory_regions_p (struct gdbarch
*gdbarch
)
3386 gdb_assert (gdbarch
!= NULL
);
3387 return gdbarch
->find_memory_regions
!= NULL
;
3391 gdbarch_find_memory_regions (struct gdbarch
*gdbarch
, find_memory_region_ftype func
, void *data
)
3393 gdb_assert (gdbarch
!= NULL
);
3394 gdb_assert (gdbarch
->find_memory_regions
!= NULL
);
3395 if (gdbarch_debug
>= 2)
3396 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_memory_regions called\n");
3397 return gdbarch
->find_memory_regions (gdbarch
, func
, data
);
3401 set_gdbarch_find_memory_regions (struct gdbarch
*gdbarch
,
3402 gdbarch_find_memory_regions_ftype find_memory_regions
)
3404 gdbarch
->find_memory_regions
= find_memory_regions
;
3408 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
3410 gdb_assert (gdbarch
!= NULL
);
3411 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
3415 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
3417 gdb_assert (gdbarch
!= NULL
);
3418 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
3419 if (gdbarch_debug
>= 2)
3420 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
3421 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
3425 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
3426 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
3428 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
3432 gdbarch_core_pid_to_str_p (struct gdbarch
*gdbarch
)
3434 gdb_assert (gdbarch
!= NULL
);
3435 return gdbarch
->core_pid_to_str
!= NULL
;
3439 gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
, ptid_t ptid
)
3441 gdb_assert (gdbarch
!= NULL
);
3442 gdb_assert (gdbarch
->core_pid_to_str
!= NULL
);
3443 if (gdbarch_debug
>= 2)
3444 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_pid_to_str called\n");
3445 return gdbarch
->core_pid_to_str (gdbarch
, ptid
);
3449 set_gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
,
3450 gdbarch_core_pid_to_str_ftype core_pid_to_str
)
3452 gdbarch
->core_pid_to_str
= core_pid_to_str
;
3456 gdbarch_gcore_bfd_target_p (struct gdbarch
*gdbarch
)
3458 gdb_assert (gdbarch
!= NULL
);
3459 return gdbarch
->gcore_bfd_target
!= 0;
3463 gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
)
3465 gdb_assert (gdbarch
!= NULL
);
3466 /* Check variable changed from pre-default. */
3467 gdb_assert (gdbarch
->gcore_bfd_target
!= 0);
3468 if (gdbarch_debug
>= 2)
3469 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gcore_bfd_target called\n");
3470 return gdbarch
->gcore_bfd_target
;
3474 set_gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
,
3475 const char * gcore_bfd_target
)
3477 gdbarch
->gcore_bfd_target
= gcore_bfd_target
;
3481 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
3483 gdb_assert (gdbarch
!= NULL
);
3484 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3485 if (gdbarch_debug
>= 2)
3486 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
3487 return gdbarch
->vtable_function_descriptors
;
3491 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
3492 int vtable_function_descriptors
)
3494 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
3498 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
3500 gdb_assert (gdbarch
!= NULL
);
3501 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3502 if (gdbarch_debug
>= 2)
3503 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
3504 return gdbarch
->vbit_in_delta
;
3508 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
3511 gdbarch
->vbit_in_delta
= vbit_in_delta
;
3515 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
3517 gdb_assert (gdbarch
!= NULL
);
3518 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
3522 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
3524 gdb_assert (gdbarch
!= NULL
);
3525 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
3526 if (gdbarch_debug
>= 2)
3527 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
3528 gdbarch
->skip_permanent_breakpoint (regcache
);
3532 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3533 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3535 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3539 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
3541 gdb_assert (gdbarch
!= NULL
);
3542 return gdbarch
->max_insn_length
!= 0;
3546 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
3548 gdb_assert (gdbarch
!= NULL
);
3549 /* Check variable changed from pre-default. */
3550 gdb_assert (gdbarch
->max_insn_length
!= 0);
3551 if (gdbarch_debug
>= 2)
3552 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
3553 return gdbarch
->max_insn_length
;
3557 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
3558 ULONGEST max_insn_length
)
3560 gdbarch
->max_insn_length
= max_insn_length
;
3564 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
3566 gdb_assert (gdbarch
!= NULL
);
3567 return gdbarch
->displaced_step_copy_insn
!= NULL
;
3570 struct displaced_step_closure
*
3571 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3573 gdb_assert (gdbarch
!= NULL
);
3574 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
3575 if (gdbarch_debug
>= 2)
3576 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3577 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3581 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3582 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3584 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3588 gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3590 gdb_assert (gdbarch
!= NULL
);
3591 gdb_assert (gdbarch
->displaced_step_hw_singlestep
!= NULL
);
3592 if (gdbarch_debug
>= 2)
3593 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_hw_singlestep called\n");
3594 return gdbarch
->displaced_step_hw_singlestep (gdbarch
, closure
);
3598 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
,
3599 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep
)
3601 gdbarch
->displaced_step_hw_singlestep
= displaced_step_hw_singlestep
;
3605 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3607 gdb_assert (gdbarch
!= NULL
);
3608 return gdbarch
->displaced_step_fixup
!= NULL
;
3612 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3614 gdb_assert (gdbarch
!= NULL
);
3615 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3616 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3617 if (gdbarch_debug
>= 2)
3618 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3619 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3623 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3624 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3626 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3630 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3632 gdb_assert (gdbarch
!= NULL
);
3633 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3634 if (gdbarch_debug
>= 2)
3635 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3636 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3640 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3641 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3643 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3647 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3649 gdb_assert (gdbarch
!= NULL
);
3650 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3651 if (gdbarch_debug
>= 2)
3652 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3653 return gdbarch
->displaced_step_location (gdbarch
);
3657 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3658 gdbarch_displaced_step_location_ftype displaced_step_location
)
3660 gdbarch
->displaced_step_location
= displaced_step_location
;
3664 gdbarch_relocate_instruction_p (struct gdbarch
*gdbarch
)
3666 gdb_assert (gdbarch
!= NULL
);
3667 return gdbarch
->relocate_instruction
!= NULL
;
3671 gdbarch_relocate_instruction (struct gdbarch
*gdbarch
, CORE_ADDR
*to
, CORE_ADDR from
)
3673 gdb_assert (gdbarch
!= NULL
);
3674 gdb_assert (gdbarch
->relocate_instruction
!= NULL
);
3675 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3676 if (gdbarch_debug
>= 2)
3677 fprintf_unfiltered (gdb_stdlog
, "gdbarch_relocate_instruction called\n");
3678 gdbarch
->relocate_instruction (gdbarch
, to
, from
);
3682 set_gdbarch_relocate_instruction (struct gdbarch
*gdbarch
,
3683 gdbarch_relocate_instruction_ftype relocate_instruction
)
3685 gdbarch
->relocate_instruction
= relocate_instruction
;
3689 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3691 gdb_assert (gdbarch
!= NULL
);
3692 return gdbarch
->overlay_update
!= NULL
;
3696 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3698 gdb_assert (gdbarch
!= NULL
);
3699 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3700 if (gdbarch_debug
>= 2)
3701 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3702 gdbarch
->overlay_update (osect
);
3706 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3707 gdbarch_overlay_update_ftype overlay_update
)
3709 gdbarch
->overlay_update
= overlay_update
;
3713 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3715 gdb_assert (gdbarch
!= NULL
);
3716 return gdbarch
->core_read_description
!= NULL
;
3719 const struct target_desc
*
3720 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3722 gdb_assert (gdbarch
!= NULL
);
3723 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3724 if (gdbarch_debug
>= 2)
3725 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3726 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3730 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3731 gdbarch_core_read_description_ftype core_read_description
)
3733 gdbarch
->core_read_description
= core_read_description
;
3737 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3739 gdb_assert (gdbarch
!= NULL
);
3740 return gdbarch
->static_transform_name
!= NULL
;
3744 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, const char *name
)
3746 gdb_assert (gdbarch
!= NULL
);
3747 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3748 if (gdbarch_debug
>= 2)
3749 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3750 return gdbarch
->static_transform_name (name
);
3754 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3755 gdbarch_static_transform_name_ftype static_transform_name
)
3757 gdbarch
->static_transform_name
= static_transform_name
;
3761 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3763 gdb_assert (gdbarch
!= NULL
);
3764 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3765 if (gdbarch_debug
>= 2)
3766 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3767 return gdbarch
->sofun_address_maybe_missing
;
3771 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3772 int sofun_address_maybe_missing
)
3774 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3778 gdbarch_process_record_p (struct gdbarch
*gdbarch
)
3780 gdb_assert (gdbarch
!= NULL
);
3781 return gdbarch
->process_record
!= NULL
;
3785 gdbarch_process_record (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR addr
)
3787 gdb_assert (gdbarch
!= NULL
);
3788 gdb_assert (gdbarch
->process_record
!= NULL
);
3789 if (gdbarch_debug
>= 2)
3790 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record called\n");
3791 return gdbarch
->process_record (gdbarch
, regcache
, addr
);
3795 set_gdbarch_process_record (struct gdbarch
*gdbarch
,
3796 gdbarch_process_record_ftype process_record
)
3798 gdbarch
->process_record
= process_record
;
3802 gdbarch_process_record_signal_p (struct gdbarch
*gdbarch
)
3804 gdb_assert (gdbarch
!= NULL
);
3805 return gdbarch
->process_record_signal
!= NULL
;
3809 gdbarch_process_record_signal (struct gdbarch
*gdbarch
, struct regcache
*regcache
, enum gdb_signal signal
)
3811 gdb_assert (gdbarch
!= NULL
);
3812 gdb_assert (gdbarch
->process_record_signal
!= NULL
);
3813 if (gdbarch_debug
>= 2)
3814 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record_signal called\n");
3815 return gdbarch
->process_record_signal (gdbarch
, regcache
, signal
);
3819 set_gdbarch_process_record_signal (struct gdbarch
*gdbarch
,
3820 gdbarch_process_record_signal_ftype process_record_signal
)
3822 gdbarch
->process_record_signal
= process_record_signal
;
3826 gdbarch_gdb_signal_from_target_p (struct gdbarch
*gdbarch
)
3828 gdb_assert (gdbarch
!= NULL
);
3829 return gdbarch
->gdb_signal_from_target
!= NULL
;
3833 gdbarch_gdb_signal_from_target (struct gdbarch
*gdbarch
, int signo
)
3835 gdb_assert (gdbarch
!= NULL
);
3836 gdb_assert (gdbarch
->gdb_signal_from_target
!= NULL
);
3837 if (gdbarch_debug
>= 2)
3838 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gdb_signal_from_target called\n");
3839 return gdbarch
->gdb_signal_from_target (gdbarch
, signo
);
3843 set_gdbarch_gdb_signal_from_target (struct gdbarch
*gdbarch
,
3844 gdbarch_gdb_signal_from_target_ftype gdb_signal_from_target
)
3846 gdbarch
->gdb_signal_from_target
= gdb_signal_from_target
;
3850 gdbarch_get_siginfo_type_p (struct gdbarch
*gdbarch
)
3852 gdb_assert (gdbarch
!= NULL
);
3853 return gdbarch
->get_siginfo_type
!= NULL
;
3857 gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
)
3859 gdb_assert (gdbarch
!= NULL
);
3860 gdb_assert (gdbarch
->get_siginfo_type
!= NULL
);
3861 if (gdbarch_debug
>= 2)
3862 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_siginfo_type called\n");
3863 return gdbarch
->get_siginfo_type (gdbarch
);
3867 set_gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
,
3868 gdbarch_get_siginfo_type_ftype get_siginfo_type
)
3870 gdbarch
->get_siginfo_type
= get_siginfo_type
;
3874 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3876 gdb_assert (gdbarch
!= NULL
);
3877 return gdbarch
->record_special_symbol
!= NULL
;
3881 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3883 gdb_assert (gdbarch
!= NULL
);
3884 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3885 if (gdbarch_debug
>= 2)
3886 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3887 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3891 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3892 gdbarch_record_special_symbol_ftype record_special_symbol
)
3894 gdbarch
->record_special_symbol
= record_special_symbol
;
3898 gdbarch_get_syscall_number_p (struct gdbarch
*gdbarch
)
3900 gdb_assert (gdbarch
!= NULL
);
3901 return gdbarch
->get_syscall_number
!= NULL
;
3905 gdbarch_get_syscall_number (struct gdbarch
*gdbarch
, ptid_t ptid
)
3907 gdb_assert (gdbarch
!= NULL
);
3908 gdb_assert (gdbarch
->get_syscall_number
!= NULL
);
3909 if (gdbarch_debug
>= 2)
3910 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_syscall_number called\n");
3911 return gdbarch
->get_syscall_number (gdbarch
, ptid
);
3915 set_gdbarch_get_syscall_number (struct gdbarch
*gdbarch
,
3916 gdbarch_get_syscall_number_ftype get_syscall_number
)
3918 gdbarch
->get_syscall_number
= get_syscall_number
;
3922 gdbarch_stap_integer_prefix (struct gdbarch
*gdbarch
)
3924 gdb_assert (gdbarch
!= NULL
);
3925 /* Skip verify of stap_integer_prefix, invalid_p == 0 */
3926 if (gdbarch_debug
>= 2)
3927 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_integer_prefix called\n");
3928 return gdbarch
->stap_integer_prefix
;
3932 set_gdbarch_stap_integer_prefix (struct gdbarch
*gdbarch
,
3933 const char * stap_integer_prefix
)
3935 gdbarch
->stap_integer_prefix
= stap_integer_prefix
;
3939 gdbarch_stap_integer_suffix (struct gdbarch
*gdbarch
)
3941 gdb_assert (gdbarch
!= NULL
);
3942 /* Skip verify of stap_integer_suffix, invalid_p == 0 */
3943 if (gdbarch_debug
>= 2)
3944 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_integer_suffix called\n");
3945 return gdbarch
->stap_integer_suffix
;
3949 set_gdbarch_stap_integer_suffix (struct gdbarch
*gdbarch
,
3950 const char * stap_integer_suffix
)
3952 gdbarch
->stap_integer_suffix
= stap_integer_suffix
;
3956 gdbarch_stap_register_prefix (struct gdbarch
*gdbarch
)
3958 gdb_assert (gdbarch
!= NULL
);
3959 /* Skip verify of stap_register_prefix, invalid_p == 0 */
3960 if (gdbarch_debug
>= 2)
3961 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_prefix called\n");
3962 return gdbarch
->stap_register_prefix
;
3966 set_gdbarch_stap_register_prefix (struct gdbarch
*gdbarch
,
3967 const char * stap_register_prefix
)
3969 gdbarch
->stap_register_prefix
= stap_register_prefix
;
3973 gdbarch_stap_register_suffix (struct gdbarch
*gdbarch
)
3975 gdb_assert (gdbarch
!= NULL
);
3976 /* Skip verify of stap_register_suffix, invalid_p == 0 */
3977 if (gdbarch_debug
>= 2)
3978 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_suffix called\n");
3979 return gdbarch
->stap_register_suffix
;
3983 set_gdbarch_stap_register_suffix (struct gdbarch
*gdbarch
,
3984 const char * stap_register_suffix
)
3986 gdbarch
->stap_register_suffix
= stap_register_suffix
;
3990 gdbarch_stap_register_indirection_prefix (struct gdbarch
*gdbarch
)
3992 gdb_assert (gdbarch
!= NULL
);
3993 /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */
3994 if (gdbarch_debug
>= 2)
3995 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_indirection_prefix called\n");
3996 return gdbarch
->stap_register_indirection_prefix
;
4000 set_gdbarch_stap_register_indirection_prefix (struct gdbarch
*gdbarch
,
4001 const char * stap_register_indirection_prefix
)
4003 gdbarch
->stap_register_indirection_prefix
= stap_register_indirection_prefix
;
4007 gdbarch_stap_register_indirection_suffix (struct gdbarch
*gdbarch
)
4009 gdb_assert (gdbarch
!= NULL
);
4010 /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */
4011 if (gdbarch_debug
>= 2)
4012 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_indirection_suffix called\n");
4013 return gdbarch
->stap_register_indirection_suffix
;
4017 set_gdbarch_stap_register_indirection_suffix (struct gdbarch
*gdbarch
,
4018 const char * stap_register_indirection_suffix
)
4020 gdbarch
->stap_register_indirection_suffix
= stap_register_indirection_suffix
;
4024 gdbarch_stap_gdb_register_prefix (struct gdbarch
*gdbarch
)
4026 gdb_assert (gdbarch
!= NULL
);
4027 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
4028 if (gdbarch_debug
>= 2)
4029 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_gdb_register_prefix called\n");
4030 return gdbarch
->stap_gdb_register_prefix
;
4034 set_gdbarch_stap_gdb_register_prefix (struct gdbarch
*gdbarch
,
4035 const char * stap_gdb_register_prefix
)
4037 gdbarch
->stap_gdb_register_prefix
= stap_gdb_register_prefix
;
4041 gdbarch_stap_gdb_register_suffix (struct gdbarch
*gdbarch
)
4043 gdb_assert (gdbarch
!= NULL
);
4044 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
4045 if (gdbarch_debug
>= 2)
4046 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_gdb_register_suffix called\n");
4047 return gdbarch
->stap_gdb_register_suffix
;
4051 set_gdbarch_stap_gdb_register_suffix (struct gdbarch
*gdbarch
,
4052 const char * stap_gdb_register_suffix
)
4054 gdbarch
->stap_gdb_register_suffix
= stap_gdb_register_suffix
;
4058 gdbarch_stap_is_single_operand_p (struct gdbarch
*gdbarch
)
4060 gdb_assert (gdbarch
!= NULL
);
4061 return gdbarch
->stap_is_single_operand
!= NULL
;
4065 gdbarch_stap_is_single_operand (struct gdbarch
*gdbarch
, const char *s
)
4067 gdb_assert (gdbarch
!= NULL
);
4068 gdb_assert (gdbarch
->stap_is_single_operand
!= NULL
);
4069 if (gdbarch_debug
>= 2)
4070 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_is_single_operand called\n");
4071 return gdbarch
->stap_is_single_operand (gdbarch
, s
);
4075 set_gdbarch_stap_is_single_operand (struct gdbarch
*gdbarch
,
4076 gdbarch_stap_is_single_operand_ftype stap_is_single_operand
)
4078 gdbarch
->stap_is_single_operand
= stap_is_single_operand
;
4082 gdbarch_stap_parse_special_token_p (struct gdbarch
*gdbarch
)
4084 gdb_assert (gdbarch
!= NULL
);
4085 return gdbarch
->stap_parse_special_token
!= NULL
;
4089 gdbarch_stap_parse_special_token (struct gdbarch
*gdbarch
, struct stap_parse_info
*p
)
4091 gdb_assert (gdbarch
!= NULL
);
4092 gdb_assert (gdbarch
->stap_parse_special_token
!= NULL
);
4093 if (gdbarch_debug
>= 2)
4094 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_parse_special_token called\n");
4095 return gdbarch
->stap_parse_special_token (gdbarch
, p
);
4099 set_gdbarch_stap_parse_special_token (struct gdbarch
*gdbarch
,
4100 gdbarch_stap_parse_special_token_ftype stap_parse_special_token
)
4102 gdbarch
->stap_parse_special_token
= stap_parse_special_token
;
4106 gdbarch_has_global_solist (struct gdbarch
*gdbarch
)
4108 gdb_assert (gdbarch
!= NULL
);
4109 /* Skip verify of has_global_solist, invalid_p == 0 */
4110 if (gdbarch_debug
>= 2)
4111 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_solist called\n");
4112 return gdbarch
->has_global_solist
;
4116 set_gdbarch_has_global_solist (struct gdbarch
*gdbarch
,
4117 int has_global_solist
)
4119 gdbarch
->has_global_solist
= has_global_solist
;
4123 gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
)
4125 gdb_assert (gdbarch
!= NULL
);
4126 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
4127 if (gdbarch_debug
>= 2)
4128 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_breakpoints called\n");
4129 return gdbarch
->has_global_breakpoints
;
4133 set_gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
,
4134 int has_global_breakpoints
)
4136 gdbarch
->has_global_breakpoints
= has_global_breakpoints
;
4140 gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
)
4142 gdb_assert (gdbarch
!= NULL
);
4143 gdb_assert (gdbarch
->has_shared_address_space
!= NULL
);
4144 if (gdbarch_debug
>= 2)
4145 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_shared_address_space called\n");
4146 return gdbarch
->has_shared_address_space (gdbarch
);
4150 set_gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
,
4151 gdbarch_has_shared_address_space_ftype has_shared_address_space
)
4153 gdbarch
->has_shared_address_space
= has_shared_address_space
;
4157 gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
, CORE_ADDR addr
, int *isize
, char **msg
)
4159 gdb_assert (gdbarch
!= NULL
);
4160 gdb_assert (gdbarch
->fast_tracepoint_valid_at
!= NULL
);
4161 if (gdbarch_debug
>= 2)
4162 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fast_tracepoint_valid_at called\n");
4163 return gdbarch
->fast_tracepoint_valid_at (gdbarch
, addr
, isize
, msg
);
4167 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
,
4168 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at
)
4170 gdbarch
->fast_tracepoint_valid_at
= fast_tracepoint_valid_at
;
4174 gdbarch_auto_charset (struct gdbarch
*gdbarch
)
4176 gdb_assert (gdbarch
!= NULL
);
4177 gdb_assert (gdbarch
->auto_charset
!= NULL
);
4178 if (gdbarch_debug
>= 2)
4179 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_charset called\n");
4180 return gdbarch
->auto_charset ();
4184 set_gdbarch_auto_charset (struct gdbarch
*gdbarch
,
4185 gdbarch_auto_charset_ftype auto_charset
)
4187 gdbarch
->auto_charset
= auto_charset
;
4191 gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
)
4193 gdb_assert (gdbarch
!= NULL
);
4194 gdb_assert (gdbarch
->auto_wide_charset
!= NULL
);
4195 if (gdbarch_debug
>= 2)
4196 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_wide_charset called\n");
4197 return gdbarch
->auto_wide_charset ();
4201 set_gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
,
4202 gdbarch_auto_wide_charset_ftype auto_wide_charset
)
4204 gdbarch
->auto_wide_charset
= auto_wide_charset
;
4208 gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
)
4210 gdb_assert (gdbarch
!= NULL
);
4211 if (gdbarch_debug
>= 2)
4212 fprintf_unfiltered (gdb_stdlog
, "gdbarch_solib_symbols_extension called\n");
4213 return gdbarch
->solib_symbols_extension
;
4217 set_gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
,
4218 const char * solib_symbols_extension
)
4220 gdbarch
->solib_symbols_extension
= solib_symbols_extension
;
4224 gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
)
4226 gdb_assert (gdbarch
!= NULL
);
4227 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
4228 if (gdbarch_debug
>= 2)
4229 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_dos_based_file_system called\n");
4230 return gdbarch
->has_dos_based_file_system
;
4234 set_gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
,
4235 int has_dos_based_file_system
)
4237 gdbarch
->has_dos_based_file_system
= has_dos_based_file_system
;
4241 gdbarch_gen_return_address (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, struct axs_value
*value
, CORE_ADDR scope
)
4243 gdb_assert (gdbarch
!= NULL
);
4244 gdb_assert (gdbarch
->gen_return_address
!= NULL
);
4245 if (gdbarch_debug
>= 2)
4246 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gen_return_address called\n");
4247 gdbarch
->gen_return_address (gdbarch
, ax
, value
, scope
);
4251 set_gdbarch_gen_return_address (struct gdbarch
*gdbarch
,
4252 gdbarch_gen_return_address_ftype gen_return_address
)
4254 gdbarch
->gen_return_address
= gen_return_address
;
4258 gdbarch_info_proc_p (struct gdbarch
*gdbarch
)
4260 gdb_assert (gdbarch
!= NULL
);
4261 return gdbarch
->info_proc
!= NULL
;
4265 gdbarch_info_proc (struct gdbarch
*gdbarch
, char *args
, enum info_proc_what what
)
4267 gdb_assert (gdbarch
!= NULL
);
4268 gdb_assert (gdbarch
->info_proc
!= NULL
);
4269 if (gdbarch_debug
>= 2)
4270 fprintf_unfiltered (gdb_stdlog
, "gdbarch_info_proc called\n");
4271 gdbarch
->info_proc (gdbarch
, args
, what
);
4275 set_gdbarch_info_proc (struct gdbarch
*gdbarch
,
4276 gdbarch_info_proc_ftype info_proc
)
4278 gdbarch
->info_proc
= info_proc
;
4282 gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch
*gdbarch
, iterate_over_objfiles_in_search_order_cb_ftype
*cb
, void *cb_data
, struct objfile
*current_objfile
)
4284 gdb_assert (gdbarch
!= NULL
);
4285 gdb_assert (gdbarch
->iterate_over_objfiles_in_search_order
!= NULL
);
4286 if (gdbarch_debug
>= 2)
4287 fprintf_unfiltered (gdb_stdlog
, "gdbarch_iterate_over_objfiles_in_search_order called\n");
4288 gdbarch
->iterate_over_objfiles_in_search_order (gdbarch
, cb
, cb_data
, current_objfile
);
4292 set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch
*gdbarch
,
4293 gdbarch_iterate_over_objfiles_in_search_order_ftype iterate_over_objfiles_in_search_order
)
4295 gdbarch
->iterate_over_objfiles_in_search_order
= iterate_over_objfiles_in_search_order
;
4299 /* Keep a registry of per-architecture data-pointers required by GDB
4306 gdbarch_data_pre_init_ftype
*pre_init
;
4307 gdbarch_data_post_init_ftype
*post_init
;
4310 struct gdbarch_data_registration
4312 struct gdbarch_data
*data
;
4313 struct gdbarch_data_registration
*next
;
4316 struct gdbarch_data_registry
4319 struct gdbarch_data_registration
*registrations
;
4322 struct gdbarch_data_registry gdbarch_data_registry
=
4327 static struct gdbarch_data
*
4328 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
4329 gdbarch_data_post_init_ftype
*post_init
)
4331 struct gdbarch_data_registration
**curr
;
4333 /* Append the new registration. */
4334 for (curr
= &gdbarch_data_registry
.registrations
;
4336 curr
= &(*curr
)->next
);
4337 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
4338 (*curr
)->next
= NULL
;
4339 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
4340 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
4341 (*curr
)->data
->pre_init
= pre_init
;
4342 (*curr
)->data
->post_init
= post_init
;
4343 (*curr
)->data
->init_p
= 1;
4344 return (*curr
)->data
;
4347 struct gdbarch_data
*
4348 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
4350 return gdbarch_data_register (pre_init
, NULL
);
4353 struct gdbarch_data
*
4354 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
4356 return gdbarch_data_register (NULL
, post_init
);
4359 /* Create/delete the gdbarch data vector. */
4362 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
4364 gdb_assert (gdbarch
->data
== NULL
);
4365 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
4366 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
4369 /* Initialize the current value of the specified per-architecture
4373 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
4374 struct gdbarch_data
*data
,
4377 gdb_assert (data
->index
< gdbarch
->nr_data
);
4378 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
4379 gdb_assert (data
->pre_init
== NULL
);
4380 gdbarch
->data
[data
->index
] = pointer
;
4383 /* Return the current value of the specified per-architecture
4387 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
4389 gdb_assert (data
->index
< gdbarch
->nr_data
);
4390 if (gdbarch
->data
[data
->index
] == NULL
)
4392 /* The data-pointer isn't initialized, call init() to get a
4394 if (data
->pre_init
!= NULL
)
4395 /* Mid architecture creation: pass just the obstack, and not
4396 the entire architecture, as that way it isn't possible for
4397 pre-init code to refer to undefined architecture
4399 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
4400 else if (gdbarch
->initialized_p
4401 && data
->post_init
!= NULL
)
4402 /* Post architecture creation: pass the entire architecture
4403 (as all fields are valid), but be careful to also detect
4404 recursive references. */
4406 gdb_assert (data
->init_p
);
4408 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
4412 /* The architecture initialization hasn't completed - punt -
4413 hope that the caller knows what they are doing. Once
4414 deprecated_set_gdbarch_data has been initialized, this can be
4415 changed to an internal error. */
4417 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
4419 return gdbarch
->data
[data
->index
];
4423 /* Keep a registry of the architectures known by GDB. */
4425 struct gdbarch_registration
4427 enum bfd_architecture bfd_architecture
;
4428 gdbarch_init_ftype
*init
;
4429 gdbarch_dump_tdep_ftype
*dump_tdep
;
4430 struct gdbarch_list
*arches
;
4431 struct gdbarch_registration
*next
;
4434 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
4437 append_name (const char ***buf
, int *nr
, const char *name
)
4439 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
4445 gdbarch_printable_names (void)
4447 /* Accumulate a list of names based on the registed list of
4450 const char **arches
= NULL
;
4451 struct gdbarch_registration
*rego
;
4453 for (rego
= gdbarch_registry
;
4457 const struct bfd_arch_info
*ap
;
4458 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
4460 internal_error (__FILE__
, __LINE__
,
4461 _("gdbarch_architecture_names: multi-arch unknown"));
4464 append_name (&arches
, &nr_arches
, ap
->printable_name
);
4469 append_name (&arches
, &nr_arches
, NULL
);
4475 gdbarch_register (enum bfd_architecture bfd_architecture
,
4476 gdbarch_init_ftype
*init
,
4477 gdbarch_dump_tdep_ftype
*dump_tdep
)
4479 struct gdbarch_registration
**curr
;
4480 const struct bfd_arch_info
*bfd_arch_info
;
4482 /* Check that BFD recognizes this architecture */
4483 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
4484 if (bfd_arch_info
== NULL
)
4486 internal_error (__FILE__
, __LINE__
,
4487 _("gdbarch: Attempt to register "
4488 "unknown architecture (%d)"),
4491 /* Check that we haven't seen this architecture before. */
4492 for (curr
= &gdbarch_registry
;
4494 curr
= &(*curr
)->next
)
4496 if (bfd_architecture
== (*curr
)->bfd_architecture
)
4497 internal_error (__FILE__
, __LINE__
,
4498 _("gdbarch: Duplicate registration "
4499 "of architecture (%s)"),
4500 bfd_arch_info
->printable_name
);
4504 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, %s)\n",
4505 bfd_arch_info
->printable_name
,
4506 host_address_to_string (init
));
4508 (*curr
) = XMALLOC (struct gdbarch_registration
);
4509 (*curr
)->bfd_architecture
= bfd_architecture
;
4510 (*curr
)->init
= init
;
4511 (*curr
)->dump_tdep
= dump_tdep
;
4512 (*curr
)->arches
= NULL
;
4513 (*curr
)->next
= NULL
;
4517 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
4518 gdbarch_init_ftype
*init
)
4520 gdbarch_register (bfd_architecture
, init
, NULL
);
4524 /* Look for an architecture using gdbarch_info. */
4526 struct gdbarch_list
*
4527 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
4528 const struct gdbarch_info
*info
)
4530 for (; arches
!= NULL
; arches
= arches
->next
)
4532 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
4534 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4536 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4538 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
4546 /* Find an architecture that matches the specified INFO. Create a new
4547 architecture if needed. Return that new architecture. */
4550 gdbarch_find_by_info (struct gdbarch_info info
)
4552 struct gdbarch
*new_gdbarch
;
4553 struct gdbarch_registration
*rego
;
4555 /* Fill in missing parts of the INFO struct using a number of
4556 sources: "set ..."; INFOabfd supplied; and the global
4558 gdbarch_info_fill (&info
);
4560 /* Must have found some sort of architecture. */
4561 gdb_assert (info
.bfd_arch_info
!= NULL
);
4565 fprintf_unfiltered (gdb_stdlog
,
4566 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
4567 (info
.bfd_arch_info
!= NULL
4568 ? info
.bfd_arch_info
->printable_name
4570 fprintf_unfiltered (gdb_stdlog
,
4571 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
4573 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4574 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4576 fprintf_unfiltered (gdb_stdlog
,
4577 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4578 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4579 fprintf_unfiltered (gdb_stdlog
,
4580 "gdbarch_find_by_info: info.abfd %s\n",
4581 host_address_to_string (info
.abfd
));
4582 fprintf_unfiltered (gdb_stdlog
,
4583 "gdbarch_find_by_info: info.tdep_info %s\n",
4584 host_address_to_string (info
.tdep_info
));
4587 /* Find the tdep code that knows about this architecture. */
4588 for (rego
= gdbarch_registry
;
4591 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4596 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4597 "No matching architecture\n");
4601 /* Ask the tdep code for an architecture that matches "info". */
4602 new_gdbarch
= rego
->init (info
, rego
->arches
);
4604 /* Did the tdep code like it? No. Reject the change and revert to
4605 the old architecture. */
4606 if (new_gdbarch
== NULL
)
4609 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4610 "Target rejected architecture\n");
4614 /* Is this a pre-existing architecture (as determined by already
4615 being initialized)? Move it to the front of the architecture
4616 list (keeping the list sorted Most Recently Used). */
4617 if (new_gdbarch
->initialized_p
)
4619 struct gdbarch_list
**list
;
4620 struct gdbarch_list
*this;
4622 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4623 "Previous architecture %s (%s) selected\n",
4624 host_address_to_string (new_gdbarch
),
4625 new_gdbarch
->bfd_arch_info
->printable_name
);
4626 /* Find the existing arch in the list. */
4627 for (list
= ®o
->arches
;
4628 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4629 list
= &(*list
)->next
);
4630 /* It had better be in the list of architectures. */
4631 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4634 (*list
) = this->next
;
4635 /* Insert THIS at the front. */
4636 this->next
= rego
->arches
;
4637 rego
->arches
= this;
4642 /* It's a new architecture. */
4644 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4645 "New architecture %s (%s) selected\n",
4646 host_address_to_string (new_gdbarch
),
4647 new_gdbarch
->bfd_arch_info
->printable_name
);
4649 /* Insert the new architecture into the front of the architecture
4650 list (keep the list sorted Most Recently Used). */
4652 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4653 this->next
= rego
->arches
;
4654 this->gdbarch
= new_gdbarch
;
4655 rego
->arches
= this;
4658 /* Check that the newly installed architecture is valid. Plug in
4659 any post init values. */
4660 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4661 verify_gdbarch (new_gdbarch
);
4662 new_gdbarch
->initialized_p
= 1;
4665 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4670 /* Make the specified architecture current. */
4673 deprecated_target_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4675 gdb_assert (new_gdbarch
!= NULL
);
4676 gdb_assert (new_gdbarch
->initialized_p
);
4677 target_gdbarch
= new_gdbarch
;
4678 observer_notify_architecture_changed (new_gdbarch
);
4679 registers_changed ();
4682 extern void _initialize_gdbarch (void);
4685 _initialize_gdbarch (void)
4687 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
4688 Set architecture debugging."), _("\
4689 Show architecture debugging."), _("\
4690 When non-zero, architecture debugging is enabled."),
4693 &setdebuglist
, &showdebuglist
);