1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 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 2 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, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA. */
25 /* This file was created with the aid of ``gdbarch.sh''.
27 The Bourne shell script ``gdbarch.sh'' creates the files
28 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
29 against the existing ``gdbarch.[hc]''. Any differences found
32 If editing this file, please also run gdbarch.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdbarch.sh and using its output may prove
39 #include "arch-utils.h"
45 #include "floatformat.h"
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
52 #include "gdb_obstack.h"
54 /* Static function declarations */
56 static void alloc_gdbarch_data (struct gdbarch *);
58 /* Non-zero if we want to trace architecture code. */
61 #define GDBARCH_DEBUG 0
63 int gdbarch_debug = GDBARCH_DEBUG;
65 show_gdbarch_debug (struct ui_file *file, int from_tty,
66 struct cmd_list_element *c, const char *value)
68 fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
72 pformat (const struct floatformat **format)
77 /* Just print out one of them - this is only for diagnostics. */
78 return format[0]->name;
82 /* Maintain the struct gdbarch object */
86 /* Has this architecture been fully initialized? */
89 /* An obstack bound to the lifetime of the architecture. */
90 struct obstack *obstack;
92 /* basic architectural information */
93 const struct bfd_arch_info * bfd_arch_info;
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).
140 const struct floatformat ** float_format;
142 const struct floatformat ** double_format;
144 const struct floatformat ** long_double_format;
148 gdbarch_read_pc_ftype *read_pc;
149 gdbarch_write_pc_ftype *write_pc;
150 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
151 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
152 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
159 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
160 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
161 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_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_unwind_dummy_id_ftype *unwind_dummy_id;
167 int deprecated_fp_regnum;
168 gdbarch_push_dummy_call_ftype *push_dummy_call;
169 int deprecated_register_size;
170 int call_dummy_location;
171 gdbarch_push_dummy_code_ftype *push_dummy_code;
172 gdbarch_print_registers_info_ftype *print_registers_info;
173 gdbarch_print_float_info_ftype *print_float_info;
174 gdbarch_print_vector_info_ftype *print_vector_info;
175 gdbarch_register_sim_regno_ftype *register_sim_regno;
176 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
177 gdbarch_cannot_store_register_ftype *cannot_store_register;
178 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
179 int believe_pcc_promotion;
180 gdbarch_convert_register_p_ftype *convert_register_p;
181 gdbarch_register_to_value_ftype *register_to_value;
182 gdbarch_value_to_register_ftype *value_to_register;
183 gdbarch_value_from_register_ftype *value_from_register;
184 gdbarch_pointer_to_address_ftype *pointer_to_address;
185 gdbarch_address_to_pointer_ftype *address_to_pointer;
186 gdbarch_integer_to_address_ftype *integer_to_address;
187 gdbarch_return_value_ftype *return_value;
188 gdbarch_extract_return_value_ftype *extract_return_value;
189 gdbarch_store_return_value_ftype *store_return_value;
190 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
191 gdbarch_skip_prologue_ftype *skip_prologue;
192 gdbarch_inner_than_ftype *inner_than;
193 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
194 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
195 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
196 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
197 CORE_ADDR decr_pc_after_break;
198 CORE_ADDR deprecated_function_start_offset;
199 gdbarch_remote_register_number_ftype *remote_register_number;
200 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
201 CORE_ADDR frame_args_skip;
202 gdbarch_unwind_pc_ftype *unwind_pc;
203 gdbarch_unwind_sp_ftype *unwind_sp;
204 gdbarch_frame_num_args_ftype *frame_num_args;
205 gdbarch_frame_align_ftype *frame_align;
206 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
207 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
208 int frame_red_zone_size;
209 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
210 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
211 gdbarch_smash_text_address_ftype *smash_text_address;
212 gdbarch_software_single_step_ftype *software_single_step;
213 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
214 gdbarch_print_insn_ftype *print_insn;
215 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
216 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
217 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
218 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
219 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
220 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
221 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
222 const char * name_of_malloc;
223 int cannot_step_breakpoint;
224 int have_nonsteppable_watchpoint;
225 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
226 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
227 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
228 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
229 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
230 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
231 int vtable_function_descriptors;
233 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
234 gdbarch_overlay_update_ftype *overlay_update;
238 /* The default architecture uses host values (for want of a better
241 extern const struct bfd_arch_info bfd_default_arch_struct;
243 struct gdbarch startup_gdbarch =
245 1, /* Always initialized. */
246 NULL, /* The obstack. */
247 /* basic architecture information */
248 &bfd_default_arch_struct, /* bfd_arch_info */
249 BFD_ENDIAN_BIG, /* byte_order */
250 GDB_OSABI_UNKNOWN, /* osabi */
252 /* target specific vector and its dump routine */
254 /*per-architecture data-pointers and swap regions */
256 /* Multi-arch values */
257 8 * sizeof (short), /* short_bit */
258 8 * sizeof (int), /* int_bit */
259 8 * sizeof (long), /* long_bit */
260 8 * sizeof (LONGEST), /* long_long_bit */
261 8 * sizeof (float), /* float_bit */
262 0, /* float_format */
263 8 * sizeof (double), /* double_bit */
264 0, /* double_format */
265 8 * sizeof (long double), /* long_double_bit */
266 0, /* long_double_format */
267 8 * sizeof (void*), /* ptr_bit */
268 8 * sizeof (void*), /* addr_bit */
272 0, /* virtual_frame_pointer */
273 0, /* pseudo_register_read */
274 0, /* pseudo_register_write */
276 0, /* num_pseudo_regs */
281 0, /* stab_reg_to_regnum */
282 0, /* ecoff_reg_to_regnum */
283 0, /* dwarf_reg_to_regnum */
284 0, /* sdb_reg_to_regnum */
285 0, /* dwarf2_reg_to_regnum */
286 0, /* register_name */
287 0, /* register_type */
288 0, /* unwind_dummy_id */
289 -1, /* deprecated_fp_regnum */
290 0, /* push_dummy_call */
291 0, /* deprecated_register_size */
292 0, /* call_dummy_location */
293 0, /* push_dummy_code */
294 default_print_registers_info, /* print_registers_info */
295 0, /* print_float_info */
296 0, /* print_vector_info */
297 0, /* register_sim_regno */
298 0, /* cannot_fetch_register */
299 0, /* cannot_store_register */
300 0, /* get_longjmp_target */
301 0, /* believe_pcc_promotion */
302 0, /* convert_register_p */
303 0, /* register_to_value */
304 0, /* value_to_register */
305 0, /* value_from_register */
306 0, /* pointer_to_address */
307 0, /* address_to_pointer */
308 0, /* integer_to_address */
309 0, /* return_value */
310 0, /* extract_return_value */
311 0, /* store_return_value */
312 0, /* deprecated_use_struct_convention */
313 0, /* skip_prologue */
315 0, /* breakpoint_from_pc */
316 0, /* adjust_breakpoint_address */
317 0, /* memory_insert_breakpoint */
318 0, /* memory_remove_breakpoint */
319 0, /* decr_pc_after_break */
320 0, /* deprecated_function_start_offset */
321 default_remote_register_number, /* remote_register_number */
322 0, /* fetch_tls_load_module_address */
323 0, /* frame_args_skip */
326 0, /* frame_num_args */
328 0, /* deprecated_reg_struct_has_addr */
329 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
330 0, /* frame_red_zone_size */
331 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
332 0, /* addr_bits_remove */
333 0, /* smash_text_address */
334 0, /* software_single_step */
335 0, /* single_step_through_delay */
337 0, /* skip_trampoline_code */
338 generic_skip_solib_resolver, /* skip_solib_resolver */
339 0, /* in_solib_return_trampoline */
340 generic_in_function_epilogue_p, /* in_function_epilogue_p */
341 construct_inferior_arguments, /* construct_inferior_arguments */
342 0, /* elf_make_msymbol_special */
343 0, /* coff_make_msymbol_special */
344 "malloc", /* name_of_malloc */
345 0, /* cannot_step_breakpoint */
346 0, /* have_nonsteppable_watchpoint */
347 0, /* address_class_type_flags */
348 0, /* address_class_type_flags_to_name */
349 0, /* address_class_name_to_type_flags */
350 default_register_reggroup_p, /* register_reggroup_p */
351 0, /* fetch_pointer_argument */
352 0, /* regset_from_core_section */
353 0, /* vtable_function_descriptors */
354 0, /* vbit_in_delta */
355 0, /* skip_permanent_breakpoint */
356 0, /* overlay_update */
357 /* startup_gdbarch() */
360 struct gdbarch *current_gdbarch = &startup_gdbarch;
362 /* Create a new ``struct gdbarch'' based on information provided by
363 ``struct gdbarch_info''. */
366 gdbarch_alloc (const struct gdbarch_info *info,
367 struct gdbarch_tdep *tdep)
369 /* NOTE: The new architecture variable is named ``current_gdbarch''
370 so that macros such as TARGET_ARCHITECTURE, when expanded, refer to
371 the current local architecture and not the previous global
372 architecture. This ensures that the new architectures initial
373 values are not influenced by the previous architecture. Once
374 everything is parameterised with gdbarch, this will go away. */
375 struct gdbarch *current_gdbarch;
377 /* Create an obstack for allocating all the per-architecture memory,
378 then use that to allocate the architecture vector. */
379 struct obstack *obstack = XMALLOC (struct obstack);
380 obstack_init (obstack);
381 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
382 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
383 current_gdbarch->obstack = obstack;
385 alloc_gdbarch_data (current_gdbarch);
387 current_gdbarch->tdep = tdep;
389 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
390 current_gdbarch->byte_order = info->byte_order;
391 current_gdbarch->osabi = info->osabi;
392 current_gdbarch->target_desc = info->target_desc;
394 /* Force the explicit initialization of these. */
395 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
396 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
397 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
398 current_gdbarch->long_long_bit = 2*current_gdbarch->long_bit;
399 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
400 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
401 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
402 current_gdbarch->ptr_bit = current_gdbarch->int_bit;
403 current_gdbarch->char_signed = -1;
404 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
405 current_gdbarch->num_regs = -1;
406 current_gdbarch->sp_regnum = -1;
407 current_gdbarch->pc_regnum = -1;
408 current_gdbarch->ps_regnum = -1;
409 current_gdbarch->fp0_regnum = -1;
410 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
411 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
412 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
413 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
414 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
415 current_gdbarch->deprecated_fp_regnum = -1;
416 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
417 current_gdbarch->print_registers_info = default_print_registers_info;
418 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
419 current_gdbarch->cannot_fetch_register = cannot_register_not;
420 current_gdbarch->cannot_store_register = cannot_register_not;
421 current_gdbarch->convert_register_p = generic_convert_register_p;
422 current_gdbarch->value_from_register = default_value_from_register;
423 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
424 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
425 current_gdbarch->return_value = legacy_return_value;
426 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
427 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
428 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
429 current_gdbarch->remote_register_number = default_remote_register_number;
430 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
431 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
432 current_gdbarch->addr_bits_remove = core_addr_identity;
433 current_gdbarch->smash_text_address = core_addr_identity;
434 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
435 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
436 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
437 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
438 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
439 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
440 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
441 current_gdbarch->name_of_malloc = "malloc";
442 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
443 /* gdbarch_alloc() */
445 return current_gdbarch;
449 /* Allocate extra space using the per-architecture obstack. */
452 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
454 void *data = obstack_alloc (arch->obstack, size);
455 memset (data, 0, size);
460 /* Free a gdbarch struct. This should never happen in normal
461 operation --- once you've created a gdbarch, you keep it around.
462 However, if an architecture's init function encounters an error
463 building the structure, it may need to clean up a partially
464 constructed gdbarch. */
467 gdbarch_free (struct gdbarch *arch)
469 struct obstack *obstack;
470 gdb_assert (arch != NULL);
471 gdb_assert (!arch->initialized_p);
472 obstack = arch->obstack;
473 obstack_free (obstack, 0); /* Includes the ARCH. */
478 /* Ensure that all values in a GDBARCH are reasonable. */
480 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
481 just happens to match the global variable ``current_gdbarch''. That
482 way macros refering to that variable get the local and not the global
483 version - ulgh. Once everything is parameterised with gdbarch, this
487 verify_gdbarch (struct gdbarch *current_gdbarch)
490 struct cleanup *cleanups;
493 log = mem_fileopen ();
494 cleanups = make_cleanup_ui_file_delete (log);
496 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
497 fprintf_unfiltered (log, "\n\tbyte-order");
498 if (current_gdbarch->bfd_arch_info == NULL)
499 fprintf_unfiltered (log, "\n\tbfd_arch_info");
500 /* Check those that need to be defined for the given multi-arch level. */
501 /* Skip verify of short_bit, invalid_p == 0 */
502 /* Skip verify of int_bit, invalid_p == 0 */
503 /* Skip verify of long_bit, invalid_p == 0 */
504 /* Skip verify of long_long_bit, invalid_p == 0 */
505 /* Skip verify of float_bit, invalid_p == 0 */
506 if (current_gdbarch->float_format == 0)
507 current_gdbarch->float_format = floatformats_ieee_single;
508 /* Skip verify of double_bit, invalid_p == 0 */
509 if (current_gdbarch->double_format == 0)
510 current_gdbarch->double_format = floatformats_ieee_double;
511 /* Skip verify of long_double_bit, invalid_p == 0 */
512 if (current_gdbarch->long_double_format == 0)
513 current_gdbarch->long_double_format = floatformats_ieee_double;
514 /* Skip verify of ptr_bit, invalid_p == 0 */
515 if (current_gdbarch->addr_bit == 0)
516 current_gdbarch->addr_bit = gdbarch_ptr_bit (current_gdbarch);
517 if (current_gdbarch->char_signed == -1)
518 current_gdbarch->char_signed = 1;
519 /* Skip verify of read_pc, has predicate */
520 /* Skip verify of write_pc, has predicate */
521 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
522 /* Skip verify of pseudo_register_read, has predicate */
523 /* Skip verify of pseudo_register_write, has predicate */
524 if (current_gdbarch->num_regs == -1)
525 fprintf_unfiltered (log, "\n\tnum_regs");
526 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
527 /* Skip verify of sp_regnum, invalid_p == 0 */
528 /* Skip verify of pc_regnum, invalid_p == 0 */
529 /* Skip verify of ps_regnum, invalid_p == 0 */
530 /* Skip verify of fp0_regnum, invalid_p == 0 */
531 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
532 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
533 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
534 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
535 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
536 /* Skip verify of register_type, has predicate */
537 /* Skip verify of unwind_dummy_id, has predicate */
538 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
539 /* Skip verify of push_dummy_call, has predicate */
540 /* Skip verify of call_dummy_location, invalid_p == 0 */
541 /* Skip verify of push_dummy_code, has predicate */
542 /* Skip verify of print_registers_info, invalid_p == 0 */
543 /* Skip verify of print_float_info, has predicate */
544 /* Skip verify of print_vector_info, has predicate */
545 /* Skip verify of register_sim_regno, invalid_p == 0 */
546 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
547 /* Skip verify of cannot_store_register, invalid_p == 0 */
548 /* Skip verify of get_longjmp_target, has predicate */
549 /* Skip verify of convert_register_p, invalid_p == 0 */
550 /* Skip verify of value_from_register, invalid_p == 0 */
551 /* Skip verify of pointer_to_address, invalid_p == 0 */
552 /* Skip verify of address_to_pointer, invalid_p == 0 */
553 /* Skip verify of integer_to_address, has predicate */
554 /* Skip verify of return_value, has predicate */
555 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
556 if (current_gdbarch->skip_prologue == 0)
557 fprintf_unfiltered (log, "\n\tskip_prologue");
558 if (current_gdbarch->inner_than == 0)
559 fprintf_unfiltered (log, "\n\tinner_than");
560 if (current_gdbarch->breakpoint_from_pc == 0)
561 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
562 /* Skip verify of adjust_breakpoint_address, has predicate */
563 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
564 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
565 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
566 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
567 /* Skip verify of remote_register_number, invalid_p == 0 */
568 /* Skip verify of fetch_tls_load_module_address, has predicate */
569 /* Skip verify of frame_args_skip, invalid_p == 0 */
570 /* Skip verify of unwind_pc, has predicate */
571 /* Skip verify of unwind_sp, has predicate */
572 /* Skip verify of frame_num_args, has predicate */
573 /* Skip verify of frame_align, has predicate */
574 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
575 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
576 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
577 /* Skip verify of addr_bits_remove, invalid_p == 0 */
578 /* Skip verify of smash_text_address, invalid_p == 0 */
579 /* Skip verify of software_single_step, has predicate */
580 /* Skip verify of single_step_through_delay, has predicate */
581 if (current_gdbarch->print_insn == 0)
582 fprintf_unfiltered (log, "\n\tprint_insn");
583 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
584 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
585 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
586 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
587 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
588 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
589 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
590 /* Skip verify of name_of_malloc, invalid_p == 0 */
591 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
592 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
593 /* Skip verify of address_class_type_flags, has predicate */
594 /* Skip verify of address_class_type_flags_to_name, has predicate */
595 /* Skip verify of address_class_name_to_type_flags, has predicate */
596 /* Skip verify of register_reggroup_p, invalid_p == 0 */
597 /* Skip verify of fetch_pointer_argument, has predicate */
598 /* Skip verify of regset_from_core_section, has predicate */
599 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
600 /* Skip verify of vbit_in_delta, invalid_p == 0 */
601 /* Skip verify of skip_permanent_breakpoint, has predicate */
602 /* Skip verify of overlay_update, has predicate */
603 buf = ui_file_xstrdup (log, &dummy);
604 make_cleanup (xfree, buf);
605 if (strlen (buf) > 0)
606 internal_error (__FILE__, __LINE__,
607 _("verify_gdbarch: the following are invalid ...%s"),
609 do_cleanups (cleanups);
613 /* Print out the details of the current architecture. */
615 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
616 just happens to match the global variable ``current_gdbarch''. That
617 way macros refering to that variable get the local and not the global
618 version - ulgh. Once everything is parameterised with gdbarch, this
622 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
624 const char *gdb_xm_file = "<not-defined>";
625 const char *gdb_nm_file = "<not-defined>";
626 const char *gdb_tm_file = "<not-defined>";
627 #if defined (GDB_XM_FILE)
628 gdb_xm_file = GDB_XM_FILE;
630 fprintf_unfiltered (file,
631 "gdbarch_dump: GDB_XM_FILE = %s\n",
633 #if defined (GDB_NM_FILE)
634 gdb_nm_file = GDB_NM_FILE;
636 fprintf_unfiltered (file,
637 "gdbarch_dump: GDB_NM_FILE = %s\n",
639 #if defined (GDB_TM_FILE)
640 gdb_tm_file = GDB_TM_FILE;
642 fprintf_unfiltered (file,
643 "gdbarch_dump: GDB_TM_FILE = %s\n",
645 fprintf_unfiltered (file,
646 "gdbarch_dump: addr_bit = %s\n",
647 paddr_d (current_gdbarch->addr_bit));
648 fprintf_unfiltered (file,
649 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
650 (long) current_gdbarch->addr_bits_remove);
651 fprintf_unfiltered (file,
652 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
653 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
654 fprintf_unfiltered (file,
655 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
656 (long) current_gdbarch->address_class_name_to_type_flags);
657 fprintf_unfiltered (file,
658 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
659 gdbarch_address_class_type_flags_p (current_gdbarch));
660 fprintf_unfiltered (file,
661 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
662 (long) current_gdbarch->address_class_type_flags);
663 fprintf_unfiltered (file,
664 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
665 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
666 fprintf_unfiltered (file,
667 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
668 (long) current_gdbarch->address_class_type_flags_to_name);
669 fprintf_unfiltered (file,
670 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
671 (long) current_gdbarch->address_to_pointer);
672 fprintf_unfiltered (file,
673 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
674 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
675 fprintf_unfiltered (file,
676 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
677 (long) current_gdbarch->adjust_breakpoint_address);
678 #ifdef BELIEVE_PCC_PROMOTION
679 fprintf_unfiltered (file,
680 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
681 XSTRING (BELIEVE_PCC_PROMOTION));
683 fprintf_unfiltered (file,
684 "gdbarch_dump: believe_pcc_promotion = %s\n",
685 paddr_d (current_gdbarch->believe_pcc_promotion));
686 fprintf_unfiltered (file,
687 "gdbarch_dump: bfd_arch_info = %s\n",
688 gdbarch_bfd_arch_info (current_gdbarch)->printable_name);
689 fprintf_unfiltered (file,
690 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
691 (long) current_gdbarch->breakpoint_from_pc);
692 fprintf_unfiltered (file,
693 "gdbarch_dump: byte_order = %s\n",
694 paddr_d (current_gdbarch->byte_order));
695 fprintf_unfiltered (file,
696 "gdbarch_dump: call_dummy_location = %s\n",
697 paddr_d (current_gdbarch->call_dummy_location));
698 fprintf_unfiltered (file,
699 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
700 (long) current_gdbarch->cannot_fetch_register);
701 fprintf_unfiltered (file,
702 "gdbarch_dump: cannot_step_breakpoint = %s\n",
703 paddr_d (current_gdbarch->cannot_step_breakpoint));
704 fprintf_unfiltered (file,
705 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
706 (long) current_gdbarch->cannot_store_register);
707 fprintf_unfiltered (file,
708 "gdbarch_dump: char_signed = %s\n",
709 paddr_d (current_gdbarch->char_signed));
710 fprintf_unfiltered (file,
711 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
712 (long) current_gdbarch->coff_make_msymbol_special);
713 fprintf_unfiltered (file,
714 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
715 (long) current_gdbarch->construct_inferior_arguments);
716 fprintf_unfiltered (file,
717 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
718 (long) current_gdbarch->convert_from_func_ptr_addr);
719 fprintf_unfiltered (file,
720 "gdbarch_dump: convert_register_p = <0x%lx>\n",
721 (long) current_gdbarch->convert_register_p);
722 fprintf_unfiltered (file,
723 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
724 paddr_nz (current_gdbarch->decr_pc_after_break));
725 #ifdef DEPRECATED_FP_REGNUM
726 fprintf_unfiltered (file,
727 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
728 XSTRING (DEPRECATED_FP_REGNUM));
730 fprintf_unfiltered (file,
731 "gdbarch_dump: deprecated_fp_regnum = %s\n",
732 paddr_d (current_gdbarch->deprecated_fp_regnum));
733 #ifdef DEPRECATED_FUNCTION_START_OFFSET
734 fprintf_unfiltered (file,
735 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
736 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
738 fprintf_unfiltered (file,
739 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
740 paddr_nz (current_gdbarch->deprecated_function_start_offset));
741 fprintf_unfiltered (file,
742 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
743 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
744 fprintf_unfiltered (file,
745 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
746 (long) current_gdbarch->deprecated_reg_struct_has_addr);
747 #ifdef DEPRECATED_REGISTER_SIZE
748 fprintf_unfiltered (file,
749 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
750 XSTRING (DEPRECATED_REGISTER_SIZE));
752 fprintf_unfiltered (file,
753 "gdbarch_dump: deprecated_register_size = %s\n",
754 paddr_d (current_gdbarch->deprecated_register_size));
755 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
756 fprintf_unfiltered (file,
757 "gdbarch_dump: %s # %s\n",
758 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
759 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
761 fprintf_unfiltered (file,
762 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
763 (long) current_gdbarch->deprecated_use_struct_convention);
764 fprintf_unfiltered (file,
765 "gdbarch_dump: double_bit = %s\n",
766 paddr_d (current_gdbarch->double_bit));
767 fprintf_unfiltered (file,
768 "gdbarch_dump: double_format = %s\n",
769 pformat (current_gdbarch->double_format));
770 fprintf_unfiltered (file,
771 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
772 (long) current_gdbarch->dwarf2_reg_to_regnum);
773 fprintf_unfiltered (file,
774 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
775 (long) current_gdbarch->dwarf_reg_to_regnum);
776 fprintf_unfiltered (file,
777 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
778 (long) current_gdbarch->ecoff_reg_to_regnum);
779 fprintf_unfiltered (file,
780 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
781 (long) current_gdbarch->elf_make_msymbol_special);
782 #ifdef EXTRACT_RETURN_VALUE
783 fprintf_unfiltered (file,
784 "gdbarch_dump: %s # %s\n",
785 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
786 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
788 fprintf_unfiltered (file,
789 "gdbarch_dump: extract_return_value = <0x%lx>\n",
790 (long) current_gdbarch->extract_return_value);
791 fprintf_unfiltered (file,
792 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
793 gdbarch_fetch_pointer_argument_p (current_gdbarch));
794 fprintf_unfiltered (file,
795 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
796 (long) current_gdbarch->fetch_pointer_argument);
797 fprintf_unfiltered (file,
798 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
799 gdbarch_fetch_tls_load_module_address_p (current_gdbarch));
800 fprintf_unfiltered (file,
801 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
802 (long) current_gdbarch->fetch_tls_load_module_address);
803 fprintf_unfiltered (file,
804 "gdbarch_dump: float_bit = %s\n",
805 paddr_d (current_gdbarch->float_bit));
806 fprintf_unfiltered (file,
807 "gdbarch_dump: float_format = %s\n",
808 pformat (current_gdbarch->float_format));
809 fprintf_unfiltered (file,
810 "gdbarch_dump: fp0_regnum = %s\n",
811 paddr_d (current_gdbarch->fp0_regnum));
812 fprintf_unfiltered (file,
813 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
814 gdbarch_frame_align_p (current_gdbarch));
815 fprintf_unfiltered (file,
816 "gdbarch_dump: frame_align = <0x%lx>\n",
817 (long) current_gdbarch->frame_align);
818 fprintf_unfiltered (file,
819 "gdbarch_dump: frame_args_skip = 0x%s\n",
820 paddr_nz (current_gdbarch->frame_args_skip));
821 fprintf_unfiltered (file,
822 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
823 gdbarch_frame_num_args_p (current_gdbarch));
824 fprintf_unfiltered (file,
825 "gdbarch_dump: frame_num_args = <0x%lx>\n",
826 (long) current_gdbarch->frame_num_args);
827 fprintf_unfiltered (file,
828 "gdbarch_dump: frame_red_zone_size = %s\n",
829 paddr_d (current_gdbarch->frame_red_zone_size));
830 fprintf_unfiltered (file,
831 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
832 gdbarch_get_longjmp_target_p (current_gdbarch));
833 fprintf_unfiltered (file,
834 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
835 (long) current_gdbarch->get_longjmp_target);
836 fprintf_unfiltered (file,
837 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
838 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
839 fprintf_unfiltered (file,
840 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
841 (long) current_gdbarch->in_function_epilogue_p);
842 fprintf_unfiltered (file,
843 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
844 (long) current_gdbarch->in_solib_return_trampoline);
845 fprintf_unfiltered (file,
846 "gdbarch_dump: inner_than = <0x%lx>\n",
847 (long) current_gdbarch->inner_than);
848 fprintf_unfiltered (file,
849 "gdbarch_dump: int_bit = %s\n",
850 paddr_d (current_gdbarch->int_bit));
851 fprintf_unfiltered (file,
852 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
853 gdbarch_integer_to_address_p (current_gdbarch));
854 fprintf_unfiltered (file,
855 "gdbarch_dump: integer_to_address = <0x%lx>\n",
856 (long) current_gdbarch->integer_to_address);
857 fprintf_unfiltered (file,
858 "gdbarch_dump: long_bit = %s\n",
859 paddr_d (current_gdbarch->long_bit));
860 fprintf_unfiltered (file,
861 "gdbarch_dump: long_double_bit = %s\n",
862 paddr_d (current_gdbarch->long_double_bit));
863 fprintf_unfiltered (file,
864 "gdbarch_dump: long_double_format = %s\n",
865 pformat (current_gdbarch->long_double_format));
866 fprintf_unfiltered (file,
867 "gdbarch_dump: long_long_bit = %s\n",
868 paddr_d (current_gdbarch->long_long_bit));
869 fprintf_unfiltered (file,
870 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
871 (long) current_gdbarch->memory_insert_breakpoint);
872 fprintf_unfiltered (file,
873 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
874 (long) current_gdbarch->memory_remove_breakpoint);
875 fprintf_unfiltered (file,
876 "gdbarch_dump: name_of_malloc = %s\n",
877 current_gdbarch->name_of_malloc);
878 fprintf_unfiltered (file,
879 "gdbarch_dump: num_pseudo_regs = %s\n",
880 paddr_d (current_gdbarch->num_pseudo_regs));
881 fprintf_unfiltered (file,
882 "gdbarch_dump: num_regs = %s\n",
883 paddr_d (current_gdbarch->num_regs));
884 fprintf_unfiltered (file,
885 "gdbarch_dump: osabi = %s\n",
886 paddr_d (current_gdbarch->osabi));
887 fprintf_unfiltered (file,
888 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
889 gdbarch_overlay_update_p (current_gdbarch));
890 fprintf_unfiltered (file,
891 "gdbarch_dump: overlay_update = <0x%lx>\n",
892 (long) current_gdbarch->overlay_update);
893 fprintf_unfiltered (file,
894 "gdbarch_dump: pc_regnum = %s\n",
895 paddr_d (current_gdbarch->pc_regnum));
896 fprintf_unfiltered (file,
897 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
898 (long) current_gdbarch->pointer_to_address);
899 fprintf_unfiltered (file,
900 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
901 gdbarch_print_float_info_p (current_gdbarch));
902 fprintf_unfiltered (file,
903 "gdbarch_dump: print_float_info = <0x%lx>\n",
904 (long) current_gdbarch->print_float_info);
905 #ifdef TARGET_PRINT_INSN
906 fprintf_unfiltered (file,
907 "gdbarch_dump: %s # %s\n",
908 "TARGET_PRINT_INSN(vma, info)",
909 XSTRING (TARGET_PRINT_INSN (vma, info)));
911 fprintf_unfiltered (file,
912 "gdbarch_dump: print_insn = <0x%lx>\n",
913 (long) current_gdbarch->print_insn);
914 fprintf_unfiltered (file,
915 "gdbarch_dump: print_registers_info = <0x%lx>\n",
916 (long) current_gdbarch->print_registers_info);
917 fprintf_unfiltered (file,
918 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
919 gdbarch_print_vector_info_p (current_gdbarch));
920 fprintf_unfiltered (file,
921 "gdbarch_dump: print_vector_info = <0x%lx>\n",
922 (long) current_gdbarch->print_vector_info);
923 fprintf_unfiltered (file,
924 "gdbarch_dump: ps_regnum = %s\n",
925 paddr_d (current_gdbarch->ps_regnum));
926 fprintf_unfiltered (file,
927 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
928 gdbarch_pseudo_register_read_p (current_gdbarch));
929 fprintf_unfiltered (file,
930 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
931 (long) current_gdbarch->pseudo_register_read);
932 fprintf_unfiltered (file,
933 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
934 gdbarch_pseudo_register_write_p (current_gdbarch));
935 fprintf_unfiltered (file,
936 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
937 (long) current_gdbarch->pseudo_register_write);
938 fprintf_unfiltered (file,
939 "gdbarch_dump: ptr_bit = %s\n",
940 paddr_d (current_gdbarch->ptr_bit));
941 fprintf_unfiltered (file,
942 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
943 gdbarch_push_dummy_call_p (current_gdbarch));
944 fprintf_unfiltered (file,
945 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
946 (long) current_gdbarch->push_dummy_call);
947 fprintf_unfiltered (file,
948 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
949 gdbarch_push_dummy_code_p (current_gdbarch));
950 fprintf_unfiltered (file,
951 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
952 (long) current_gdbarch->push_dummy_code);
953 fprintf_unfiltered (file,
954 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
955 gdbarch_read_pc_p (current_gdbarch));
956 fprintf_unfiltered (file,
957 "gdbarch_dump: read_pc = <0x%lx>\n",
958 (long) current_gdbarch->read_pc);
959 fprintf_unfiltered (file,
960 "gdbarch_dump: register_name = <0x%lx>\n",
961 (long) current_gdbarch->register_name);
962 fprintf_unfiltered (file,
963 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
964 (long) current_gdbarch->register_reggroup_p);
965 fprintf_unfiltered (file,
966 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
967 (long) current_gdbarch->register_sim_regno);
968 fprintf_unfiltered (file,
969 "gdbarch_dump: register_to_value = <0x%lx>\n",
970 (long) current_gdbarch->register_to_value);
971 fprintf_unfiltered (file,
972 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
973 gdbarch_register_type_p (current_gdbarch));
974 fprintf_unfiltered (file,
975 "gdbarch_dump: register_type = <0x%lx>\n",
976 (long) current_gdbarch->register_type);
977 fprintf_unfiltered (file,
978 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
979 gdbarch_regset_from_core_section_p (current_gdbarch));
980 fprintf_unfiltered (file,
981 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
982 (long) current_gdbarch->regset_from_core_section);
983 fprintf_unfiltered (file,
984 "gdbarch_dump: remote_register_number = <0x%lx>\n",
985 (long) current_gdbarch->remote_register_number);
986 fprintf_unfiltered (file,
987 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
988 gdbarch_return_value_p (current_gdbarch));
989 fprintf_unfiltered (file,
990 "gdbarch_dump: return_value = <0x%lx>\n",
991 (long) current_gdbarch->return_value);
992 fprintf_unfiltered (file,
993 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
994 (long) current_gdbarch->sdb_reg_to_regnum);
995 fprintf_unfiltered (file,
996 "gdbarch_dump: short_bit = %s\n",
997 paddr_d (current_gdbarch->short_bit));
998 fprintf_unfiltered (file,
999 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1000 gdbarch_single_step_through_delay_p (current_gdbarch));
1001 fprintf_unfiltered (file,
1002 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1003 (long) current_gdbarch->single_step_through_delay);
1004 fprintf_unfiltered (file,
1005 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1006 gdbarch_skip_permanent_breakpoint_p (current_gdbarch));
1007 fprintf_unfiltered (file,
1008 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1009 (long) current_gdbarch->skip_permanent_breakpoint);
1010 fprintf_unfiltered (file,
1011 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1012 (long) current_gdbarch->skip_prologue);
1013 fprintf_unfiltered (file,
1014 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1015 (long) current_gdbarch->skip_solib_resolver);
1016 fprintf_unfiltered (file,
1017 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1018 (long) current_gdbarch->skip_trampoline_code);
1019 fprintf_unfiltered (file,
1020 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1021 (long) current_gdbarch->smash_text_address);
1022 #ifdef SOFTWARE_SINGLE_STEP_P
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: %s # %s\n",
1025 "SOFTWARE_SINGLE_STEP_P()",
1026 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1028 fprintf_unfiltered (file,
1029 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1030 gdbarch_software_single_step_p (current_gdbarch));
1031 #ifdef SOFTWARE_SINGLE_STEP
1032 fprintf_unfiltered (file,
1033 "gdbarch_dump: %s # %s\n",
1034 "SOFTWARE_SINGLE_STEP(frame)",
1035 XSTRING (SOFTWARE_SINGLE_STEP (frame)));
1037 fprintf_unfiltered (file,
1038 "gdbarch_dump: software_single_step = <0x%lx>\n",
1039 (long) current_gdbarch->software_single_step);
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: sp_regnum = %s\n",
1042 paddr_d (current_gdbarch->sp_regnum));
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1045 (long) current_gdbarch->stab_reg_to_regnum);
1046 fprintf_unfiltered (file,
1047 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1048 (long) current_gdbarch->stabs_argument_has_addr);
1049 #ifdef STORE_RETURN_VALUE
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: %s # %s\n",
1052 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1053 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1055 fprintf_unfiltered (file,
1056 "gdbarch_dump: store_return_value = <0x%lx>\n",
1057 (long) current_gdbarch->store_return_value);
1058 fprintf_unfiltered (file,
1059 "gdbarch_dump: target_desc = %s\n",
1060 paddr_d ((long) current_gdbarch->target_desc));
1061 fprintf_unfiltered (file,
1062 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1063 gdbarch_unwind_dummy_id_p (current_gdbarch));
1064 fprintf_unfiltered (file,
1065 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1066 (long) current_gdbarch->unwind_dummy_id);
1067 fprintf_unfiltered (file,
1068 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1069 gdbarch_unwind_pc_p (current_gdbarch));
1070 fprintf_unfiltered (file,
1071 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1072 (long) current_gdbarch->unwind_pc);
1073 fprintf_unfiltered (file,
1074 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1075 gdbarch_unwind_sp_p (current_gdbarch));
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1078 (long) current_gdbarch->unwind_sp);
1079 fprintf_unfiltered (file,
1080 "gdbarch_dump: value_from_register = <0x%lx>\n",
1081 (long) current_gdbarch->value_from_register);
1082 fprintf_unfiltered (file,
1083 "gdbarch_dump: value_to_register = <0x%lx>\n",
1084 (long) current_gdbarch->value_to_register);
1085 fprintf_unfiltered (file,
1086 "gdbarch_dump: vbit_in_delta = %s\n",
1087 paddr_d (current_gdbarch->vbit_in_delta));
1088 fprintf_unfiltered (file,
1089 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1090 (long) current_gdbarch->virtual_frame_pointer);
1091 fprintf_unfiltered (file,
1092 "gdbarch_dump: vtable_function_descriptors = %s\n",
1093 paddr_d (current_gdbarch->vtable_function_descriptors));
1094 fprintf_unfiltered (file,
1095 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1096 gdbarch_write_pc_p (current_gdbarch));
1097 fprintf_unfiltered (file,
1098 "gdbarch_dump: write_pc = <0x%lx>\n",
1099 (long) current_gdbarch->write_pc);
1100 if (current_gdbarch->dump_tdep != NULL)
1101 current_gdbarch->dump_tdep (current_gdbarch, file);
1104 struct gdbarch_tdep *
1105 gdbarch_tdep (struct gdbarch *gdbarch)
1107 if (gdbarch_debug >= 2)
1108 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1109 return gdbarch->tdep;
1113 const struct bfd_arch_info *
1114 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1116 gdb_assert (gdbarch != NULL);
1117 if (gdbarch_debug >= 2)
1118 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1119 return gdbarch->bfd_arch_info;
1123 gdbarch_byte_order (struct gdbarch *gdbarch)
1125 gdb_assert (gdbarch != NULL);
1126 if (gdbarch_debug >= 2)
1127 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1128 return gdbarch->byte_order;
1132 gdbarch_osabi (struct gdbarch *gdbarch)
1134 gdb_assert (gdbarch != NULL);
1135 if (gdbarch_debug >= 2)
1136 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1137 return gdbarch->osabi;
1140 const struct target_desc *
1141 gdbarch_target_desc (struct gdbarch *gdbarch)
1143 gdb_assert (gdbarch != NULL);
1144 if (gdbarch_debug >= 2)
1145 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1146 return gdbarch->target_desc;
1150 gdbarch_short_bit (struct gdbarch *gdbarch)
1152 gdb_assert (gdbarch != NULL);
1153 /* Skip verify of short_bit, invalid_p == 0 */
1154 if (gdbarch_debug >= 2)
1155 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1156 return gdbarch->short_bit;
1160 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1163 gdbarch->short_bit = short_bit;
1167 gdbarch_int_bit (struct gdbarch *gdbarch)
1169 gdb_assert (gdbarch != NULL);
1170 /* Skip verify of int_bit, invalid_p == 0 */
1171 if (gdbarch_debug >= 2)
1172 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1173 return gdbarch->int_bit;
1177 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1180 gdbarch->int_bit = int_bit;
1184 gdbarch_long_bit (struct gdbarch *gdbarch)
1186 gdb_assert (gdbarch != NULL);
1187 /* Skip verify of long_bit, invalid_p == 0 */
1188 if (gdbarch_debug >= 2)
1189 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1190 return gdbarch->long_bit;
1194 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1197 gdbarch->long_bit = long_bit;
1201 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1203 gdb_assert (gdbarch != NULL);
1204 /* Skip verify of long_long_bit, invalid_p == 0 */
1205 if (gdbarch_debug >= 2)
1206 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1207 return gdbarch->long_long_bit;
1211 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1214 gdbarch->long_long_bit = long_long_bit;
1218 gdbarch_float_bit (struct gdbarch *gdbarch)
1220 gdb_assert (gdbarch != NULL);
1221 /* Skip verify of float_bit, invalid_p == 0 */
1222 if (gdbarch_debug >= 2)
1223 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1224 return gdbarch->float_bit;
1228 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1231 gdbarch->float_bit = float_bit;
1234 const struct floatformat **
1235 gdbarch_float_format (struct gdbarch *gdbarch)
1237 gdb_assert (gdbarch != NULL);
1238 if (gdbarch_debug >= 2)
1239 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1240 return gdbarch->float_format;
1244 set_gdbarch_float_format (struct gdbarch *gdbarch,
1245 const struct floatformat ** float_format)
1247 gdbarch->float_format = float_format;
1251 gdbarch_double_bit (struct gdbarch *gdbarch)
1253 gdb_assert (gdbarch != NULL);
1254 /* Skip verify of double_bit, invalid_p == 0 */
1255 if (gdbarch_debug >= 2)
1256 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1257 return gdbarch->double_bit;
1261 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1264 gdbarch->double_bit = double_bit;
1267 const struct floatformat **
1268 gdbarch_double_format (struct gdbarch *gdbarch)
1270 gdb_assert (gdbarch != NULL);
1271 if (gdbarch_debug >= 2)
1272 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1273 return gdbarch->double_format;
1277 set_gdbarch_double_format (struct gdbarch *gdbarch,
1278 const struct floatformat ** double_format)
1280 gdbarch->double_format = double_format;
1284 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1286 gdb_assert (gdbarch != NULL);
1287 /* Skip verify of long_double_bit, invalid_p == 0 */
1288 if (gdbarch_debug >= 2)
1289 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1290 return gdbarch->long_double_bit;
1294 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1295 int long_double_bit)
1297 gdbarch->long_double_bit = long_double_bit;
1300 const struct floatformat **
1301 gdbarch_long_double_format (struct gdbarch *gdbarch)
1303 gdb_assert (gdbarch != NULL);
1304 if (gdbarch_debug >= 2)
1305 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1306 return gdbarch->long_double_format;
1310 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1311 const struct floatformat ** long_double_format)
1313 gdbarch->long_double_format = long_double_format;
1317 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1319 gdb_assert (gdbarch != NULL);
1320 /* Skip verify of ptr_bit, invalid_p == 0 */
1321 if (gdbarch_debug >= 2)
1322 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1323 return gdbarch->ptr_bit;
1327 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1330 gdbarch->ptr_bit = ptr_bit;
1334 gdbarch_addr_bit (struct gdbarch *gdbarch)
1336 gdb_assert (gdbarch != NULL);
1337 /* Check variable changed from pre-default. */
1338 gdb_assert (gdbarch->addr_bit != 0);
1339 if (gdbarch_debug >= 2)
1340 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1341 return gdbarch->addr_bit;
1345 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1348 gdbarch->addr_bit = addr_bit;
1352 gdbarch_char_signed (struct gdbarch *gdbarch)
1354 gdb_assert (gdbarch != NULL);
1355 /* Check variable changed from pre-default. */
1356 gdb_assert (gdbarch->char_signed != -1);
1357 if (gdbarch_debug >= 2)
1358 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1359 return gdbarch->char_signed;
1363 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1366 gdbarch->char_signed = char_signed;
1370 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1372 gdb_assert (gdbarch != NULL);
1373 return gdbarch->read_pc != NULL;
1377 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1379 gdb_assert (gdbarch != NULL);
1380 gdb_assert (gdbarch->read_pc != NULL);
1381 if (gdbarch_debug >= 2)
1382 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1383 return gdbarch->read_pc (regcache);
1387 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1388 gdbarch_read_pc_ftype read_pc)
1390 gdbarch->read_pc = read_pc;
1394 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1396 gdb_assert (gdbarch != NULL);
1397 return gdbarch->write_pc != NULL;
1401 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1403 gdb_assert (gdbarch != NULL);
1404 gdb_assert (gdbarch->write_pc != NULL);
1405 if (gdbarch_debug >= 2)
1406 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1407 gdbarch->write_pc (regcache, val);
1411 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1412 gdbarch_write_pc_ftype write_pc)
1414 gdbarch->write_pc = write_pc;
1418 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1420 gdb_assert (gdbarch != NULL);
1421 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1422 if (gdbarch_debug >= 2)
1423 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1424 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1428 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1429 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1431 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1435 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1437 gdb_assert (gdbarch != NULL);
1438 return gdbarch->pseudo_register_read != NULL;
1442 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1444 gdb_assert (gdbarch != NULL);
1445 gdb_assert (gdbarch->pseudo_register_read != NULL);
1446 if (gdbarch_debug >= 2)
1447 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1448 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1452 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1453 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1455 gdbarch->pseudo_register_read = pseudo_register_read;
1459 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1461 gdb_assert (gdbarch != NULL);
1462 return gdbarch->pseudo_register_write != NULL;
1466 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1468 gdb_assert (gdbarch != NULL);
1469 gdb_assert (gdbarch->pseudo_register_write != NULL);
1470 if (gdbarch_debug >= 2)
1471 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1472 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1476 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1477 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1479 gdbarch->pseudo_register_write = pseudo_register_write;
1483 gdbarch_num_regs (struct gdbarch *gdbarch)
1485 gdb_assert (gdbarch != NULL);
1486 /* Check variable changed from pre-default. */
1487 gdb_assert (gdbarch->num_regs != -1);
1488 if (gdbarch_debug >= 2)
1489 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1490 return gdbarch->num_regs;
1494 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1497 gdbarch->num_regs = num_regs;
1501 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1503 gdb_assert (gdbarch != NULL);
1504 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1505 if (gdbarch_debug >= 2)
1506 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1507 return gdbarch->num_pseudo_regs;
1511 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1512 int num_pseudo_regs)
1514 gdbarch->num_pseudo_regs = num_pseudo_regs;
1518 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1520 gdb_assert (gdbarch != NULL);
1521 /* Skip verify of sp_regnum, invalid_p == 0 */
1522 if (gdbarch_debug >= 2)
1523 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1524 return gdbarch->sp_regnum;
1528 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1531 gdbarch->sp_regnum = sp_regnum;
1535 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1537 gdb_assert (gdbarch != NULL);
1538 /* Skip verify of pc_regnum, invalid_p == 0 */
1539 if (gdbarch_debug >= 2)
1540 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1541 return gdbarch->pc_regnum;
1545 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1548 gdbarch->pc_regnum = pc_regnum;
1552 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1554 gdb_assert (gdbarch != NULL);
1555 /* Skip verify of ps_regnum, invalid_p == 0 */
1556 if (gdbarch_debug >= 2)
1557 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1558 return gdbarch->ps_regnum;
1562 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1565 gdbarch->ps_regnum = ps_regnum;
1569 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1571 gdb_assert (gdbarch != NULL);
1572 /* Skip verify of fp0_regnum, invalid_p == 0 */
1573 if (gdbarch_debug >= 2)
1574 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1575 return gdbarch->fp0_regnum;
1579 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1582 gdbarch->fp0_regnum = fp0_regnum;
1586 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1588 gdb_assert (gdbarch != NULL);
1589 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1590 if (gdbarch_debug >= 2)
1591 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1592 return gdbarch->stab_reg_to_regnum (stab_regnr);
1596 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1597 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1599 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1603 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1605 gdb_assert (gdbarch != NULL);
1606 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1607 if (gdbarch_debug >= 2)
1608 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1609 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
1613 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1614 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1616 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1620 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
1622 gdb_assert (gdbarch != NULL);
1623 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
1624 if (gdbarch_debug >= 2)
1625 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
1626 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
1630 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
1631 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
1633 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
1637 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1639 gdb_assert (gdbarch != NULL);
1640 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1641 if (gdbarch_debug >= 2)
1642 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1643 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
1647 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1648 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1650 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1654 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1656 gdb_assert (gdbarch != NULL);
1657 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1658 if (gdbarch_debug >= 2)
1659 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1660 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
1664 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1665 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1667 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1671 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1673 gdb_assert (gdbarch != NULL);
1674 gdb_assert (gdbarch->register_name != NULL);
1675 if (gdbarch_debug >= 2)
1676 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1677 return gdbarch->register_name (regnr);
1681 set_gdbarch_register_name (struct gdbarch *gdbarch,
1682 gdbarch_register_name_ftype register_name)
1684 gdbarch->register_name = register_name;
1688 gdbarch_register_type_p (struct gdbarch *gdbarch)
1690 gdb_assert (gdbarch != NULL);
1691 return gdbarch->register_type != NULL;
1695 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1697 gdb_assert (gdbarch != NULL);
1698 gdb_assert (gdbarch->register_type != NULL);
1699 if (gdbarch_debug >= 2)
1700 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1701 return gdbarch->register_type (gdbarch, reg_nr);
1705 set_gdbarch_register_type (struct gdbarch *gdbarch,
1706 gdbarch_register_type_ftype register_type)
1708 gdbarch->register_type = register_type;
1712 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
1714 gdb_assert (gdbarch != NULL);
1715 return gdbarch->unwind_dummy_id != NULL;
1719 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
1721 gdb_assert (gdbarch != NULL);
1722 gdb_assert (gdbarch->unwind_dummy_id != NULL);
1723 if (gdbarch_debug >= 2)
1724 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
1725 return gdbarch->unwind_dummy_id (gdbarch, info);
1729 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
1730 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
1732 gdbarch->unwind_dummy_id = unwind_dummy_id;
1736 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1738 gdb_assert (gdbarch != NULL);
1739 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1740 if (gdbarch_debug >= 2)
1741 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1742 return gdbarch->deprecated_fp_regnum;
1746 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1747 int deprecated_fp_regnum)
1749 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1753 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1755 gdb_assert (gdbarch != NULL);
1756 return gdbarch->push_dummy_call != NULL;
1760 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)
1762 gdb_assert (gdbarch != NULL);
1763 gdb_assert (gdbarch->push_dummy_call != NULL);
1764 if (gdbarch_debug >= 2)
1765 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1766 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1770 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1771 gdbarch_push_dummy_call_ftype push_dummy_call)
1773 gdbarch->push_dummy_call = push_dummy_call;
1777 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
1779 gdb_assert (gdbarch != NULL);
1780 if (gdbarch_debug >= 2)
1781 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
1782 return gdbarch->deprecated_register_size;
1786 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
1787 int deprecated_register_size)
1789 gdbarch->deprecated_register_size = deprecated_register_size;
1793 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1795 gdb_assert (gdbarch != NULL);
1796 /* Skip verify of call_dummy_location, invalid_p == 0 */
1797 if (gdbarch_debug >= 2)
1798 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1799 return gdbarch->call_dummy_location;
1803 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1804 int call_dummy_location)
1806 gdbarch->call_dummy_location = call_dummy_location;
1810 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1812 gdb_assert (gdbarch != NULL);
1813 return gdbarch->push_dummy_code != NULL;
1817 gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
1819 gdb_assert (gdbarch != NULL);
1820 gdb_assert (gdbarch->push_dummy_code != NULL);
1821 if (gdbarch_debug >= 2)
1822 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1823 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache);
1827 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1828 gdbarch_push_dummy_code_ftype push_dummy_code)
1830 gdbarch->push_dummy_code = push_dummy_code;
1834 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1836 gdb_assert (gdbarch != NULL);
1837 gdb_assert (gdbarch->print_registers_info != NULL);
1838 if (gdbarch_debug >= 2)
1839 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1840 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1844 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1845 gdbarch_print_registers_info_ftype print_registers_info)
1847 gdbarch->print_registers_info = print_registers_info;
1851 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1853 gdb_assert (gdbarch != NULL);
1854 return gdbarch->print_float_info != NULL;
1858 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1860 gdb_assert (gdbarch != NULL);
1861 gdb_assert (gdbarch->print_float_info != NULL);
1862 if (gdbarch_debug >= 2)
1863 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1864 gdbarch->print_float_info (gdbarch, file, frame, args);
1868 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1869 gdbarch_print_float_info_ftype print_float_info)
1871 gdbarch->print_float_info = print_float_info;
1875 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1877 gdb_assert (gdbarch != NULL);
1878 return gdbarch->print_vector_info != NULL;
1882 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1884 gdb_assert (gdbarch != NULL);
1885 gdb_assert (gdbarch->print_vector_info != NULL);
1886 if (gdbarch_debug >= 2)
1887 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
1888 gdbarch->print_vector_info (gdbarch, file, frame, args);
1892 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
1893 gdbarch_print_vector_info_ftype print_vector_info)
1895 gdbarch->print_vector_info = print_vector_info;
1899 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
1901 gdb_assert (gdbarch != NULL);
1902 gdb_assert (gdbarch->register_sim_regno != NULL);
1903 if (gdbarch_debug >= 2)
1904 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
1905 return gdbarch->register_sim_regno (reg_nr);
1909 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
1910 gdbarch_register_sim_regno_ftype register_sim_regno)
1912 gdbarch->register_sim_regno = register_sim_regno;
1916 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
1918 gdb_assert (gdbarch != NULL);
1919 gdb_assert (gdbarch->cannot_fetch_register != NULL);
1920 if (gdbarch_debug >= 2)
1921 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
1922 return gdbarch->cannot_fetch_register (regnum);
1926 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
1927 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
1929 gdbarch->cannot_fetch_register = cannot_fetch_register;
1933 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
1935 gdb_assert (gdbarch != NULL);
1936 gdb_assert (gdbarch->cannot_store_register != NULL);
1937 if (gdbarch_debug >= 2)
1938 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
1939 return gdbarch->cannot_store_register (regnum);
1943 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
1944 gdbarch_cannot_store_register_ftype cannot_store_register)
1946 gdbarch->cannot_store_register = cannot_store_register;
1950 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
1952 gdb_assert (gdbarch != NULL);
1953 return gdbarch->get_longjmp_target != NULL;
1957 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
1959 gdb_assert (gdbarch != NULL);
1960 gdb_assert (gdbarch->get_longjmp_target != NULL);
1961 if (gdbarch_debug >= 2)
1962 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
1963 return gdbarch->get_longjmp_target (frame, pc);
1967 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
1968 gdbarch_get_longjmp_target_ftype get_longjmp_target)
1970 gdbarch->get_longjmp_target = get_longjmp_target;
1974 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
1976 gdb_assert (gdbarch != NULL);
1977 if (gdbarch_debug >= 2)
1978 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
1979 return gdbarch->believe_pcc_promotion;
1983 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
1984 int believe_pcc_promotion)
1986 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
1990 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
1992 gdb_assert (gdbarch != NULL);
1993 gdb_assert (gdbarch->convert_register_p != NULL);
1994 if (gdbarch_debug >= 2)
1995 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
1996 return gdbarch->convert_register_p (regnum, type);
2000 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2001 gdbarch_convert_register_p_ftype convert_register_p)
2003 gdbarch->convert_register_p = convert_register_p;
2007 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2009 gdb_assert (gdbarch != NULL);
2010 gdb_assert (gdbarch->register_to_value != NULL);
2011 if (gdbarch_debug >= 2)
2012 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2013 gdbarch->register_to_value (frame, regnum, type, buf);
2017 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2018 gdbarch_register_to_value_ftype register_to_value)
2020 gdbarch->register_to_value = register_to_value;
2024 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2026 gdb_assert (gdbarch != NULL);
2027 gdb_assert (gdbarch->value_to_register != NULL);
2028 if (gdbarch_debug >= 2)
2029 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2030 gdbarch->value_to_register (frame, regnum, type, buf);
2034 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2035 gdbarch_value_to_register_ftype value_to_register)
2037 gdbarch->value_to_register = value_to_register;
2041 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2043 gdb_assert (gdbarch != NULL);
2044 gdb_assert (gdbarch->value_from_register != NULL);
2045 if (gdbarch_debug >= 2)
2046 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2047 return gdbarch->value_from_register (type, regnum, frame);
2051 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2052 gdbarch_value_from_register_ftype value_from_register)
2054 gdbarch->value_from_register = value_from_register;
2058 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2060 gdb_assert (gdbarch != NULL);
2061 gdb_assert (gdbarch->pointer_to_address != NULL);
2062 if (gdbarch_debug >= 2)
2063 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2064 return gdbarch->pointer_to_address (type, buf);
2068 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2069 gdbarch_pointer_to_address_ftype pointer_to_address)
2071 gdbarch->pointer_to_address = pointer_to_address;
2075 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2077 gdb_assert (gdbarch != NULL);
2078 gdb_assert (gdbarch->address_to_pointer != NULL);
2079 if (gdbarch_debug >= 2)
2080 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2081 gdbarch->address_to_pointer (type, buf, addr);
2085 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2086 gdbarch_address_to_pointer_ftype address_to_pointer)
2088 gdbarch->address_to_pointer = address_to_pointer;
2092 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2094 gdb_assert (gdbarch != NULL);
2095 return gdbarch->integer_to_address != NULL;
2099 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2101 gdb_assert (gdbarch != NULL);
2102 gdb_assert (gdbarch->integer_to_address != NULL);
2103 if (gdbarch_debug >= 2)
2104 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2105 return gdbarch->integer_to_address (gdbarch, type, buf);
2109 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2110 gdbarch_integer_to_address_ftype integer_to_address)
2112 gdbarch->integer_to_address = integer_to_address;
2116 gdbarch_return_value_p (struct gdbarch *gdbarch)
2118 gdb_assert (gdbarch != NULL);
2119 return gdbarch->return_value != legacy_return_value;
2122 enum return_value_convention
2123 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2125 gdb_assert (gdbarch != NULL);
2126 gdb_assert (gdbarch->return_value != NULL);
2127 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2128 if (gdbarch_debug >= 2)
2129 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2130 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2134 set_gdbarch_return_value (struct gdbarch *gdbarch,
2135 gdbarch_return_value_ftype return_value)
2137 gdbarch->return_value = return_value;
2141 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
2143 gdb_assert (gdbarch != NULL);
2144 gdb_assert (gdbarch->extract_return_value != NULL);
2145 if (gdbarch_debug >= 2)
2146 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2147 gdbarch->extract_return_value (type, regcache, valbuf);
2151 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2152 gdbarch_extract_return_value_ftype extract_return_value)
2154 gdbarch->extract_return_value = extract_return_value;
2158 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
2160 gdb_assert (gdbarch != NULL);
2161 gdb_assert (gdbarch->store_return_value != NULL);
2162 if (gdbarch_debug >= 2)
2163 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2164 gdbarch->store_return_value (type, regcache, valbuf);
2168 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2169 gdbarch_store_return_value_ftype store_return_value)
2171 gdbarch->store_return_value = store_return_value;
2175 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2177 gdb_assert (gdbarch != NULL);
2178 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2179 if (gdbarch_debug >= 2)
2180 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2181 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2185 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2186 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2188 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2192 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2194 gdb_assert (gdbarch != NULL);
2195 gdb_assert (gdbarch->skip_prologue != NULL);
2196 if (gdbarch_debug >= 2)
2197 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2198 return gdbarch->skip_prologue (ip);
2202 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2203 gdbarch_skip_prologue_ftype skip_prologue)
2205 gdbarch->skip_prologue = skip_prologue;
2209 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2211 gdb_assert (gdbarch != NULL);
2212 gdb_assert (gdbarch->inner_than != NULL);
2213 if (gdbarch_debug >= 2)
2214 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2215 return gdbarch->inner_than (lhs, rhs);
2219 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2220 gdbarch_inner_than_ftype inner_than)
2222 gdbarch->inner_than = inner_than;
2226 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2228 gdb_assert (gdbarch != NULL);
2229 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2230 if (gdbarch_debug >= 2)
2231 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2232 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2236 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2237 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2239 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2243 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2245 gdb_assert (gdbarch != NULL);
2246 return gdbarch->adjust_breakpoint_address != NULL;
2250 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2252 gdb_assert (gdbarch != NULL);
2253 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2254 if (gdbarch_debug >= 2)
2255 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2256 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2260 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2261 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2263 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2267 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2269 gdb_assert (gdbarch != NULL);
2270 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2271 if (gdbarch_debug >= 2)
2272 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2273 return gdbarch->memory_insert_breakpoint (bp_tgt);
2277 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2278 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2280 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2284 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2286 gdb_assert (gdbarch != NULL);
2287 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2288 if (gdbarch_debug >= 2)
2289 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2290 return gdbarch->memory_remove_breakpoint (bp_tgt);
2294 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2295 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2297 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2301 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2303 gdb_assert (gdbarch != NULL);
2304 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2305 if (gdbarch_debug >= 2)
2306 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2307 return gdbarch->decr_pc_after_break;
2311 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2312 CORE_ADDR decr_pc_after_break)
2314 gdbarch->decr_pc_after_break = decr_pc_after_break;
2318 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2320 gdb_assert (gdbarch != NULL);
2321 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2322 if (gdbarch_debug >= 2)
2323 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2324 return gdbarch->deprecated_function_start_offset;
2328 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2329 CORE_ADDR deprecated_function_start_offset)
2331 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2335 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2337 gdb_assert (gdbarch != NULL);
2338 gdb_assert (gdbarch->remote_register_number != NULL);
2339 if (gdbarch_debug >= 2)
2340 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2341 return gdbarch->remote_register_number (gdbarch, regno);
2345 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2346 gdbarch_remote_register_number_ftype remote_register_number)
2348 gdbarch->remote_register_number = remote_register_number;
2352 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2354 gdb_assert (gdbarch != NULL);
2355 return gdbarch->fetch_tls_load_module_address != NULL;
2359 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2361 gdb_assert (gdbarch != NULL);
2362 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2363 if (gdbarch_debug >= 2)
2364 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2365 return gdbarch->fetch_tls_load_module_address (objfile);
2369 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2370 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2372 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2376 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2378 gdb_assert (gdbarch != NULL);
2379 /* Skip verify of frame_args_skip, invalid_p == 0 */
2380 if (gdbarch_debug >= 2)
2381 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2382 return gdbarch->frame_args_skip;
2386 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2387 CORE_ADDR frame_args_skip)
2389 gdbarch->frame_args_skip = frame_args_skip;
2393 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2395 gdb_assert (gdbarch != NULL);
2396 return gdbarch->unwind_pc != NULL;
2400 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2402 gdb_assert (gdbarch != NULL);
2403 gdb_assert (gdbarch->unwind_pc != NULL);
2404 if (gdbarch_debug >= 2)
2405 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2406 return gdbarch->unwind_pc (gdbarch, next_frame);
2410 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2411 gdbarch_unwind_pc_ftype unwind_pc)
2413 gdbarch->unwind_pc = unwind_pc;
2417 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2419 gdb_assert (gdbarch != NULL);
2420 return gdbarch->unwind_sp != NULL;
2424 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2426 gdb_assert (gdbarch != NULL);
2427 gdb_assert (gdbarch->unwind_sp != NULL);
2428 if (gdbarch_debug >= 2)
2429 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2430 return gdbarch->unwind_sp (gdbarch, next_frame);
2434 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2435 gdbarch_unwind_sp_ftype unwind_sp)
2437 gdbarch->unwind_sp = unwind_sp;
2441 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2443 gdb_assert (gdbarch != NULL);
2444 return gdbarch->frame_num_args != NULL;
2448 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2450 gdb_assert (gdbarch != NULL);
2451 gdb_assert (gdbarch->frame_num_args != NULL);
2452 if (gdbarch_debug >= 2)
2453 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2454 return gdbarch->frame_num_args (frame);
2458 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2459 gdbarch_frame_num_args_ftype frame_num_args)
2461 gdbarch->frame_num_args = frame_num_args;
2465 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2467 gdb_assert (gdbarch != NULL);
2468 return gdbarch->frame_align != NULL;
2472 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2474 gdb_assert (gdbarch != NULL);
2475 gdb_assert (gdbarch->frame_align != NULL);
2476 if (gdbarch_debug >= 2)
2477 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2478 return gdbarch->frame_align (gdbarch, address);
2482 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2483 gdbarch_frame_align_ftype frame_align)
2485 gdbarch->frame_align = frame_align;
2489 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
2491 gdb_assert (gdbarch != NULL);
2492 return gdbarch->deprecated_reg_struct_has_addr != NULL;
2496 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
2498 gdb_assert (gdbarch != NULL);
2499 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
2500 if (gdbarch_debug >= 2)
2501 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
2502 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
2506 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
2507 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
2509 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
2513 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2515 gdb_assert (gdbarch != NULL);
2516 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2517 if (gdbarch_debug >= 2)
2518 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2519 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2523 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2524 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2526 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2530 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2532 gdb_assert (gdbarch != NULL);
2533 if (gdbarch_debug >= 2)
2534 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2535 return gdbarch->frame_red_zone_size;
2539 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2540 int frame_red_zone_size)
2542 gdbarch->frame_red_zone_size = frame_red_zone_size;
2546 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2548 gdb_assert (gdbarch != NULL);
2549 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2550 if (gdbarch_debug >= 2)
2551 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2552 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2556 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2557 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2559 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2563 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2565 gdb_assert (gdbarch != NULL);
2566 gdb_assert (gdbarch->addr_bits_remove != NULL);
2567 if (gdbarch_debug >= 2)
2568 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2569 return gdbarch->addr_bits_remove (addr);
2573 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2574 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2576 gdbarch->addr_bits_remove = addr_bits_remove;
2580 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2582 gdb_assert (gdbarch != NULL);
2583 gdb_assert (gdbarch->smash_text_address != NULL);
2584 if (gdbarch_debug >= 2)
2585 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2586 return gdbarch->smash_text_address (addr);
2590 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2591 gdbarch_smash_text_address_ftype smash_text_address)
2593 gdbarch->smash_text_address = smash_text_address;
2597 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2599 gdb_assert (gdbarch != NULL);
2600 return gdbarch->software_single_step != NULL;
2604 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2606 gdb_assert (gdbarch != NULL);
2607 gdb_assert (gdbarch->software_single_step != NULL);
2608 if (gdbarch_debug >= 2)
2609 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2610 return gdbarch->software_single_step (frame);
2614 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2615 gdbarch_software_single_step_ftype software_single_step)
2617 gdbarch->software_single_step = software_single_step;
2621 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2623 gdb_assert (gdbarch != NULL);
2624 return gdbarch->single_step_through_delay != NULL;
2628 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2630 gdb_assert (gdbarch != NULL);
2631 gdb_assert (gdbarch->single_step_through_delay != NULL);
2632 if (gdbarch_debug >= 2)
2633 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2634 return gdbarch->single_step_through_delay (gdbarch, frame);
2638 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2639 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2641 gdbarch->single_step_through_delay = single_step_through_delay;
2645 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2647 gdb_assert (gdbarch != NULL);
2648 gdb_assert (gdbarch->print_insn != NULL);
2649 if (gdbarch_debug >= 2)
2650 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2651 return gdbarch->print_insn (vma, info);
2655 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2656 gdbarch_print_insn_ftype print_insn)
2658 gdbarch->print_insn = print_insn;
2662 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2664 gdb_assert (gdbarch != NULL);
2665 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2666 if (gdbarch_debug >= 2)
2667 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2668 return gdbarch->skip_trampoline_code (frame, pc);
2672 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2673 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2675 gdbarch->skip_trampoline_code = skip_trampoline_code;
2679 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2681 gdb_assert (gdbarch != NULL);
2682 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2683 if (gdbarch_debug >= 2)
2684 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2685 return gdbarch->skip_solib_resolver (gdbarch, pc);
2689 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2690 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2692 gdbarch->skip_solib_resolver = skip_solib_resolver;
2696 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2698 gdb_assert (gdbarch != NULL);
2699 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2700 if (gdbarch_debug >= 2)
2701 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2702 return gdbarch->in_solib_return_trampoline (pc, name);
2706 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2707 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2709 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2713 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2715 gdb_assert (gdbarch != NULL);
2716 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2717 if (gdbarch_debug >= 2)
2718 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2719 return gdbarch->in_function_epilogue_p (gdbarch, addr);
2723 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2724 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2726 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2730 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
2732 gdb_assert (gdbarch != NULL);
2733 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
2734 if (gdbarch_debug >= 2)
2735 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
2736 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
2740 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
2741 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
2743 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
2747 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2749 gdb_assert (gdbarch != NULL);
2750 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2751 if (gdbarch_debug >= 2)
2752 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2753 gdbarch->elf_make_msymbol_special (sym, msym);
2757 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2758 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2760 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2764 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2766 gdb_assert (gdbarch != NULL);
2767 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2768 if (gdbarch_debug >= 2)
2769 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2770 gdbarch->coff_make_msymbol_special (val, msym);
2774 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2775 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2777 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2781 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
2783 gdb_assert (gdbarch != NULL);
2784 /* Skip verify of name_of_malloc, invalid_p == 0 */
2785 if (gdbarch_debug >= 2)
2786 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
2787 return gdbarch->name_of_malloc;
2791 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
2792 const char * name_of_malloc)
2794 gdbarch->name_of_malloc = name_of_malloc;
2798 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2800 gdb_assert (gdbarch != NULL);
2801 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2802 if (gdbarch_debug >= 2)
2803 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2804 return gdbarch->cannot_step_breakpoint;
2808 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2809 int cannot_step_breakpoint)
2811 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2815 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2817 gdb_assert (gdbarch != NULL);
2818 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2819 if (gdbarch_debug >= 2)
2820 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2821 return gdbarch->have_nonsteppable_watchpoint;
2825 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2826 int have_nonsteppable_watchpoint)
2828 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2832 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2834 gdb_assert (gdbarch != NULL);
2835 return gdbarch->address_class_type_flags != NULL;
2839 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2841 gdb_assert (gdbarch != NULL);
2842 gdb_assert (gdbarch->address_class_type_flags != NULL);
2843 if (gdbarch_debug >= 2)
2844 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2845 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2849 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2850 gdbarch_address_class_type_flags_ftype address_class_type_flags)
2852 gdbarch->address_class_type_flags = address_class_type_flags;
2856 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2858 gdb_assert (gdbarch != NULL);
2859 return gdbarch->address_class_type_flags_to_name != NULL;
2863 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2865 gdb_assert (gdbarch != NULL);
2866 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2867 if (gdbarch_debug >= 2)
2868 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2869 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2873 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2874 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2876 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
2880 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
2882 gdb_assert (gdbarch != NULL);
2883 return gdbarch->address_class_name_to_type_flags != NULL;
2887 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
2889 gdb_assert (gdbarch != NULL);
2890 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
2891 if (gdbarch_debug >= 2)
2892 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
2893 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
2897 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
2898 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
2900 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
2904 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
2906 gdb_assert (gdbarch != NULL);
2907 gdb_assert (gdbarch->register_reggroup_p != NULL);
2908 if (gdbarch_debug >= 2)
2909 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
2910 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
2914 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
2915 gdbarch_register_reggroup_p_ftype register_reggroup_p)
2917 gdbarch->register_reggroup_p = register_reggroup_p;
2921 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
2923 gdb_assert (gdbarch != NULL);
2924 return gdbarch->fetch_pointer_argument != NULL;
2928 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
2930 gdb_assert (gdbarch != NULL);
2931 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
2932 if (gdbarch_debug >= 2)
2933 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
2934 return gdbarch->fetch_pointer_argument (frame, argi, type);
2938 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
2939 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
2941 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
2945 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
2947 gdb_assert (gdbarch != NULL);
2948 return gdbarch->regset_from_core_section != NULL;
2951 const struct regset *
2952 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
2954 gdb_assert (gdbarch != NULL);
2955 gdb_assert (gdbarch->regset_from_core_section != NULL);
2956 if (gdbarch_debug >= 2)
2957 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
2958 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
2962 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
2963 gdbarch_regset_from_core_section_ftype regset_from_core_section)
2965 gdbarch->regset_from_core_section = regset_from_core_section;
2969 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
2971 gdb_assert (gdbarch != NULL);
2972 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
2973 if (gdbarch_debug >= 2)
2974 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
2975 return gdbarch->vtable_function_descriptors;
2979 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
2980 int vtable_function_descriptors)
2982 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
2986 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
2988 gdb_assert (gdbarch != NULL);
2989 /* Skip verify of vbit_in_delta, invalid_p == 0 */
2990 if (gdbarch_debug >= 2)
2991 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
2992 return gdbarch->vbit_in_delta;
2996 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
2999 gdbarch->vbit_in_delta = vbit_in_delta;
3003 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3005 gdb_assert (gdbarch != NULL);
3006 return gdbarch->skip_permanent_breakpoint != NULL;
3010 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3012 gdb_assert (gdbarch != NULL);
3013 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3014 if (gdbarch_debug >= 2)
3015 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3016 gdbarch->skip_permanent_breakpoint (regcache);
3020 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3021 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3023 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3027 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3029 gdb_assert (gdbarch != NULL);
3030 return gdbarch->overlay_update != NULL;
3034 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3036 gdb_assert (gdbarch != NULL);
3037 gdb_assert (gdbarch->overlay_update != NULL);
3038 if (gdbarch_debug >= 2)
3039 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3040 gdbarch->overlay_update (osect);
3044 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3045 gdbarch_overlay_update_ftype overlay_update)
3047 gdbarch->overlay_update = overlay_update;
3051 /* Keep a registry of per-architecture data-pointers required by GDB
3058 gdbarch_data_pre_init_ftype *pre_init;
3059 gdbarch_data_post_init_ftype *post_init;
3062 struct gdbarch_data_registration
3064 struct gdbarch_data *data;
3065 struct gdbarch_data_registration *next;
3068 struct gdbarch_data_registry
3071 struct gdbarch_data_registration *registrations;
3074 struct gdbarch_data_registry gdbarch_data_registry =
3079 static struct gdbarch_data *
3080 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3081 gdbarch_data_post_init_ftype *post_init)
3083 struct gdbarch_data_registration **curr;
3084 /* Append the new registraration. */
3085 for (curr = &gdbarch_data_registry.registrations;
3087 curr = &(*curr)->next);
3088 (*curr) = XMALLOC (struct gdbarch_data_registration);
3089 (*curr)->next = NULL;
3090 (*curr)->data = XMALLOC (struct gdbarch_data);
3091 (*curr)->data->index = gdbarch_data_registry.nr++;
3092 (*curr)->data->pre_init = pre_init;
3093 (*curr)->data->post_init = post_init;
3094 (*curr)->data->init_p = 1;
3095 return (*curr)->data;
3098 struct gdbarch_data *
3099 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3101 return gdbarch_data_register (pre_init, NULL);
3104 struct gdbarch_data *
3105 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3107 return gdbarch_data_register (NULL, post_init);
3110 /* Create/delete the gdbarch data vector. */
3113 alloc_gdbarch_data (struct gdbarch *gdbarch)
3115 gdb_assert (gdbarch->data == NULL);
3116 gdbarch->nr_data = gdbarch_data_registry.nr;
3117 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3120 /* Initialize the current value of the specified per-architecture
3124 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3125 struct gdbarch_data *data,
3128 gdb_assert (data->index < gdbarch->nr_data);
3129 gdb_assert (gdbarch->data[data->index] == NULL);
3130 gdb_assert (data->pre_init == NULL);
3131 gdbarch->data[data->index] = pointer;
3134 /* Return the current value of the specified per-architecture
3138 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3140 gdb_assert (data->index < gdbarch->nr_data);
3141 if (gdbarch->data[data->index] == NULL)
3143 /* The data-pointer isn't initialized, call init() to get a
3145 if (data->pre_init != NULL)
3146 /* Mid architecture creation: pass just the obstack, and not
3147 the entire architecture, as that way it isn't possible for
3148 pre-init code to refer to undefined architecture
3150 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3151 else if (gdbarch->initialized_p
3152 && data->post_init != NULL)
3153 /* Post architecture creation: pass the entire architecture
3154 (as all fields are valid), but be careful to also detect
3155 recursive references. */
3157 gdb_assert (data->init_p);
3159 gdbarch->data[data->index] = data->post_init (gdbarch);
3163 /* The architecture initialization hasn't completed - punt -
3164 hope that the caller knows what they are doing. Once
3165 deprecated_set_gdbarch_data has been initialized, this can be
3166 changed to an internal error. */
3168 gdb_assert (gdbarch->data[data->index] != NULL);
3170 return gdbarch->data[data->index];
3175 /* Keep a registry of swapped data required by GDB modules. */
3180 struct gdbarch_swap_registration *source;
3181 struct gdbarch_swap *next;
3184 struct gdbarch_swap_registration
3187 unsigned long sizeof_data;
3188 gdbarch_swap_ftype *init;
3189 struct gdbarch_swap_registration *next;
3192 struct gdbarch_swap_registry
3195 struct gdbarch_swap_registration *registrations;
3198 struct gdbarch_swap_registry gdbarch_swap_registry =
3204 deprecated_register_gdbarch_swap (void *data,
3205 unsigned long sizeof_data,
3206 gdbarch_swap_ftype *init)
3208 struct gdbarch_swap_registration **rego;
3209 for (rego = &gdbarch_swap_registry.registrations;
3211 rego = &(*rego)->next);
3212 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3213 (*rego)->next = NULL;
3214 (*rego)->init = init;
3215 (*rego)->data = data;
3216 (*rego)->sizeof_data = sizeof_data;
3220 current_gdbarch_swap_init_hack (void)
3222 struct gdbarch_swap_registration *rego;
3223 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3224 for (rego = gdbarch_swap_registry.registrations;
3228 if (rego->data != NULL)
3230 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3231 struct gdbarch_swap);
3232 (*curr)->source = rego;
3233 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3235 (*curr)->next = NULL;
3236 curr = &(*curr)->next;
3238 if (rego->init != NULL)
3243 static struct gdbarch *
3244 current_gdbarch_swap_out_hack (void)
3246 struct gdbarch *old_gdbarch = current_gdbarch;
3247 struct gdbarch_swap *curr;
3249 gdb_assert (old_gdbarch != NULL);
3250 for (curr = old_gdbarch->swap;
3254 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3255 memset (curr->source->data, 0, curr->source->sizeof_data);
3257 current_gdbarch = NULL;
3262 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3264 struct gdbarch_swap *curr;
3266 gdb_assert (current_gdbarch == NULL);
3267 for (curr = new_gdbarch->swap;
3270 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3271 current_gdbarch = new_gdbarch;
3275 /* Keep a registry of the architectures known by GDB. */
3277 struct gdbarch_registration
3279 enum bfd_architecture bfd_architecture;
3280 gdbarch_init_ftype *init;
3281 gdbarch_dump_tdep_ftype *dump_tdep;
3282 struct gdbarch_list *arches;
3283 struct gdbarch_registration *next;
3286 static struct gdbarch_registration *gdbarch_registry = NULL;
3289 append_name (const char ***buf, int *nr, const char *name)
3291 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3297 gdbarch_printable_names (void)
3299 /* Accumulate a list of names based on the registed list of
3301 enum bfd_architecture a;
3303 const char **arches = NULL;
3304 struct gdbarch_registration *rego;
3305 for (rego = gdbarch_registry;
3309 const struct bfd_arch_info *ap;
3310 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3312 internal_error (__FILE__, __LINE__,
3313 _("gdbarch_architecture_names: multi-arch unknown"));
3316 append_name (&arches, &nr_arches, ap->printable_name);
3321 append_name (&arches, &nr_arches, NULL);
3327 gdbarch_register (enum bfd_architecture bfd_architecture,
3328 gdbarch_init_ftype *init,
3329 gdbarch_dump_tdep_ftype *dump_tdep)
3331 struct gdbarch_registration **curr;
3332 const struct bfd_arch_info *bfd_arch_info;
3333 /* Check that BFD recognizes this architecture */
3334 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3335 if (bfd_arch_info == NULL)
3337 internal_error (__FILE__, __LINE__,
3338 _("gdbarch: Attempt to register unknown architecture (%d)"),
3341 /* Check that we haven't seen this architecture before */
3342 for (curr = &gdbarch_registry;
3344 curr = &(*curr)->next)
3346 if (bfd_architecture == (*curr)->bfd_architecture)
3347 internal_error (__FILE__, __LINE__,
3348 _("gdbarch: Duplicate registraration of architecture (%s)"),
3349 bfd_arch_info->printable_name);
3353 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3354 bfd_arch_info->printable_name,
3357 (*curr) = XMALLOC (struct gdbarch_registration);
3358 (*curr)->bfd_architecture = bfd_architecture;
3359 (*curr)->init = init;
3360 (*curr)->dump_tdep = dump_tdep;
3361 (*curr)->arches = NULL;
3362 (*curr)->next = NULL;
3366 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3367 gdbarch_init_ftype *init)
3369 gdbarch_register (bfd_architecture, init, NULL);
3373 /* Look for an architecture using gdbarch_info. */
3375 struct gdbarch_list *
3376 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3377 const struct gdbarch_info *info)
3379 for (; arches != NULL; arches = arches->next)
3381 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3383 if (info->byte_order != arches->gdbarch->byte_order)
3385 if (info->osabi != arches->gdbarch->osabi)
3387 if (info->target_desc != arches->gdbarch->target_desc)
3395 /* Find an architecture that matches the specified INFO. Create a new
3396 architecture if needed. Return that new architecture. Assumes
3397 that there is no current architecture. */
3399 static struct gdbarch *
3400 find_arch_by_info (struct gdbarch_info info)
3402 struct gdbarch *new_gdbarch;
3403 struct gdbarch_registration *rego;
3405 /* The existing architecture has been swapped out - all this code
3406 works from a clean slate. */
3407 gdb_assert (current_gdbarch == NULL);
3409 /* Fill in missing parts of the INFO struct using a number of
3410 sources: "set ..."; INFOabfd supplied; and the global
3412 gdbarch_info_fill (&info);
3414 /* Must have found some sort of architecture. */
3415 gdb_assert (info.bfd_arch_info != NULL);
3419 fprintf_unfiltered (gdb_stdlog,
3420 "find_arch_by_info: info.bfd_arch_info %s\n",
3421 (info.bfd_arch_info != NULL
3422 ? info.bfd_arch_info->printable_name
3424 fprintf_unfiltered (gdb_stdlog,
3425 "find_arch_by_info: info.byte_order %d (%s)\n",
3427 (info.byte_order == BFD_ENDIAN_BIG ? "big"
3428 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3430 fprintf_unfiltered (gdb_stdlog,
3431 "find_arch_by_info: info.osabi %d (%s)\n",
3432 info.osabi, gdbarch_osabi_name (info.osabi));
3433 fprintf_unfiltered (gdb_stdlog,
3434 "find_arch_by_info: info.abfd 0x%lx\n",
3436 fprintf_unfiltered (gdb_stdlog,
3437 "find_arch_by_info: info.tdep_info 0x%lx\n",
3438 (long) info.tdep_info);
3441 /* Find the tdep code that knows about this architecture. */
3442 for (rego = gdbarch_registry;
3445 if (rego->bfd_architecture == info.bfd_arch_info->arch)
3450 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3451 "No matching architecture\n");
3455 /* Ask the tdep code for an architecture that matches "info". */
3456 new_gdbarch = rego->init (info, rego->arches);
3458 /* Did the tdep code like it? No. Reject the change and revert to
3459 the old architecture. */
3460 if (new_gdbarch == NULL)
3463 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3464 "Target rejected architecture\n");
3468 /* Is this a pre-existing architecture (as determined by already
3469 being initialized)? Move it to the front of the architecture
3470 list (keeping the list sorted Most Recently Used). */
3471 if (new_gdbarch->initialized_p)
3473 struct gdbarch_list **list;
3474 struct gdbarch_list *this;
3476 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3477 "Previous architecture 0x%08lx (%s) selected\n",
3479 new_gdbarch->bfd_arch_info->printable_name);
3480 /* Find the existing arch in the list. */
3481 for (list = ®o->arches;
3482 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
3483 list = &(*list)->next);
3484 /* It had better be in the list of architectures. */
3485 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
3488 (*list) = this->next;
3489 /* Insert THIS at the front. */
3490 this->next = rego->arches;
3491 rego->arches = this;
3496 /* It's a new architecture. */
3498 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3499 "New architecture 0x%08lx (%s) selected\n",
3501 new_gdbarch->bfd_arch_info->printable_name);
3503 /* Insert the new architecture into the front of the architecture
3504 list (keep the list sorted Most Recently Used). */
3506 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
3507 this->next = rego->arches;
3508 this->gdbarch = new_gdbarch;
3509 rego->arches = this;
3512 /* Check that the newly installed architecture is valid. Plug in
3513 any post init values. */
3514 new_gdbarch->dump_tdep = rego->dump_tdep;
3515 verify_gdbarch (new_gdbarch);
3516 new_gdbarch->initialized_p = 1;
3518 /* Initialize any per-architecture swap areas. This phase requires
3519 a valid global CURRENT_GDBARCH. Set it momentarially, and then
3520 swap the entire architecture out. */
3521 current_gdbarch = new_gdbarch;
3522 current_gdbarch_swap_init_hack ();
3523 current_gdbarch_swap_out_hack ();
3526 gdbarch_dump (new_gdbarch, gdb_stdlog);
3532 gdbarch_find_by_info (struct gdbarch_info info)
3534 /* Save the previously selected architecture, setting the global to
3535 NULL. This stops things like gdbarch->init() trying to use the
3536 previous architecture's configuration. The previous architecture
3537 may not even be of the same architecture family. The most recent
3538 architecture of the same family is found at the head of the
3539 rego->arches list. */
3540 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
3542 /* Find the specified architecture. */
3543 struct gdbarch *new_gdbarch = find_arch_by_info (info);
3545 /* Restore the existing architecture. */
3546 gdb_assert (current_gdbarch == NULL);
3547 current_gdbarch_swap_in_hack (old_gdbarch);
3552 /* Make the specified architecture current, swapping the existing one
3556 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
3558 gdb_assert (new_gdbarch != NULL);
3559 gdb_assert (current_gdbarch != NULL);
3560 gdb_assert (new_gdbarch->initialized_p);
3561 current_gdbarch_swap_out_hack ();
3562 current_gdbarch_swap_in_hack (new_gdbarch);
3563 architecture_changed_event ();
3564 reinit_frame_cache ();
3567 extern void _initialize_gdbarch (void);
3570 _initialize_gdbarch (void)
3572 struct cmd_list_element *c;
3574 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
3575 Set architecture debugging."), _("\
3576 Show architecture debugging."), _("\
3577 When non-zero, architecture debugging is enabled."),
3580 &setdebuglist, &showdebuglist);