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;
149 gdbarch_read_pc_ftype *read_pc;
150 gdbarch_write_pc_ftype *write_pc;
151 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
152 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
153 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
160 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
161 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
162 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
163 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
164 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
165 gdbarch_register_name_ftype *register_name;
166 gdbarch_register_type_ftype *register_type;
167 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
168 int deprecated_fp_regnum;
169 gdbarch_push_dummy_call_ftype *push_dummy_call;
170 int deprecated_register_size;
171 int call_dummy_location;
172 gdbarch_push_dummy_code_ftype *push_dummy_code;
173 gdbarch_print_registers_info_ftype *print_registers_info;
174 gdbarch_print_float_info_ftype *print_float_info;
175 gdbarch_print_vector_info_ftype *print_vector_info;
176 gdbarch_register_sim_regno_ftype *register_sim_regno;
177 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
178 gdbarch_cannot_store_register_ftype *cannot_store_register;
179 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
180 int believe_pcc_promotion;
181 gdbarch_convert_register_p_ftype *convert_register_p;
182 gdbarch_register_to_value_ftype *register_to_value;
183 gdbarch_value_to_register_ftype *value_to_register;
184 gdbarch_value_from_register_ftype *value_from_register;
185 gdbarch_pointer_to_address_ftype *pointer_to_address;
186 gdbarch_address_to_pointer_ftype *address_to_pointer;
187 gdbarch_integer_to_address_ftype *integer_to_address;
188 gdbarch_return_value_ftype *return_value;
189 gdbarch_extract_return_value_ftype *extract_return_value;
190 gdbarch_store_return_value_ftype *store_return_value;
191 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
192 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
193 gdbarch_skip_prologue_ftype *skip_prologue;
194 gdbarch_inner_than_ftype *inner_than;
195 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
196 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
197 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
198 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
199 CORE_ADDR decr_pc_after_break;
200 CORE_ADDR deprecated_function_start_offset;
201 gdbarch_remote_register_number_ftype *remote_register_number;
202 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
203 CORE_ADDR frame_args_skip;
204 gdbarch_unwind_pc_ftype *unwind_pc;
205 gdbarch_unwind_sp_ftype *unwind_sp;
206 gdbarch_frame_num_args_ftype *frame_num_args;
207 gdbarch_frame_align_ftype *frame_align;
208 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
209 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
210 int frame_red_zone_size;
211 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
212 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
213 gdbarch_smash_text_address_ftype *smash_text_address;
214 gdbarch_software_single_step_ftype *software_single_step;
215 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
216 gdbarch_print_insn_ftype *print_insn;
217 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
218 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
219 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
220 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
221 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
222 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
223 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
224 const char * name_of_malloc;
225 int cannot_step_breakpoint;
226 int have_nonsteppable_watchpoint;
227 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
228 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
229 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
230 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
231 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
232 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
233 int vtable_function_descriptors;
235 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
236 gdbarch_overlay_update_ftype *overlay_update;
240 /* The default architecture uses host values (for want of a better
243 extern const struct bfd_arch_info bfd_default_arch_struct;
245 struct gdbarch startup_gdbarch =
247 1, /* Always initialized. */
248 NULL, /* The obstack. */
249 /* basic architecture information */
250 &bfd_default_arch_struct, /* bfd_arch_info */
251 BFD_ENDIAN_BIG, /* byte_order */
252 GDB_OSABI_UNKNOWN, /* osabi */
254 /* target specific vector and its dump routine */
256 /*per-architecture data-pointers and swap regions */
258 /* Multi-arch values */
259 8 * sizeof (short), /* short_bit */
260 8 * sizeof (int), /* int_bit */
261 8 * sizeof (long), /* long_bit */
262 8 * sizeof (LONGEST), /* long_long_bit */
263 8 * sizeof (float), /* float_bit */
264 0, /* float_format */
265 8 * sizeof (double), /* double_bit */
266 0, /* double_format */
267 8 * sizeof (long double), /* long_double_bit */
268 0, /* long_double_format */
269 8 * sizeof (void*), /* ptr_bit */
270 8 * sizeof (void*), /* addr_bit */
271 8 * sizeof (void*), /* bfd_vma_bit */
275 0, /* virtual_frame_pointer */
276 0, /* pseudo_register_read */
277 0, /* pseudo_register_write */
279 0, /* num_pseudo_regs */
284 0, /* stab_reg_to_regnum */
285 0, /* ecoff_reg_to_regnum */
286 0, /* dwarf_reg_to_regnum */
287 0, /* sdb_reg_to_regnum */
288 0, /* dwarf2_reg_to_regnum */
289 0, /* register_name */
290 0, /* register_type */
291 0, /* unwind_dummy_id */
292 -1, /* deprecated_fp_regnum */
293 0, /* push_dummy_call */
294 0, /* deprecated_register_size */
295 0, /* call_dummy_location */
296 0, /* push_dummy_code */
297 default_print_registers_info, /* print_registers_info */
298 0, /* print_float_info */
299 0, /* print_vector_info */
300 0, /* register_sim_regno */
301 0, /* cannot_fetch_register */
302 0, /* cannot_store_register */
303 0, /* get_longjmp_target */
304 0, /* believe_pcc_promotion */
305 0, /* convert_register_p */
306 0, /* register_to_value */
307 0, /* value_to_register */
308 0, /* value_from_register */
309 0, /* pointer_to_address */
310 0, /* address_to_pointer */
311 0, /* integer_to_address */
312 0, /* return_value */
313 0, /* extract_return_value */
314 0, /* store_return_value */
315 0, /* deprecated_use_struct_convention */
316 0, /* deprecated_extract_struct_value_address */
317 0, /* skip_prologue */
319 0, /* breakpoint_from_pc */
320 0, /* adjust_breakpoint_address */
321 0, /* memory_insert_breakpoint */
322 0, /* memory_remove_breakpoint */
323 0, /* decr_pc_after_break */
324 0, /* deprecated_function_start_offset */
325 default_remote_register_number, /* remote_register_number */
326 0, /* fetch_tls_load_module_address */
327 0, /* frame_args_skip */
330 0, /* frame_num_args */
332 0, /* deprecated_reg_struct_has_addr */
333 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
334 0, /* frame_red_zone_size */
335 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
336 0, /* addr_bits_remove */
337 0, /* smash_text_address */
338 0, /* software_single_step */
339 0, /* single_step_through_delay */
341 0, /* skip_trampoline_code */
342 generic_skip_solib_resolver, /* skip_solib_resolver */
343 0, /* in_solib_return_trampoline */
344 generic_in_function_epilogue_p, /* in_function_epilogue_p */
345 construct_inferior_arguments, /* construct_inferior_arguments */
346 0, /* elf_make_msymbol_special */
347 0, /* coff_make_msymbol_special */
348 "malloc", /* name_of_malloc */
349 0, /* cannot_step_breakpoint */
350 0, /* have_nonsteppable_watchpoint */
351 0, /* address_class_type_flags */
352 0, /* address_class_type_flags_to_name */
353 0, /* address_class_name_to_type_flags */
354 default_register_reggroup_p, /* register_reggroup_p */
355 0, /* fetch_pointer_argument */
356 0, /* regset_from_core_section */
357 0, /* vtable_function_descriptors */
358 0, /* vbit_in_delta */
359 0, /* skip_permanent_breakpoint */
360 0, /* overlay_update */
361 /* startup_gdbarch() */
364 struct gdbarch *current_gdbarch = &startup_gdbarch;
366 /* Create a new ``struct gdbarch'' based on information provided by
367 ``struct gdbarch_info''. */
370 gdbarch_alloc (const struct gdbarch_info *info,
371 struct gdbarch_tdep *tdep)
373 /* NOTE: The new architecture variable is named ``current_gdbarch''
374 so that macros such as TARGET_ARCHITECTURE, when expanded, refer to
375 the current local architecture and not the previous global
376 architecture. This ensures that the new architectures initial
377 values are not influenced by the previous architecture. Once
378 everything is parameterised with gdbarch, this will go away. */
379 struct gdbarch *current_gdbarch;
381 /* Create an obstack for allocating all the per-architecture memory,
382 then use that to allocate the architecture vector. */
383 struct obstack *obstack = XMALLOC (struct obstack);
384 obstack_init (obstack);
385 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
386 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
387 current_gdbarch->obstack = obstack;
389 alloc_gdbarch_data (current_gdbarch);
391 current_gdbarch->tdep = tdep;
393 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
394 current_gdbarch->byte_order = info->byte_order;
395 current_gdbarch->osabi = info->osabi;
396 current_gdbarch->target_desc = info->target_desc;
398 /* Force the explicit initialization of these. */
399 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
400 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
401 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
402 current_gdbarch->long_long_bit = 2*current_gdbarch->long_bit;
403 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
404 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
405 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
406 current_gdbarch->ptr_bit = current_gdbarch->int_bit;
407 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
408 current_gdbarch->char_signed = -1;
409 current_gdbarch->write_pc = generic_target_write_pc;
410 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
411 current_gdbarch->num_regs = -1;
412 current_gdbarch->sp_regnum = -1;
413 current_gdbarch->pc_regnum = -1;
414 current_gdbarch->ps_regnum = -1;
415 current_gdbarch->fp0_regnum = -1;
416 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
417 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
418 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
419 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
420 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
421 current_gdbarch->deprecated_fp_regnum = -1;
422 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
423 current_gdbarch->print_registers_info = default_print_registers_info;
424 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
425 current_gdbarch->cannot_fetch_register = cannot_register_not;
426 current_gdbarch->cannot_store_register = cannot_register_not;
427 current_gdbarch->convert_register_p = generic_convert_register_p;
428 current_gdbarch->value_from_register = default_value_from_register;
429 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
430 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
431 current_gdbarch->return_value = legacy_return_value;
432 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
433 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
434 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
435 current_gdbarch->remote_register_number = default_remote_register_number;
436 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
437 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
438 current_gdbarch->addr_bits_remove = core_addr_identity;
439 current_gdbarch->smash_text_address = core_addr_identity;
440 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
441 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
442 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
443 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
444 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
445 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
446 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
447 current_gdbarch->name_of_malloc = "malloc";
448 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
449 /* gdbarch_alloc() */
451 return current_gdbarch;
455 /* Allocate extra space using the per-architecture obstack. */
458 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
460 void *data = obstack_alloc (arch->obstack, size);
461 memset (data, 0, size);
466 /* Free a gdbarch struct. This should never happen in normal
467 operation --- once you've created a gdbarch, you keep it around.
468 However, if an architecture's init function encounters an error
469 building the structure, it may need to clean up a partially
470 constructed gdbarch. */
473 gdbarch_free (struct gdbarch *arch)
475 struct obstack *obstack;
476 gdb_assert (arch != NULL);
477 gdb_assert (!arch->initialized_p);
478 obstack = arch->obstack;
479 obstack_free (obstack, 0); /* Includes the ARCH. */
484 /* Ensure that all values in a GDBARCH are reasonable. */
486 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
487 just happens to match the global variable ``current_gdbarch''. That
488 way macros refering to that variable get the local and not the global
489 version - ulgh. Once everything is parameterised with gdbarch, this
493 verify_gdbarch (struct gdbarch *current_gdbarch)
496 struct cleanup *cleanups;
499 log = mem_fileopen ();
500 cleanups = make_cleanup_ui_file_delete (log);
502 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
503 fprintf_unfiltered (log, "\n\tbyte-order");
504 if (current_gdbarch->bfd_arch_info == NULL)
505 fprintf_unfiltered (log, "\n\tbfd_arch_info");
506 /* Check those that need to be defined for the given multi-arch level. */
507 /* Skip verify of short_bit, invalid_p == 0 */
508 /* Skip verify of int_bit, invalid_p == 0 */
509 /* Skip verify of long_bit, invalid_p == 0 */
510 /* Skip verify of long_long_bit, invalid_p == 0 */
511 /* Skip verify of float_bit, invalid_p == 0 */
512 if (current_gdbarch->float_format == 0)
513 current_gdbarch->float_format = floatformats_ieee_single;
514 /* Skip verify of double_bit, invalid_p == 0 */
515 if (current_gdbarch->double_format == 0)
516 current_gdbarch->double_format = floatformats_ieee_double;
517 /* Skip verify of long_double_bit, invalid_p == 0 */
518 if (current_gdbarch->long_double_format == 0)
519 current_gdbarch->long_double_format = floatformats_ieee_double;
520 /* Skip verify of ptr_bit, invalid_p == 0 */
521 if (current_gdbarch->addr_bit == 0)
522 current_gdbarch->addr_bit = gdbarch_ptr_bit (current_gdbarch);
523 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
524 if (current_gdbarch->char_signed == -1)
525 current_gdbarch->char_signed = 1;
526 /* Skip verify of read_pc, has predicate */
527 /* Skip verify of write_pc, invalid_p == 0 */
528 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
529 /* Skip verify of pseudo_register_read, has predicate */
530 /* Skip verify of pseudo_register_write, has predicate */
531 if (current_gdbarch->num_regs == -1)
532 fprintf_unfiltered (log, "\n\tnum_regs");
533 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
534 /* Skip verify of sp_regnum, invalid_p == 0 */
535 /* Skip verify of pc_regnum, invalid_p == 0 */
536 /* Skip verify of ps_regnum, invalid_p == 0 */
537 /* Skip verify of fp0_regnum, invalid_p == 0 */
538 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
539 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
540 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
541 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
542 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
543 /* Skip verify of register_type, has predicate */
544 /* Skip verify of unwind_dummy_id, has predicate */
545 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
546 /* Skip verify of push_dummy_call, has predicate */
547 /* Skip verify of call_dummy_location, invalid_p == 0 */
548 /* Skip verify of push_dummy_code, has predicate */
549 /* Skip verify of print_registers_info, invalid_p == 0 */
550 /* Skip verify of print_float_info, has predicate */
551 /* Skip verify of print_vector_info, has predicate */
552 /* Skip verify of register_sim_regno, invalid_p == 0 */
553 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
554 /* Skip verify of cannot_store_register, invalid_p == 0 */
555 /* Skip verify of get_longjmp_target, has predicate */
556 /* Skip verify of convert_register_p, invalid_p == 0 */
557 /* Skip verify of value_from_register, invalid_p == 0 */
558 /* Skip verify of pointer_to_address, invalid_p == 0 */
559 /* Skip verify of address_to_pointer, invalid_p == 0 */
560 /* Skip verify of integer_to_address, has predicate */
561 /* Skip verify of return_value, has predicate */
562 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
563 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
564 if (current_gdbarch->skip_prologue == 0)
565 fprintf_unfiltered (log, "\n\tskip_prologue");
566 if (current_gdbarch->inner_than == 0)
567 fprintf_unfiltered (log, "\n\tinner_than");
568 if (current_gdbarch->breakpoint_from_pc == 0)
569 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
570 /* Skip verify of adjust_breakpoint_address, has predicate */
571 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
572 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
573 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
574 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
575 /* Skip verify of remote_register_number, invalid_p == 0 */
576 /* Skip verify of fetch_tls_load_module_address, has predicate */
577 /* Skip verify of frame_args_skip, invalid_p == 0 */
578 /* Skip verify of unwind_pc, has predicate */
579 /* Skip verify of unwind_sp, has predicate */
580 /* Skip verify of frame_num_args, has predicate */
581 /* Skip verify of frame_align, has predicate */
582 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
583 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
584 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
585 /* Skip verify of addr_bits_remove, invalid_p == 0 */
586 /* Skip verify of smash_text_address, invalid_p == 0 */
587 /* Skip verify of software_single_step, has predicate */
588 /* Skip verify of single_step_through_delay, has predicate */
589 if (current_gdbarch->print_insn == 0)
590 fprintf_unfiltered (log, "\n\tprint_insn");
591 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
592 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
593 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
594 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
595 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
596 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
597 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
598 /* Skip verify of name_of_malloc, invalid_p == 0 */
599 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
600 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
601 /* Skip verify of address_class_type_flags, has predicate */
602 /* Skip verify of address_class_type_flags_to_name, has predicate */
603 /* Skip verify of address_class_name_to_type_flags, has predicate */
604 /* Skip verify of register_reggroup_p, invalid_p == 0 */
605 /* Skip verify of fetch_pointer_argument, has predicate */
606 /* Skip verify of regset_from_core_section, has predicate */
607 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
608 /* Skip verify of vbit_in_delta, invalid_p == 0 */
609 /* Skip verify of skip_permanent_breakpoint, has predicate */
610 /* Skip verify of overlay_update, has predicate */
611 buf = ui_file_xstrdup (log, &dummy);
612 make_cleanup (xfree, buf);
613 if (strlen (buf) > 0)
614 internal_error (__FILE__, __LINE__,
615 _("verify_gdbarch: the following are invalid ...%s"),
617 do_cleanups (cleanups);
621 /* Print out the details of the current architecture. */
623 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
624 just happens to match the global variable ``current_gdbarch''. That
625 way macros refering to that variable get the local and not the global
626 version - ulgh. Once everything is parameterised with gdbarch, this
630 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
632 const char *gdb_xm_file = "<not-defined>";
633 const char *gdb_nm_file = "<not-defined>";
634 const char *gdb_tm_file = "<not-defined>";
635 #if defined (GDB_XM_FILE)
636 gdb_xm_file = GDB_XM_FILE;
638 fprintf_unfiltered (file,
639 "gdbarch_dump: GDB_XM_FILE = %s\n",
641 #if defined (GDB_NM_FILE)
642 gdb_nm_file = GDB_NM_FILE;
644 fprintf_unfiltered (file,
645 "gdbarch_dump: GDB_NM_FILE = %s\n",
647 #if defined (GDB_TM_FILE)
648 gdb_tm_file = GDB_TM_FILE;
650 fprintf_unfiltered (file,
651 "gdbarch_dump: GDB_TM_FILE = %s\n",
653 #ifdef TARGET_ADDR_BIT
654 fprintf_unfiltered (file,
655 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
656 XSTRING (TARGET_ADDR_BIT));
658 fprintf_unfiltered (file,
659 "gdbarch_dump: addr_bit = %s\n",
660 paddr_d (current_gdbarch->addr_bit));
661 fprintf_unfiltered (file,
662 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
663 (long) current_gdbarch->addr_bits_remove);
664 fprintf_unfiltered (file,
665 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
666 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
667 fprintf_unfiltered (file,
668 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
669 (long) current_gdbarch->address_class_name_to_type_flags);
670 fprintf_unfiltered (file,
671 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
672 gdbarch_address_class_type_flags_p (current_gdbarch));
673 fprintf_unfiltered (file,
674 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
675 (long) current_gdbarch->address_class_type_flags);
676 fprintf_unfiltered (file,
677 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
678 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
679 fprintf_unfiltered (file,
680 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
681 (long) current_gdbarch->address_class_type_flags_to_name);
682 fprintf_unfiltered (file,
683 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
684 (long) current_gdbarch->address_to_pointer);
685 fprintf_unfiltered (file,
686 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
687 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
688 fprintf_unfiltered (file,
689 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
690 (long) current_gdbarch->adjust_breakpoint_address);
691 #ifdef BELIEVE_PCC_PROMOTION
692 fprintf_unfiltered (file,
693 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
694 XSTRING (BELIEVE_PCC_PROMOTION));
696 fprintf_unfiltered (file,
697 "gdbarch_dump: believe_pcc_promotion = %s\n",
698 paddr_d (current_gdbarch->believe_pcc_promotion));
699 #ifdef TARGET_ARCHITECTURE
700 fprintf_unfiltered (file,
701 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
702 XSTRING (TARGET_ARCHITECTURE));
704 fprintf_unfiltered (file,
705 "gdbarch_dump: bfd_arch_info = %s\n",
706 TARGET_ARCHITECTURE->printable_name);
707 fprintf_unfiltered (file,
708 "gdbarch_dump: bfd_vma_bit = %s\n",
709 paddr_d (current_gdbarch->bfd_vma_bit));
710 fprintf_unfiltered (file,
711 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
712 (long) current_gdbarch->breakpoint_from_pc);
713 fprintf_unfiltered (file,
714 "gdbarch_dump: byte_order = %s\n",
715 paddr_d (current_gdbarch->byte_order));
716 fprintf_unfiltered (file,
717 "gdbarch_dump: call_dummy_location = %s\n",
718 paddr_d (current_gdbarch->call_dummy_location));
719 fprintf_unfiltered (file,
720 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
721 (long) current_gdbarch->cannot_fetch_register);
722 fprintf_unfiltered (file,
723 "gdbarch_dump: cannot_step_breakpoint = %s\n",
724 paddr_d (current_gdbarch->cannot_step_breakpoint));
725 fprintf_unfiltered (file,
726 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
727 (long) current_gdbarch->cannot_store_register);
728 fprintf_unfiltered (file,
729 "gdbarch_dump: char_signed = %s\n",
730 paddr_d (current_gdbarch->char_signed));
731 fprintf_unfiltered (file,
732 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
733 (long) current_gdbarch->coff_make_msymbol_special);
734 fprintf_unfiltered (file,
735 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
736 (long) current_gdbarch->construct_inferior_arguments);
737 fprintf_unfiltered (file,
738 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
739 (long) current_gdbarch->convert_from_func_ptr_addr);
740 fprintf_unfiltered (file,
741 "gdbarch_dump: convert_register_p = <0x%lx>\n",
742 (long) current_gdbarch->convert_register_p);
743 fprintf_unfiltered (file,
744 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
745 paddr_nz (current_gdbarch->decr_pc_after_break));
746 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
747 fprintf_unfiltered (file,
748 "gdbarch_dump: %s # %s\n",
749 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
750 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
752 fprintf_unfiltered (file,
753 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
754 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
755 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
756 fprintf_unfiltered (file,
757 "gdbarch_dump: %s # %s\n",
758 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
759 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
761 fprintf_unfiltered (file,
762 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
763 (long) current_gdbarch->deprecated_extract_struct_value_address);
764 #ifdef DEPRECATED_FP_REGNUM
765 fprintf_unfiltered (file,
766 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
767 XSTRING (DEPRECATED_FP_REGNUM));
769 fprintf_unfiltered (file,
770 "gdbarch_dump: deprecated_fp_regnum = %s\n",
771 paddr_d (current_gdbarch->deprecated_fp_regnum));
772 #ifdef DEPRECATED_FUNCTION_START_OFFSET
773 fprintf_unfiltered (file,
774 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
775 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
777 fprintf_unfiltered (file,
778 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
779 paddr_nz (current_gdbarch->deprecated_function_start_offset));
780 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
781 fprintf_unfiltered (file,
782 "gdbarch_dump: %s # %s\n",
783 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
784 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
786 fprintf_unfiltered (file,
787 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
788 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
789 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
790 fprintf_unfiltered (file,
791 "gdbarch_dump: %s # %s\n",
792 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
793 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
795 fprintf_unfiltered (file,
796 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
797 (long) current_gdbarch->deprecated_reg_struct_has_addr);
798 #ifdef DEPRECATED_REGISTER_SIZE
799 fprintf_unfiltered (file,
800 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
801 XSTRING (DEPRECATED_REGISTER_SIZE));
803 fprintf_unfiltered (file,
804 "gdbarch_dump: deprecated_register_size = %s\n",
805 paddr_d (current_gdbarch->deprecated_register_size));
806 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
807 fprintf_unfiltered (file,
808 "gdbarch_dump: %s # %s\n",
809 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
810 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
812 fprintf_unfiltered (file,
813 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
814 (long) current_gdbarch->deprecated_use_struct_convention);
815 fprintf_unfiltered (file,
816 "gdbarch_dump: double_bit = %s\n",
817 paddr_d (current_gdbarch->double_bit));
818 fprintf_unfiltered (file,
819 "gdbarch_dump: double_format = %s\n",
820 pformat (current_gdbarch->double_format));
821 fprintf_unfiltered (file,
822 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
823 (long) current_gdbarch->dwarf2_reg_to_regnum);
824 fprintf_unfiltered (file,
825 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
826 (long) current_gdbarch->dwarf_reg_to_regnum);
827 fprintf_unfiltered (file,
828 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
829 (long) current_gdbarch->ecoff_reg_to_regnum);
830 fprintf_unfiltered (file,
831 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
832 (long) current_gdbarch->elf_make_msymbol_special);
833 #ifdef EXTRACT_RETURN_VALUE
834 fprintf_unfiltered (file,
835 "gdbarch_dump: %s # %s\n",
836 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
837 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
839 fprintf_unfiltered (file,
840 "gdbarch_dump: extract_return_value = <0x%lx>\n",
841 (long) current_gdbarch->extract_return_value);
842 fprintf_unfiltered (file,
843 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
844 gdbarch_fetch_pointer_argument_p (current_gdbarch));
845 fprintf_unfiltered (file,
846 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
847 (long) current_gdbarch->fetch_pointer_argument);
848 fprintf_unfiltered (file,
849 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
850 gdbarch_fetch_tls_load_module_address_p (current_gdbarch));
851 fprintf_unfiltered (file,
852 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
853 (long) current_gdbarch->fetch_tls_load_module_address);
854 fprintf_unfiltered (file,
855 "gdbarch_dump: float_bit = %s\n",
856 paddr_d (current_gdbarch->float_bit));
857 fprintf_unfiltered (file,
858 "gdbarch_dump: float_format = %s\n",
859 pformat (current_gdbarch->float_format));
861 fprintf_unfiltered (file,
862 "gdbarch_dump: FP0_REGNUM # %s\n",
863 XSTRING (FP0_REGNUM));
865 fprintf_unfiltered (file,
866 "gdbarch_dump: fp0_regnum = %s\n",
867 paddr_d (current_gdbarch->fp0_regnum));
868 fprintf_unfiltered (file,
869 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
870 gdbarch_frame_align_p (current_gdbarch));
871 fprintf_unfiltered (file,
872 "gdbarch_dump: frame_align = <0x%lx>\n",
873 (long) current_gdbarch->frame_align);
874 fprintf_unfiltered (file,
875 "gdbarch_dump: frame_args_skip = 0x%s\n",
876 paddr_nz (current_gdbarch->frame_args_skip));
877 fprintf_unfiltered (file,
878 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
879 gdbarch_frame_num_args_p (current_gdbarch));
880 fprintf_unfiltered (file,
881 "gdbarch_dump: frame_num_args = <0x%lx>\n",
882 (long) current_gdbarch->frame_num_args);
883 fprintf_unfiltered (file,
884 "gdbarch_dump: frame_red_zone_size = %s\n",
885 paddr_d (current_gdbarch->frame_red_zone_size));
886 fprintf_unfiltered (file,
887 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
888 gdbarch_get_longjmp_target_p (current_gdbarch));
889 fprintf_unfiltered (file,
890 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
891 (long) current_gdbarch->get_longjmp_target);
892 fprintf_unfiltered (file,
893 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
894 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
895 fprintf_unfiltered (file,
896 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
897 (long) current_gdbarch->in_function_epilogue_p);
898 fprintf_unfiltered (file,
899 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
900 (long) current_gdbarch->in_solib_return_trampoline);
901 fprintf_unfiltered (file,
902 "gdbarch_dump: inner_than = <0x%lx>\n",
903 (long) current_gdbarch->inner_than);
904 fprintf_unfiltered (file,
905 "gdbarch_dump: int_bit = %s\n",
906 paddr_d (current_gdbarch->int_bit));
907 fprintf_unfiltered (file,
908 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
909 gdbarch_integer_to_address_p (current_gdbarch));
910 fprintf_unfiltered (file,
911 "gdbarch_dump: integer_to_address = <0x%lx>\n",
912 (long) current_gdbarch->integer_to_address);
913 fprintf_unfiltered (file,
914 "gdbarch_dump: long_bit = %s\n",
915 paddr_d (current_gdbarch->long_bit));
916 fprintf_unfiltered (file,
917 "gdbarch_dump: long_double_bit = %s\n",
918 paddr_d (current_gdbarch->long_double_bit));
919 fprintf_unfiltered (file,
920 "gdbarch_dump: long_double_format = %s\n",
921 pformat (current_gdbarch->long_double_format));
922 fprintf_unfiltered (file,
923 "gdbarch_dump: long_long_bit = %s\n",
924 paddr_d (current_gdbarch->long_long_bit));
925 fprintf_unfiltered (file,
926 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
927 (long) current_gdbarch->memory_insert_breakpoint);
928 fprintf_unfiltered (file,
929 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
930 (long) current_gdbarch->memory_remove_breakpoint);
931 fprintf_unfiltered (file,
932 "gdbarch_dump: name_of_malloc = %s\n",
933 current_gdbarch->name_of_malloc);
934 fprintf_unfiltered (file,
935 "gdbarch_dump: num_pseudo_regs = %s\n",
936 paddr_d (current_gdbarch->num_pseudo_regs));
937 fprintf_unfiltered (file,
938 "gdbarch_dump: num_regs = %s\n",
939 paddr_d (current_gdbarch->num_regs));
940 fprintf_unfiltered (file,
941 "gdbarch_dump: osabi = %s\n",
942 paddr_d (current_gdbarch->osabi));
943 fprintf_unfiltered (file,
944 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
945 gdbarch_overlay_update_p (current_gdbarch));
946 fprintf_unfiltered (file,
947 "gdbarch_dump: overlay_update = <0x%lx>\n",
948 (long) current_gdbarch->overlay_update);
950 fprintf_unfiltered (file,
951 "gdbarch_dump: PC_REGNUM # %s\n",
952 XSTRING (PC_REGNUM));
954 fprintf_unfiltered (file,
955 "gdbarch_dump: pc_regnum = %s\n",
956 paddr_d (current_gdbarch->pc_regnum));
957 fprintf_unfiltered (file,
958 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
959 (long) current_gdbarch->pointer_to_address);
960 fprintf_unfiltered (file,
961 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
962 gdbarch_print_float_info_p (current_gdbarch));
963 fprintf_unfiltered (file,
964 "gdbarch_dump: print_float_info = <0x%lx>\n",
965 (long) current_gdbarch->print_float_info);
966 #ifdef TARGET_PRINT_INSN
967 fprintf_unfiltered (file,
968 "gdbarch_dump: %s # %s\n",
969 "TARGET_PRINT_INSN(vma, info)",
970 XSTRING (TARGET_PRINT_INSN (vma, info)));
972 fprintf_unfiltered (file,
973 "gdbarch_dump: print_insn = <0x%lx>\n",
974 (long) current_gdbarch->print_insn);
975 fprintf_unfiltered (file,
976 "gdbarch_dump: print_registers_info = <0x%lx>\n",
977 (long) current_gdbarch->print_registers_info);
978 fprintf_unfiltered (file,
979 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
980 gdbarch_print_vector_info_p (current_gdbarch));
981 fprintf_unfiltered (file,
982 "gdbarch_dump: print_vector_info = <0x%lx>\n",
983 (long) current_gdbarch->print_vector_info);
985 fprintf_unfiltered (file,
986 "gdbarch_dump: PS_REGNUM # %s\n",
987 XSTRING (PS_REGNUM));
989 fprintf_unfiltered (file,
990 "gdbarch_dump: ps_regnum = %s\n",
991 paddr_d (current_gdbarch->ps_regnum));
992 fprintf_unfiltered (file,
993 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
994 gdbarch_pseudo_register_read_p (current_gdbarch));
995 fprintf_unfiltered (file,
996 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
997 (long) current_gdbarch->pseudo_register_read);
998 fprintf_unfiltered (file,
999 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1000 gdbarch_pseudo_register_write_p (current_gdbarch));
1001 fprintf_unfiltered (file,
1002 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1003 (long) current_gdbarch->pseudo_register_write);
1004 fprintf_unfiltered (file,
1005 "gdbarch_dump: ptr_bit = %s\n",
1006 paddr_d (current_gdbarch->ptr_bit));
1007 fprintf_unfiltered (file,
1008 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1009 gdbarch_push_dummy_call_p (current_gdbarch));
1010 fprintf_unfiltered (file,
1011 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1012 (long) current_gdbarch->push_dummy_call);
1013 fprintf_unfiltered (file,
1014 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1015 gdbarch_push_dummy_code_p (current_gdbarch));
1016 fprintf_unfiltered (file,
1017 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1018 (long) current_gdbarch->push_dummy_code);
1019 #ifdef TARGET_READ_PC_P
1020 fprintf_unfiltered (file,
1021 "gdbarch_dump: %s # %s\n",
1022 "TARGET_READ_PC_P()",
1023 XSTRING (TARGET_READ_PC_P ()));
1025 fprintf_unfiltered (file,
1026 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1027 gdbarch_read_pc_p (current_gdbarch));
1028 #ifdef TARGET_READ_PC
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: %s # %s\n",
1031 "TARGET_READ_PC(ptid)",
1032 XSTRING (TARGET_READ_PC (ptid)));
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: read_pc = <0x%lx>\n",
1036 (long) current_gdbarch->read_pc);
1037 fprintf_unfiltered (file,
1038 "gdbarch_dump: register_name = <0x%lx>\n",
1039 (long) current_gdbarch->register_name);
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1042 (long) current_gdbarch->register_reggroup_p);
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1045 (long) current_gdbarch->register_sim_regno);
1046 fprintf_unfiltered (file,
1047 "gdbarch_dump: register_to_value = <0x%lx>\n",
1048 (long) current_gdbarch->register_to_value);
1049 fprintf_unfiltered (file,
1050 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1051 gdbarch_register_type_p (current_gdbarch));
1052 fprintf_unfiltered (file,
1053 "gdbarch_dump: register_type = <0x%lx>\n",
1054 (long) current_gdbarch->register_type);
1055 fprintf_unfiltered (file,
1056 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1057 gdbarch_regset_from_core_section_p (current_gdbarch));
1058 fprintf_unfiltered (file,
1059 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1060 (long) current_gdbarch->regset_from_core_section);
1061 fprintf_unfiltered (file,
1062 "gdbarch_dump: remote_register_number = <0x%lx>\n",
1063 (long) current_gdbarch->remote_register_number);
1064 fprintf_unfiltered (file,
1065 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1066 gdbarch_return_value_p (current_gdbarch));
1067 fprintf_unfiltered (file,
1068 "gdbarch_dump: return_value = <0x%lx>\n",
1069 (long) current_gdbarch->return_value);
1070 fprintf_unfiltered (file,
1071 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1072 (long) current_gdbarch->sdb_reg_to_regnum);
1073 fprintf_unfiltered (file,
1074 "gdbarch_dump: short_bit = %s\n",
1075 paddr_d (current_gdbarch->short_bit));
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1078 gdbarch_single_step_through_delay_p (current_gdbarch));
1079 fprintf_unfiltered (file,
1080 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1081 (long) current_gdbarch->single_step_through_delay);
1082 fprintf_unfiltered (file,
1083 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1084 gdbarch_skip_permanent_breakpoint_p (current_gdbarch));
1085 fprintf_unfiltered (file,
1086 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1087 (long) current_gdbarch->skip_permanent_breakpoint);
1088 fprintf_unfiltered (file,
1089 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1090 (long) current_gdbarch->skip_prologue);
1091 fprintf_unfiltered (file,
1092 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1093 (long) current_gdbarch->skip_solib_resolver);
1094 fprintf_unfiltered (file,
1095 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1096 (long) current_gdbarch->skip_trampoline_code);
1097 fprintf_unfiltered (file,
1098 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1099 (long) current_gdbarch->smash_text_address);
1100 #ifdef SOFTWARE_SINGLE_STEP_P
1101 fprintf_unfiltered (file,
1102 "gdbarch_dump: %s # %s\n",
1103 "SOFTWARE_SINGLE_STEP_P()",
1104 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1106 fprintf_unfiltered (file,
1107 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1108 gdbarch_software_single_step_p (current_gdbarch));
1109 #ifdef SOFTWARE_SINGLE_STEP
1110 fprintf_unfiltered (file,
1111 "gdbarch_dump: %s # %s\n",
1112 "SOFTWARE_SINGLE_STEP(regcache)",
1113 XSTRING (SOFTWARE_SINGLE_STEP (regcache)));
1115 fprintf_unfiltered (file,
1116 "gdbarch_dump: software_single_step = <0x%lx>\n",
1117 (long) current_gdbarch->software_single_step);
1119 fprintf_unfiltered (file,
1120 "gdbarch_dump: SP_REGNUM # %s\n",
1121 XSTRING (SP_REGNUM));
1123 fprintf_unfiltered (file,
1124 "gdbarch_dump: sp_regnum = %s\n",
1125 paddr_d (current_gdbarch->sp_regnum));
1126 fprintf_unfiltered (file,
1127 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1128 (long) current_gdbarch->stab_reg_to_regnum);
1129 fprintf_unfiltered (file,
1130 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1131 (long) current_gdbarch->stabs_argument_has_addr);
1132 #ifdef STORE_RETURN_VALUE
1133 fprintf_unfiltered (file,
1134 "gdbarch_dump: %s # %s\n",
1135 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1136 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1138 fprintf_unfiltered (file,
1139 "gdbarch_dump: store_return_value = <0x%lx>\n",
1140 (long) current_gdbarch->store_return_value);
1141 fprintf_unfiltered (file,
1142 "gdbarch_dump: target_desc = %s\n",
1143 paddr_d ((long) current_gdbarch->target_desc));
1144 fprintf_unfiltered (file,
1145 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1146 gdbarch_unwind_dummy_id_p (current_gdbarch));
1147 fprintf_unfiltered (file,
1148 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1149 (long) current_gdbarch->unwind_dummy_id);
1150 fprintf_unfiltered (file,
1151 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1152 gdbarch_unwind_pc_p (current_gdbarch));
1153 fprintf_unfiltered (file,
1154 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1155 (long) current_gdbarch->unwind_pc);
1156 fprintf_unfiltered (file,
1157 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1158 gdbarch_unwind_sp_p (current_gdbarch));
1159 fprintf_unfiltered (file,
1160 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1161 (long) current_gdbarch->unwind_sp);
1162 fprintf_unfiltered (file,
1163 "gdbarch_dump: value_from_register = <0x%lx>\n",
1164 (long) current_gdbarch->value_from_register);
1165 fprintf_unfiltered (file,
1166 "gdbarch_dump: value_to_register = <0x%lx>\n",
1167 (long) current_gdbarch->value_to_register);
1168 fprintf_unfiltered (file,
1169 "gdbarch_dump: vbit_in_delta = %s\n",
1170 paddr_d (current_gdbarch->vbit_in_delta));
1171 fprintf_unfiltered (file,
1172 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1173 (long) current_gdbarch->virtual_frame_pointer);
1174 fprintf_unfiltered (file,
1175 "gdbarch_dump: vtable_function_descriptors = %s\n",
1176 paddr_d (current_gdbarch->vtable_function_descriptors));
1177 #ifdef TARGET_WRITE_PC
1178 fprintf_unfiltered (file,
1179 "gdbarch_dump: %s # %s\n",
1180 "TARGET_WRITE_PC(val, ptid)",
1181 XSTRING (TARGET_WRITE_PC (val, ptid)));
1183 fprintf_unfiltered (file,
1184 "gdbarch_dump: write_pc = <0x%lx>\n",
1185 (long) current_gdbarch->write_pc);
1186 if (current_gdbarch->dump_tdep != NULL)
1187 current_gdbarch->dump_tdep (current_gdbarch, file);
1190 struct gdbarch_tdep *
1191 gdbarch_tdep (struct gdbarch *gdbarch)
1193 if (gdbarch_debug >= 2)
1194 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1195 return gdbarch->tdep;
1199 const struct bfd_arch_info *
1200 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1202 gdb_assert (gdbarch != NULL);
1203 if (gdbarch_debug >= 2)
1204 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1205 return gdbarch->bfd_arch_info;
1209 gdbarch_byte_order (struct gdbarch *gdbarch)
1211 gdb_assert (gdbarch != NULL);
1212 if (gdbarch_debug >= 2)
1213 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1214 return gdbarch->byte_order;
1218 gdbarch_osabi (struct gdbarch *gdbarch)
1220 gdb_assert (gdbarch != NULL);
1221 if (gdbarch_debug >= 2)
1222 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1223 return gdbarch->osabi;
1226 const struct target_desc *
1227 gdbarch_target_desc (struct gdbarch *gdbarch)
1229 gdb_assert (gdbarch != NULL);
1230 if (gdbarch_debug >= 2)
1231 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1232 return gdbarch->target_desc;
1236 gdbarch_short_bit (struct gdbarch *gdbarch)
1238 gdb_assert (gdbarch != NULL);
1239 /* Skip verify of short_bit, invalid_p == 0 */
1240 if (gdbarch_debug >= 2)
1241 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1242 return gdbarch->short_bit;
1246 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1249 gdbarch->short_bit = short_bit;
1253 gdbarch_int_bit (struct gdbarch *gdbarch)
1255 gdb_assert (gdbarch != NULL);
1256 /* Skip verify of int_bit, invalid_p == 0 */
1257 if (gdbarch_debug >= 2)
1258 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1259 return gdbarch->int_bit;
1263 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1266 gdbarch->int_bit = int_bit;
1270 gdbarch_long_bit (struct gdbarch *gdbarch)
1272 gdb_assert (gdbarch != NULL);
1273 /* Skip verify of long_bit, invalid_p == 0 */
1274 if (gdbarch_debug >= 2)
1275 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1276 return gdbarch->long_bit;
1280 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1283 gdbarch->long_bit = long_bit;
1287 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1289 gdb_assert (gdbarch != NULL);
1290 /* Skip verify of long_long_bit, invalid_p == 0 */
1291 if (gdbarch_debug >= 2)
1292 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1293 return gdbarch->long_long_bit;
1297 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1300 gdbarch->long_long_bit = long_long_bit;
1304 gdbarch_float_bit (struct gdbarch *gdbarch)
1306 gdb_assert (gdbarch != NULL);
1307 /* Skip verify of float_bit, invalid_p == 0 */
1308 if (gdbarch_debug >= 2)
1309 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1310 return gdbarch->float_bit;
1314 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1317 gdbarch->float_bit = float_bit;
1320 const struct floatformat **
1321 gdbarch_float_format (struct gdbarch *gdbarch)
1323 gdb_assert (gdbarch != NULL);
1324 if (gdbarch_debug >= 2)
1325 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1326 return gdbarch->float_format;
1330 set_gdbarch_float_format (struct gdbarch *gdbarch,
1331 const struct floatformat ** float_format)
1333 gdbarch->float_format = float_format;
1337 gdbarch_double_bit (struct gdbarch *gdbarch)
1339 gdb_assert (gdbarch != NULL);
1340 /* Skip verify of double_bit, invalid_p == 0 */
1341 if (gdbarch_debug >= 2)
1342 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1343 return gdbarch->double_bit;
1347 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1350 gdbarch->double_bit = double_bit;
1353 const struct floatformat **
1354 gdbarch_double_format (struct gdbarch *gdbarch)
1356 gdb_assert (gdbarch != NULL);
1357 if (gdbarch_debug >= 2)
1358 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1359 return gdbarch->double_format;
1363 set_gdbarch_double_format (struct gdbarch *gdbarch,
1364 const struct floatformat ** double_format)
1366 gdbarch->double_format = double_format;
1370 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1372 gdb_assert (gdbarch != NULL);
1373 /* Skip verify of long_double_bit, invalid_p == 0 */
1374 if (gdbarch_debug >= 2)
1375 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1376 return gdbarch->long_double_bit;
1380 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1381 int long_double_bit)
1383 gdbarch->long_double_bit = long_double_bit;
1386 const struct floatformat **
1387 gdbarch_long_double_format (struct gdbarch *gdbarch)
1389 gdb_assert (gdbarch != NULL);
1390 if (gdbarch_debug >= 2)
1391 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1392 return gdbarch->long_double_format;
1396 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1397 const struct floatformat ** long_double_format)
1399 gdbarch->long_double_format = long_double_format;
1403 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1405 gdb_assert (gdbarch != NULL);
1406 /* Skip verify of ptr_bit, invalid_p == 0 */
1407 if (gdbarch_debug >= 2)
1408 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1409 return gdbarch->ptr_bit;
1413 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1416 gdbarch->ptr_bit = ptr_bit;
1420 gdbarch_addr_bit (struct gdbarch *gdbarch)
1422 gdb_assert (gdbarch != NULL);
1423 /* Check variable changed from pre-default. */
1424 gdb_assert (gdbarch->addr_bit != 0);
1425 if (gdbarch_debug >= 2)
1426 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1427 return gdbarch->addr_bit;
1431 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1434 gdbarch->addr_bit = addr_bit;
1438 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1440 gdb_assert (gdbarch != NULL);
1441 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1442 if (gdbarch_debug >= 2)
1443 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1444 return gdbarch->bfd_vma_bit;
1448 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1451 gdbarch->bfd_vma_bit = bfd_vma_bit;
1455 gdbarch_char_signed (struct gdbarch *gdbarch)
1457 gdb_assert (gdbarch != NULL);
1458 /* Check variable changed from pre-default. */
1459 gdb_assert (gdbarch->char_signed != -1);
1460 if (gdbarch_debug >= 2)
1461 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1462 return gdbarch->char_signed;
1466 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1469 gdbarch->char_signed = char_signed;
1473 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1475 gdb_assert (gdbarch != NULL);
1476 return gdbarch->read_pc != NULL;
1480 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
1482 gdb_assert (gdbarch != NULL);
1483 gdb_assert (gdbarch->read_pc != NULL);
1484 if (gdbarch_debug >= 2)
1485 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1486 return gdbarch->read_pc (ptid);
1490 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1491 gdbarch_read_pc_ftype read_pc)
1493 gdbarch->read_pc = read_pc;
1497 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
1499 gdb_assert (gdbarch != NULL);
1500 gdb_assert (gdbarch->write_pc != NULL);
1501 if (gdbarch_debug >= 2)
1502 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1503 gdbarch->write_pc (val, ptid);
1507 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1508 gdbarch_write_pc_ftype write_pc)
1510 gdbarch->write_pc = write_pc;
1514 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1516 gdb_assert (gdbarch != NULL);
1517 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1518 if (gdbarch_debug >= 2)
1519 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1520 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1524 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1525 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1527 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1531 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1533 gdb_assert (gdbarch != NULL);
1534 return gdbarch->pseudo_register_read != NULL;
1538 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1540 gdb_assert (gdbarch != NULL);
1541 gdb_assert (gdbarch->pseudo_register_read != NULL);
1542 if (gdbarch_debug >= 2)
1543 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1544 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1548 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1549 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1551 gdbarch->pseudo_register_read = pseudo_register_read;
1555 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1557 gdb_assert (gdbarch != NULL);
1558 return gdbarch->pseudo_register_write != NULL;
1562 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1564 gdb_assert (gdbarch != NULL);
1565 gdb_assert (gdbarch->pseudo_register_write != NULL);
1566 if (gdbarch_debug >= 2)
1567 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1568 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1572 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1573 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1575 gdbarch->pseudo_register_write = pseudo_register_write;
1579 gdbarch_num_regs (struct gdbarch *gdbarch)
1581 gdb_assert (gdbarch != NULL);
1582 /* Check variable changed from pre-default. */
1583 gdb_assert (gdbarch->num_regs != -1);
1584 if (gdbarch_debug >= 2)
1585 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1586 return gdbarch->num_regs;
1590 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1593 gdbarch->num_regs = num_regs;
1597 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1599 gdb_assert (gdbarch != NULL);
1600 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1601 if (gdbarch_debug >= 2)
1602 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1603 return gdbarch->num_pseudo_regs;
1607 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1608 int num_pseudo_regs)
1610 gdbarch->num_pseudo_regs = num_pseudo_regs;
1614 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1616 gdb_assert (gdbarch != NULL);
1617 /* Skip verify of sp_regnum, invalid_p == 0 */
1618 if (gdbarch_debug >= 2)
1619 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1620 return gdbarch->sp_regnum;
1624 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1627 gdbarch->sp_regnum = sp_regnum;
1631 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1633 gdb_assert (gdbarch != NULL);
1634 /* Skip verify of pc_regnum, invalid_p == 0 */
1635 if (gdbarch_debug >= 2)
1636 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1637 return gdbarch->pc_regnum;
1641 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1644 gdbarch->pc_regnum = pc_regnum;
1648 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1650 gdb_assert (gdbarch != NULL);
1651 /* Skip verify of ps_regnum, invalid_p == 0 */
1652 if (gdbarch_debug >= 2)
1653 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1654 return gdbarch->ps_regnum;
1658 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1661 gdbarch->ps_regnum = ps_regnum;
1665 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1667 gdb_assert (gdbarch != NULL);
1668 /* Skip verify of fp0_regnum, invalid_p == 0 */
1669 if (gdbarch_debug >= 2)
1670 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1671 return gdbarch->fp0_regnum;
1675 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1678 gdbarch->fp0_regnum = fp0_regnum;
1682 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1684 gdb_assert (gdbarch != NULL);
1685 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1686 if (gdbarch_debug >= 2)
1687 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1688 return gdbarch->stab_reg_to_regnum (stab_regnr);
1692 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1693 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1695 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1699 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1701 gdb_assert (gdbarch != NULL);
1702 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1703 if (gdbarch_debug >= 2)
1704 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1705 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
1709 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1710 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1712 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1716 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
1718 gdb_assert (gdbarch != NULL);
1719 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
1720 if (gdbarch_debug >= 2)
1721 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
1722 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
1726 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
1727 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
1729 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
1733 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1735 gdb_assert (gdbarch != NULL);
1736 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1737 if (gdbarch_debug >= 2)
1738 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1739 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
1743 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1744 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1746 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1750 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1752 gdb_assert (gdbarch != NULL);
1753 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1754 if (gdbarch_debug >= 2)
1755 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1756 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
1760 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1761 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1763 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1767 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1769 gdb_assert (gdbarch != NULL);
1770 gdb_assert (gdbarch->register_name != NULL);
1771 if (gdbarch_debug >= 2)
1772 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1773 return gdbarch->register_name (regnr);
1777 set_gdbarch_register_name (struct gdbarch *gdbarch,
1778 gdbarch_register_name_ftype register_name)
1780 gdbarch->register_name = register_name;
1784 gdbarch_register_type_p (struct gdbarch *gdbarch)
1786 gdb_assert (gdbarch != NULL);
1787 return gdbarch->register_type != NULL;
1791 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1793 gdb_assert (gdbarch != NULL);
1794 gdb_assert (gdbarch->register_type != NULL);
1795 if (gdbarch_debug >= 2)
1796 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1797 return gdbarch->register_type (gdbarch, reg_nr);
1801 set_gdbarch_register_type (struct gdbarch *gdbarch,
1802 gdbarch_register_type_ftype register_type)
1804 gdbarch->register_type = register_type;
1808 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
1810 gdb_assert (gdbarch != NULL);
1811 return gdbarch->unwind_dummy_id != NULL;
1815 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
1817 gdb_assert (gdbarch != NULL);
1818 gdb_assert (gdbarch->unwind_dummy_id != NULL);
1819 if (gdbarch_debug >= 2)
1820 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
1821 return gdbarch->unwind_dummy_id (gdbarch, info);
1825 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
1826 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
1828 gdbarch->unwind_dummy_id = unwind_dummy_id;
1832 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1834 gdb_assert (gdbarch != NULL);
1835 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1836 if (gdbarch_debug >= 2)
1837 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1838 return gdbarch->deprecated_fp_regnum;
1842 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1843 int deprecated_fp_regnum)
1845 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1849 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1851 gdb_assert (gdbarch != NULL);
1852 return gdbarch->push_dummy_call != NULL;
1856 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)
1858 gdb_assert (gdbarch != NULL);
1859 gdb_assert (gdbarch->push_dummy_call != NULL);
1860 if (gdbarch_debug >= 2)
1861 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1862 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1866 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1867 gdbarch_push_dummy_call_ftype push_dummy_call)
1869 gdbarch->push_dummy_call = push_dummy_call;
1873 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
1875 gdb_assert (gdbarch != NULL);
1876 if (gdbarch_debug >= 2)
1877 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
1878 return gdbarch->deprecated_register_size;
1882 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
1883 int deprecated_register_size)
1885 gdbarch->deprecated_register_size = deprecated_register_size;
1889 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1891 gdb_assert (gdbarch != NULL);
1892 /* Skip verify of call_dummy_location, invalid_p == 0 */
1893 if (gdbarch_debug >= 2)
1894 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1895 return gdbarch->call_dummy_location;
1899 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1900 int call_dummy_location)
1902 gdbarch->call_dummy_location = call_dummy_location;
1906 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1908 gdb_assert (gdbarch != NULL);
1909 return gdbarch->push_dummy_code != NULL;
1913 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)
1915 gdb_assert (gdbarch != NULL);
1916 gdb_assert (gdbarch->push_dummy_code != NULL);
1917 if (gdbarch_debug >= 2)
1918 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1919 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
1923 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1924 gdbarch_push_dummy_code_ftype push_dummy_code)
1926 gdbarch->push_dummy_code = push_dummy_code;
1930 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1932 gdb_assert (gdbarch != NULL);
1933 gdb_assert (gdbarch->print_registers_info != NULL);
1934 if (gdbarch_debug >= 2)
1935 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1936 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1940 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1941 gdbarch_print_registers_info_ftype print_registers_info)
1943 gdbarch->print_registers_info = print_registers_info;
1947 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1949 gdb_assert (gdbarch != NULL);
1950 return gdbarch->print_float_info != NULL;
1954 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1956 gdb_assert (gdbarch != NULL);
1957 gdb_assert (gdbarch->print_float_info != NULL);
1958 if (gdbarch_debug >= 2)
1959 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1960 gdbarch->print_float_info (gdbarch, file, frame, args);
1964 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1965 gdbarch_print_float_info_ftype print_float_info)
1967 gdbarch->print_float_info = print_float_info;
1971 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1973 gdb_assert (gdbarch != NULL);
1974 return gdbarch->print_vector_info != NULL;
1978 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1980 gdb_assert (gdbarch != NULL);
1981 gdb_assert (gdbarch->print_vector_info != NULL);
1982 if (gdbarch_debug >= 2)
1983 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
1984 gdbarch->print_vector_info (gdbarch, file, frame, args);
1988 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
1989 gdbarch_print_vector_info_ftype print_vector_info)
1991 gdbarch->print_vector_info = print_vector_info;
1995 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
1997 gdb_assert (gdbarch != NULL);
1998 gdb_assert (gdbarch->register_sim_regno != NULL);
1999 if (gdbarch_debug >= 2)
2000 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2001 return gdbarch->register_sim_regno (reg_nr);
2005 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2006 gdbarch_register_sim_regno_ftype register_sim_regno)
2008 gdbarch->register_sim_regno = register_sim_regno;
2012 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2014 gdb_assert (gdbarch != NULL);
2015 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2016 if (gdbarch_debug >= 2)
2017 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2018 return gdbarch->cannot_fetch_register (regnum);
2022 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2023 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2025 gdbarch->cannot_fetch_register = cannot_fetch_register;
2029 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2031 gdb_assert (gdbarch != NULL);
2032 gdb_assert (gdbarch->cannot_store_register != NULL);
2033 if (gdbarch_debug >= 2)
2034 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2035 return gdbarch->cannot_store_register (regnum);
2039 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2040 gdbarch_cannot_store_register_ftype cannot_store_register)
2042 gdbarch->cannot_store_register = cannot_store_register;
2046 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2048 gdb_assert (gdbarch != NULL);
2049 return gdbarch->get_longjmp_target != NULL;
2053 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
2055 gdb_assert (gdbarch != NULL);
2056 gdb_assert (gdbarch->get_longjmp_target != NULL);
2057 if (gdbarch_debug >= 2)
2058 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2059 return gdbarch->get_longjmp_target (pc);
2063 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2064 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2066 gdbarch->get_longjmp_target = get_longjmp_target;
2070 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2072 gdb_assert (gdbarch != NULL);
2073 if (gdbarch_debug >= 2)
2074 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2075 return gdbarch->believe_pcc_promotion;
2079 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2080 int believe_pcc_promotion)
2082 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2086 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2088 gdb_assert (gdbarch != NULL);
2089 gdb_assert (gdbarch->convert_register_p != NULL);
2090 if (gdbarch_debug >= 2)
2091 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2092 return gdbarch->convert_register_p (regnum, type);
2096 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2097 gdbarch_convert_register_p_ftype convert_register_p)
2099 gdbarch->convert_register_p = convert_register_p;
2103 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2105 gdb_assert (gdbarch != NULL);
2106 gdb_assert (gdbarch->register_to_value != NULL);
2107 if (gdbarch_debug >= 2)
2108 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2109 gdbarch->register_to_value (frame, regnum, type, buf);
2113 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2114 gdbarch_register_to_value_ftype register_to_value)
2116 gdbarch->register_to_value = register_to_value;
2120 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2122 gdb_assert (gdbarch != NULL);
2123 gdb_assert (gdbarch->value_to_register != NULL);
2124 if (gdbarch_debug >= 2)
2125 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2126 gdbarch->value_to_register (frame, regnum, type, buf);
2130 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2131 gdbarch_value_to_register_ftype value_to_register)
2133 gdbarch->value_to_register = value_to_register;
2137 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2139 gdb_assert (gdbarch != NULL);
2140 gdb_assert (gdbarch->value_from_register != NULL);
2141 if (gdbarch_debug >= 2)
2142 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2143 return gdbarch->value_from_register (type, regnum, frame);
2147 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2148 gdbarch_value_from_register_ftype value_from_register)
2150 gdbarch->value_from_register = value_from_register;
2154 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2156 gdb_assert (gdbarch != NULL);
2157 gdb_assert (gdbarch->pointer_to_address != NULL);
2158 if (gdbarch_debug >= 2)
2159 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2160 return gdbarch->pointer_to_address (type, buf);
2164 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2165 gdbarch_pointer_to_address_ftype pointer_to_address)
2167 gdbarch->pointer_to_address = pointer_to_address;
2171 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2173 gdb_assert (gdbarch != NULL);
2174 gdb_assert (gdbarch->address_to_pointer != NULL);
2175 if (gdbarch_debug >= 2)
2176 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2177 gdbarch->address_to_pointer (type, buf, addr);
2181 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2182 gdbarch_address_to_pointer_ftype address_to_pointer)
2184 gdbarch->address_to_pointer = address_to_pointer;
2188 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2190 gdb_assert (gdbarch != NULL);
2191 return gdbarch->integer_to_address != NULL;
2195 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2197 gdb_assert (gdbarch != NULL);
2198 gdb_assert (gdbarch->integer_to_address != NULL);
2199 if (gdbarch_debug >= 2)
2200 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2201 return gdbarch->integer_to_address (gdbarch, type, buf);
2205 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2206 gdbarch_integer_to_address_ftype integer_to_address)
2208 gdbarch->integer_to_address = integer_to_address;
2212 gdbarch_return_value_p (struct gdbarch *gdbarch)
2214 gdb_assert (gdbarch != NULL);
2215 return gdbarch->return_value != legacy_return_value;
2218 enum return_value_convention
2219 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2221 gdb_assert (gdbarch != NULL);
2222 gdb_assert (gdbarch->return_value != NULL);
2223 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2224 if (gdbarch_debug >= 2)
2225 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2226 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2230 set_gdbarch_return_value (struct gdbarch *gdbarch,
2231 gdbarch_return_value_ftype return_value)
2233 gdbarch->return_value = return_value;
2237 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
2239 gdb_assert (gdbarch != NULL);
2240 gdb_assert (gdbarch->extract_return_value != NULL);
2241 if (gdbarch_debug >= 2)
2242 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2243 gdbarch->extract_return_value (type, regcache, valbuf);
2247 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2248 gdbarch_extract_return_value_ftype extract_return_value)
2250 gdbarch->extract_return_value = extract_return_value;
2254 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
2256 gdb_assert (gdbarch != NULL);
2257 gdb_assert (gdbarch->store_return_value != NULL);
2258 if (gdbarch_debug >= 2)
2259 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2260 gdbarch->store_return_value (type, regcache, valbuf);
2264 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2265 gdbarch_store_return_value_ftype store_return_value)
2267 gdbarch->store_return_value = store_return_value;
2271 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2273 gdb_assert (gdbarch != NULL);
2274 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2275 if (gdbarch_debug >= 2)
2276 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2277 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2281 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2282 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2284 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2288 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
2290 gdb_assert (gdbarch != NULL);
2291 return gdbarch->deprecated_extract_struct_value_address != NULL;
2295 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
2297 gdb_assert (gdbarch != NULL);
2298 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
2299 if (gdbarch_debug >= 2)
2300 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
2301 return gdbarch->deprecated_extract_struct_value_address (regcache);
2305 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
2306 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
2308 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
2312 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2314 gdb_assert (gdbarch != NULL);
2315 gdb_assert (gdbarch->skip_prologue != NULL);
2316 if (gdbarch_debug >= 2)
2317 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2318 return gdbarch->skip_prologue (ip);
2322 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2323 gdbarch_skip_prologue_ftype skip_prologue)
2325 gdbarch->skip_prologue = skip_prologue;
2329 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2331 gdb_assert (gdbarch != NULL);
2332 gdb_assert (gdbarch->inner_than != NULL);
2333 if (gdbarch_debug >= 2)
2334 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2335 return gdbarch->inner_than (lhs, rhs);
2339 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2340 gdbarch_inner_than_ftype inner_than)
2342 gdbarch->inner_than = inner_than;
2346 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2348 gdb_assert (gdbarch != NULL);
2349 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2350 if (gdbarch_debug >= 2)
2351 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2352 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2356 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2357 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2359 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2363 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2365 gdb_assert (gdbarch != NULL);
2366 return gdbarch->adjust_breakpoint_address != NULL;
2370 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2372 gdb_assert (gdbarch != NULL);
2373 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2374 if (gdbarch_debug >= 2)
2375 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2376 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2380 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2381 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2383 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2387 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2389 gdb_assert (gdbarch != NULL);
2390 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2391 if (gdbarch_debug >= 2)
2392 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2393 return gdbarch->memory_insert_breakpoint (bp_tgt);
2397 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2398 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2400 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2404 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2406 gdb_assert (gdbarch != NULL);
2407 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2408 if (gdbarch_debug >= 2)
2409 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2410 return gdbarch->memory_remove_breakpoint (bp_tgt);
2414 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2415 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2417 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2421 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2423 gdb_assert (gdbarch != NULL);
2424 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2425 if (gdbarch_debug >= 2)
2426 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2427 return gdbarch->decr_pc_after_break;
2431 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2432 CORE_ADDR decr_pc_after_break)
2434 gdbarch->decr_pc_after_break = decr_pc_after_break;
2438 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2440 gdb_assert (gdbarch != NULL);
2441 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2442 if (gdbarch_debug >= 2)
2443 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2444 return gdbarch->deprecated_function_start_offset;
2448 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2449 CORE_ADDR deprecated_function_start_offset)
2451 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2455 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2457 gdb_assert (gdbarch != NULL);
2458 gdb_assert (gdbarch->remote_register_number != NULL);
2459 if (gdbarch_debug >= 2)
2460 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2461 return gdbarch->remote_register_number (gdbarch, regno);
2465 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2466 gdbarch_remote_register_number_ftype remote_register_number)
2468 gdbarch->remote_register_number = remote_register_number;
2472 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2474 gdb_assert (gdbarch != NULL);
2475 return gdbarch->fetch_tls_load_module_address != NULL;
2479 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2481 gdb_assert (gdbarch != NULL);
2482 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2483 if (gdbarch_debug >= 2)
2484 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2485 return gdbarch->fetch_tls_load_module_address (objfile);
2489 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2490 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2492 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2496 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2498 gdb_assert (gdbarch != NULL);
2499 /* Skip verify of frame_args_skip, invalid_p == 0 */
2500 if (gdbarch_debug >= 2)
2501 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2502 return gdbarch->frame_args_skip;
2506 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2507 CORE_ADDR frame_args_skip)
2509 gdbarch->frame_args_skip = frame_args_skip;
2513 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2515 gdb_assert (gdbarch != NULL);
2516 return gdbarch->unwind_pc != NULL;
2520 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2522 gdb_assert (gdbarch != NULL);
2523 gdb_assert (gdbarch->unwind_pc != NULL);
2524 if (gdbarch_debug >= 2)
2525 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2526 return gdbarch->unwind_pc (gdbarch, next_frame);
2530 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2531 gdbarch_unwind_pc_ftype unwind_pc)
2533 gdbarch->unwind_pc = unwind_pc;
2537 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2539 gdb_assert (gdbarch != NULL);
2540 return gdbarch->unwind_sp != NULL;
2544 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2546 gdb_assert (gdbarch != NULL);
2547 gdb_assert (gdbarch->unwind_sp != NULL);
2548 if (gdbarch_debug >= 2)
2549 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2550 return gdbarch->unwind_sp (gdbarch, next_frame);
2554 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2555 gdbarch_unwind_sp_ftype unwind_sp)
2557 gdbarch->unwind_sp = unwind_sp;
2561 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2563 gdb_assert (gdbarch != NULL);
2564 return gdbarch->frame_num_args != NULL;
2568 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2570 gdb_assert (gdbarch != NULL);
2571 gdb_assert (gdbarch->frame_num_args != NULL);
2572 if (gdbarch_debug >= 2)
2573 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2574 return gdbarch->frame_num_args (frame);
2578 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2579 gdbarch_frame_num_args_ftype frame_num_args)
2581 gdbarch->frame_num_args = frame_num_args;
2585 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2587 gdb_assert (gdbarch != NULL);
2588 return gdbarch->frame_align != NULL;
2592 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2594 gdb_assert (gdbarch != NULL);
2595 gdb_assert (gdbarch->frame_align != NULL);
2596 if (gdbarch_debug >= 2)
2597 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2598 return gdbarch->frame_align (gdbarch, address);
2602 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2603 gdbarch_frame_align_ftype frame_align)
2605 gdbarch->frame_align = frame_align;
2609 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
2611 gdb_assert (gdbarch != NULL);
2612 return gdbarch->deprecated_reg_struct_has_addr != NULL;
2616 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
2618 gdb_assert (gdbarch != NULL);
2619 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
2620 if (gdbarch_debug >= 2)
2621 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
2622 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
2626 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
2627 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
2629 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
2633 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2635 gdb_assert (gdbarch != NULL);
2636 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2637 if (gdbarch_debug >= 2)
2638 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2639 return gdbarch->stabs_argument_has_addr (gdbarch, type);
2643 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2644 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2646 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2650 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2652 gdb_assert (gdbarch != NULL);
2653 if (gdbarch_debug >= 2)
2654 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2655 return gdbarch->frame_red_zone_size;
2659 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2660 int frame_red_zone_size)
2662 gdbarch->frame_red_zone_size = frame_red_zone_size;
2666 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2668 gdb_assert (gdbarch != NULL);
2669 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2670 if (gdbarch_debug >= 2)
2671 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2672 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2676 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2677 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2679 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2683 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2685 gdb_assert (gdbarch != NULL);
2686 gdb_assert (gdbarch->addr_bits_remove != NULL);
2687 if (gdbarch_debug >= 2)
2688 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2689 return gdbarch->addr_bits_remove (addr);
2693 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2694 gdbarch_addr_bits_remove_ftype addr_bits_remove)
2696 gdbarch->addr_bits_remove = addr_bits_remove;
2700 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2702 gdb_assert (gdbarch != NULL);
2703 gdb_assert (gdbarch->smash_text_address != NULL);
2704 if (gdbarch_debug >= 2)
2705 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2706 return gdbarch->smash_text_address (addr);
2710 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2711 gdbarch_smash_text_address_ftype smash_text_address)
2713 gdbarch->smash_text_address = smash_text_address;
2717 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2719 gdb_assert (gdbarch != NULL);
2720 return gdbarch->software_single_step != NULL;
2724 gdbarch_software_single_step (struct gdbarch *gdbarch, struct regcache *regcache)
2726 gdb_assert (gdbarch != NULL);
2727 gdb_assert (gdbarch->software_single_step != NULL);
2728 if (gdbarch_debug >= 2)
2729 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2730 return gdbarch->software_single_step (regcache);
2734 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2735 gdbarch_software_single_step_ftype software_single_step)
2737 gdbarch->software_single_step = software_single_step;
2741 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2743 gdb_assert (gdbarch != NULL);
2744 return gdbarch->single_step_through_delay != NULL;
2748 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2750 gdb_assert (gdbarch != NULL);
2751 gdb_assert (gdbarch->single_step_through_delay != NULL);
2752 if (gdbarch_debug >= 2)
2753 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2754 return gdbarch->single_step_through_delay (gdbarch, frame);
2758 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2759 gdbarch_single_step_through_delay_ftype single_step_through_delay)
2761 gdbarch->single_step_through_delay = single_step_through_delay;
2765 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2767 gdb_assert (gdbarch != NULL);
2768 gdb_assert (gdbarch->print_insn != NULL);
2769 if (gdbarch_debug >= 2)
2770 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2771 return gdbarch->print_insn (vma, info);
2775 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2776 gdbarch_print_insn_ftype print_insn)
2778 gdbarch->print_insn = print_insn;
2782 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
2784 gdb_assert (gdbarch != NULL);
2785 gdb_assert (gdbarch->skip_trampoline_code != NULL);
2786 if (gdbarch_debug >= 2)
2787 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2788 return gdbarch->skip_trampoline_code (pc);
2792 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2793 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2795 gdbarch->skip_trampoline_code = skip_trampoline_code;
2799 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2801 gdb_assert (gdbarch != NULL);
2802 gdb_assert (gdbarch->skip_solib_resolver != NULL);
2803 if (gdbarch_debug >= 2)
2804 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2805 return gdbarch->skip_solib_resolver (gdbarch, pc);
2809 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2810 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2812 gdbarch->skip_solib_resolver = skip_solib_resolver;
2816 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2818 gdb_assert (gdbarch != NULL);
2819 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2820 if (gdbarch_debug >= 2)
2821 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2822 return gdbarch->in_solib_return_trampoline (pc, name);
2826 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2827 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2829 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2833 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2835 gdb_assert (gdbarch != NULL);
2836 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2837 if (gdbarch_debug >= 2)
2838 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2839 return gdbarch->in_function_epilogue_p (gdbarch, addr);
2843 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2844 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2846 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2850 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
2852 gdb_assert (gdbarch != NULL);
2853 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
2854 if (gdbarch_debug >= 2)
2855 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
2856 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
2860 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
2861 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
2863 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
2867 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2869 gdb_assert (gdbarch != NULL);
2870 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2871 if (gdbarch_debug >= 2)
2872 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2873 gdbarch->elf_make_msymbol_special (sym, msym);
2877 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2878 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2880 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2884 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2886 gdb_assert (gdbarch != NULL);
2887 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2888 if (gdbarch_debug >= 2)
2889 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2890 gdbarch->coff_make_msymbol_special (val, msym);
2894 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2895 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2897 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2901 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
2903 gdb_assert (gdbarch != NULL);
2904 /* Skip verify of name_of_malloc, invalid_p == 0 */
2905 if (gdbarch_debug >= 2)
2906 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
2907 return gdbarch->name_of_malloc;
2911 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
2912 const char * name_of_malloc)
2914 gdbarch->name_of_malloc = name_of_malloc;
2918 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2920 gdb_assert (gdbarch != NULL);
2921 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2922 if (gdbarch_debug >= 2)
2923 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2924 return gdbarch->cannot_step_breakpoint;
2928 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2929 int cannot_step_breakpoint)
2931 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2935 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2937 gdb_assert (gdbarch != NULL);
2938 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2939 if (gdbarch_debug >= 2)
2940 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2941 return gdbarch->have_nonsteppable_watchpoint;
2945 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2946 int have_nonsteppable_watchpoint)
2948 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2952 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2954 gdb_assert (gdbarch != NULL);
2955 return gdbarch->address_class_type_flags != NULL;
2959 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2961 gdb_assert (gdbarch != NULL);
2962 gdb_assert (gdbarch->address_class_type_flags != NULL);
2963 if (gdbarch_debug >= 2)
2964 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2965 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2969 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2970 gdbarch_address_class_type_flags_ftype address_class_type_flags)
2972 gdbarch->address_class_type_flags = address_class_type_flags;
2976 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2978 gdb_assert (gdbarch != NULL);
2979 return gdbarch->address_class_type_flags_to_name != NULL;
2983 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2985 gdb_assert (gdbarch != NULL);
2986 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2987 if (gdbarch_debug >= 2)
2988 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2989 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2993 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2994 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2996 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3000 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3002 gdb_assert (gdbarch != NULL);
3003 return gdbarch->address_class_name_to_type_flags != NULL;
3007 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
3009 gdb_assert (gdbarch != NULL);
3010 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
3011 if (gdbarch_debug >= 2)
3012 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
3013 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
3017 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3018 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3020 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3024 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3026 gdb_assert (gdbarch != NULL);
3027 gdb_assert (gdbarch->register_reggroup_p != NULL);
3028 if (gdbarch_debug >= 2)
3029 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3030 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3034 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3035 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3037 gdbarch->register_reggroup_p = register_reggroup_p;
3041 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3043 gdb_assert (gdbarch != NULL);
3044 return gdbarch->fetch_pointer_argument != NULL;
3048 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3050 gdb_assert (gdbarch != NULL);
3051 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3052 if (gdbarch_debug >= 2)
3053 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3054 return gdbarch->fetch_pointer_argument (frame, argi, type);
3058 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3059 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3061 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3065 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3067 gdb_assert (gdbarch != NULL);
3068 return gdbarch->regset_from_core_section != NULL;
3071 const struct regset *
3072 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3074 gdb_assert (gdbarch != NULL);
3075 gdb_assert (gdbarch->regset_from_core_section != NULL);
3076 if (gdbarch_debug >= 2)
3077 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3078 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3082 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3083 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3085 gdbarch->regset_from_core_section = regset_from_core_section;
3089 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3091 gdb_assert (gdbarch != NULL);
3092 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3093 if (gdbarch_debug >= 2)
3094 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3095 return gdbarch->vtable_function_descriptors;
3099 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3100 int vtable_function_descriptors)
3102 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3106 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3108 gdb_assert (gdbarch != NULL);
3109 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3110 if (gdbarch_debug >= 2)
3111 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3112 return gdbarch->vbit_in_delta;
3116 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3119 gdbarch->vbit_in_delta = vbit_in_delta;
3123 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3125 gdb_assert (gdbarch != NULL);
3126 return gdbarch->skip_permanent_breakpoint != NULL;
3130 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3132 gdb_assert (gdbarch != NULL);
3133 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3134 if (gdbarch_debug >= 2)
3135 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3136 gdbarch->skip_permanent_breakpoint (regcache);
3140 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3141 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3143 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3147 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3149 gdb_assert (gdbarch != NULL);
3150 return gdbarch->overlay_update != NULL;
3154 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3156 gdb_assert (gdbarch != NULL);
3157 gdb_assert (gdbarch->overlay_update != NULL);
3158 if (gdbarch_debug >= 2)
3159 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3160 gdbarch->overlay_update (osect);
3164 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3165 gdbarch_overlay_update_ftype overlay_update)
3167 gdbarch->overlay_update = overlay_update;
3171 /* Keep a registry of per-architecture data-pointers required by GDB
3178 gdbarch_data_pre_init_ftype *pre_init;
3179 gdbarch_data_post_init_ftype *post_init;
3182 struct gdbarch_data_registration
3184 struct gdbarch_data *data;
3185 struct gdbarch_data_registration *next;
3188 struct gdbarch_data_registry
3191 struct gdbarch_data_registration *registrations;
3194 struct gdbarch_data_registry gdbarch_data_registry =
3199 static struct gdbarch_data *
3200 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3201 gdbarch_data_post_init_ftype *post_init)
3203 struct gdbarch_data_registration **curr;
3204 /* Append the new registraration. */
3205 for (curr = &gdbarch_data_registry.registrations;
3207 curr = &(*curr)->next);
3208 (*curr) = XMALLOC (struct gdbarch_data_registration);
3209 (*curr)->next = NULL;
3210 (*curr)->data = XMALLOC (struct gdbarch_data);
3211 (*curr)->data->index = gdbarch_data_registry.nr++;
3212 (*curr)->data->pre_init = pre_init;
3213 (*curr)->data->post_init = post_init;
3214 (*curr)->data->init_p = 1;
3215 return (*curr)->data;
3218 struct gdbarch_data *
3219 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3221 return gdbarch_data_register (pre_init, NULL);
3224 struct gdbarch_data *
3225 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3227 return gdbarch_data_register (NULL, post_init);
3230 /* Create/delete the gdbarch data vector. */
3233 alloc_gdbarch_data (struct gdbarch *gdbarch)
3235 gdb_assert (gdbarch->data == NULL);
3236 gdbarch->nr_data = gdbarch_data_registry.nr;
3237 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3240 /* Initialize the current value of the specified per-architecture
3244 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3245 struct gdbarch_data *data,
3248 gdb_assert (data->index < gdbarch->nr_data);
3249 gdb_assert (gdbarch->data[data->index] == NULL);
3250 gdb_assert (data->pre_init == NULL);
3251 gdbarch->data[data->index] = pointer;
3254 /* Return the current value of the specified per-architecture
3258 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3260 gdb_assert (data->index < gdbarch->nr_data);
3261 if (gdbarch->data[data->index] == NULL)
3263 /* The data-pointer isn't initialized, call init() to get a
3265 if (data->pre_init != NULL)
3266 /* Mid architecture creation: pass just the obstack, and not
3267 the entire architecture, as that way it isn't possible for
3268 pre-init code to refer to undefined architecture
3270 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3271 else if (gdbarch->initialized_p
3272 && data->post_init != NULL)
3273 /* Post architecture creation: pass the entire architecture
3274 (as all fields are valid), but be careful to also detect
3275 recursive references. */
3277 gdb_assert (data->init_p);
3279 gdbarch->data[data->index] = data->post_init (gdbarch);
3283 /* The architecture initialization hasn't completed - punt -
3284 hope that the caller knows what they are doing. Once
3285 deprecated_set_gdbarch_data has been initialized, this can be
3286 changed to an internal error. */
3288 gdb_assert (gdbarch->data[data->index] != NULL);
3290 return gdbarch->data[data->index];
3295 /* Keep a registry of swapped data required by GDB modules. */
3300 struct gdbarch_swap_registration *source;
3301 struct gdbarch_swap *next;
3304 struct gdbarch_swap_registration
3307 unsigned long sizeof_data;
3308 gdbarch_swap_ftype *init;
3309 struct gdbarch_swap_registration *next;
3312 struct gdbarch_swap_registry
3315 struct gdbarch_swap_registration *registrations;
3318 struct gdbarch_swap_registry gdbarch_swap_registry =
3324 deprecated_register_gdbarch_swap (void *data,
3325 unsigned long sizeof_data,
3326 gdbarch_swap_ftype *init)
3328 struct gdbarch_swap_registration **rego;
3329 for (rego = &gdbarch_swap_registry.registrations;
3331 rego = &(*rego)->next);
3332 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3333 (*rego)->next = NULL;
3334 (*rego)->init = init;
3335 (*rego)->data = data;
3336 (*rego)->sizeof_data = sizeof_data;
3340 current_gdbarch_swap_init_hack (void)
3342 struct gdbarch_swap_registration *rego;
3343 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3344 for (rego = gdbarch_swap_registry.registrations;
3348 if (rego->data != NULL)
3350 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3351 struct gdbarch_swap);
3352 (*curr)->source = rego;
3353 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3355 (*curr)->next = NULL;
3356 curr = &(*curr)->next;
3358 if (rego->init != NULL)
3363 static struct gdbarch *
3364 current_gdbarch_swap_out_hack (void)
3366 struct gdbarch *old_gdbarch = current_gdbarch;
3367 struct gdbarch_swap *curr;
3369 gdb_assert (old_gdbarch != NULL);
3370 for (curr = old_gdbarch->swap;
3374 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3375 memset (curr->source->data, 0, curr->source->sizeof_data);
3377 current_gdbarch = NULL;
3382 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3384 struct gdbarch_swap *curr;
3386 gdb_assert (current_gdbarch == NULL);
3387 for (curr = new_gdbarch->swap;
3390 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3391 current_gdbarch = new_gdbarch;
3395 /* Keep a registry of the architectures known by GDB. */
3397 struct gdbarch_registration
3399 enum bfd_architecture bfd_architecture;
3400 gdbarch_init_ftype *init;
3401 gdbarch_dump_tdep_ftype *dump_tdep;
3402 struct gdbarch_list *arches;
3403 struct gdbarch_registration *next;
3406 static struct gdbarch_registration *gdbarch_registry = NULL;
3409 append_name (const char ***buf, int *nr, const char *name)
3411 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3417 gdbarch_printable_names (void)
3419 /* Accumulate a list of names based on the registed list of
3421 enum bfd_architecture a;
3423 const char **arches = NULL;
3424 struct gdbarch_registration *rego;
3425 for (rego = gdbarch_registry;
3429 const struct bfd_arch_info *ap;
3430 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3432 internal_error (__FILE__, __LINE__,
3433 _("gdbarch_architecture_names: multi-arch unknown"));
3436 append_name (&arches, &nr_arches, ap->printable_name);
3441 append_name (&arches, &nr_arches, NULL);
3447 gdbarch_register (enum bfd_architecture bfd_architecture,
3448 gdbarch_init_ftype *init,
3449 gdbarch_dump_tdep_ftype *dump_tdep)
3451 struct gdbarch_registration **curr;
3452 const struct bfd_arch_info *bfd_arch_info;
3453 /* Check that BFD recognizes this architecture */
3454 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3455 if (bfd_arch_info == NULL)
3457 internal_error (__FILE__, __LINE__,
3458 _("gdbarch: Attempt to register unknown architecture (%d)"),
3461 /* Check that we haven't seen this architecture before */
3462 for (curr = &gdbarch_registry;
3464 curr = &(*curr)->next)
3466 if (bfd_architecture == (*curr)->bfd_architecture)
3467 internal_error (__FILE__, __LINE__,
3468 _("gdbarch: Duplicate registraration of architecture (%s)"),
3469 bfd_arch_info->printable_name);
3473 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3474 bfd_arch_info->printable_name,
3477 (*curr) = XMALLOC (struct gdbarch_registration);
3478 (*curr)->bfd_architecture = bfd_architecture;
3479 (*curr)->init = init;
3480 (*curr)->dump_tdep = dump_tdep;
3481 (*curr)->arches = NULL;
3482 (*curr)->next = NULL;
3486 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3487 gdbarch_init_ftype *init)
3489 gdbarch_register (bfd_architecture, init, NULL);
3493 /* Look for an architecture using gdbarch_info. */
3495 struct gdbarch_list *
3496 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3497 const struct gdbarch_info *info)
3499 for (; arches != NULL; arches = arches->next)
3501 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3503 if (info->byte_order != arches->gdbarch->byte_order)
3505 if (info->osabi != arches->gdbarch->osabi)
3507 if (info->target_desc != arches->gdbarch->target_desc)
3515 /* Find an architecture that matches the specified INFO. Create a new
3516 architecture if needed. Return that new architecture. Assumes
3517 that there is no current architecture. */
3519 static struct gdbarch *
3520 find_arch_by_info (struct gdbarch_info info)
3522 struct gdbarch *new_gdbarch;
3523 struct gdbarch_registration *rego;
3525 /* The existing architecture has been swapped out - all this code
3526 works from a clean slate. */
3527 gdb_assert (current_gdbarch == NULL);
3529 /* Fill in missing parts of the INFO struct using a number of
3530 sources: "set ..."; INFOabfd supplied; and the global
3532 gdbarch_info_fill (&info);
3534 /* Must have found some sort of architecture. */
3535 gdb_assert (info.bfd_arch_info != NULL);
3539 fprintf_unfiltered (gdb_stdlog,
3540 "find_arch_by_info: info.bfd_arch_info %s\n",
3541 (info.bfd_arch_info != NULL
3542 ? info.bfd_arch_info->printable_name
3544 fprintf_unfiltered (gdb_stdlog,
3545 "find_arch_by_info: info.byte_order %d (%s)\n",
3547 (info.byte_order == BFD_ENDIAN_BIG ? "big"
3548 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3550 fprintf_unfiltered (gdb_stdlog,
3551 "find_arch_by_info: info.osabi %d (%s)\n",
3552 info.osabi, gdbarch_osabi_name (info.osabi));
3553 fprintf_unfiltered (gdb_stdlog,
3554 "find_arch_by_info: info.abfd 0x%lx\n",
3556 fprintf_unfiltered (gdb_stdlog,
3557 "find_arch_by_info: info.tdep_info 0x%lx\n",
3558 (long) info.tdep_info);
3561 /* Find the tdep code that knows about this architecture. */
3562 for (rego = gdbarch_registry;
3565 if (rego->bfd_architecture == info.bfd_arch_info->arch)
3570 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3571 "No matching architecture\n");
3575 /* Ask the tdep code for an architecture that matches "info". */
3576 new_gdbarch = rego->init (info, rego->arches);
3578 /* Did the tdep code like it? No. Reject the change and revert to
3579 the old architecture. */
3580 if (new_gdbarch == NULL)
3583 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3584 "Target rejected architecture\n");
3588 /* Is this a pre-existing architecture (as determined by already
3589 being initialized)? Move it to the front of the architecture
3590 list (keeping the list sorted Most Recently Used). */
3591 if (new_gdbarch->initialized_p)
3593 struct gdbarch_list **list;
3594 struct gdbarch_list *this;
3596 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3597 "Previous architecture 0x%08lx (%s) selected\n",
3599 new_gdbarch->bfd_arch_info->printable_name);
3600 /* Find the existing arch in the list. */
3601 for (list = ®o->arches;
3602 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
3603 list = &(*list)->next);
3604 /* It had better be in the list of architectures. */
3605 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
3608 (*list) = this->next;
3609 /* Insert THIS at the front. */
3610 this->next = rego->arches;
3611 rego->arches = this;
3616 /* It's a new architecture. */
3618 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3619 "New architecture 0x%08lx (%s) selected\n",
3621 new_gdbarch->bfd_arch_info->printable_name);
3623 /* Insert the new architecture into the front of the architecture
3624 list (keep the list sorted Most Recently Used). */
3626 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
3627 this->next = rego->arches;
3628 this->gdbarch = new_gdbarch;
3629 rego->arches = this;
3632 /* Check that the newly installed architecture is valid. Plug in
3633 any post init values. */
3634 new_gdbarch->dump_tdep = rego->dump_tdep;
3635 verify_gdbarch (new_gdbarch);
3636 new_gdbarch->initialized_p = 1;
3638 /* Initialize any per-architecture swap areas. This phase requires
3639 a valid global CURRENT_GDBARCH. Set it momentarially, and then
3640 swap the entire architecture out. */
3641 current_gdbarch = new_gdbarch;
3642 current_gdbarch_swap_init_hack ();
3643 current_gdbarch_swap_out_hack ();
3646 gdbarch_dump (new_gdbarch, gdb_stdlog);
3652 gdbarch_find_by_info (struct gdbarch_info info)
3654 /* Save the previously selected architecture, setting the global to
3655 NULL. This stops things like gdbarch->init() trying to use the
3656 previous architecture's configuration. The previous architecture
3657 may not even be of the same architecture family. The most recent
3658 architecture of the same family is found at the head of the
3659 rego->arches list. */
3660 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
3662 /* Find the specified architecture. */
3663 struct gdbarch *new_gdbarch = find_arch_by_info (info);
3665 /* Restore the existing architecture. */
3666 gdb_assert (current_gdbarch == NULL);
3667 current_gdbarch_swap_in_hack (old_gdbarch);
3672 /* Make the specified architecture current, swapping the existing one
3676 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
3678 gdb_assert (new_gdbarch != NULL);
3679 gdb_assert (current_gdbarch != NULL);
3680 gdb_assert (new_gdbarch->initialized_p);
3681 current_gdbarch_swap_out_hack ();
3682 current_gdbarch_swap_in_hack (new_gdbarch);
3683 architecture_changed_event ();
3684 reinit_frame_cache ();
3687 extern void _initialize_gdbarch (void);
3690 _initialize_gdbarch (void)
3692 struct cmd_list_element *c;
3694 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
3695 Set architecture debugging."), _("\
3696 Show architecture debugging."), _("\
3697 When non-zero, architecture debugging is enabled."),
3700 &setdebuglist, &showdebuglist);