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 unsigned 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 /* Multi-arch values.
118 When extending this structure you must:
122 Declare set/get functions and define the corresponding
125 gdbarch_alloc(): If zero/NULL is not a suitable default,
126 initialize the new field.
128 verify_gdbarch(): Confirm that the target updated the field
131 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
134 ``startup_gdbarch()'': Append an initial value to the static
135 variable (base values on the host's c-type system).
137 get_gdbarch(): Implement the set/get functions (probably using
138 the macro's as shortcuts).
147 int long_long_align_bit
;
149 const struct floatformat
** half_format
;
151 const struct floatformat
** float_format
;
153 const struct floatformat
** double_format
;
155 const struct floatformat
** long_double_format
;
158 int dwarf2_addr_size
;
160 gdbarch_read_pc_ftype
*read_pc
;
161 gdbarch_write_pc_ftype
*write_pc
;
162 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
163 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
164 gdbarch_pseudo_register_read_value_ftype
*pseudo_register_read_value
;
165 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
168 gdbarch_ax_pseudo_register_collect_ftype
*ax_pseudo_register_collect
;
169 gdbarch_ax_pseudo_register_push_stack_ftype
*ax_pseudo_register_push_stack
;
174 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
175 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
176 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
177 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
178 gdbarch_register_name_ftype
*register_name
;
179 gdbarch_register_type_ftype
*register_type
;
180 gdbarch_dummy_id_ftype
*dummy_id
;
181 int deprecated_fp_regnum
;
182 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
183 int call_dummy_location
;
184 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
185 gdbarch_print_registers_info_ftype
*print_registers_info
;
186 gdbarch_print_float_info_ftype
*print_float_info
;
187 gdbarch_print_vector_info_ftype
*print_vector_info
;
188 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
189 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
190 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
191 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
192 int believe_pcc_promotion
;
193 gdbarch_convert_register_p_ftype
*convert_register_p
;
194 gdbarch_register_to_value_ftype
*register_to_value
;
195 gdbarch_value_to_register_ftype
*value_to_register
;
196 gdbarch_value_from_register_ftype
*value_from_register
;
197 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
198 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
199 gdbarch_integer_to_address_ftype
*integer_to_address
;
200 gdbarch_return_value_ftype
*return_value
;
201 gdbarch_return_in_first_hidden_param_p_ftype
*return_in_first_hidden_param_p
;
202 gdbarch_skip_prologue_ftype
*skip_prologue
;
203 gdbarch_skip_main_prologue_ftype
*skip_main_prologue
;
204 gdbarch_inner_than_ftype
*inner_than
;
205 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
206 gdbarch_remote_breakpoint_from_pc_ftype
*remote_breakpoint_from_pc
;
207 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
208 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
209 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
210 CORE_ADDR decr_pc_after_break
;
211 CORE_ADDR deprecated_function_start_offset
;
212 gdbarch_remote_register_number_ftype
*remote_register_number
;
213 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
214 CORE_ADDR frame_args_skip
;
215 gdbarch_unwind_pc_ftype
*unwind_pc
;
216 gdbarch_unwind_sp_ftype
*unwind_sp
;
217 gdbarch_frame_num_args_ftype
*frame_num_args
;
218 gdbarch_frame_align_ftype
*frame_align
;
219 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
220 int frame_red_zone_size
;
221 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
222 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
223 gdbarch_software_single_step_ftype
*software_single_step
;
224 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
225 gdbarch_print_insn_ftype
*print_insn
;
226 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
227 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
228 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
229 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
230 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
231 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
232 int cannot_step_breakpoint
;
233 int have_nonsteppable_watchpoint
;
234 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
235 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
236 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
237 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
238 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
239 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
240 struct core_regset_section
* core_regset_sections
;
241 gdbarch_make_corefile_notes_ftype
*make_corefile_notes
;
242 gdbarch_find_memory_regions_ftype
*find_memory_regions
;
243 gdbarch_core_xfer_shared_libraries_ftype
*core_xfer_shared_libraries
;
244 gdbarch_core_pid_to_str_ftype
*core_pid_to_str
;
245 const char * gcore_bfd_target
;
246 int vtable_function_descriptors
;
248 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
249 ULONGEST max_insn_length
;
250 gdbarch_displaced_step_copy_insn_ftype
*displaced_step_copy_insn
;
251 gdbarch_displaced_step_hw_singlestep_ftype
*displaced_step_hw_singlestep
;
252 gdbarch_displaced_step_fixup_ftype
*displaced_step_fixup
;
253 gdbarch_displaced_step_free_closure_ftype
*displaced_step_free_closure
;
254 gdbarch_displaced_step_location_ftype
*displaced_step_location
;
255 gdbarch_relocate_instruction_ftype
*relocate_instruction
;
256 gdbarch_overlay_update_ftype
*overlay_update
;
257 gdbarch_core_read_description_ftype
*core_read_description
;
258 gdbarch_static_transform_name_ftype
*static_transform_name
;
259 int sofun_address_maybe_missing
;
260 gdbarch_process_record_ftype
*process_record
;
261 gdbarch_process_record_signal_ftype
*process_record_signal
;
262 gdbarch_gdb_signal_from_target_ftype
*gdb_signal_from_target
;
263 gdbarch_get_siginfo_type_ftype
*get_siginfo_type
;
264 gdbarch_record_special_symbol_ftype
*record_special_symbol
;
265 gdbarch_get_syscall_number_ftype
*get_syscall_number
;
266 const char * stap_integer_prefix
;
267 const char * stap_integer_suffix
;
268 const char * stap_register_prefix
;
269 const char * stap_register_suffix
;
270 const char * stap_register_indirection_prefix
;
271 const char * stap_register_indirection_suffix
;
272 const char * stap_gdb_register_prefix
;
273 const char * stap_gdb_register_suffix
;
274 gdbarch_stap_is_single_operand_ftype
*stap_is_single_operand
;
275 gdbarch_stap_parse_special_token_ftype
*stap_parse_special_token
;
276 int has_global_solist
;
277 int has_global_breakpoints
;
278 gdbarch_has_shared_address_space_ftype
*has_shared_address_space
;
279 gdbarch_fast_tracepoint_valid_at_ftype
*fast_tracepoint_valid_at
;
280 gdbarch_auto_charset_ftype
*auto_charset
;
281 gdbarch_auto_wide_charset_ftype
*auto_wide_charset
;
282 const char * solib_symbols_extension
;
283 int has_dos_based_file_system
;
284 gdbarch_gen_return_address_ftype
*gen_return_address
;
285 gdbarch_info_proc_ftype
*info_proc
;
286 gdbarch_core_info_proc_ftype
*core_info_proc
;
287 gdbarch_iterate_over_objfiles_in_search_order_ftype
*iterate_over_objfiles_in_search_order
;
288 struct ravenscar_arch_ops
* ravenscar_ops
;
292 /* The default architecture uses host values (for want of a better
295 extern const struct bfd_arch_info bfd_default_arch_struct
;
297 struct gdbarch startup_gdbarch
=
299 1, /* Always initialized. */
300 NULL
, /* The obstack. */
301 /* basic architecture information. */
302 &bfd_default_arch_struct
, /* bfd_arch_info */
303 BFD_ENDIAN_BIG
, /* byte_order */
304 BFD_ENDIAN_BIG
, /* byte_order_for_code */
305 GDB_OSABI_UNKNOWN
, /* osabi */
307 /* target specific vector and its dump routine. */
309 /*per-architecture data-pointers. */
311 /* Multi-arch values */
312 1, /* bits_big_endian */
313 8 * sizeof (short), /* short_bit */
314 8 * sizeof (int), /* int_bit */
315 8 * sizeof (long), /* long_bit */
316 8 * sizeof (LONGEST
), /* long_long_bit */
317 8 * sizeof (LONGEST
), /* long_long_align_bit */
320 8 * sizeof (float), /* float_bit */
321 0, /* float_format */
322 8 * sizeof (double), /* double_bit */
323 0, /* double_format */
324 8 * sizeof (long double), /* long_double_bit */
325 0, /* long_double_format */
326 8 * sizeof (void*), /* ptr_bit */
327 8 * sizeof (void*), /* addr_bit */
328 sizeof (void*), /* dwarf2_addr_size */
332 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
333 0, /* pseudo_register_read */
334 0, /* pseudo_register_read_value */
335 0, /* pseudo_register_write */
337 0, /* num_pseudo_regs */
338 0, /* ax_pseudo_register_collect */
339 0, /* ax_pseudo_register_push_stack */
344 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
345 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
346 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
347 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
348 0, /* register_name */
349 0, /* register_type */
351 -1, /* deprecated_fp_regnum */
352 0, /* push_dummy_call */
353 0, /* call_dummy_location */
354 0, /* push_dummy_code */
355 default_print_registers_info
, /* print_registers_info */
356 0, /* print_float_info */
357 0, /* print_vector_info */
358 legacy_register_sim_regno
, /* register_sim_regno */
359 cannot_register_not
, /* cannot_fetch_register */
360 cannot_register_not
, /* cannot_store_register */
361 0, /* get_longjmp_target */
362 0, /* believe_pcc_promotion */
363 generic_convert_register_p
, /* convert_register_p */
364 0, /* register_to_value */
365 0, /* value_to_register */
366 0, /* value_from_register */
367 unsigned_pointer_to_address
, /* pointer_to_address */
368 unsigned_address_to_pointer
, /* address_to_pointer */
369 0, /* integer_to_address */
370 0, /* return_value */
371 default_return_in_first_hidden_param_p
, /* return_in_first_hidden_param_p */
372 0, /* skip_prologue */
373 0, /* skip_main_prologue */
375 0, /* breakpoint_from_pc */
376 default_remote_breakpoint_from_pc
, /* remote_breakpoint_from_pc */
377 0, /* adjust_breakpoint_address */
378 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
379 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
380 0, /* decr_pc_after_break */
381 0, /* deprecated_function_start_offset */
382 default_remote_register_number
, /* remote_register_number */
383 0, /* fetch_tls_load_module_address */
384 0, /* frame_args_skip */
387 0, /* frame_num_args */
389 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
390 0, /* frame_red_zone_size */
391 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
392 core_addr_identity
, /* addr_bits_remove */
393 0, /* software_single_step */
394 0, /* single_step_through_delay */
396 0, /* skip_trampoline_code */
397 generic_skip_solib_resolver
, /* skip_solib_resolver */
398 generic_in_solib_return_trampoline
, /* in_solib_return_trampoline */
399 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
400 0, /* elf_make_msymbol_special */
401 0, /* coff_make_msymbol_special */
402 0, /* cannot_step_breakpoint */
403 0, /* have_nonsteppable_watchpoint */
404 0, /* address_class_type_flags */
405 0, /* address_class_type_flags_to_name */
406 0, /* address_class_name_to_type_flags */
407 default_register_reggroup_p
, /* register_reggroup_p */
408 0, /* fetch_pointer_argument */
409 0, /* regset_from_core_section */
410 0, /* core_regset_sections */
411 0, /* make_corefile_notes */
412 0, /* find_memory_regions */
413 0, /* core_xfer_shared_libraries */
414 0, /* core_pid_to_str */
415 0, /* gcore_bfd_target */
416 0, /* vtable_function_descriptors */
417 0, /* vbit_in_delta */
418 0, /* skip_permanent_breakpoint */
419 0, /* max_insn_length */
420 0, /* displaced_step_copy_insn */
421 default_displaced_step_hw_singlestep
, /* displaced_step_hw_singlestep */
422 0, /* displaced_step_fixup */
423 NULL
, /* displaced_step_free_closure */
424 NULL
, /* displaced_step_location */
425 0, /* relocate_instruction */
426 0, /* overlay_update */
427 0, /* core_read_description */
428 0, /* static_transform_name */
429 0, /* sofun_address_maybe_missing */
430 0, /* process_record */
431 0, /* process_record_signal */
432 0, /* gdb_signal_from_target */
433 0, /* get_siginfo_type */
434 0, /* record_special_symbol */
435 0, /* get_syscall_number */
436 0, /* stap_integer_prefix */
437 0, /* stap_integer_suffix */
438 0, /* stap_register_prefix */
439 0, /* stap_register_suffix */
440 0, /* stap_register_indirection_prefix */
441 0, /* stap_register_indirection_suffix */
442 0, /* stap_gdb_register_prefix */
443 0, /* stap_gdb_register_suffix */
444 0, /* stap_is_single_operand */
445 0, /* stap_parse_special_token */
446 0, /* has_global_solist */
447 0, /* has_global_breakpoints */
448 default_has_shared_address_space
, /* has_shared_address_space */
449 default_fast_tracepoint_valid_at
, /* fast_tracepoint_valid_at */
450 default_auto_charset
, /* auto_charset */
451 default_auto_wide_charset
, /* auto_wide_charset */
452 0, /* solib_symbols_extension */
453 0, /* has_dos_based_file_system */
454 default_gen_return_address
, /* gen_return_address */
456 0, /* core_info_proc */
457 default_iterate_over_objfiles_in_search_order
, /* iterate_over_objfiles_in_search_order */
458 NULL
, /* ravenscar_ops */
459 /* startup_gdbarch() */
463 /* Create a new ``struct gdbarch'' based on information provided by
464 ``struct gdbarch_info''. */
467 gdbarch_alloc (const struct gdbarch_info
*info
,
468 struct gdbarch_tdep
*tdep
)
470 struct gdbarch
*gdbarch
;
472 /* Create an obstack for allocating all the per-architecture memory,
473 then use that to allocate the architecture vector. */
474 struct obstack
*obstack
= XMALLOC (struct obstack
);
475 obstack_init (obstack
);
476 gdbarch
= obstack_alloc (obstack
, sizeof (*gdbarch
));
477 memset (gdbarch
, 0, sizeof (*gdbarch
));
478 gdbarch
->obstack
= obstack
;
480 alloc_gdbarch_data (gdbarch
);
482 gdbarch
->tdep
= tdep
;
484 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
485 gdbarch
->byte_order
= info
->byte_order
;
486 gdbarch
->byte_order_for_code
= info
->byte_order_for_code
;
487 gdbarch
->osabi
= info
->osabi
;
488 gdbarch
->target_desc
= info
->target_desc
;
490 /* Force the explicit initialization of these. */
491 gdbarch
->bits_big_endian
= (gdbarch
->byte_order
== BFD_ENDIAN_BIG
);
492 gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
493 gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
494 gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
495 gdbarch
->long_long_bit
= 2*gdbarch
->long_bit
;
496 gdbarch
->long_long_align_bit
= 2*gdbarch
->long_bit
;
497 gdbarch
->half_bit
= 2*TARGET_CHAR_BIT
;
498 gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
499 gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
500 gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
501 gdbarch
->ptr_bit
= gdbarch
->int_bit
;
502 gdbarch
->char_signed
= -1;
503 gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
504 gdbarch
->num_regs
= -1;
505 gdbarch
->sp_regnum
= -1;
506 gdbarch
->pc_regnum
= -1;
507 gdbarch
->ps_regnum
= -1;
508 gdbarch
->fp0_regnum
= -1;
509 gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
510 gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
511 gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
512 gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
513 gdbarch
->deprecated_fp_regnum
= -1;
514 gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
515 gdbarch
->print_registers_info
= default_print_registers_info
;
516 gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
517 gdbarch
->cannot_fetch_register
= cannot_register_not
;
518 gdbarch
->cannot_store_register
= cannot_register_not
;
519 gdbarch
->convert_register_p
= generic_convert_register_p
;
520 gdbarch
->value_from_register
= default_value_from_register
;
521 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
522 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
523 gdbarch
->return_in_first_hidden_param_p
= default_return_in_first_hidden_param_p
;
524 gdbarch
->remote_breakpoint_from_pc
= default_remote_breakpoint_from_pc
;
525 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
526 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
527 gdbarch
->remote_register_number
= default_remote_register_number
;
528 gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
529 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
530 gdbarch
->addr_bits_remove
= core_addr_identity
;
531 gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
532 gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
533 gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
534 gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
535 gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
536 gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
537 gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
538 gdbarch
->displaced_step_hw_singlestep
= default_displaced_step_hw_singlestep
;
539 gdbarch
->displaced_step_fixup
= NULL
;
540 gdbarch
->displaced_step_free_closure
= NULL
;
541 gdbarch
->displaced_step_location
= NULL
;
542 gdbarch
->relocate_instruction
= NULL
;
543 gdbarch
->has_shared_address_space
= default_has_shared_address_space
;
544 gdbarch
->fast_tracepoint_valid_at
= default_fast_tracepoint_valid_at
;
545 gdbarch
->auto_charset
= default_auto_charset
;
546 gdbarch
->auto_wide_charset
= default_auto_wide_charset
;
547 gdbarch
->gen_return_address
= default_gen_return_address
;
548 gdbarch
->iterate_over_objfiles_in_search_order
= default_iterate_over_objfiles_in_search_order
;
549 gdbarch
->ravenscar_ops
= NULL
;
550 /* gdbarch_alloc() */
556 /* Allocate extra space using the per-architecture obstack. */
559 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
561 void *data
= obstack_alloc (arch
->obstack
, size
);
563 memset (data
, 0, size
);
568 /* Free a gdbarch struct. This should never happen in normal
569 operation --- once you've created a gdbarch, you keep it around.
570 However, if an architecture's init function encounters an error
571 building the structure, it may need to clean up a partially
572 constructed gdbarch. */
575 gdbarch_free (struct gdbarch
*arch
)
577 struct obstack
*obstack
;
579 gdb_assert (arch
!= NULL
);
580 gdb_assert (!arch
->initialized_p
);
581 obstack
= arch
->obstack
;
582 obstack_free (obstack
, 0); /* Includes the ARCH. */
587 /* Ensure that all values in a GDBARCH are reasonable. */
590 verify_gdbarch (struct gdbarch
*gdbarch
)
593 struct cleanup
*cleanups
;
597 log
= mem_fileopen ();
598 cleanups
= make_cleanup_ui_file_delete (log
);
600 if (gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
601 fprintf_unfiltered (log
, "\n\tbyte-order");
602 if (gdbarch
->bfd_arch_info
== NULL
)
603 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
604 /* Check those that need to be defined for the given multi-arch level. */
605 /* Skip verify of bits_big_endian, invalid_p == 0 */
606 /* Skip verify of short_bit, invalid_p == 0 */
607 /* Skip verify of int_bit, invalid_p == 0 */
608 /* Skip verify of long_bit, invalid_p == 0 */
609 /* Skip verify of long_long_bit, invalid_p == 0 */
610 /* Skip verify of long_long_align_bit, invalid_p == 0 */
611 /* Skip verify of half_bit, invalid_p == 0 */
612 if (gdbarch
->half_format
== 0)
613 gdbarch
->half_format
= floatformats_ieee_half
;
614 /* Skip verify of float_bit, invalid_p == 0 */
615 if (gdbarch
->float_format
== 0)
616 gdbarch
->float_format
= floatformats_ieee_single
;
617 /* Skip verify of double_bit, invalid_p == 0 */
618 if (gdbarch
->double_format
== 0)
619 gdbarch
->double_format
= floatformats_ieee_double
;
620 /* Skip verify of long_double_bit, invalid_p == 0 */
621 if (gdbarch
->long_double_format
== 0)
622 gdbarch
->long_double_format
= floatformats_ieee_double
;
623 /* Skip verify of ptr_bit, invalid_p == 0 */
624 if (gdbarch
->addr_bit
== 0)
625 gdbarch
->addr_bit
= gdbarch_ptr_bit (gdbarch
);
626 if (gdbarch
->dwarf2_addr_size
== 0)
627 gdbarch
->dwarf2_addr_size
= gdbarch_ptr_bit (gdbarch
) / TARGET_CHAR_BIT
;
628 if (gdbarch
->char_signed
== -1)
629 gdbarch
->char_signed
= 1;
630 /* Skip verify of read_pc, has predicate. */
631 /* Skip verify of write_pc, has predicate. */
632 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
633 /* Skip verify of pseudo_register_read, has predicate. */
634 /* Skip verify of pseudo_register_read_value, has predicate. */
635 /* Skip verify of pseudo_register_write, has predicate. */
636 if (gdbarch
->num_regs
== -1)
637 fprintf_unfiltered (log
, "\n\tnum_regs");
638 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
639 /* Skip verify of ax_pseudo_register_collect, has predicate. */
640 /* Skip verify of ax_pseudo_register_push_stack, has predicate. */
641 /* Skip verify of sp_regnum, invalid_p == 0 */
642 /* Skip verify of pc_regnum, invalid_p == 0 */
643 /* Skip verify of ps_regnum, invalid_p == 0 */
644 /* Skip verify of fp0_regnum, invalid_p == 0 */
645 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
646 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
647 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
648 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
649 if (gdbarch
->register_name
== 0)
650 fprintf_unfiltered (log
, "\n\tregister_name");
651 /* Skip verify of register_type, has predicate. */
652 /* Skip verify of dummy_id, has predicate. */
653 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
654 /* Skip verify of push_dummy_call, has predicate. */
655 /* Skip verify of call_dummy_location, invalid_p == 0 */
656 /* Skip verify of push_dummy_code, has predicate. */
657 /* Skip verify of print_registers_info, invalid_p == 0 */
658 /* Skip verify of print_float_info, has predicate. */
659 /* Skip verify of print_vector_info, has predicate. */
660 /* Skip verify of register_sim_regno, invalid_p == 0 */
661 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
662 /* Skip verify of cannot_store_register, invalid_p == 0 */
663 /* Skip verify of get_longjmp_target, has predicate. */
664 /* Skip verify of convert_register_p, invalid_p == 0 */
665 /* Skip verify of value_from_register, invalid_p == 0 */
666 /* Skip verify of pointer_to_address, invalid_p == 0 */
667 /* Skip verify of address_to_pointer, invalid_p == 0 */
668 /* Skip verify of integer_to_address, has predicate. */
669 /* Skip verify of return_value, has predicate. */
670 /* Skip verify of return_in_first_hidden_param_p, invalid_p == 0 */
671 if (gdbarch
->skip_prologue
== 0)
672 fprintf_unfiltered (log
, "\n\tskip_prologue");
673 /* Skip verify of skip_main_prologue, has predicate. */
674 if (gdbarch
->inner_than
== 0)
675 fprintf_unfiltered (log
, "\n\tinner_than");
676 if (gdbarch
->breakpoint_from_pc
== 0)
677 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
678 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
679 /* Skip verify of adjust_breakpoint_address, has predicate. */
680 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
681 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
682 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
683 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
684 /* Skip verify of remote_register_number, invalid_p == 0 */
685 /* Skip verify of fetch_tls_load_module_address, has predicate. */
686 /* Skip verify of frame_args_skip, invalid_p == 0 */
687 /* Skip verify of unwind_pc, has predicate. */
688 /* Skip verify of unwind_sp, has predicate. */
689 /* Skip verify of frame_num_args, has predicate. */
690 /* Skip verify of frame_align, has predicate. */
691 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
692 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
693 /* Skip verify of addr_bits_remove, invalid_p == 0 */
694 /* Skip verify of software_single_step, has predicate. */
695 /* Skip verify of single_step_through_delay, has predicate. */
696 if (gdbarch
->print_insn
== 0)
697 fprintf_unfiltered (log
, "\n\tprint_insn");
698 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
699 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
700 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
701 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
702 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
703 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
704 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
705 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
706 /* Skip verify of address_class_type_flags, has predicate. */
707 /* Skip verify of address_class_type_flags_to_name, has predicate. */
708 /* Skip verify of address_class_name_to_type_flags, has predicate. */
709 /* Skip verify of register_reggroup_p, invalid_p == 0 */
710 /* Skip verify of fetch_pointer_argument, has predicate. */
711 /* Skip verify of regset_from_core_section, has predicate. */
712 /* Skip verify of make_corefile_notes, has predicate. */
713 /* Skip verify of find_memory_regions, has predicate. */
714 /* Skip verify of core_xfer_shared_libraries, has predicate. */
715 /* Skip verify of core_pid_to_str, has predicate. */
716 /* Skip verify of gcore_bfd_target, has predicate. */
717 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
718 /* Skip verify of vbit_in_delta, invalid_p == 0 */
719 /* Skip verify of skip_permanent_breakpoint, has predicate. */
720 /* Skip verify of max_insn_length, has predicate. */
721 /* Skip verify of displaced_step_copy_insn, has predicate. */
722 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
723 /* Skip verify of displaced_step_fixup, has predicate. */
724 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
725 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
726 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
727 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
728 /* Skip verify of relocate_instruction, has predicate. */
729 /* Skip verify of overlay_update, has predicate. */
730 /* Skip verify of core_read_description, has predicate. */
731 /* Skip verify of static_transform_name, has predicate. */
732 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
733 /* Skip verify of process_record, has predicate. */
734 /* Skip verify of process_record_signal, has predicate. */
735 /* Skip verify of gdb_signal_from_target, has predicate. */
736 /* Skip verify of get_siginfo_type, has predicate. */
737 /* Skip verify of record_special_symbol, has predicate. */
738 /* Skip verify of get_syscall_number, has predicate. */
739 /* Skip verify of stap_integer_prefix, invalid_p == 0 */
740 /* Skip verify of stap_integer_suffix, invalid_p == 0 */
741 /* Skip verify of stap_register_prefix, invalid_p == 0 */
742 /* Skip verify of stap_register_suffix, invalid_p == 0 */
743 /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */
744 /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */
745 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
746 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
747 /* Skip verify of stap_is_single_operand, has predicate. */
748 /* Skip verify of stap_parse_special_token, has predicate. */
749 /* Skip verify of has_global_solist, invalid_p == 0 */
750 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
751 /* Skip verify of has_shared_address_space, invalid_p == 0 */
752 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
753 /* Skip verify of auto_charset, invalid_p == 0 */
754 /* Skip verify of auto_wide_charset, invalid_p == 0 */
755 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
756 /* Skip verify of gen_return_address, invalid_p == 0 */
757 /* Skip verify of info_proc, has predicate. */
758 /* Skip verify of core_info_proc, has predicate. */
759 /* Skip verify of iterate_over_objfiles_in_search_order, invalid_p == 0 */
760 /* Skip verify of ravenscar_ops, invalid_p == 0 */
761 buf
= ui_file_xstrdup (log
, &length
);
762 make_cleanup (xfree
, buf
);
764 internal_error (__FILE__
, __LINE__
,
765 _("verify_gdbarch: the following are invalid ...%s"),
767 do_cleanups (cleanups
);
771 /* Print out the details of the current architecture. */
774 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
776 const char *gdb_nm_file
= "<not-defined>";
778 #if defined (GDB_NM_FILE)
779 gdb_nm_file
= GDB_NM_FILE
;
781 fprintf_unfiltered (file
,
782 "gdbarch_dump: GDB_NM_FILE = %s\n",
784 fprintf_unfiltered (file
,
785 "gdbarch_dump: addr_bit = %s\n",
786 plongest (gdbarch
->addr_bit
));
787 fprintf_unfiltered (file
,
788 "gdbarch_dump: addr_bits_remove = <%s>\n",
789 host_address_to_string (gdbarch
->addr_bits_remove
));
790 fprintf_unfiltered (file
,
791 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
792 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
793 fprintf_unfiltered (file
,
794 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
795 host_address_to_string (gdbarch
->address_class_name_to_type_flags
));
796 fprintf_unfiltered (file
,
797 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
798 gdbarch_address_class_type_flags_p (gdbarch
));
799 fprintf_unfiltered (file
,
800 "gdbarch_dump: address_class_type_flags = <%s>\n",
801 host_address_to_string (gdbarch
->address_class_type_flags
));
802 fprintf_unfiltered (file
,
803 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
804 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
805 fprintf_unfiltered (file
,
806 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
807 host_address_to_string (gdbarch
->address_class_type_flags_to_name
));
808 fprintf_unfiltered (file
,
809 "gdbarch_dump: address_to_pointer = <%s>\n",
810 host_address_to_string (gdbarch
->address_to_pointer
));
811 fprintf_unfiltered (file
,
812 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
813 gdbarch_adjust_breakpoint_address_p (gdbarch
));
814 fprintf_unfiltered (file
,
815 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
816 host_address_to_string (gdbarch
->adjust_breakpoint_address
));
817 fprintf_unfiltered (file
,
818 "gdbarch_dump: auto_charset = <%s>\n",
819 host_address_to_string (gdbarch
->auto_charset
));
820 fprintf_unfiltered (file
,
821 "gdbarch_dump: auto_wide_charset = <%s>\n",
822 host_address_to_string (gdbarch
->auto_wide_charset
));
823 fprintf_unfiltered (file
,
824 "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
825 gdbarch_ax_pseudo_register_collect_p (gdbarch
));
826 fprintf_unfiltered (file
,
827 "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
828 host_address_to_string (gdbarch
->ax_pseudo_register_collect
));
829 fprintf_unfiltered (file
,
830 "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
831 gdbarch_ax_pseudo_register_push_stack_p (gdbarch
));
832 fprintf_unfiltered (file
,
833 "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
834 host_address_to_string (gdbarch
->ax_pseudo_register_push_stack
));
835 fprintf_unfiltered (file
,
836 "gdbarch_dump: believe_pcc_promotion = %s\n",
837 plongest (gdbarch
->believe_pcc_promotion
));
838 fprintf_unfiltered (file
,
839 "gdbarch_dump: bfd_arch_info = %s\n",
840 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
841 fprintf_unfiltered (file
,
842 "gdbarch_dump: bits_big_endian = %s\n",
843 plongest (gdbarch
->bits_big_endian
));
844 fprintf_unfiltered (file
,
845 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
846 host_address_to_string (gdbarch
->breakpoint_from_pc
));
847 fprintf_unfiltered (file
,
848 "gdbarch_dump: byte_order = %s\n",
849 plongest (gdbarch
->byte_order
));
850 fprintf_unfiltered (file
,
851 "gdbarch_dump: byte_order_for_code = %s\n",
852 plongest (gdbarch
->byte_order_for_code
));
853 fprintf_unfiltered (file
,
854 "gdbarch_dump: call_dummy_location = %s\n",
855 plongest (gdbarch
->call_dummy_location
));
856 fprintf_unfiltered (file
,
857 "gdbarch_dump: cannot_fetch_register = <%s>\n",
858 host_address_to_string (gdbarch
->cannot_fetch_register
));
859 fprintf_unfiltered (file
,
860 "gdbarch_dump: cannot_step_breakpoint = %s\n",
861 plongest (gdbarch
->cannot_step_breakpoint
));
862 fprintf_unfiltered (file
,
863 "gdbarch_dump: cannot_store_register = <%s>\n",
864 host_address_to_string (gdbarch
->cannot_store_register
));
865 fprintf_unfiltered (file
,
866 "gdbarch_dump: char_signed = %s\n",
867 plongest (gdbarch
->char_signed
));
868 fprintf_unfiltered (file
,
869 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
870 host_address_to_string (gdbarch
->coff_make_msymbol_special
));
871 fprintf_unfiltered (file
,
872 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
873 host_address_to_string (gdbarch
->convert_from_func_ptr_addr
));
874 fprintf_unfiltered (file
,
875 "gdbarch_dump: convert_register_p = <%s>\n",
876 host_address_to_string (gdbarch
->convert_register_p
));
877 fprintf_unfiltered (file
,
878 "gdbarch_dump: gdbarch_core_info_proc_p() = %d\n",
879 gdbarch_core_info_proc_p (gdbarch
));
880 fprintf_unfiltered (file
,
881 "gdbarch_dump: core_info_proc = <%s>\n",
882 host_address_to_string (gdbarch
->core_info_proc
));
883 fprintf_unfiltered (file
,
884 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
885 gdbarch_core_pid_to_str_p (gdbarch
));
886 fprintf_unfiltered (file
,
887 "gdbarch_dump: core_pid_to_str = <%s>\n",
888 host_address_to_string (gdbarch
->core_pid_to_str
));
889 fprintf_unfiltered (file
,
890 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
891 gdbarch_core_read_description_p (gdbarch
));
892 fprintf_unfiltered (file
,
893 "gdbarch_dump: core_read_description = <%s>\n",
894 host_address_to_string (gdbarch
->core_read_description
));
895 fprintf_unfiltered (file
,
896 "gdbarch_dump: core_regset_sections = %s\n",
897 host_address_to_string (gdbarch
->core_regset_sections
));
898 fprintf_unfiltered (file
,
899 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
900 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
901 fprintf_unfiltered (file
,
902 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
903 host_address_to_string (gdbarch
->core_xfer_shared_libraries
));
904 fprintf_unfiltered (file
,
905 "gdbarch_dump: decr_pc_after_break = %s\n",
906 core_addr_to_string_nz (gdbarch
->decr_pc_after_break
));
907 fprintf_unfiltered (file
,
908 "gdbarch_dump: deprecated_fp_regnum = %s\n",
909 plongest (gdbarch
->deprecated_fp_regnum
));
910 fprintf_unfiltered (file
,
911 "gdbarch_dump: deprecated_function_start_offset = %s\n",
912 core_addr_to_string_nz (gdbarch
->deprecated_function_start_offset
));
913 fprintf_unfiltered (file
,
914 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
915 gdbarch_displaced_step_copy_insn_p (gdbarch
));
916 fprintf_unfiltered (file
,
917 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
918 host_address_to_string (gdbarch
->displaced_step_copy_insn
));
919 fprintf_unfiltered (file
,
920 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
921 gdbarch_displaced_step_fixup_p (gdbarch
));
922 fprintf_unfiltered (file
,
923 "gdbarch_dump: displaced_step_fixup = <%s>\n",
924 host_address_to_string (gdbarch
->displaced_step_fixup
));
925 fprintf_unfiltered (file
,
926 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
927 host_address_to_string (gdbarch
->displaced_step_free_closure
));
928 fprintf_unfiltered (file
,
929 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
930 host_address_to_string (gdbarch
->displaced_step_hw_singlestep
));
931 fprintf_unfiltered (file
,
932 "gdbarch_dump: displaced_step_location = <%s>\n",
933 host_address_to_string (gdbarch
->displaced_step_location
));
934 fprintf_unfiltered (file
,
935 "gdbarch_dump: double_bit = %s\n",
936 plongest (gdbarch
->double_bit
));
937 fprintf_unfiltered (file
,
938 "gdbarch_dump: double_format = %s\n",
939 pformat (gdbarch
->double_format
));
940 fprintf_unfiltered (file
,
941 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
942 gdbarch_dummy_id_p (gdbarch
));
943 fprintf_unfiltered (file
,
944 "gdbarch_dump: dummy_id = <%s>\n",
945 host_address_to_string (gdbarch
->dummy_id
));
946 fprintf_unfiltered (file
,
947 "gdbarch_dump: dwarf2_addr_size = %s\n",
948 plongest (gdbarch
->dwarf2_addr_size
));
949 fprintf_unfiltered (file
,
950 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
951 host_address_to_string (gdbarch
->dwarf2_reg_to_regnum
));
952 fprintf_unfiltered (file
,
953 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
954 host_address_to_string (gdbarch
->ecoff_reg_to_regnum
));
955 fprintf_unfiltered (file
,
956 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
957 host_address_to_string (gdbarch
->elf_make_msymbol_special
));
958 fprintf_unfiltered (file
,
959 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
960 host_address_to_string (gdbarch
->fast_tracepoint_valid_at
));
961 fprintf_unfiltered (file
,
962 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
963 gdbarch_fetch_pointer_argument_p (gdbarch
));
964 fprintf_unfiltered (file
,
965 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
966 host_address_to_string (gdbarch
->fetch_pointer_argument
));
967 fprintf_unfiltered (file
,
968 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
969 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
970 fprintf_unfiltered (file
,
971 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
972 host_address_to_string (gdbarch
->fetch_tls_load_module_address
));
973 fprintf_unfiltered (file
,
974 "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n",
975 gdbarch_find_memory_regions_p (gdbarch
));
976 fprintf_unfiltered (file
,
977 "gdbarch_dump: find_memory_regions = <%s>\n",
978 host_address_to_string (gdbarch
->find_memory_regions
));
979 fprintf_unfiltered (file
,
980 "gdbarch_dump: float_bit = %s\n",
981 plongest (gdbarch
->float_bit
));
982 fprintf_unfiltered (file
,
983 "gdbarch_dump: float_format = %s\n",
984 pformat (gdbarch
->float_format
));
985 fprintf_unfiltered (file
,
986 "gdbarch_dump: fp0_regnum = %s\n",
987 plongest (gdbarch
->fp0_regnum
));
988 fprintf_unfiltered (file
,
989 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
990 gdbarch_frame_align_p (gdbarch
));
991 fprintf_unfiltered (file
,
992 "gdbarch_dump: frame_align = <%s>\n",
993 host_address_to_string (gdbarch
->frame_align
));
994 fprintf_unfiltered (file
,
995 "gdbarch_dump: frame_args_skip = %s\n",
996 core_addr_to_string_nz (gdbarch
->frame_args_skip
));
997 fprintf_unfiltered (file
,
998 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
999 gdbarch_frame_num_args_p (gdbarch
));
1000 fprintf_unfiltered (file
,
1001 "gdbarch_dump: frame_num_args = <%s>\n",
1002 host_address_to_string (gdbarch
->frame_num_args
));
1003 fprintf_unfiltered (file
,
1004 "gdbarch_dump: frame_red_zone_size = %s\n",
1005 plongest (gdbarch
->frame_red_zone_size
));
1006 fprintf_unfiltered (file
,
1007 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
1008 gdbarch_gcore_bfd_target_p (gdbarch
));
1009 fprintf_unfiltered (file
,
1010 "gdbarch_dump: gcore_bfd_target = %s\n",
1011 pstring (gdbarch
->gcore_bfd_target
));
1012 fprintf_unfiltered (file
,
1013 "gdbarch_dump: gdbarch_gdb_signal_from_target_p() = %d\n",
1014 gdbarch_gdb_signal_from_target_p (gdbarch
));
1015 fprintf_unfiltered (file
,
1016 "gdbarch_dump: gdb_signal_from_target = <%s>\n",
1017 host_address_to_string (gdbarch
->gdb_signal_from_target
));
1018 fprintf_unfiltered (file
,
1019 "gdbarch_dump: gen_return_address = <%s>\n",
1020 host_address_to_string (gdbarch
->gen_return_address
));
1021 fprintf_unfiltered (file
,
1022 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1023 gdbarch_get_longjmp_target_p (gdbarch
));
1024 fprintf_unfiltered (file
,
1025 "gdbarch_dump: get_longjmp_target = <%s>\n",
1026 host_address_to_string (gdbarch
->get_longjmp_target
));
1027 fprintf_unfiltered (file
,
1028 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
1029 gdbarch_get_siginfo_type_p (gdbarch
));
1030 fprintf_unfiltered (file
,
1031 "gdbarch_dump: get_siginfo_type = <%s>\n",
1032 host_address_to_string (gdbarch
->get_siginfo_type
));
1033 fprintf_unfiltered (file
,
1034 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
1035 gdbarch_get_syscall_number_p (gdbarch
));
1036 fprintf_unfiltered (file
,
1037 "gdbarch_dump: get_syscall_number = <%s>\n",
1038 host_address_to_string (gdbarch
->get_syscall_number
));
1039 fprintf_unfiltered (file
,
1040 "gdbarch_dump: half_bit = %s\n",
1041 plongest (gdbarch
->half_bit
));
1042 fprintf_unfiltered (file
,
1043 "gdbarch_dump: half_format = %s\n",
1044 pformat (gdbarch
->half_format
));
1045 fprintf_unfiltered (file
,
1046 "gdbarch_dump: has_dos_based_file_system = %s\n",
1047 plongest (gdbarch
->has_dos_based_file_system
));
1048 fprintf_unfiltered (file
,
1049 "gdbarch_dump: has_global_breakpoints = %s\n",
1050 plongest (gdbarch
->has_global_breakpoints
));
1051 fprintf_unfiltered (file
,
1052 "gdbarch_dump: has_global_solist = %s\n",
1053 plongest (gdbarch
->has_global_solist
));
1054 fprintf_unfiltered (file
,
1055 "gdbarch_dump: has_shared_address_space = <%s>\n",
1056 host_address_to_string (gdbarch
->has_shared_address_space
));
1057 fprintf_unfiltered (file
,
1058 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1059 plongest (gdbarch
->have_nonsteppable_watchpoint
));
1060 fprintf_unfiltered (file
,
1061 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
1062 host_address_to_string (gdbarch
->in_function_epilogue_p
));
1063 fprintf_unfiltered (file
,
1064 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
1065 host_address_to_string (gdbarch
->in_solib_return_trampoline
));
1066 fprintf_unfiltered (file
,
1067 "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
1068 gdbarch_info_proc_p (gdbarch
));
1069 fprintf_unfiltered (file
,
1070 "gdbarch_dump: info_proc = <%s>\n",
1071 host_address_to_string (gdbarch
->info_proc
));
1072 fprintf_unfiltered (file
,
1073 "gdbarch_dump: inner_than = <%s>\n",
1074 host_address_to_string (gdbarch
->inner_than
));
1075 fprintf_unfiltered (file
,
1076 "gdbarch_dump: int_bit = %s\n",
1077 plongest (gdbarch
->int_bit
));
1078 fprintf_unfiltered (file
,
1079 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1080 gdbarch_integer_to_address_p (gdbarch
));
1081 fprintf_unfiltered (file
,
1082 "gdbarch_dump: integer_to_address = <%s>\n",
1083 host_address_to_string (gdbarch
->integer_to_address
));
1084 fprintf_unfiltered (file
,
1085 "gdbarch_dump: iterate_over_objfiles_in_search_order = <%s>\n",
1086 host_address_to_string (gdbarch
->iterate_over_objfiles_in_search_order
));
1087 fprintf_unfiltered (file
,
1088 "gdbarch_dump: long_bit = %s\n",
1089 plongest (gdbarch
->long_bit
));
1090 fprintf_unfiltered (file
,
1091 "gdbarch_dump: long_double_bit = %s\n",
1092 plongest (gdbarch
->long_double_bit
));
1093 fprintf_unfiltered (file
,
1094 "gdbarch_dump: long_double_format = %s\n",
1095 pformat (gdbarch
->long_double_format
));
1096 fprintf_unfiltered (file
,
1097 "gdbarch_dump: long_long_align_bit = %s\n",
1098 plongest (gdbarch
->long_long_align_bit
));
1099 fprintf_unfiltered (file
,
1100 "gdbarch_dump: long_long_bit = %s\n",
1101 plongest (gdbarch
->long_long_bit
));
1102 fprintf_unfiltered (file
,
1103 "gdbarch_dump: gdbarch_make_corefile_notes_p() = %d\n",
1104 gdbarch_make_corefile_notes_p (gdbarch
));
1105 fprintf_unfiltered (file
,
1106 "gdbarch_dump: make_corefile_notes = <%s>\n",
1107 host_address_to_string (gdbarch
->make_corefile_notes
));
1108 fprintf_unfiltered (file
,
1109 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
1110 gdbarch_max_insn_length_p (gdbarch
));
1111 fprintf_unfiltered (file
,
1112 "gdbarch_dump: max_insn_length = %s\n",
1113 plongest (gdbarch
->max_insn_length
));
1114 fprintf_unfiltered (file
,
1115 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1116 host_address_to_string (gdbarch
->memory_insert_breakpoint
));
1117 fprintf_unfiltered (file
,
1118 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1119 host_address_to_string (gdbarch
->memory_remove_breakpoint
));
1120 fprintf_unfiltered (file
,
1121 "gdbarch_dump: num_pseudo_regs = %s\n",
1122 plongest (gdbarch
->num_pseudo_regs
));
1123 fprintf_unfiltered (file
,
1124 "gdbarch_dump: num_regs = %s\n",
1125 plongest (gdbarch
->num_regs
));
1126 fprintf_unfiltered (file
,
1127 "gdbarch_dump: osabi = %s\n",
1128 plongest (gdbarch
->osabi
));
1129 fprintf_unfiltered (file
,
1130 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1131 gdbarch_overlay_update_p (gdbarch
));
1132 fprintf_unfiltered (file
,
1133 "gdbarch_dump: overlay_update = <%s>\n",
1134 host_address_to_string (gdbarch
->overlay_update
));
1135 fprintf_unfiltered (file
,
1136 "gdbarch_dump: pc_regnum = %s\n",
1137 plongest (gdbarch
->pc_regnum
));
1138 fprintf_unfiltered (file
,
1139 "gdbarch_dump: pointer_to_address = <%s>\n",
1140 host_address_to_string (gdbarch
->pointer_to_address
));
1141 fprintf_unfiltered (file
,
1142 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1143 gdbarch_print_float_info_p (gdbarch
));
1144 fprintf_unfiltered (file
,
1145 "gdbarch_dump: print_float_info = <%s>\n",
1146 host_address_to_string (gdbarch
->print_float_info
));
1147 fprintf_unfiltered (file
,
1148 "gdbarch_dump: print_insn = <%s>\n",
1149 host_address_to_string (gdbarch
->print_insn
));
1150 fprintf_unfiltered (file
,
1151 "gdbarch_dump: print_registers_info = <%s>\n",
1152 host_address_to_string (gdbarch
->print_registers_info
));
1153 fprintf_unfiltered (file
,
1154 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1155 gdbarch_print_vector_info_p (gdbarch
));
1156 fprintf_unfiltered (file
,
1157 "gdbarch_dump: print_vector_info = <%s>\n",
1158 host_address_to_string (gdbarch
->print_vector_info
));
1159 fprintf_unfiltered (file
,
1160 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1161 gdbarch_process_record_p (gdbarch
));
1162 fprintf_unfiltered (file
,
1163 "gdbarch_dump: process_record = <%s>\n",
1164 host_address_to_string (gdbarch
->process_record
));
1165 fprintf_unfiltered (file
,
1166 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1167 gdbarch_process_record_signal_p (gdbarch
));
1168 fprintf_unfiltered (file
,
1169 "gdbarch_dump: process_record_signal = <%s>\n",
1170 host_address_to_string (gdbarch
->process_record_signal
));
1171 fprintf_unfiltered (file
,
1172 "gdbarch_dump: ps_regnum = %s\n",
1173 plongest (gdbarch
->ps_regnum
));
1174 fprintf_unfiltered (file
,
1175 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1176 gdbarch_pseudo_register_read_p (gdbarch
));
1177 fprintf_unfiltered (file
,
1178 "gdbarch_dump: pseudo_register_read = <%s>\n",
1179 host_address_to_string (gdbarch
->pseudo_register_read
));
1180 fprintf_unfiltered (file
,
1181 "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
1182 gdbarch_pseudo_register_read_value_p (gdbarch
));
1183 fprintf_unfiltered (file
,
1184 "gdbarch_dump: pseudo_register_read_value = <%s>\n",
1185 host_address_to_string (gdbarch
->pseudo_register_read_value
));
1186 fprintf_unfiltered (file
,
1187 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1188 gdbarch_pseudo_register_write_p (gdbarch
));
1189 fprintf_unfiltered (file
,
1190 "gdbarch_dump: pseudo_register_write = <%s>\n",
1191 host_address_to_string (gdbarch
->pseudo_register_write
));
1192 fprintf_unfiltered (file
,
1193 "gdbarch_dump: ptr_bit = %s\n",
1194 plongest (gdbarch
->ptr_bit
));
1195 fprintf_unfiltered (file
,
1196 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1197 gdbarch_push_dummy_call_p (gdbarch
));
1198 fprintf_unfiltered (file
,
1199 "gdbarch_dump: push_dummy_call = <%s>\n",
1200 host_address_to_string (gdbarch
->push_dummy_call
));
1201 fprintf_unfiltered (file
,
1202 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1203 gdbarch_push_dummy_code_p (gdbarch
));
1204 fprintf_unfiltered (file
,
1205 "gdbarch_dump: push_dummy_code = <%s>\n",
1206 host_address_to_string (gdbarch
->push_dummy_code
));
1207 fprintf_unfiltered (file
,
1208 "gdbarch_dump: ravenscar_ops = %s\n",
1209 host_address_to_string (gdbarch
->ravenscar_ops
));
1210 fprintf_unfiltered (file
,
1211 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1212 gdbarch_read_pc_p (gdbarch
));
1213 fprintf_unfiltered (file
,
1214 "gdbarch_dump: read_pc = <%s>\n",
1215 host_address_to_string (gdbarch
->read_pc
));
1216 fprintf_unfiltered (file
,
1217 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1218 gdbarch_record_special_symbol_p (gdbarch
));
1219 fprintf_unfiltered (file
,
1220 "gdbarch_dump: record_special_symbol = <%s>\n",
1221 host_address_to_string (gdbarch
->record_special_symbol
));
1222 fprintf_unfiltered (file
,
1223 "gdbarch_dump: register_name = <%s>\n",
1224 host_address_to_string (gdbarch
->register_name
));
1225 fprintf_unfiltered (file
,
1226 "gdbarch_dump: register_reggroup_p = <%s>\n",
1227 host_address_to_string (gdbarch
->register_reggroup_p
));
1228 fprintf_unfiltered (file
,
1229 "gdbarch_dump: register_sim_regno = <%s>\n",
1230 host_address_to_string (gdbarch
->register_sim_regno
));
1231 fprintf_unfiltered (file
,
1232 "gdbarch_dump: register_to_value = <%s>\n",
1233 host_address_to_string (gdbarch
->register_to_value
));
1234 fprintf_unfiltered (file
,
1235 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1236 gdbarch_register_type_p (gdbarch
));
1237 fprintf_unfiltered (file
,
1238 "gdbarch_dump: register_type = <%s>\n",
1239 host_address_to_string (gdbarch
->register_type
));
1240 fprintf_unfiltered (file
,
1241 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1242 gdbarch_regset_from_core_section_p (gdbarch
));
1243 fprintf_unfiltered (file
,
1244 "gdbarch_dump: regset_from_core_section = <%s>\n",
1245 host_address_to_string (gdbarch
->regset_from_core_section
));
1246 fprintf_unfiltered (file
,
1247 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1248 gdbarch_relocate_instruction_p (gdbarch
));
1249 fprintf_unfiltered (file
,
1250 "gdbarch_dump: relocate_instruction = <%s>\n",
1251 host_address_to_string (gdbarch
->relocate_instruction
));
1252 fprintf_unfiltered (file
,
1253 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1254 host_address_to_string (gdbarch
->remote_breakpoint_from_pc
));
1255 fprintf_unfiltered (file
,
1256 "gdbarch_dump: remote_register_number = <%s>\n",
1257 host_address_to_string (gdbarch
->remote_register_number
));
1258 fprintf_unfiltered (file
,
1259 "gdbarch_dump: return_in_first_hidden_param_p = <%s>\n",
1260 host_address_to_string (gdbarch
->return_in_first_hidden_param_p
));
1261 fprintf_unfiltered (file
,
1262 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1263 gdbarch_return_value_p (gdbarch
));
1264 fprintf_unfiltered (file
,
1265 "gdbarch_dump: return_value = <%s>\n",
1266 host_address_to_string (gdbarch
->return_value
));
1267 fprintf_unfiltered (file
,
1268 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1269 host_address_to_string (gdbarch
->sdb_reg_to_regnum
));
1270 fprintf_unfiltered (file
,
1271 "gdbarch_dump: short_bit = %s\n",
1272 plongest (gdbarch
->short_bit
));
1273 fprintf_unfiltered (file
,
1274 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1275 gdbarch_single_step_through_delay_p (gdbarch
));
1276 fprintf_unfiltered (file
,
1277 "gdbarch_dump: single_step_through_delay = <%s>\n",
1278 host_address_to_string (gdbarch
->single_step_through_delay
));
1279 fprintf_unfiltered (file
,
1280 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1281 gdbarch_skip_main_prologue_p (gdbarch
));
1282 fprintf_unfiltered (file
,
1283 "gdbarch_dump: skip_main_prologue = <%s>\n",
1284 host_address_to_string (gdbarch
->skip_main_prologue
));
1285 fprintf_unfiltered (file
,
1286 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1287 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1288 fprintf_unfiltered (file
,
1289 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1290 host_address_to_string (gdbarch
->skip_permanent_breakpoint
));
1291 fprintf_unfiltered (file
,
1292 "gdbarch_dump: skip_prologue = <%s>\n",
1293 host_address_to_string (gdbarch
->skip_prologue
));
1294 fprintf_unfiltered (file
,
1295 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1296 host_address_to_string (gdbarch
->skip_solib_resolver
));
1297 fprintf_unfiltered (file
,
1298 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1299 host_address_to_string (gdbarch
->skip_trampoline_code
));
1300 fprintf_unfiltered (file
,
1301 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1302 gdbarch_software_single_step_p (gdbarch
));
1303 fprintf_unfiltered (file
,
1304 "gdbarch_dump: software_single_step = <%s>\n",
1305 host_address_to_string (gdbarch
->software_single_step
));
1306 fprintf_unfiltered (file
,
1307 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1308 plongest (gdbarch
->sofun_address_maybe_missing
));
1309 fprintf_unfiltered (file
,
1310 "gdbarch_dump: solib_symbols_extension = %s\n",
1311 pstring (gdbarch
->solib_symbols_extension
));
1312 fprintf_unfiltered (file
,
1313 "gdbarch_dump: sp_regnum = %s\n",
1314 plongest (gdbarch
->sp_regnum
));
1315 fprintf_unfiltered (file
,
1316 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1317 host_address_to_string (gdbarch
->stab_reg_to_regnum
));
1318 fprintf_unfiltered (file
,
1319 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1320 host_address_to_string (gdbarch
->stabs_argument_has_addr
));
1321 fprintf_unfiltered (file
,
1322 "gdbarch_dump: stap_gdb_register_prefix = %s\n",
1323 pstring (gdbarch
->stap_gdb_register_prefix
));
1324 fprintf_unfiltered (file
,
1325 "gdbarch_dump: stap_gdb_register_suffix = %s\n",
1326 pstring (gdbarch
->stap_gdb_register_suffix
));
1327 fprintf_unfiltered (file
,
1328 "gdbarch_dump: stap_integer_prefix = %s\n",
1329 pstring (gdbarch
->stap_integer_prefix
));
1330 fprintf_unfiltered (file
,
1331 "gdbarch_dump: stap_integer_suffix = %s\n",
1332 pstring (gdbarch
->stap_integer_suffix
));
1333 fprintf_unfiltered (file
,
1334 "gdbarch_dump: gdbarch_stap_is_single_operand_p() = %d\n",
1335 gdbarch_stap_is_single_operand_p (gdbarch
));
1336 fprintf_unfiltered (file
,
1337 "gdbarch_dump: stap_is_single_operand = <%s>\n",
1338 host_address_to_string (gdbarch
->stap_is_single_operand
));
1339 fprintf_unfiltered (file
,
1340 "gdbarch_dump: gdbarch_stap_parse_special_token_p() = %d\n",
1341 gdbarch_stap_parse_special_token_p (gdbarch
));
1342 fprintf_unfiltered (file
,
1343 "gdbarch_dump: stap_parse_special_token = <%s>\n",
1344 host_address_to_string (gdbarch
->stap_parse_special_token
));
1345 fprintf_unfiltered (file
,
1346 "gdbarch_dump: stap_register_indirection_prefix = %s\n",
1347 pstring (gdbarch
->stap_register_indirection_prefix
));
1348 fprintf_unfiltered (file
,
1349 "gdbarch_dump: stap_register_indirection_suffix = %s\n",
1350 pstring (gdbarch
->stap_register_indirection_suffix
));
1351 fprintf_unfiltered (file
,
1352 "gdbarch_dump: stap_register_prefix = %s\n",
1353 pstring (gdbarch
->stap_register_prefix
));
1354 fprintf_unfiltered (file
,
1355 "gdbarch_dump: stap_register_suffix = %s\n",
1356 pstring (gdbarch
->stap_register_suffix
));
1357 fprintf_unfiltered (file
,
1358 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1359 gdbarch_static_transform_name_p (gdbarch
));
1360 fprintf_unfiltered (file
,
1361 "gdbarch_dump: static_transform_name = <%s>\n",
1362 host_address_to_string (gdbarch
->static_transform_name
));
1363 fprintf_unfiltered (file
,
1364 "gdbarch_dump: target_desc = %s\n",
1365 host_address_to_string (gdbarch
->target_desc
));
1366 fprintf_unfiltered (file
,
1367 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1368 gdbarch_unwind_pc_p (gdbarch
));
1369 fprintf_unfiltered (file
,
1370 "gdbarch_dump: unwind_pc = <%s>\n",
1371 host_address_to_string (gdbarch
->unwind_pc
));
1372 fprintf_unfiltered (file
,
1373 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1374 gdbarch_unwind_sp_p (gdbarch
));
1375 fprintf_unfiltered (file
,
1376 "gdbarch_dump: unwind_sp = <%s>\n",
1377 host_address_to_string (gdbarch
->unwind_sp
));
1378 fprintf_unfiltered (file
,
1379 "gdbarch_dump: value_from_register = <%s>\n",
1380 host_address_to_string (gdbarch
->value_from_register
));
1381 fprintf_unfiltered (file
,
1382 "gdbarch_dump: value_to_register = <%s>\n",
1383 host_address_to_string (gdbarch
->value_to_register
));
1384 fprintf_unfiltered (file
,
1385 "gdbarch_dump: vbit_in_delta = %s\n",
1386 plongest (gdbarch
->vbit_in_delta
));
1387 fprintf_unfiltered (file
,
1388 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1389 host_address_to_string (gdbarch
->virtual_frame_pointer
));
1390 fprintf_unfiltered (file
,
1391 "gdbarch_dump: vtable_function_descriptors = %s\n",
1392 plongest (gdbarch
->vtable_function_descriptors
));
1393 fprintf_unfiltered (file
,
1394 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1395 gdbarch_write_pc_p (gdbarch
));
1396 fprintf_unfiltered (file
,
1397 "gdbarch_dump: write_pc = <%s>\n",
1398 host_address_to_string (gdbarch
->write_pc
));
1399 if (gdbarch
->dump_tdep
!= NULL
)
1400 gdbarch
->dump_tdep (gdbarch
, file
);
1403 struct gdbarch_tdep
*
1404 gdbarch_tdep (struct gdbarch
*gdbarch
)
1406 if (gdbarch_debug
>= 2)
1407 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1408 return gdbarch
->tdep
;
1412 const struct bfd_arch_info
*
1413 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1415 gdb_assert (gdbarch
!= NULL
);
1416 if (gdbarch_debug
>= 2)
1417 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1418 return gdbarch
->bfd_arch_info
;
1422 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1424 gdb_assert (gdbarch
!= NULL
);
1425 if (gdbarch_debug
>= 2)
1426 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1427 return gdbarch
->byte_order
;
1431 gdbarch_byte_order_for_code (struct gdbarch
*gdbarch
)
1433 gdb_assert (gdbarch
!= NULL
);
1434 if (gdbarch_debug
>= 2)
1435 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order_for_code called\n");
1436 return gdbarch
->byte_order_for_code
;
1440 gdbarch_osabi (struct gdbarch
*gdbarch
)
1442 gdb_assert (gdbarch
!= NULL
);
1443 if (gdbarch_debug
>= 2)
1444 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1445 return gdbarch
->osabi
;
1448 const struct target_desc
*
1449 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1451 gdb_assert (gdbarch
!= NULL
);
1452 if (gdbarch_debug
>= 2)
1453 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1454 return gdbarch
->target_desc
;
1458 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1460 gdb_assert (gdbarch
!= NULL
);
1461 /* Skip verify of bits_big_endian, invalid_p == 0 */
1462 if (gdbarch_debug
>= 2)
1463 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1464 return gdbarch
->bits_big_endian
;
1468 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1469 int bits_big_endian
)
1471 gdbarch
->bits_big_endian
= bits_big_endian
;
1475 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1477 gdb_assert (gdbarch
!= NULL
);
1478 /* Skip verify of short_bit, invalid_p == 0 */
1479 if (gdbarch_debug
>= 2)
1480 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1481 return gdbarch
->short_bit
;
1485 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1488 gdbarch
->short_bit
= short_bit
;
1492 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1494 gdb_assert (gdbarch
!= NULL
);
1495 /* Skip verify of int_bit, invalid_p == 0 */
1496 if (gdbarch_debug
>= 2)
1497 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1498 return gdbarch
->int_bit
;
1502 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1505 gdbarch
->int_bit
= int_bit
;
1509 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1511 gdb_assert (gdbarch
!= NULL
);
1512 /* Skip verify of long_bit, invalid_p == 0 */
1513 if (gdbarch_debug
>= 2)
1514 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1515 return gdbarch
->long_bit
;
1519 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1522 gdbarch
->long_bit
= long_bit
;
1526 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1528 gdb_assert (gdbarch
!= NULL
);
1529 /* Skip verify of long_long_bit, invalid_p == 0 */
1530 if (gdbarch_debug
>= 2)
1531 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1532 return gdbarch
->long_long_bit
;
1536 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1539 gdbarch
->long_long_bit
= long_long_bit
;
1543 gdbarch_long_long_align_bit (struct gdbarch
*gdbarch
)
1545 gdb_assert (gdbarch
!= NULL
);
1546 /* Skip verify of long_long_align_bit, invalid_p == 0 */
1547 if (gdbarch_debug
>= 2)
1548 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_align_bit called\n");
1549 return gdbarch
->long_long_align_bit
;
1553 set_gdbarch_long_long_align_bit (struct gdbarch
*gdbarch
,
1554 int long_long_align_bit
)
1556 gdbarch
->long_long_align_bit
= long_long_align_bit
;
1560 gdbarch_half_bit (struct gdbarch
*gdbarch
)
1562 gdb_assert (gdbarch
!= NULL
);
1563 /* Skip verify of half_bit, invalid_p == 0 */
1564 if (gdbarch_debug
>= 2)
1565 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_bit called\n");
1566 return gdbarch
->half_bit
;
1570 set_gdbarch_half_bit (struct gdbarch
*gdbarch
,
1573 gdbarch
->half_bit
= half_bit
;
1576 const struct floatformat
**
1577 gdbarch_half_format (struct gdbarch
*gdbarch
)
1579 gdb_assert (gdbarch
!= NULL
);
1580 if (gdbarch_debug
>= 2)
1581 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_format called\n");
1582 return gdbarch
->half_format
;
1586 set_gdbarch_half_format (struct gdbarch
*gdbarch
,
1587 const struct floatformat
** half_format
)
1589 gdbarch
->half_format
= half_format
;
1593 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1595 gdb_assert (gdbarch
!= NULL
);
1596 /* Skip verify of float_bit, invalid_p == 0 */
1597 if (gdbarch_debug
>= 2)
1598 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1599 return gdbarch
->float_bit
;
1603 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1606 gdbarch
->float_bit
= float_bit
;
1609 const struct floatformat
**
1610 gdbarch_float_format (struct gdbarch
*gdbarch
)
1612 gdb_assert (gdbarch
!= NULL
);
1613 if (gdbarch_debug
>= 2)
1614 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1615 return gdbarch
->float_format
;
1619 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1620 const struct floatformat
** float_format
)
1622 gdbarch
->float_format
= float_format
;
1626 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1628 gdb_assert (gdbarch
!= NULL
);
1629 /* Skip verify of double_bit, invalid_p == 0 */
1630 if (gdbarch_debug
>= 2)
1631 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1632 return gdbarch
->double_bit
;
1636 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1639 gdbarch
->double_bit
= double_bit
;
1642 const struct floatformat
**
1643 gdbarch_double_format (struct gdbarch
*gdbarch
)
1645 gdb_assert (gdbarch
!= NULL
);
1646 if (gdbarch_debug
>= 2)
1647 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1648 return gdbarch
->double_format
;
1652 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1653 const struct floatformat
** double_format
)
1655 gdbarch
->double_format
= double_format
;
1659 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1661 gdb_assert (gdbarch
!= NULL
);
1662 /* Skip verify of long_double_bit, invalid_p == 0 */
1663 if (gdbarch_debug
>= 2)
1664 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1665 return gdbarch
->long_double_bit
;
1669 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1670 int long_double_bit
)
1672 gdbarch
->long_double_bit
= long_double_bit
;
1675 const struct floatformat
**
1676 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1678 gdb_assert (gdbarch
!= NULL
);
1679 if (gdbarch_debug
>= 2)
1680 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1681 return gdbarch
->long_double_format
;
1685 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1686 const struct floatformat
** long_double_format
)
1688 gdbarch
->long_double_format
= long_double_format
;
1692 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1694 gdb_assert (gdbarch
!= NULL
);
1695 /* Skip verify of ptr_bit, invalid_p == 0 */
1696 if (gdbarch_debug
>= 2)
1697 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1698 return gdbarch
->ptr_bit
;
1702 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1705 gdbarch
->ptr_bit
= ptr_bit
;
1709 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1711 gdb_assert (gdbarch
!= NULL
);
1712 /* Check variable changed from pre-default. */
1713 gdb_assert (gdbarch
->addr_bit
!= 0);
1714 if (gdbarch_debug
>= 2)
1715 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1716 return gdbarch
->addr_bit
;
1720 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1723 gdbarch
->addr_bit
= addr_bit
;
1727 gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
)
1729 gdb_assert (gdbarch
!= NULL
);
1730 /* Check variable changed from pre-default. */
1731 gdb_assert (gdbarch
->dwarf2_addr_size
!= 0);
1732 if (gdbarch_debug
>= 2)
1733 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_addr_size called\n");
1734 return gdbarch
->dwarf2_addr_size
;
1738 set_gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
,
1739 int dwarf2_addr_size
)
1741 gdbarch
->dwarf2_addr_size
= dwarf2_addr_size
;
1745 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1747 gdb_assert (gdbarch
!= NULL
);
1748 /* Check variable changed from pre-default. */
1749 gdb_assert (gdbarch
->char_signed
!= -1);
1750 if (gdbarch_debug
>= 2)
1751 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1752 return gdbarch
->char_signed
;
1756 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1759 gdbarch
->char_signed
= char_signed
;
1763 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1765 gdb_assert (gdbarch
!= NULL
);
1766 return gdbarch
->read_pc
!= NULL
;
1770 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1772 gdb_assert (gdbarch
!= NULL
);
1773 gdb_assert (gdbarch
->read_pc
!= NULL
);
1774 if (gdbarch_debug
>= 2)
1775 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1776 return gdbarch
->read_pc (regcache
);
1780 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1781 gdbarch_read_pc_ftype read_pc
)
1783 gdbarch
->read_pc
= read_pc
;
1787 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1789 gdb_assert (gdbarch
!= NULL
);
1790 return gdbarch
->write_pc
!= NULL
;
1794 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1796 gdb_assert (gdbarch
!= NULL
);
1797 gdb_assert (gdbarch
->write_pc
!= NULL
);
1798 if (gdbarch_debug
>= 2)
1799 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1800 gdbarch
->write_pc (regcache
, val
);
1804 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1805 gdbarch_write_pc_ftype write_pc
)
1807 gdbarch
->write_pc
= write_pc
;
1811 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1813 gdb_assert (gdbarch
!= NULL
);
1814 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1815 if (gdbarch_debug
>= 2)
1816 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1817 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1821 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1822 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1824 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1828 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1830 gdb_assert (gdbarch
!= NULL
);
1831 return gdbarch
->pseudo_register_read
!= NULL
;
1834 enum register_status
1835 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1837 gdb_assert (gdbarch
!= NULL
);
1838 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1839 if (gdbarch_debug
>= 2)
1840 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1841 return gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1845 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1846 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1848 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1852 gdbarch_pseudo_register_read_value_p (struct gdbarch
*gdbarch
)
1854 gdb_assert (gdbarch
!= NULL
);
1855 return gdbarch
->pseudo_register_read_value
!= NULL
;
1859 gdbarch_pseudo_register_read_value (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
)
1861 gdb_assert (gdbarch
!= NULL
);
1862 gdb_assert (gdbarch
->pseudo_register_read_value
!= NULL
);
1863 if (gdbarch_debug
>= 2)
1864 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read_value called\n");
1865 return gdbarch
->pseudo_register_read_value (gdbarch
, regcache
, cookednum
);
1869 set_gdbarch_pseudo_register_read_value (struct gdbarch
*gdbarch
,
1870 gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value
)
1872 gdbarch
->pseudo_register_read_value
= pseudo_register_read_value
;
1876 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1878 gdb_assert (gdbarch
!= NULL
);
1879 return gdbarch
->pseudo_register_write
!= NULL
;
1883 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1885 gdb_assert (gdbarch
!= NULL
);
1886 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1887 if (gdbarch_debug
>= 2)
1888 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1889 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1893 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1894 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1896 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1900 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1902 gdb_assert (gdbarch
!= NULL
);
1903 /* Check variable changed from pre-default. */
1904 gdb_assert (gdbarch
->num_regs
!= -1);
1905 if (gdbarch_debug
>= 2)
1906 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1907 return gdbarch
->num_regs
;
1911 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1914 gdbarch
->num_regs
= num_regs
;
1918 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1920 gdb_assert (gdbarch
!= NULL
);
1921 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1922 if (gdbarch_debug
>= 2)
1923 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1924 return gdbarch
->num_pseudo_regs
;
1928 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1929 int num_pseudo_regs
)
1931 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1935 gdbarch_ax_pseudo_register_collect_p (struct gdbarch
*gdbarch
)
1937 gdb_assert (gdbarch
!= NULL
);
1938 return gdbarch
->ax_pseudo_register_collect
!= NULL
;
1942 gdbarch_ax_pseudo_register_collect (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, int reg
)
1944 gdb_assert (gdbarch
!= NULL
);
1945 gdb_assert (gdbarch
->ax_pseudo_register_collect
!= NULL
);
1946 if (gdbarch_debug
>= 2)
1947 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ax_pseudo_register_collect called\n");
1948 return gdbarch
->ax_pseudo_register_collect (gdbarch
, ax
, reg
);
1952 set_gdbarch_ax_pseudo_register_collect (struct gdbarch
*gdbarch
,
1953 gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect
)
1955 gdbarch
->ax_pseudo_register_collect
= ax_pseudo_register_collect
;
1959 gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch
*gdbarch
)
1961 gdb_assert (gdbarch
!= NULL
);
1962 return gdbarch
->ax_pseudo_register_push_stack
!= NULL
;
1966 gdbarch_ax_pseudo_register_push_stack (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, int reg
)
1968 gdb_assert (gdbarch
!= NULL
);
1969 gdb_assert (gdbarch
->ax_pseudo_register_push_stack
!= NULL
);
1970 if (gdbarch_debug
>= 2)
1971 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ax_pseudo_register_push_stack called\n");
1972 return gdbarch
->ax_pseudo_register_push_stack (gdbarch
, ax
, reg
);
1976 set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch
*gdbarch
,
1977 gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack
)
1979 gdbarch
->ax_pseudo_register_push_stack
= ax_pseudo_register_push_stack
;
1983 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1985 gdb_assert (gdbarch
!= NULL
);
1986 /* Skip verify of sp_regnum, invalid_p == 0 */
1987 if (gdbarch_debug
>= 2)
1988 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1989 return gdbarch
->sp_regnum
;
1993 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1996 gdbarch
->sp_regnum
= sp_regnum
;
2000 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
2002 gdb_assert (gdbarch
!= NULL
);
2003 /* Skip verify of pc_regnum, invalid_p == 0 */
2004 if (gdbarch_debug
>= 2)
2005 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
2006 return gdbarch
->pc_regnum
;
2010 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
2013 gdbarch
->pc_regnum
= pc_regnum
;
2017 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
2019 gdb_assert (gdbarch
!= NULL
);
2020 /* Skip verify of ps_regnum, invalid_p == 0 */
2021 if (gdbarch_debug
>= 2)
2022 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
2023 return gdbarch
->ps_regnum
;
2027 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
2030 gdbarch
->ps_regnum
= ps_regnum
;
2034 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
2036 gdb_assert (gdbarch
!= NULL
);
2037 /* Skip verify of fp0_regnum, invalid_p == 0 */
2038 if (gdbarch_debug
>= 2)
2039 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
2040 return gdbarch
->fp0_regnum
;
2044 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
2047 gdbarch
->fp0_regnum
= fp0_regnum
;
2051 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
2053 gdb_assert (gdbarch
!= NULL
);
2054 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
2055 if (gdbarch_debug
>= 2)
2056 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
2057 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
2061 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
2062 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
2064 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
2068 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
2070 gdb_assert (gdbarch
!= NULL
);
2071 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
2072 if (gdbarch_debug
>= 2)
2073 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
2074 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
2078 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
2079 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
2081 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
2085 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
2087 gdb_assert (gdbarch
!= NULL
);
2088 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
2089 if (gdbarch_debug
>= 2)
2090 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
2091 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
2095 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
2096 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
2098 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
2102 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
2104 gdb_assert (gdbarch
!= NULL
);
2105 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
2106 if (gdbarch_debug
>= 2)
2107 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
2108 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
2112 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
2113 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
2115 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
2119 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
2121 gdb_assert (gdbarch
!= NULL
);
2122 gdb_assert (gdbarch
->register_name
!= NULL
);
2123 if (gdbarch_debug
>= 2)
2124 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
2125 return gdbarch
->register_name (gdbarch
, regnr
);
2129 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
2130 gdbarch_register_name_ftype register_name
)
2132 gdbarch
->register_name
= register_name
;
2136 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
2138 gdb_assert (gdbarch
!= NULL
);
2139 return gdbarch
->register_type
!= NULL
;
2143 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
2145 gdb_assert (gdbarch
!= NULL
);
2146 gdb_assert (gdbarch
->register_type
!= NULL
);
2147 if (gdbarch_debug
>= 2)
2148 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
2149 return gdbarch
->register_type (gdbarch
, reg_nr
);
2153 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
2154 gdbarch_register_type_ftype register_type
)
2156 gdbarch
->register_type
= register_type
;
2160 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
2162 gdb_assert (gdbarch
!= NULL
);
2163 return gdbarch
->dummy_id
!= NULL
;
2167 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
2169 gdb_assert (gdbarch
!= NULL
);
2170 gdb_assert (gdbarch
->dummy_id
!= NULL
);
2171 if (gdbarch_debug
>= 2)
2172 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
2173 return gdbarch
->dummy_id (gdbarch
, this_frame
);
2177 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
2178 gdbarch_dummy_id_ftype dummy_id
)
2180 gdbarch
->dummy_id
= dummy_id
;
2184 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
2186 gdb_assert (gdbarch
!= NULL
);
2187 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2188 if (gdbarch_debug
>= 2)
2189 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
2190 return gdbarch
->deprecated_fp_regnum
;
2194 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
2195 int deprecated_fp_regnum
)
2197 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
2201 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
2203 gdb_assert (gdbarch
!= NULL
);
2204 return gdbarch
->push_dummy_call
!= NULL
;
2208 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
)
2210 gdb_assert (gdbarch
!= NULL
);
2211 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
2212 if (gdbarch_debug
>= 2)
2213 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
2214 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
2218 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
2219 gdbarch_push_dummy_call_ftype push_dummy_call
)
2221 gdbarch
->push_dummy_call
= push_dummy_call
;
2225 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
2227 gdb_assert (gdbarch
!= NULL
);
2228 /* Skip verify of call_dummy_location, invalid_p == 0 */
2229 if (gdbarch_debug
>= 2)
2230 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
2231 return gdbarch
->call_dummy_location
;
2235 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
2236 int call_dummy_location
)
2238 gdbarch
->call_dummy_location
= call_dummy_location
;
2242 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2244 gdb_assert (gdbarch
!= NULL
);
2245 return gdbarch
->push_dummy_code
!= NULL
;
2249 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
)
2251 gdb_assert (gdbarch
!= NULL
);
2252 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2253 if (gdbarch_debug
>= 2)
2254 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2255 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
2259 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2260 gdbarch_push_dummy_code_ftype push_dummy_code
)
2262 gdbarch
->push_dummy_code
= push_dummy_code
;
2266 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2268 gdb_assert (gdbarch
!= NULL
);
2269 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2270 if (gdbarch_debug
>= 2)
2271 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2272 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2276 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2277 gdbarch_print_registers_info_ftype print_registers_info
)
2279 gdbarch
->print_registers_info
= print_registers_info
;
2283 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2285 gdb_assert (gdbarch
!= NULL
);
2286 return gdbarch
->print_float_info
!= NULL
;
2290 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2292 gdb_assert (gdbarch
!= NULL
);
2293 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2294 if (gdbarch_debug
>= 2)
2295 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2296 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2300 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2301 gdbarch_print_float_info_ftype print_float_info
)
2303 gdbarch
->print_float_info
= print_float_info
;
2307 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2309 gdb_assert (gdbarch
!= NULL
);
2310 return gdbarch
->print_vector_info
!= NULL
;
2314 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2316 gdb_assert (gdbarch
!= NULL
);
2317 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2318 if (gdbarch_debug
>= 2)
2319 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2320 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2324 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2325 gdbarch_print_vector_info_ftype print_vector_info
)
2327 gdbarch
->print_vector_info
= print_vector_info
;
2331 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2333 gdb_assert (gdbarch
!= NULL
);
2334 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2335 if (gdbarch_debug
>= 2)
2336 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2337 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
2341 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2342 gdbarch_register_sim_regno_ftype register_sim_regno
)
2344 gdbarch
->register_sim_regno
= register_sim_regno
;
2348 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2350 gdb_assert (gdbarch
!= NULL
);
2351 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2352 if (gdbarch_debug
>= 2)
2353 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2354 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
2358 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2359 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2361 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2365 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2367 gdb_assert (gdbarch
!= NULL
);
2368 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2369 if (gdbarch_debug
>= 2)
2370 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2371 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
2375 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2376 gdbarch_cannot_store_register_ftype cannot_store_register
)
2378 gdbarch
->cannot_store_register
= cannot_store_register
;
2382 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2384 gdb_assert (gdbarch
!= NULL
);
2385 return gdbarch
->get_longjmp_target
!= NULL
;
2389 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
2391 gdb_assert (gdbarch
!= NULL
);
2392 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2393 if (gdbarch_debug
>= 2)
2394 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2395 return gdbarch
->get_longjmp_target (frame
, pc
);
2399 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2400 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2402 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2406 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2408 gdb_assert (gdbarch
!= NULL
);
2409 if (gdbarch_debug
>= 2)
2410 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2411 return gdbarch
->believe_pcc_promotion
;
2415 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2416 int believe_pcc_promotion
)
2418 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2422 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2424 gdb_assert (gdbarch
!= NULL
);
2425 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2426 if (gdbarch_debug
>= 2)
2427 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2428 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
2432 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2433 gdbarch_convert_register_p_ftype convert_register_p
)
2435 gdbarch
->convert_register_p
= convert_register_p
;
2439 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
, int *optimizedp
, int *unavailablep
)
2441 gdb_assert (gdbarch
!= NULL
);
2442 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2443 if (gdbarch_debug
>= 2)
2444 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2445 return gdbarch
->register_to_value (frame
, regnum
, type
, buf
, optimizedp
, unavailablep
);
2449 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2450 gdbarch_register_to_value_ftype register_to_value
)
2452 gdbarch
->register_to_value
= register_to_value
;
2456 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2458 gdb_assert (gdbarch
!= NULL
);
2459 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2460 if (gdbarch_debug
>= 2)
2461 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2462 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2466 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2467 gdbarch_value_to_register_ftype value_to_register
)
2469 gdbarch
->value_to_register
= value_to_register
;
2473 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2475 gdb_assert (gdbarch
!= NULL
);
2476 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2477 if (gdbarch_debug
>= 2)
2478 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2479 return gdbarch
->value_from_register (type
, regnum
, frame
);
2483 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2484 gdbarch_value_from_register_ftype value_from_register
)
2486 gdbarch
->value_from_register
= value_from_register
;
2490 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2492 gdb_assert (gdbarch
!= NULL
);
2493 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2494 if (gdbarch_debug
>= 2)
2495 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2496 return gdbarch
->pointer_to_address (gdbarch
, type
, buf
);
2500 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2501 gdbarch_pointer_to_address_ftype pointer_to_address
)
2503 gdbarch
->pointer_to_address
= pointer_to_address
;
2507 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2509 gdb_assert (gdbarch
!= NULL
);
2510 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2511 if (gdbarch_debug
>= 2)
2512 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2513 gdbarch
->address_to_pointer (gdbarch
, type
, buf
, addr
);
2517 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2518 gdbarch_address_to_pointer_ftype address_to_pointer
)
2520 gdbarch
->address_to_pointer
= address_to_pointer
;
2524 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2526 gdb_assert (gdbarch
!= NULL
);
2527 return gdbarch
->integer_to_address
!= NULL
;
2531 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2533 gdb_assert (gdbarch
!= NULL
);
2534 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2535 if (gdbarch_debug
>= 2)
2536 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2537 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2541 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2542 gdbarch_integer_to_address_ftype integer_to_address
)
2544 gdbarch
->integer_to_address
= integer_to_address
;
2548 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2550 gdb_assert (gdbarch
!= NULL
);
2551 return gdbarch
->return_value
!= NULL
;
2554 enum return_value_convention
2555 gdbarch_return_value (struct gdbarch
*gdbarch
, struct value
*function
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2557 gdb_assert (gdbarch
!= NULL
);
2558 gdb_assert (gdbarch
->return_value
!= NULL
);
2559 if (gdbarch_debug
>= 2)
2560 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2561 return gdbarch
->return_value (gdbarch
, function
, valtype
, regcache
, readbuf
, writebuf
);
2565 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2566 gdbarch_return_value_ftype return_value
)
2568 gdbarch
->return_value
= return_value
;
2572 gdbarch_return_in_first_hidden_param_p (struct gdbarch
*gdbarch
, struct type
*type
)
2574 gdb_assert (gdbarch
!= NULL
);
2575 gdb_assert (gdbarch
->return_in_first_hidden_param_p
!= NULL
);
2576 if (gdbarch_debug
>= 2)
2577 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_in_first_hidden_param_p called\n");
2578 return gdbarch
->return_in_first_hidden_param_p (gdbarch
, type
);
2582 set_gdbarch_return_in_first_hidden_param_p (struct gdbarch
*gdbarch
,
2583 gdbarch_return_in_first_hidden_param_p_ftype return_in_first_hidden_param_p
)
2585 gdbarch
->return_in_first_hidden_param_p
= return_in_first_hidden_param_p
;
2589 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2591 gdb_assert (gdbarch
!= NULL
);
2592 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2593 if (gdbarch_debug
>= 2)
2594 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2595 return gdbarch
->skip_prologue (gdbarch
, ip
);
2599 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2600 gdbarch_skip_prologue_ftype skip_prologue
)
2602 gdbarch
->skip_prologue
= skip_prologue
;
2606 gdbarch_skip_main_prologue_p (struct gdbarch
*gdbarch
)
2608 gdb_assert (gdbarch
!= NULL
);
2609 return gdbarch
->skip_main_prologue
!= NULL
;
2613 gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2615 gdb_assert (gdbarch
!= NULL
);
2616 gdb_assert (gdbarch
->skip_main_prologue
!= NULL
);
2617 if (gdbarch_debug
>= 2)
2618 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_main_prologue called\n");
2619 return gdbarch
->skip_main_prologue (gdbarch
, ip
);
2623 set_gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
,
2624 gdbarch_skip_main_prologue_ftype skip_main_prologue
)
2626 gdbarch
->skip_main_prologue
= skip_main_prologue
;
2630 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2632 gdb_assert (gdbarch
!= NULL
);
2633 gdb_assert (gdbarch
->inner_than
!= NULL
);
2634 if (gdbarch_debug
>= 2)
2635 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2636 return gdbarch
->inner_than (lhs
, rhs
);
2640 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2641 gdbarch_inner_than_ftype inner_than
)
2643 gdbarch
->inner_than
= inner_than
;
2647 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2649 gdb_assert (gdbarch
!= NULL
);
2650 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2651 if (gdbarch_debug
>= 2)
2652 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2653 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2657 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2658 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2660 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2664 gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *kindptr
)
2666 gdb_assert (gdbarch
!= NULL
);
2667 gdb_assert (gdbarch
->remote_breakpoint_from_pc
!= NULL
);
2668 if (gdbarch_debug
>= 2)
2669 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_breakpoint_from_pc called\n");
2670 gdbarch
->remote_breakpoint_from_pc (gdbarch
, pcptr
, kindptr
);
2674 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2675 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc
)
2677 gdbarch
->remote_breakpoint_from_pc
= remote_breakpoint_from_pc
;
2681 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2683 gdb_assert (gdbarch
!= NULL
);
2684 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2688 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2690 gdb_assert (gdbarch
!= NULL
);
2691 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2692 if (gdbarch_debug
>= 2)
2693 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2694 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2698 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2699 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2701 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2705 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2707 gdb_assert (gdbarch
!= NULL
);
2708 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2709 if (gdbarch_debug
>= 2)
2710 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2711 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2715 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2716 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2718 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2722 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2724 gdb_assert (gdbarch
!= NULL
);
2725 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2726 if (gdbarch_debug
>= 2)
2727 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2728 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2732 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2733 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2735 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2739 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2741 gdb_assert (gdbarch
!= NULL
);
2742 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2743 if (gdbarch_debug
>= 2)
2744 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2745 return gdbarch
->decr_pc_after_break
;
2749 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2750 CORE_ADDR decr_pc_after_break
)
2752 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2756 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2758 gdb_assert (gdbarch
!= NULL
);
2759 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2760 if (gdbarch_debug
>= 2)
2761 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2762 return gdbarch
->deprecated_function_start_offset
;
2766 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2767 CORE_ADDR deprecated_function_start_offset
)
2769 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2773 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2775 gdb_assert (gdbarch
!= NULL
);
2776 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2777 if (gdbarch_debug
>= 2)
2778 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2779 return gdbarch
->remote_register_number (gdbarch
, regno
);
2783 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2784 gdbarch_remote_register_number_ftype remote_register_number
)
2786 gdbarch
->remote_register_number
= remote_register_number
;
2790 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2792 gdb_assert (gdbarch
!= NULL
);
2793 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2797 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2799 gdb_assert (gdbarch
!= NULL
);
2800 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2801 if (gdbarch_debug
>= 2)
2802 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2803 return gdbarch
->fetch_tls_load_module_address (objfile
);
2807 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2808 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2810 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2814 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2816 gdb_assert (gdbarch
!= NULL
);
2817 /* Skip verify of frame_args_skip, invalid_p == 0 */
2818 if (gdbarch_debug
>= 2)
2819 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2820 return gdbarch
->frame_args_skip
;
2824 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2825 CORE_ADDR frame_args_skip
)
2827 gdbarch
->frame_args_skip
= frame_args_skip
;
2831 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2833 gdb_assert (gdbarch
!= NULL
);
2834 return gdbarch
->unwind_pc
!= NULL
;
2838 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2840 gdb_assert (gdbarch
!= NULL
);
2841 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2842 if (gdbarch_debug
>= 2)
2843 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2844 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2848 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2849 gdbarch_unwind_pc_ftype unwind_pc
)
2851 gdbarch
->unwind_pc
= unwind_pc
;
2855 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2857 gdb_assert (gdbarch
!= NULL
);
2858 return gdbarch
->unwind_sp
!= NULL
;
2862 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2864 gdb_assert (gdbarch
!= NULL
);
2865 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2866 if (gdbarch_debug
>= 2)
2867 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2868 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2872 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2873 gdbarch_unwind_sp_ftype unwind_sp
)
2875 gdbarch
->unwind_sp
= unwind_sp
;
2879 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2881 gdb_assert (gdbarch
!= NULL
);
2882 return gdbarch
->frame_num_args
!= NULL
;
2886 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2888 gdb_assert (gdbarch
!= NULL
);
2889 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2890 if (gdbarch_debug
>= 2)
2891 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2892 return gdbarch
->frame_num_args (frame
);
2896 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2897 gdbarch_frame_num_args_ftype frame_num_args
)
2899 gdbarch
->frame_num_args
= frame_num_args
;
2903 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2905 gdb_assert (gdbarch
!= NULL
);
2906 return gdbarch
->frame_align
!= NULL
;
2910 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2912 gdb_assert (gdbarch
!= NULL
);
2913 gdb_assert (gdbarch
->frame_align
!= NULL
);
2914 if (gdbarch_debug
>= 2)
2915 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2916 return gdbarch
->frame_align (gdbarch
, address
);
2920 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2921 gdbarch_frame_align_ftype frame_align
)
2923 gdbarch
->frame_align
= frame_align
;
2927 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2929 gdb_assert (gdbarch
!= NULL
);
2930 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2931 if (gdbarch_debug
>= 2)
2932 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2933 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2937 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2938 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2940 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2944 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2946 gdb_assert (gdbarch
!= NULL
);
2947 if (gdbarch_debug
>= 2)
2948 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2949 return gdbarch
->frame_red_zone_size
;
2953 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2954 int frame_red_zone_size
)
2956 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2960 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2962 gdb_assert (gdbarch
!= NULL
);
2963 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2964 if (gdbarch_debug
>= 2)
2965 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2966 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2970 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2971 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2973 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2977 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2979 gdb_assert (gdbarch
!= NULL
);
2980 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2981 if (gdbarch_debug
>= 2)
2982 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2983 return gdbarch
->addr_bits_remove (gdbarch
, addr
);
2987 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2988 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2990 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2994 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2996 gdb_assert (gdbarch
!= NULL
);
2997 return gdbarch
->software_single_step
!= NULL
;
3001 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3003 gdb_assert (gdbarch
!= NULL
);
3004 gdb_assert (gdbarch
->software_single_step
!= NULL
);
3005 if (gdbarch_debug
>= 2)
3006 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
3007 return gdbarch
->software_single_step (frame
);
3011 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
3012 gdbarch_software_single_step_ftype software_single_step
)
3014 gdbarch
->software_single_step
= software_single_step
;
3018 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
3020 gdb_assert (gdbarch
!= NULL
);
3021 return gdbarch
->single_step_through_delay
!= NULL
;
3025 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3027 gdb_assert (gdbarch
!= NULL
);
3028 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
3029 if (gdbarch_debug
>= 2)
3030 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
3031 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
3035 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
3036 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
3038 gdbarch
->single_step_through_delay
= single_step_through_delay
;
3042 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
3044 gdb_assert (gdbarch
!= NULL
);
3045 gdb_assert (gdbarch
->print_insn
!= NULL
);
3046 if (gdbarch_debug
>= 2)
3047 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
3048 return gdbarch
->print_insn (vma
, info
);
3052 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
3053 gdbarch_print_insn_ftype print_insn
)
3055 gdbarch
->print_insn
= print_insn
;
3059 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
3061 gdb_assert (gdbarch
!= NULL
);
3062 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
3063 if (gdbarch_debug
>= 2)
3064 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
3065 return gdbarch
->skip_trampoline_code (frame
, pc
);
3069 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
3070 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
3072 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
3076 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3078 gdb_assert (gdbarch
!= NULL
);
3079 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
3080 if (gdbarch_debug
>= 2)
3081 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
3082 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
3086 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
3087 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
3089 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
3093 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, const char *name
)
3095 gdb_assert (gdbarch
!= NULL
);
3096 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
3097 if (gdbarch_debug
>= 2)
3098 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
3099 return gdbarch
->in_solib_return_trampoline (gdbarch
, pc
, name
);
3103 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
3104 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
3106 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
3110 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3112 gdb_assert (gdbarch
!= NULL
);
3113 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
3114 if (gdbarch_debug
>= 2)
3115 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
3116 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
3120 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
3121 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
3123 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
3127 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
3129 gdb_assert (gdbarch
!= NULL
);
3130 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
3131 if (gdbarch_debug
>= 2)
3132 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
3133 gdbarch
->elf_make_msymbol_special (sym
, msym
);
3137 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
3138 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
3140 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
3144 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
3146 gdb_assert (gdbarch
!= NULL
);
3147 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
3148 if (gdbarch_debug
>= 2)
3149 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
3150 gdbarch
->coff_make_msymbol_special (val
, msym
);
3154 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
3155 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
3157 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
3161 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
3163 gdb_assert (gdbarch
!= NULL
);
3164 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3165 if (gdbarch_debug
>= 2)
3166 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
3167 return gdbarch
->cannot_step_breakpoint
;
3171 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
3172 int cannot_step_breakpoint
)
3174 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
3178 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
3180 gdb_assert (gdbarch
!= NULL
);
3181 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3182 if (gdbarch_debug
>= 2)
3183 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
3184 return gdbarch
->have_nonsteppable_watchpoint
;
3188 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
3189 int have_nonsteppable_watchpoint
)
3191 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
3195 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
3197 gdb_assert (gdbarch
!= NULL
);
3198 return gdbarch
->address_class_type_flags
!= NULL
;
3202 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
3204 gdb_assert (gdbarch
!= NULL
);
3205 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
3206 if (gdbarch_debug
>= 2)
3207 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
3208 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
3212 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
3213 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
3215 gdbarch
->address_class_type_flags
= address_class_type_flags
;
3219 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
3221 gdb_assert (gdbarch
!= NULL
);
3222 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
3226 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
3228 gdb_assert (gdbarch
!= NULL
);
3229 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
3230 if (gdbarch_debug
>= 2)
3231 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
3232 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
3236 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
3237 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3239 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3243 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3245 gdb_assert (gdbarch
!= NULL
);
3246 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3250 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3252 gdb_assert (gdbarch
!= NULL
);
3253 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3254 if (gdbarch_debug
>= 2)
3255 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3256 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3260 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3261 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3263 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3267 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3269 gdb_assert (gdbarch
!= NULL
);
3270 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3271 if (gdbarch_debug
>= 2)
3272 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3273 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3277 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3278 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3280 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3284 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3286 gdb_assert (gdbarch
!= NULL
);
3287 return gdbarch
->fetch_pointer_argument
!= NULL
;
3291 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3293 gdb_assert (gdbarch
!= NULL
);
3294 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3295 if (gdbarch_debug
>= 2)
3296 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3297 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3301 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3302 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3304 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3308 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3310 gdb_assert (gdbarch
!= NULL
);
3311 return gdbarch
->regset_from_core_section
!= NULL
;
3314 const struct regset
*
3315 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3317 gdb_assert (gdbarch
!= NULL
);
3318 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3319 if (gdbarch_debug
>= 2)
3320 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3321 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3325 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3326 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3328 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3331 struct core_regset_section
*
3332 gdbarch_core_regset_sections (struct gdbarch
*gdbarch
)
3334 gdb_assert (gdbarch
!= NULL
);
3335 if (gdbarch_debug
>= 2)
3336 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_regset_sections called\n");
3337 return gdbarch
->core_regset_sections
;
3341 set_gdbarch_core_regset_sections (struct gdbarch
*gdbarch
,
3342 struct core_regset_section
* core_regset_sections
)
3344 gdbarch
->core_regset_sections
= core_regset_sections
;
3348 gdbarch_make_corefile_notes_p (struct gdbarch
*gdbarch
)
3350 gdb_assert (gdbarch
!= NULL
);
3351 return gdbarch
->make_corefile_notes
!= NULL
;
3355 gdbarch_make_corefile_notes (struct gdbarch
*gdbarch
, bfd
*obfd
, int *note_size
)
3357 gdb_assert (gdbarch
!= NULL
);
3358 gdb_assert (gdbarch
->make_corefile_notes
!= NULL
);
3359 if (gdbarch_debug
>= 2)
3360 fprintf_unfiltered (gdb_stdlog
, "gdbarch_make_corefile_notes called\n");
3361 return gdbarch
->make_corefile_notes (gdbarch
, obfd
, note_size
);
3365 set_gdbarch_make_corefile_notes (struct gdbarch
*gdbarch
,
3366 gdbarch_make_corefile_notes_ftype make_corefile_notes
)
3368 gdbarch
->make_corefile_notes
= make_corefile_notes
;
3372 gdbarch_find_memory_regions_p (struct gdbarch
*gdbarch
)
3374 gdb_assert (gdbarch
!= NULL
);
3375 return gdbarch
->find_memory_regions
!= NULL
;
3379 gdbarch_find_memory_regions (struct gdbarch
*gdbarch
, find_memory_region_ftype func
, void *data
)
3381 gdb_assert (gdbarch
!= NULL
);
3382 gdb_assert (gdbarch
->find_memory_regions
!= NULL
);
3383 if (gdbarch_debug
>= 2)
3384 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_memory_regions called\n");
3385 return gdbarch
->find_memory_regions (gdbarch
, func
, data
);
3389 set_gdbarch_find_memory_regions (struct gdbarch
*gdbarch
,
3390 gdbarch_find_memory_regions_ftype find_memory_regions
)
3392 gdbarch
->find_memory_regions
= find_memory_regions
;
3396 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
3398 gdb_assert (gdbarch
!= NULL
);
3399 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
3403 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
3405 gdb_assert (gdbarch
!= NULL
);
3406 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
3407 if (gdbarch_debug
>= 2)
3408 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
3409 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
3413 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
3414 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
3416 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
3420 gdbarch_core_pid_to_str_p (struct gdbarch
*gdbarch
)
3422 gdb_assert (gdbarch
!= NULL
);
3423 return gdbarch
->core_pid_to_str
!= NULL
;
3427 gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
, ptid_t ptid
)
3429 gdb_assert (gdbarch
!= NULL
);
3430 gdb_assert (gdbarch
->core_pid_to_str
!= NULL
);
3431 if (gdbarch_debug
>= 2)
3432 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_pid_to_str called\n");
3433 return gdbarch
->core_pid_to_str (gdbarch
, ptid
);
3437 set_gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
,
3438 gdbarch_core_pid_to_str_ftype core_pid_to_str
)
3440 gdbarch
->core_pid_to_str
= core_pid_to_str
;
3444 gdbarch_gcore_bfd_target_p (struct gdbarch
*gdbarch
)
3446 gdb_assert (gdbarch
!= NULL
);
3447 return gdbarch
->gcore_bfd_target
!= 0;
3451 gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
)
3453 gdb_assert (gdbarch
!= NULL
);
3454 /* Check variable changed from pre-default. */
3455 gdb_assert (gdbarch
->gcore_bfd_target
!= 0);
3456 if (gdbarch_debug
>= 2)
3457 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gcore_bfd_target called\n");
3458 return gdbarch
->gcore_bfd_target
;
3462 set_gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
,
3463 const char * gcore_bfd_target
)
3465 gdbarch
->gcore_bfd_target
= gcore_bfd_target
;
3469 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
3471 gdb_assert (gdbarch
!= NULL
);
3472 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3473 if (gdbarch_debug
>= 2)
3474 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
3475 return gdbarch
->vtable_function_descriptors
;
3479 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
3480 int vtable_function_descriptors
)
3482 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
3486 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
3488 gdb_assert (gdbarch
!= NULL
);
3489 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3490 if (gdbarch_debug
>= 2)
3491 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
3492 return gdbarch
->vbit_in_delta
;
3496 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
3499 gdbarch
->vbit_in_delta
= vbit_in_delta
;
3503 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
3505 gdb_assert (gdbarch
!= NULL
);
3506 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
3510 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
3512 gdb_assert (gdbarch
!= NULL
);
3513 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
3514 if (gdbarch_debug
>= 2)
3515 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
3516 gdbarch
->skip_permanent_breakpoint (regcache
);
3520 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3521 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3523 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3527 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
3529 gdb_assert (gdbarch
!= NULL
);
3530 return gdbarch
->max_insn_length
!= 0;
3534 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
3536 gdb_assert (gdbarch
!= NULL
);
3537 /* Check variable changed from pre-default. */
3538 gdb_assert (gdbarch
->max_insn_length
!= 0);
3539 if (gdbarch_debug
>= 2)
3540 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
3541 return gdbarch
->max_insn_length
;
3545 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
3546 ULONGEST max_insn_length
)
3548 gdbarch
->max_insn_length
= max_insn_length
;
3552 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
3554 gdb_assert (gdbarch
!= NULL
);
3555 return gdbarch
->displaced_step_copy_insn
!= NULL
;
3558 struct displaced_step_closure
*
3559 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3561 gdb_assert (gdbarch
!= NULL
);
3562 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
3563 if (gdbarch_debug
>= 2)
3564 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3565 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3569 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3570 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3572 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3576 gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3578 gdb_assert (gdbarch
!= NULL
);
3579 gdb_assert (gdbarch
->displaced_step_hw_singlestep
!= NULL
);
3580 if (gdbarch_debug
>= 2)
3581 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_hw_singlestep called\n");
3582 return gdbarch
->displaced_step_hw_singlestep (gdbarch
, closure
);
3586 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
,
3587 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep
)
3589 gdbarch
->displaced_step_hw_singlestep
= displaced_step_hw_singlestep
;
3593 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3595 gdb_assert (gdbarch
!= NULL
);
3596 return gdbarch
->displaced_step_fixup
!= NULL
;
3600 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3602 gdb_assert (gdbarch
!= NULL
);
3603 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3604 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3605 if (gdbarch_debug
>= 2)
3606 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3607 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3611 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3612 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3614 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3618 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3620 gdb_assert (gdbarch
!= NULL
);
3621 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3622 if (gdbarch_debug
>= 2)
3623 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3624 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3628 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3629 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3631 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3635 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3637 gdb_assert (gdbarch
!= NULL
);
3638 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3639 if (gdbarch_debug
>= 2)
3640 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3641 return gdbarch
->displaced_step_location (gdbarch
);
3645 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3646 gdbarch_displaced_step_location_ftype displaced_step_location
)
3648 gdbarch
->displaced_step_location
= displaced_step_location
;
3652 gdbarch_relocate_instruction_p (struct gdbarch
*gdbarch
)
3654 gdb_assert (gdbarch
!= NULL
);
3655 return gdbarch
->relocate_instruction
!= NULL
;
3659 gdbarch_relocate_instruction (struct gdbarch
*gdbarch
, CORE_ADDR
*to
, CORE_ADDR from
)
3661 gdb_assert (gdbarch
!= NULL
);
3662 gdb_assert (gdbarch
->relocate_instruction
!= NULL
);
3663 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3664 if (gdbarch_debug
>= 2)
3665 fprintf_unfiltered (gdb_stdlog
, "gdbarch_relocate_instruction called\n");
3666 gdbarch
->relocate_instruction (gdbarch
, to
, from
);
3670 set_gdbarch_relocate_instruction (struct gdbarch
*gdbarch
,
3671 gdbarch_relocate_instruction_ftype relocate_instruction
)
3673 gdbarch
->relocate_instruction
= relocate_instruction
;
3677 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3679 gdb_assert (gdbarch
!= NULL
);
3680 return gdbarch
->overlay_update
!= NULL
;
3684 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3686 gdb_assert (gdbarch
!= NULL
);
3687 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3688 if (gdbarch_debug
>= 2)
3689 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3690 gdbarch
->overlay_update (osect
);
3694 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3695 gdbarch_overlay_update_ftype overlay_update
)
3697 gdbarch
->overlay_update
= overlay_update
;
3701 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3703 gdb_assert (gdbarch
!= NULL
);
3704 return gdbarch
->core_read_description
!= NULL
;
3707 const struct target_desc
*
3708 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3710 gdb_assert (gdbarch
!= NULL
);
3711 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3712 if (gdbarch_debug
>= 2)
3713 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3714 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3718 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3719 gdbarch_core_read_description_ftype core_read_description
)
3721 gdbarch
->core_read_description
= core_read_description
;
3725 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3727 gdb_assert (gdbarch
!= NULL
);
3728 return gdbarch
->static_transform_name
!= NULL
;
3732 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, const char *name
)
3734 gdb_assert (gdbarch
!= NULL
);
3735 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3736 if (gdbarch_debug
>= 2)
3737 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3738 return gdbarch
->static_transform_name (name
);
3742 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3743 gdbarch_static_transform_name_ftype static_transform_name
)
3745 gdbarch
->static_transform_name
= static_transform_name
;
3749 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3751 gdb_assert (gdbarch
!= NULL
);
3752 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3753 if (gdbarch_debug
>= 2)
3754 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3755 return gdbarch
->sofun_address_maybe_missing
;
3759 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3760 int sofun_address_maybe_missing
)
3762 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3766 gdbarch_process_record_p (struct gdbarch
*gdbarch
)
3768 gdb_assert (gdbarch
!= NULL
);
3769 return gdbarch
->process_record
!= NULL
;
3773 gdbarch_process_record (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR addr
)
3775 gdb_assert (gdbarch
!= NULL
);
3776 gdb_assert (gdbarch
->process_record
!= NULL
);
3777 if (gdbarch_debug
>= 2)
3778 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record called\n");
3779 return gdbarch
->process_record (gdbarch
, regcache
, addr
);
3783 set_gdbarch_process_record (struct gdbarch
*gdbarch
,
3784 gdbarch_process_record_ftype process_record
)
3786 gdbarch
->process_record
= process_record
;
3790 gdbarch_process_record_signal_p (struct gdbarch
*gdbarch
)
3792 gdb_assert (gdbarch
!= NULL
);
3793 return gdbarch
->process_record_signal
!= NULL
;
3797 gdbarch_process_record_signal (struct gdbarch
*gdbarch
, struct regcache
*regcache
, enum gdb_signal signal
)
3799 gdb_assert (gdbarch
!= NULL
);
3800 gdb_assert (gdbarch
->process_record_signal
!= NULL
);
3801 if (gdbarch_debug
>= 2)
3802 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record_signal called\n");
3803 return gdbarch
->process_record_signal (gdbarch
, regcache
, signal
);
3807 set_gdbarch_process_record_signal (struct gdbarch
*gdbarch
,
3808 gdbarch_process_record_signal_ftype process_record_signal
)
3810 gdbarch
->process_record_signal
= process_record_signal
;
3814 gdbarch_gdb_signal_from_target_p (struct gdbarch
*gdbarch
)
3816 gdb_assert (gdbarch
!= NULL
);
3817 return gdbarch
->gdb_signal_from_target
!= NULL
;
3821 gdbarch_gdb_signal_from_target (struct gdbarch
*gdbarch
, int signo
)
3823 gdb_assert (gdbarch
!= NULL
);
3824 gdb_assert (gdbarch
->gdb_signal_from_target
!= NULL
);
3825 if (gdbarch_debug
>= 2)
3826 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gdb_signal_from_target called\n");
3827 return gdbarch
->gdb_signal_from_target (gdbarch
, signo
);
3831 set_gdbarch_gdb_signal_from_target (struct gdbarch
*gdbarch
,
3832 gdbarch_gdb_signal_from_target_ftype gdb_signal_from_target
)
3834 gdbarch
->gdb_signal_from_target
= gdb_signal_from_target
;
3838 gdbarch_get_siginfo_type_p (struct gdbarch
*gdbarch
)
3840 gdb_assert (gdbarch
!= NULL
);
3841 return gdbarch
->get_siginfo_type
!= NULL
;
3845 gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
)
3847 gdb_assert (gdbarch
!= NULL
);
3848 gdb_assert (gdbarch
->get_siginfo_type
!= NULL
);
3849 if (gdbarch_debug
>= 2)
3850 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_siginfo_type called\n");
3851 return gdbarch
->get_siginfo_type (gdbarch
);
3855 set_gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
,
3856 gdbarch_get_siginfo_type_ftype get_siginfo_type
)
3858 gdbarch
->get_siginfo_type
= get_siginfo_type
;
3862 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3864 gdb_assert (gdbarch
!= NULL
);
3865 return gdbarch
->record_special_symbol
!= NULL
;
3869 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3871 gdb_assert (gdbarch
!= NULL
);
3872 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3873 if (gdbarch_debug
>= 2)
3874 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3875 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3879 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3880 gdbarch_record_special_symbol_ftype record_special_symbol
)
3882 gdbarch
->record_special_symbol
= record_special_symbol
;
3886 gdbarch_get_syscall_number_p (struct gdbarch
*gdbarch
)
3888 gdb_assert (gdbarch
!= NULL
);
3889 return gdbarch
->get_syscall_number
!= NULL
;
3893 gdbarch_get_syscall_number (struct gdbarch
*gdbarch
, ptid_t ptid
)
3895 gdb_assert (gdbarch
!= NULL
);
3896 gdb_assert (gdbarch
->get_syscall_number
!= NULL
);
3897 if (gdbarch_debug
>= 2)
3898 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_syscall_number called\n");
3899 return gdbarch
->get_syscall_number (gdbarch
, ptid
);
3903 set_gdbarch_get_syscall_number (struct gdbarch
*gdbarch
,
3904 gdbarch_get_syscall_number_ftype get_syscall_number
)
3906 gdbarch
->get_syscall_number
= get_syscall_number
;
3910 gdbarch_stap_integer_prefix (struct gdbarch
*gdbarch
)
3912 gdb_assert (gdbarch
!= NULL
);
3913 /* Skip verify of stap_integer_prefix, invalid_p == 0 */
3914 if (gdbarch_debug
>= 2)
3915 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_integer_prefix called\n");
3916 return gdbarch
->stap_integer_prefix
;
3920 set_gdbarch_stap_integer_prefix (struct gdbarch
*gdbarch
,
3921 const char * stap_integer_prefix
)
3923 gdbarch
->stap_integer_prefix
= stap_integer_prefix
;
3927 gdbarch_stap_integer_suffix (struct gdbarch
*gdbarch
)
3929 gdb_assert (gdbarch
!= NULL
);
3930 /* Skip verify of stap_integer_suffix, invalid_p == 0 */
3931 if (gdbarch_debug
>= 2)
3932 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_integer_suffix called\n");
3933 return gdbarch
->stap_integer_suffix
;
3937 set_gdbarch_stap_integer_suffix (struct gdbarch
*gdbarch
,
3938 const char * stap_integer_suffix
)
3940 gdbarch
->stap_integer_suffix
= stap_integer_suffix
;
3944 gdbarch_stap_register_prefix (struct gdbarch
*gdbarch
)
3946 gdb_assert (gdbarch
!= NULL
);
3947 /* Skip verify of stap_register_prefix, invalid_p == 0 */
3948 if (gdbarch_debug
>= 2)
3949 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_prefix called\n");
3950 return gdbarch
->stap_register_prefix
;
3954 set_gdbarch_stap_register_prefix (struct gdbarch
*gdbarch
,
3955 const char * stap_register_prefix
)
3957 gdbarch
->stap_register_prefix
= stap_register_prefix
;
3961 gdbarch_stap_register_suffix (struct gdbarch
*gdbarch
)
3963 gdb_assert (gdbarch
!= NULL
);
3964 /* Skip verify of stap_register_suffix, invalid_p == 0 */
3965 if (gdbarch_debug
>= 2)
3966 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_suffix called\n");
3967 return gdbarch
->stap_register_suffix
;
3971 set_gdbarch_stap_register_suffix (struct gdbarch
*gdbarch
,
3972 const char * stap_register_suffix
)
3974 gdbarch
->stap_register_suffix
= stap_register_suffix
;
3978 gdbarch_stap_register_indirection_prefix (struct gdbarch
*gdbarch
)
3980 gdb_assert (gdbarch
!= NULL
);
3981 /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */
3982 if (gdbarch_debug
>= 2)
3983 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_indirection_prefix called\n");
3984 return gdbarch
->stap_register_indirection_prefix
;
3988 set_gdbarch_stap_register_indirection_prefix (struct gdbarch
*gdbarch
,
3989 const char * stap_register_indirection_prefix
)
3991 gdbarch
->stap_register_indirection_prefix
= stap_register_indirection_prefix
;
3995 gdbarch_stap_register_indirection_suffix (struct gdbarch
*gdbarch
)
3997 gdb_assert (gdbarch
!= NULL
);
3998 /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */
3999 if (gdbarch_debug
>= 2)
4000 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_indirection_suffix called\n");
4001 return gdbarch
->stap_register_indirection_suffix
;
4005 set_gdbarch_stap_register_indirection_suffix (struct gdbarch
*gdbarch
,
4006 const char * stap_register_indirection_suffix
)
4008 gdbarch
->stap_register_indirection_suffix
= stap_register_indirection_suffix
;
4012 gdbarch_stap_gdb_register_prefix (struct gdbarch
*gdbarch
)
4014 gdb_assert (gdbarch
!= NULL
);
4015 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
4016 if (gdbarch_debug
>= 2)
4017 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_gdb_register_prefix called\n");
4018 return gdbarch
->stap_gdb_register_prefix
;
4022 set_gdbarch_stap_gdb_register_prefix (struct gdbarch
*gdbarch
,
4023 const char * stap_gdb_register_prefix
)
4025 gdbarch
->stap_gdb_register_prefix
= stap_gdb_register_prefix
;
4029 gdbarch_stap_gdb_register_suffix (struct gdbarch
*gdbarch
)
4031 gdb_assert (gdbarch
!= NULL
);
4032 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
4033 if (gdbarch_debug
>= 2)
4034 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_gdb_register_suffix called\n");
4035 return gdbarch
->stap_gdb_register_suffix
;
4039 set_gdbarch_stap_gdb_register_suffix (struct gdbarch
*gdbarch
,
4040 const char * stap_gdb_register_suffix
)
4042 gdbarch
->stap_gdb_register_suffix
= stap_gdb_register_suffix
;
4046 gdbarch_stap_is_single_operand_p (struct gdbarch
*gdbarch
)
4048 gdb_assert (gdbarch
!= NULL
);
4049 return gdbarch
->stap_is_single_operand
!= NULL
;
4053 gdbarch_stap_is_single_operand (struct gdbarch
*gdbarch
, const char *s
)
4055 gdb_assert (gdbarch
!= NULL
);
4056 gdb_assert (gdbarch
->stap_is_single_operand
!= NULL
);
4057 if (gdbarch_debug
>= 2)
4058 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_is_single_operand called\n");
4059 return gdbarch
->stap_is_single_operand (gdbarch
, s
);
4063 set_gdbarch_stap_is_single_operand (struct gdbarch
*gdbarch
,
4064 gdbarch_stap_is_single_operand_ftype stap_is_single_operand
)
4066 gdbarch
->stap_is_single_operand
= stap_is_single_operand
;
4070 gdbarch_stap_parse_special_token_p (struct gdbarch
*gdbarch
)
4072 gdb_assert (gdbarch
!= NULL
);
4073 return gdbarch
->stap_parse_special_token
!= NULL
;
4077 gdbarch_stap_parse_special_token (struct gdbarch
*gdbarch
, struct stap_parse_info
*p
)
4079 gdb_assert (gdbarch
!= NULL
);
4080 gdb_assert (gdbarch
->stap_parse_special_token
!= NULL
);
4081 if (gdbarch_debug
>= 2)
4082 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_parse_special_token called\n");
4083 return gdbarch
->stap_parse_special_token (gdbarch
, p
);
4087 set_gdbarch_stap_parse_special_token (struct gdbarch
*gdbarch
,
4088 gdbarch_stap_parse_special_token_ftype stap_parse_special_token
)
4090 gdbarch
->stap_parse_special_token
= stap_parse_special_token
;
4094 gdbarch_has_global_solist (struct gdbarch
*gdbarch
)
4096 gdb_assert (gdbarch
!= NULL
);
4097 /* Skip verify of has_global_solist, invalid_p == 0 */
4098 if (gdbarch_debug
>= 2)
4099 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_solist called\n");
4100 return gdbarch
->has_global_solist
;
4104 set_gdbarch_has_global_solist (struct gdbarch
*gdbarch
,
4105 int has_global_solist
)
4107 gdbarch
->has_global_solist
= has_global_solist
;
4111 gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
)
4113 gdb_assert (gdbarch
!= NULL
);
4114 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
4115 if (gdbarch_debug
>= 2)
4116 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_breakpoints called\n");
4117 return gdbarch
->has_global_breakpoints
;
4121 set_gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
,
4122 int has_global_breakpoints
)
4124 gdbarch
->has_global_breakpoints
= has_global_breakpoints
;
4128 gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
)
4130 gdb_assert (gdbarch
!= NULL
);
4131 gdb_assert (gdbarch
->has_shared_address_space
!= NULL
);
4132 if (gdbarch_debug
>= 2)
4133 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_shared_address_space called\n");
4134 return gdbarch
->has_shared_address_space (gdbarch
);
4138 set_gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
,
4139 gdbarch_has_shared_address_space_ftype has_shared_address_space
)
4141 gdbarch
->has_shared_address_space
= has_shared_address_space
;
4145 gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
, CORE_ADDR addr
, int *isize
, char **msg
)
4147 gdb_assert (gdbarch
!= NULL
);
4148 gdb_assert (gdbarch
->fast_tracepoint_valid_at
!= NULL
);
4149 if (gdbarch_debug
>= 2)
4150 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fast_tracepoint_valid_at called\n");
4151 return gdbarch
->fast_tracepoint_valid_at (gdbarch
, addr
, isize
, msg
);
4155 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
,
4156 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at
)
4158 gdbarch
->fast_tracepoint_valid_at
= fast_tracepoint_valid_at
;
4162 gdbarch_auto_charset (struct gdbarch
*gdbarch
)
4164 gdb_assert (gdbarch
!= NULL
);
4165 gdb_assert (gdbarch
->auto_charset
!= NULL
);
4166 if (gdbarch_debug
>= 2)
4167 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_charset called\n");
4168 return gdbarch
->auto_charset ();
4172 set_gdbarch_auto_charset (struct gdbarch
*gdbarch
,
4173 gdbarch_auto_charset_ftype auto_charset
)
4175 gdbarch
->auto_charset
= auto_charset
;
4179 gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
)
4181 gdb_assert (gdbarch
!= NULL
);
4182 gdb_assert (gdbarch
->auto_wide_charset
!= NULL
);
4183 if (gdbarch_debug
>= 2)
4184 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_wide_charset called\n");
4185 return gdbarch
->auto_wide_charset ();
4189 set_gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
,
4190 gdbarch_auto_wide_charset_ftype auto_wide_charset
)
4192 gdbarch
->auto_wide_charset
= auto_wide_charset
;
4196 gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
)
4198 gdb_assert (gdbarch
!= NULL
);
4199 if (gdbarch_debug
>= 2)
4200 fprintf_unfiltered (gdb_stdlog
, "gdbarch_solib_symbols_extension called\n");
4201 return gdbarch
->solib_symbols_extension
;
4205 set_gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
,
4206 const char * solib_symbols_extension
)
4208 gdbarch
->solib_symbols_extension
= solib_symbols_extension
;
4212 gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
)
4214 gdb_assert (gdbarch
!= NULL
);
4215 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
4216 if (gdbarch_debug
>= 2)
4217 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_dos_based_file_system called\n");
4218 return gdbarch
->has_dos_based_file_system
;
4222 set_gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
,
4223 int has_dos_based_file_system
)
4225 gdbarch
->has_dos_based_file_system
= has_dos_based_file_system
;
4229 gdbarch_gen_return_address (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, struct axs_value
*value
, CORE_ADDR scope
)
4231 gdb_assert (gdbarch
!= NULL
);
4232 gdb_assert (gdbarch
->gen_return_address
!= NULL
);
4233 if (gdbarch_debug
>= 2)
4234 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gen_return_address called\n");
4235 gdbarch
->gen_return_address (gdbarch
, ax
, value
, scope
);
4239 set_gdbarch_gen_return_address (struct gdbarch
*gdbarch
,
4240 gdbarch_gen_return_address_ftype gen_return_address
)
4242 gdbarch
->gen_return_address
= gen_return_address
;
4246 gdbarch_info_proc_p (struct gdbarch
*gdbarch
)
4248 gdb_assert (gdbarch
!= NULL
);
4249 return gdbarch
->info_proc
!= NULL
;
4253 gdbarch_info_proc (struct gdbarch
*gdbarch
, char *args
, enum info_proc_what what
)
4255 gdb_assert (gdbarch
!= NULL
);
4256 gdb_assert (gdbarch
->info_proc
!= NULL
);
4257 if (gdbarch_debug
>= 2)
4258 fprintf_unfiltered (gdb_stdlog
, "gdbarch_info_proc called\n");
4259 gdbarch
->info_proc (gdbarch
, args
, what
);
4263 set_gdbarch_info_proc (struct gdbarch
*gdbarch
,
4264 gdbarch_info_proc_ftype info_proc
)
4266 gdbarch
->info_proc
= info_proc
;
4270 gdbarch_core_info_proc_p (struct gdbarch
*gdbarch
)
4272 gdb_assert (gdbarch
!= NULL
);
4273 return gdbarch
->core_info_proc
!= NULL
;
4277 gdbarch_core_info_proc (struct gdbarch
*gdbarch
, char *args
, enum info_proc_what what
)
4279 gdb_assert (gdbarch
!= NULL
);
4280 gdb_assert (gdbarch
->core_info_proc
!= NULL
);
4281 if (gdbarch_debug
>= 2)
4282 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_info_proc called\n");
4283 gdbarch
->core_info_proc (gdbarch
, args
, what
);
4287 set_gdbarch_core_info_proc (struct gdbarch
*gdbarch
,
4288 gdbarch_core_info_proc_ftype core_info_proc
)
4290 gdbarch
->core_info_proc
= core_info_proc
;
4294 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
)
4296 gdb_assert (gdbarch
!= NULL
);
4297 gdb_assert (gdbarch
->iterate_over_objfiles_in_search_order
!= NULL
);
4298 if (gdbarch_debug
>= 2)
4299 fprintf_unfiltered (gdb_stdlog
, "gdbarch_iterate_over_objfiles_in_search_order called\n");
4300 gdbarch
->iterate_over_objfiles_in_search_order (gdbarch
, cb
, cb_data
, current_objfile
);
4304 set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch
*gdbarch
,
4305 gdbarch_iterate_over_objfiles_in_search_order_ftype iterate_over_objfiles_in_search_order
)
4307 gdbarch
->iterate_over_objfiles_in_search_order
= iterate_over_objfiles_in_search_order
;
4310 struct ravenscar_arch_ops
*
4311 gdbarch_ravenscar_ops (struct gdbarch
*gdbarch
)
4313 gdb_assert (gdbarch
!= NULL
);
4314 /* Skip verify of ravenscar_ops, invalid_p == 0 */
4315 if (gdbarch_debug
>= 2)
4316 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ravenscar_ops called\n");
4317 return gdbarch
->ravenscar_ops
;
4321 set_gdbarch_ravenscar_ops (struct gdbarch
*gdbarch
,
4322 struct ravenscar_arch_ops
* ravenscar_ops
)
4324 gdbarch
->ravenscar_ops
= ravenscar_ops
;
4328 /* Keep a registry of per-architecture data-pointers required by GDB
4335 gdbarch_data_pre_init_ftype
*pre_init
;
4336 gdbarch_data_post_init_ftype
*post_init
;
4339 struct gdbarch_data_registration
4341 struct gdbarch_data
*data
;
4342 struct gdbarch_data_registration
*next
;
4345 struct gdbarch_data_registry
4348 struct gdbarch_data_registration
*registrations
;
4351 struct gdbarch_data_registry gdbarch_data_registry
=
4356 static struct gdbarch_data
*
4357 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
4358 gdbarch_data_post_init_ftype
*post_init
)
4360 struct gdbarch_data_registration
**curr
;
4362 /* Append the new registration. */
4363 for (curr
= &gdbarch_data_registry
.registrations
;
4365 curr
= &(*curr
)->next
);
4366 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
4367 (*curr
)->next
= NULL
;
4368 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
4369 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
4370 (*curr
)->data
->pre_init
= pre_init
;
4371 (*curr
)->data
->post_init
= post_init
;
4372 (*curr
)->data
->init_p
= 1;
4373 return (*curr
)->data
;
4376 struct gdbarch_data
*
4377 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
4379 return gdbarch_data_register (pre_init
, NULL
);
4382 struct gdbarch_data
*
4383 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
4385 return gdbarch_data_register (NULL
, post_init
);
4388 /* Create/delete the gdbarch data vector. */
4391 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
4393 gdb_assert (gdbarch
->data
== NULL
);
4394 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
4395 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
4398 /* Initialize the current value of the specified per-architecture
4402 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
4403 struct gdbarch_data
*data
,
4406 gdb_assert (data
->index
< gdbarch
->nr_data
);
4407 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
4408 gdb_assert (data
->pre_init
== NULL
);
4409 gdbarch
->data
[data
->index
] = pointer
;
4412 /* Return the current value of the specified per-architecture
4416 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
4418 gdb_assert (data
->index
< gdbarch
->nr_data
);
4419 if (gdbarch
->data
[data
->index
] == NULL
)
4421 /* The data-pointer isn't initialized, call init() to get a
4423 if (data
->pre_init
!= NULL
)
4424 /* Mid architecture creation: pass just the obstack, and not
4425 the entire architecture, as that way it isn't possible for
4426 pre-init code to refer to undefined architecture
4428 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
4429 else if (gdbarch
->initialized_p
4430 && data
->post_init
!= NULL
)
4431 /* Post architecture creation: pass the entire architecture
4432 (as all fields are valid), but be careful to also detect
4433 recursive references. */
4435 gdb_assert (data
->init_p
);
4437 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
4441 /* The architecture initialization hasn't completed - punt -
4442 hope that the caller knows what they are doing. Once
4443 deprecated_set_gdbarch_data has been initialized, this can be
4444 changed to an internal error. */
4446 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
4448 return gdbarch
->data
[data
->index
];
4452 /* Keep a registry of the architectures known by GDB. */
4454 struct gdbarch_registration
4456 enum bfd_architecture bfd_architecture
;
4457 gdbarch_init_ftype
*init
;
4458 gdbarch_dump_tdep_ftype
*dump_tdep
;
4459 struct gdbarch_list
*arches
;
4460 struct gdbarch_registration
*next
;
4463 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
4466 append_name (const char ***buf
, int *nr
, const char *name
)
4468 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
4474 gdbarch_printable_names (void)
4476 /* Accumulate a list of names based on the registed list of
4479 const char **arches
= NULL
;
4480 struct gdbarch_registration
*rego
;
4482 for (rego
= gdbarch_registry
;
4486 const struct bfd_arch_info
*ap
;
4487 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
4489 internal_error (__FILE__
, __LINE__
,
4490 _("gdbarch_architecture_names: multi-arch unknown"));
4493 append_name (&arches
, &nr_arches
, ap
->printable_name
);
4498 append_name (&arches
, &nr_arches
, NULL
);
4504 gdbarch_register (enum bfd_architecture bfd_architecture
,
4505 gdbarch_init_ftype
*init
,
4506 gdbarch_dump_tdep_ftype
*dump_tdep
)
4508 struct gdbarch_registration
**curr
;
4509 const struct bfd_arch_info
*bfd_arch_info
;
4511 /* Check that BFD recognizes this architecture */
4512 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
4513 if (bfd_arch_info
== NULL
)
4515 internal_error (__FILE__
, __LINE__
,
4516 _("gdbarch: Attempt to register "
4517 "unknown architecture (%d)"),
4520 /* Check that we haven't seen this architecture before. */
4521 for (curr
= &gdbarch_registry
;
4523 curr
= &(*curr
)->next
)
4525 if (bfd_architecture
== (*curr
)->bfd_architecture
)
4526 internal_error (__FILE__
, __LINE__
,
4527 _("gdbarch: Duplicate registration "
4528 "of architecture (%s)"),
4529 bfd_arch_info
->printable_name
);
4533 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, %s)\n",
4534 bfd_arch_info
->printable_name
,
4535 host_address_to_string (init
));
4537 (*curr
) = XMALLOC (struct gdbarch_registration
);
4538 (*curr
)->bfd_architecture
= bfd_architecture
;
4539 (*curr
)->init
= init
;
4540 (*curr
)->dump_tdep
= dump_tdep
;
4541 (*curr
)->arches
= NULL
;
4542 (*curr
)->next
= NULL
;
4546 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
4547 gdbarch_init_ftype
*init
)
4549 gdbarch_register (bfd_architecture
, init
, NULL
);
4553 /* Look for an architecture using gdbarch_info. */
4555 struct gdbarch_list
*
4556 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
4557 const struct gdbarch_info
*info
)
4559 for (; arches
!= NULL
; arches
= arches
->next
)
4561 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
4563 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4565 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4567 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
4575 /* Find an architecture that matches the specified INFO. Create a new
4576 architecture if needed. Return that new architecture. */
4579 gdbarch_find_by_info (struct gdbarch_info info
)
4581 struct gdbarch
*new_gdbarch
;
4582 struct gdbarch_registration
*rego
;
4584 /* Fill in missing parts of the INFO struct using a number of
4585 sources: "set ..."; INFOabfd supplied; and the global
4587 gdbarch_info_fill (&info
);
4589 /* Must have found some sort of architecture. */
4590 gdb_assert (info
.bfd_arch_info
!= NULL
);
4594 fprintf_unfiltered (gdb_stdlog
,
4595 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
4596 (info
.bfd_arch_info
!= NULL
4597 ? info
.bfd_arch_info
->printable_name
4599 fprintf_unfiltered (gdb_stdlog
,
4600 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
4602 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4603 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4605 fprintf_unfiltered (gdb_stdlog
,
4606 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4607 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4608 fprintf_unfiltered (gdb_stdlog
,
4609 "gdbarch_find_by_info: info.abfd %s\n",
4610 host_address_to_string (info
.abfd
));
4611 fprintf_unfiltered (gdb_stdlog
,
4612 "gdbarch_find_by_info: info.tdep_info %s\n",
4613 host_address_to_string (info
.tdep_info
));
4616 /* Find the tdep code that knows about this architecture. */
4617 for (rego
= gdbarch_registry
;
4620 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4625 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4626 "No matching architecture\n");
4630 /* Ask the tdep code for an architecture that matches "info". */
4631 new_gdbarch
= rego
->init (info
, rego
->arches
);
4633 /* Did the tdep code like it? No. Reject the change and revert to
4634 the old architecture. */
4635 if (new_gdbarch
== NULL
)
4638 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4639 "Target rejected architecture\n");
4643 /* Is this a pre-existing architecture (as determined by already
4644 being initialized)? Move it to the front of the architecture
4645 list (keeping the list sorted Most Recently Used). */
4646 if (new_gdbarch
->initialized_p
)
4648 struct gdbarch_list
**list
;
4649 struct gdbarch_list
*this;
4651 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4652 "Previous architecture %s (%s) selected\n",
4653 host_address_to_string (new_gdbarch
),
4654 new_gdbarch
->bfd_arch_info
->printable_name
);
4655 /* Find the existing arch in the list. */
4656 for (list
= ®o
->arches
;
4657 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4658 list
= &(*list
)->next
);
4659 /* It had better be in the list of architectures. */
4660 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4663 (*list
) = this->next
;
4664 /* Insert THIS at the front. */
4665 this->next
= rego
->arches
;
4666 rego
->arches
= this;
4671 /* It's a new architecture. */
4673 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4674 "New architecture %s (%s) selected\n",
4675 host_address_to_string (new_gdbarch
),
4676 new_gdbarch
->bfd_arch_info
->printable_name
);
4678 /* Insert the new architecture into the front of the architecture
4679 list (keep the list sorted Most Recently Used). */
4681 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4682 this->next
= rego
->arches
;
4683 this->gdbarch
= new_gdbarch
;
4684 rego
->arches
= this;
4687 /* Check that the newly installed architecture is valid. Plug in
4688 any post init values. */
4689 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4690 verify_gdbarch (new_gdbarch
);
4691 new_gdbarch
->initialized_p
= 1;
4694 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4699 /* Make the specified architecture current. */
4702 set_target_gdbarch (struct gdbarch
*new_gdbarch
)
4704 gdb_assert (new_gdbarch
!= NULL
);
4705 gdb_assert (new_gdbarch
->initialized_p
);
4706 current_inferior ()->gdbarch
= new_gdbarch
;
4707 observer_notify_architecture_changed (new_gdbarch
);
4708 registers_changed ();
4711 /* Return the current inferior's arch. */
4714 target_gdbarch (void)
4716 return current_inferior ()->gdbarch
;
4719 extern void _initialize_gdbarch (void);
4722 _initialize_gdbarch (void)
4724 add_setshow_zuinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
4725 Set architecture debugging."), _("\
4726 Show architecture debugging."), _("\
4727 When non-zero, architecture debugging is enabled."),
4730 &setdebuglist
, &showdebuglist
);