1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2007, 2008, 2009 Free Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* This file was created with the aid of ``gdbarch.sh''.
25 The Bourne shell script ``gdbarch.sh'' creates the files
26 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
27 against the existing ``gdbarch.[hc]''. Any differences found
30 If editing this file, please also run gdbarch.sh and merge any
31 changes into that script. Conversely, when making sweeping changes
32 to this file, modifying gdbarch.sh and using its output may prove
37 #include "arch-utils.h"
43 #include "floatformat.h"
45 #include "gdb_assert.h"
46 #include "gdb_string.h"
47 #include "reggroups.h"
49 #include "gdb_obstack.h"
53 /* Static function declarations */
55 static void alloc_gdbarch_data (struct gdbarch
*);
57 /* Non-zero if we want to trace architecture code. */
60 #define GDBARCH_DEBUG 0
62 int gdbarch_debug
= GDBARCH_DEBUG
;
64 show_gdbarch_debug (struct ui_file
*file
, int from_tty
,
65 struct cmd_list_element
*c
, const char *value
)
67 fprintf_filtered (file
, _("Architecture debugging is %s.\n"), value
);
71 pformat (const struct floatformat
**format
)
76 /* Just print out one of them - this is only for diagnostics. */
77 return format
[0]->name
;
81 pstring (const char *string
)
89 /* Maintain the struct gdbarch object. */
93 /* Has this architecture been fully initialized? */
96 /* An obstack bound to the lifetime of the architecture. */
97 struct obstack
*obstack
;
99 /* basic architectural information. */
100 const struct bfd_arch_info
* bfd_arch_info
;
102 int byte_order_for_code
;
103 enum gdb_osabi osabi
;
104 const struct target_desc
* target_desc
;
106 /* target specific vector. */
107 struct gdbarch_tdep
*tdep
;
108 gdbarch_dump_tdep_ftype
*dump_tdep
;
110 /* per-architecture data-pointers. */
114 /* per-architecture swap-regions. */
115 struct gdbarch_swap
*swap
;
117 /* Multi-arch values.
119 When extending this structure you must:
123 Declare set/get functions and define the corresponding
126 gdbarch_alloc(): If zero/NULL is not a suitable default,
127 initialize the new field.
129 verify_gdbarch(): Confirm that the target updated the field
132 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
135 ``startup_gdbarch()'': Append an initial value to the static
136 variable (base values on the host's c-type system).
138 get_gdbarch(): Implement the set/get functions (probably using
139 the macro's as shortcuts).
148 int long_long_align_bit
;
150 const struct floatformat
** half_format
;
152 const struct floatformat
** float_format
;
154 const struct floatformat
** double_format
;
156 const struct floatformat
** long_double_format
;
159 int dwarf2_addr_size
;
161 gdbarch_read_pc_ftype
*read_pc
;
162 gdbarch_write_pc_ftype
*write_pc
;
163 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
164 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
165 gdbarch_pseudo_register_read_value_ftype
*pseudo_register_read_value
;
166 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
169 gdbarch_ax_pseudo_register_collect_ftype
*ax_pseudo_register_collect
;
170 gdbarch_ax_pseudo_register_push_stack_ftype
*ax_pseudo_register_push_stack
;
175 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
176 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
177 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
178 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
179 gdbarch_register_name_ftype
*register_name
;
180 gdbarch_register_type_ftype
*register_type
;
181 gdbarch_dummy_id_ftype
*dummy_id
;
182 int deprecated_fp_regnum
;
183 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
184 int call_dummy_location
;
185 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
186 gdbarch_print_registers_info_ftype
*print_registers_info
;
187 gdbarch_print_float_info_ftype
*print_float_info
;
188 gdbarch_print_vector_info_ftype
*print_vector_info
;
189 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
190 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
191 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
192 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
193 int believe_pcc_promotion
;
194 gdbarch_convert_register_p_ftype
*convert_register_p
;
195 gdbarch_register_to_value_ftype
*register_to_value
;
196 gdbarch_value_to_register_ftype
*value_to_register
;
197 gdbarch_value_from_register_ftype
*value_from_register
;
198 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
199 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
200 gdbarch_integer_to_address_ftype
*integer_to_address
;
201 gdbarch_return_value_ftype
*return_value
;
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_smash_text_address_ftype
*smash_text_address
;
224 gdbarch_software_single_step_ftype
*software_single_step
;
225 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
226 gdbarch_print_insn_ftype
*print_insn
;
227 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
228 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
229 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
230 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
231 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
232 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
233 int cannot_step_breakpoint
;
234 int have_nonsteppable_watchpoint
;
235 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
236 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
237 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
238 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
239 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
240 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
241 struct core_regset_section
* core_regset_sections
;
242 gdbarch_make_corefile_notes_ftype
*make_corefile_notes
;
243 gdbarch_find_memory_regions_ftype
*find_memory_regions
;
244 gdbarch_core_xfer_shared_libraries_ftype
*core_xfer_shared_libraries
;
245 gdbarch_core_pid_to_str_ftype
*core_pid_to_str
;
246 const char * gcore_bfd_target
;
247 int vtable_function_descriptors
;
249 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
250 ULONGEST max_insn_length
;
251 gdbarch_displaced_step_copy_insn_ftype
*displaced_step_copy_insn
;
252 gdbarch_displaced_step_hw_singlestep_ftype
*displaced_step_hw_singlestep
;
253 gdbarch_displaced_step_fixup_ftype
*displaced_step_fixup
;
254 gdbarch_displaced_step_free_closure_ftype
*displaced_step_free_closure
;
255 gdbarch_displaced_step_location_ftype
*displaced_step_location
;
256 gdbarch_relocate_instruction_ftype
*relocate_instruction
;
257 gdbarch_overlay_update_ftype
*overlay_update
;
258 gdbarch_core_read_description_ftype
*core_read_description
;
259 gdbarch_static_transform_name_ftype
*static_transform_name
;
260 int sofun_address_maybe_missing
;
261 gdbarch_process_record_ftype
*process_record
;
262 gdbarch_process_record_signal_ftype
*process_record_signal
;
263 gdbarch_gdb_signal_from_target_ftype
*gdb_signal_from_target
;
264 gdbarch_get_siginfo_type_ftype
*get_siginfo_type
;
265 gdbarch_record_special_symbol_ftype
*record_special_symbol
;
266 gdbarch_get_syscall_number_ftype
*get_syscall_number
;
267 const char * stap_integer_prefix
;
268 const char * stap_integer_suffix
;
269 const char * stap_register_prefix
;
270 const char * stap_register_suffix
;
271 const char * stap_register_indirection_prefix
;
272 const char * stap_register_indirection_suffix
;
273 const char * stap_gdb_register_prefix
;
274 const char * stap_gdb_register_suffix
;
275 gdbarch_stap_is_single_operand_ftype
*stap_is_single_operand
;
276 gdbarch_stap_parse_special_token_ftype
*stap_parse_special_token
;
277 int has_global_solist
;
278 int has_global_breakpoints
;
279 gdbarch_has_shared_address_space_ftype
*has_shared_address_space
;
280 gdbarch_fast_tracepoint_valid_at_ftype
*fast_tracepoint_valid_at
;
281 gdbarch_auto_charset_ftype
*auto_charset
;
282 gdbarch_auto_wide_charset_ftype
*auto_wide_charset
;
283 const char * solib_symbols_extension
;
284 int has_dos_based_file_system
;
285 gdbarch_gen_return_address_ftype
*gen_return_address
;
286 gdbarch_info_proc_ftype
*info_proc
;
290 /* The default architecture uses host values (for want of a better
293 extern const struct bfd_arch_info bfd_default_arch_struct
;
295 struct gdbarch startup_gdbarch
=
297 1, /* Always initialized. */
298 NULL
, /* The obstack. */
299 /* basic architecture information. */
300 &bfd_default_arch_struct
, /* bfd_arch_info */
301 BFD_ENDIAN_BIG
, /* byte_order */
302 BFD_ENDIAN_BIG
, /* byte_order_for_code */
303 GDB_OSABI_UNKNOWN
, /* osabi */
305 /* target specific vector and its dump routine. */
307 /*per-architecture data-pointers and swap regions. */
309 /* Multi-arch values */
310 1, /* bits_big_endian */
311 8 * sizeof (short), /* short_bit */
312 8 * sizeof (int), /* int_bit */
313 8 * sizeof (long), /* long_bit */
314 8 * sizeof (LONGEST
), /* long_long_bit */
315 8 * sizeof (LONGEST
), /* long_long_align_bit */
318 8 * sizeof (float), /* float_bit */
319 0, /* float_format */
320 8 * sizeof (double), /* double_bit */
321 0, /* double_format */
322 8 * sizeof (long double), /* long_double_bit */
323 0, /* long_double_format */
324 8 * sizeof (void*), /* ptr_bit */
325 8 * sizeof (void*), /* addr_bit */
326 sizeof (void*), /* dwarf2_addr_size */
330 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
331 0, /* pseudo_register_read */
332 0, /* pseudo_register_read_value */
333 0, /* pseudo_register_write */
335 0, /* num_pseudo_regs */
336 0, /* ax_pseudo_register_collect */
337 0, /* ax_pseudo_register_push_stack */
342 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
343 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
344 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
345 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
346 0, /* register_name */
347 0, /* register_type */
349 -1, /* deprecated_fp_regnum */
350 0, /* push_dummy_call */
351 0, /* call_dummy_location */
352 0, /* push_dummy_code */
353 default_print_registers_info
, /* print_registers_info */
354 0, /* print_float_info */
355 0, /* print_vector_info */
356 legacy_register_sim_regno
, /* register_sim_regno */
357 cannot_register_not
, /* cannot_fetch_register */
358 cannot_register_not
, /* cannot_store_register */
359 0, /* get_longjmp_target */
360 0, /* believe_pcc_promotion */
361 generic_convert_register_p
, /* convert_register_p */
362 0, /* register_to_value */
363 0, /* value_to_register */
364 0, /* value_from_register */
365 unsigned_pointer_to_address
, /* pointer_to_address */
366 unsigned_address_to_pointer
, /* address_to_pointer */
367 0, /* integer_to_address */
368 0, /* return_value */
369 0, /* skip_prologue */
370 0, /* skip_main_prologue */
372 0, /* breakpoint_from_pc */
373 default_remote_breakpoint_from_pc
, /* remote_breakpoint_from_pc */
374 0, /* adjust_breakpoint_address */
375 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
376 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
377 0, /* decr_pc_after_break */
378 0, /* deprecated_function_start_offset */
379 default_remote_register_number
, /* remote_register_number */
380 0, /* fetch_tls_load_module_address */
381 0, /* frame_args_skip */
384 0, /* frame_num_args */
386 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
387 0, /* frame_red_zone_size */
388 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
389 core_addr_identity
, /* addr_bits_remove */
390 core_addr_identity
, /* smash_text_address */
391 0, /* software_single_step */
392 0, /* single_step_through_delay */
394 0, /* skip_trampoline_code */
395 generic_skip_solib_resolver
, /* skip_solib_resolver */
396 generic_in_solib_return_trampoline
, /* in_solib_return_trampoline */
397 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
398 0, /* elf_make_msymbol_special */
399 0, /* coff_make_msymbol_special */
400 0, /* cannot_step_breakpoint */
401 0, /* have_nonsteppable_watchpoint */
402 0, /* address_class_type_flags */
403 0, /* address_class_type_flags_to_name */
404 0, /* address_class_name_to_type_flags */
405 default_register_reggroup_p
, /* register_reggroup_p */
406 0, /* fetch_pointer_argument */
407 0, /* regset_from_core_section */
408 0, /* core_regset_sections */
409 0, /* make_corefile_notes */
410 0, /* find_memory_regions */
411 0, /* core_xfer_shared_libraries */
412 0, /* core_pid_to_str */
413 0, /* gcore_bfd_target */
414 0, /* vtable_function_descriptors */
415 0, /* vbit_in_delta */
416 0, /* skip_permanent_breakpoint */
417 0, /* max_insn_length */
418 0, /* displaced_step_copy_insn */
419 default_displaced_step_hw_singlestep
, /* displaced_step_hw_singlestep */
420 0, /* displaced_step_fixup */
421 NULL
, /* displaced_step_free_closure */
422 NULL
, /* displaced_step_location */
423 0, /* relocate_instruction */
424 0, /* overlay_update */
425 0, /* core_read_description */
426 0, /* static_transform_name */
427 0, /* sofun_address_maybe_missing */
428 0, /* process_record */
429 0, /* process_record_signal */
430 default_gdb_signal_from_target
, /* gdb_signal_from_target */
431 0, /* get_siginfo_type */
432 0, /* record_special_symbol */
433 0, /* get_syscall_number */
434 0, /* stap_integer_prefix */
435 0, /* stap_integer_suffix */
436 0, /* stap_register_prefix */
437 0, /* stap_register_suffix */
438 0, /* stap_register_indirection_prefix */
439 0, /* stap_register_indirection_suffix */
440 0, /* stap_gdb_register_prefix */
441 0, /* stap_gdb_register_suffix */
442 0, /* stap_is_single_operand */
443 0, /* stap_parse_special_token */
444 0, /* has_global_solist */
445 0, /* has_global_breakpoints */
446 default_has_shared_address_space
, /* has_shared_address_space */
447 default_fast_tracepoint_valid_at
, /* fast_tracepoint_valid_at */
448 default_auto_charset
, /* auto_charset */
449 default_auto_wide_charset
, /* auto_wide_charset */
450 0, /* solib_symbols_extension */
451 0, /* has_dos_based_file_system */
452 default_gen_return_address
, /* gen_return_address */
454 /* startup_gdbarch() */
457 struct gdbarch
*target_gdbarch
= &startup_gdbarch
;
459 /* Create a new ``struct gdbarch'' based on information provided by
460 ``struct gdbarch_info''. */
463 gdbarch_alloc (const struct gdbarch_info
*info
,
464 struct gdbarch_tdep
*tdep
)
466 struct gdbarch
*gdbarch
;
468 /* Create an obstack for allocating all the per-architecture memory,
469 then use that to allocate the architecture vector. */
470 struct obstack
*obstack
= XMALLOC (struct obstack
);
471 obstack_init (obstack
);
472 gdbarch
= obstack_alloc (obstack
, sizeof (*gdbarch
));
473 memset (gdbarch
, 0, sizeof (*gdbarch
));
474 gdbarch
->obstack
= obstack
;
476 alloc_gdbarch_data (gdbarch
);
478 gdbarch
->tdep
= tdep
;
480 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
481 gdbarch
->byte_order
= info
->byte_order
;
482 gdbarch
->byte_order_for_code
= info
->byte_order_for_code
;
483 gdbarch
->osabi
= info
->osabi
;
484 gdbarch
->target_desc
= info
->target_desc
;
486 /* Force the explicit initialization of these. */
487 gdbarch
->bits_big_endian
= (gdbarch
->byte_order
== BFD_ENDIAN_BIG
);
488 gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
489 gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
490 gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
491 gdbarch
->long_long_bit
= 2*gdbarch
->long_bit
;
492 gdbarch
->long_long_align_bit
= 2*gdbarch
->long_bit
;
493 gdbarch
->half_bit
= 2*TARGET_CHAR_BIT
;
494 gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
495 gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
496 gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
497 gdbarch
->ptr_bit
= gdbarch
->int_bit
;
498 gdbarch
->char_signed
= -1;
499 gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
500 gdbarch
->num_regs
= -1;
501 gdbarch
->sp_regnum
= -1;
502 gdbarch
->pc_regnum
= -1;
503 gdbarch
->ps_regnum
= -1;
504 gdbarch
->fp0_regnum
= -1;
505 gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
506 gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
507 gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
508 gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
509 gdbarch
->deprecated_fp_regnum
= -1;
510 gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
511 gdbarch
->print_registers_info
= default_print_registers_info
;
512 gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
513 gdbarch
->cannot_fetch_register
= cannot_register_not
;
514 gdbarch
->cannot_store_register
= cannot_register_not
;
515 gdbarch
->convert_register_p
= generic_convert_register_p
;
516 gdbarch
->value_from_register
= default_value_from_register
;
517 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
518 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
519 gdbarch
->remote_breakpoint_from_pc
= default_remote_breakpoint_from_pc
;
520 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
521 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
522 gdbarch
->remote_register_number
= default_remote_register_number
;
523 gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
524 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
525 gdbarch
->addr_bits_remove
= core_addr_identity
;
526 gdbarch
->smash_text_address
= core_addr_identity
;
527 gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
528 gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
529 gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
530 gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
531 gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
532 gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
533 gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
534 gdbarch
->displaced_step_hw_singlestep
= default_displaced_step_hw_singlestep
;
535 gdbarch
->displaced_step_fixup
= NULL
;
536 gdbarch
->displaced_step_free_closure
= NULL
;
537 gdbarch
->displaced_step_location
= NULL
;
538 gdbarch
->relocate_instruction
= NULL
;
539 gdbarch
->gdb_signal_from_target
= default_gdb_signal_from_target
;
540 gdbarch
->has_shared_address_space
= default_has_shared_address_space
;
541 gdbarch
->fast_tracepoint_valid_at
= default_fast_tracepoint_valid_at
;
542 gdbarch
->auto_charset
= default_auto_charset
;
543 gdbarch
->auto_wide_charset
= default_auto_wide_charset
;
544 gdbarch
->gen_return_address
= default_gen_return_address
;
545 /* gdbarch_alloc() */
551 /* Allocate extra space using the per-architecture obstack. */
554 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
556 void *data
= obstack_alloc (arch
->obstack
, size
);
558 memset (data
, 0, size
);
563 /* Free a gdbarch struct. This should never happen in normal
564 operation --- once you've created a gdbarch, you keep it around.
565 However, if an architecture's init function encounters an error
566 building the structure, it may need to clean up a partially
567 constructed gdbarch. */
570 gdbarch_free (struct gdbarch
*arch
)
572 struct obstack
*obstack
;
574 gdb_assert (arch
!= NULL
);
575 gdb_assert (!arch
->initialized_p
);
576 obstack
= arch
->obstack
;
577 obstack_free (obstack
, 0); /* Includes the ARCH. */
582 /* Ensure that all values in a GDBARCH are reasonable. */
585 verify_gdbarch (struct gdbarch
*gdbarch
)
588 struct cleanup
*cleanups
;
592 log
= mem_fileopen ();
593 cleanups
= make_cleanup_ui_file_delete (log
);
595 if (gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
596 fprintf_unfiltered (log
, "\n\tbyte-order");
597 if (gdbarch
->bfd_arch_info
== NULL
)
598 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
599 /* Check those that need to be defined for the given multi-arch level. */
600 /* Skip verify of bits_big_endian, invalid_p == 0 */
601 /* Skip verify of short_bit, invalid_p == 0 */
602 /* Skip verify of int_bit, invalid_p == 0 */
603 /* Skip verify of long_bit, invalid_p == 0 */
604 /* Skip verify of long_long_bit, invalid_p == 0 */
605 /* Skip verify of long_long_align_bit, invalid_p == 0 */
606 /* Skip verify of half_bit, invalid_p == 0 */
607 if (gdbarch
->half_format
== 0)
608 gdbarch
->half_format
= floatformats_ieee_half
;
609 /* Skip verify of float_bit, invalid_p == 0 */
610 if (gdbarch
->float_format
== 0)
611 gdbarch
->float_format
= floatformats_ieee_single
;
612 /* Skip verify of double_bit, invalid_p == 0 */
613 if (gdbarch
->double_format
== 0)
614 gdbarch
->double_format
= floatformats_ieee_double
;
615 /* Skip verify of long_double_bit, invalid_p == 0 */
616 if (gdbarch
->long_double_format
== 0)
617 gdbarch
->long_double_format
= floatformats_ieee_double
;
618 /* Skip verify of ptr_bit, invalid_p == 0 */
619 if (gdbarch
->addr_bit
== 0)
620 gdbarch
->addr_bit
= gdbarch_ptr_bit (gdbarch
);
621 if (gdbarch
->dwarf2_addr_size
== 0)
622 gdbarch
->dwarf2_addr_size
= gdbarch_ptr_bit (gdbarch
) / TARGET_CHAR_BIT
;
623 if (gdbarch
->char_signed
== -1)
624 gdbarch
->char_signed
= 1;
625 /* Skip verify of read_pc, has predicate. */
626 /* Skip verify of write_pc, has predicate. */
627 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
628 /* Skip verify of pseudo_register_read, has predicate. */
629 /* Skip verify of pseudo_register_read_value, has predicate. */
630 /* Skip verify of pseudo_register_write, has predicate. */
631 if (gdbarch
->num_regs
== -1)
632 fprintf_unfiltered (log
, "\n\tnum_regs");
633 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
634 /* Skip verify of ax_pseudo_register_collect, has predicate. */
635 /* Skip verify of ax_pseudo_register_push_stack, has predicate. */
636 /* Skip verify of sp_regnum, invalid_p == 0 */
637 /* Skip verify of pc_regnum, invalid_p == 0 */
638 /* Skip verify of ps_regnum, invalid_p == 0 */
639 /* Skip verify of fp0_regnum, invalid_p == 0 */
640 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
641 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
642 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
643 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
644 if (gdbarch
->register_name
== 0)
645 fprintf_unfiltered (log
, "\n\tregister_name");
646 /* Skip verify of register_type, has predicate. */
647 /* Skip verify of dummy_id, has predicate. */
648 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
649 /* Skip verify of push_dummy_call, has predicate. */
650 /* Skip verify of call_dummy_location, invalid_p == 0 */
651 /* Skip verify of push_dummy_code, has predicate. */
652 /* Skip verify of print_registers_info, invalid_p == 0 */
653 /* Skip verify of print_float_info, has predicate. */
654 /* Skip verify of print_vector_info, has predicate. */
655 /* Skip verify of register_sim_regno, invalid_p == 0 */
656 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
657 /* Skip verify of cannot_store_register, invalid_p == 0 */
658 /* Skip verify of get_longjmp_target, has predicate. */
659 /* Skip verify of convert_register_p, invalid_p == 0 */
660 /* Skip verify of value_from_register, invalid_p == 0 */
661 /* Skip verify of pointer_to_address, invalid_p == 0 */
662 /* Skip verify of address_to_pointer, invalid_p == 0 */
663 /* Skip verify of integer_to_address, has predicate. */
664 /* Skip verify of return_value, has predicate. */
665 if (gdbarch
->skip_prologue
== 0)
666 fprintf_unfiltered (log
, "\n\tskip_prologue");
667 /* Skip verify of skip_main_prologue, has predicate. */
668 if (gdbarch
->inner_than
== 0)
669 fprintf_unfiltered (log
, "\n\tinner_than");
670 if (gdbarch
->breakpoint_from_pc
== 0)
671 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
672 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
673 /* Skip verify of adjust_breakpoint_address, has predicate. */
674 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
675 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
676 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
677 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
678 /* Skip verify of remote_register_number, invalid_p == 0 */
679 /* Skip verify of fetch_tls_load_module_address, has predicate. */
680 /* Skip verify of frame_args_skip, invalid_p == 0 */
681 /* Skip verify of unwind_pc, has predicate. */
682 /* Skip verify of unwind_sp, has predicate. */
683 /* Skip verify of frame_num_args, has predicate. */
684 /* Skip verify of frame_align, has predicate. */
685 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
686 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
687 /* Skip verify of addr_bits_remove, invalid_p == 0 */
688 /* Skip verify of smash_text_address, invalid_p == 0 */
689 /* Skip verify of software_single_step, has predicate. */
690 /* Skip verify of single_step_through_delay, has predicate. */
691 if (gdbarch
->print_insn
== 0)
692 fprintf_unfiltered (log
, "\n\tprint_insn");
693 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
694 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
695 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
696 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
697 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
698 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
699 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
700 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
701 /* Skip verify of address_class_type_flags, has predicate. */
702 /* Skip verify of address_class_type_flags_to_name, has predicate. */
703 /* Skip verify of address_class_name_to_type_flags, has predicate. */
704 /* Skip verify of register_reggroup_p, invalid_p == 0 */
705 /* Skip verify of fetch_pointer_argument, has predicate. */
706 /* Skip verify of regset_from_core_section, has predicate. */
707 /* Skip verify of make_corefile_notes, has predicate. */
708 /* Skip verify of find_memory_regions, has predicate. */
709 /* Skip verify of core_xfer_shared_libraries, has predicate. */
710 /* Skip verify of core_pid_to_str, has predicate. */
711 /* Skip verify of gcore_bfd_target, has predicate. */
712 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
713 /* Skip verify of vbit_in_delta, invalid_p == 0 */
714 /* Skip verify of skip_permanent_breakpoint, has predicate. */
715 /* Skip verify of max_insn_length, has predicate. */
716 /* Skip verify of displaced_step_copy_insn, has predicate. */
717 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
718 /* Skip verify of displaced_step_fixup, has predicate. */
719 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
720 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
721 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
722 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
723 /* Skip verify of relocate_instruction, has predicate. */
724 /* Skip verify of overlay_update, has predicate. */
725 /* Skip verify of core_read_description, has predicate. */
726 /* Skip verify of static_transform_name, has predicate. */
727 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
728 /* Skip verify of process_record, has predicate. */
729 /* Skip verify of process_record_signal, has predicate. */
730 /* Skip verify of gdb_signal_from_target, invalid_p == 0 */
731 /* Skip verify of get_siginfo_type, has predicate. */
732 /* Skip verify of record_special_symbol, has predicate. */
733 /* Skip verify of get_syscall_number, has predicate. */
734 /* Skip verify of stap_integer_prefix, invalid_p == 0 */
735 /* Skip verify of stap_integer_suffix, invalid_p == 0 */
736 /* Skip verify of stap_register_prefix, invalid_p == 0 */
737 /* Skip verify of stap_register_suffix, invalid_p == 0 */
738 /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */
739 /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */
740 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
741 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
742 /* Skip verify of stap_is_single_operand, has predicate. */
743 /* Skip verify of stap_parse_special_token, has predicate. */
744 /* Skip verify of has_global_solist, invalid_p == 0 */
745 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
746 /* Skip verify of has_shared_address_space, invalid_p == 0 */
747 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
748 /* Skip verify of auto_charset, invalid_p == 0 */
749 /* Skip verify of auto_wide_charset, invalid_p == 0 */
750 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
751 /* Skip verify of gen_return_address, invalid_p == 0 */
752 /* Skip verify of info_proc, has predicate. */
753 buf
= ui_file_xstrdup (log
, &length
);
754 make_cleanup (xfree
, buf
);
756 internal_error (__FILE__
, __LINE__
,
757 _("verify_gdbarch: the following are invalid ...%s"),
759 do_cleanups (cleanups
);
763 /* Print out the details of the current architecture. */
766 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
768 const char *gdb_nm_file
= "<not-defined>";
770 #if defined (GDB_NM_FILE)
771 gdb_nm_file
= GDB_NM_FILE
;
773 fprintf_unfiltered (file
,
774 "gdbarch_dump: GDB_NM_FILE = %s\n",
776 fprintf_unfiltered (file
,
777 "gdbarch_dump: addr_bit = %s\n",
778 plongest (gdbarch
->addr_bit
));
779 fprintf_unfiltered (file
,
780 "gdbarch_dump: addr_bits_remove = <%s>\n",
781 host_address_to_string (gdbarch
->addr_bits_remove
));
782 fprintf_unfiltered (file
,
783 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
784 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
785 fprintf_unfiltered (file
,
786 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
787 host_address_to_string (gdbarch
->address_class_name_to_type_flags
));
788 fprintf_unfiltered (file
,
789 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
790 gdbarch_address_class_type_flags_p (gdbarch
));
791 fprintf_unfiltered (file
,
792 "gdbarch_dump: address_class_type_flags = <%s>\n",
793 host_address_to_string (gdbarch
->address_class_type_flags
));
794 fprintf_unfiltered (file
,
795 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
796 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
797 fprintf_unfiltered (file
,
798 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
799 host_address_to_string (gdbarch
->address_class_type_flags_to_name
));
800 fprintf_unfiltered (file
,
801 "gdbarch_dump: address_to_pointer = <%s>\n",
802 host_address_to_string (gdbarch
->address_to_pointer
));
803 fprintf_unfiltered (file
,
804 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
805 gdbarch_adjust_breakpoint_address_p (gdbarch
));
806 fprintf_unfiltered (file
,
807 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
808 host_address_to_string (gdbarch
->adjust_breakpoint_address
));
809 fprintf_unfiltered (file
,
810 "gdbarch_dump: auto_charset = <%s>\n",
811 host_address_to_string (gdbarch
->auto_charset
));
812 fprintf_unfiltered (file
,
813 "gdbarch_dump: auto_wide_charset = <%s>\n",
814 host_address_to_string (gdbarch
->auto_wide_charset
));
815 fprintf_unfiltered (file
,
816 "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
817 gdbarch_ax_pseudo_register_collect_p (gdbarch
));
818 fprintf_unfiltered (file
,
819 "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
820 host_address_to_string (gdbarch
->ax_pseudo_register_collect
));
821 fprintf_unfiltered (file
,
822 "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
823 gdbarch_ax_pseudo_register_push_stack_p (gdbarch
));
824 fprintf_unfiltered (file
,
825 "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
826 host_address_to_string (gdbarch
->ax_pseudo_register_push_stack
));
827 fprintf_unfiltered (file
,
828 "gdbarch_dump: believe_pcc_promotion = %s\n",
829 plongest (gdbarch
->believe_pcc_promotion
));
830 fprintf_unfiltered (file
,
831 "gdbarch_dump: bfd_arch_info = %s\n",
832 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
833 fprintf_unfiltered (file
,
834 "gdbarch_dump: bits_big_endian = %s\n",
835 plongest (gdbarch
->bits_big_endian
));
836 fprintf_unfiltered (file
,
837 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
838 host_address_to_string (gdbarch
->breakpoint_from_pc
));
839 fprintf_unfiltered (file
,
840 "gdbarch_dump: byte_order = %s\n",
841 plongest (gdbarch
->byte_order
));
842 fprintf_unfiltered (file
,
843 "gdbarch_dump: byte_order_for_code = %s\n",
844 plongest (gdbarch
->byte_order_for_code
));
845 fprintf_unfiltered (file
,
846 "gdbarch_dump: call_dummy_location = %s\n",
847 plongest (gdbarch
->call_dummy_location
));
848 fprintf_unfiltered (file
,
849 "gdbarch_dump: cannot_fetch_register = <%s>\n",
850 host_address_to_string (gdbarch
->cannot_fetch_register
));
851 fprintf_unfiltered (file
,
852 "gdbarch_dump: cannot_step_breakpoint = %s\n",
853 plongest (gdbarch
->cannot_step_breakpoint
));
854 fprintf_unfiltered (file
,
855 "gdbarch_dump: cannot_store_register = <%s>\n",
856 host_address_to_string (gdbarch
->cannot_store_register
));
857 fprintf_unfiltered (file
,
858 "gdbarch_dump: char_signed = %s\n",
859 plongest (gdbarch
->char_signed
));
860 fprintf_unfiltered (file
,
861 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
862 host_address_to_string (gdbarch
->coff_make_msymbol_special
));
863 fprintf_unfiltered (file
,
864 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
865 host_address_to_string (gdbarch
->convert_from_func_ptr_addr
));
866 fprintf_unfiltered (file
,
867 "gdbarch_dump: convert_register_p = <%s>\n",
868 host_address_to_string (gdbarch
->convert_register_p
));
869 fprintf_unfiltered (file
,
870 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
871 gdbarch_core_pid_to_str_p (gdbarch
));
872 fprintf_unfiltered (file
,
873 "gdbarch_dump: core_pid_to_str = <%s>\n",
874 host_address_to_string (gdbarch
->core_pid_to_str
));
875 fprintf_unfiltered (file
,
876 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
877 gdbarch_core_read_description_p (gdbarch
));
878 fprintf_unfiltered (file
,
879 "gdbarch_dump: core_read_description = <%s>\n",
880 host_address_to_string (gdbarch
->core_read_description
));
881 fprintf_unfiltered (file
,
882 "gdbarch_dump: core_regset_sections = %s\n",
883 host_address_to_string (gdbarch
->core_regset_sections
));
884 fprintf_unfiltered (file
,
885 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
886 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
887 fprintf_unfiltered (file
,
888 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
889 host_address_to_string (gdbarch
->core_xfer_shared_libraries
));
890 fprintf_unfiltered (file
,
891 "gdbarch_dump: decr_pc_after_break = %s\n",
892 core_addr_to_string_nz (gdbarch
->decr_pc_after_break
));
893 fprintf_unfiltered (file
,
894 "gdbarch_dump: deprecated_fp_regnum = %s\n",
895 plongest (gdbarch
->deprecated_fp_regnum
));
896 fprintf_unfiltered (file
,
897 "gdbarch_dump: deprecated_function_start_offset = %s\n",
898 core_addr_to_string_nz (gdbarch
->deprecated_function_start_offset
));
899 fprintf_unfiltered (file
,
900 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
901 gdbarch_displaced_step_copy_insn_p (gdbarch
));
902 fprintf_unfiltered (file
,
903 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
904 host_address_to_string (gdbarch
->displaced_step_copy_insn
));
905 fprintf_unfiltered (file
,
906 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
907 gdbarch_displaced_step_fixup_p (gdbarch
));
908 fprintf_unfiltered (file
,
909 "gdbarch_dump: displaced_step_fixup = <%s>\n",
910 host_address_to_string (gdbarch
->displaced_step_fixup
));
911 fprintf_unfiltered (file
,
912 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
913 host_address_to_string (gdbarch
->displaced_step_free_closure
));
914 fprintf_unfiltered (file
,
915 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
916 host_address_to_string (gdbarch
->displaced_step_hw_singlestep
));
917 fprintf_unfiltered (file
,
918 "gdbarch_dump: displaced_step_location = <%s>\n",
919 host_address_to_string (gdbarch
->displaced_step_location
));
920 fprintf_unfiltered (file
,
921 "gdbarch_dump: double_bit = %s\n",
922 plongest (gdbarch
->double_bit
));
923 fprintf_unfiltered (file
,
924 "gdbarch_dump: double_format = %s\n",
925 pformat (gdbarch
->double_format
));
926 fprintf_unfiltered (file
,
927 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
928 gdbarch_dummy_id_p (gdbarch
));
929 fprintf_unfiltered (file
,
930 "gdbarch_dump: dummy_id = <%s>\n",
931 host_address_to_string (gdbarch
->dummy_id
));
932 fprintf_unfiltered (file
,
933 "gdbarch_dump: dwarf2_addr_size = %s\n",
934 plongest (gdbarch
->dwarf2_addr_size
));
935 fprintf_unfiltered (file
,
936 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
937 host_address_to_string (gdbarch
->dwarf2_reg_to_regnum
));
938 fprintf_unfiltered (file
,
939 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
940 host_address_to_string (gdbarch
->ecoff_reg_to_regnum
));
941 fprintf_unfiltered (file
,
942 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
943 host_address_to_string (gdbarch
->elf_make_msymbol_special
));
944 fprintf_unfiltered (file
,
945 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
946 host_address_to_string (gdbarch
->fast_tracepoint_valid_at
));
947 fprintf_unfiltered (file
,
948 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
949 gdbarch_fetch_pointer_argument_p (gdbarch
));
950 fprintf_unfiltered (file
,
951 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
952 host_address_to_string (gdbarch
->fetch_pointer_argument
));
953 fprintf_unfiltered (file
,
954 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
955 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
956 fprintf_unfiltered (file
,
957 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
958 host_address_to_string (gdbarch
->fetch_tls_load_module_address
));
959 fprintf_unfiltered (file
,
960 "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n",
961 gdbarch_find_memory_regions_p (gdbarch
));
962 fprintf_unfiltered (file
,
963 "gdbarch_dump: find_memory_regions = <%s>\n",
964 host_address_to_string (gdbarch
->find_memory_regions
));
965 fprintf_unfiltered (file
,
966 "gdbarch_dump: float_bit = %s\n",
967 plongest (gdbarch
->float_bit
));
968 fprintf_unfiltered (file
,
969 "gdbarch_dump: float_format = %s\n",
970 pformat (gdbarch
->float_format
));
971 fprintf_unfiltered (file
,
972 "gdbarch_dump: fp0_regnum = %s\n",
973 plongest (gdbarch
->fp0_regnum
));
974 fprintf_unfiltered (file
,
975 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
976 gdbarch_frame_align_p (gdbarch
));
977 fprintf_unfiltered (file
,
978 "gdbarch_dump: frame_align = <%s>\n",
979 host_address_to_string (gdbarch
->frame_align
));
980 fprintf_unfiltered (file
,
981 "gdbarch_dump: frame_args_skip = %s\n",
982 core_addr_to_string_nz (gdbarch
->frame_args_skip
));
983 fprintf_unfiltered (file
,
984 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
985 gdbarch_frame_num_args_p (gdbarch
));
986 fprintf_unfiltered (file
,
987 "gdbarch_dump: frame_num_args = <%s>\n",
988 host_address_to_string (gdbarch
->frame_num_args
));
989 fprintf_unfiltered (file
,
990 "gdbarch_dump: frame_red_zone_size = %s\n",
991 plongest (gdbarch
->frame_red_zone_size
));
992 fprintf_unfiltered (file
,
993 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
994 gdbarch_gcore_bfd_target_p (gdbarch
));
995 fprintf_unfiltered (file
,
996 "gdbarch_dump: gcore_bfd_target = %s\n",
997 pstring (gdbarch
->gcore_bfd_target
));
998 fprintf_unfiltered (file
,
999 "gdbarch_dump: gdb_signal_from_target = <%s>\n",
1000 host_address_to_string (gdbarch
->gdb_signal_from_target
));
1001 fprintf_unfiltered (file
,
1002 "gdbarch_dump: gen_return_address = <%s>\n",
1003 host_address_to_string (gdbarch
->gen_return_address
));
1004 fprintf_unfiltered (file
,
1005 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1006 gdbarch_get_longjmp_target_p (gdbarch
));
1007 fprintf_unfiltered (file
,
1008 "gdbarch_dump: get_longjmp_target = <%s>\n",
1009 host_address_to_string (gdbarch
->get_longjmp_target
));
1010 fprintf_unfiltered (file
,
1011 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
1012 gdbarch_get_siginfo_type_p (gdbarch
));
1013 fprintf_unfiltered (file
,
1014 "gdbarch_dump: get_siginfo_type = <%s>\n",
1015 host_address_to_string (gdbarch
->get_siginfo_type
));
1016 fprintf_unfiltered (file
,
1017 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
1018 gdbarch_get_syscall_number_p (gdbarch
));
1019 fprintf_unfiltered (file
,
1020 "gdbarch_dump: get_syscall_number = <%s>\n",
1021 host_address_to_string (gdbarch
->get_syscall_number
));
1022 fprintf_unfiltered (file
,
1023 "gdbarch_dump: half_bit = %s\n",
1024 plongest (gdbarch
->half_bit
));
1025 fprintf_unfiltered (file
,
1026 "gdbarch_dump: half_format = %s\n",
1027 pformat (gdbarch
->half_format
));
1028 fprintf_unfiltered (file
,
1029 "gdbarch_dump: has_dos_based_file_system = %s\n",
1030 plongest (gdbarch
->has_dos_based_file_system
));
1031 fprintf_unfiltered (file
,
1032 "gdbarch_dump: has_global_breakpoints = %s\n",
1033 plongest (gdbarch
->has_global_breakpoints
));
1034 fprintf_unfiltered (file
,
1035 "gdbarch_dump: has_global_solist = %s\n",
1036 plongest (gdbarch
->has_global_solist
));
1037 fprintf_unfiltered (file
,
1038 "gdbarch_dump: has_shared_address_space = <%s>\n",
1039 host_address_to_string (gdbarch
->has_shared_address_space
));
1040 fprintf_unfiltered (file
,
1041 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1042 plongest (gdbarch
->have_nonsteppable_watchpoint
));
1043 fprintf_unfiltered (file
,
1044 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
1045 host_address_to_string (gdbarch
->in_function_epilogue_p
));
1046 fprintf_unfiltered (file
,
1047 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
1048 host_address_to_string (gdbarch
->in_solib_return_trampoline
));
1049 fprintf_unfiltered (file
,
1050 "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
1051 gdbarch_info_proc_p (gdbarch
));
1052 fprintf_unfiltered (file
,
1053 "gdbarch_dump: info_proc = <%s>\n",
1054 host_address_to_string (gdbarch
->info_proc
));
1055 fprintf_unfiltered (file
,
1056 "gdbarch_dump: inner_than = <%s>\n",
1057 host_address_to_string (gdbarch
->inner_than
));
1058 fprintf_unfiltered (file
,
1059 "gdbarch_dump: int_bit = %s\n",
1060 plongest (gdbarch
->int_bit
));
1061 fprintf_unfiltered (file
,
1062 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1063 gdbarch_integer_to_address_p (gdbarch
));
1064 fprintf_unfiltered (file
,
1065 "gdbarch_dump: integer_to_address = <%s>\n",
1066 host_address_to_string (gdbarch
->integer_to_address
));
1067 fprintf_unfiltered (file
,
1068 "gdbarch_dump: long_bit = %s\n",
1069 plongest (gdbarch
->long_bit
));
1070 fprintf_unfiltered (file
,
1071 "gdbarch_dump: long_double_bit = %s\n",
1072 plongest (gdbarch
->long_double_bit
));
1073 fprintf_unfiltered (file
,
1074 "gdbarch_dump: long_double_format = %s\n",
1075 pformat (gdbarch
->long_double_format
));
1076 fprintf_unfiltered (file
,
1077 "gdbarch_dump: long_long_align_bit = %s\n",
1078 plongest (gdbarch
->long_long_align_bit
));
1079 fprintf_unfiltered (file
,
1080 "gdbarch_dump: long_long_bit = %s\n",
1081 plongest (gdbarch
->long_long_bit
));
1082 fprintf_unfiltered (file
,
1083 "gdbarch_dump: gdbarch_make_corefile_notes_p() = %d\n",
1084 gdbarch_make_corefile_notes_p (gdbarch
));
1085 fprintf_unfiltered (file
,
1086 "gdbarch_dump: make_corefile_notes = <%s>\n",
1087 host_address_to_string (gdbarch
->make_corefile_notes
));
1088 fprintf_unfiltered (file
,
1089 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
1090 gdbarch_max_insn_length_p (gdbarch
));
1091 fprintf_unfiltered (file
,
1092 "gdbarch_dump: max_insn_length = %s\n",
1093 plongest (gdbarch
->max_insn_length
));
1094 fprintf_unfiltered (file
,
1095 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1096 host_address_to_string (gdbarch
->memory_insert_breakpoint
));
1097 fprintf_unfiltered (file
,
1098 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1099 host_address_to_string (gdbarch
->memory_remove_breakpoint
));
1100 fprintf_unfiltered (file
,
1101 "gdbarch_dump: num_pseudo_regs = %s\n",
1102 plongest (gdbarch
->num_pseudo_regs
));
1103 fprintf_unfiltered (file
,
1104 "gdbarch_dump: num_regs = %s\n",
1105 plongest (gdbarch
->num_regs
));
1106 fprintf_unfiltered (file
,
1107 "gdbarch_dump: osabi = %s\n",
1108 plongest (gdbarch
->osabi
));
1109 fprintf_unfiltered (file
,
1110 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
1111 gdbarch_overlay_update_p (gdbarch
));
1112 fprintf_unfiltered (file
,
1113 "gdbarch_dump: overlay_update = <%s>\n",
1114 host_address_to_string (gdbarch
->overlay_update
));
1115 fprintf_unfiltered (file
,
1116 "gdbarch_dump: pc_regnum = %s\n",
1117 plongest (gdbarch
->pc_regnum
));
1118 fprintf_unfiltered (file
,
1119 "gdbarch_dump: pointer_to_address = <%s>\n",
1120 host_address_to_string (gdbarch
->pointer_to_address
));
1121 fprintf_unfiltered (file
,
1122 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1123 gdbarch_print_float_info_p (gdbarch
));
1124 fprintf_unfiltered (file
,
1125 "gdbarch_dump: print_float_info = <%s>\n",
1126 host_address_to_string (gdbarch
->print_float_info
));
1127 fprintf_unfiltered (file
,
1128 "gdbarch_dump: print_insn = <%s>\n",
1129 host_address_to_string (gdbarch
->print_insn
));
1130 fprintf_unfiltered (file
,
1131 "gdbarch_dump: print_registers_info = <%s>\n",
1132 host_address_to_string (gdbarch
->print_registers_info
));
1133 fprintf_unfiltered (file
,
1134 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1135 gdbarch_print_vector_info_p (gdbarch
));
1136 fprintf_unfiltered (file
,
1137 "gdbarch_dump: print_vector_info = <%s>\n",
1138 host_address_to_string (gdbarch
->print_vector_info
));
1139 fprintf_unfiltered (file
,
1140 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1141 gdbarch_process_record_p (gdbarch
));
1142 fprintf_unfiltered (file
,
1143 "gdbarch_dump: process_record = <%s>\n",
1144 host_address_to_string (gdbarch
->process_record
));
1145 fprintf_unfiltered (file
,
1146 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1147 gdbarch_process_record_signal_p (gdbarch
));
1148 fprintf_unfiltered (file
,
1149 "gdbarch_dump: process_record_signal = <%s>\n",
1150 host_address_to_string (gdbarch
->process_record_signal
));
1151 fprintf_unfiltered (file
,
1152 "gdbarch_dump: ps_regnum = %s\n",
1153 plongest (gdbarch
->ps_regnum
));
1154 fprintf_unfiltered (file
,
1155 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1156 gdbarch_pseudo_register_read_p (gdbarch
));
1157 fprintf_unfiltered (file
,
1158 "gdbarch_dump: pseudo_register_read = <%s>\n",
1159 host_address_to_string (gdbarch
->pseudo_register_read
));
1160 fprintf_unfiltered (file
,
1161 "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
1162 gdbarch_pseudo_register_read_value_p (gdbarch
));
1163 fprintf_unfiltered (file
,
1164 "gdbarch_dump: pseudo_register_read_value = <%s>\n",
1165 host_address_to_string (gdbarch
->pseudo_register_read_value
));
1166 fprintf_unfiltered (file
,
1167 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1168 gdbarch_pseudo_register_write_p (gdbarch
));
1169 fprintf_unfiltered (file
,
1170 "gdbarch_dump: pseudo_register_write = <%s>\n",
1171 host_address_to_string (gdbarch
->pseudo_register_write
));
1172 fprintf_unfiltered (file
,
1173 "gdbarch_dump: ptr_bit = %s\n",
1174 plongest (gdbarch
->ptr_bit
));
1175 fprintf_unfiltered (file
,
1176 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1177 gdbarch_push_dummy_call_p (gdbarch
));
1178 fprintf_unfiltered (file
,
1179 "gdbarch_dump: push_dummy_call = <%s>\n",
1180 host_address_to_string (gdbarch
->push_dummy_call
));
1181 fprintf_unfiltered (file
,
1182 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1183 gdbarch_push_dummy_code_p (gdbarch
));
1184 fprintf_unfiltered (file
,
1185 "gdbarch_dump: push_dummy_code = <%s>\n",
1186 host_address_to_string (gdbarch
->push_dummy_code
));
1187 fprintf_unfiltered (file
,
1188 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1189 gdbarch_read_pc_p (gdbarch
));
1190 fprintf_unfiltered (file
,
1191 "gdbarch_dump: read_pc = <%s>\n",
1192 host_address_to_string (gdbarch
->read_pc
));
1193 fprintf_unfiltered (file
,
1194 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1195 gdbarch_record_special_symbol_p (gdbarch
));
1196 fprintf_unfiltered (file
,
1197 "gdbarch_dump: record_special_symbol = <%s>\n",
1198 host_address_to_string (gdbarch
->record_special_symbol
));
1199 fprintf_unfiltered (file
,
1200 "gdbarch_dump: register_name = <%s>\n",
1201 host_address_to_string (gdbarch
->register_name
));
1202 fprintf_unfiltered (file
,
1203 "gdbarch_dump: register_reggroup_p = <%s>\n",
1204 host_address_to_string (gdbarch
->register_reggroup_p
));
1205 fprintf_unfiltered (file
,
1206 "gdbarch_dump: register_sim_regno = <%s>\n",
1207 host_address_to_string (gdbarch
->register_sim_regno
));
1208 fprintf_unfiltered (file
,
1209 "gdbarch_dump: register_to_value = <%s>\n",
1210 host_address_to_string (gdbarch
->register_to_value
));
1211 fprintf_unfiltered (file
,
1212 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1213 gdbarch_register_type_p (gdbarch
));
1214 fprintf_unfiltered (file
,
1215 "gdbarch_dump: register_type = <%s>\n",
1216 host_address_to_string (gdbarch
->register_type
));
1217 fprintf_unfiltered (file
,
1218 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1219 gdbarch_regset_from_core_section_p (gdbarch
));
1220 fprintf_unfiltered (file
,
1221 "gdbarch_dump: regset_from_core_section = <%s>\n",
1222 host_address_to_string (gdbarch
->regset_from_core_section
));
1223 fprintf_unfiltered (file
,
1224 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1225 gdbarch_relocate_instruction_p (gdbarch
));
1226 fprintf_unfiltered (file
,
1227 "gdbarch_dump: relocate_instruction = <%s>\n",
1228 host_address_to_string (gdbarch
->relocate_instruction
));
1229 fprintf_unfiltered (file
,
1230 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1231 host_address_to_string (gdbarch
->remote_breakpoint_from_pc
));
1232 fprintf_unfiltered (file
,
1233 "gdbarch_dump: remote_register_number = <%s>\n",
1234 host_address_to_string (gdbarch
->remote_register_number
));
1235 fprintf_unfiltered (file
,
1236 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1237 gdbarch_return_value_p (gdbarch
));
1238 fprintf_unfiltered (file
,
1239 "gdbarch_dump: return_value = <%s>\n",
1240 host_address_to_string (gdbarch
->return_value
));
1241 fprintf_unfiltered (file
,
1242 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1243 host_address_to_string (gdbarch
->sdb_reg_to_regnum
));
1244 fprintf_unfiltered (file
,
1245 "gdbarch_dump: short_bit = %s\n",
1246 plongest (gdbarch
->short_bit
));
1247 fprintf_unfiltered (file
,
1248 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1249 gdbarch_single_step_through_delay_p (gdbarch
));
1250 fprintf_unfiltered (file
,
1251 "gdbarch_dump: single_step_through_delay = <%s>\n",
1252 host_address_to_string (gdbarch
->single_step_through_delay
));
1253 fprintf_unfiltered (file
,
1254 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1255 gdbarch_skip_main_prologue_p (gdbarch
));
1256 fprintf_unfiltered (file
,
1257 "gdbarch_dump: skip_main_prologue = <%s>\n",
1258 host_address_to_string (gdbarch
->skip_main_prologue
));
1259 fprintf_unfiltered (file
,
1260 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1261 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1262 fprintf_unfiltered (file
,
1263 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1264 host_address_to_string (gdbarch
->skip_permanent_breakpoint
));
1265 fprintf_unfiltered (file
,
1266 "gdbarch_dump: skip_prologue = <%s>\n",
1267 host_address_to_string (gdbarch
->skip_prologue
));
1268 fprintf_unfiltered (file
,
1269 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1270 host_address_to_string (gdbarch
->skip_solib_resolver
));
1271 fprintf_unfiltered (file
,
1272 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1273 host_address_to_string (gdbarch
->skip_trampoline_code
));
1274 fprintf_unfiltered (file
,
1275 "gdbarch_dump: smash_text_address = <%s>\n",
1276 host_address_to_string (gdbarch
->smash_text_address
));
1277 fprintf_unfiltered (file
,
1278 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1279 gdbarch_software_single_step_p (gdbarch
));
1280 fprintf_unfiltered (file
,
1281 "gdbarch_dump: software_single_step = <%s>\n",
1282 host_address_to_string (gdbarch
->software_single_step
));
1283 fprintf_unfiltered (file
,
1284 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1285 plongest (gdbarch
->sofun_address_maybe_missing
));
1286 fprintf_unfiltered (file
,
1287 "gdbarch_dump: solib_symbols_extension = %s\n",
1288 pstring (gdbarch
->solib_symbols_extension
));
1289 fprintf_unfiltered (file
,
1290 "gdbarch_dump: sp_regnum = %s\n",
1291 plongest (gdbarch
->sp_regnum
));
1292 fprintf_unfiltered (file
,
1293 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1294 host_address_to_string (gdbarch
->stab_reg_to_regnum
));
1295 fprintf_unfiltered (file
,
1296 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1297 host_address_to_string (gdbarch
->stabs_argument_has_addr
));
1298 fprintf_unfiltered (file
,
1299 "gdbarch_dump: stap_gdb_register_prefix = %s\n",
1300 gdbarch
->stap_gdb_register_prefix
);
1301 fprintf_unfiltered (file
,
1302 "gdbarch_dump: stap_gdb_register_suffix = %s\n",
1303 gdbarch
->stap_gdb_register_suffix
);
1304 fprintf_unfiltered (file
,
1305 "gdbarch_dump: stap_integer_prefix = %s\n",
1306 gdbarch
->stap_integer_prefix
);
1307 fprintf_unfiltered (file
,
1308 "gdbarch_dump: stap_integer_suffix = %s\n",
1309 gdbarch
->stap_integer_suffix
);
1310 fprintf_unfiltered (file
,
1311 "gdbarch_dump: gdbarch_stap_is_single_operand_p() = %d\n",
1312 gdbarch_stap_is_single_operand_p (gdbarch
));
1313 fprintf_unfiltered (file
,
1314 "gdbarch_dump: stap_is_single_operand = <%s>\n",
1315 host_address_to_string (gdbarch
->stap_is_single_operand
));
1316 fprintf_unfiltered (file
,
1317 "gdbarch_dump: gdbarch_stap_parse_special_token_p() = %d\n",
1318 gdbarch_stap_parse_special_token_p (gdbarch
));
1319 fprintf_unfiltered (file
,
1320 "gdbarch_dump: stap_parse_special_token = <%s>\n",
1321 host_address_to_string (gdbarch
->stap_parse_special_token
));
1322 fprintf_unfiltered (file
,
1323 "gdbarch_dump: stap_register_indirection_prefix = %s\n",
1324 gdbarch
->stap_register_indirection_prefix
);
1325 fprintf_unfiltered (file
,
1326 "gdbarch_dump: stap_register_indirection_suffix = %s\n",
1327 gdbarch
->stap_register_indirection_suffix
);
1328 fprintf_unfiltered (file
,
1329 "gdbarch_dump: stap_register_prefix = %s\n",
1330 gdbarch
->stap_register_prefix
);
1331 fprintf_unfiltered (file
,
1332 "gdbarch_dump: stap_register_suffix = %s\n",
1333 gdbarch
->stap_register_suffix
);
1334 fprintf_unfiltered (file
,
1335 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1336 gdbarch_static_transform_name_p (gdbarch
));
1337 fprintf_unfiltered (file
,
1338 "gdbarch_dump: static_transform_name = <%s>\n",
1339 host_address_to_string (gdbarch
->static_transform_name
));
1340 fprintf_unfiltered (file
,
1341 "gdbarch_dump: target_desc = %s\n",
1342 host_address_to_string (gdbarch
->target_desc
));
1343 fprintf_unfiltered (file
,
1344 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1345 gdbarch_unwind_pc_p (gdbarch
));
1346 fprintf_unfiltered (file
,
1347 "gdbarch_dump: unwind_pc = <%s>\n",
1348 host_address_to_string (gdbarch
->unwind_pc
));
1349 fprintf_unfiltered (file
,
1350 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1351 gdbarch_unwind_sp_p (gdbarch
));
1352 fprintf_unfiltered (file
,
1353 "gdbarch_dump: unwind_sp = <%s>\n",
1354 host_address_to_string (gdbarch
->unwind_sp
));
1355 fprintf_unfiltered (file
,
1356 "gdbarch_dump: value_from_register = <%s>\n",
1357 host_address_to_string (gdbarch
->value_from_register
));
1358 fprintf_unfiltered (file
,
1359 "gdbarch_dump: value_to_register = <%s>\n",
1360 host_address_to_string (gdbarch
->value_to_register
));
1361 fprintf_unfiltered (file
,
1362 "gdbarch_dump: vbit_in_delta = %s\n",
1363 plongest (gdbarch
->vbit_in_delta
));
1364 fprintf_unfiltered (file
,
1365 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1366 host_address_to_string (gdbarch
->virtual_frame_pointer
));
1367 fprintf_unfiltered (file
,
1368 "gdbarch_dump: vtable_function_descriptors = %s\n",
1369 plongest (gdbarch
->vtable_function_descriptors
));
1370 fprintf_unfiltered (file
,
1371 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1372 gdbarch_write_pc_p (gdbarch
));
1373 fprintf_unfiltered (file
,
1374 "gdbarch_dump: write_pc = <%s>\n",
1375 host_address_to_string (gdbarch
->write_pc
));
1376 if (gdbarch
->dump_tdep
!= NULL
)
1377 gdbarch
->dump_tdep (gdbarch
, file
);
1380 struct gdbarch_tdep
*
1381 gdbarch_tdep (struct gdbarch
*gdbarch
)
1383 if (gdbarch_debug
>= 2)
1384 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1385 return gdbarch
->tdep
;
1389 const struct bfd_arch_info
*
1390 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1392 gdb_assert (gdbarch
!= NULL
);
1393 if (gdbarch_debug
>= 2)
1394 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1395 return gdbarch
->bfd_arch_info
;
1399 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1401 gdb_assert (gdbarch
!= NULL
);
1402 if (gdbarch_debug
>= 2)
1403 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1404 return gdbarch
->byte_order
;
1408 gdbarch_byte_order_for_code (struct gdbarch
*gdbarch
)
1410 gdb_assert (gdbarch
!= NULL
);
1411 if (gdbarch_debug
>= 2)
1412 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order_for_code called\n");
1413 return gdbarch
->byte_order_for_code
;
1417 gdbarch_osabi (struct gdbarch
*gdbarch
)
1419 gdb_assert (gdbarch
!= NULL
);
1420 if (gdbarch_debug
>= 2)
1421 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1422 return gdbarch
->osabi
;
1425 const struct target_desc
*
1426 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1428 gdb_assert (gdbarch
!= NULL
);
1429 if (gdbarch_debug
>= 2)
1430 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1431 return gdbarch
->target_desc
;
1435 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1437 gdb_assert (gdbarch
!= NULL
);
1438 /* Skip verify of bits_big_endian, invalid_p == 0 */
1439 if (gdbarch_debug
>= 2)
1440 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1441 return gdbarch
->bits_big_endian
;
1445 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1446 int bits_big_endian
)
1448 gdbarch
->bits_big_endian
= bits_big_endian
;
1452 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1454 gdb_assert (gdbarch
!= NULL
);
1455 /* Skip verify of short_bit, invalid_p == 0 */
1456 if (gdbarch_debug
>= 2)
1457 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1458 return gdbarch
->short_bit
;
1462 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1465 gdbarch
->short_bit
= short_bit
;
1469 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1471 gdb_assert (gdbarch
!= NULL
);
1472 /* Skip verify of int_bit, invalid_p == 0 */
1473 if (gdbarch_debug
>= 2)
1474 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1475 return gdbarch
->int_bit
;
1479 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1482 gdbarch
->int_bit
= int_bit
;
1486 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1488 gdb_assert (gdbarch
!= NULL
);
1489 /* Skip verify of long_bit, invalid_p == 0 */
1490 if (gdbarch_debug
>= 2)
1491 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1492 return gdbarch
->long_bit
;
1496 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1499 gdbarch
->long_bit
= long_bit
;
1503 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1505 gdb_assert (gdbarch
!= NULL
);
1506 /* Skip verify of long_long_bit, invalid_p == 0 */
1507 if (gdbarch_debug
>= 2)
1508 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1509 return gdbarch
->long_long_bit
;
1513 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1516 gdbarch
->long_long_bit
= long_long_bit
;
1520 gdbarch_long_long_align_bit (struct gdbarch
*gdbarch
)
1522 gdb_assert (gdbarch
!= NULL
);
1523 /* Skip verify of long_long_align_bit, invalid_p == 0 */
1524 if (gdbarch_debug
>= 2)
1525 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_align_bit called\n");
1526 return gdbarch
->long_long_align_bit
;
1530 set_gdbarch_long_long_align_bit (struct gdbarch
*gdbarch
,
1531 int long_long_align_bit
)
1533 gdbarch
->long_long_align_bit
= long_long_align_bit
;
1537 gdbarch_half_bit (struct gdbarch
*gdbarch
)
1539 gdb_assert (gdbarch
!= NULL
);
1540 /* Skip verify of half_bit, invalid_p == 0 */
1541 if (gdbarch_debug
>= 2)
1542 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_bit called\n");
1543 return gdbarch
->half_bit
;
1547 set_gdbarch_half_bit (struct gdbarch
*gdbarch
,
1550 gdbarch
->half_bit
= half_bit
;
1553 const struct floatformat
**
1554 gdbarch_half_format (struct gdbarch
*gdbarch
)
1556 gdb_assert (gdbarch
!= NULL
);
1557 if (gdbarch_debug
>= 2)
1558 fprintf_unfiltered (gdb_stdlog
, "gdbarch_half_format called\n");
1559 return gdbarch
->half_format
;
1563 set_gdbarch_half_format (struct gdbarch
*gdbarch
,
1564 const struct floatformat
** half_format
)
1566 gdbarch
->half_format
= half_format
;
1570 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1572 gdb_assert (gdbarch
!= NULL
);
1573 /* Skip verify of float_bit, invalid_p == 0 */
1574 if (gdbarch_debug
>= 2)
1575 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1576 return gdbarch
->float_bit
;
1580 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1583 gdbarch
->float_bit
= float_bit
;
1586 const struct floatformat
**
1587 gdbarch_float_format (struct gdbarch
*gdbarch
)
1589 gdb_assert (gdbarch
!= NULL
);
1590 if (gdbarch_debug
>= 2)
1591 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1592 return gdbarch
->float_format
;
1596 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1597 const struct floatformat
** float_format
)
1599 gdbarch
->float_format
= float_format
;
1603 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1605 gdb_assert (gdbarch
!= NULL
);
1606 /* Skip verify of double_bit, invalid_p == 0 */
1607 if (gdbarch_debug
>= 2)
1608 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1609 return gdbarch
->double_bit
;
1613 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1616 gdbarch
->double_bit
= double_bit
;
1619 const struct floatformat
**
1620 gdbarch_double_format (struct gdbarch
*gdbarch
)
1622 gdb_assert (gdbarch
!= NULL
);
1623 if (gdbarch_debug
>= 2)
1624 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1625 return gdbarch
->double_format
;
1629 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1630 const struct floatformat
** double_format
)
1632 gdbarch
->double_format
= double_format
;
1636 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1638 gdb_assert (gdbarch
!= NULL
);
1639 /* Skip verify of long_double_bit, invalid_p == 0 */
1640 if (gdbarch_debug
>= 2)
1641 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1642 return gdbarch
->long_double_bit
;
1646 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1647 int long_double_bit
)
1649 gdbarch
->long_double_bit
= long_double_bit
;
1652 const struct floatformat
**
1653 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1655 gdb_assert (gdbarch
!= NULL
);
1656 if (gdbarch_debug
>= 2)
1657 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1658 return gdbarch
->long_double_format
;
1662 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1663 const struct floatformat
** long_double_format
)
1665 gdbarch
->long_double_format
= long_double_format
;
1669 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1671 gdb_assert (gdbarch
!= NULL
);
1672 /* Skip verify of ptr_bit, invalid_p == 0 */
1673 if (gdbarch_debug
>= 2)
1674 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1675 return gdbarch
->ptr_bit
;
1679 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1682 gdbarch
->ptr_bit
= ptr_bit
;
1686 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1688 gdb_assert (gdbarch
!= NULL
);
1689 /* Check variable changed from pre-default. */
1690 gdb_assert (gdbarch
->addr_bit
!= 0);
1691 if (gdbarch_debug
>= 2)
1692 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1693 return gdbarch
->addr_bit
;
1697 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1700 gdbarch
->addr_bit
= addr_bit
;
1704 gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
)
1706 gdb_assert (gdbarch
!= NULL
);
1707 /* Check variable changed from pre-default. */
1708 gdb_assert (gdbarch
->dwarf2_addr_size
!= 0);
1709 if (gdbarch_debug
>= 2)
1710 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_addr_size called\n");
1711 return gdbarch
->dwarf2_addr_size
;
1715 set_gdbarch_dwarf2_addr_size (struct gdbarch
*gdbarch
,
1716 int dwarf2_addr_size
)
1718 gdbarch
->dwarf2_addr_size
= dwarf2_addr_size
;
1722 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1724 gdb_assert (gdbarch
!= NULL
);
1725 /* Check variable changed from pre-default. */
1726 gdb_assert (gdbarch
->char_signed
!= -1);
1727 if (gdbarch_debug
>= 2)
1728 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1729 return gdbarch
->char_signed
;
1733 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1736 gdbarch
->char_signed
= char_signed
;
1740 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1742 gdb_assert (gdbarch
!= NULL
);
1743 return gdbarch
->read_pc
!= NULL
;
1747 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1749 gdb_assert (gdbarch
!= NULL
);
1750 gdb_assert (gdbarch
->read_pc
!= NULL
);
1751 if (gdbarch_debug
>= 2)
1752 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1753 return gdbarch
->read_pc (regcache
);
1757 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1758 gdbarch_read_pc_ftype read_pc
)
1760 gdbarch
->read_pc
= read_pc
;
1764 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1766 gdb_assert (gdbarch
!= NULL
);
1767 return gdbarch
->write_pc
!= NULL
;
1771 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1773 gdb_assert (gdbarch
!= NULL
);
1774 gdb_assert (gdbarch
->write_pc
!= NULL
);
1775 if (gdbarch_debug
>= 2)
1776 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1777 gdbarch
->write_pc (regcache
, val
);
1781 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1782 gdbarch_write_pc_ftype write_pc
)
1784 gdbarch
->write_pc
= write_pc
;
1788 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1790 gdb_assert (gdbarch
!= NULL
);
1791 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1792 if (gdbarch_debug
>= 2)
1793 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1794 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1798 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1799 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1801 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1805 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1807 gdb_assert (gdbarch
!= NULL
);
1808 return gdbarch
->pseudo_register_read
!= NULL
;
1811 enum register_status
1812 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1814 gdb_assert (gdbarch
!= NULL
);
1815 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1816 if (gdbarch_debug
>= 2)
1817 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1818 return gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1822 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1823 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1825 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1829 gdbarch_pseudo_register_read_value_p (struct gdbarch
*gdbarch
)
1831 gdb_assert (gdbarch
!= NULL
);
1832 return gdbarch
->pseudo_register_read_value
!= NULL
;
1836 gdbarch_pseudo_register_read_value (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
)
1838 gdb_assert (gdbarch
!= NULL
);
1839 gdb_assert (gdbarch
->pseudo_register_read_value
!= NULL
);
1840 if (gdbarch_debug
>= 2)
1841 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read_value called\n");
1842 return gdbarch
->pseudo_register_read_value (gdbarch
, regcache
, cookednum
);
1846 set_gdbarch_pseudo_register_read_value (struct gdbarch
*gdbarch
,
1847 gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value
)
1849 gdbarch
->pseudo_register_read_value
= pseudo_register_read_value
;
1853 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1855 gdb_assert (gdbarch
!= NULL
);
1856 return gdbarch
->pseudo_register_write
!= NULL
;
1860 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1862 gdb_assert (gdbarch
!= NULL
);
1863 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1864 if (gdbarch_debug
>= 2)
1865 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1866 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1870 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1871 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1873 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1877 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1879 gdb_assert (gdbarch
!= NULL
);
1880 /* Check variable changed from pre-default. */
1881 gdb_assert (gdbarch
->num_regs
!= -1);
1882 if (gdbarch_debug
>= 2)
1883 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1884 return gdbarch
->num_regs
;
1888 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1891 gdbarch
->num_regs
= num_regs
;
1895 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1897 gdb_assert (gdbarch
!= NULL
);
1898 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1899 if (gdbarch_debug
>= 2)
1900 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1901 return gdbarch
->num_pseudo_regs
;
1905 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1906 int num_pseudo_regs
)
1908 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1912 gdbarch_ax_pseudo_register_collect_p (struct gdbarch
*gdbarch
)
1914 gdb_assert (gdbarch
!= NULL
);
1915 return gdbarch
->ax_pseudo_register_collect
!= NULL
;
1919 gdbarch_ax_pseudo_register_collect (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, int reg
)
1921 gdb_assert (gdbarch
!= NULL
);
1922 gdb_assert (gdbarch
->ax_pseudo_register_collect
!= NULL
);
1923 if (gdbarch_debug
>= 2)
1924 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ax_pseudo_register_collect called\n");
1925 return gdbarch
->ax_pseudo_register_collect (gdbarch
, ax
, reg
);
1929 set_gdbarch_ax_pseudo_register_collect (struct gdbarch
*gdbarch
,
1930 gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect
)
1932 gdbarch
->ax_pseudo_register_collect
= ax_pseudo_register_collect
;
1936 gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch
*gdbarch
)
1938 gdb_assert (gdbarch
!= NULL
);
1939 return gdbarch
->ax_pseudo_register_push_stack
!= NULL
;
1943 gdbarch_ax_pseudo_register_push_stack (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, int reg
)
1945 gdb_assert (gdbarch
!= NULL
);
1946 gdb_assert (gdbarch
->ax_pseudo_register_push_stack
!= NULL
);
1947 if (gdbarch_debug
>= 2)
1948 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ax_pseudo_register_push_stack called\n");
1949 return gdbarch
->ax_pseudo_register_push_stack (gdbarch
, ax
, reg
);
1953 set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch
*gdbarch
,
1954 gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack
)
1956 gdbarch
->ax_pseudo_register_push_stack
= ax_pseudo_register_push_stack
;
1960 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1962 gdb_assert (gdbarch
!= NULL
);
1963 /* Skip verify of sp_regnum, invalid_p == 0 */
1964 if (gdbarch_debug
>= 2)
1965 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1966 return gdbarch
->sp_regnum
;
1970 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1973 gdbarch
->sp_regnum
= sp_regnum
;
1977 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1979 gdb_assert (gdbarch
!= NULL
);
1980 /* Skip verify of pc_regnum, invalid_p == 0 */
1981 if (gdbarch_debug
>= 2)
1982 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1983 return gdbarch
->pc_regnum
;
1987 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1990 gdbarch
->pc_regnum
= pc_regnum
;
1994 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
1996 gdb_assert (gdbarch
!= NULL
);
1997 /* Skip verify of ps_regnum, invalid_p == 0 */
1998 if (gdbarch_debug
>= 2)
1999 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
2000 return gdbarch
->ps_regnum
;
2004 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
2007 gdbarch
->ps_regnum
= ps_regnum
;
2011 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
2013 gdb_assert (gdbarch
!= NULL
);
2014 /* Skip verify of fp0_regnum, invalid_p == 0 */
2015 if (gdbarch_debug
>= 2)
2016 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
2017 return gdbarch
->fp0_regnum
;
2021 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
2024 gdbarch
->fp0_regnum
= fp0_regnum
;
2028 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
2030 gdb_assert (gdbarch
!= NULL
);
2031 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
2032 if (gdbarch_debug
>= 2)
2033 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
2034 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
2038 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
2039 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
2041 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
2045 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
2047 gdb_assert (gdbarch
!= NULL
);
2048 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
2049 if (gdbarch_debug
>= 2)
2050 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
2051 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
2055 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
2056 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
2058 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
2062 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
2064 gdb_assert (gdbarch
!= NULL
);
2065 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
2066 if (gdbarch_debug
>= 2)
2067 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
2068 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
2072 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
2073 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
2075 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
2079 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
2081 gdb_assert (gdbarch
!= NULL
);
2082 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
2083 if (gdbarch_debug
>= 2)
2084 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
2085 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
2089 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
2090 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
2092 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
2096 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
2098 gdb_assert (gdbarch
!= NULL
);
2099 gdb_assert (gdbarch
->register_name
!= NULL
);
2100 if (gdbarch_debug
>= 2)
2101 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
2102 return gdbarch
->register_name (gdbarch
, regnr
);
2106 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
2107 gdbarch_register_name_ftype register_name
)
2109 gdbarch
->register_name
= register_name
;
2113 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
2115 gdb_assert (gdbarch
!= NULL
);
2116 return gdbarch
->register_type
!= NULL
;
2120 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
2122 gdb_assert (gdbarch
!= NULL
);
2123 gdb_assert (gdbarch
->register_type
!= NULL
);
2124 if (gdbarch_debug
>= 2)
2125 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
2126 return gdbarch
->register_type (gdbarch
, reg_nr
);
2130 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
2131 gdbarch_register_type_ftype register_type
)
2133 gdbarch
->register_type
= register_type
;
2137 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
2139 gdb_assert (gdbarch
!= NULL
);
2140 return gdbarch
->dummy_id
!= NULL
;
2144 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
2146 gdb_assert (gdbarch
!= NULL
);
2147 gdb_assert (gdbarch
->dummy_id
!= NULL
);
2148 if (gdbarch_debug
>= 2)
2149 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
2150 return gdbarch
->dummy_id (gdbarch
, this_frame
);
2154 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
2155 gdbarch_dummy_id_ftype dummy_id
)
2157 gdbarch
->dummy_id
= dummy_id
;
2161 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
2163 gdb_assert (gdbarch
!= NULL
);
2164 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2165 if (gdbarch_debug
>= 2)
2166 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
2167 return gdbarch
->deprecated_fp_regnum
;
2171 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
2172 int deprecated_fp_regnum
)
2174 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
2178 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
2180 gdb_assert (gdbarch
!= NULL
);
2181 return gdbarch
->push_dummy_call
!= NULL
;
2185 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
)
2187 gdb_assert (gdbarch
!= NULL
);
2188 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
2189 if (gdbarch_debug
>= 2)
2190 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
2191 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
2195 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
2196 gdbarch_push_dummy_call_ftype push_dummy_call
)
2198 gdbarch
->push_dummy_call
= push_dummy_call
;
2202 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
2204 gdb_assert (gdbarch
!= NULL
);
2205 /* Skip verify of call_dummy_location, invalid_p == 0 */
2206 if (gdbarch_debug
>= 2)
2207 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
2208 return gdbarch
->call_dummy_location
;
2212 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
2213 int call_dummy_location
)
2215 gdbarch
->call_dummy_location
= call_dummy_location
;
2219 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2221 gdb_assert (gdbarch
!= NULL
);
2222 return gdbarch
->push_dummy_code
!= NULL
;
2226 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
)
2228 gdb_assert (gdbarch
!= NULL
);
2229 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2230 if (gdbarch_debug
>= 2)
2231 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2232 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
2236 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2237 gdbarch_push_dummy_code_ftype push_dummy_code
)
2239 gdbarch
->push_dummy_code
= push_dummy_code
;
2243 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2245 gdb_assert (gdbarch
!= NULL
);
2246 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2247 if (gdbarch_debug
>= 2)
2248 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2249 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2253 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2254 gdbarch_print_registers_info_ftype print_registers_info
)
2256 gdbarch
->print_registers_info
= print_registers_info
;
2260 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2262 gdb_assert (gdbarch
!= NULL
);
2263 return gdbarch
->print_float_info
!= NULL
;
2267 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2269 gdb_assert (gdbarch
!= NULL
);
2270 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2271 if (gdbarch_debug
>= 2)
2272 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2273 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2277 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2278 gdbarch_print_float_info_ftype print_float_info
)
2280 gdbarch
->print_float_info
= print_float_info
;
2284 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2286 gdb_assert (gdbarch
!= NULL
);
2287 return gdbarch
->print_vector_info
!= NULL
;
2291 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2293 gdb_assert (gdbarch
!= NULL
);
2294 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2295 if (gdbarch_debug
>= 2)
2296 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2297 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2301 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2302 gdbarch_print_vector_info_ftype print_vector_info
)
2304 gdbarch
->print_vector_info
= print_vector_info
;
2308 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2310 gdb_assert (gdbarch
!= NULL
);
2311 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2312 if (gdbarch_debug
>= 2)
2313 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2314 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
2318 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2319 gdbarch_register_sim_regno_ftype register_sim_regno
)
2321 gdbarch
->register_sim_regno
= register_sim_regno
;
2325 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2327 gdb_assert (gdbarch
!= NULL
);
2328 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2329 if (gdbarch_debug
>= 2)
2330 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2331 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
2335 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2336 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2338 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2342 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2344 gdb_assert (gdbarch
!= NULL
);
2345 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2346 if (gdbarch_debug
>= 2)
2347 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2348 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
2352 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2353 gdbarch_cannot_store_register_ftype cannot_store_register
)
2355 gdbarch
->cannot_store_register
= cannot_store_register
;
2359 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2361 gdb_assert (gdbarch
!= NULL
);
2362 return gdbarch
->get_longjmp_target
!= NULL
;
2366 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
2368 gdb_assert (gdbarch
!= NULL
);
2369 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2370 if (gdbarch_debug
>= 2)
2371 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2372 return gdbarch
->get_longjmp_target (frame
, pc
);
2376 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2377 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2379 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2383 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2385 gdb_assert (gdbarch
!= NULL
);
2386 if (gdbarch_debug
>= 2)
2387 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2388 return gdbarch
->believe_pcc_promotion
;
2392 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2393 int believe_pcc_promotion
)
2395 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2399 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2401 gdb_assert (gdbarch
!= NULL
);
2402 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2403 if (gdbarch_debug
>= 2)
2404 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2405 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
2409 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2410 gdbarch_convert_register_p_ftype convert_register_p
)
2412 gdbarch
->convert_register_p
= convert_register_p
;
2416 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
, int *optimizedp
, int *unavailablep
)
2418 gdb_assert (gdbarch
!= NULL
);
2419 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2420 if (gdbarch_debug
>= 2)
2421 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2422 return gdbarch
->register_to_value (frame
, regnum
, type
, buf
, optimizedp
, unavailablep
);
2426 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2427 gdbarch_register_to_value_ftype register_to_value
)
2429 gdbarch
->register_to_value
= register_to_value
;
2433 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2435 gdb_assert (gdbarch
!= NULL
);
2436 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2437 if (gdbarch_debug
>= 2)
2438 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2439 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2443 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2444 gdbarch_value_to_register_ftype value_to_register
)
2446 gdbarch
->value_to_register
= value_to_register
;
2450 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2452 gdb_assert (gdbarch
!= NULL
);
2453 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2454 if (gdbarch_debug
>= 2)
2455 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2456 return gdbarch
->value_from_register (type
, regnum
, frame
);
2460 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2461 gdbarch_value_from_register_ftype value_from_register
)
2463 gdbarch
->value_from_register
= value_from_register
;
2467 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2469 gdb_assert (gdbarch
!= NULL
);
2470 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2471 if (gdbarch_debug
>= 2)
2472 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2473 return gdbarch
->pointer_to_address (gdbarch
, type
, buf
);
2477 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2478 gdbarch_pointer_to_address_ftype pointer_to_address
)
2480 gdbarch
->pointer_to_address
= pointer_to_address
;
2484 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2486 gdb_assert (gdbarch
!= NULL
);
2487 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2488 if (gdbarch_debug
>= 2)
2489 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2490 gdbarch
->address_to_pointer (gdbarch
, type
, buf
, addr
);
2494 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2495 gdbarch_address_to_pointer_ftype address_to_pointer
)
2497 gdbarch
->address_to_pointer
= address_to_pointer
;
2501 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2503 gdb_assert (gdbarch
!= NULL
);
2504 return gdbarch
->integer_to_address
!= NULL
;
2508 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2510 gdb_assert (gdbarch
!= NULL
);
2511 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2512 if (gdbarch_debug
>= 2)
2513 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2514 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2518 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2519 gdbarch_integer_to_address_ftype integer_to_address
)
2521 gdbarch
->integer_to_address
= integer_to_address
;
2525 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2527 gdb_assert (gdbarch
!= NULL
);
2528 return gdbarch
->return_value
!= NULL
;
2531 enum return_value_convention
2532 gdbarch_return_value (struct gdbarch
*gdbarch
, struct value
*function
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2534 gdb_assert (gdbarch
!= NULL
);
2535 gdb_assert (gdbarch
->return_value
!= NULL
);
2536 if (gdbarch_debug
>= 2)
2537 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2538 return gdbarch
->return_value (gdbarch
, function
, valtype
, regcache
, readbuf
, writebuf
);
2542 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2543 gdbarch_return_value_ftype return_value
)
2545 gdbarch
->return_value
= return_value
;
2549 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2551 gdb_assert (gdbarch
!= NULL
);
2552 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2553 if (gdbarch_debug
>= 2)
2554 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2555 return gdbarch
->skip_prologue (gdbarch
, ip
);
2559 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2560 gdbarch_skip_prologue_ftype skip_prologue
)
2562 gdbarch
->skip_prologue
= skip_prologue
;
2566 gdbarch_skip_main_prologue_p (struct gdbarch
*gdbarch
)
2568 gdb_assert (gdbarch
!= NULL
);
2569 return gdbarch
->skip_main_prologue
!= NULL
;
2573 gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2575 gdb_assert (gdbarch
!= NULL
);
2576 gdb_assert (gdbarch
->skip_main_prologue
!= NULL
);
2577 if (gdbarch_debug
>= 2)
2578 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_main_prologue called\n");
2579 return gdbarch
->skip_main_prologue (gdbarch
, ip
);
2583 set_gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
,
2584 gdbarch_skip_main_prologue_ftype skip_main_prologue
)
2586 gdbarch
->skip_main_prologue
= skip_main_prologue
;
2590 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2592 gdb_assert (gdbarch
!= NULL
);
2593 gdb_assert (gdbarch
->inner_than
!= NULL
);
2594 if (gdbarch_debug
>= 2)
2595 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2596 return gdbarch
->inner_than (lhs
, rhs
);
2600 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2601 gdbarch_inner_than_ftype inner_than
)
2603 gdbarch
->inner_than
= inner_than
;
2607 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2609 gdb_assert (gdbarch
!= NULL
);
2610 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2611 if (gdbarch_debug
>= 2)
2612 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2613 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2617 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2618 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2620 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2624 gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *kindptr
)
2626 gdb_assert (gdbarch
!= NULL
);
2627 gdb_assert (gdbarch
->remote_breakpoint_from_pc
!= NULL
);
2628 if (gdbarch_debug
>= 2)
2629 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_breakpoint_from_pc called\n");
2630 gdbarch
->remote_breakpoint_from_pc (gdbarch
, pcptr
, kindptr
);
2634 set_gdbarch_remote_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2635 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc
)
2637 gdbarch
->remote_breakpoint_from_pc
= remote_breakpoint_from_pc
;
2641 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2643 gdb_assert (gdbarch
!= NULL
);
2644 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2648 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2650 gdb_assert (gdbarch
!= NULL
);
2651 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2652 if (gdbarch_debug
>= 2)
2653 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2654 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2658 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2659 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2661 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2665 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2667 gdb_assert (gdbarch
!= NULL
);
2668 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2669 if (gdbarch_debug
>= 2)
2670 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2671 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2675 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2676 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2678 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2682 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2684 gdb_assert (gdbarch
!= NULL
);
2685 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2686 if (gdbarch_debug
>= 2)
2687 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2688 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2692 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2693 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2695 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2699 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2701 gdb_assert (gdbarch
!= NULL
);
2702 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2703 if (gdbarch_debug
>= 2)
2704 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2705 return gdbarch
->decr_pc_after_break
;
2709 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2710 CORE_ADDR decr_pc_after_break
)
2712 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2716 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2718 gdb_assert (gdbarch
!= NULL
);
2719 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2720 if (gdbarch_debug
>= 2)
2721 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2722 return gdbarch
->deprecated_function_start_offset
;
2726 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2727 CORE_ADDR deprecated_function_start_offset
)
2729 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2733 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2735 gdb_assert (gdbarch
!= NULL
);
2736 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2737 if (gdbarch_debug
>= 2)
2738 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2739 return gdbarch
->remote_register_number (gdbarch
, regno
);
2743 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2744 gdbarch_remote_register_number_ftype remote_register_number
)
2746 gdbarch
->remote_register_number
= remote_register_number
;
2750 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2752 gdb_assert (gdbarch
!= NULL
);
2753 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2757 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2759 gdb_assert (gdbarch
!= NULL
);
2760 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2761 if (gdbarch_debug
>= 2)
2762 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2763 return gdbarch
->fetch_tls_load_module_address (objfile
);
2767 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2768 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2770 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2774 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2776 gdb_assert (gdbarch
!= NULL
);
2777 /* Skip verify of frame_args_skip, invalid_p == 0 */
2778 if (gdbarch_debug
>= 2)
2779 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2780 return gdbarch
->frame_args_skip
;
2784 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2785 CORE_ADDR frame_args_skip
)
2787 gdbarch
->frame_args_skip
= frame_args_skip
;
2791 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2793 gdb_assert (gdbarch
!= NULL
);
2794 return gdbarch
->unwind_pc
!= NULL
;
2798 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2800 gdb_assert (gdbarch
!= NULL
);
2801 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2802 if (gdbarch_debug
>= 2)
2803 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2804 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2808 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2809 gdbarch_unwind_pc_ftype unwind_pc
)
2811 gdbarch
->unwind_pc
= unwind_pc
;
2815 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2817 gdb_assert (gdbarch
!= NULL
);
2818 return gdbarch
->unwind_sp
!= NULL
;
2822 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2824 gdb_assert (gdbarch
!= NULL
);
2825 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2826 if (gdbarch_debug
>= 2)
2827 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2828 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2832 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2833 gdbarch_unwind_sp_ftype unwind_sp
)
2835 gdbarch
->unwind_sp
= unwind_sp
;
2839 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2841 gdb_assert (gdbarch
!= NULL
);
2842 return gdbarch
->frame_num_args
!= NULL
;
2846 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2848 gdb_assert (gdbarch
!= NULL
);
2849 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2850 if (gdbarch_debug
>= 2)
2851 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2852 return gdbarch
->frame_num_args (frame
);
2856 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2857 gdbarch_frame_num_args_ftype frame_num_args
)
2859 gdbarch
->frame_num_args
= frame_num_args
;
2863 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2865 gdb_assert (gdbarch
!= NULL
);
2866 return gdbarch
->frame_align
!= NULL
;
2870 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2872 gdb_assert (gdbarch
!= NULL
);
2873 gdb_assert (gdbarch
->frame_align
!= NULL
);
2874 if (gdbarch_debug
>= 2)
2875 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2876 return gdbarch
->frame_align (gdbarch
, address
);
2880 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2881 gdbarch_frame_align_ftype frame_align
)
2883 gdbarch
->frame_align
= frame_align
;
2887 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2889 gdb_assert (gdbarch
!= NULL
);
2890 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2891 if (gdbarch_debug
>= 2)
2892 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2893 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2897 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2898 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2900 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2904 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2906 gdb_assert (gdbarch
!= NULL
);
2907 if (gdbarch_debug
>= 2)
2908 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2909 return gdbarch
->frame_red_zone_size
;
2913 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2914 int frame_red_zone_size
)
2916 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2920 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2922 gdb_assert (gdbarch
!= NULL
);
2923 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2924 if (gdbarch_debug
>= 2)
2925 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2926 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2930 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2931 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2933 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2937 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2939 gdb_assert (gdbarch
!= NULL
);
2940 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2941 if (gdbarch_debug
>= 2)
2942 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2943 return gdbarch
->addr_bits_remove (gdbarch
, addr
);
2947 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2948 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2950 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2954 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2956 gdb_assert (gdbarch
!= NULL
);
2957 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2958 if (gdbarch_debug
>= 2)
2959 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2960 return gdbarch
->smash_text_address (gdbarch
, addr
);
2964 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
2965 gdbarch_smash_text_address_ftype smash_text_address
)
2967 gdbarch
->smash_text_address
= smash_text_address
;
2971 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2973 gdb_assert (gdbarch
!= NULL
);
2974 return gdbarch
->software_single_step
!= NULL
;
2978 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2980 gdb_assert (gdbarch
!= NULL
);
2981 gdb_assert (gdbarch
->software_single_step
!= NULL
);
2982 if (gdbarch_debug
>= 2)
2983 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
2984 return gdbarch
->software_single_step (frame
);
2988 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
2989 gdbarch_software_single_step_ftype software_single_step
)
2991 gdbarch
->software_single_step
= software_single_step
;
2995 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
2997 gdb_assert (gdbarch
!= NULL
);
2998 return gdbarch
->single_step_through_delay
!= NULL
;
3002 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3004 gdb_assert (gdbarch
!= NULL
);
3005 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
3006 if (gdbarch_debug
>= 2)
3007 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
3008 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
3012 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
3013 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
3015 gdbarch
->single_step_through_delay
= single_step_through_delay
;
3019 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
3021 gdb_assert (gdbarch
!= NULL
);
3022 gdb_assert (gdbarch
->print_insn
!= NULL
);
3023 if (gdbarch_debug
>= 2)
3024 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
3025 return gdbarch
->print_insn (vma
, info
);
3029 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
3030 gdbarch_print_insn_ftype print_insn
)
3032 gdbarch
->print_insn
= print_insn
;
3036 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
3038 gdb_assert (gdbarch
!= NULL
);
3039 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
3040 if (gdbarch_debug
>= 2)
3041 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
3042 return gdbarch
->skip_trampoline_code (frame
, pc
);
3046 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
3047 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
3049 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
3053 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3055 gdb_assert (gdbarch
!= NULL
);
3056 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
3057 if (gdbarch_debug
>= 2)
3058 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
3059 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
3063 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
3064 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
3066 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
3070 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, const char *name
)
3072 gdb_assert (gdbarch
!= NULL
);
3073 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
3074 if (gdbarch_debug
>= 2)
3075 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
3076 return gdbarch
->in_solib_return_trampoline (gdbarch
, pc
, name
);
3080 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
3081 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
3083 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
3087 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3089 gdb_assert (gdbarch
!= NULL
);
3090 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
3091 if (gdbarch_debug
>= 2)
3092 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
3093 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
3097 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
3098 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
3100 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
3104 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
3106 gdb_assert (gdbarch
!= NULL
);
3107 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
3108 if (gdbarch_debug
>= 2)
3109 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
3110 gdbarch
->elf_make_msymbol_special (sym
, msym
);
3114 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
3115 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
3117 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
3121 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
3123 gdb_assert (gdbarch
!= NULL
);
3124 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
3125 if (gdbarch_debug
>= 2)
3126 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
3127 gdbarch
->coff_make_msymbol_special (val
, msym
);
3131 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
3132 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
3134 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
3138 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
3140 gdb_assert (gdbarch
!= NULL
);
3141 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3142 if (gdbarch_debug
>= 2)
3143 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
3144 return gdbarch
->cannot_step_breakpoint
;
3148 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
3149 int cannot_step_breakpoint
)
3151 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
3155 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
3157 gdb_assert (gdbarch
!= NULL
);
3158 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3159 if (gdbarch_debug
>= 2)
3160 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
3161 return gdbarch
->have_nonsteppable_watchpoint
;
3165 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
3166 int have_nonsteppable_watchpoint
)
3168 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
3172 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
3174 gdb_assert (gdbarch
!= NULL
);
3175 return gdbarch
->address_class_type_flags
!= NULL
;
3179 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
3181 gdb_assert (gdbarch
!= NULL
);
3182 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
3183 if (gdbarch_debug
>= 2)
3184 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
3185 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
3189 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
3190 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
3192 gdbarch
->address_class_type_flags
= address_class_type_flags
;
3196 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
3198 gdb_assert (gdbarch
!= NULL
);
3199 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
3203 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
3205 gdb_assert (gdbarch
!= NULL
);
3206 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
3207 if (gdbarch_debug
>= 2)
3208 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
3209 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
3213 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
3214 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3216 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3220 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3222 gdb_assert (gdbarch
!= NULL
);
3223 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3227 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3229 gdb_assert (gdbarch
!= NULL
);
3230 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3231 if (gdbarch_debug
>= 2)
3232 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3233 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3237 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3238 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3240 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3244 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3246 gdb_assert (gdbarch
!= NULL
);
3247 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3248 if (gdbarch_debug
>= 2)
3249 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3250 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3254 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3255 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3257 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3261 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3263 gdb_assert (gdbarch
!= NULL
);
3264 return gdbarch
->fetch_pointer_argument
!= NULL
;
3268 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3270 gdb_assert (gdbarch
!= NULL
);
3271 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3272 if (gdbarch_debug
>= 2)
3273 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3274 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3278 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3279 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3281 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3285 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3287 gdb_assert (gdbarch
!= NULL
);
3288 return gdbarch
->regset_from_core_section
!= NULL
;
3291 const struct regset
*
3292 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3294 gdb_assert (gdbarch
!= NULL
);
3295 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3296 if (gdbarch_debug
>= 2)
3297 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3298 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3302 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3303 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3305 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3308 struct core_regset_section
*
3309 gdbarch_core_regset_sections (struct gdbarch
*gdbarch
)
3311 gdb_assert (gdbarch
!= NULL
);
3312 if (gdbarch_debug
>= 2)
3313 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_regset_sections called\n");
3314 return gdbarch
->core_regset_sections
;
3318 set_gdbarch_core_regset_sections (struct gdbarch
*gdbarch
,
3319 struct core_regset_section
* core_regset_sections
)
3321 gdbarch
->core_regset_sections
= core_regset_sections
;
3325 gdbarch_make_corefile_notes_p (struct gdbarch
*gdbarch
)
3327 gdb_assert (gdbarch
!= NULL
);
3328 return gdbarch
->make_corefile_notes
!= NULL
;
3332 gdbarch_make_corefile_notes (struct gdbarch
*gdbarch
, bfd
*obfd
, int *note_size
)
3334 gdb_assert (gdbarch
!= NULL
);
3335 gdb_assert (gdbarch
->make_corefile_notes
!= NULL
);
3336 if (gdbarch_debug
>= 2)
3337 fprintf_unfiltered (gdb_stdlog
, "gdbarch_make_corefile_notes called\n");
3338 return gdbarch
->make_corefile_notes (gdbarch
, obfd
, note_size
);
3342 set_gdbarch_make_corefile_notes (struct gdbarch
*gdbarch
,
3343 gdbarch_make_corefile_notes_ftype make_corefile_notes
)
3345 gdbarch
->make_corefile_notes
= make_corefile_notes
;
3349 gdbarch_find_memory_regions_p (struct gdbarch
*gdbarch
)
3351 gdb_assert (gdbarch
!= NULL
);
3352 return gdbarch
->find_memory_regions
!= NULL
;
3356 gdbarch_find_memory_regions (struct gdbarch
*gdbarch
, find_memory_region_ftype func
, void *data
)
3358 gdb_assert (gdbarch
!= NULL
);
3359 gdb_assert (gdbarch
->find_memory_regions
!= NULL
);
3360 if (gdbarch_debug
>= 2)
3361 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_memory_regions called\n");
3362 return gdbarch
->find_memory_regions (gdbarch
, func
, data
);
3366 set_gdbarch_find_memory_regions (struct gdbarch
*gdbarch
,
3367 gdbarch_find_memory_regions_ftype find_memory_regions
)
3369 gdbarch
->find_memory_regions
= find_memory_regions
;
3373 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
3375 gdb_assert (gdbarch
!= NULL
);
3376 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
3380 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
3382 gdb_assert (gdbarch
!= NULL
);
3383 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
3384 if (gdbarch_debug
>= 2)
3385 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
3386 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
3390 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
3391 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
3393 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
3397 gdbarch_core_pid_to_str_p (struct gdbarch
*gdbarch
)
3399 gdb_assert (gdbarch
!= NULL
);
3400 return gdbarch
->core_pid_to_str
!= NULL
;
3404 gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
, ptid_t ptid
)
3406 gdb_assert (gdbarch
!= NULL
);
3407 gdb_assert (gdbarch
->core_pid_to_str
!= NULL
);
3408 if (gdbarch_debug
>= 2)
3409 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_pid_to_str called\n");
3410 return gdbarch
->core_pid_to_str (gdbarch
, ptid
);
3414 set_gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
,
3415 gdbarch_core_pid_to_str_ftype core_pid_to_str
)
3417 gdbarch
->core_pid_to_str
= core_pid_to_str
;
3421 gdbarch_gcore_bfd_target_p (struct gdbarch
*gdbarch
)
3423 gdb_assert (gdbarch
!= NULL
);
3424 return gdbarch
->gcore_bfd_target
!= 0;
3428 gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
)
3430 gdb_assert (gdbarch
!= NULL
);
3431 /* Check variable changed from pre-default. */
3432 gdb_assert (gdbarch
->gcore_bfd_target
!= 0);
3433 if (gdbarch_debug
>= 2)
3434 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gcore_bfd_target called\n");
3435 return gdbarch
->gcore_bfd_target
;
3439 set_gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
,
3440 const char * gcore_bfd_target
)
3442 gdbarch
->gcore_bfd_target
= gcore_bfd_target
;
3446 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
3448 gdb_assert (gdbarch
!= NULL
);
3449 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3450 if (gdbarch_debug
>= 2)
3451 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
3452 return gdbarch
->vtable_function_descriptors
;
3456 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
3457 int vtable_function_descriptors
)
3459 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
3463 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
3465 gdb_assert (gdbarch
!= NULL
);
3466 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3467 if (gdbarch_debug
>= 2)
3468 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
3469 return gdbarch
->vbit_in_delta
;
3473 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
3476 gdbarch
->vbit_in_delta
= vbit_in_delta
;
3480 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
3482 gdb_assert (gdbarch
!= NULL
);
3483 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
3487 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
3489 gdb_assert (gdbarch
!= NULL
);
3490 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
3491 if (gdbarch_debug
>= 2)
3492 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
3493 gdbarch
->skip_permanent_breakpoint (regcache
);
3497 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3498 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3500 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3504 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
3506 gdb_assert (gdbarch
!= NULL
);
3507 return gdbarch
->max_insn_length
!= 0;
3511 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
3513 gdb_assert (gdbarch
!= NULL
);
3514 /* Check variable changed from pre-default. */
3515 gdb_assert (gdbarch
->max_insn_length
!= 0);
3516 if (gdbarch_debug
>= 2)
3517 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
3518 return gdbarch
->max_insn_length
;
3522 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
3523 ULONGEST max_insn_length
)
3525 gdbarch
->max_insn_length
= max_insn_length
;
3529 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
3531 gdb_assert (gdbarch
!= NULL
);
3532 return gdbarch
->displaced_step_copy_insn
!= NULL
;
3535 struct displaced_step_closure
*
3536 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3538 gdb_assert (gdbarch
!= NULL
);
3539 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
3540 if (gdbarch_debug
>= 2)
3541 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3542 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3546 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3547 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3549 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3553 gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3555 gdb_assert (gdbarch
!= NULL
);
3556 gdb_assert (gdbarch
->displaced_step_hw_singlestep
!= NULL
);
3557 if (gdbarch_debug
>= 2)
3558 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_hw_singlestep called\n");
3559 return gdbarch
->displaced_step_hw_singlestep (gdbarch
, closure
);
3563 set_gdbarch_displaced_step_hw_singlestep (struct gdbarch
*gdbarch
,
3564 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep
)
3566 gdbarch
->displaced_step_hw_singlestep
= displaced_step_hw_singlestep
;
3570 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3572 gdb_assert (gdbarch
!= NULL
);
3573 return gdbarch
->displaced_step_fixup
!= NULL
;
3577 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3579 gdb_assert (gdbarch
!= NULL
);
3580 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3581 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3582 if (gdbarch_debug
>= 2)
3583 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3584 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3588 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3589 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3591 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3595 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3597 gdb_assert (gdbarch
!= NULL
);
3598 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3599 if (gdbarch_debug
>= 2)
3600 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3601 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3605 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3606 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3608 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3612 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3614 gdb_assert (gdbarch
!= NULL
);
3615 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3616 if (gdbarch_debug
>= 2)
3617 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3618 return gdbarch
->displaced_step_location (gdbarch
);
3622 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3623 gdbarch_displaced_step_location_ftype displaced_step_location
)
3625 gdbarch
->displaced_step_location
= displaced_step_location
;
3629 gdbarch_relocate_instruction_p (struct gdbarch
*gdbarch
)
3631 gdb_assert (gdbarch
!= NULL
);
3632 return gdbarch
->relocate_instruction
!= NULL
;
3636 gdbarch_relocate_instruction (struct gdbarch
*gdbarch
, CORE_ADDR
*to
, CORE_ADDR from
)
3638 gdb_assert (gdbarch
!= NULL
);
3639 gdb_assert (gdbarch
->relocate_instruction
!= NULL
);
3640 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3641 if (gdbarch_debug
>= 2)
3642 fprintf_unfiltered (gdb_stdlog
, "gdbarch_relocate_instruction called\n");
3643 gdbarch
->relocate_instruction (gdbarch
, to
, from
);
3647 set_gdbarch_relocate_instruction (struct gdbarch
*gdbarch
,
3648 gdbarch_relocate_instruction_ftype relocate_instruction
)
3650 gdbarch
->relocate_instruction
= relocate_instruction
;
3654 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3656 gdb_assert (gdbarch
!= NULL
);
3657 return gdbarch
->overlay_update
!= NULL
;
3661 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3663 gdb_assert (gdbarch
!= NULL
);
3664 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3665 if (gdbarch_debug
>= 2)
3666 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3667 gdbarch
->overlay_update (osect
);
3671 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3672 gdbarch_overlay_update_ftype overlay_update
)
3674 gdbarch
->overlay_update
= overlay_update
;
3678 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3680 gdb_assert (gdbarch
!= NULL
);
3681 return gdbarch
->core_read_description
!= NULL
;
3684 const struct target_desc
*
3685 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3687 gdb_assert (gdbarch
!= NULL
);
3688 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3689 if (gdbarch_debug
>= 2)
3690 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3691 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3695 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3696 gdbarch_core_read_description_ftype core_read_description
)
3698 gdbarch
->core_read_description
= core_read_description
;
3702 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3704 gdb_assert (gdbarch
!= NULL
);
3705 return gdbarch
->static_transform_name
!= NULL
;
3709 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, const char *name
)
3711 gdb_assert (gdbarch
!= NULL
);
3712 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3713 if (gdbarch_debug
>= 2)
3714 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3715 return gdbarch
->static_transform_name (name
);
3719 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3720 gdbarch_static_transform_name_ftype static_transform_name
)
3722 gdbarch
->static_transform_name
= static_transform_name
;
3726 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3728 gdb_assert (gdbarch
!= NULL
);
3729 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3730 if (gdbarch_debug
>= 2)
3731 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3732 return gdbarch
->sofun_address_maybe_missing
;
3736 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3737 int sofun_address_maybe_missing
)
3739 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3743 gdbarch_process_record_p (struct gdbarch
*gdbarch
)
3745 gdb_assert (gdbarch
!= NULL
);
3746 return gdbarch
->process_record
!= NULL
;
3750 gdbarch_process_record (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR addr
)
3752 gdb_assert (gdbarch
!= NULL
);
3753 gdb_assert (gdbarch
->process_record
!= NULL
);
3754 if (gdbarch_debug
>= 2)
3755 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record called\n");
3756 return gdbarch
->process_record (gdbarch
, regcache
, addr
);
3760 set_gdbarch_process_record (struct gdbarch
*gdbarch
,
3761 gdbarch_process_record_ftype process_record
)
3763 gdbarch
->process_record
= process_record
;
3767 gdbarch_process_record_signal_p (struct gdbarch
*gdbarch
)
3769 gdb_assert (gdbarch
!= NULL
);
3770 return gdbarch
->process_record_signal
!= NULL
;
3774 gdbarch_process_record_signal (struct gdbarch
*gdbarch
, struct regcache
*regcache
, enum gdb_signal signal
)
3776 gdb_assert (gdbarch
!= NULL
);
3777 gdb_assert (gdbarch
->process_record_signal
!= NULL
);
3778 if (gdbarch_debug
>= 2)
3779 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record_signal called\n");
3780 return gdbarch
->process_record_signal (gdbarch
, regcache
, signal
);
3784 set_gdbarch_process_record_signal (struct gdbarch
*gdbarch
,
3785 gdbarch_process_record_signal_ftype process_record_signal
)
3787 gdbarch
->process_record_signal
= process_record_signal
;
3791 gdbarch_gdb_signal_from_target (struct gdbarch
*gdbarch
, int signo
)
3793 gdb_assert (gdbarch
!= NULL
);
3794 gdb_assert (gdbarch
->gdb_signal_from_target
!= NULL
);
3795 if (gdbarch_debug
>= 2)
3796 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gdb_signal_from_target called\n");
3797 return gdbarch
->gdb_signal_from_target (gdbarch
, signo
);
3801 set_gdbarch_gdb_signal_from_target (struct gdbarch
*gdbarch
,
3802 gdbarch_gdb_signal_from_target_ftype gdb_signal_from_target
)
3804 gdbarch
->gdb_signal_from_target
= gdb_signal_from_target
;
3808 gdbarch_get_siginfo_type_p (struct gdbarch
*gdbarch
)
3810 gdb_assert (gdbarch
!= NULL
);
3811 return gdbarch
->get_siginfo_type
!= NULL
;
3815 gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
)
3817 gdb_assert (gdbarch
!= NULL
);
3818 gdb_assert (gdbarch
->get_siginfo_type
!= NULL
);
3819 if (gdbarch_debug
>= 2)
3820 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_siginfo_type called\n");
3821 return gdbarch
->get_siginfo_type (gdbarch
);
3825 set_gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
,
3826 gdbarch_get_siginfo_type_ftype get_siginfo_type
)
3828 gdbarch
->get_siginfo_type
= get_siginfo_type
;
3832 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3834 gdb_assert (gdbarch
!= NULL
);
3835 return gdbarch
->record_special_symbol
!= NULL
;
3839 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3841 gdb_assert (gdbarch
!= NULL
);
3842 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3843 if (gdbarch_debug
>= 2)
3844 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3845 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3849 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3850 gdbarch_record_special_symbol_ftype record_special_symbol
)
3852 gdbarch
->record_special_symbol
= record_special_symbol
;
3856 gdbarch_get_syscall_number_p (struct gdbarch
*gdbarch
)
3858 gdb_assert (gdbarch
!= NULL
);
3859 return gdbarch
->get_syscall_number
!= NULL
;
3863 gdbarch_get_syscall_number (struct gdbarch
*gdbarch
, ptid_t ptid
)
3865 gdb_assert (gdbarch
!= NULL
);
3866 gdb_assert (gdbarch
->get_syscall_number
!= NULL
);
3867 if (gdbarch_debug
>= 2)
3868 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_syscall_number called\n");
3869 return gdbarch
->get_syscall_number (gdbarch
, ptid
);
3873 set_gdbarch_get_syscall_number (struct gdbarch
*gdbarch
,
3874 gdbarch_get_syscall_number_ftype get_syscall_number
)
3876 gdbarch
->get_syscall_number
= get_syscall_number
;
3880 gdbarch_stap_integer_prefix (struct gdbarch
*gdbarch
)
3882 gdb_assert (gdbarch
!= NULL
);
3883 /* Skip verify of stap_integer_prefix, invalid_p == 0 */
3884 if (gdbarch_debug
>= 2)
3885 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_integer_prefix called\n");
3886 return gdbarch
->stap_integer_prefix
;
3890 set_gdbarch_stap_integer_prefix (struct gdbarch
*gdbarch
,
3891 const char * stap_integer_prefix
)
3893 gdbarch
->stap_integer_prefix
= stap_integer_prefix
;
3897 gdbarch_stap_integer_suffix (struct gdbarch
*gdbarch
)
3899 gdb_assert (gdbarch
!= NULL
);
3900 /* Skip verify of stap_integer_suffix, invalid_p == 0 */
3901 if (gdbarch_debug
>= 2)
3902 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_integer_suffix called\n");
3903 return gdbarch
->stap_integer_suffix
;
3907 set_gdbarch_stap_integer_suffix (struct gdbarch
*gdbarch
,
3908 const char * stap_integer_suffix
)
3910 gdbarch
->stap_integer_suffix
= stap_integer_suffix
;
3914 gdbarch_stap_register_prefix (struct gdbarch
*gdbarch
)
3916 gdb_assert (gdbarch
!= NULL
);
3917 /* Skip verify of stap_register_prefix, invalid_p == 0 */
3918 if (gdbarch_debug
>= 2)
3919 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_prefix called\n");
3920 return gdbarch
->stap_register_prefix
;
3924 set_gdbarch_stap_register_prefix (struct gdbarch
*gdbarch
,
3925 const char * stap_register_prefix
)
3927 gdbarch
->stap_register_prefix
= stap_register_prefix
;
3931 gdbarch_stap_register_suffix (struct gdbarch
*gdbarch
)
3933 gdb_assert (gdbarch
!= NULL
);
3934 /* Skip verify of stap_register_suffix, invalid_p == 0 */
3935 if (gdbarch_debug
>= 2)
3936 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_suffix called\n");
3937 return gdbarch
->stap_register_suffix
;
3941 set_gdbarch_stap_register_suffix (struct gdbarch
*gdbarch
,
3942 const char * stap_register_suffix
)
3944 gdbarch
->stap_register_suffix
= stap_register_suffix
;
3948 gdbarch_stap_register_indirection_prefix (struct gdbarch
*gdbarch
)
3950 gdb_assert (gdbarch
!= NULL
);
3951 /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */
3952 if (gdbarch_debug
>= 2)
3953 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_indirection_prefix called\n");
3954 return gdbarch
->stap_register_indirection_prefix
;
3958 set_gdbarch_stap_register_indirection_prefix (struct gdbarch
*gdbarch
,
3959 const char * stap_register_indirection_prefix
)
3961 gdbarch
->stap_register_indirection_prefix
= stap_register_indirection_prefix
;
3965 gdbarch_stap_register_indirection_suffix (struct gdbarch
*gdbarch
)
3967 gdb_assert (gdbarch
!= NULL
);
3968 /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */
3969 if (gdbarch_debug
>= 2)
3970 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_register_indirection_suffix called\n");
3971 return gdbarch
->stap_register_indirection_suffix
;
3975 set_gdbarch_stap_register_indirection_suffix (struct gdbarch
*gdbarch
,
3976 const char * stap_register_indirection_suffix
)
3978 gdbarch
->stap_register_indirection_suffix
= stap_register_indirection_suffix
;
3982 gdbarch_stap_gdb_register_prefix (struct gdbarch
*gdbarch
)
3984 gdb_assert (gdbarch
!= NULL
);
3985 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
3986 if (gdbarch_debug
>= 2)
3987 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_gdb_register_prefix called\n");
3988 return gdbarch
->stap_gdb_register_prefix
;
3992 set_gdbarch_stap_gdb_register_prefix (struct gdbarch
*gdbarch
,
3993 const char * stap_gdb_register_prefix
)
3995 gdbarch
->stap_gdb_register_prefix
= stap_gdb_register_prefix
;
3999 gdbarch_stap_gdb_register_suffix (struct gdbarch
*gdbarch
)
4001 gdb_assert (gdbarch
!= NULL
);
4002 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
4003 if (gdbarch_debug
>= 2)
4004 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_gdb_register_suffix called\n");
4005 return gdbarch
->stap_gdb_register_suffix
;
4009 set_gdbarch_stap_gdb_register_suffix (struct gdbarch
*gdbarch
,
4010 const char * stap_gdb_register_suffix
)
4012 gdbarch
->stap_gdb_register_suffix
= stap_gdb_register_suffix
;
4016 gdbarch_stap_is_single_operand_p (struct gdbarch
*gdbarch
)
4018 gdb_assert (gdbarch
!= NULL
);
4019 return gdbarch
->stap_is_single_operand
!= NULL
;
4023 gdbarch_stap_is_single_operand (struct gdbarch
*gdbarch
, const char *s
)
4025 gdb_assert (gdbarch
!= NULL
);
4026 gdb_assert (gdbarch
->stap_is_single_operand
!= NULL
);
4027 if (gdbarch_debug
>= 2)
4028 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_is_single_operand called\n");
4029 return gdbarch
->stap_is_single_operand (gdbarch
, s
);
4033 set_gdbarch_stap_is_single_operand (struct gdbarch
*gdbarch
,
4034 gdbarch_stap_is_single_operand_ftype stap_is_single_operand
)
4036 gdbarch
->stap_is_single_operand
= stap_is_single_operand
;
4040 gdbarch_stap_parse_special_token_p (struct gdbarch
*gdbarch
)
4042 gdb_assert (gdbarch
!= NULL
);
4043 return gdbarch
->stap_parse_special_token
!= NULL
;
4047 gdbarch_stap_parse_special_token (struct gdbarch
*gdbarch
, struct stap_parse_info
*p
)
4049 gdb_assert (gdbarch
!= NULL
);
4050 gdb_assert (gdbarch
->stap_parse_special_token
!= NULL
);
4051 if (gdbarch_debug
>= 2)
4052 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stap_parse_special_token called\n");
4053 return gdbarch
->stap_parse_special_token (gdbarch
, p
);
4057 set_gdbarch_stap_parse_special_token (struct gdbarch
*gdbarch
,
4058 gdbarch_stap_parse_special_token_ftype stap_parse_special_token
)
4060 gdbarch
->stap_parse_special_token
= stap_parse_special_token
;
4064 gdbarch_has_global_solist (struct gdbarch
*gdbarch
)
4066 gdb_assert (gdbarch
!= NULL
);
4067 /* Skip verify of has_global_solist, invalid_p == 0 */
4068 if (gdbarch_debug
>= 2)
4069 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_solist called\n");
4070 return gdbarch
->has_global_solist
;
4074 set_gdbarch_has_global_solist (struct gdbarch
*gdbarch
,
4075 int has_global_solist
)
4077 gdbarch
->has_global_solist
= has_global_solist
;
4081 gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
)
4083 gdb_assert (gdbarch
!= NULL
);
4084 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
4085 if (gdbarch_debug
>= 2)
4086 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_breakpoints called\n");
4087 return gdbarch
->has_global_breakpoints
;
4091 set_gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
,
4092 int has_global_breakpoints
)
4094 gdbarch
->has_global_breakpoints
= has_global_breakpoints
;
4098 gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
)
4100 gdb_assert (gdbarch
!= NULL
);
4101 gdb_assert (gdbarch
->has_shared_address_space
!= NULL
);
4102 if (gdbarch_debug
>= 2)
4103 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_shared_address_space called\n");
4104 return gdbarch
->has_shared_address_space (gdbarch
);
4108 set_gdbarch_has_shared_address_space (struct gdbarch
*gdbarch
,
4109 gdbarch_has_shared_address_space_ftype has_shared_address_space
)
4111 gdbarch
->has_shared_address_space
= has_shared_address_space
;
4115 gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
, CORE_ADDR addr
, int *isize
, char **msg
)
4117 gdb_assert (gdbarch
!= NULL
);
4118 gdb_assert (gdbarch
->fast_tracepoint_valid_at
!= NULL
);
4119 if (gdbarch_debug
>= 2)
4120 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fast_tracepoint_valid_at called\n");
4121 return gdbarch
->fast_tracepoint_valid_at (gdbarch
, addr
, isize
, msg
);
4125 set_gdbarch_fast_tracepoint_valid_at (struct gdbarch
*gdbarch
,
4126 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at
)
4128 gdbarch
->fast_tracepoint_valid_at
= fast_tracepoint_valid_at
;
4132 gdbarch_auto_charset (struct gdbarch
*gdbarch
)
4134 gdb_assert (gdbarch
!= NULL
);
4135 gdb_assert (gdbarch
->auto_charset
!= NULL
);
4136 if (gdbarch_debug
>= 2)
4137 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_charset called\n");
4138 return gdbarch
->auto_charset ();
4142 set_gdbarch_auto_charset (struct gdbarch
*gdbarch
,
4143 gdbarch_auto_charset_ftype auto_charset
)
4145 gdbarch
->auto_charset
= auto_charset
;
4149 gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
)
4151 gdb_assert (gdbarch
!= NULL
);
4152 gdb_assert (gdbarch
->auto_wide_charset
!= NULL
);
4153 if (gdbarch_debug
>= 2)
4154 fprintf_unfiltered (gdb_stdlog
, "gdbarch_auto_wide_charset called\n");
4155 return gdbarch
->auto_wide_charset ();
4159 set_gdbarch_auto_wide_charset (struct gdbarch
*gdbarch
,
4160 gdbarch_auto_wide_charset_ftype auto_wide_charset
)
4162 gdbarch
->auto_wide_charset
= auto_wide_charset
;
4166 gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
)
4168 gdb_assert (gdbarch
!= NULL
);
4169 if (gdbarch_debug
>= 2)
4170 fprintf_unfiltered (gdb_stdlog
, "gdbarch_solib_symbols_extension called\n");
4171 return gdbarch
->solib_symbols_extension
;
4175 set_gdbarch_solib_symbols_extension (struct gdbarch
*gdbarch
,
4176 const char * solib_symbols_extension
)
4178 gdbarch
->solib_symbols_extension
= solib_symbols_extension
;
4182 gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
)
4184 gdb_assert (gdbarch
!= NULL
);
4185 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
4186 if (gdbarch_debug
>= 2)
4187 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_dos_based_file_system called\n");
4188 return gdbarch
->has_dos_based_file_system
;
4192 set_gdbarch_has_dos_based_file_system (struct gdbarch
*gdbarch
,
4193 int has_dos_based_file_system
)
4195 gdbarch
->has_dos_based_file_system
= has_dos_based_file_system
;
4199 gdbarch_gen_return_address (struct gdbarch
*gdbarch
, struct agent_expr
*ax
, struct axs_value
*value
, CORE_ADDR scope
)
4201 gdb_assert (gdbarch
!= NULL
);
4202 gdb_assert (gdbarch
->gen_return_address
!= NULL
);
4203 if (gdbarch_debug
>= 2)
4204 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gen_return_address called\n");
4205 gdbarch
->gen_return_address (gdbarch
, ax
, value
, scope
);
4209 set_gdbarch_gen_return_address (struct gdbarch
*gdbarch
,
4210 gdbarch_gen_return_address_ftype gen_return_address
)
4212 gdbarch
->gen_return_address
= gen_return_address
;
4216 gdbarch_info_proc_p (struct gdbarch
*gdbarch
)
4218 gdb_assert (gdbarch
!= NULL
);
4219 return gdbarch
->info_proc
!= NULL
;
4223 gdbarch_info_proc (struct gdbarch
*gdbarch
, char *args
, enum info_proc_what what
)
4225 gdb_assert (gdbarch
!= NULL
);
4226 gdb_assert (gdbarch
->info_proc
!= NULL
);
4227 if (gdbarch_debug
>= 2)
4228 fprintf_unfiltered (gdb_stdlog
, "gdbarch_info_proc called\n");
4229 gdbarch
->info_proc (gdbarch
, args
, what
);
4233 set_gdbarch_info_proc (struct gdbarch
*gdbarch
,
4234 gdbarch_info_proc_ftype info_proc
)
4236 gdbarch
->info_proc
= info_proc
;
4240 /* Keep a registry of per-architecture data-pointers required by GDB
4247 gdbarch_data_pre_init_ftype
*pre_init
;
4248 gdbarch_data_post_init_ftype
*post_init
;
4251 struct gdbarch_data_registration
4253 struct gdbarch_data
*data
;
4254 struct gdbarch_data_registration
*next
;
4257 struct gdbarch_data_registry
4260 struct gdbarch_data_registration
*registrations
;
4263 struct gdbarch_data_registry gdbarch_data_registry
=
4268 static struct gdbarch_data
*
4269 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
4270 gdbarch_data_post_init_ftype
*post_init
)
4272 struct gdbarch_data_registration
**curr
;
4274 /* Append the new registration. */
4275 for (curr
= &gdbarch_data_registry
.registrations
;
4277 curr
= &(*curr
)->next
);
4278 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
4279 (*curr
)->next
= NULL
;
4280 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
4281 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
4282 (*curr
)->data
->pre_init
= pre_init
;
4283 (*curr
)->data
->post_init
= post_init
;
4284 (*curr
)->data
->init_p
= 1;
4285 return (*curr
)->data
;
4288 struct gdbarch_data
*
4289 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
4291 return gdbarch_data_register (pre_init
, NULL
);
4294 struct gdbarch_data
*
4295 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
4297 return gdbarch_data_register (NULL
, post_init
);
4300 /* Create/delete the gdbarch data vector. */
4303 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
4305 gdb_assert (gdbarch
->data
== NULL
);
4306 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
4307 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
4310 /* Initialize the current value of the specified per-architecture
4314 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
4315 struct gdbarch_data
*data
,
4318 gdb_assert (data
->index
< gdbarch
->nr_data
);
4319 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
4320 gdb_assert (data
->pre_init
== NULL
);
4321 gdbarch
->data
[data
->index
] = pointer
;
4324 /* Return the current value of the specified per-architecture
4328 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
4330 gdb_assert (data
->index
< gdbarch
->nr_data
);
4331 if (gdbarch
->data
[data
->index
] == NULL
)
4333 /* The data-pointer isn't initialized, call init() to get a
4335 if (data
->pre_init
!= NULL
)
4336 /* Mid architecture creation: pass just the obstack, and not
4337 the entire architecture, as that way it isn't possible for
4338 pre-init code to refer to undefined architecture
4340 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
4341 else if (gdbarch
->initialized_p
4342 && data
->post_init
!= NULL
)
4343 /* Post architecture creation: pass the entire architecture
4344 (as all fields are valid), but be careful to also detect
4345 recursive references. */
4347 gdb_assert (data
->init_p
);
4349 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
4353 /* The architecture initialization hasn't completed - punt -
4354 hope that the caller knows what they are doing. Once
4355 deprecated_set_gdbarch_data has been initialized, this can be
4356 changed to an internal error. */
4358 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
4360 return gdbarch
->data
[data
->index
];
4364 /* Keep a registry of the architectures known by GDB. */
4366 struct gdbarch_registration
4368 enum bfd_architecture bfd_architecture
;
4369 gdbarch_init_ftype
*init
;
4370 gdbarch_dump_tdep_ftype
*dump_tdep
;
4371 struct gdbarch_list
*arches
;
4372 struct gdbarch_registration
*next
;
4375 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
4378 append_name (const char ***buf
, int *nr
, const char *name
)
4380 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
4386 gdbarch_printable_names (void)
4388 /* Accumulate a list of names based on the registed list of
4391 const char **arches
= NULL
;
4392 struct gdbarch_registration
*rego
;
4394 for (rego
= gdbarch_registry
;
4398 const struct bfd_arch_info
*ap
;
4399 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
4401 internal_error (__FILE__
, __LINE__
,
4402 _("gdbarch_architecture_names: multi-arch unknown"));
4405 append_name (&arches
, &nr_arches
, ap
->printable_name
);
4410 append_name (&arches
, &nr_arches
, NULL
);
4416 gdbarch_register (enum bfd_architecture bfd_architecture
,
4417 gdbarch_init_ftype
*init
,
4418 gdbarch_dump_tdep_ftype
*dump_tdep
)
4420 struct gdbarch_registration
**curr
;
4421 const struct bfd_arch_info
*bfd_arch_info
;
4423 /* Check that BFD recognizes this architecture */
4424 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
4425 if (bfd_arch_info
== NULL
)
4427 internal_error (__FILE__
, __LINE__
,
4428 _("gdbarch: Attempt to register "
4429 "unknown architecture (%d)"),
4432 /* Check that we haven't seen this architecture before. */
4433 for (curr
= &gdbarch_registry
;
4435 curr
= &(*curr
)->next
)
4437 if (bfd_architecture
== (*curr
)->bfd_architecture
)
4438 internal_error (__FILE__
, __LINE__
,
4439 _("gdbarch: Duplicate registration "
4440 "of architecture (%s)"),
4441 bfd_arch_info
->printable_name
);
4445 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, %s)\n",
4446 bfd_arch_info
->printable_name
,
4447 host_address_to_string (init
));
4449 (*curr
) = XMALLOC (struct gdbarch_registration
);
4450 (*curr
)->bfd_architecture
= bfd_architecture
;
4451 (*curr
)->init
= init
;
4452 (*curr
)->dump_tdep
= dump_tdep
;
4453 (*curr
)->arches
= NULL
;
4454 (*curr
)->next
= NULL
;
4458 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
4459 gdbarch_init_ftype
*init
)
4461 gdbarch_register (bfd_architecture
, init
, NULL
);
4465 /* Look for an architecture using gdbarch_info. */
4467 struct gdbarch_list
*
4468 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
4469 const struct gdbarch_info
*info
)
4471 for (; arches
!= NULL
; arches
= arches
->next
)
4473 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
4475 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4477 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4479 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
4487 /* Find an architecture that matches the specified INFO. Create a new
4488 architecture if needed. Return that new architecture. */
4491 gdbarch_find_by_info (struct gdbarch_info info
)
4493 struct gdbarch
*new_gdbarch
;
4494 struct gdbarch_registration
*rego
;
4496 /* Fill in missing parts of the INFO struct using a number of
4497 sources: "set ..."; INFOabfd supplied; and the global
4499 gdbarch_info_fill (&info
);
4501 /* Must have found some sort of architecture. */
4502 gdb_assert (info
.bfd_arch_info
!= NULL
);
4506 fprintf_unfiltered (gdb_stdlog
,
4507 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
4508 (info
.bfd_arch_info
!= NULL
4509 ? info
.bfd_arch_info
->printable_name
4511 fprintf_unfiltered (gdb_stdlog
,
4512 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
4514 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4515 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4517 fprintf_unfiltered (gdb_stdlog
,
4518 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4519 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4520 fprintf_unfiltered (gdb_stdlog
,
4521 "gdbarch_find_by_info: info.abfd %s\n",
4522 host_address_to_string (info
.abfd
));
4523 fprintf_unfiltered (gdb_stdlog
,
4524 "gdbarch_find_by_info: info.tdep_info %s\n",
4525 host_address_to_string (info
.tdep_info
));
4528 /* Find the tdep code that knows about this architecture. */
4529 for (rego
= gdbarch_registry
;
4532 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4537 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4538 "No matching architecture\n");
4542 /* Ask the tdep code for an architecture that matches "info". */
4543 new_gdbarch
= rego
->init (info
, rego
->arches
);
4545 /* Did the tdep code like it? No. Reject the change and revert to
4546 the old architecture. */
4547 if (new_gdbarch
== NULL
)
4550 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4551 "Target rejected architecture\n");
4555 /* Is this a pre-existing architecture (as determined by already
4556 being initialized)? Move it to the front of the architecture
4557 list (keeping the list sorted Most Recently Used). */
4558 if (new_gdbarch
->initialized_p
)
4560 struct gdbarch_list
**list
;
4561 struct gdbarch_list
*this;
4563 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4564 "Previous architecture %s (%s) selected\n",
4565 host_address_to_string (new_gdbarch
),
4566 new_gdbarch
->bfd_arch_info
->printable_name
);
4567 /* Find the existing arch in the list. */
4568 for (list
= ®o
->arches
;
4569 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4570 list
= &(*list
)->next
);
4571 /* It had better be in the list of architectures. */
4572 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4575 (*list
) = this->next
;
4576 /* Insert THIS at the front. */
4577 this->next
= rego
->arches
;
4578 rego
->arches
= this;
4583 /* It's a new architecture. */
4585 fprintf_unfiltered (gdb_stdlog
, "gdbarch_find_by_info: "
4586 "New architecture %s (%s) selected\n",
4587 host_address_to_string (new_gdbarch
),
4588 new_gdbarch
->bfd_arch_info
->printable_name
);
4590 /* Insert the new architecture into the front of the architecture
4591 list (keep the list sorted Most Recently Used). */
4593 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4594 this->next
= rego
->arches
;
4595 this->gdbarch
= new_gdbarch
;
4596 rego
->arches
= this;
4599 /* Check that the newly installed architecture is valid. Plug in
4600 any post init values. */
4601 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4602 verify_gdbarch (new_gdbarch
);
4603 new_gdbarch
->initialized_p
= 1;
4606 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4611 /* Make the specified architecture current. */
4614 deprecated_target_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4616 gdb_assert (new_gdbarch
!= NULL
);
4617 gdb_assert (new_gdbarch
->initialized_p
);
4618 target_gdbarch
= new_gdbarch
;
4619 observer_notify_architecture_changed (new_gdbarch
);
4620 registers_changed ();
4623 extern void _initialize_gdbarch (void);
4626 _initialize_gdbarch (void)
4628 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
4629 Set architecture debugging."), _("\
4630 Show architecture debugging."), _("\
4631 When non-zero, architecture debugging is enabled."),
4634 &setdebuglist
, &showdebuglist
);