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, 2007
6 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 /* Maintain the struct gdbarch object */
85 /* Has this architecture been fully initialized? */
88 /* An obstack bound to the lifetime of the architecture. */
89 struct obstack
*obstack
;
91 /* basic architectural information */
92 const struct bfd_arch_info
* bfd_arch_info
;
94 int byte_order_for_code
;
96 const struct target_desc
* target_desc
;
98 /* target specific vector. */
99 struct gdbarch_tdep
*tdep
;
100 gdbarch_dump_tdep_ftype
*dump_tdep
;
102 /* per-architecture data-pointers */
106 /* per-architecture swap-regions */
107 struct gdbarch_swap
*swap
;
109 /* Multi-arch values.
111 When extending this structure you must:
115 Declare set/get functions and define the corresponding
118 gdbarch_alloc(): If zero/NULL is not a suitable default,
119 initialize the new field.
121 verify_gdbarch(): Confirm that the target updated the field
124 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
127 ``startup_gdbarch()'': Append an initial value to the static
128 variable (base values on the host's c-type system).
130 get_gdbarch(): Implement the set/get functions (probably using
131 the macro's as shortcuts).
141 const struct floatformat
** float_format
;
143 const struct floatformat
** double_format
;
145 const struct floatformat
** long_double_format
;
149 gdbarch_read_pc_ftype
*read_pc
;
150 gdbarch_write_pc_ftype
*write_pc
;
151 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
152 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
153 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
160 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
161 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
162 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
163 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
164 gdbarch_register_name_ftype
*register_name
;
165 gdbarch_register_type_ftype
*register_type
;
166 gdbarch_dummy_id_ftype
*dummy_id
;
167 int deprecated_fp_regnum
;
168 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
169 int call_dummy_location
;
170 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
171 gdbarch_print_registers_info_ftype
*print_registers_info
;
172 gdbarch_print_float_info_ftype
*print_float_info
;
173 gdbarch_print_vector_info_ftype
*print_vector_info
;
174 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
175 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
176 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
177 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
178 int believe_pcc_promotion
;
179 gdbarch_convert_register_p_ftype
*convert_register_p
;
180 gdbarch_register_to_value_ftype
*register_to_value
;
181 gdbarch_value_to_register_ftype
*value_to_register
;
182 gdbarch_value_from_register_ftype
*value_from_register
;
183 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
184 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
185 gdbarch_integer_to_address_ftype
*integer_to_address
;
186 gdbarch_return_value_ftype
*return_value
;
187 gdbarch_skip_prologue_ftype
*skip_prologue
;
188 gdbarch_skip_main_prologue_ftype
*skip_main_prologue
;
189 gdbarch_inner_than_ftype
*inner_than
;
190 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
191 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
192 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
193 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
194 CORE_ADDR decr_pc_after_break
;
195 CORE_ADDR deprecated_function_start_offset
;
196 gdbarch_remote_register_number_ftype
*remote_register_number
;
197 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
198 CORE_ADDR frame_args_skip
;
199 gdbarch_unwind_pc_ftype
*unwind_pc
;
200 gdbarch_unwind_sp_ftype
*unwind_sp
;
201 gdbarch_frame_num_args_ftype
*frame_num_args
;
202 gdbarch_frame_align_ftype
*frame_align
;
203 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
204 int frame_red_zone_size
;
205 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
206 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
207 gdbarch_smash_text_address_ftype
*smash_text_address
;
208 gdbarch_software_single_step_ftype
*software_single_step
;
209 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
210 gdbarch_print_insn_ftype
*print_insn
;
211 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
212 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
213 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
214 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
215 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
216 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
217 int cannot_step_breakpoint
;
218 int have_nonsteppable_watchpoint
;
219 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
220 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
221 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
222 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
223 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
224 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
225 int core_reg_section_encodes_pid
;
226 struct core_regset_section
* core_regset_sections
;
227 gdbarch_core_xfer_shared_libraries_ftype
*core_xfer_shared_libraries
;
228 gdbarch_core_pid_to_str_ftype
*core_pid_to_str
;
229 const char * gcore_bfd_target
;
230 int vtable_function_descriptors
;
232 gdbarch_skip_permanent_breakpoint_ftype
*skip_permanent_breakpoint
;
233 ULONGEST max_insn_length
;
234 gdbarch_displaced_step_copy_insn_ftype
*displaced_step_copy_insn
;
235 gdbarch_displaced_step_fixup_ftype
*displaced_step_fixup
;
236 gdbarch_displaced_step_free_closure_ftype
*displaced_step_free_closure
;
237 gdbarch_displaced_step_location_ftype
*displaced_step_location
;
238 gdbarch_overlay_update_ftype
*overlay_update
;
239 gdbarch_core_read_description_ftype
*core_read_description
;
240 gdbarch_static_transform_name_ftype
*static_transform_name
;
241 int sofun_address_maybe_missing
;
242 gdbarch_process_record_ftype
*process_record
;
243 gdbarch_target_signal_from_host_ftype
*target_signal_from_host
;
244 gdbarch_target_signal_to_host_ftype
*target_signal_to_host
;
245 gdbarch_get_siginfo_type_ftype
*get_siginfo_type
;
246 gdbarch_record_special_symbol_ftype
*record_special_symbol
;
247 int has_global_solist
;
248 int has_global_breakpoints
;
252 /* The default architecture uses host values (for want of a better
255 extern const struct bfd_arch_info bfd_default_arch_struct
;
257 struct gdbarch startup_gdbarch
=
259 1, /* Always initialized. */
260 NULL
, /* The obstack. */
261 /* basic architecture information */
262 &bfd_default_arch_struct
, /* bfd_arch_info */
263 BFD_ENDIAN_BIG
, /* byte_order */
264 BFD_ENDIAN_BIG
, /* byte_order_for_code */
265 GDB_OSABI_UNKNOWN
, /* osabi */
267 /* target specific vector and its dump routine */
269 /*per-architecture data-pointers and swap regions */
271 /* Multi-arch values */
272 1, /* bits_big_endian */
273 8 * sizeof (short), /* short_bit */
274 8 * sizeof (int), /* int_bit */
275 8 * sizeof (long), /* long_bit */
276 8 * sizeof (LONGEST
), /* long_long_bit */
277 8 * sizeof (float), /* float_bit */
278 0, /* float_format */
279 8 * sizeof (double), /* double_bit */
280 0, /* double_format */
281 8 * sizeof (long double), /* long_double_bit */
282 0, /* long_double_format */
283 8 * sizeof (void*), /* ptr_bit */
284 8 * sizeof (void*), /* addr_bit */
288 legacy_virtual_frame_pointer
, /* virtual_frame_pointer */
289 0, /* pseudo_register_read */
290 0, /* pseudo_register_write */
292 0, /* num_pseudo_regs */
297 no_op_reg_to_regnum
, /* stab_reg_to_regnum */
298 no_op_reg_to_regnum
, /* ecoff_reg_to_regnum */
299 no_op_reg_to_regnum
, /* sdb_reg_to_regnum */
300 no_op_reg_to_regnum
, /* dwarf2_reg_to_regnum */
301 0, /* register_name */
302 0, /* register_type */
304 -1, /* deprecated_fp_regnum */
305 0, /* push_dummy_call */
306 0, /* call_dummy_location */
307 0, /* push_dummy_code */
308 default_print_registers_info
, /* print_registers_info */
309 0, /* print_float_info */
310 0, /* print_vector_info */
311 legacy_register_sim_regno
, /* register_sim_regno */
312 cannot_register_not
, /* cannot_fetch_register */
313 cannot_register_not
, /* cannot_store_register */
314 0, /* get_longjmp_target */
315 0, /* believe_pcc_promotion */
316 generic_convert_register_p
, /* convert_register_p */
317 0, /* register_to_value */
318 0, /* value_to_register */
319 0, /* value_from_register */
320 unsigned_pointer_to_address
, /* pointer_to_address */
321 unsigned_address_to_pointer
, /* address_to_pointer */
322 0, /* integer_to_address */
323 0, /* return_value */
324 0, /* skip_prologue */
325 0, /* skip_main_prologue */
327 0, /* breakpoint_from_pc */
328 0, /* adjust_breakpoint_address */
329 default_memory_insert_breakpoint
, /* memory_insert_breakpoint */
330 default_memory_remove_breakpoint
, /* memory_remove_breakpoint */
331 0, /* decr_pc_after_break */
332 0, /* deprecated_function_start_offset */
333 default_remote_register_number
, /* remote_register_number */
334 0, /* fetch_tls_load_module_address */
335 0, /* frame_args_skip */
338 0, /* frame_num_args */
340 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
341 0, /* frame_red_zone_size */
342 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
343 core_addr_identity
, /* addr_bits_remove */
344 core_addr_identity
, /* smash_text_address */
345 0, /* software_single_step */
346 0, /* single_step_through_delay */
348 0, /* skip_trampoline_code */
349 generic_skip_solib_resolver
, /* skip_solib_resolver */
350 0, /* in_solib_return_trampoline */
351 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
352 0, /* elf_make_msymbol_special */
353 0, /* coff_make_msymbol_special */
354 0, /* cannot_step_breakpoint */
355 0, /* have_nonsteppable_watchpoint */
356 0, /* address_class_type_flags */
357 0, /* address_class_type_flags_to_name */
358 0, /* address_class_name_to_type_flags */
359 default_register_reggroup_p
, /* register_reggroup_p */
360 0, /* fetch_pointer_argument */
361 0, /* regset_from_core_section */
362 0, /* core_reg_section_encodes_pid */
363 0, /* core_regset_sections */
364 0, /* core_xfer_shared_libraries */
365 0, /* core_pid_to_str */
366 0, /* gcore_bfd_target */
367 0, /* vtable_function_descriptors */
368 0, /* vbit_in_delta */
369 0, /* skip_permanent_breakpoint */
370 0, /* max_insn_length */
371 0, /* displaced_step_copy_insn */
372 0, /* displaced_step_fixup */
373 NULL
, /* displaced_step_free_closure */
374 NULL
, /* displaced_step_location */
375 0, /* overlay_update */
376 0, /* core_read_description */
377 0, /* static_transform_name */
378 0, /* sofun_address_maybe_missing */
379 0, /* process_record */
380 default_target_signal_from_host
, /* target_signal_from_host */
381 default_target_signal_to_host
, /* target_signal_to_host */
382 0, /* get_siginfo_type */
383 0, /* record_special_symbol */
384 0, /* has_global_solist */
385 0, /* has_global_breakpoints */
386 /* startup_gdbarch() */
389 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
390 struct gdbarch
*target_gdbarch
= &startup_gdbarch
;
392 /* Create a new ``struct gdbarch'' based on information provided by
393 ``struct gdbarch_info''. */
396 gdbarch_alloc (const struct gdbarch_info
*info
,
397 struct gdbarch_tdep
*tdep
)
399 struct gdbarch
*gdbarch
;
401 /* Create an obstack for allocating all the per-architecture memory,
402 then use that to allocate the architecture vector. */
403 struct obstack
*obstack
= XMALLOC (struct obstack
);
404 obstack_init (obstack
);
405 gdbarch
= obstack_alloc (obstack
, sizeof (*gdbarch
));
406 memset (gdbarch
, 0, sizeof (*gdbarch
));
407 gdbarch
->obstack
= obstack
;
409 alloc_gdbarch_data (gdbarch
);
411 gdbarch
->tdep
= tdep
;
413 gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
414 gdbarch
->byte_order
= info
->byte_order
;
415 gdbarch
->byte_order_for_code
= info
->byte_order_for_code
;
416 gdbarch
->osabi
= info
->osabi
;
417 gdbarch
->target_desc
= info
->target_desc
;
419 /* Force the explicit initialization of these. */
420 gdbarch
->bits_big_endian
= (gdbarch
->byte_order
== BFD_ENDIAN_BIG
);
421 gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
422 gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
423 gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
424 gdbarch
->long_long_bit
= 2*gdbarch
->long_bit
;
425 gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
426 gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
427 gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
428 gdbarch
->ptr_bit
= gdbarch
->int_bit
;
429 gdbarch
->char_signed
= -1;
430 gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
431 gdbarch
->num_regs
= -1;
432 gdbarch
->sp_regnum
= -1;
433 gdbarch
->pc_regnum
= -1;
434 gdbarch
->ps_regnum
= -1;
435 gdbarch
->fp0_regnum
= -1;
436 gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
437 gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
438 gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
439 gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
440 gdbarch
->deprecated_fp_regnum
= -1;
441 gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
442 gdbarch
->print_registers_info
= default_print_registers_info
;
443 gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
444 gdbarch
->cannot_fetch_register
= cannot_register_not
;
445 gdbarch
->cannot_store_register
= cannot_register_not
;
446 gdbarch
->convert_register_p
= generic_convert_register_p
;
447 gdbarch
->value_from_register
= default_value_from_register
;
448 gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
449 gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
450 gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
451 gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
452 gdbarch
->remote_register_number
= default_remote_register_number
;
453 gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
454 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
455 gdbarch
->addr_bits_remove
= core_addr_identity
;
456 gdbarch
->smash_text_address
= core_addr_identity
;
457 gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
458 gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
459 gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
460 gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
461 gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
462 gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
463 gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
464 gdbarch
->displaced_step_fixup
= NULL
;
465 gdbarch
->displaced_step_free_closure
= NULL
;
466 gdbarch
->displaced_step_location
= NULL
;
467 gdbarch
->target_signal_from_host
= default_target_signal_from_host
;
468 gdbarch
->target_signal_to_host
= default_target_signal_to_host
;
469 /* gdbarch_alloc() */
475 /* Allocate extra space using the per-architecture obstack. */
478 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
480 void *data
= obstack_alloc (arch
->obstack
, size
);
481 memset (data
, 0, size
);
486 /* Free a gdbarch struct. This should never happen in normal
487 operation --- once you've created a gdbarch, you keep it around.
488 However, if an architecture's init function encounters an error
489 building the structure, it may need to clean up a partially
490 constructed gdbarch. */
493 gdbarch_free (struct gdbarch
*arch
)
495 struct obstack
*obstack
;
496 gdb_assert (arch
!= NULL
);
497 gdb_assert (!arch
->initialized_p
);
498 obstack
= arch
->obstack
;
499 obstack_free (obstack
, 0); /* Includes the ARCH. */
504 /* Ensure that all values in a GDBARCH are reasonable. */
507 verify_gdbarch (struct gdbarch
*gdbarch
)
510 struct cleanup
*cleanups
;
513 log
= mem_fileopen ();
514 cleanups
= make_cleanup_ui_file_delete (log
);
516 if (gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
517 fprintf_unfiltered (log
, "\n\tbyte-order");
518 if (gdbarch
->bfd_arch_info
== NULL
)
519 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
520 /* Check those that need to be defined for the given multi-arch level. */
521 /* Skip verify of bits_big_endian, invalid_p == 0 */
522 /* Skip verify of short_bit, invalid_p == 0 */
523 /* Skip verify of int_bit, invalid_p == 0 */
524 /* Skip verify of long_bit, invalid_p == 0 */
525 /* Skip verify of long_long_bit, invalid_p == 0 */
526 /* Skip verify of float_bit, invalid_p == 0 */
527 if (gdbarch
->float_format
== 0)
528 gdbarch
->float_format
= floatformats_ieee_single
;
529 /* Skip verify of double_bit, invalid_p == 0 */
530 if (gdbarch
->double_format
== 0)
531 gdbarch
->double_format
= floatformats_ieee_double
;
532 /* Skip verify of long_double_bit, invalid_p == 0 */
533 if (gdbarch
->long_double_format
== 0)
534 gdbarch
->long_double_format
= floatformats_ieee_double
;
535 /* Skip verify of ptr_bit, invalid_p == 0 */
536 if (gdbarch
->addr_bit
== 0)
537 gdbarch
->addr_bit
= gdbarch_ptr_bit (gdbarch
);
538 if (gdbarch
->char_signed
== -1)
539 gdbarch
->char_signed
= 1;
540 /* Skip verify of read_pc, has predicate */
541 /* Skip verify of write_pc, has predicate */
542 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
543 /* Skip verify of pseudo_register_read, has predicate */
544 /* Skip verify of pseudo_register_write, has predicate */
545 if (gdbarch
->num_regs
== -1)
546 fprintf_unfiltered (log
, "\n\tnum_regs");
547 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
548 /* Skip verify of sp_regnum, invalid_p == 0 */
549 /* Skip verify of pc_regnum, invalid_p == 0 */
550 /* Skip verify of ps_regnum, invalid_p == 0 */
551 /* Skip verify of fp0_regnum, invalid_p == 0 */
552 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
553 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
554 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
555 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
556 if (gdbarch
->register_name
== 0)
557 fprintf_unfiltered (log
, "\n\tregister_name");
558 /* Skip verify of register_type, has predicate */
559 /* Skip verify of dummy_id, has predicate */
560 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
561 /* Skip verify of push_dummy_call, has predicate */
562 /* Skip verify of call_dummy_location, invalid_p == 0 */
563 /* Skip verify of push_dummy_code, has predicate */
564 /* Skip verify of print_registers_info, invalid_p == 0 */
565 /* Skip verify of print_float_info, has predicate */
566 /* Skip verify of print_vector_info, has predicate */
567 /* Skip verify of register_sim_regno, invalid_p == 0 */
568 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
569 /* Skip verify of cannot_store_register, invalid_p == 0 */
570 /* Skip verify of get_longjmp_target, has predicate */
571 /* Skip verify of convert_register_p, invalid_p == 0 */
572 /* Skip verify of value_from_register, invalid_p == 0 */
573 /* Skip verify of pointer_to_address, invalid_p == 0 */
574 /* Skip verify of address_to_pointer, invalid_p == 0 */
575 /* Skip verify of integer_to_address, has predicate */
576 /* Skip verify of return_value, has predicate */
577 if (gdbarch
->skip_prologue
== 0)
578 fprintf_unfiltered (log
, "\n\tskip_prologue");
579 /* Skip verify of skip_main_prologue, has predicate */
580 if (gdbarch
->inner_than
== 0)
581 fprintf_unfiltered (log
, "\n\tinner_than");
582 if (gdbarch
->breakpoint_from_pc
== 0)
583 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
584 /* Skip verify of adjust_breakpoint_address, has predicate */
585 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
586 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
587 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
588 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
589 /* Skip verify of remote_register_number, invalid_p == 0 */
590 /* Skip verify of fetch_tls_load_module_address, has predicate */
591 /* Skip verify of frame_args_skip, invalid_p == 0 */
592 /* Skip verify of unwind_pc, has predicate */
593 /* Skip verify of unwind_sp, has predicate */
594 /* Skip verify of frame_num_args, has predicate */
595 /* Skip verify of frame_align, has predicate */
596 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
597 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
598 /* Skip verify of addr_bits_remove, invalid_p == 0 */
599 /* Skip verify of smash_text_address, invalid_p == 0 */
600 /* Skip verify of software_single_step, has predicate */
601 /* Skip verify of single_step_through_delay, has predicate */
602 if (gdbarch
->print_insn
== 0)
603 fprintf_unfiltered (log
, "\n\tprint_insn");
604 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
605 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
606 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
607 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
608 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
609 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
610 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
611 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
612 /* Skip verify of address_class_type_flags, has predicate */
613 /* Skip verify of address_class_type_flags_to_name, has predicate */
614 /* Skip verify of address_class_name_to_type_flags, has predicate */
615 /* Skip verify of register_reggroup_p, invalid_p == 0 */
616 /* Skip verify of fetch_pointer_argument, has predicate */
617 /* Skip verify of regset_from_core_section, has predicate */
618 /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
619 /* Skip verify of core_xfer_shared_libraries, has predicate */
620 /* Skip verify of core_pid_to_str, has predicate */
621 /* Skip verify of gcore_bfd_target, has predicate */
622 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
623 /* Skip verify of vbit_in_delta, invalid_p == 0 */
624 /* Skip verify of skip_permanent_breakpoint, has predicate */
625 /* Skip verify of max_insn_length, has predicate */
626 /* Skip verify of displaced_step_copy_insn, has predicate */
627 /* Skip verify of displaced_step_fixup, has predicate */
628 if ((! gdbarch
->displaced_step_free_closure
) != (! gdbarch
->displaced_step_copy_insn
))
629 fprintf_unfiltered (log
, "\n\tdisplaced_step_free_closure");
630 if ((! gdbarch
->displaced_step_location
) != (! gdbarch
->displaced_step_copy_insn
))
631 fprintf_unfiltered (log
, "\n\tdisplaced_step_location");
632 /* Skip verify of overlay_update, has predicate */
633 /* Skip verify of core_read_description, has predicate */
634 /* Skip verify of static_transform_name, has predicate */
635 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
636 /* Skip verify of process_record, has predicate */
637 /* Skip verify of target_signal_from_host, invalid_p == 0 */
638 /* Skip verify of target_signal_to_host, invalid_p == 0 */
639 /* Skip verify of get_siginfo_type, has predicate */
640 /* Skip verify of record_special_symbol, has predicate */
641 /* Skip verify of has_global_solist, invalid_p == 0 */
642 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
643 buf
= ui_file_xstrdup (log
, &dummy
);
644 make_cleanup (xfree
, buf
);
645 if (strlen (buf
) > 0)
646 internal_error (__FILE__
, __LINE__
,
647 _("verify_gdbarch: the following are invalid ...%s"),
649 do_cleanups (cleanups
);
653 /* Print out the details of the current architecture. */
656 gdbarch_dump (struct gdbarch
*gdbarch
, struct ui_file
*file
)
658 const char *gdb_nm_file
= "<not-defined>";
659 #if defined (GDB_NM_FILE)
660 gdb_nm_file
= GDB_NM_FILE
;
662 fprintf_unfiltered (file
,
663 "gdbarch_dump: GDB_NM_FILE = %s\n",
665 fprintf_unfiltered (file
,
666 "gdbarch_dump: addr_bit = %s\n",
667 plongest (gdbarch
->addr_bit
));
668 fprintf_unfiltered (file
,
669 "gdbarch_dump: addr_bits_remove = <%s>\n",
670 host_address_to_string (gdbarch
->addr_bits_remove
));
671 fprintf_unfiltered (file
,
672 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
673 gdbarch_address_class_name_to_type_flags_p (gdbarch
));
674 fprintf_unfiltered (file
,
675 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
676 host_address_to_string (gdbarch
->address_class_name_to_type_flags
));
677 fprintf_unfiltered (file
,
678 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
679 gdbarch_address_class_type_flags_p (gdbarch
));
680 fprintf_unfiltered (file
,
681 "gdbarch_dump: address_class_type_flags = <%s>\n",
682 host_address_to_string (gdbarch
->address_class_type_flags
));
683 fprintf_unfiltered (file
,
684 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
685 gdbarch_address_class_type_flags_to_name_p (gdbarch
));
686 fprintf_unfiltered (file
,
687 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
688 host_address_to_string (gdbarch
->address_class_type_flags_to_name
));
689 fprintf_unfiltered (file
,
690 "gdbarch_dump: address_to_pointer = <%s>\n",
691 host_address_to_string (gdbarch
->address_to_pointer
));
692 fprintf_unfiltered (file
,
693 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
694 gdbarch_adjust_breakpoint_address_p (gdbarch
));
695 fprintf_unfiltered (file
,
696 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
697 host_address_to_string (gdbarch
->adjust_breakpoint_address
));
698 fprintf_unfiltered (file
,
699 "gdbarch_dump: believe_pcc_promotion = %s\n",
700 plongest (gdbarch
->believe_pcc_promotion
));
701 fprintf_unfiltered (file
,
702 "gdbarch_dump: bfd_arch_info = %s\n",
703 gdbarch_bfd_arch_info (gdbarch
)->printable_name
);
704 fprintf_unfiltered (file
,
705 "gdbarch_dump: bits_big_endian = %s\n",
706 plongest (gdbarch
->bits_big_endian
));
707 fprintf_unfiltered (file
,
708 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
709 host_address_to_string (gdbarch
->breakpoint_from_pc
));
710 fprintf_unfiltered (file
,
711 "gdbarch_dump: byte_order = %s\n",
712 plongest (gdbarch
->byte_order
));
713 fprintf_unfiltered (file
,
714 "gdbarch_dump: byte_order_for_code = %s\n",
715 plongest (gdbarch
->byte_order_for_code
));
716 fprintf_unfiltered (file
,
717 "gdbarch_dump: call_dummy_location = %s\n",
718 plongest (gdbarch
->call_dummy_location
));
719 fprintf_unfiltered (file
,
720 "gdbarch_dump: cannot_fetch_register = <%s>\n",
721 host_address_to_string (gdbarch
->cannot_fetch_register
));
722 fprintf_unfiltered (file
,
723 "gdbarch_dump: cannot_step_breakpoint = %s\n",
724 plongest (gdbarch
->cannot_step_breakpoint
));
725 fprintf_unfiltered (file
,
726 "gdbarch_dump: cannot_store_register = <%s>\n",
727 host_address_to_string (gdbarch
->cannot_store_register
));
728 fprintf_unfiltered (file
,
729 "gdbarch_dump: char_signed = %s\n",
730 plongest (gdbarch
->char_signed
));
731 fprintf_unfiltered (file
,
732 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
733 host_address_to_string (gdbarch
->coff_make_msymbol_special
));
734 fprintf_unfiltered (file
,
735 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
736 host_address_to_string (gdbarch
->convert_from_func_ptr_addr
));
737 fprintf_unfiltered (file
,
738 "gdbarch_dump: convert_register_p = <%s>\n",
739 host_address_to_string (gdbarch
->convert_register_p
));
740 fprintf_unfiltered (file
,
741 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
742 gdbarch_core_pid_to_str_p (gdbarch
));
743 fprintf_unfiltered (file
,
744 "gdbarch_dump: core_pid_to_str = <%s>\n",
745 host_address_to_string (gdbarch
->core_pid_to_str
));
746 fprintf_unfiltered (file
,
747 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
748 gdbarch_core_read_description_p (gdbarch
));
749 fprintf_unfiltered (file
,
750 "gdbarch_dump: core_read_description = <%s>\n",
751 host_address_to_string (gdbarch
->core_read_description
));
752 fprintf_unfiltered (file
,
753 "gdbarch_dump: core_reg_section_encodes_pid = %s\n",
754 plongest (gdbarch
->core_reg_section_encodes_pid
));
755 fprintf_unfiltered (file
,
756 "gdbarch_dump: core_regset_sections = %s\n",
757 host_address_to_string (gdbarch
->core_regset_sections
));
758 fprintf_unfiltered (file
,
759 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
760 gdbarch_core_xfer_shared_libraries_p (gdbarch
));
761 fprintf_unfiltered (file
,
762 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
763 host_address_to_string (gdbarch
->core_xfer_shared_libraries
));
764 fprintf_unfiltered (file
,
765 "gdbarch_dump: decr_pc_after_break = %s\n",
766 core_addr_to_string_nz (gdbarch
->decr_pc_after_break
));
767 fprintf_unfiltered (file
,
768 "gdbarch_dump: deprecated_fp_regnum = %s\n",
769 plongest (gdbarch
->deprecated_fp_regnum
));
770 fprintf_unfiltered (file
,
771 "gdbarch_dump: deprecated_function_start_offset = %s\n",
772 core_addr_to_string_nz (gdbarch
->deprecated_function_start_offset
));
773 fprintf_unfiltered (file
,
774 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
775 gdbarch_displaced_step_copy_insn_p (gdbarch
));
776 fprintf_unfiltered (file
,
777 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
778 host_address_to_string (gdbarch
->displaced_step_copy_insn
));
779 fprintf_unfiltered (file
,
780 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
781 gdbarch_displaced_step_fixup_p (gdbarch
));
782 fprintf_unfiltered (file
,
783 "gdbarch_dump: displaced_step_fixup = <%s>\n",
784 host_address_to_string (gdbarch
->displaced_step_fixup
));
785 fprintf_unfiltered (file
,
786 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
787 host_address_to_string (gdbarch
->displaced_step_free_closure
));
788 fprintf_unfiltered (file
,
789 "gdbarch_dump: displaced_step_location = <%s>\n",
790 host_address_to_string (gdbarch
->displaced_step_location
));
791 fprintf_unfiltered (file
,
792 "gdbarch_dump: double_bit = %s\n",
793 plongest (gdbarch
->double_bit
));
794 fprintf_unfiltered (file
,
795 "gdbarch_dump: double_format = %s\n",
796 pformat (gdbarch
->double_format
));
797 fprintf_unfiltered (file
,
798 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
799 gdbarch_dummy_id_p (gdbarch
));
800 fprintf_unfiltered (file
,
801 "gdbarch_dump: dummy_id = <%s>\n",
802 host_address_to_string (gdbarch
->dummy_id
));
803 fprintf_unfiltered (file
,
804 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
805 host_address_to_string (gdbarch
->dwarf2_reg_to_regnum
));
806 fprintf_unfiltered (file
,
807 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
808 host_address_to_string (gdbarch
->ecoff_reg_to_regnum
));
809 fprintf_unfiltered (file
,
810 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
811 host_address_to_string (gdbarch
->elf_make_msymbol_special
));
812 fprintf_unfiltered (file
,
813 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
814 gdbarch_fetch_pointer_argument_p (gdbarch
));
815 fprintf_unfiltered (file
,
816 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
817 host_address_to_string (gdbarch
->fetch_pointer_argument
));
818 fprintf_unfiltered (file
,
819 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
820 gdbarch_fetch_tls_load_module_address_p (gdbarch
));
821 fprintf_unfiltered (file
,
822 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
823 host_address_to_string (gdbarch
->fetch_tls_load_module_address
));
824 fprintf_unfiltered (file
,
825 "gdbarch_dump: float_bit = %s\n",
826 plongest (gdbarch
->float_bit
));
827 fprintf_unfiltered (file
,
828 "gdbarch_dump: float_format = %s\n",
829 pformat (gdbarch
->float_format
));
830 fprintf_unfiltered (file
,
831 "gdbarch_dump: fp0_regnum = %s\n",
832 plongest (gdbarch
->fp0_regnum
));
833 fprintf_unfiltered (file
,
834 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
835 gdbarch_frame_align_p (gdbarch
));
836 fprintf_unfiltered (file
,
837 "gdbarch_dump: frame_align = <%s>\n",
838 host_address_to_string (gdbarch
->frame_align
));
839 fprintf_unfiltered (file
,
840 "gdbarch_dump: frame_args_skip = %s\n",
841 core_addr_to_string_nz (gdbarch
->frame_args_skip
));
842 fprintf_unfiltered (file
,
843 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
844 gdbarch_frame_num_args_p (gdbarch
));
845 fprintf_unfiltered (file
,
846 "gdbarch_dump: frame_num_args = <%s>\n",
847 host_address_to_string (gdbarch
->frame_num_args
));
848 fprintf_unfiltered (file
,
849 "gdbarch_dump: frame_red_zone_size = %s\n",
850 plongest (gdbarch
->frame_red_zone_size
));
851 fprintf_unfiltered (file
,
852 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
853 gdbarch_gcore_bfd_target_p (gdbarch
));
854 fprintf_unfiltered (file
,
855 "gdbarch_dump: gcore_bfd_target = %s\n",
856 gdbarch
->gcore_bfd_target
);
857 fprintf_unfiltered (file
,
858 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
859 gdbarch_get_longjmp_target_p (gdbarch
));
860 fprintf_unfiltered (file
,
861 "gdbarch_dump: get_longjmp_target = <%s>\n",
862 host_address_to_string (gdbarch
->get_longjmp_target
));
863 fprintf_unfiltered (file
,
864 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
865 gdbarch_get_siginfo_type_p (gdbarch
));
866 fprintf_unfiltered (file
,
867 "gdbarch_dump: get_siginfo_type = <%s>\n",
868 host_address_to_string (gdbarch
->get_siginfo_type
));
869 fprintf_unfiltered (file
,
870 "gdbarch_dump: has_global_breakpoints = %s\n",
871 plongest (gdbarch
->has_global_breakpoints
));
872 fprintf_unfiltered (file
,
873 "gdbarch_dump: has_global_solist = %s\n",
874 plongest (gdbarch
->has_global_solist
));
875 fprintf_unfiltered (file
,
876 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
877 plongest (gdbarch
->have_nonsteppable_watchpoint
));
878 fprintf_unfiltered (file
,
879 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
880 host_address_to_string (gdbarch
->in_function_epilogue_p
));
881 fprintf_unfiltered (file
,
882 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
883 host_address_to_string (gdbarch
->in_solib_return_trampoline
));
884 fprintf_unfiltered (file
,
885 "gdbarch_dump: inner_than = <%s>\n",
886 host_address_to_string (gdbarch
->inner_than
));
887 fprintf_unfiltered (file
,
888 "gdbarch_dump: int_bit = %s\n",
889 plongest (gdbarch
->int_bit
));
890 fprintf_unfiltered (file
,
891 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
892 gdbarch_integer_to_address_p (gdbarch
));
893 fprintf_unfiltered (file
,
894 "gdbarch_dump: integer_to_address = <%s>\n",
895 host_address_to_string (gdbarch
->integer_to_address
));
896 fprintf_unfiltered (file
,
897 "gdbarch_dump: long_bit = %s\n",
898 plongest (gdbarch
->long_bit
));
899 fprintf_unfiltered (file
,
900 "gdbarch_dump: long_double_bit = %s\n",
901 plongest (gdbarch
->long_double_bit
));
902 fprintf_unfiltered (file
,
903 "gdbarch_dump: long_double_format = %s\n",
904 pformat (gdbarch
->long_double_format
));
905 fprintf_unfiltered (file
,
906 "gdbarch_dump: long_long_bit = %s\n",
907 plongest (gdbarch
->long_long_bit
));
908 fprintf_unfiltered (file
,
909 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
910 gdbarch_max_insn_length_p (gdbarch
));
911 fprintf_unfiltered (file
,
912 "gdbarch_dump: max_insn_length = %s\n",
913 plongest (gdbarch
->max_insn_length
));
914 fprintf_unfiltered (file
,
915 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
916 host_address_to_string (gdbarch
->memory_insert_breakpoint
));
917 fprintf_unfiltered (file
,
918 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
919 host_address_to_string (gdbarch
->memory_remove_breakpoint
));
920 fprintf_unfiltered (file
,
921 "gdbarch_dump: num_pseudo_regs = %s\n",
922 plongest (gdbarch
->num_pseudo_regs
));
923 fprintf_unfiltered (file
,
924 "gdbarch_dump: num_regs = %s\n",
925 plongest (gdbarch
->num_regs
));
926 fprintf_unfiltered (file
,
927 "gdbarch_dump: osabi = %s\n",
928 plongest (gdbarch
->osabi
));
929 fprintf_unfiltered (file
,
930 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
931 gdbarch_overlay_update_p (gdbarch
));
932 fprintf_unfiltered (file
,
933 "gdbarch_dump: overlay_update = <%s>\n",
934 host_address_to_string (gdbarch
->overlay_update
));
935 fprintf_unfiltered (file
,
936 "gdbarch_dump: pc_regnum = %s\n",
937 plongest (gdbarch
->pc_regnum
));
938 fprintf_unfiltered (file
,
939 "gdbarch_dump: pointer_to_address = <%s>\n",
940 host_address_to_string (gdbarch
->pointer_to_address
));
941 fprintf_unfiltered (file
,
942 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
943 gdbarch_print_float_info_p (gdbarch
));
944 fprintf_unfiltered (file
,
945 "gdbarch_dump: print_float_info = <%s>\n",
946 host_address_to_string (gdbarch
->print_float_info
));
947 fprintf_unfiltered (file
,
948 "gdbarch_dump: print_insn = <%s>\n",
949 host_address_to_string (gdbarch
->print_insn
));
950 fprintf_unfiltered (file
,
951 "gdbarch_dump: print_registers_info = <%s>\n",
952 host_address_to_string (gdbarch
->print_registers_info
));
953 fprintf_unfiltered (file
,
954 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
955 gdbarch_print_vector_info_p (gdbarch
));
956 fprintf_unfiltered (file
,
957 "gdbarch_dump: print_vector_info = <%s>\n",
958 host_address_to_string (gdbarch
->print_vector_info
));
959 fprintf_unfiltered (file
,
960 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
961 gdbarch_process_record_p (gdbarch
));
962 fprintf_unfiltered (file
,
963 "gdbarch_dump: process_record = <%s>\n",
964 host_address_to_string (gdbarch
->process_record
));
965 fprintf_unfiltered (file
,
966 "gdbarch_dump: ps_regnum = %s\n",
967 plongest (gdbarch
->ps_regnum
));
968 fprintf_unfiltered (file
,
969 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
970 gdbarch_pseudo_register_read_p (gdbarch
));
971 fprintf_unfiltered (file
,
972 "gdbarch_dump: pseudo_register_read = <%s>\n",
973 host_address_to_string (gdbarch
->pseudo_register_read
));
974 fprintf_unfiltered (file
,
975 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
976 gdbarch_pseudo_register_write_p (gdbarch
));
977 fprintf_unfiltered (file
,
978 "gdbarch_dump: pseudo_register_write = <%s>\n",
979 host_address_to_string (gdbarch
->pseudo_register_write
));
980 fprintf_unfiltered (file
,
981 "gdbarch_dump: ptr_bit = %s\n",
982 plongest (gdbarch
->ptr_bit
));
983 fprintf_unfiltered (file
,
984 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
985 gdbarch_push_dummy_call_p (gdbarch
));
986 fprintf_unfiltered (file
,
987 "gdbarch_dump: push_dummy_call = <%s>\n",
988 host_address_to_string (gdbarch
->push_dummy_call
));
989 fprintf_unfiltered (file
,
990 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
991 gdbarch_push_dummy_code_p (gdbarch
));
992 fprintf_unfiltered (file
,
993 "gdbarch_dump: push_dummy_code = <%s>\n",
994 host_address_to_string (gdbarch
->push_dummy_code
));
995 fprintf_unfiltered (file
,
996 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
997 gdbarch_read_pc_p (gdbarch
));
998 fprintf_unfiltered (file
,
999 "gdbarch_dump: read_pc = <%s>\n",
1000 host_address_to_string (gdbarch
->read_pc
));
1001 fprintf_unfiltered (file
,
1002 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1003 gdbarch_record_special_symbol_p (gdbarch
));
1004 fprintf_unfiltered (file
,
1005 "gdbarch_dump: record_special_symbol = <%s>\n",
1006 host_address_to_string (gdbarch
->record_special_symbol
));
1007 fprintf_unfiltered (file
,
1008 "gdbarch_dump: register_name = <%s>\n",
1009 host_address_to_string (gdbarch
->register_name
));
1010 fprintf_unfiltered (file
,
1011 "gdbarch_dump: register_reggroup_p = <%s>\n",
1012 host_address_to_string (gdbarch
->register_reggroup_p
));
1013 fprintf_unfiltered (file
,
1014 "gdbarch_dump: register_sim_regno = <%s>\n",
1015 host_address_to_string (gdbarch
->register_sim_regno
));
1016 fprintf_unfiltered (file
,
1017 "gdbarch_dump: register_to_value = <%s>\n",
1018 host_address_to_string (gdbarch
->register_to_value
));
1019 fprintf_unfiltered (file
,
1020 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1021 gdbarch_register_type_p (gdbarch
));
1022 fprintf_unfiltered (file
,
1023 "gdbarch_dump: register_type = <%s>\n",
1024 host_address_to_string (gdbarch
->register_type
));
1025 fprintf_unfiltered (file
,
1026 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1027 gdbarch_regset_from_core_section_p (gdbarch
));
1028 fprintf_unfiltered (file
,
1029 "gdbarch_dump: regset_from_core_section = <%s>\n",
1030 host_address_to_string (gdbarch
->regset_from_core_section
));
1031 fprintf_unfiltered (file
,
1032 "gdbarch_dump: remote_register_number = <%s>\n",
1033 host_address_to_string (gdbarch
->remote_register_number
));
1034 fprintf_unfiltered (file
,
1035 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1036 gdbarch_return_value_p (gdbarch
));
1037 fprintf_unfiltered (file
,
1038 "gdbarch_dump: return_value = <%s>\n",
1039 host_address_to_string (gdbarch
->return_value
));
1040 fprintf_unfiltered (file
,
1041 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1042 host_address_to_string (gdbarch
->sdb_reg_to_regnum
));
1043 fprintf_unfiltered (file
,
1044 "gdbarch_dump: short_bit = %s\n",
1045 plongest (gdbarch
->short_bit
));
1046 fprintf_unfiltered (file
,
1047 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1048 gdbarch_single_step_through_delay_p (gdbarch
));
1049 fprintf_unfiltered (file
,
1050 "gdbarch_dump: single_step_through_delay = <%s>\n",
1051 host_address_to_string (gdbarch
->single_step_through_delay
));
1052 fprintf_unfiltered (file
,
1053 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1054 gdbarch_skip_main_prologue_p (gdbarch
));
1055 fprintf_unfiltered (file
,
1056 "gdbarch_dump: skip_main_prologue = <%s>\n",
1057 host_address_to_string (gdbarch
->skip_main_prologue
));
1058 fprintf_unfiltered (file
,
1059 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1060 gdbarch_skip_permanent_breakpoint_p (gdbarch
));
1061 fprintf_unfiltered (file
,
1062 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1063 host_address_to_string (gdbarch
->skip_permanent_breakpoint
));
1064 fprintf_unfiltered (file
,
1065 "gdbarch_dump: skip_prologue = <%s>\n",
1066 host_address_to_string (gdbarch
->skip_prologue
));
1067 fprintf_unfiltered (file
,
1068 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1069 host_address_to_string (gdbarch
->skip_solib_resolver
));
1070 fprintf_unfiltered (file
,
1071 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1072 host_address_to_string (gdbarch
->skip_trampoline_code
));
1073 fprintf_unfiltered (file
,
1074 "gdbarch_dump: smash_text_address = <%s>\n",
1075 host_address_to_string (gdbarch
->smash_text_address
));
1076 fprintf_unfiltered (file
,
1077 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1078 gdbarch_software_single_step_p (gdbarch
));
1079 fprintf_unfiltered (file
,
1080 "gdbarch_dump: software_single_step = <%s>\n",
1081 host_address_to_string (gdbarch
->software_single_step
));
1082 fprintf_unfiltered (file
,
1083 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1084 plongest (gdbarch
->sofun_address_maybe_missing
));
1085 fprintf_unfiltered (file
,
1086 "gdbarch_dump: sp_regnum = %s\n",
1087 plongest (gdbarch
->sp_regnum
));
1088 fprintf_unfiltered (file
,
1089 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1090 host_address_to_string (gdbarch
->stab_reg_to_regnum
));
1091 fprintf_unfiltered (file
,
1092 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1093 host_address_to_string (gdbarch
->stabs_argument_has_addr
));
1094 fprintf_unfiltered (file
,
1095 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1096 gdbarch_static_transform_name_p (gdbarch
));
1097 fprintf_unfiltered (file
,
1098 "gdbarch_dump: static_transform_name = <%s>\n",
1099 host_address_to_string (gdbarch
->static_transform_name
));
1100 fprintf_unfiltered (file
,
1101 "gdbarch_dump: target_desc = %s\n",
1102 host_address_to_string (gdbarch
->target_desc
));
1103 fprintf_unfiltered (file
,
1104 "gdbarch_dump: target_signal_from_host = <%s>\n",
1105 host_address_to_string (gdbarch
->target_signal_from_host
));
1106 fprintf_unfiltered (file
,
1107 "gdbarch_dump: target_signal_to_host = <%s>\n",
1108 host_address_to_string (gdbarch
->target_signal_to_host
));
1109 fprintf_unfiltered (file
,
1110 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1111 gdbarch_unwind_pc_p (gdbarch
));
1112 fprintf_unfiltered (file
,
1113 "gdbarch_dump: unwind_pc = <%s>\n",
1114 host_address_to_string (gdbarch
->unwind_pc
));
1115 fprintf_unfiltered (file
,
1116 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1117 gdbarch_unwind_sp_p (gdbarch
));
1118 fprintf_unfiltered (file
,
1119 "gdbarch_dump: unwind_sp = <%s>\n",
1120 host_address_to_string (gdbarch
->unwind_sp
));
1121 fprintf_unfiltered (file
,
1122 "gdbarch_dump: value_from_register = <%s>\n",
1123 host_address_to_string (gdbarch
->value_from_register
));
1124 fprintf_unfiltered (file
,
1125 "gdbarch_dump: value_to_register = <%s>\n",
1126 host_address_to_string (gdbarch
->value_to_register
));
1127 fprintf_unfiltered (file
,
1128 "gdbarch_dump: vbit_in_delta = %s\n",
1129 plongest (gdbarch
->vbit_in_delta
));
1130 fprintf_unfiltered (file
,
1131 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1132 host_address_to_string (gdbarch
->virtual_frame_pointer
));
1133 fprintf_unfiltered (file
,
1134 "gdbarch_dump: vtable_function_descriptors = %s\n",
1135 plongest (gdbarch
->vtable_function_descriptors
));
1136 fprintf_unfiltered (file
,
1137 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1138 gdbarch_write_pc_p (gdbarch
));
1139 fprintf_unfiltered (file
,
1140 "gdbarch_dump: write_pc = <%s>\n",
1141 host_address_to_string (gdbarch
->write_pc
));
1142 if (gdbarch
->dump_tdep
!= NULL
)
1143 gdbarch
->dump_tdep (gdbarch
, file
);
1146 struct gdbarch_tdep
*
1147 gdbarch_tdep (struct gdbarch
*gdbarch
)
1149 if (gdbarch_debug
>= 2)
1150 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1151 return gdbarch
->tdep
;
1155 const struct bfd_arch_info
*
1156 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1158 gdb_assert (gdbarch
!= NULL
);
1159 if (gdbarch_debug
>= 2)
1160 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1161 return gdbarch
->bfd_arch_info
;
1165 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1167 gdb_assert (gdbarch
!= NULL
);
1168 if (gdbarch_debug
>= 2)
1169 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1170 return gdbarch
->byte_order
;
1174 gdbarch_byte_order_for_code (struct gdbarch
*gdbarch
)
1176 gdb_assert (gdbarch
!= NULL
);
1177 if (gdbarch_debug
>= 2)
1178 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order_for_code called\n");
1179 return gdbarch
->byte_order_for_code
;
1183 gdbarch_osabi (struct gdbarch
*gdbarch
)
1185 gdb_assert (gdbarch
!= NULL
);
1186 if (gdbarch_debug
>= 2)
1187 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1188 return gdbarch
->osabi
;
1191 const struct target_desc
*
1192 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1194 gdb_assert (gdbarch
!= NULL
);
1195 if (gdbarch_debug
>= 2)
1196 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1197 return gdbarch
->target_desc
;
1201 gdbarch_bits_big_endian (struct gdbarch
*gdbarch
)
1203 gdb_assert (gdbarch
!= NULL
);
1204 /* Skip verify of bits_big_endian, invalid_p == 0 */
1205 if (gdbarch_debug
>= 2)
1206 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bits_big_endian called\n");
1207 return gdbarch
->bits_big_endian
;
1211 set_gdbarch_bits_big_endian (struct gdbarch
*gdbarch
,
1212 int bits_big_endian
)
1214 gdbarch
->bits_big_endian
= bits_big_endian
;
1218 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1220 gdb_assert (gdbarch
!= NULL
);
1221 /* Skip verify of short_bit, invalid_p == 0 */
1222 if (gdbarch_debug
>= 2)
1223 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1224 return gdbarch
->short_bit
;
1228 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1231 gdbarch
->short_bit
= short_bit
;
1235 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1237 gdb_assert (gdbarch
!= NULL
);
1238 /* Skip verify of int_bit, invalid_p == 0 */
1239 if (gdbarch_debug
>= 2)
1240 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1241 return gdbarch
->int_bit
;
1245 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1248 gdbarch
->int_bit
= int_bit
;
1252 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1254 gdb_assert (gdbarch
!= NULL
);
1255 /* Skip verify of long_bit, invalid_p == 0 */
1256 if (gdbarch_debug
>= 2)
1257 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1258 return gdbarch
->long_bit
;
1262 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1265 gdbarch
->long_bit
= long_bit
;
1269 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1271 gdb_assert (gdbarch
!= NULL
);
1272 /* Skip verify of long_long_bit, invalid_p == 0 */
1273 if (gdbarch_debug
>= 2)
1274 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1275 return gdbarch
->long_long_bit
;
1279 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1282 gdbarch
->long_long_bit
= long_long_bit
;
1286 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1288 gdb_assert (gdbarch
!= NULL
);
1289 /* Skip verify of float_bit, invalid_p == 0 */
1290 if (gdbarch_debug
>= 2)
1291 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1292 return gdbarch
->float_bit
;
1296 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1299 gdbarch
->float_bit
= float_bit
;
1302 const struct floatformat
**
1303 gdbarch_float_format (struct gdbarch
*gdbarch
)
1305 gdb_assert (gdbarch
!= NULL
);
1306 if (gdbarch_debug
>= 2)
1307 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1308 return gdbarch
->float_format
;
1312 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1313 const struct floatformat
** float_format
)
1315 gdbarch
->float_format
= float_format
;
1319 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1321 gdb_assert (gdbarch
!= NULL
);
1322 /* Skip verify of double_bit, invalid_p == 0 */
1323 if (gdbarch_debug
>= 2)
1324 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1325 return gdbarch
->double_bit
;
1329 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1332 gdbarch
->double_bit
= double_bit
;
1335 const struct floatformat
**
1336 gdbarch_double_format (struct gdbarch
*gdbarch
)
1338 gdb_assert (gdbarch
!= NULL
);
1339 if (gdbarch_debug
>= 2)
1340 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1341 return gdbarch
->double_format
;
1345 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1346 const struct floatformat
** double_format
)
1348 gdbarch
->double_format
= double_format
;
1352 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1354 gdb_assert (gdbarch
!= NULL
);
1355 /* Skip verify of long_double_bit, invalid_p == 0 */
1356 if (gdbarch_debug
>= 2)
1357 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1358 return gdbarch
->long_double_bit
;
1362 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1363 int long_double_bit
)
1365 gdbarch
->long_double_bit
= long_double_bit
;
1368 const struct floatformat
**
1369 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1371 gdb_assert (gdbarch
!= NULL
);
1372 if (gdbarch_debug
>= 2)
1373 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1374 return gdbarch
->long_double_format
;
1378 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1379 const struct floatformat
** long_double_format
)
1381 gdbarch
->long_double_format
= long_double_format
;
1385 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1387 gdb_assert (gdbarch
!= NULL
);
1388 /* Skip verify of ptr_bit, invalid_p == 0 */
1389 if (gdbarch_debug
>= 2)
1390 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1391 return gdbarch
->ptr_bit
;
1395 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1398 gdbarch
->ptr_bit
= ptr_bit
;
1402 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1404 gdb_assert (gdbarch
!= NULL
);
1405 /* Check variable changed from pre-default. */
1406 gdb_assert (gdbarch
->addr_bit
!= 0);
1407 if (gdbarch_debug
>= 2)
1408 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1409 return gdbarch
->addr_bit
;
1413 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1416 gdbarch
->addr_bit
= addr_bit
;
1420 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1422 gdb_assert (gdbarch
!= NULL
);
1423 /* Check variable changed from pre-default. */
1424 gdb_assert (gdbarch
->char_signed
!= -1);
1425 if (gdbarch_debug
>= 2)
1426 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1427 return gdbarch
->char_signed
;
1431 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1434 gdbarch
->char_signed
= char_signed
;
1438 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1440 gdb_assert (gdbarch
!= NULL
);
1441 return gdbarch
->read_pc
!= NULL
;
1445 gdbarch_read_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
1447 gdb_assert (gdbarch
!= NULL
);
1448 gdb_assert (gdbarch
->read_pc
!= NULL
);
1449 if (gdbarch_debug
>= 2)
1450 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1451 return gdbarch
->read_pc (regcache
);
1455 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1456 gdbarch_read_pc_ftype read_pc
)
1458 gdbarch
->read_pc
= read_pc
;
1462 gdbarch_write_pc_p (struct gdbarch
*gdbarch
)
1464 gdb_assert (gdbarch
!= NULL
);
1465 return gdbarch
->write_pc
!= NULL
;
1469 gdbarch_write_pc (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR val
)
1471 gdb_assert (gdbarch
!= NULL
);
1472 gdb_assert (gdbarch
->write_pc
!= NULL
);
1473 if (gdbarch_debug
>= 2)
1474 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1475 gdbarch
->write_pc (regcache
, val
);
1479 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1480 gdbarch_write_pc_ftype write_pc
)
1482 gdbarch
->write_pc
= write_pc
;
1486 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1488 gdb_assert (gdbarch
!= NULL
);
1489 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1490 if (gdbarch_debug
>= 2)
1491 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1492 gdbarch
->virtual_frame_pointer (gdbarch
, pc
, frame_regnum
, frame_offset
);
1496 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1497 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1499 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1503 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1505 gdb_assert (gdbarch
!= NULL
);
1506 return gdbarch
->pseudo_register_read
!= NULL
;
1510 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1512 gdb_assert (gdbarch
!= NULL
);
1513 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1514 if (gdbarch_debug
>= 2)
1515 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1516 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
1520 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
1521 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
1523 gdbarch
->pseudo_register_read
= pseudo_register_read
;
1527 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
1529 gdb_assert (gdbarch
!= NULL
);
1530 return gdbarch
->pseudo_register_write
!= NULL
;
1534 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
1536 gdb_assert (gdbarch
!= NULL
);
1537 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
1538 if (gdbarch_debug
>= 2)
1539 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
1540 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
1544 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
1545 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
1547 gdbarch
->pseudo_register_write
= pseudo_register_write
;
1551 gdbarch_num_regs (struct gdbarch
*gdbarch
)
1553 gdb_assert (gdbarch
!= NULL
);
1554 /* Check variable changed from pre-default. */
1555 gdb_assert (gdbarch
->num_regs
!= -1);
1556 if (gdbarch_debug
>= 2)
1557 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
1558 return gdbarch
->num_regs
;
1562 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
1565 gdbarch
->num_regs
= num_regs
;
1569 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
1571 gdb_assert (gdbarch
!= NULL
);
1572 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1573 if (gdbarch_debug
>= 2)
1574 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
1575 return gdbarch
->num_pseudo_regs
;
1579 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
1580 int num_pseudo_regs
)
1582 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
1586 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
1588 gdb_assert (gdbarch
!= NULL
);
1589 /* Skip verify of sp_regnum, invalid_p == 0 */
1590 if (gdbarch_debug
>= 2)
1591 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
1592 return gdbarch
->sp_regnum
;
1596 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
1599 gdbarch
->sp_regnum
= sp_regnum
;
1603 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
1605 gdb_assert (gdbarch
!= NULL
);
1606 /* Skip verify of pc_regnum, invalid_p == 0 */
1607 if (gdbarch_debug
>= 2)
1608 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
1609 return gdbarch
->pc_regnum
;
1613 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
1616 gdbarch
->pc_regnum
= pc_regnum
;
1620 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
1622 gdb_assert (gdbarch
!= NULL
);
1623 /* Skip verify of ps_regnum, invalid_p == 0 */
1624 if (gdbarch_debug
>= 2)
1625 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
1626 return gdbarch
->ps_regnum
;
1630 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
1633 gdbarch
->ps_regnum
= ps_regnum
;
1637 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
1639 gdb_assert (gdbarch
!= NULL
);
1640 /* Skip verify of fp0_regnum, invalid_p == 0 */
1641 if (gdbarch_debug
>= 2)
1642 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
1643 return gdbarch
->fp0_regnum
;
1647 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
1650 gdbarch
->fp0_regnum
= fp0_regnum
;
1654 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
1656 gdb_assert (gdbarch
!= NULL
);
1657 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
1658 if (gdbarch_debug
>= 2)
1659 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
1660 return gdbarch
->stab_reg_to_regnum (gdbarch
, stab_regnr
);
1664 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
1665 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
1667 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
1671 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
1673 gdb_assert (gdbarch
!= NULL
);
1674 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
1675 if (gdbarch_debug
>= 2)
1676 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
1677 return gdbarch
->ecoff_reg_to_regnum (gdbarch
, ecoff_regnr
);
1681 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
1682 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
1684 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
1688 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
1690 gdb_assert (gdbarch
!= NULL
);
1691 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
1692 if (gdbarch_debug
>= 2)
1693 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
1694 return gdbarch
->sdb_reg_to_regnum (gdbarch
, sdb_regnr
);
1698 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
1699 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
1701 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
1705 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
1707 gdb_assert (gdbarch
!= NULL
);
1708 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
1709 if (gdbarch_debug
>= 2)
1710 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
1711 return gdbarch
->dwarf2_reg_to_regnum (gdbarch
, dwarf2_regnr
);
1715 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
1716 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
1718 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
1722 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
1724 gdb_assert (gdbarch
!= NULL
);
1725 gdb_assert (gdbarch
->register_name
!= NULL
);
1726 if (gdbarch_debug
>= 2)
1727 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
1728 return gdbarch
->register_name (gdbarch
, regnr
);
1732 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
1733 gdbarch_register_name_ftype register_name
)
1735 gdbarch
->register_name
= register_name
;
1739 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
1741 gdb_assert (gdbarch
!= NULL
);
1742 return gdbarch
->register_type
!= NULL
;
1746 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
1748 gdb_assert (gdbarch
!= NULL
);
1749 gdb_assert (gdbarch
->register_type
!= NULL
);
1750 if (gdbarch_debug
>= 2)
1751 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
1752 return gdbarch
->register_type (gdbarch
, reg_nr
);
1756 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
1757 gdbarch_register_type_ftype register_type
)
1759 gdbarch
->register_type
= register_type
;
1763 gdbarch_dummy_id_p (struct gdbarch
*gdbarch
)
1765 gdb_assert (gdbarch
!= NULL
);
1766 return gdbarch
->dummy_id
!= NULL
;
1770 gdbarch_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*this_frame
)
1772 gdb_assert (gdbarch
!= NULL
);
1773 gdb_assert (gdbarch
->dummy_id
!= NULL
);
1774 if (gdbarch_debug
>= 2)
1775 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dummy_id called\n");
1776 return gdbarch
->dummy_id (gdbarch
, this_frame
);
1780 set_gdbarch_dummy_id (struct gdbarch
*gdbarch
,
1781 gdbarch_dummy_id_ftype dummy_id
)
1783 gdbarch
->dummy_id
= dummy_id
;
1787 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
1789 gdb_assert (gdbarch
!= NULL
);
1790 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1791 if (gdbarch_debug
>= 2)
1792 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
1793 return gdbarch
->deprecated_fp_regnum
;
1797 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
1798 int deprecated_fp_regnum
)
1800 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
1804 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
1806 gdb_assert (gdbarch
!= NULL
);
1807 return gdbarch
->push_dummy_call
!= NULL
;
1811 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
)
1813 gdb_assert (gdbarch
!= NULL
);
1814 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
1815 if (gdbarch_debug
>= 2)
1816 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
1817 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
1821 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
1822 gdbarch_push_dummy_call_ftype push_dummy_call
)
1824 gdbarch
->push_dummy_call
= push_dummy_call
;
1828 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
1830 gdb_assert (gdbarch
!= NULL
);
1831 /* Skip verify of call_dummy_location, invalid_p == 0 */
1832 if (gdbarch_debug
>= 2)
1833 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
1834 return gdbarch
->call_dummy_location
;
1838 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
1839 int call_dummy_location
)
1841 gdbarch
->call_dummy_location
= call_dummy_location
;
1845 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
1847 gdb_assert (gdbarch
!= NULL
);
1848 return gdbarch
->push_dummy_code
!= NULL
;
1852 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
)
1854 gdb_assert (gdbarch
!= NULL
);
1855 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
1856 if (gdbarch_debug
>= 2)
1857 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
1858 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, args
, nargs
, value_type
, real_pc
, bp_addr
, regcache
);
1862 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
1863 gdbarch_push_dummy_code_ftype push_dummy_code
)
1865 gdbarch
->push_dummy_code
= push_dummy_code
;
1869 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
1871 gdb_assert (gdbarch
!= NULL
);
1872 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
1873 if (gdbarch_debug
>= 2)
1874 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
1875 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
1879 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
1880 gdbarch_print_registers_info_ftype print_registers_info
)
1882 gdbarch
->print_registers_info
= print_registers_info
;
1886 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
1888 gdb_assert (gdbarch
!= NULL
);
1889 return gdbarch
->print_float_info
!= NULL
;
1893 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
1895 gdb_assert (gdbarch
!= NULL
);
1896 gdb_assert (gdbarch
->print_float_info
!= NULL
);
1897 if (gdbarch_debug
>= 2)
1898 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
1899 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
1903 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
1904 gdbarch_print_float_info_ftype print_float_info
)
1906 gdbarch
->print_float_info
= print_float_info
;
1910 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
1912 gdb_assert (gdbarch
!= NULL
);
1913 return gdbarch
->print_vector_info
!= NULL
;
1917 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
1919 gdb_assert (gdbarch
!= NULL
);
1920 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
1921 if (gdbarch_debug
>= 2)
1922 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
1923 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
1927 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
1928 gdbarch_print_vector_info_ftype print_vector_info
)
1930 gdbarch
->print_vector_info
= print_vector_info
;
1934 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
1936 gdb_assert (gdbarch
!= NULL
);
1937 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
1938 if (gdbarch_debug
>= 2)
1939 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
1940 return gdbarch
->register_sim_regno (gdbarch
, reg_nr
);
1944 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
1945 gdbarch_register_sim_regno_ftype register_sim_regno
)
1947 gdbarch
->register_sim_regno
= register_sim_regno
;
1951 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
1953 gdb_assert (gdbarch
!= NULL
);
1954 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
1955 if (gdbarch_debug
>= 2)
1956 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
1957 return gdbarch
->cannot_fetch_register (gdbarch
, regnum
);
1961 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
1962 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
1964 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
1968 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
1970 gdb_assert (gdbarch
!= NULL
);
1971 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
1972 if (gdbarch_debug
>= 2)
1973 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
1974 return gdbarch
->cannot_store_register (gdbarch
, regnum
);
1978 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
1979 gdbarch_cannot_store_register_ftype cannot_store_register
)
1981 gdbarch
->cannot_store_register
= cannot_store_register
;
1985 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
1987 gdb_assert (gdbarch
!= NULL
);
1988 return gdbarch
->get_longjmp_target
!= NULL
;
1992 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR
*pc
)
1994 gdb_assert (gdbarch
!= NULL
);
1995 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
1996 if (gdbarch_debug
>= 2)
1997 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
1998 return gdbarch
->get_longjmp_target (frame
, pc
);
2002 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2003 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2005 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2009 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2011 gdb_assert (gdbarch
!= NULL
);
2012 if (gdbarch_debug
>= 2)
2013 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2014 return gdbarch
->believe_pcc_promotion
;
2018 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2019 int believe_pcc_promotion
)
2021 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2025 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2027 gdb_assert (gdbarch
!= NULL
);
2028 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2029 if (gdbarch_debug
>= 2)
2030 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2031 return gdbarch
->convert_register_p (gdbarch
, regnum
, type
);
2035 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2036 gdbarch_convert_register_p_ftype convert_register_p
)
2038 gdbarch
->convert_register_p
= convert_register_p
;
2042 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
)
2044 gdb_assert (gdbarch
!= NULL
);
2045 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2046 if (gdbarch_debug
>= 2)
2047 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2048 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2052 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2053 gdbarch_register_to_value_ftype register_to_value
)
2055 gdbarch
->register_to_value
= register_to_value
;
2059 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2061 gdb_assert (gdbarch
!= NULL
);
2062 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2063 if (gdbarch_debug
>= 2)
2064 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2065 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2069 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2070 gdbarch_value_to_register_ftype value_to_register
)
2072 gdbarch
->value_to_register
= value_to_register
;
2076 gdbarch_value_from_register (struct gdbarch
*gdbarch
, struct type
*type
, int regnum
, struct frame_info
*frame
)
2078 gdb_assert (gdbarch
!= NULL
);
2079 gdb_assert (gdbarch
->value_from_register
!= NULL
);
2080 if (gdbarch_debug
>= 2)
2081 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_from_register called\n");
2082 return gdbarch
->value_from_register (type
, regnum
, frame
);
2086 set_gdbarch_value_from_register (struct gdbarch
*gdbarch
,
2087 gdbarch_value_from_register_ftype value_from_register
)
2089 gdbarch
->value_from_register
= value_from_register
;
2093 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2095 gdb_assert (gdbarch
!= NULL
);
2096 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2097 if (gdbarch_debug
>= 2)
2098 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2099 return gdbarch
->pointer_to_address (gdbarch
, type
, buf
);
2103 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2104 gdbarch_pointer_to_address_ftype pointer_to_address
)
2106 gdbarch
->pointer_to_address
= pointer_to_address
;
2110 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2112 gdb_assert (gdbarch
!= NULL
);
2113 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2114 if (gdbarch_debug
>= 2)
2115 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2116 gdbarch
->address_to_pointer (gdbarch
, type
, buf
, addr
);
2120 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2121 gdbarch_address_to_pointer_ftype address_to_pointer
)
2123 gdbarch
->address_to_pointer
= address_to_pointer
;
2127 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2129 gdb_assert (gdbarch
!= NULL
);
2130 return gdbarch
->integer_to_address
!= NULL
;
2134 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2136 gdb_assert (gdbarch
!= NULL
);
2137 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2138 if (gdbarch_debug
>= 2)
2139 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2140 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2144 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2145 gdbarch_integer_to_address_ftype integer_to_address
)
2147 gdbarch
->integer_to_address
= integer_to_address
;
2151 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2153 gdb_assert (gdbarch
!= NULL
);
2154 return gdbarch
->return_value
!= NULL
;
2157 enum return_value_convention
2158 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*functype
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2160 gdb_assert (gdbarch
!= NULL
);
2161 gdb_assert (gdbarch
->return_value
!= NULL
);
2162 if (gdbarch_debug
>= 2)
2163 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2164 return gdbarch
->return_value (gdbarch
, functype
, valtype
, regcache
, readbuf
, writebuf
);
2168 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2169 gdbarch_return_value_ftype return_value
)
2171 gdbarch
->return_value
= return_value
;
2175 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2177 gdb_assert (gdbarch
!= NULL
);
2178 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2179 if (gdbarch_debug
>= 2)
2180 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2181 return gdbarch
->skip_prologue (gdbarch
, ip
);
2185 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2186 gdbarch_skip_prologue_ftype skip_prologue
)
2188 gdbarch
->skip_prologue
= skip_prologue
;
2192 gdbarch_skip_main_prologue_p (struct gdbarch
*gdbarch
)
2194 gdb_assert (gdbarch
!= NULL
);
2195 return gdbarch
->skip_main_prologue
!= NULL
;
2199 gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2201 gdb_assert (gdbarch
!= NULL
);
2202 gdb_assert (gdbarch
->skip_main_prologue
!= NULL
);
2203 if (gdbarch_debug
>= 2)
2204 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_main_prologue called\n");
2205 return gdbarch
->skip_main_prologue (gdbarch
, ip
);
2209 set_gdbarch_skip_main_prologue (struct gdbarch
*gdbarch
,
2210 gdbarch_skip_main_prologue_ftype skip_main_prologue
)
2212 gdbarch
->skip_main_prologue
= skip_main_prologue
;
2216 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2218 gdb_assert (gdbarch
!= NULL
);
2219 gdb_assert (gdbarch
->inner_than
!= NULL
);
2220 if (gdbarch_debug
>= 2)
2221 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2222 return gdbarch
->inner_than (lhs
, rhs
);
2226 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2227 gdbarch_inner_than_ftype inner_than
)
2229 gdbarch
->inner_than
= inner_than
;
2233 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2235 gdb_assert (gdbarch
!= NULL
);
2236 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2237 if (gdbarch_debug
>= 2)
2238 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2239 return gdbarch
->breakpoint_from_pc (gdbarch
, pcptr
, lenptr
);
2243 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2244 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2246 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2250 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2252 gdb_assert (gdbarch
!= NULL
);
2253 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2257 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2259 gdb_assert (gdbarch
!= NULL
);
2260 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2261 if (gdbarch_debug
>= 2)
2262 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2263 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2267 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2268 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2270 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2274 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2276 gdb_assert (gdbarch
!= NULL
);
2277 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2278 if (gdbarch_debug
>= 2)
2279 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2280 return gdbarch
->memory_insert_breakpoint (gdbarch
, bp_tgt
);
2284 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2285 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2287 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2291 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2293 gdb_assert (gdbarch
!= NULL
);
2294 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2295 if (gdbarch_debug
>= 2)
2296 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2297 return gdbarch
->memory_remove_breakpoint (gdbarch
, bp_tgt
);
2301 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2302 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2304 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2308 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2310 gdb_assert (gdbarch
!= NULL
);
2311 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2312 if (gdbarch_debug
>= 2)
2313 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2314 return gdbarch
->decr_pc_after_break
;
2318 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2319 CORE_ADDR decr_pc_after_break
)
2321 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2325 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2327 gdb_assert (gdbarch
!= NULL
);
2328 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2329 if (gdbarch_debug
>= 2)
2330 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2331 return gdbarch
->deprecated_function_start_offset
;
2335 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2336 CORE_ADDR deprecated_function_start_offset
)
2338 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2342 gdbarch_remote_register_number (struct gdbarch
*gdbarch
, int regno
)
2344 gdb_assert (gdbarch
!= NULL
);
2345 gdb_assert (gdbarch
->remote_register_number
!= NULL
);
2346 if (gdbarch_debug
>= 2)
2347 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_register_number called\n");
2348 return gdbarch
->remote_register_number (gdbarch
, regno
);
2352 set_gdbarch_remote_register_number (struct gdbarch
*gdbarch
,
2353 gdbarch_remote_register_number_ftype remote_register_number
)
2355 gdbarch
->remote_register_number
= remote_register_number
;
2359 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
2361 gdb_assert (gdbarch
!= NULL
);
2362 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
2366 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
2368 gdb_assert (gdbarch
!= NULL
);
2369 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
2370 if (gdbarch_debug
>= 2)
2371 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
2372 return gdbarch
->fetch_tls_load_module_address (objfile
);
2376 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
2377 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
2379 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
2383 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
2385 gdb_assert (gdbarch
!= NULL
);
2386 /* Skip verify of frame_args_skip, invalid_p == 0 */
2387 if (gdbarch_debug
>= 2)
2388 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
2389 return gdbarch
->frame_args_skip
;
2393 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
2394 CORE_ADDR frame_args_skip
)
2396 gdbarch
->frame_args_skip
= frame_args_skip
;
2400 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
2402 gdb_assert (gdbarch
!= NULL
);
2403 return gdbarch
->unwind_pc
!= NULL
;
2407 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2409 gdb_assert (gdbarch
!= NULL
);
2410 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
2411 if (gdbarch_debug
>= 2)
2412 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
2413 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
2417 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
2418 gdbarch_unwind_pc_ftype unwind_pc
)
2420 gdbarch
->unwind_pc
= unwind_pc
;
2424 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
2426 gdb_assert (gdbarch
!= NULL
);
2427 return gdbarch
->unwind_sp
!= NULL
;
2431 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
2433 gdb_assert (gdbarch
!= NULL
);
2434 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
2435 if (gdbarch_debug
>= 2)
2436 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
2437 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
2441 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
2442 gdbarch_unwind_sp_ftype unwind_sp
)
2444 gdbarch
->unwind_sp
= unwind_sp
;
2448 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
2450 gdb_assert (gdbarch
!= NULL
);
2451 return gdbarch
->frame_num_args
!= NULL
;
2455 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2457 gdb_assert (gdbarch
!= NULL
);
2458 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
2459 if (gdbarch_debug
>= 2)
2460 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
2461 return gdbarch
->frame_num_args (frame
);
2465 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
2466 gdbarch_frame_num_args_ftype frame_num_args
)
2468 gdbarch
->frame_num_args
= frame_num_args
;
2472 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
2474 gdb_assert (gdbarch
!= NULL
);
2475 return gdbarch
->frame_align
!= NULL
;
2479 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
2481 gdb_assert (gdbarch
!= NULL
);
2482 gdb_assert (gdbarch
->frame_align
!= NULL
);
2483 if (gdbarch_debug
>= 2)
2484 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
2485 return gdbarch
->frame_align (gdbarch
, address
);
2489 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
2490 gdbarch_frame_align_ftype frame_align
)
2492 gdbarch
->frame_align
= frame_align
;
2496 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
2498 gdb_assert (gdbarch
!= NULL
);
2499 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
2500 if (gdbarch_debug
>= 2)
2501 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
2502 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
2506 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
2507 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
2509 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
2513 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
2515 gdb_assert (gdbarch
!= NULL
);
2516 if (gdbarch_debug
>= 2)
2517 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
2518 return gdbarch
->frame_red_zone_size
;
2522 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
2523 int frame_red_zone_size
)
2525 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
2529 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
2531 gdb_assert (gdbarch
!= NULL
);
2532 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
2533 if (gdbarch_debug
>= 2)
2534 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
2535 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
2539 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
2540 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
2542 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
2546 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2548 gdb_assert (gdbarch
!= NULL
);
2549 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
2550 if (gdbarch_debug
>= 2)
2551 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
2552 return gdbarch
->addr_bits_remove (gdbarch
, addr
);
2556 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
2557 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
2559 gdbarch
->addr_bits_remove
= addr_bits_remove
;
2563 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2565 gdb_assert (gdbarch
!= NULL
);
2566 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
2567 if (gdbarch_debug
>= 2)
2568 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
2569 return gdbarch
->smash_text_address (gdbarch
, addr
);
2573 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
2574 gdbarch_smash_text_address_ftype smash_text_address
)
2576 gdbarch
->smash_text_address
= smash_text_address
;
2580 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
2582 gdb_assert (gdbarch
!= NULL
);
2583 return gdbarch
->software_single_step
!= NULL
;
2587 gdbarch_software_single_step (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2589 gdb_assert (gdbarch
!= NULL
);
2590 gdb_assert (gdbarch
->software_single_step
!= NULL
);
2591 if (gdbarch_debug
>= 2)
2592 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
2593 return gdbarch
->software_single_step (frame
);
2597 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
2598 gdbarch_software_single_step_ftype software_single_step
)
2600 gdbarch
->software_single_step
= software_single_step
;
2604 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
2606 gdb_assert (gdbarch
!= NULL
);
2607 return gdbarch
->single_step_through_delay
!= NULL
;
2611 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
2613 gdb_assert (gdbarch
!= NULL
);
2614 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
2615 if (gdbarch_debug
>= 2)
2616 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
2617 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
2621 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
2622 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
2624 gdbarch
->single_step_through_delay
= single_step_through_delay
;
2628 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
2630 gdb_assert (gdbarch
!= NULL
);
2631 gdb_assert (gdbarch
->print_insn
!= NULL
);
2632 if (gdbarch_debug
>= 2)
2633 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
2634 return gdbarch
->print_insn (vma
, info
);
2638 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
2639 gdbarch_print_insn_ftype print_insn
)
2641 gdbarch
->print_insn
= print_insn
;
2645 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, struct frame_info
*frame
, CORE_ADDR pc
)
2647 gdb_assert (gdbarch
!= NULL
);
2648 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
2649 if (gdbarch_debug
>= 2)
2650 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
2651 return gdbarch
->skip_trampoline_code (frame
, pc
);
2655 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
2656 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
2658 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
2662 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
2664 gdb_assert (gdbarch
!= NULL
);
2665 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
2666 if (gdbarch_debug
>= 2)
2667 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
2668 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
2672 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
2673 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
2675 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
2679 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
2681 gdb_assert (gdbarch
!= NULL
);
2682 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
2683 if (gdbarch_debug
>= 2)
2684 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
2685 return gdbarch
->in_solib_return_trampoline (pc
, name
);
2689 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
2690 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
2692 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
2696 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
2698 gdb_assert (gdbarch
!= NULL
);
2699 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
2700 if (gdbarch_debug
>= 2)
2701 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
2702 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
2706 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
2707 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
2709 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
2713 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
2715 gdb_assert (gdbarch
!= NULL
);
2716 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
2717 if (gdbarch_debug
>= 2)
2718 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
2719 gdbarch
->elf_make_msymbol_special (sym
, msym
);
2723 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
2724 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
2726 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
2730 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
2732 gdb_assert (gdbarch
!= NULL
);
2733 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
2734 if (gdbarch_debug
>= 2)
2735 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
2736 gdbarch
->coff_make_msymbol_special (val
, msym
);
2740 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
2741 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
2743 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
2747 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
2749 gdb_assert (gdbarch
!= NULL
);
2750 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2751 if (gdbarch_debug
>= 2)
2752 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
2753 return gdbarch
->cannot_step_breakpoint
;
2757 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
2758 int cannot_step_breakpoint
)
2760 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
2764 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
2766 gdb_assert (gdbarch
!= NULL
);
2767 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2768 if (gdbarch_debug
>= 2)
2769 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
2770 return gdbarch
->have_nonsteppable_watchpoint
;
2774 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
2775 int have_nonsteppable_watchpoint
)
2777 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
2781 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
2783 gdb_assert (gdbarch
!= NULL
);
2784 return gdbarch
->address_class_type_flags
!= NULL
;
2788 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
2790 gdb_assert (gdbarch
!= NULL
);
2791 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
2792 if (gdbarch_debug
>= 2)
2793 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
2794 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
2798 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
2799 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
2801 gdbarch
->address_class_type_flags
= address_class_type_flags
;
2805 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
2807 gdb_assert (gdbarch
!= NULL
);
2808 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
2812 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
2814 gdb_assert (gdbarch
!= NULL
);
2815 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
2816 if (gdbarch_debug
>= 2)
2817 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
2818 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
2822 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
2823 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
2825 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
2829 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
2831 gdb_assert (gdbarch
!= NULL
);
2832 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
2836 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
2838 gdb_assert (gdbarch
!= NULL
);
2839 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
2840 if (gdbarch_debug
>= 2)
2841 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
2842 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
2846 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
2847 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
2849 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
2853 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
2855 gdb_assert (gdbarch
!= NULL
);
2856 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
2857 if (gdbarch_debug
>= 2)
2858 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
2859 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
2863 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
2864 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
2866 gdbarch
->register_reggroup_p
= register_reggroup_p
;
2870 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
2872 gdb_assert (gdbarch
!= NULL
);
2873 return gdbarch
->fetch_pointer_argument
!= NULL
;
2877 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
2879 gdb_assert (gdbarch
!= NULL
);
2880 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
2881 if (gdbarch_debug
>= 2)
2882 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
2883 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
2887 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
2888 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
2890 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
2894 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
2896 gdb_assert (gdbarch
!= NULL
);
2897 return gdbarch
->regset_from_core_section
!= NULL
;
2900 const struct regset
*
2901 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
2903 gdb_assert (gdbarch
!= NULL
);
2904 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
2905 if (gdbarch_debug
>= 2)
2906 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
2907 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
2911 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
2912 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
2914 gdbarch
->regset_from_core_section
= regset_from_core_section
;
2918 gdbarch_core_reg_section_encodes_pid (struct gdbarch
*gdbarch
)
2920 gdb_assert (gdbarch
!= NULL
);
2921 /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
2922 if (gdbarch_debug
>= 2)
2923 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_reg_section_encodes_pid called\n");
2924 return gdbarch
->core_reg_section_encodes_pid
;
2928 set_gdbarch_core_reg_section_encodes_pid (struct gdbarch
*gdbarch
,
2929 int core_reg_section_encodes_pid
)
2931 gdbarch
->core_reg_section_encodes_pid
= core_reg_section_encodes_pid
;
2934 struct core_regset_section
*
2935 gdbarch_core_regset_sections (struct gdbarch
*gdbarch
)
2937 gdb_assert (gdbarch
!= NULL
);
2938 if (gdbarch_debug
>= 2)
2939 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_regset_sections called\n");
2940 return gdbarch
->core_regset_sections
;
2944 set_gdbarch_core_regset_sections (struct gdbarch
*gdbarch
,
2945 struct core_regset_section
* core_regset_sections
)
2947 gdbarch
->core_regset_sections
= core_regset_sections
;
2951 gdbarch_core_xfer_shared_libraries_p (struct gdbarch
*gdbarch
)
2953 gdb_assert (gdbarch
!= NULL
);
2954 return gdbarch
->core_xfer_shared_libraries
!= NULL
;
2958 gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
, gdb_byte
*readbuf
, ULONGEST offset
, LONGEST len
)
2960 gdb_assert (gdbarch
!= NULL
);
2961 gdb_assert (gdbarch
->core_xfer_shared_libraries
!= NULL
);
2962 if (gdbarch_debug
>= 2)
2963 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_xfer_shared_libraries called\n");
2964 return gdbarch
->core_xfer_shared_libraries (gdbarch
, readbuf
, offset
, len
);
2968 set_gdbarch_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
2969 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries
)
2971 gdbarch
->core_xfer_shared_libraries
= core_xfer_shared_libraries
;
2975 gdbarch_core_pid_to_str_p (struct gdbarch
*gdbarch
)
2977 gdb_assert (gdbarch
!= NULL
);
2978 return gdbarch
->core_pid_to_str
!= NULL
;
2982 gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
, ptid_t ptid
)
2984 gdb_assert (gdbarch
!= NULL
);
2985 gdb_assert (gdbarch
->core_pid_to_str
!= NULL
);
2986 if (gdbarch_debug
>= 2)
2987 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_pid_to_str called\n");
2988 return gdbarch
->core_pid_to_str (gdbarch
, ptid
);
2992 set_gdbarch_core_pid_to_str (struct gdbarch
*gdbarch
,
2993 gdbarch_core_pid_to_str_ftype core_pid_to_str
)
2995 gdbarch
->core_pid_to_str
= core_pid_to_str
;
2999 gdbarch_gcore_bfd_target_p (struct gdbarch
*gdbarch
)
3001 gdb_assert (gdbarch
!= NULL
);
3002 return gdbarch
->gcore_bfd_target
!= 0;
3006 gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
)
3008 gdb_assert (gdbarch
!= NULL
);
3009 /* Check variable changed from pre-default. */
3010 gdb_assert (gdbarch
->gcore_bfd_target
!= 0);
3011 if (gdbarch_debug
>= 2)
3012 fprintf_unfiltered (gdb_stdlog
, "gdbarch_gcore_bfd_target called\n");
3013 return gdbarch
->gcore_bfd_target
;
3017 set_gdbarch_gcore_bfd_target (struct gdbarch
*gdbarch
,
3018 const char * gcore_bfd_target
)
3020 gdbarch
->gcore_bfd_target
= gcore_bfd_target
;
3024 gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
)
3026 gdb_assert (gdbarch
!= NULL
);
3027 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3028 if (gdbarch_debug
>= 2)
3029 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vtable_function_descriptors called\n");
3030 return gdbarch
->vtable_function_descriptors
;
3034 set_gdbarch_vtable_function_descriptors (struct gdbarch
*gdbarch
,
3035 int vtable_function_descriptors
)
3037 gdbarch
->vtable_function_descriptors
= vtable_function_descriptors
;
3041 gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
)
3043 gdb_assert (gdbarch
!= NULL
);
3044 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3045 if (gdbarch_debug
>= 2)
3046 fprintf_unfiltered (gdb_stdlog
, "gdbarch_vbit_in_delta called\n");
3047 return gdbarch
->vbit_in_delta
;
3051 set_gdbarch_vbit_in_delta (struct gdbarch
*gdbarch
,
3054 gdbarch
->vbit_in_delta
= vbit_in_delta
;
3058 gdbarch_skip_permanent_breakpoint_p (struct gdbarch
*gdbarch
)
3060 gdb_assert (gdbarch
!= NULL
);
3061 return gdbarch
->skip_permanent_breakpoint
!= NULL
;
3065 gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
3067 gdb_assert (gdbarch
!= NULL
);
3068 gdb_assert (gdbarch
->skip_permanent_breakpoint
!= NULL
);
3069 if (gdbarch_debug
>= 2)
3070 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_permanent_breakpoint called\n");
3071 gdbarch
->skip_permanent_breakpoint (regcache
);
3075 set_gdbarch_skip_permanent_breakpoint (struct gdbarch
*gdbarch
,
3076 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint
)
3078 gdbarch
->skip_permanent_breakpoint
= skip_permanent_breakpoint
;
3082 gdbarch_max_insn_length_p (struct gdbarch
*gdbarch
)
3084 gdb_assert (gdbarch
!= NULL
);
3085 return gdbarch
->max_insn_length
!= 0;
3089 gdbarch_max_insn_length (struct gdbarch
*gdbarch
)
3091 gdb_assert (gdbarch
!= NULL
);
3092 /* Check variable changed from pre-default. */
3093 gdb_assert (gdbarch
->max_insn_length
!= 0);
3094 if (gdbarch_debug
>= 2)
3095 fprintf_unfiltered (gdb_stdlog
, "gdbarch_max_insn_length called\n");
3096 return gdbarch
->max_insn_length
;
3100 set_gdbarch_max_insn_length (struct gdbarch
*gdbarch
,
3101 ULONGEST max_insn_length
)
3103 gdbarch
->max_insn_length
= max_insn_length
;
3107 gdbarch_displaced_step_copy_insn_p (struct gdbarch
*gdbarch
)
3109 gdb_assert (gdbarch
!= NULL
);
3110 return gdbarch
->displaced_step_copy_insn
!= NULL
;
3113 struct displaced_step_closure
*
3114 gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3116 gdb_assert (gdbarch
!= NULL
);
3117 gdb_assert (gdbarch
->displaced_step_copy_insn
!= NULL
);
3118 if (gdbarch_debug
>= 2)
3119 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_copy_insn called\n");
3120 return gdbarch
->displaced_step_copy_insn (gdbarch
, from
, to
, regs
);
3124 set_gdbarch_displaced_step_copy_insn (struct gdbarch
*gdbarch
,
3125 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn
)
3127 gdbarch
->displaced_step_copy_insn
= displaced_step_copy_insn
;
3131 gdbarch_displaced_step_fixup_p (struct gdbarch
*gdbarch
)
3133 gdb_assert (gdbarch
!= NULL
);
3134 return gdbarch
->displaced_step_fixup
!= NULL
;
3138 gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
, CORE_ADDR from
, CORE_ADDR to
, struct regcache
*regs
)
3140 gdb_assert (gdbarch
!= NULL
);
3141 gdb_assert (gdbarch
->displaced_step_fixup
!= NULL
);
3142 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3143 if (gdbarch_debug
>= 2)
3144 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_fixup called\n");
3145 gdbarch
->displaced_step_fixup (gdbarch
, closure
, from
, to
, regs
);
3149 set_gdbarch_displaced_step_fixup (struct gdbarch
*gdbarch
,
3150 gdbarch_displaced_step_fixup_ftype displaced_step_fixup
)
3152 gdbarch
->displaced_step_fixup
= displaced_step_fixup
;
3156 gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
, struct displaced_step_closure
*closure
)
3158 gdb_assert (gdbarch
!= NULL
);
3159 gdb_assert (gdbarch
->displaced_step_free_closure
!= NULL
);
3160 if (gdbarch_debug
>= 2)
3161 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_free_closure called\n");
3162 gdbarch
->displaced_step_free_closure (gdbarch
, closure
);
3166 set_gdbarch_displaced_step_free_closure (struct gdbarch
*gdbarch
,
3167 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure
)
3169 gdbarch
->displaced_step_free_closure
= displaced_step_free_closure
;
3173 gdbarch_displaced_step_location (struct gdbarch
*gdbarch
)
3175 gdb_assert (gdbarch
!= NULL
);
3176 gdb_assert (gdbarch
->displaced_step_location
!= NULL
);
3177 if (gdbarch_debug
>= 2)
3178 fprintf_unfiltered (gdb_stdlog
, "gdbarch_displaced_step_location called\n");
3179 return gdbarch
->displaced_step_location (gdbarch
);
3183 set_gdbarch_displaced_step_location (struct gdbarch
*gdbarch
,
3184 gdbarch_displaced_step_location_ftype displaced_step_location
)
3186 gdbarch
->displaced_step_location
= displaced_step_location
;
3190 gdbarch_overlay_update_p (struct gdbarch
*gdbarch
)
3192 gdb_assert (gdbarch
!= NULL
);
3193 return gdbarch
->overlay_update
!= NULL
;
3197 gdbarch_overlay_update (struct gdbarch
*gdbarch
, struct obj_section
*osect
)
3199 gdb_assert (gdbarch
!= NULL
);
3200 gdb_assert (gdbarch
->overlay_update
!= NULL
);
3201 if (gdbarch_debug
>= 2)
3202 fprintf_unfiltered (gdb_stdlog
, "gdbarch_overlay_update called\n");
3203 gdbarch
->overlay_update (osect
);
3207 set_gdbarch_overlay_update (struct gdbarch
*gdbarch
,
3208 gdbarch_overlay_update_ftype overlay_update
)
3210 gdbarch
->overlay_update
= overlay_update
;
3214 gdbarch_core_read_description_p (struct gdbarch
*gdbarch
)
3216 gdb_assert (gdbarch
!= NULL
);
3217 return gdbarch
->core_read_description
!= NULL
;
3220 const struct target_desc
*
3221 gdbarch_core_read_description (struct gdbarch
*gdbarch
, struct target_ops
*target
, bfd
*abfd
)
3223 gdb_assert (gdbarch
!= NULL
);
3224 gdb_assert (gdbarch
->core_read_description
!= NULL
);
3225 if (gdbarch_debug
>= 2)
3226 fprintf_unfiltered (gdb_stdlog
, "gdbarch_core_read_description called\n");
3227 return gdbarch
->core_read_description (gdbarch
, target
, abfd
);
3231 set_gdbarch_core_read_description (struct gdbarch
*gdbarch
,
3232 gdbarch_core_read_description_ftype core_read_description
)
3234 gdbarch
->core_read_description
= core_read_description
;
3238 gdbarch_static_transform_name_p (struct gdbarch
*gdbarch
)
3240 gdb_assert (gdbarch
!= NULL
);
3241 return gdbarch
->static_transform_name
!= NULL
;
3245 gdbarch_static_transform_name (struct gdbarch
*gdbarch
, char *name
)
3247 gdb_assert (gdbarch
!= NULL
);
3248 gdb_assert (gdbarch
->static_transform_name
!= NULL
);
3249 if (gdbarch_debug
>= 2)
3250 fprintf_unfiltered (gdb_stdlog
, "gdbarch_static_transform_name called\n");
3251 return gdbarch
->static_transform_name (name
);
3255 set_gdbarch_static_transform_name (struct gdbarch
*gdbarch
,
3256 gdbarch_static_transform_name_ftype static_transform_name
)
3258 gdbarch
->static_transform_name
= static_transform_name
;
3262 gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
)
3264 gdb_assert (gdbarch
!= NULL
);
3265 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3266 if (gdbarch_debug
>= 2)
3267 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sofun_address_maybe_missing called\n");
3268 return gdbarch
->sofun_address_maybe_missing
;
3272 set_gdbarch_sofun_address_maybe_missing (struct gdbarch
*gdbarch
,
3273 int sofun_address_maybe_missing
)
3275 gdbarch
->sofun_address_maybe_missing
= sofun_address_maybe_missing
;
3279 gdbarch_process_record_p (struct gdbarch
*gdbarch
)
3281 gdb_assert (gdbarch
!= NULL
);
3282 return gdbarch
->process_record
!= NULL
;
3286 gdbarch_process_record (struct gdbarch
*gdbarch
, struct regcache
*regcache
, CORE_ADDR addr
)
3288 gdb_assert (gdbarch
!= NULL
);
3289 gdb_assert (gdbarch
->process_record
!= NULL
);
3290 if (gdbarch_debug
>= 2)
3291 fprintf_unfiltered (gdb_stdlog
, "gdbarch_process_record called\n");
3292 return gdbarch
->process_record (gdbarch
, regcache
, addr
);
3296 set_gdbarch_process_record (struct gdbarch
*gdbarch
,
3297 gdbarch_process_record_ftype process_record
)
3299 gdbarch
->process_record
= process_record
;
3303 gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
, int signo
)
3305 gdb_assert (gdbarch
!= NULL
);
3306 gdb_assert (gdbarch
->target_signal_from_host
!= NULL
);
3307 if (gdbarch_debug
>= 2)
3308 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_from_host called\n");
3309 return gdbarch
->target_signal_from_host (gdbarch
, signo
);
3313 set_gdbarch_target_signal_from_host (struct gdbarch
*gdbarch
,
3314 gdbarch_target_signal_from_host_ftype target_signal_from_host
)
3316 gdbarch
->target_signal_from_host
= target_signal_from_host
;
3320 gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
, enum target_signal ts
)
3322 gdb_assert (gdbarch
!= NULL
);
3323 gdb_assert (gdbarch
->target_signal_to_host
!= NULL
);
3324 if (gdbarch_debug
>= 2)
3325 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_signal_to_host called\n");
3326 return gdbarch
->target_signal_to_host (gdbarch
, ts
);
3330 set_gdbarch_target_signal_to_host (struct gdbarch
*gdbarch
,
3331 gdbarch_target_signal_to_host_ftype target_signal_to_host
)
3333 gdbarch
->target_signal_to_host
= target_signal_to_host
;
3337 gdbarch_get_siginfo_type_p (struct gdbarch
*gdbarch
)
3339 gdb_assert (gdbarch
!= NULL
);
3340 return gdbarch
->get_siginfo_type
!= NULL
;
3344 gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
)
3346 gdb_assert (gdbarch
!= NULL
);
3347 gdb_assert (gdbarch
->get_siginfo_type
!= NULL
);
3348 if (gdbarch_debug
>= 2)
3349 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_siginfo_type called\n");
3350 return gdbarch
->get_siginfo_type (gdbarch
);
3354 set_gdbarch_get_siginfo_type (struct gdbarch
*gdbarch
,
3355 gdbarch_get_siginfo_type_ftype get_siginfo_type
)
3357 gdbarch
->get_siginfo_type
= get_siginfo_type
;
3361 gdbarch_record_special_symbol_p (struct gdbarch
*gdbarch
)
3363 gdb_assert (gdbarch
!= NULL
);
3364 return gdbarch
->record_special_symbol
!= NULL
;
3368 gdbarch_record_special_symbol (struct gdbarch
*gdbarch
, struct objfile
*objfile
, asymbol
*sym
)
3370 gdb_assert (gdbarch
!= NULL
);
3371 gdb_assert (gdbarch
->record_special_symbol
!= NULL
);
3372 if (gdbarch_debug
>= 2)
3373 fprintf_unfiltered (gdb_stdlog
, "gdbarch_record_special_symbol called\n");
3374 gdbarch
->record_special_symbol (gdbarch
, objfile
, sym
);
3378 set_gdbarch_record_special_symbol (struct gdbarch
*gdbarch
,
3379 gdbarch_record_special_symbol_ftype record_special_symbol
)
3381 gdbarch
->record_special_symbol
= record_special_symbol
;
3385 gdbarch_has_global_solist (struct gdbarch
*gdbarch
)
3387 gdb_assert (gdbarch
!= NULL
);
3388 /* Skip verify of has_global_solist, invalid_p == 0 */
3389 if (gdbarch_debug
>= 2)
3390 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_solist called\n");
3391 return gdbarch
->has_global_solist
;
3395 set_gdbarch_has_global_solist (struct gdbarch
*gdbarch
,
3396 int has_global_solist
)
3398 gdbarch
->has_global_solist
= has_global_solist
;
3402 gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
)
3404 gdb_assert (gdbarch
!= NULL
);
3405 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
3406 if (gdbarch_debug
>= 2)
3407 fprintf_unfiltered (gdb_stdlog
, "gdbarch_has_global_breakpoints called\n");
3408 return gdbarch
->has_global_breakpoints
;
3412 set_gdbarch_has_global_breakpoints (struct gdbarch
*gdbarch
,
3413 int has_global_breakpoints
)
3415 gdbarch
->has_global_breakpoints
= has_global_breakpoints
;
3419 /* Keep a registry of per-architecture data-pointers required by GDB
3426 gdbarch_data_pre_init_ftype
*pre_init
;
3427 gdbarch_data_post_init_ftype
*post_init
;
3430 struct gdbarch_data_registration
3432 struct gdbarch_data
*data
;
3433 struct gdbarch_data_registration
*next
;
3436 struct gdbarch_data_registry
3439 struct gdbarch_data_registration
*registrations
;
3442 struct gdbarch_data_registry gdbarch_data_registry
=
3447 static struct gdbarch_data
*
3448 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3449 gdbarch_data_post_init_ftype
*post_init
)
3451 struct gdbarch_data_registration
**curr
;
3452 /* Append the new registraration. */
3453 for (curr
= &gdbarch_data_registry
.registrations
;
3455 curr
= &(*curr
)->next
);
3456 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3457 (*curr
)->next
= NULL
;
3458 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3459 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3460 (*curr
)->data
->pre_init
= pre_init
;
3461 (*curr
)->data
->post_init
= post_init
;
3462 (*curr
)->data
->init_p
= 1;
3463 return (*curr
)->data
;
3466 struct gdbarch_data
*
3467 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3469 return gdbarch_data_register (pre_init
, NULL
);
3472 struct gdbarch_data
*
3473 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3475 return gdbarch_data_register (NULL
, post_init
);
3478 /* Create/delete the gdbarch data vector. */
3481 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3483 gdb_assert (gdbarch
->data
== NULL
);
3484 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3485 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3488 /* Initialize the current value of the specified per-architecture
3492 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3493 struct gdbarch_data
*data
,
3496 gdb_assert (data
->index
< gdbarch
->nr_data
);
3497 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3498 gdb_assert (data
->pre_init
== NULL
);
3499 gdbarch
->data
[data
->index
] = pointer
;
3502 /* Return the current value of the specified per-architecture
3506 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3508 gdb_assert (data
->index
< gdbarch
->nr_data
);
3509 if (gdbarch
->data
[data
->index
] == NULL
)
3511 /* The data-pointer isn't initialized, call init() to get a
3513 if (data
->pre_init
!= NULL
)
3514 /* Mid architecture creation: pass just the obstack, and not
3515 the entire architecture, as that way it isn't possible for
3516 pre-init code to refer to undefined architecture
3518 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3519 else if (gdbarch
->initialized_p
3520 && data
->post_init
!= NULL
)
3521 /* Post architecture creation: pass the entire architecture
3522 (as all fields are valid), but be careful to also detect
3523 recursive references. */
3525 gdb_assert (data
->init_p
);
3527 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3531 /* The architecture initialization hasn't completed - punt -
3532 hope that the caller knows what they are doing. Once
3533 deprecated_set_gdbarch_data has been initialized, this can be
3534 changed to an internal error. */
3536 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3538 return gdbarch
->data
[data
->index
];
3542 /* Keep a registry of the architectures known by GDB. */
3544 struct gdbarch_registration
3546 enum bfd_architecture bfd_architecture
;
3547 gdbarch_init_ftype
*init
;
3548 gdbarch_dump_tdep_ftype
*dump_tdep
;
3549 struct gdbarch_list
*arches
;
3550 struct gdbarch_registration
*next
;
3553 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3556 append_name (const char ***buf
, int *nr
, const char *name
)
3558 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3564 gdbarch_printable_names (void)
3566 /* Accumulate a list of names based on the registed list of
3568 enum bfd_architecture a
;
3570 const char **arches
= NULL
;
3571 struct gdbarch_registration
*rego
;
3572 for (rego
= gdbarch_registry
;
3576 const struct bfd_arch_info
*ap
;
3577 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3579 internal_error (__FILE__
, __LINE__
,
3580 _("gdbarch_architecture_names: multi-arch unknown"));
3583 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3588 append_name (&arches
, &nr_arches
, NULL
);
3594 gdbarch_register (enum bfd_architecture bfd_architecture
,
3595 gdbarch_init_ftype
*init
,
3596 gdbarch_dump_tdep_ftype
*dump_tdep
)
3598 struct gdbarch_registration
**curr
;
3599 const struct bfd_arch_info
*bfd_arch_info
;
3600 /* Check that BFD recognizes this architecture */
3601 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3602 if (bfd_arch_info
== NULL
)
3604 internal_error (__FILE__
, __LINE__
,
3605 _("gdbarch: Attempt to register unknown architecture (%d)"),
3608 /* Check that we haven't seen this architecture before */
3609 for (curr
= &gdbarch_registry
;
3611 curr
= &(*curr
)->next
)
3613 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3614 internal_error (__FILE__
, __LINE__
,
3615 _("gdbarch: Duplicate registraration of architecture (%s)"),
3616 bfd_arch_info
->printable_name
);
3620 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, %s)\n",
3621 bfd_arch_info
->printable_name
,
3622 host_address_to_string (init
));
3624 (*curr
) = XMALLOC (struct gdbarch_registration
);
3625 (*curr
)->bfd_architecture
= bfd_architecture
;
3626 (*curr
)->init
= init
;
3627 (*curr
)->dump_tdep
= dump_tdep
;
3628 (*curr
)->arches
= NULL
;
3629 (*curr
)->next
= NULL
;
3633 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3634 gdbarch_init_ftype
*init
)
3636 gdbarch_register (bfd_architecture
, init
, NULL
);
3640 /* Look for an architecture using gdbarch_info. */
3642 struct gdbarch_list
*
3643 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3644 const struct gdbarch_info
*info
)
3646 for (; arches
!= NULL
; arches
= arches
->next
)
3648 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3650 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
3652 if (info
->osabi
!= arches
->gdbarch
->osabi
)
3654 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
3662 /* Find an architecture that matches the specified INFO. Create a new
3663 architecture if needed. Return that new architecture. Assumes
3664 that there is no current architecture. */
3666 static struct gdbarch
*
3667 find_arch_by_info (struct gdbarch_info info
)
3669 struct gdbarch
*new_gdbarch
;
3670 struct gdbarch_registration
*rego
;
3672 /* The existing architecture has been swapped out - all this code
3673 works from a clean slate. */
3674 gdb_assert (current_gdbarch
== NULL
);
3676 /* Fill in missing parts of the INFO struct using a number of
3677 sources: "set ..."; INFOabfd supplied; and the global
3679 gdbarch_info_fill (&info
);
3681 /* Must have found some sort of architecture. */
3682 gdb_assert (info
.bfd_arch_info
!= NULL
);
3686 fprintf_unfiltered (gdb_stdlog
,
3687 "find_arch_by_info: info.bfd_arch_info %s\n",
3688 (info
.bfd_arch_info
!= NULL
3689 ? info
.bfd_arch_info
->printable_name
3691 fprintf_unfiltered (gdb_stdlog
,
3692 "find_arch_by_info: info.byte_order %d (%s)\n",
3694 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
3695 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
3697 fprintf_unfiltered (gdb_stdlog
,
3698 "find_arch_by_info: info.osabi %d (%s)\n",
3699 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
3700 fprintf_unfiltered (gdb_stdlog
,
3701 "find_arch_by_info: info.abfd %s\n",
3702 host_address_to_string (info
.abfd
));
3703 fprintf_unfiltered (gdb_stdlog
,
3704 "find_arch_by_info: info.tdep_info %s\n",
3705 host_address_to_string (info
.tdep_info
));
3708 /* Find the tdep code that knows about this architecture. */
3709 for (rego
= gdbarch_registry
;
3712 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
3717 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3718 "No matching architecture\n");
3722 /* Ask the tdep code for an architecture that matches "info". */
3723 new_gdbarch
= rego
->init (info
, rego
->arches
);
3725 /* Did the tdep code like it? No. Reject the change and revert to
3726 the old architecture. */
3727 if (new_gdbarch
== NULL
)
3730 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3731 "Target rejected architecture\n");
3735 /* Is this a pre-existing architecture (as determined by already
3736 being initialized)? Move it to the front of the architecture
3737 list (keeping the list sorted Most Recently Used). */
3738 if (new_gdbarch
->initialized_p
)
3740 struct gdbarch_list
**list
;
3741 struct gdbarch_list
*this;
3743 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3744 "Previous architecture %s (%s) selected\n",
3745 host_address_to_string (new_gdbarch
),
3746 new_gdbarch
->bfd_arch_info
->printable_name
);
3747 /* Find the existing arch in the list. */
3748 for (list
= ®o
->arches
;
3749 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
3750 list
= &(*list
)->next
);
3751 /* It had better be in the list of architectures. */
3752 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
3755 (*list
) = this->next
;
3756 /* Insert THIS at the front. */
3757 this->next
= rego
->arches
;
3758 rego
->arches
= this;
3763 /* It's a new architecture. */
3765 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
3766 "New architecture %s (%s) selected\n",
3767 host_address_to_string (new_gdbarch
),
3768 new_gdbarch
->bfd_arch_info
->printable_name
);
3770 /* Insert the new architecture into the front of the architecture
3771 list (keep the list sorted Most Recently Used). */
3773 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
3774 this->next
= rego
->arches
;
3775 this->gdbarch
= new_gdbarch
;
3776 rego
->arches
= this;
3779 /* Check that the newly installed architecture is valid. Plug in
3780 any post init values. */
3781 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
3782 verify_gdbarch (new_gdbarch
);
3783 new_gdbarch
->initialized_p
= 1;
3786 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
3792 gdbarch_find_by_info (struct gdbarch_info info
)
3794 struct gdbarch
*new_gdbarch
;
3796 /* Save the previously selected architecture, setting the global to
3797 NULL. This stops things like gdbarch->init() trying to use the
3798 previous architecture's configuration. The previous architecture
3799 may not even be of the same architecture family. The most recent
3800 architecture of the same family is found at the head of the
3801 rego->arches list. */
3802 struct gdbarch
*old_gdbarch
= current_gdbarch
;
3803 current_gdbarch
= NULL
;
3805 /* Find the specified architecture. */
3806 new_gdbarch
= find_arch_by_info (info
);
3808 /* Restore the existing architecture. */
3809 gdb_assert (current_gdbarch
== NULL
);
3810 current_gdbarch
= old_gdbarch
;
3815 /* Make the specified architecture current. */
3818 deprecated_current_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
3820 gdb_assert (new_gdbarch
!= NULL
);
3821 gdb_assert (current_gdbarch
!= NULL
);
3822 gdb_assert (new_gdbarch
->initialized_p
);
3823 current_gdbarch
= new_gdbarch
;
3824 target_gdbarch
= new_gdbarch
;
3825 observer_notify_architecture_changed (new_gdbarch
);
3826 registers_changed ();
3829 extern void _initialize_gdbarch (void);
3832 _initialize_gdbarch (void)
3834 struct cmd_list_element
*c
;
3836 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
3837 Set architecture debugging."), _("\
3838 Show architecture debugging."), _("\
3839 When non-zero, architecture debugging is enabled."),
3842 &setdebuglist
, &showdebuglist
);