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"
42 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
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_read_sp_ftype *read_sp;
152 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
153 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
154 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
161 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
162 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
163 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
164 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
165 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
166 gdbarch_register_name_ftype *register_name;
167 gdbarch_register_type_ftype *register_type;
168 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
169 int deprecated_fp_regnum;
170 gdbarch_push_dummy_call_ftype *push_dummy_call;
171 int deprecated_register_size;
172 int call_dummy_location;
173 gdbarch_push_dummy_code_ftype *push_dummy_code;
174 gdbarch_print_registers_info_ftype *print_registers_info;
175 gdbarch_print_float_info_ftype *print_float_info;
176 gdbarch_print_vector_info_ftype *print_vector_info;
177 gdbarch_register_sim_regno_ftype *register_sim_regno;
178 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
179 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
180 gdbarch_cannot_store_register_ftype *cannot_store_register;
181 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
182 int believe_pcc_promotion;
183 gdbarch_convert_register_p_ftype *convert_register_p;
184 gdbarch_register_to_value_ftype *register_to_value;
185 gdbarch_value_to_register_ftype *value_to_register;
186 gdbarch_value_from_register_ftype *value_from_register;
187 gdbarch_pointer_to_address_ftype *pointer_to_address;
188 gdbarch_address_to_pointer_ftype *address_to_pointer;
189 gdbarch_integer_to_address_ftype *integer_to_address;
190 gdbarch_return_value_ftype *return_value;
191 gdbarch_extract_return_value_ftype *extract_return_value;
192 gdbarch_store_return_value_ftype *store_return_value;
193 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
194 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
195 gdbarch_skip_prologue_ftype *skip_prologue;
196 gdbarch_inner_than_ftype *inner_than;
197 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
198 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
199 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
200 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
201 CORE_ADDR decr_pc_after_break;
202 CORE_ADDR deprecated_function_start_offset;
203 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
204 gdbarch_remote_register_number_ftype *remote_register_number;
205 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
206 CORE_ADDR frame_args_skip;
207 gdbarch_unwind_pc_ftype *unwind_pc;
208 gdbarch_unwind_sp_ftype *unwind_sp;
209 gdbarch_frame_num_args_ftype *frame_num_args;
210 gdbarch_deprecated_stack_align_ftype *deprecated_stack_align;
211 gdbarch_frame_align_ftype *frame_align;
212 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
213 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
214 int frame_red_zone_size;
215 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
216 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
217 gdbarch_smash_text_address_ftype *smash_text_address;
218 gdbarch_software_single_step_ftype *software_single_step;
219 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
220 gdbarch_print_insn_ftype *print_insn;
221 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
222 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
223 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
224 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
225 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
226 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
227 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
228 const char * name_of_malloc;
229 int cannot_step_breakpoint;
230 int have_nonsteppable_watchpoint;
231 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
232 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
233 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
234 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
235 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
236 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
237 int vtable_function_descriptors;
239 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
243 /* The default architecture uses host values (for want of a better
246 extern const struct bfd_arch_info bfd_default_arch_struct;
248 struct gdbarch startup_gdbarch =
250 1, /* Always initialized. */
251 NULL, /* The obstack. */
252 /* basic architecture information */
253 &bfd_default_arch_struct, /* bfd_arch_info */
254 BFD_ENDIAN_BIG, /* byte_order */
255 GDB_OSABI_UNKNOWN, /* osabi */
257 /* target specific vector and its dump routine */
259 /*per-architecture data-pointers and swap regions */
261 /* Multi-arch values */
262 8 * sizeof (short), /* short_bit */
263 8 * sizeof (int), /* int_bit */
264 8 * sizeof (long), /* long_bit */
265 8 * sizeof (LONGEST), /* long_long_bit */
266 8 * sizeof (float), /* float_bit */
267 0, /* float_format */
268 8 * sizeof (double), /* double_bit */
269 0, /* double_format */
270 8 * sizeof (long double), /* long_double_bit */
271 0, /* long_double_format */
272 8 * sizeof (void*), /* ptr_bit */
273 8 * sizeof (void*), /* addr_bit */
274 8 * sizeof (void*), /* bfd_vma_bit */
279 0, /* virtual_frame_pointer */
280 0, /* pseudo_register_read */
281 0, /* pseudo_register_write */
283 0, /* num_pseudo_regs */
288 0, /* stab_reg_to_regnum */
289 0, /* ecoff_reg_to_regnum */
290 0, /* dwarf_reg_to_regnum */
291 0, /* sdb_reg_to_regnum */
292 0, /* dwarf2_reg_to_regnum */
293 0, /* register_name */
294 0, /* register_type */
295 0, /* unwind_dummy_id */
296 -1, /* deprecated_fp_regnum */
297 0, /* push_dummy_call */
298 0, /* deprecated_register_size */
299 0, /* call_dummy_location */
300 0, /* push_dummy_code */
301 default_print_registers_info, /* print_registers_info */
302 0, /* print_float_info */
303 0, /* print_vector_info */
304 0, /* register_sim_regno */
305 0, /* register_bytes_ok */
306 0, /* cannot_fetch_register */
307 0, /* cannot_store_register */
308 0, /* get_longjmp_target */
309 0, /* believe_pcc_promotion */
310 0, /* convert_register_p */
311 0, /* register_to_value */
312 0, /* value_to_register */
313 0, /* value_from_register */
314 0, /* pointer_to_address */
315 0, /* address_to_pointer */
316 0, /* integer_to_address */
317 0, /* return_value */
318 0, /* extract_return_value */
319 0, /* store_return_value */
320 0, /* deprecated_use_struct_convention */
321 0, /* deprecated_extract_struct_value_address */
322 0, /* skip_prologue */
324 0, /* breakpoint_from_pc */
325 0, /* adjust_breakpoint_address */
326 0, /* memory_insert_breakpoint */
327 0, /* memory_remove_breakpoint */
328 0, /* decr_pc_after_break */
329 0, /* deprecated_function_start_offset */
330 generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
331 default_remote_register_number, /* remote_register_number */
332 0, /* fetch_tls_load_module_address */
333 0, /* frame_args_skip */
336 0, /* frame_num_args */
337 0, /* deprecated_stack_align */
339 0, /* deprecated_reg_struct_has_addr */
340 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
341 0, /* frame_red_zone_size */
342 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
343 0, /* addr_bits_remove */
344 0, /* smash_text_address */
345 0, /* software_single_step */
346 0, /* single_step_through_delay */
348 0, /* skip_trampoline_code */
349 generic_skip_solib_resolver, /* skip_solib_resolver */
350 0, /* in_solib_return_trampoline */
351 generic_in_function_epilogue_p, /* in_function_epilogue_p */
352 construct_inferior_arguments, /* construct_inferior_arguments */
353 0, /* elf_make_msymbol_special */
354 0, /* coff_make_msymbol_special */
355 "malloc", /* name_of_malloc */
356 0, /* cannot_step_breakpoint */
357 0, /* have_nonsteppable_watchpoint */
358 0, /* address_class_type_flags */
359 0, /* address_class_type_flags_to_name */
360 0, /* address_class_name_to_type_flags */
361 default_register_reggroup_p, /* register_reggroup_p */
362 0, /* fetch_pointer_argument */
363 0, /* regset_from_core_section */
364 0, /* vtable_function_descriptors */
365 0, /* vbit_in_delta */
366 0, /* skip_permanent_breakpoint */
367 /* startup_gdbarch() */
370 struct gdbarch *current_gdbarch = &startup_gdbarch;
372 /* Create a new ``struct gdbarch'' based on information provided by
373 ``struct gdbarch_info''. */
376 gdbarch_alloc (const struct gdbarch_info *info,
377 struct gdbarch_tdep *tdep)
379 /* NOTE: The new architecture variable is named ``current_gdbarch''
380 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
381 the current local architecture and not the previous global
382 architecture. This ensures that the new architectures initial
383 values are not influenced by the previous architecture. Once
384 everything is parameterised with gdbarch, this will go away. */
385 struct gdbarch *current_gdbarch;
387 /* Create an obstack for allocating all the per-architecture memory,
388 then use that to allocate the architecture vector. */
389 struct obstack *obstack = XMALLOC (struct obstack);
390 obstack_init (obstack);
391 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
392 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
393 current_gdbarch->obstack = obstack;
395 alloc_gdbarch_data (current_gdbarch);
397 current_gdbarch->tdep = tdep;
399 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
400 current_gdbarch->byte_order = info->byte_order;
401 current_gdbarch->osabi = info->osabi;
402 current_gdbarch->target_desc = info->target_desc;
404 /* Force the explicit initialization of these. */
405 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
406 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
407 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
408 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
409 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
410 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
411 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
412 current_gdbarch->ptr_bit = TARGET_INT_BIT;
413 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
414 current_gdbarch->char_signed = -1;
415 current_gdbarch->write_pc = generic_target_write_pc;
416 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
417 current_gdbarch->num_regs = -1;
418 current_gdbarch->sp_regnum = -1;
419 current_gdbarch->pc_regnum = -1;
420 current_gdbarch->ps_regnum = -1;
421 current_gdbarch->fp0_regnum = -1;
422 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
423 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
424 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
425 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
426 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
427 current_gdbarch->deprecated_fp_regnum = -1;
428 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
429 current_gdbarch->print_registers_info = default_print_registers_info;
430 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
431 current_gdbarch->cannot_fetch_register = cannot_register_not;
432 current_gdbarch->cannot_store_register = cannot_register_not;
433 current_gdbarch->convert_register_p = generic_convert_register_p;
434 current_gdbarch->value_from_register = default_value_from_register;
435 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
436 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
437 current_gdbarch->return_value = legacy_return_value;
438 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
439 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
440 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
441 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
442 current_gdbarch->remote_register_number = default_remote_register_number;
443 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
444 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
445 current_gdbarch->addr_bits_remove = core_addr_identity;
446 current_gdbarch->smash_text_address = core_addr_identity;
447 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
448 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
449 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
450 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
451 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
452 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
453 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
454 current_gdbarch->name_of_malloc = "malloc";
455 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
456 /* gdbarch_alloc() */
458 return current_gdbarch;
462 /* Allocate extra space using the per-architecture obstack. */
465 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
467 void *data = obstack_alloc (arch->obstack, size);
468 memset (data, 0, size);
473 /* Free a gdbarch struct. This should never happen in normal
474 operation --- once you've created a gdbarch, you keep it around.
475 However, if an architecture's init function encounters an error
476 building the structure, it may need to clean up a partially
477 constructed gdbarch. */
480 gdbarch_free (struct gdbarch *arch)
482 struct obstack *obstack;
483 gdb_assert (arch != NULL);
484 gdb_assert (!arch->initialized_p);
485 obstack = arch->obstack;
486 obstack_free (obstack, 0); /* Includes the ARCH. */
491 /* Ensure that all values in a GDBARCH are reasonable. */
493 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
494 just happens to match the global variable ``current_gdbarch''. That
495 way macros refering to that variable get the local and not the global
496 version - ulgh. Once everything is parameterised with gdbarch, this
500 verify_gdbarch (struct gdbarch *current_gdbarch)
503 struct cleanup *cleanups;
506 log = mem_fileopen ();
507 cleanups = make_cleanup_ui_file_delete (log);
509 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
510 fprintf_unfiltered (log, "\n\tbyte-order");
511 if (current_gdbarch->bfd_arch_info == NULL)
512 fprintf_unfiltered (log, "\n\tbfd_arch_info");
513 /* Check those that need to be defined for the given multi-arch level. */
514 /* Skip verify of short_bit, invalid_p == 0 */
515 /* Skip verify of int_bit, invalid_p == 0 */
516 /* Skip verify of long_bit, invalid_p == 0 */
517 /* Skip verify of long_long_bit, invalid_p == 0 */
518 /* Skip verify of float_bit, invalid_p == 0 */
519 if (current_gdbarch->float_format == 0)
520 current_gdbarch->float_format = floatformats_ieee_single;
521 /* Skip verify of double_bit, invalid_p == 0 */
522 if (current_gdbarch->double_format == 0)
523 current_gdbarch->double_format = floatformats_ieee_double;
524 /* Skip verify of long_double_bit, invalid_p == 0 */
525 if (current_gdbarch->long_double_format == 0)
526 current_gdbarch->long_double_format = floatformats_ieee_double;
527 /* Skip verify of ptr_bit, invalid_p == 0 */
528 if (current_gdbarch->addr_bit == 0)
529 current_gdbarch->addr_bit = TARGET_PTR_BIT;
530 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
531 if (current_gdbarch->char_signed == -1)
532 current_gdbarch->char_signed = 1;
533 /* Skip verify of read_pc, has predicate */
534 /* Skip verify of write_pc, invalid_p == 0 */
535 /* Skip verify of read_sp, has predicate */
536 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
537 /* Skip verify of pseudo_register_read, has predicate */
538 /* Skip verify of pseudo_register_write, has predicate */
539 if (current_gdbarch->num_regs == -1)
540 fprintf_unfiltered (log, "\n\tnum_regs");
541 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
542 /* Skip verify of sp_regnum, invalid_p == 0 */
543 /* Skip verify of pc_regnum, invalid_p == 0 */
544 /* Skip verify of ps_regnum, invalid_p == 0 */
545 /* Skip verify of fp0_regnum, invalid_p == 0 */
546 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
547 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
548 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
549 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
550 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
551 /* Skip verify of register_type, has predicate */
552 /* Skip verify of unwind_dummy_id, has predicate */
553 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
554 /* Skip verify of push_dummy_call, has predicate */
555 /* Skip verify of call_dummy_location, invalid_p == 0 */
556 /* Skip verify of push_dummy_code, has predicate */
557 /* Skip verify of print_registers_info, invalid_p == 0 */
558 /* Skip verify of print_float_info, has predicate */
559 /* Skip verify of print_vector_info, has predicate */
560 /* Skip verify of register_sim_regno, invalid_p == 0 */
561 /* Skip verify of register_bytes_ok, has predicate */
562 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
563 /* Skip verify of cannot_store_register, invalid_p == 0 */
564 /* Skip verify of get_longjmp_target, has predicate */
565 /* Skip verify of convert_register_p, invalid_p == 0 */
566 /* Skip verify of value_from_register, invalid_p == 0 */
567 /* Skip verify of pointer_to_address, invalid_p == 0 */
568 /* Skip verify of address_to_pointer, invalid_p == 0 */
569 /* Skip verify of integer_to_address, has predicate */
570 /* Skip verify of return_value, has predicate */
571 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
572 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
573 if (current_gdbarch->skip_prologue == 0)
574 fprintf_unfiltered (log, "\n\tskip_prologue");
575 if (current_gdbarch->inner_than == 0)
576 fprintf_unfiltered (log, "\n\tinner_than");
577 if (current_gdbarch->breakpoint_from_pc == 0)
578 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
579 /* Skip verify of adjust_breakpoint_address, has predicate */
580 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
581 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
582 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
583 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
584 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
585 /* Skip verify of remote_register_number, invalid_p == 0 */
586 /* Skip verify of fetch_tls_load_module_address, has predicate */
587 /* Skip verify of frame_args_skip, invalid_p == 0 */
588 /* Skip verify of unwind_pc, has predicate */
589 /* Skip verify of unwind_sp, has predicate */
590 /* Skip verify of frame_num_args, has predicate */
591 /* Skip verify of deprecated_stack_align, has predicate */
592 /* Skip verify of frame_align, has predicate */
593 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
594 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
595 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
596 /* Skip verify of addr_bits_remove, invalid_p == 0 */
597 /* Skip verify of smash_text_address, invalid_p == 0 */
598 /* Skip verify of software_single_step, has predicate */
599 /* Skip verify of single_step_through_delay, has predicate */
600 if (current_gdbarch->print_insn == 0)
601 fprintf_unfiltered (log, "\n\tprint_insn");
602 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
603 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
604 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
605 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
606 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
607 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
608 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
609 /* Skip verify of name_of_malloc, invalid_p == 0 */
610 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
611 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
612 /* Skip verify of address_class_type_flags, has predicate */
613 /* Skip verify of address_class_type_flags_to_name, has predicate */
614 /* Skip verify of address_class_name_to_type_flags, has predicate */
615 /* Skip verify of register_reggroup_p, invalid_p == 0 */
616 /* Skip verify of fetch_pointer_argument, has predicate */
617 /* Skip verify of regset_from_core_section, has predicate */
618 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
619 /* Skip verify of vbit_in_delta, invalid_p == 0 */
620 /* Skip verify of skip_permanent_breakpoint, has predicate */
621 buf = ui_file_xstrdup (log, &dummy);
622 make_cleanup (xfree, buf);
623 if (strlen (buf) > 0)
624 internal_error (__FILE__, __LINE__,
625 _("verify_gdbarch: the following are invalid ...%s"),
627 do_cleanups (cleanups);
631 /* Print out the details of the current architecture. */
633 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
634 just happens to match the global variable ``current_gdbarch''. That
635 way macros refering to that variable get the local and not the global
636 version - ulgh. Once everything is parameterised with gdbarch, this
640 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
642 const char *gdb_xm_file = "<not-defined>";
643 const char *gdb_nm_file = "<not-defined>";
644 const char *gdb_tm_file = "<not-defined>";
645 #if defined (GDB_XM_FILE)
646 gdb_xm_file = GDB_XM_FILE;
648 fprintf_unfiltered (file,
649 "gdbarch_dump: GDB_XM_FILE = %s\n",
651 #if defined (GDB_NM_FILE)
652 gdb_nm_file = GDB_NM_FILE;
654 fprintf_unfiltered (file,
655 "gdbarch_dump: GDB_NM_FILE = %s\n",
657 #if defined (GDB_TM_FILE)
658 gdb_tm_file = GDB_TM_FILE;
660 fprintf_unfiltered (file,
661 "gdbarch_dump: GDB_TM_FILE = %s\n",
663 #ifdef TARGET_ADDR_BIT
664 fprintf_unfiltered (file,
665 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
666 XSTRING (TARGET_ADDR_BIT));
668 fprintf_unfiltered (file,
669 "gdbarch_dump: addr_bit = %s\n",
670 paddr_d (current_gdbarch->addr_bit));
671 #ifdef ADDR_BITS_REMOVE
672 fprintf_unfiltered (file,
673 "gdbarch_dump: %s # %s\n",
674 "ADDR_BITS_REMOVE(addr)",
675 XSTRING (ADDR_BITS_REMOVE (addr)));
677 fprintf_unfiltered (file,
678 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
679 (long) current_gdbarch->addr_bits_remove);
680 fprintf_unfiltered (file,
681 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
682 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
683 fprintf_unfiltered (file,
684 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
685 (long) current_gdbarch->address_class_name_to_type_flags);
686 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
687 fprintf_unfiltered (file,
688 "gdbarch_dump: %s # %s\n",
689 "ADDRESS_CLASS_TYPE_FLAGS_P()",
690 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
692 fprintf_unfiltered (file,
693 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
694 gdbarch_address_class_type_flags_p (current_gdbarch));
695 #ifdef ADDRESS_CLASS_TYPE_FLAGS
696 fprintf_unfiltered (file,
697 "gdbarch_dump: %s # %s\n",
698 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
699 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
701 fprintf_unfiltered (file,
702 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
703 (long) current_gdbarch->address_class_type_flags);
704 fprintf_unfiltered (file,
705 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
706 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
707 fprintf_unfiltered (file,
708 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
709 (long) current_gdbarch->address_class_type_flags_to_name);
710 #ifdef ADDRESS_TO_POINTER
711 fprintf_unfiltered (file,
712 "gdbarch_dump: %s # %s\n",
713 "ADDRESS_TO_POINTER(type, buf, addr)",
714 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
716 fprintf_unfiltered (file,
717 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
718 (long) current_gdbarch->address_to_pointer);
719 fprintf_unfiltered (file,
720 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
721 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
722 fprintf_unfiltered (file,
723 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
724 (long) current_gdbarch->adjust_breakpoint_address);
725 #ifdef BELIEVE_PCC_PROMOTION
726 fprintf_unfiltered (file,
727 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
728 XSTRING (BELIEVE_PCC_PROMOTION));
730 fprintf_unfiltered (file,
731 "gdbarch_dump: believe_pcc_promotion = %s\n",
732 paddr_d (current_gdbarch->believe_pcc_promotion));
733 #ifdef TARGET_ARCHITECTURE
734 fprintf_unfiltered (file,
735 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
736 XSTRING (TARGET_ARCHITECTURE));
738 fprintf_unfiltered (file,
739 "gdbarch_dump: bfd_arch_info = %s\n",
740 TARGET_ARCHITECTURE->printable_name);
741 #ifdef TARGET_BFD_VMA_BIT
742 fprintf_unfiltered (file,
743 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
744 XSTRING (TARGET_BFD_VMA_BIT));
746 fprintf_unfiltered (file,
747 "gdbarch_dump: bfd_vma_bit = %s\n",
748 paddr_d (current_gdbarch->bfd_vma_bit));
749 #ifdef BREAKPOINT_FROM_PC
750 fprintf_unfiltered (file,
751 "gdbarch_dump: %s # %s\n",
752 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
753 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
755 fprintf_unfiltered (file,
756 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
757 (long) current_gdbarch->breakpoint_from_pc);
758 #ifdef TARGET_BYTE_ORDER
759 fprintf_unfiltered (file,
760 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
761 XSTRING (TARGET_BYTE_ORDER));
763 fprintf_unfiltered (file,
764 "gdbarch_dump: byte_order = %s\n",
765 paddr_d (current_gdbarch->byte_order));
766 #ifdef CALL_DUMMY_LOCATION
767 fprintf_unfiltered (file,
768 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
769 XSTRING (CALL_DUMMY_LOCATION));
771 fprintf_unfiltered (file,
772 "gdbarch_dump: call_dummy_location = %s\n",
773 paddr_d (current_gdbarch->call_dummy_location));
774 #ifdef CANNOT_FETCH_REGISTER
775 fprintf_unfiltered (file,
776 "gdbarch_dump: %s # %s\n",
777 "CANNOT_FETCH_REGISTER(regnum)",
778 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
780 fprintf_unfiltered (file,
781 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
782 (long) current_gdbarch->cannot_fetch_register);
783 #ifdef CANNOT_STEP_BREAKPOINT
784 fprintf_unfiltered (file,
785 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
786 XSTRING (CANNOT_STEP_BREAKPOINT));
788 fprintf_unfiltered (file,
789 "gdbarch_dump: cannot_step_breakpoint = %s\n",
790 paddr_d (current_gdbarch->cannot_step_breakpoint));
791 #ifdef CANNOT_STORE_REGISTER
792 fprintf_unfiltered (file,
793 "gdbarch_dump: %s # %s\n",
794 "CANNOT_STORE_REGISTER(regnum)",
795 XSTRING (CANNOT_STORE_REGISTER (regnum)));
797 fprintf_unfiltered (file,
798 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
799 (long) current_gdbarch->cannot_store_register);
800 #ifdef TARGET_CHAR_SIGNED
801 fprintf_unfiltered (file,
802 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
803 XSTRING (TARGET_CHAR_SIGNED));
805 fprintf_unfiltered (file,
806 "gdbarch_dump: char_signed = %s\n",
807 paddr_d (current_gdbarch->char_signed));
808 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
809 fprintf_unfiltered (file,
810 "gdbarch_dump: %s # %s\n",
811 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
812 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
814 fprintf_unfiltered (file,
815 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
816 (long) current_gdbarch->coff_make_msymbol_special);
817 fprintf_unfiltered (file,
818 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
819 (long) current_gdbarch->construct_inferior_arguments);
820 fprintf_unfiltered (file,
821 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
822 (long) current_gdbarch->convert_from_func_ptr_addr);
823 #ifdef CONVERT_REGISTER_P
824 fprintf_unfiltered (file,
825 "gdbarch_dump: %s # %s\n",
826 "CONVERT_REGISTER_P(regnum, type)",
827 XSTRING (CONVERT_REGISTER_P (regnum, type)));
829 fprintf_unfiltered (file,
830 "gdbarch_dump: convert_register_p = <0x%lx>\n",
831 (long) current_gdbarch->convert_register_p);
832 #ifdef DECR_PC_AFTER_BREAK
833 fprintf_unfiltered (file,
834 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
835 XSTRING (DECR_PC_AFTER_BREAK));
837 fprintf_unfiltered (file,
838 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
839 paddr_nz (current_gdbarch->decr_pc_after_break));
840 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
841 fprintf_unfiltered (file,
842 "gdbarch_dump: %s # %s\n",
843 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
844 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
846 fprintf_unfiltered (file,
847 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
848 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
849 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
850 fprintf_unfiltered (file,
851 "gdbarch_dump: %s # %s\n",
852 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
853 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
855 fprintf_unfiltered (file,
856 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
857 (long) current_gdbarch->deprecated_extract_struct_value_address);
858 #ifdef DEPRECATED_FP_REGNUM
859 fprintf_unfiltered (file,
860 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
861 XSTRING (DEPRECATED_FP_REGNUM));
863 fprintf_unfiltered (file,
864 "gdbarch_dump: deprecated_fp_regnum = %s\n",
865 paddr_d (current_gdbarch->deprecated_fp_regnum));
866 #ifdef DEPRECATED_FUNCTION_START_OFFSET
867 fprintf_unfiltered (file,
868 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
869 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
871 fprintf_unfiltered (file,
872 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
873 paddr_nz (current_gdbarch->deprecated_function_start_offset));
874 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
875 fprintf_unfiltered (file,
876 "gdbarch_dump: %s # %s\n",
877 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
878 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
880 fprintf_unfiltered (file,
881 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
882 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
883 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
884 fprintf_unfiltered (file,
885 "gdbarch_dump: %s # %s\n",
886 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
887 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
889 fprintf_unfiltered (file,
890 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
891 (long) current_gdbarch->deprecated_reg_struct_has_addr);
892 #ifdef DEPRECATED_REGISTER_SIZE
893 fprintf_unfiltered (file,
894 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
895 XSTRING (DEPRECATED_REGISTER_SIZE));
897 fprintf_unfiltered (file,
898 "gdbarch_dump: deprecated_register_size = %s\n",
899 paddr_d (current_gdbarch->deprecated_register_size));
900 #ifdef DEPRECATED_STACK_ALIGN_P
901 fprintf_unfiltered (file,
902 "gdbarch_dump: %s # %s\n",
903 "DEPRECATED_STACK_ALIGN_P()",
904 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
906 fprintf_unfiltered (file,
907 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
908 gdbarch_deprecated_stack_align_p (current_gdbarch));
909 #ifdef DEPRECATED_STACK_ALIGN
910 fprintf_unfiltered (file,
911 "gdbarch_dump: %s # %s\n",
912 "DEPRECATED_STACK_ALIGN(sp)",
913 XSTRING (DEPRECATED_STACK_ALIGN (sp)));
915 fprintf_unfiltered (file,
916 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
917 (long) current_gdbarch->deprecated_stack_align);
918 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
919 fprintf_unfiltered (file,
920 "gdbarch_dump: %s # %s\n",
921 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
922 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
924 fprintf_unfiltered (file,
925 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
926 (long) current_gdbarch->deprecated_use_struct_convention);
927 #ifdef TARGET_DOUBLE_BIT
928 fprintf_unfiltered (file,
929 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
930 XSTRING (TARGET_DOUBLE_BIT));
932 fprintf_unfiltered (file,
933 "gdbarch_dump: double_bit = %s\n",
934 paddr_d (current_gdbarch->double_bit));
935 #ifdef TARGET_DOUBLE_FORMAT
936 fprintf_unfiltered (file,
937 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
938 XSTRING (TARGET_DOUBLE_FORMAT));
940 fprintf_unfiltered (file,
941 "gdbarch_dump: double_format = %s\n",
942 pformat (current_gdbarch->double_format));
943 #ifdef DWARF2_REG_TO_REGNUM
944 fprintf_unfiltered (file,
945 "gdbarch_dump: %s # %s\n",
946 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
947 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
949 fprintf_unfiltered (file,
950 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
951 (long) current_gdbarch->dwarf2_reg_to_regnum);
952 #ifdef DWARF_REG_TO_REGNUM
953 fprintf_unfiltered (file,
954 "gdbarch_dump: %s # %s\n",
955 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
956 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
958 fprintf_unfiltered (file,
959 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
960 (long) current_gdbarch->dwarf_reg_to_regnum);
961 #ifdef ECOFF_REG_TO_REGNUM
962 fprintf_unfiltered (file,
963 "gdbarch_dump: %s # %s\n",
964 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
965 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
967 fprintf_unfiltered (file,
968 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
969 (long) current_gdbarch->ecoff_reg_to_regnum);
970 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
971 fprintf_unfiltered (file,
972 "gdbarch_dump: %s # %s\n",
973 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
974 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
976 fprintf_unfiltered (file,
977 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
978 (long) current_gdbarch->elf_make_msymbol_special);
979 #ifdef EXTRACT_RETURN_VALUE
980 fprintf_unfiltered (file,
981 "gdbarch_dump: %s # %s\n",
982 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
983 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
985 fprintf_unfiltered (file,
986 "gdbarch_dump: extract_return_value = <0x%lx>\n",
987 (long) current_gdbarch->extract_return_value);
988 #ifdef FETCH_POINTER_ARGUMENT_P
989 fprintf_unfiltered (file,
990 "gdbarch_dump: %s # %s\n",
991 "FETCH_POINTER_ARGUMENT_P()",
992 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
994 fprintf_unfiltered (file,
995 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
996 gdbarch_fetch_pointer_argument_p (current_gdbarch));
997 #ifdef FETCH_POINTER_ARGUMENT
998 fprintf_unfiltered (file,
999 "gdbarch_dump: %s # %s\n",
1000 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1001 XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
1003 fprintf_unfiltered (file,
1004 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1005 (long) current_gdbarch->fetch_pointer_argument);
1006 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS_P
1007 fprintf_unfiltered (file,
1008 "gdbarch_dump: %s # %s\n",
1009 "FETCH_TLS_LOAD_MODULE_ADDRESS_P()",
1010 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS_P ()));
1012 fprintf_unfiltered (file,
1013 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
1014 gdbarch_fetch_tls_load_module_address_p (current_gdbarch));
1015 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS
1016 fprintf_unfiltered (file,
1017 "gdbarch_dump: %s # %s\n",
1018 "FETCH_TLS_LOAD_MODULE_ADDRESS(objfile)",
1019 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS (objfile)));
1021 fprintf_unfiltered (file,
1022 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
1023 (long) current_gdbarch->fetch_tls_load_module_address);
1024 #ifdef TARGET_FLOAT_BIT
1025 fprintf_unfiltered (file,
1026 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1027 XSTRING (TARGET_FLOAT_BIT));
1029 fprintf_unfiltered (file,
1030 "gdbarch_dump: float_bit = %s\n",
1031 paddr_d (current_gdbarch->float_bit));
1032 #ifdef TARGET_FLOAT_FORMAT
1033 fprintf_unfiltered (file,
1034 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1035 XSTRING (TARGET_FLOAT_FORMAT));
1037 fprintf_unfiltered (file,
1038 "gdbarch_dump: float_format = %s\n",
1039 pformat (current_gdbarch->float_format));
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: FP0_REGNUM # %s\n",
1043 XSTRING (FP0_REGNUM));
1045 fprintf_unfiltered (file,
1046 "gdbarch_dump: fp0_regnum = %s\n",
1047 paddr_d (current_gdbarch->fp0_regnum));
1048 fprintf_unfiltered (file,
1049 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1050 gdbarch_frame_align_p (current_gdbarch));
1051 fprintf_unfiltered (file,
1052 "gdbarch_dump: frame_align = <0x%lx>\n",
1053 (long) current_gdbarch->frame_align);
1054 #ifdef FRAME_ARGS_SKIP
1055 fprintf_unfiltered (file,
1056 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1057 XSTRING (FRAME_ARGS_SKIP));
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: frame_args_skip = 0x%s\n",
1061 paddr_nz (current_gdbarch->frame_args_skip));
1062 #ifdef FRAME_NUM_ARGS_P
1063 fprintf_unfiltered (file,
1064 "gdbarch_dump: %s # %s\n",
1065 "FRAME_NUM_ARGS_P()",
1066 XSTRING (FRAME_NUM_ARGS_P ()));
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1070 gdbarch_frame_num_args_p (current_gdbarch));
1071 #ifdef FRAME_NUM_ARGS
1072 fprintf_unfiltered (file,
1073 "gdbarch_dump: %s # %s\n",
1074 "FRAME_NUM_ARGS(frame)",
1075 XSTRING (FRAME_NUM_ARGS (frame)));
1077 fprintf_unfiltered (file,
1078 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1079 (long) current_gdbarch->frame_num_args);
1080 #ifdef FRAME_RED_ZONE_SIZE
1081 fprintf_unfiltered (file,
1082 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1083 XSTRING (FRAME_RED_ZONE_SIZE));
1085 fprintf_unfiltered (file,
1086 "gdbarch_dump: frame_red_zone_size = %s\n",
1087 paddr_d (current_gdbarch->frame_red_zone_size));
1088 #ifdef GET_LONGJMP_TARGET_P
1089 fprintf_unfiltered (file,
1090 "gdbarch_dump: %s # %s\n",
1091 "GET_LONGJMP_TARGET_P()",
1092 XSTRING (GET_LONGJMP_TARGET_P ()));
1094 fprintf_unfiltered (file,
1095 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1096 gdbarch_get_longjmp_target_p (current_gdbarch));
1097 #ifdef GET_LONGJMP_TARGET
1098 fprintf_unfiltered (file,
1099 "gdbarch_dump: %s # %s\n",
1100 "GET_LONGJMP_TARGET(pc)",
1101 XSTRING (GET_LONGJMP_TARGET (pc)));
1103 fprintf_unfiltered (file,
1104 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1105 (long) current_gdbarch->get_longjmp_target);
1106 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1107 fprintf_unfiltered (file,
1108 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1109 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1111 fprintf_unfiltered (file,
1112 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1113 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
1114 fprintf_unfiltered (file,
1115 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1116 (long) current_gdbarch->in_function_epilogue_p);
1117 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: %s # %s\n",
1120 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1121 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1123 fprintf_unfiltered (file,
1124 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1125 (long) current_gdbarch->in_solib_return_trampoline);
1127 fprintf_unfiltered (file,
1128 "gdbarch_dump: %s # %s\n",
1129 "INNER_THAN(lhs, rhs)",
1130 XSTRING (INNER_THAN (lhs, rhs)));
1132 fprintf_unfiltered (file,
1133 "gdbarch_dump: inner_than = <0x%lx>\n",
1134 (long) current_gdbarch->inner_than);
1135 #ifdef TARGET_INT_BIT
1136 fprintf_unfiltered (file,
1137 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1138 XSTRING (TARGET_INT_BIT));
1140 fprintf_unfiltered (file,
1141 "gdbarch_dump: int_bit = %s\n",
1142 paddr_d (current_gdbarch->int_bit));
1143 fprintf_unfiltered (file,
1144 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1145 gdbarch_integer_to_address_p (current_gdbarch));
1146 fprintf_unfiltered (file,
1147 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1148 (long) current_gdbarch->integer_to_address);
1149 #ifdef TARGET_LONG_BIT
1150 fprintf_unfiltered (file,
1151 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1152 XSTRING (TARGET_LONG_BIT));
1154 fprintf_unfiltered (file,
1155 "gdbarch_dump: long_bit = %s\n",
1156 paddr_d (current_gdbarch->long_bit));
1157 #ifdef TARGET_LONG_DOUBLE_BIT
1158 fprintf_unfiltered (file,
1159 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1160 XSTRING (TARGET_LONG_DOUBLE_BIT));
1162 fprintf_unfiltered (file,
1163 "gdbarch_dump: long_double_bit = %s\n",
1164 paddr_d (current_gdbarch->long_double_bit));
1165 #ifdef TARGET_LONG_DOUBLE_FORMAT
1166 fprintf_unfiltered (file,
1167 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1168 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1170 fprintf_unfiltered (file,
1171 "gdbarch_dump: long_double_format = %s\n",
1172 pformat (current_gdbarch->long_double_format));
1173 #ifdef TARGET_LONG_LONG_BIT
1174 fprintf_unfiltered (file,
1175 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1176 XSTRING (TARGET_LONG_LONG_BIT));
1178 fprintf_unfiltered (file,
1179 "gdbarch_dump: long_long_bit = %s\n",
1180 paddr_d (current_gdbarch->long_long_bit));
1181 #ifdef MEMORY_INSERT_BREAKPOINT
1182 fprintf_unfiltered (file,
1183 "gdbarch_dump: %s # %s\n",
1184 "MEMORY_INSERT_BREAKPOINT(bp_tgt)",
1185 XSTRING (MEMORY_INSERT_BREAKPOINT (bp_tgt)));
1187 fprintf_unfiltered (file,
1188 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1189 (long) current_gdbarch->memory_insert_breakpoint);
1190 #ifdef MEMORY_REMOVE_BREAKPOINT
1191 fprintf_unfiltered (file,
1192 "gdbarch_dump: %s # %s\n",
1193 "MEMORY_REMOVE_BREAKPOINT(bp_tgt)",
1194 XSTRING (MEMORY_REMOVE_BREAKPOINT (bp_tgt)));
1196 fprintf_unfiltered (file,
1197 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1198 (long) current_gdbarch->memory_remove_breakpoint);
1199 #ifdef NAME_OF_MALLOC
1200 fprintf_unfiltered (file,
1201 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1202 XSTRING (NAME_OF_MALLOC));
1204 fprintf_unfiltered (file,
1205 "gdbarch_dump: name_of_malloc = %s\n",
1207 #ifdef NUM_PSEUDO_REGS
1208 fprintf_unfiltered (file,
1209 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1210 XSTRING (NUM_PSEUDO_REGS));
1212 fprintf_unfiltered (file,
1213 "gdbarch_dump: num_pseudo_regs = %s\n",
1214 paddr_d (current_gdbarch->num_pseudo_regs));
1216 fprintf_unfiltered (file,
1217 "gdbarch_dump: NUM_REGS # %s\n",
1218 XSTRING (NUM_REGS));
1220 fprintf_unfiltered (file,
1221 "gdbarch_dump: num_regs = %s\n",
1222 paddr_d (current_gdbarch->num_regs));
1224 fprintf_unfiltered (file,
1225 "gdbarch_dump: TARGET_OSABI # %s\n",
1226 XSTRING (TARGET_OSABI));
1228 fprintf_unfiltered (file,
1229 "gdbarch_dump: osabi = %s\n",
1230 paddr_d (current_gdbarch->osabi));
1232 fprintf_unfiltered (file,
1233 "gdbarch_dump: PC_REGNUM # %s\n",
1234 XSTRING (PC_REGNUM));
1236 fprintf_unfiltered (file,
1237 "gdbarch_dump: pc_regnum = %s\n",
1238 paddr_d (current_gdbarch->pc_regnum));
1239 #ifdef POINTER_TO_ADDRESS
1240 fprintf_unfiltered (file,
1241 "gdbarch_dump: %s # %s\n",
1242 "POINTER_TO_ADDRESS(type, buf)",
1243 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1245 fprintf_unfiltered (file,
1246 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1247 (long) current_gdbarch->pointer_to_address);
1248 fprintf_unfiltered (file,
1249 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1250 gdbarch_print_float_info_p (current_gdbarch));
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: print_float_info = <0x%lx>\n",
1253 (long) current_gdbarch->print_float_info);
1254 #ifdef TARGET_PRINT_INSN
1255 fprintf_unfiltered (file,
1256 "gdbarch_dump: %s # %s\n",
1257 "TARGET_PRINT_INSN(vma, info)",
1258 XSTRING (TARGET_PRINT_INSN (vma, info)));
1260 fprintf_unfiltered (file,
1261 "gdbarch_dump: print_insn = <0x%lx>\n",
1262 (long) current_gdbarch->print_insn);
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1265 (long) current_gdbarch->print_registers_info);
1266 fprintf_unfiltered (file,
1267 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1268 gdbarch_print_vector_info_p (current_gdbarch));
1269 fprintf_unfiltered (file,
1270 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1271 (long) current_gdbarch->print_vector_info);
1273 fprintf_unfiltered (file,
1274 "gdbarch_dump: PS_REGNUM # %s\n",
1275 XSTRING (PS_REGNUM));
1277 fprintf_unfiltered (file,
1278 "gdbarch_dump: ps_regnum = %s\n",
1279 paddr_d (current_gdbarch->ps_regnum));
1280 fprintf_unfiltered (file,
1281 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1282 gdbarch_pseudo_register_read_p (current_gdbarch));
1283 fprintf_unfiltered (file,
1284 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1285 (long) current_gdbarch->pseudo_register_read);
1286 fprintf_unfiltered (file,
1287 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1288 gdbarch_pseudo_register_write_p (current_gdbarch));
1289 fprintf_unfiltered (file,
1290 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1291 (long) current_gdbarch->pseudo_register_write);
1292 #ifdef TARGET_PTR_BIT
1293 fprintf_unfiltered (file,
1294 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1295 XSTRING (TARGET_PTR_BIT));
1297 fprintf_unfiltered (file,
1298 "gdbarch_dump: ptr_bit = %s\n",
1299 paddr_d (current_gdbarch->ptr_bit));
1300 fprintf_unfiltered (file,
1301 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1302 gdbarch_push_dummy_call_p (current_gdbarch));
1303 fprintf_unfiltered (file,
1304 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1305 (long) current_gdbarch->push_dummy_call);
1306 fprintf_unfiltered (file,
1307 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1308 gdbarch_push_dummy_code_p (current_gdbarch));
1309 fprintf_unfiltered (file,
1310 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1311 (long) current_gdbarch->push_dummy_code);
1312 #ifdef TARGET_READ_PC_P
1313 fprintf_unfiltered (file,
1314 "gdbarch_dump: %s # %s\n",
1315 "TARGET_READ_PC_P()",
1316 XSTRING (TARGET_READ_PC_P ()));
1318 fprintf_unfiltered (file,
1319 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1320 gdbarch_read_pc_p (current_gdbarch));
1321 #ifdef TARGET_READ_PC
1322 fprintf_unfiltered (file,
1323 "gdbarch_dump: %s # %s\n",
1324 "TARGET_READ_PC(ptid)",
1325 XSTRING (TARGET_READ_PC (ptid)));
1327 fprintf_unfiltered (file,
1328 "gdbarch_dump: read_pc = <0x%lx>\n",
1329 (long) current_gdbarch->read_pc);
1330 #ifdef TARGET_READ_SP_P
1331 fprintf_unfiltered (file,
1332 "gdbarch_dump: %s # %s\n",
1333 "TARGET_READ_SP_P()",
1334 XSTRING (TARGET_READ_SP_P ()));
1336 fprintf_unfiltered (file,
1337 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1338 gdbarch_read_sp_p (current_gdbarch));
1339 #ifdef TARGET_READ_SP
1340 fprintf_unfiltered (file,
1341 "gdbarch_dump: %s # %s\n",
1343 XSTRING (TARGET_READ_SP ()));
1345 fprintf_unfiltered (file,
1346 "gdbarch_dump: read_sp = <0x%lx>\n",
1347 (long) current_gdbarch->read_sp);
1348 #ifdef REGISTER_BYTES_OK_P
1349 fprintf_unfiltered (file,
1350 "gdbarch_dump: %s # %s\n",
1351 "REGISTER_BYTES_OK_P()",
1352 XSTRING (REGISTER_BYTES_OK_P ()));
1354 fprintf_unfiltered (file,
1355 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1356 gdbarch_register_bytes_ok_p (current_gdbarch));
1357 #ifdef REGISTER_BYTES_OK
1358 fprintf_unfiltered (file,
1359 "gdbarch_dump: %s # %s\n",
1360 "REGISTER_BYTES_OK(nr_bytes)",
1361 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1363 fprintf_unfiltered (file,
1364 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1365 (long) current_gdbarch->register_bytes_ok);
1366 #ifdef REGISTER_NAME
1367 fprintf_unfiltered (file,
1368 "gdbarch_dump: %s # %s\n",
1369 "REGISTER_NAME(regnr)",
1370 XSTRING (REGISTER_NAME (regnr)));
1372 fprintf_unfiltered (file,
1373 "gdbarch_dump: register_name = <0x%lx>\n",
1374 (long) current_gdbarch->register_name);
1375 fprintf_unfiltered (file,
1376 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1377 (long) current_gdbarch->register_reggroup_p);
1378 #ifdef REGISTER_SIM_REGNO
1379 fprintf_unfiltered (file,
1380 "gdbarch_dump: %s # %s\n",
1381 "REGISTER_SIM_REGNO(reg_nr)",
1382 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1384 fprintf_unfiltered (file,
1385 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1386 (long) current_gdbarch->register_sim_regno);
1387 #ifdef REGISTER_TO_VALUE
1388 fprintf_unfiltered (file,
1389 "gdbarch_dump: %s # %s\n",
1390 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1391 XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
1393 fprintf_unfiltered (file,
1394 "gdbarch_dump: register_to_value = <0x%lx>\n",
1395 (long) current_gdbarch->register_to_value);
1396 fprintf_unfiltered (file,
1397 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1398 gdbarch_register_type_p (current_gdbarch));
1399 fprintf_unfiltered (file,
1400 "gdbarch_dump: register_type = <0x%lx>\n",
1401 (long) current_gdbarch->register_type);
1402 fprintf_unfiltered (file,
1403 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1404 gdbarch_regset_from_core_section_p (current_gdbarch));
1405 fprintf_unfiltered (file,
1406 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1407 (long) current_gdbarch->regset_from_core_section);
1408 fprintf_unfiltered (file,
1409 "gdbarch_dump: remote_register_number = <0x%lx>\n",
1410 (long) current_gdbarch->remote_register_number);
1411 fprintf_unfiltered (file,
1412 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1413 (long) current_gdbarch->remote_translate_xfer_address);
1414 fprintf_unfiltered (file,
1415 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1416 gdbarch_return_value_p (current_gdbarch));
1417 fprintf_unfiltered (file,
1418 "gdbarch_dump: return_value = <0x%lx>\n",
1419 (long) current_gdbarch->return_value);
1420 #ifdef SDB_REG_TO_REGNUM
1421 fprintf_unfiltered (file,
1422 "gdbarch_dump: %s # %s\n",
1423 "SDB_REG_TO_REGNUM(sdb_regnr)",
1424 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1426 fprintf_unfiltered (file,
1427 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1428 (long) current_gdbarch->sdb_reg_to_regnum);
1429 #ifdef TARGET_SHORT_BIT
1430 fprintf_unfiltered (file,
1431 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1432 XSTRING (TARGET_SHORT_BIT));
1434 fprintf_unfiltered (file,
1435 "gdbarch_dump: short_bit = %s\n",
1436 paddr_d (current_gdbarch->short_bit));
1437 fprintf_unfiltered (file,
1438 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1439 gdbarch_single_step_through_delay_p (current_gdbarch));
1440 fprintf_unfiltered (file,
1441 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1442 (long) current_gdbarch->single_step_through_delay);
1443 fprintf_unfiltered (file,
1444 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1445 gdbarch_skip_permanent_breakpoint_p (current_gdbarch));
1446 fprintf_unfiltered (file,
1447 "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1448 (long) current_gdbarch->skip_permanent_breakpoint);
1449 #ifdef SKIP_PROLOGUE
1450 fprintf_unfiltered (file,
1451 "gdbarch_dump: %s # %s\n",
1452 "SKIP_PROLOGUE(ip)",
1453 XSTRING (SKIP_PROLOGUE (ip)));
1455 fprintf_unfiltered (file,
1456 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1457 (long) current_gdbarch->skip_prologue);
1458 fprintf_unfiltered (file,
1459 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1460 (long) current_gdbarch->skip_solib_resolver);
1461 #ifdef SKIP_TRAMPOLINE_CODE
1462 fprintf_unfiltered (file,
1463 "gdbarch_dump: %s # %s\n",
1464 "SKIP_TRAMPOLINE_CODE(pc)",
1465 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1467 fprintf_unfiltered (file,
1468 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1469 (long) current_gdbarch->skip_trampoline_code);
1470 #ifdef SMASH_TEXT_ADDRESS
1471 fprintf_unfiltered (file,
1472 "gdbarch_dump: %s # %s\n",
1473 "SMASH_TEXT_ADDRESS(addr)",
1474 XSTRING (SMASH_TEXT_ADDRESS (addr)));
1476 fprintf_unfiltered (file,
1477 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1478 (long) current_gdbarch->smash_text_address);
1479 #ifdef SOFTWARE_SINGLE_STEP_P
1480 fprintf_unfiltered (file,
1481 "gdbarch_dump: %s # %s\n",
1482 "SOFTWARE_SINGLE_STEP_P()",
1483 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1485 fprintf_unfiltered (file,
1486 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1487 gdbarch_software_single_step_p (current_gdbarch));
1488 #ifdef SOFTWARE_SINGLE_STEP
1489 fprintf_unfiltered (file,
1490 "gdbarch_dump: %s # %s\n",
1491 "SOFTWARE_SINGLE_STEP(regcache)",
1492 XSTRING (SOFTWARE_SINGLE_STEP (regcache)));
1494 fprintf_unfiltered (file,
1495 "gdbarch_dump: software_single_step = <0x%lx>\n",
1496 (long) current_gdbarch->software_single_step);
1498 fprintf_unfiltered (file,
1499 "gdbarch_dump: SP_REGNUM # %s\n",
1500 XSTRING (SP_REGNUM));
1502 fprintf_unfiltered (file,
1503 "gdbarch_dump: sp_regnum = %s\n",
1504 paddr_d (current_gdbarch->sp_regnum));
1505 #ifdef STAB_REG_TO_REGNUM
1506 fprintf_unfiltered (file,
1507 "gdbarch_dump: %s # %s\n",
1508 "STAB_REG_TO_REGNUM(stab_regnr)",
1509 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
1511 fprintf_unfiltered (file,
1512 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1513 (long) current_gdbarch->stab_reg_to_regnum);
1514 fprintf_unfiltered (file,
1515 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1516 (long) current_gdbarch->stabs_argument_has_addr);
1517 #ifdef STORE_RETURN_VALUE
1518 fprintf_unfiltered (file,
1519 "gdbarch_dump: %s # %s\n",
1520 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1521 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1523 fprintf_unfiltered (file,
1524 "gdbarch_dump: store_return_value = <0x%lx>\n",
1525 (long) current_gdbarch->store_return_value);
1526 fprintf_unfiltered (file,
1527 "gdbarch_dump: target_desc = %s\n",
1528 paddr_d ((long) current_gdbarch->target_desc));
1529 fprintf_unfiltered (file,
1530 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1531 gdbarch_unwind_dummy_id_p (current_gdbarch));
1532 fprintf_unfiltered (file,
1533 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1534 (long) current_gdbarch->unwind_dummy_id);
1535 fprintf_unfiltered (file,
1536 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1537 gdbarch_unwind_pc_p (current_gdbarch));
1538 fprintf_unfiltered (file,
1539 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1540 (long) current_gdbarch->unwind_pc);
1541 fprintf_unfiltered (file,
1542 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1543 gdbarch_unwind_sp_p (current_gdbarch));
1544 fprintf_unfiltered (file,
1545 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1546 (long) current_gdbarch->unwind_sp);
1547 fprintf_unfiltered (file,
1548 "gdbarch_dump: value_from_register = <0x%lx>\n",
1549 (long) current_gdbarch->value_from_register);
1550 #ifdef VALUE_TO_REGISTER
1551 fprintf_unfiltered (file,
1552 "gdbarch_dump: %s # %s\n",
1553 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1554 XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
1556 fprintf_unfiltered (file,
1557 "gdbarch_dump: value_to_register = <0x%lx>\n",
1558 (long) current_gdbarch->value_to_register);
1559 fprintf_unfiltered (file,
1560 "gdbarch_dump: vbit_in_delta = %s\n",
1561 paddr_d (current_gdbarch->vbit_in_delta));
1562 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1563 fprintf_unfiltered (file,
1564 "gdbarch_dump: %s # %s\n",
1565 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1566 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
1568 fprintf_unfiltered (file,
1569 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1570 (long) current_gdbarch->virtual_frame_pointer);
1571 fprintf_unfiltered (file,
1572 "gdbarch_dump: vtable_function_descriptors = %s\n",
1573 paddr_d (current_gdbarch->vtable_function_descriptors));
1574 #ifdef TARGET_WRITE_PC
1575 fprintf_unfiltered (file,
1576 "gdbarch_dump: %s # %s\n",
1577 "TARGET_WRITE_PC(val, ptid)",
1578 XSTRING (TARGET_WRITE_PC (val, ptid)));
1580 fprintf_unfiltered (file,
1581 "gdbarch_dump: write_pc = <0x%lx>\n",
1582 (long) current_gdbarch->write_pc);
1583 if (current_gdbarch->dump_tdep != NULL)
1584 current_gdbarch->dump_tdep (current_gdbarch, file);
1587 struct gdbarch_tdep *
1588 gdbarch_tdep (struct gdbarch *gdbarch)
1590 if (gdbarch_debug >= 2)
1591 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1592 return gdbarch->tdep;
1596 const struct bfd_arch_info *
1597 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1599 gdb_assert (gdbarch != NULL);
1600 if (gdbarch_debug >= 2)
1601 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1602 return gdbarch->bfd_arch_info;
1606 gdbarch_byte_order (struct gdbarch *gdbarch)
1608 gdb_assert (gdbarch != NULL);
1609 if (gdbarch_debug >= 2)
1610 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1611 return gdbarch->byte_order;
1615 gdbarch_osabi (struct gdbarch *gdbarch)
1617 gdb_assert (gdbarch != NULL);
1618 if (gdbarch_debug >= 2)
1619 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1620 return gdbarch->osabi;
1623 const struct target_desc *
1624 gdbarch_target_desc (struct gdbarch *gdbarch)
1626 gdb_assert (gdbarch != NULL);
1627 if (gdbarch_debug >= 2)
1628 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1629 return gdbarch->target_desc;
1633 gdbarch_short_bit (struct gdbarch *gdbarch)
1635 gdb_assert (gdbarch != NULL);
1636 /* Skip verify of short_bit, invalid_p == 0 */
1637 if (gdbarch_debug >= 2)
1638 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1639 return gdbarch->short_bit;
1643 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1646 gdbarch->short_bit = short_bit;
1650 gdbarch_int_bit (struct gdbarch *gdbarch)
1652 gdb_assert (gdbarch != NULL);
1653 /* Skip verify of int_bit, invalid_p == 0 */
1654 if (gdbarch_debug >= 2)
1655 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1656 return gdbarch->int_bit;
1660 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1663 gdbarch->int_bit = int_bit;
1667 gdbarch_long_bit (struct gdbarch *gdbarch)
1669 gdb_assert (gdbarch != NULL);
1670 /* Skip verify of long_bit, invalid_p == 0 */
1671 if (gdbarch_debug >= 2)
1672 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1673 return gdbarch->long_bit;
1677 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1680 gdbarch->long_bit = long_bit;
1684 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1686 gdb_assert (gdbarch != NULL);
1687 /* Skip verify of long_long_bit, invalid_p == 0 */
1688 if (gdbarch_debug >= 2)
1689 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1690 return gdbarch->long_long_bit;
1694 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1697 gdbarch->long_long_bit = long_long_bit;
1701 gdbarch_float_bit (struct gdbarch *gdbarch)
1703 gdb_assert (gdbarch != NULL);
1704 /* Skip verify of float_bit, invalid_p == 0 */
1705 if (gdbarch_debug >= 2)
1706 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1707 return gdbarch->float_bit;
1711 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1714 gdbarch->float_bit = float_bit;
1717 const struct floatformat **
1718 gdbarch_float_format (struct gdbarch *gdbarch)
1720 gdb_assert (gdbarch != NULL);
1721 if (gdbarch_debug >= 2)
1722 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1723 return gdbarch->float_format;
1727 set_gdbarch_float_format (struct gdbarch *gdbarch,
1728 const struct floatformat ** float_format)
1730 gdbarch->float_format = float_format;
1734 gdbarch_double_bit (struct gdbarch *gdbarch)
1736 gdb_assert (gdbarch != NULL);
1737 /* Skip verify of double_bit, invalid_p == 0 */
1738 if (gdbarch_debug >= 2)
1739 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1740 return gdbarch->double_bit;
1744 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1747 gdbarch->double_bit = double_bit;
1750 const struct floatformat **
1751 gdbarch_double_format (struct gdbarch *gdbarch)
1753 gdb_assert (gdbarch != NULL);
1754 if (gdbarch_debug >= 2)
1755 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1756 return gdbarch->double_format;
1760 set_gdbarch_double_format (struct gdbarch *gdbarch,
1761 const struct floatformat ** double_format)
1763 gdbarch->double_format = double_format;
1767 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1769 gdb_assert (gdbarch != NULL);
1770 /* Skip verify of long_double_bit, invalid_p == 0 */
1771 if (gdbarch_debug >= 2)
1772 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1773 return gdbarch->long_double_bit;
1777 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1778 int long_double_bit)
1780 gdbarch->long_double_bit = long_double_bit;
1783 const struct floatformat **
1784 gdbarch_long_double_format (struct gdbarch *gdbarch)
1786 gdb_assert (gdbarch != NULL);
1787 if (gdbarch_debug >= 2)
1788 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1789 return gdbarch->long_double_format;
1793 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1794 const struct floatformat ** long_double_format)
1796 gdbarch->long_double_format = long_double_format;
1800 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1802 gdb_assert (gdbarch != NULL);
1803 /* Skip verify of ptr_bit, invalid_p == 0 */
1804 if (gdbarch_debug >= 2)
1805 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1806 return gdbarch->ptr_bit;
1810 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1813 gdbarch->ptr_bit = ptr_bit;
1817 gdbarch_addr_bit (struct gdbarch *gdbarch)
1819 gdb_assert (gdbarch != NULL);
1820 /* Check variable changed from pre-default. */
1821 gdb_assert (gdbarch->addr_bit != 0);
1822 if (gdbarch_debug >= 2)
1823 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1824 return gdbarch->addr_bit;
1828 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1831 gdbarch->addr_bit = addr_bit;
1835 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1837 gdb_assert (gdbarch != NULL);
1838 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1839 if (gdbarch_debug >= 2)
1840 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1841 return gdbarch->bfd_vma_bit;
1845 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1848 gdbarch->bfd_vma_bit = bfd_vma_bit;
1852 gdbarch_char_signed (struct gdbarch *gdbarch)
1854 gdb_assert (gdbarch != NULL);
1855 /* Check variable changed from pre-default. */
1856 gdb_assert (gdbarch->char_signed != -1);
1857 if (gdbarch_debug >= 2)
1858 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1859 return gdbarch->char_signed;
1863 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1866 gdbarch->char_signed = char_signed;
1870 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1872 gdb_assert (gdbarch != NULL);
1873 return gdbarch->read_pc != NULL;
1877 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
1879 gdb_assert (gdbarch != NULL);
1880 gdb_assert (gdbarch->read_pc != NULL);
1881 if (gdbarch_debug >= 2)
1882 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1883 return gdbarch->read_pc (ptid);
1887 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1888 gdbarch_read_pc_ftype read_pc)
1890 gdbarch->read_pc = read_pc;
1894 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
1896 gdb_assert (gdbarch != NULL);
1897 gdb_assert (gdbarch->write_pc != NULL);
1898 if (gdbarch_debug >= 2)
1899 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1900 gdbarch->write_pc (val, ptid);
1904 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1905 gdbarch_write_pc_ftype write_pc)
1907 gdbarch->write_pc = write_pc;
1911 gdbarch_read_sp_p (struct gdbarch *gdbarch)
1913 gdb_assert (gdbarch != NULL);
1914 return gdbarch->read_sp != NULL;
1918 gdbarch_read_sp (struct gdbarch *gdbarch)
1920 gdb_assert (gdbarch != NULL);
1921 gdb_assert (gdbarch->read_sp != NULL);
1922 if (gdbarch_debug >= 2)
1923 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
1924 return gdbarch->read_sp ();
1928 set_gdbarch_read_sp (struct gdbarch *gdbarch,
1929 gdbarch_read_sp_ftype read_sp)
1931 gdbarch->read_sp = read_sp;
1935 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1937 gdb_assert (gdbarch != NULL);
1938 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1939 if (gdbarch_debug >= 2)
1940 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1941 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1945 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1946 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1948 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1952 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1954 gdb_assert (gdbarch != NULL);
1955 return gdbarch->pseudo_register_read != NULL;
1959 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1961 gdb_assert (gdbarch != NULL);
1962 gdb_assert (gdbarch->pseudo_register_read != NULL);
1963 if (gdbarch_debug >= 2)
1964 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1965 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1969 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1970 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1972 gdbarch->pseudo_register_read = pseudo_register_read;
1976 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1978 gdb_assert (gdbarch != NULL);
1979 return gdbarch->pseudo_register_write != NULL;
1983 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1985 gdb_assert (gdbarch != NULL);
1986 gdb_assert (gdbarch->pseudo_register_write != NULL);
1987 if (gdbarch_debug >= 2)
1988 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1989 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1993 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1994 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1996 gdbarch->pseudo_register_write = pseudo_register_write;
2000 gdbarch_num_regs (struct gdbarch *gdbarch)
2002 gdb_assert (gdbarch != NULL);
2003 /* Check variable changed from pre-default. */
2004 gdb_assert (gdbarch->num_regs != -1);
2005 if (gdbarch_debug >= 2)
2006 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2007 return gdbarch->num_regs;
2011 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2014 gdbarch->num_regs = num_regs;
2018 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2020 gdb_assert (gdbarch != NULL);
2021 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2022 if (gdbarch_debug >= 2)
2023 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2024 return gdbarch->num_pseudo_regs;
2028 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2029 int num_pseudo_regs)
2031 gdbarch->num_pseudo_regs = num_pseudo_regs;
2035 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2037 gdb_assert (gdbarch != NULL);
2038 /* Skip verify of sp_regnum, invalid_p == 0 */
2039 if (gdbarch_debug >= 2)
2040 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2041 return gdbarch->sp_regnum;
2045 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2048 gdbarch->sp_regnum = sp_regnum;
2052 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2054 gdb_assert (gdbarch != NULL);
2055 /* Skip verify of pc_regnum, invalid_p == 0 */
2056 if (gdbarch_debug >= 2)
2057 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2058 return gdbarch->pc_regnum;
2062 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2065 gdbarch->pc_regnum = pc_regnum;
2069 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2071 gdb_assert (gdbarch != NULL);
2072 /* Skip verify of ps_regnum, invalid_p == 0 */
2073 if (gdbarch_debug >= 2)
2074 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2075 return gdbarch->ps_regnum;
2079 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2082 gdbarch->ps_regnum = ps_regnum;
2086 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2088 gdb_assert (gdbarch != NULL);
2089 /* Skip verify of fp0_regnum, invalid_p == 0 */
2090 if (gdbarch_debug >= 2)
2091 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2092 return gdbarch->fp0_regnum;
2096 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2099 gdbarch->fp0_regnum = fp0_regnum;
2103 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2105 gdb_assert (gdbarch != NULL);
2106 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
2107 if (gdbarch_debug >= 2)
2108 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2109 return gdbarch->stab_reg_to_regnum (stab_regnr);
2113 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2114 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2116 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2120 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2122 gdb_assert (gdbarch != NULL);
2123 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
2124 if (gdbarch_debug >= 2)
2125 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2126 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2130 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2131 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2133 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2137 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2139 gdb_assert (gdbarch != NULL);
2140 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
2141 if (gdbarch_debug >= 2)
2142 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2143 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2147 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2148 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2150 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2154 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2156 gdb_assert (gdbarch != NULL);
2157 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
2158 if (gdbarch_debug >= 2)
2159 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2160 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2164 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2165 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2167 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2171 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2173 gdb_assert (gdbarch != NULL);
2174 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
2175 if (gdbarch_debug >= 2)
2176 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2177 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2181 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2182 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2184 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2188 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2190 gdb_assert (gdbarch != NULL);
2191 gdb_assert (gdbarch->register_name != NULL);
2192 if (gdbarch_debug >= 2)
2193 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2194 return gdbarch->register_name (regnr);
2198 set_gdbarch_register_name (struct gdbarch *gdbarch,
2199 gdbarch_register_name_ftype register_name)
2201 gdbarch->register_name = register_name;
2205 gdbarch_register_type_p (struct gdbarch *gdbarch)
2207 gdb_assert (gdbarch != NULL);
2208 return gdbarch->register_type != NULL;
2212 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2214 gdb_assert (gdbarch != NULL);
2215 gdb_assert (gdbarch->register_type != NULL);
2216 if (gdbarch_debug >= 2)
2217 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2218 return gdbarch->register_type (gdbarch, reg_nr);
2222 set_gdbarch_register_type (struct gdbarch *gdbarch,
2223 gdbarch_register_type_ftype register_type)
2225 gdbarch->register_type = register_type;
2229 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
2231 gdb_assert (gdbarch != NULL);
2232 return gdbarch->unwind_dummy_id != NULL;
2236 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
2238 gdb_assert (gdbarch != NULL);
2239 gdb_assert (gdbarch->unwind_dummy_id != NULL);
2240 if (gdbarch_debug >= 2)
2241 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
2242 return gdbarch->unwind_dummy_id (gdbarch, info);
2246 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
2247 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
2249 gdbarch->unwind_dummy_id = unwind_dummy_id;
2253 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2255 gdb_assert (gdbarch != NULL);
2256 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2257 if (gdbarch_debug >= 2)
2258 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2259 return gdbarch->deprecated_fp_regnum;
2263 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2264 int deprecated_fp_regnum)
2266 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2270 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
2272 gdb_assert (gdbarch != NULL);
2273 return gdbarch->push_dummy_call != NULL;
2277 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)
2279 gdb_assert (gdbarch != NULL);
2280 gdb_assert (gdbarch->push_dummy_call != NULL);
2281 if (gdbarch_debug >= 2)
2282 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
2283 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
2287 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2288 gdbarch_push_dummy_call_ftype push_dummy_call)
2290 gdbarch->push_dummy_call = push_dummy_call;
2294 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
2296 gdb_assert (gdbarch != NULL);
2297 if (gdbarch_debug >= 2)
2298 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
2299 return gdbarch->deprecated_register_size;
2303 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
2304 int deprecated_register_size)
2306 gdbarch->deprecated_register_size = deprecated_register_size;
2310 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2312 gdb_assert (gdbarch != NULL);
2313 /* Skip verify of call_dummy_location, invalid_p == 0 */
2314 if (gdbarch_debug >= 2)
2315 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2316 return gdbarch->call_dummy_location;
2320 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2321 int call_dummy_location)
2323 gdbarch->call_dummy_location = call_dummy_location;
2327 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
2329 gdb_assert (gdbarch != NULL);
2330 return gdbarch->push_dummy_code != NULL;
2334 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)
2336 gdb_assert (gdbarch != NULL);
2337 gdb_assert (gdbarch->push_dummy_code != NULL);
2338 if (gdbarch_debug >= 2)
2339 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
2340 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
2344 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2345 gdbarch_push_dummy_code_ftype push_dummy_code)
2347 gdbarch->push_dummy_code = push_dummy_code;
2351 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2353 gdb_assert (gdbarch != NULL);
2354 gdb_assert (gdbarch->print_registers_info != NULL);
2355 if (gdbarch_debug >= 2)
2356 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2357 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2361 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2362 gdbarch_print_registers_info_ftype print_registers_info)
2364 gdbarch->print_registers_info = print_registers_info;
2368 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2370 gdb_assert (gdbarch != NULL);
2371 return gdbarch->print_float_info != NULL;
2375 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2377 gdb_assert (gdbarch != NULL);
2378 gdb_assert (gdbarch->print_float_info != NULL);
2379 if (gdbarch_debug >= 2)
2380 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2381 gdbarch->print_float_info (gdbarch, file, frame, args);
2385 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2386 gdbarch_print_float_info_ftype print_float_info)
2388 gdbarch->print_float_info = print_float_info;
2392 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2394 gdb_assert (gdbarch != NULL);
2395 return gdbarch->print_vector_info != NULL;
2399 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2401 gdb_assert (gdbarch != NULL);
2402 gdb_assert (gdbarch->print_vector_info != NULL);
2403 if (gdbarch_debug >= 2)
2404 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2405 gdbarch->print_vector_info (gdbarch, file, frame, args);
2409 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2410 gdbarch_print_vector_info_ftype print_vector_info)
2412 gdbarch->print_vector_info = print_vector_info;
2416 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2418 gdb_assert (gdbarch != NULL);
2419 gdb_assert (gdbarch->register_sim_regno != NULL);
2420 if (gdbarch_debug >= 2)
2421 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2422 return gdbarch->register_sim_regno (reg_nr);
2426 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2427 gdbarch_register_sim_regno_ftype register_sim_regno)
2429 gdbarch->register_sim_regno = register_sim_regno;
2433 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
2435 gdb_assert (gdbarch != NULL);
2436 return gdbarch->register_bytes_ok != NULL;
2440 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
2442 gdb_assert (gdbarch != NULL);
2443 gdb_assert (gdbarch->register_bytes_ok != NULL);
2444 if (gdbarch_debug >= 2)
2445 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
2446 return gdbarch->register_bytes_ok (nr_bytes);
2450 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
2451 gdbarch_register_bytes_ok_ftype register_bytes_ok)
2453 gdbarch->register_bytes_ok = register_bytes_ok;
2457 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2459 gdb_assert (gdbarch != NULL);
2460 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2461 if (gdbarch_debug >= 2)
2462 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2463 return gdbarch->cannot_fetch_register (regnum);
2467 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2468 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2470 gdbarch->cannot_fetch_register = cannot_fetch_register;
2474 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2476 gdb_assert (gdbarch != NULL);
2477 gdb_assert (gdbarch->cannot_store_register != NULL);
2478 if (gdbarch_debug >= 2)
2479 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2480 return gdbarch->cannot_store_register (regnum);
2484 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2485 gdbarch_cannot_store_register_ftype cannot_store_register)
2487 gdbarch->cannot_store_register = cannot_store_register;
2491 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2493 gdb_assert (gdbarch != NULL);
2494 return gdbarch->get_longjmp_target != NULL;
2498 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
2500 gdb_assert (gdbarch != NULL);
2501 gdb_assert (gdbarch->get_longjmp_target != NULL);
2502 if (gdbarch_debug >= 2)
2503 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2504 return gdbarch->get_longjmp_target (pc);
2508 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2509 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2511 gdbarch->get_longjmp_target = get_longjmp_target;
2515 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2517 gdb_assert (gdbarch != NULL);
2518 if (gdbarch_debug >= 2)
2519 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2520 return gdbarch->believe_pcc_promotion;
2524 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2525 int believe_pcc_promotion)
2527 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2531 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2533 gdb_assert (gdbarch != NULL);
2534 gdb_assert (gdbarch->convert_register_p != NULL);
2535 if (gdbarch_debug >= 2)
2536 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2537 return gdbarch->convert_register_p (regnum, type);
2541 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2542 gdbarch_convert_register_p_ftype convert_register_p)
2544 gdbarch->convert_register_p = convert_register_p;
2548 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2550 gdb_assert (gdbarch != NULL);
2551 gdb_assert (gdbarch->register_to_value != NULL);
2552 if (gdbarch_debug >= 2)
2553 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2554 gdbarch->register_to_value (frame, regnum, type, buf);
2558 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2559 gdbarch_register_to_value_ftype register_to_value)
2561 gdbarch->register_to_value = register_to_value;
2565 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2567 gdb_assert (gdbarch != NULL);
2568 gdb_assert (gdbarch->value_to_register != NULL);
2569 if (gdbarch_debug >= 2)
2570 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2571 gdbarch->value_to_register (frame, regnum, type, buf);
2575 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2576 gdbarch_value_to_register_ftype value_to_register)
2578 gdbarch->value_to_register = value_to_register;
2582 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2584 gdb_assert (gdbarch != NULL);
2585 gdb_assert (gdbarch->value_from_register != NULL);
2586 if (gdbarch_debug >= 2)
2587 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2588 return gdbarch->value_from_register (type, regnum, frame);
2592 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2593 gdbarch_value_from_register_ftype value_from_register)
2595 gdbarch->value_from_register = value_from_register;
2599 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2601 gdb_assert (gdbarch != NULL);
2602 gdb_assert (gdbarch->pointer_to_address != NULL);
2603 if (gdbarch_debug >= 2)
2604 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2605 return gdbarch->pointer_to_address (type, buf);
2609 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2610 gdbarch_pointer_to_address_ftype pointer_to_address)
2612 gdbarch->pointer_to_address = pointer_to_address;
2616 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2618 gdb_assert (gdbarch != NULL);
2619 gdb_assert (gdbarch->address_to_pointer != NULL);
2620 if (gdbarch_debug >= 2)
2621 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2622 gdbarch->address_to_pointer (type, buf, addr);
2626 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2627 gdbarch_address_to_pointer_ftype address_to_pointer)
2629 gdbarch->address_to_pointer = address_to_pointer;
2633 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2635 gdb_assert (gdbarch != NULL);
2636 return gdbarch->integer_to_address != NULL;
2640 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2642 gdb_assert (gdbarch != NULL);
2643 gdb_assert (gdbarch->integer_to_address != NULL);
2644 if (gdbarch_debug >= 2)
2645 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2646 return gdbarch->integer_to_address (gdbarch, type, buf);
2650 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2651 gdbarch_integer_to_address_ftype integer_to_address)
2653 gdbarch->integer_to_address = integer_to_address;
2657 gdbarch_return_value_p (struct gdbarch *gdbarch)
2659 gdb_assert (gdbarch != NULL);
2660 return gdbarch->return_value != legacy_return_value;
2663 enum return_value_convention
2664 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2666 gdb_assert (gdbarch != NULL);
2667 gdb_assert (gdbarch->return_value != NULL);
2668 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2669 if (gdbarch_debug >= 2)
2670 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2671 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2675 set_gdbarch_return_value (struct gdbarch *gdbarch,
2676 gdbarch_return_value_ftype return_value)
2678 gdbarch->return_value = return_value;
2682 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
2684 gdb_assert (gdbarch != NULL);
2685 gdb_assert (gdbarch->extract_return_value != NULL);
2686 if (gdbarch_debug >= 2)
2687 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2688 gdbarch->extract_return_value (type, regcache, valbuf);
2692 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2693 gdbarch_extract_return_value_ftype extract_return_value)
2695 gdbarch->extract_return_value = extract_return_value;
2699 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
2701 gdb_assert (gdbarch != NULL);
2702 gdb_assert (gdbarch->store_return_value != NULL);
2703 if (gdbarch_debug >= 2)
2704 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2705 gdbarch->store_return_value (type, regcache, valbuf);
2709 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2710 gdbarch_store_return_value_ftype store_return_value)
2712 gdbarch->store_return_value = store_return_value;
2716 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2718 gdb_assert (gdbarch != NULL);
2719 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2720 if (gdbarch_debug >= 2)
2721 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2722 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2726 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2727 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2729 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2733 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
2735 gdb_assert (gdbarch != NULL);
2736 return gdbarch->deprecated_extract_struct_value_address != NULL;
2740 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
2742 gdb_assert (gdbarch != NULL);
2743 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
2744 if (gdbarch_debug >= 2)
2745 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
2746 return gdbarch->deprecated_extract_struct_value_address (regcache);
2750 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
2751 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
2753 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
2757 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2759 gdb_assert (gdbarch != NULL);
2760 gdb_assert (gdbarch->skip_prologue != NULL);
2761 if (gdbarch_debug >= 2)
2762 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2763 return gdbarch->skip_prologue (ip);
2767 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2768 gdbarch_skip_prologue_ftype skip_prologue)
2770 gdbarch->skip_prologue = skip_prologue;
2774 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2776 gdb_assert (gdbarch != NULL);
2777 gdb_assert (gdbarch->inner_than != NULL);
2778 if (gdbarch_debug >= 2)
2779 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2780 return gdbarch->inner_than (lhs, rhs);
2784 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2785 gdbarch_inner_than_ftype inner_than)
2787 gdbarch->inner_than = inner_than;
2791 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2793 gdb_assert (gdbarch != NULL);
2794 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2795 if (gdbarch_debug >= 2)
2796 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2797 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2801 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2802 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2804 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2808 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2810 gdb_assert (gdbarch != NULL);
2811 return gdbarch->adjust_breakpoint_address != NULL;
2815 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2817 gdb_assert (gdbarch != NULL);
2818 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2819 if (gdbarch_debug >= 2)
2820 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2821 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2825 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2826 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2828 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2832 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2834 gdb_assert (gdbarch != NULL);
2835 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2836 if (gdbarch_debug >= 2)
2837 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2838 return gdbarch->memory_insert_breakpoint (bp_tgt);
2842 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2843 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2845 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2849 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2851 gdb_assert (gdbarch != NULL);
2852 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2853 if (gdbarch_debug >= 2)
2854 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2855 return gdbarch->memory_remove_breakpoint (bp_tgt);
2859 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2860 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2862 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2866 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2868 gdb_assert (gdbarch != NULL);
2869 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2870 if (gdbarch_debug >= 2)
2871 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2872 return gdbarch->decr_pc_after_break;
2876 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2877 CORE_ADDR decr_pc_after_break)
2879 gdbarch->decr_pc_after_break = decr_pc_after_break;
2883 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2885 gdb_assert (gdbarch != NULL);
2886 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2887 if (gdbarch_debug >= 2)
2888 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2889 return gdbarch->deprecated_function_start_offset;
2893 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2894 CORE_ADDR deprecated_function_start_offset)
2896 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2900 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
2902 gdb_assert (gdbarch != NULL);
2903 gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
2904 if (gdbarch_debug >= 2)
2905 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
2906 gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
2910 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
2911 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
2913 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
2917 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2919 gdb_assert (gdbarch != NULL);
2920 gdb_assert (gdbarch->remote_register_number != NULL);
2921 if (gdbarch_debug >= 2)
2922 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2923 return gdbarch->remote_register_number (gdbarch, regno);
2927 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2928 gdbarch_remote_register_number_ftype remote_register_number)
2930 gdbarch->remote_register_number = remote_register_number;
2934 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2936 gdb_assert (gdbarch != NULL);
2937 return gdbarch->fetch_tls_load_module_address != NULL;
2941 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2943 gdb_assert (gdbarch != NULL);
2944 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2945 if (gdbarch_debug >= 2)
2946 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2947 return gdbarch->fetch_tls_load_module_address (objfile);
2951 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2952 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2954 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2958 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2960 gdb_assert (gdbarch != NULL);
2961 /* Skip verify of frame_args_skip, invalid_p == 0 */
2962 if (gdbarch_debug >= 2)
2963 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2964 return gdbarch->frame_args_skip;
2968 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2969 CORE_ADDR frame_args_skip)
2971 gdbarch->frame_args_skip = frame_args_skip;
2975 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2977 gdb_assert (gdbarch != NULL);
2978 return gdbarch->unwind_pc != NULL;
2982 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2984 gdb_assert (gdbarch != NULL);
2985 gdb_assert (gdbarch->unwind_pc != NULL);
2986 if (gdbarch_debug >= 2)
2987 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2988 return gdbarch->unwind_pc (gdbarch, next_frame);
2992 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2993 gdbarch_unwind_pc_ftype unwind_pc)
2995 gdbarch->unwind_pc = unwind_pc;
2999 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
3001 gdb_assert (gdbarch != NULL);
3002 return gdbarch->unwind_sp != NULL;
3006 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
3008 gdb_assert (gdbarch != NULL);
3009 gdb_assert (gdbarch->unwind_sp != NULL);
3010 if (gdbarch_debug >= 2)
3011 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
3012 return gdbarch->unwind_sp (gdbarch, next_frame);
3016 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
3017 gdbarch_unwind_sp_ftype unwind_sp)
3019 gdbarch->unwind_sp = unwind_sp;
3023 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
3025 gdb_assert (gdbarch != NULL);
3026 return gdbarch->frame_num_args != NULL;
3030 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3032 gdb_assert (gdbarch != NULL);
3033 gdb_assert (gdbarch->frame_num_args != NULL);
3034 if (gdbarch_debug >= 2)
3035 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3036 return gdbarch->frame_num_args (frame);
3040 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3041 gdbarch_frame_num_args_ftype frame_num_args)
3043 gdbarch->frame_num_args = frame_num_args;
3047 gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
3049 gdb_assert (gdbarch != NULL);
3050 return gdbarch->deprecated_stack_align != NULL;
3054 gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3056 gdb_assert (gdbarch != NULL);
3057 gdb_assert (gdbarch->deprecated_stack_align != NULL);
3058 if (gdbarch_debug >= 2)
3059 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
3060 return gdbarch->deprecated_stack_align (sp);
3064 set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
3065 gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
3067 gdbarch->deprecated_stack_align = deprecated_stack_align;
3071 gdbarch_frame_align_p (struct gdbarch *gdbarch)
3073 gdb_assert (gdbarch != NULL);
3074 return gdbarch->frame_align != NULL;
3078 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
3080 gdb_assert (gdbarch != NULL);
3081 gdb_assert (gdbarch->frame_align != NULL);
3082 if (gdbarch_debug >= 2)
3083 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
3084 return gdbarch->frame_align (gdbarch, address);
3088 set_gdbarch_frame_align (struct gdbarch *gdbarch,
3089 gdbarch_frame_align_ftype frame_align)
3091 gdbarch->frame_align = frame_align;
3095 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3097 gdb_assert (gdbarch != NULL);
3098 return gdbarch->deprecated_reg_struct_has_addr != NULL;
3102 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3104 gdb_assert (gdbarch != NULL);
3105 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
3106 if (gdbarch_debug >= 2)
3107 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
3108 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
3112 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
3113 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
3115 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
3119 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
3121 gdb_assert (gdbarch != NULL);
3122 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
3123 if (gdbarch_debug >= 2)
3124 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
3125 return gdbarch->stabs_argument_has_addr (gdbarch, type);
3129 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
3130 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
3132 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
3136 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
3138 gdb_assert (gdbarch != NULL);
3139 if (gdbarch_debug >= 2)
3140 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
3141 return gdbarch->frame_red_zone_size;
3145 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
3146 int frame_red_zone_size)
3148 gdbarch->frame_red_zone_size = frame_red_zone_size;
3152 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
3154 gdb_assert (gdbarch != NULL);
3155 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
3156 if (gdbarch_debug >= 2)
3157 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
3158 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
3162 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
3163 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
3165 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
3169 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
3171 gdb_assert (gdbarch != NULL);
3172 gdb_assert (gdbarch->addr_bits_remove != NULL);
3173 if (gdbarch_debug >= 2)
3174 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
3175 return gdbarch->addr_bits_remove (addr);
3179 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
3180 gdbarch_addr_bits_remove_ftype addr_bits_remove)
3182 gdbarch->addr_bits_remove = addr_bits_remove;
3186 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
3188 gdb_assert (gdbarch != NULL);
3189 gdb_assert (gdbarch->smash_text_address != NULL);
3190 if (gdbarch_debug >= 2)
3191 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
3192 return gdbarch->smash_text_address (addr);
3196 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
3197 gdbarch_smash_text_address_ftype smash_text_address)
3199 gdbarch->smash_text_address = smash_text_address;
3203 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
3205 gdb_assert (gdbarch != NULL);
3206 return gdbarch->software_single_step != NULL;
3210 gdbarch_software_single_step (struct gdbarch *gdbarch, struct regcache *regcache)
3212 gdb_assert (gdbarch != NULL);
3213 gdb_assert (gdbarch->software_single_step != NULL);
3214 if (gdbarch_debug >= 2)
3215 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
3216 return gdbarch->software_single_step (regcache);
3220 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
3221 gdbarch_software_single_step_ftype software_single_step)
3223 gdbarch->software_single_step = software_single_step;
3227 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
3229 gdb_assert (gdbarch != NULL);
3230 return gdbarch->single_step_through_delay != NULL;
3234 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
3236 gdb_assert (gdbarch != NULL);
3237 gdb_assert (gdbarch->single_step_through_delay != NULL);
3238 if (gdbarch_debug >= 2)
3239 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
3240 return gdbarch->single_step_through_delay (gdbarch, frame);
3244 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
3245 gdbarch_single_step_through_delay_ftype single_step_through_delay)
3247 gdbarch->single_step_through_delay = single_step_through_delay;
3251 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
3253 gdb_assert (gdbarch != NULL);
3254 gdb_assert (gdbarch->print_insn != NULL);
3255 if (gdbarch_debug >= 2)
3256 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
3257 return gdbarch->print_insn (vma, info);
3261 set_gdbarch_print_insn (struct gdbarch *gdbarch,
3262 gdbarch_print_insn_ftype print_insn)
3264 gdbarch->print_insn = print_insn;
3268 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
3270 gdb_assert (gdbarch != NULL);
3271 gdb_assert (gdbarch->skip_trampoline_code != NULL);
3272 if (gdbarch_debug >= 2)
3273 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
3274 return gdbarch->skip_trampoline_code (pc);
3278 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
3279 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
3281 gdbarch->skip_trampoline_code = skip_trampoline_code;
3285 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
3287 gdb_assert (gdbarch != NULL);
3288 gdb_assert (gdbarch->skip_solib_resolver != NULL);
3289 if (gdbarch_debug >= 2)
3290 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
3291 return gdbarch->skip_solib_resolver (gdbarch, pc);
3295 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
3296 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
3298 gdbarch->skip_solib_resolver = skip_solib_resolver;
3302 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3304 gdb_assert (gdbarch != NULL);
3305 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
3306 if (gdbarch_debug >= 2)
3307 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
3308 return gdbarch->in_solib_return_trampoline (pc, name);
3312 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3313 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3315 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3319 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3321 gdb_assert (gdbarch != NULL);
3322 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
3323 if (gdbarch_debug >= 2)
3324 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3325 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3329 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3330 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3332 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3336 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
3338 gdb_assert (gdbarch != NULL);
3339 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
3340 if (gdbarch_debug >= 2)
3341 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
3342 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
3346 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
3347 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
3349 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
3353 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3355 gdb_assert (gdbarch != NULL);
3356 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
3357 if (gdbarch_debug >= 2)
3358 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3359 gdbarch->elf_make_msymbol_special (sym, msym);
3363 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
3364 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
3366 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
3370 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
3372 gdb_assert (gdbarch != NULL);
3373 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
3374 if (gdbarch_debug >= 2)
3375 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
3376 gdbarch->coff_make_msymbol_special (val, msym);
3380 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
3381 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
3383 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
3387 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
3389 gdb_assert (gdbarch != NULL);
3390 /* Skip verify of name_of_malloc, invalid_p == 0 */
3391 if (gdbarch_debug >= 2)
3392 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
3393 return gdbarch->name_of_malloc;
3397 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
3398 const char * name_of_malloc)
3400 gdbarch->name_of_malloc = name_of_malloc;
3404 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
3406 gdb_assert (gdbarch != NULL);
3407 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3408 if (gdbarch_debug >= 2)
3409 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
3410 return gdbarch->cannot_step_breakpoint;
3414 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
3415 int cannot_step_breakpoint)
3417 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
3421 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
3423 gdb_assert (gdbarch != NULL);
3424 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3425 if (gdbarch_debug >= 2)
3426 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
3427 return gdbarch->have_nonsteppable_watchpoint;
3431 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
3432 int have_nonsteppable_watchpoint)
3434 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
3438 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
3440 gdb_assert (gdbarch != NULL);
3441 return gdbarch->address_class_type_flags != NULL;
3445 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
3447 gdb_assert (gdbarch != NULL);
3448 gdb_assert (gdbarch->address_class_type_flags != NULL);
3449 if (gdbarch_debug >= 2)
3450 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
3451 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
3455 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
3456 gdbarch_address_class_type_flags_ftype address_class_type_flags)
3458 gdbarch->address_class_type_flags = address_class_type_flags;
3462 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
3464 gdb_assert (gdbarch != NULL);
3465 return gdbarch->address_class_type_flags_to_name != NULL;
3469 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
3471 gdb_assert (gdbarch != NULL);
3472 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
3473 if (gdbarch_debug >= 2)
3474 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
3475 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
3479 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
3480 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
3482 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3486 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3488 gdb_assert (gdbarch != NULL);
3489 return gdbarch->address_class_name_to_type_flags != NULL;
3493 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
3495 gdb_assert (gdbarch != NULL);
3496 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
3497 if (gdbarch_debug >= 2)
3498 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
3499 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
3503 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3504 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3506 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3510 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3512 gdb_assert (gdbarch != NULL);
3513 gdb_assert (gdbarch->register_reggroup_p != NULL);
3514 if (gdbarch_debug >= 2)
3515 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3516 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3520 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3521 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3523 gdbarch->register_reggroup_p = register_reggroup_p;
3527 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3529 gdb_assert (gdbarch != NULL);
3530 return gdbarch->fetch_pointer_argument != NULL;
3534 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3536 gdb_assert (gdbarch != NULL);
3537 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3538 if (gdbarch_debug >= 2)
3539 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3540 return gdbarch->fetch_pointer_argument (frame, argi, type);
3544 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3545 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3547 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3551 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3553 gdb_assert (gdbarch != NULL);
3554 return gdbarch->regset_from_core_section != NULL;
3557 const struct regset *
3558 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3560 gdb_assert (gdbarch != NULL);
3561 gdb_assert (gdbarch->regset_from_core_section != NULL);
3562 if (gdbarch_debug >= 2)
3563 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3564 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3568 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3569 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3571 gdbarch->regset_from_core_section = regset_from_core_section;
3575 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3577 gdb_assert (gdbarch != NULL);
3578 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3579 if (gdbarch_debug >= 2)
3580 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3581 return gdbarch->vtable_function_descriptors;
3585 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3586 int vtable_function_descriptors)
3588 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3592 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3594 gdb_assert (gdbarch != NULL);
3595 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3596 if (gdbarch_debug >= 2)
3597 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3598 return gdbarch->vbit_in_delta;
3602 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3605 gdbarch->vbit_in_delta = vbit_in_delta;
3609 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3611 gdb_assert (gdbarch != NULL);
3612 return gdbarch->skip_permanent_breakpoint != NULL;
3616 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3618 gdb_assert (gdbarch != NULL);
3619 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3620 if (gdbarch_debug >= 2)
3621 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3622 gdbarch->skip_permanent_breakpoint (regcache);
3626 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3627 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3629 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3633 /* Keep a registry of per-architecture data-pointers required by GDB
3640 gdbarch_data_pre_init_ftype *pre_init;
3641 gdbarch_data_post_init_ftype *post_init;
3644 struct gdbarch_data_registration
3646 struct gdbarch_data *data;
3647 struct gdbarch_data_registration *next;
3650 struct gdbarch_data_registry
3653 struct gdbarch_data_registration *registrations;
3656 struct gdbarch_data_registry gdbarch_data_registry =
3661 static struct gdbarch_data *
3662 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3663 gdbarch_data_post_init_ftype *post_init)
3665 struct gdbarch_data_registration **curr;
3666 /* Append the new registraration. */
3667 for (curr = &gdbarch_data_registry.registrations;
3669 curr = &(*curr)->next);
3670 (*curr) = XMALLOC (struct gdbarch_data_registration);
3671 (*curr)->next = NULL;
3672 (*curr)->data = XMALLOC (struct gdbarch_data);
3673 (*curr)->data->index = gdbarch_data_registry.nr++;
3674 (*curr)->data->pre_init = pre_init;
3675 (*curr)->data->post_init = post_init;
3676 (*curr)->data->init_p = 1;
3677 return (*curr)->data;
3680 struct gdbarch_data *
3681 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3683 return gdbarch_data_register (pre_init, NULL);
3686 struct gdbarch_data *
3687 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3689 return gdbarch_data_register (NULL, post_init);
3692 /* Create/delete the gdbarch data vector. */
3695 alloc_gdbarch_data (struct gdbarch *gdbarch)
3697 gdb_assert (gdbarch->data == NULL);
3698 gdbarch->nr_data = gdbarch_data_registry.nr;
3699 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3702 /* Initialize the current value of the specified per-architecture
3706 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3707 struct gdbarch_data *data,
3710 gdb_assert (data->index < gdbarch->nr_data);
3711 gdb_assert (gdbarch->data[data->index] == NULL);
3712 gdb_assert (data->pre_init == NULL);
3713 gdbarch->data[data->index] = pointer;
3716 /* Return the current value of the specified per-architecture
3720 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3722 gdb_assert (data->index < gdbarch->nr_data);
3723 if (gdbarch->data[data->index] == NULL)
3725 /* The data-pointer isn't initialized, call init() to get a
3727 if (data->pre_init != NULL)
3728 /* Mid architecture creation: pass just the obstack, and not
3729 the entire architecture, as that way it isn't possible for
3730 pre-init code to refer to undefined architecture
3732 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3733 else if (gdbarch->initialized_p
3734 && data->post_init != NULL)
3735 /* Post architecture creation: pass the entire architecture
3736 (as all fields are valid), but be careful to also detect
3737 recursive references. */
3739 gdb_assert (data->init_p);
3741 gdbarch->data[data->index] = data->post_init (gdbarch);
3745 /* The architecture initialization hasn't completed - punt -
3746 hope that the caller knows what they are doing. Once
3747 deprecated_set_gdbarch_data has been initialized, this can be
3748 changed to an internal error. */
3750 gdb_assert (gdbarch->data[data->index] != NULL);
3752 return gdbarch->data[data->index];
3757 /* Keep a registry of swapped data required by GDB modules. */
3762 struct gdbarch_swap_registration *source;
3763 struct gdbarch_swap *next;
3766 struct gdbarch_swap_registration
3769 unsigned long sizeof_data;
3770 gdbarch_swap_ftype *init;
3771 struct gdbarch_swap_registration *next;
3774 struct gdbarch_swap_registry
3777 struct gdbarch_swap_registration *registrations;
3780 struct gdbarch_swap_registry gdbarch_swap_registry =
3786 deprecated_register_gdbarch_swap (void *data,
3787 unsigned long sizeof_data,
3788 gdbarch_swap_ftype *init)
3790 struct gdbarch_swap_registration **rego;
3791 for (rego = &gdbarch_swap_registry.registrations;
3793 rego = &(*rego)->next);
3794 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3795 (*rego)->next = NULL;
3796 (*rego)->init = init;
3797 (*rego)->data = data;
3798 (*rego)->sizeof_data = sizeof_data;
3802 current_gdbarch_swap_init_hack (void)
3804 struct gdbarch_swap_registration *rego;
3805 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3806 for (rego = gdbarch_swap_registry.registrations;
3810 if (rego->data != NULL)
3812 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3813 struct gdbarch_swap);
3814 (*curr)->source = rego;
3815 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3817 (*curr)->next = NULL;
3818 curr = &(*curr)->next;
3820 if (rego->init != NULL)
3825 static struct gdbarch *
3826 current_gdbarch_swap_out_hack (void)
3828 struct gdbarch *old_gdbarch = current_gdbarch;
3829 struct gdbarch_swap *curr;
3831 gdb_assert (old_gdbarch != NULL);
3832 for (curr = old_gdbarch->swap;
3836 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3837 memset (curr->source->data, 0, curr->source->sizeof_data);
3839 current_gdbarch = NULL;
3844 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3846 struct gdbarch_swap *curr;
3848 gdb_assert (current_gdbarch == NULL);
3849 for (curr = new_gdbarch->swap;
3852 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3853 current_gdbarch = new_gdbarch;
3857 /* Keep a registry of the architectures known by GDB. */
3859 struct gdbarch_registration
3861 enum bfd_architecture bfd_architecture;
3862 gdbarch_init_ftype *init;
3863 gdbarch_dump_tdep_ftype *dump_tdep;
3864 struct gdbarch_list *arches;
3865 struct gdbarch_registration *next;
3868 static struct gdbarch_registration *gdbarch_registry = NULL;
3871 append_name (const char ***buf, int *nr, const char *name)
3873 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3879 gdbarch_printable_names (void)
3881 /* Accumulate a list of names based on the registed list of
3883 enum bfd_architecture a;
3885 const char **arches = NULL;
3886 struct gdbarch_registration *rego;
3887 for (rego = gdbarch_registry;
3891 const struct bfd_arch_info *ap;
3892 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3894 internal_error (__FILE__, __LINE__,
3895 _("gdbarch_architecture_names: multi-arch unknown"));
3898 append_name (&arches, &nr_arches, ap->printable_name);
3903 append_name (&arches, &nr_arches, NULL);
3909 gdbarch_register (enum bfd_architecture bfd_architecture,
3910 gdbarch_init_ftype *init,
3911 gdbarch_dump_tdep_ftype *dump_tdep)
3913 struct gdbarch_registration **curr;
3914 const struct bfd_arch_info *bfd_arch_info;
3915 /* Check that BFD recognizes this architecture */
3916 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3917 if (bfd_arch_info == NULL)
3919 internal_error (__FILE__, __LINE__,
3920 _("gdbarch: Attempt to register unknown architecture (%d)"),
3923 /* Check that we haven't seen this architecture before */
3924 for (curr = &gdbarch_registry;
3926 curr = &(*curr)->next)
3928 if (bfd_architecture == (*curr)->bfd_architecture)
3929 internal_error (__FILE__, __LINE__,
3930 _("gdbarch: Duplicate registraration of architecture (%s)"),
3931 bfd_arch_info->printable_name);
3935 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3936 bfd_arch_info->printable_name,
3939 (*curr) = XMALLOC (struct gdbarch_registration);
3940 (*curr)->bfd_architecture = bfd_architecture;
3941 (*curr)->init = init;
3942 (*curr)->dump_tdep = dump_tdep;
3943 (*curr)->arches = NULL;
3944 (*curr)->next = NULL;
3948 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3949 gdbarch_init_ftype *init)
3951 gdbarch_register (bfd_architecture, init, NULL);
3955 /* Look for an architecture using gdbarch_info. */
3957 struct gdbarch_list *
3958 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3959 const struct gdbarch_info *info)
3961 for (; arches != NULL; arches = arches->next)
3963 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3965 if (info->byte_order != arches->gdbarch->byte_order)
3967 if (info->osabi != arches->gdbarch->osabi)
3969 if (info->target_desc != arches->gdbarch->target_desc)
3977 /* Find an architecture that matches the specified INFO. Create a new
3978 architecture if needed. Return that new architecture. Assumes
3979 that there is no current architecture. */
3981 static struct gdbarch *
3982 find_arch_by_info (struct gdbarch_info info)
3984 struct gdbarch *new_gdbarch;
3985 struct gdbarch_registration *rego;
3987 /* The existing architecture has been swapped out - all this code
3988 works from a clean slate. */
3989 gdb_assert (current_gdbarch == NULL);
3991 /* Fill in missing parts of the INFO struct using a number of
3992 sources: "set ..."; INFOabfd supplied; and the global
3994 gdbarch_info_fill (&info);
3996 /* Must have found some sort of architecture. */
3997 gdb_assert (info.bfd_arch_info != NULL);
4001 fprintf_unfiltered (gdb_stdlog,
4002 "find_arch_by_info: info.bfd_arch_info %s\n",
4003 (info.bfd_arch_info != NULL
4004 ? info.bfd_arch_info->printable_name
4006 fprintf_unfiltered (gdb_stdlog,
4007 "find_arch_by_info: info.byte_order %d (%s)\n",
4009 (info.byte_order == BFD_ENDIAN_BIG ? "big"
4010 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
4012 fprintf_unfiltered (gdb_stdlog,
4013 "find_arch_by_info: info.osabi %d (%s)\n",
4014 info.osabi, gdbarch_osabi_name (info.osabi));
4015 fprintf_unfiltered (gdb_stdlog,
4016 "find_arch_by_info: info.abfd 0x%lx\n",
4018 fprintf_unfiltered (gdb_stdlog,
4019 "find_arch_by_info: info.tdep_info 0x%lx\n",
4020 (long) info.tdep_info);
4023 /* Find the tdep code that knows about this architecture. */
4024 for (rego = gdbarch_registry;
4027 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4032 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4033 "No matching architecture\n");
4037 /* Ask the tdep code for an architecture that matches "info". */
4038 new_gdbarch = rego->init (info, rego->arches);
4040 /* Did the tdep code like it? No. Reject the change and revert to
4041 the old architecture. */
4042 if (new_gdbarch == NULL)
4045 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4046 "Target rejected architecture\n");
4050 /* Is this a pre-existing architecture (as determined by already
4051 being initialized)? Move it to the front of the architecture
4052 list (keeping the list sorted Most Recently Used). */
4053 if (new_gdbarch->initialized_p)
4055 struct gdbarch_list **list;
4056 struct gdbarch_list *this;
4058 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4059 "Previous architecture 0x%08lx (%s) selected\n",
4061 new_gdbarch->bfd_arch_info->printable_name);
4062 /* Find the existing arch in the list. */
4063 for (list = ®o->arches;
4064 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4065 list = &(*list)->next);
4066 /* It had better be in the list of architectures. */
4067 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4070 (*list) = this->next;
4071 /* Insert THIS at the front. */
4072 this->next = rego->arches;
4073 rego->arches = this;
4078 /* It's a new architecture. */
4080 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4081 "New architecture 0x%08lx (%s) selected\n",
4083 new_gdbarch->bfd_arch_info->printable_name);
4085 /* Insert the new architecture into the front of the architecture
4086 list (keep the list sorted Most Recently Used). */
4088 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4089 this->next = rego->arches;
4090 this->gdbarch = new_gdbarch;
4091 rego->arches = this;
4094 /* Check that the newly installed architecture is valid. Plug in
4095 any post init values. */
4096 new_gdbarch->dump_tdep = rego->dump_tdep;
4097 verify_gdbarch (new_gdbarch);
4098 new_gdbarch->initialized_p = 1;
4100 /* Initialize any per-architecture swap areas. This phase requires
4101 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4102 swap the entire architecture out. */
4103 current_gdbarch = new_gdbarch;
4104 current_gdbarch_swap_init_hack ();
4105 current_gdbarch_swap_out_hack ();
4108 gdbarch_dump (new_gdbarch, gdb_stdlog);
4114 gdbarch_find_by_info (struct gdbarch_info info)
4116 /* Save the previously selected architecture, setting the global to
4117 NULL. This stops things like gdbarch->init() trying to use the
4118 previous architecture's configuration. The previous architecture
4119 may not even be of the same architecture family. The most recent
4120 architecture of the same family is found at the head of the
4121 rego->arches list. */
4122 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
4124 /* Find the specified architecture. */
4125 struct gdbarch *new_gdbarch = find_arch_by_info (info);
4127 /* Restore the existing architecture. */
4128 gdb_assert (current_gdbarch == NULL);
4129 current_gdbarch_swap_in_hack (old_gdbarch);
4134 /* Make the specified architecture current, swapping the existing one
4138 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
4140 gdb_assert (new_gdbarch != NULL);
4141 gdb_assert (current_gdbarch != NULL);
4142 gdb_assert (new_gdbarch->initialized_p);
4143 current_gdbarch_swap_out_hack ();
4144 current_gdbarch_swap_in_hack (new_gdbarch);
4145 architecture_changed_event ();
4146 reinit_frame_cache ();
4149 extern void _initialize_gdbarch (void);
4152 _initialize_gdbarch (void)
4154 struct cmd_list_element *c;
4156 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
4157 Set architecture debugging."), _("\
4158 Show architecture debugging."), _("\
4159 When non-zero, architecture debugging is enabled."),
4162 &setdebuglist, &showdebuglist);