1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free
6 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., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, 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)
81 /* Maintain the struct gdbarch object */
85 /* Has this architecture been fully initialized? */
88 /* An obstack bound to the lifetime of the architecture. */
89 struct obstack *obstack;
91 /* basic architectural information */
92 const struct bfd_arch_info * bfd_arch_info;
96 /* target specific vector. */
97 struct gdbarch_tdep *tdep;
98 gdbarch_dump_tdep_ftype *dump_tdep;
100 /* per-architecture data-pointers */
104 /* per-architecture swap-regions */
105 struct gdbarch_swap *swap;
107 /* Multi-arch values.
109 When extending this structure you must:
113 Declare set/get functions and define the corresponding
116 gdbarch_alloc(): If zero/NULL is not a suitable default,
117 initialize the new field.
119 verify_gdbarch(): Confirm that the target updated the field
122 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
125 ``startup_gdbarch()'': Append an initial value to the static
126 variable (base values on the host's c-type system).
128 get_gdbarch(): Implement the set/get functions (probably using
129 the macro's as shortcuts).
138 const struct floatformat * float_format;
140 const struct floatformat * double_format;
142 const struct floatformat * long_double_format;
147 gdbarch_read_pc_ftype *read_pc;
148 gdbarch_write_pc_ftype *write_pc;
149 gdbarch_read_sp_ftype *read_sp;
150 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
151 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
152 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
159 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
160 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
161 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
162 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
163 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
164 gdbarch_register_name_ftype *register_name;
165 gdbarch_register_type_ftype *register_type;
166 gdbarch_deprecated_register_byte_ftype *deprecated_register_byte;
167 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
168 int deprecated_fp_regnum;
169 gdbarch_push_dummy_call_ftype *push_dummy_call;
170 gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments;
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_pointer_to_address_ftype *pointer_to_address;
187 gdbarch_address_to_pointer_ftype *address_to_pointer;
188 gdbarch_integer_to_address_ftype *integer_to_address;
189 gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return;
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_extract_return_value_ftype *deprecated_extract_return_value;
194 gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
195 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
196 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
197 gdbarch_skip_prologue_ftype *skip_prologue;
198 gdbarch_inner_than_ftype *inner_than;
199 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
200 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
201 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
202 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
203 CORE_ADDR decr_pc_after_break;
204 CORE_ADDR deprecated_function_start_offset;
205 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
206 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
207 CORE_ADDR frame_args_skip;
208 gdbarch_unwind_pc_ftype *unwind_pc;
209 gdbarch_unwind_sp_ftype *unwind_sp;
210 gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call;
211 gdbarch_frame_num_args_ftype *frame_num_args;
212 gdbarch_deprecated_stack_align_ftype *deprecated_stack_align;
213 gdbarch_frame_align_ftype *frame_align;
214 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
215 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
216 int frame_red_zone_size;
217 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
218 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
219 gdbarch_smash_text_address_ftype *smash_text_address;
220 gdbarch_software_single_step_ftype *software_single_step;
221 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
222 gdbarch_print_insn_ftype *print_insn;
223 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
224 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
225 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
226 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
227 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
228 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
229 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
230 const char * name_of_malloc;
231 int cannot_step_breakpoint;
232 int have_nonsteppable_watchpoint;
233 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
234 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
235 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
236 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
237 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
238 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
242 /* The default architecture uses host values (for want of a better
245 extern const struct bfd_arch_info bfd_default_arch_struct;
247 struct gdbarch startup_gdbarch =
249 1, /* Always initialized. */
250 NULL, /* The obstack. */
251 /* basic architecture information */
252 &bfd_default_arch_struct, /* bfd_arch_info */
253 BFD_ENDIAN_BIG, /* byte_order */
254 GDB_OSABI_UNKNOWN, /* osabi */
255 /* target specific vector and its dump routine */
257 /*per-architecture data-pointers and swap regions */
259 /* Multi-arch values */
260 8 * sizeof (short), /* short_bit */
261 8 * sizeof (int), /* int_bit */
262 8 * sizeof (long), /* long_bit */
263 8 * sizeof (LONGEST), /* long_long_bit */
264 8 * sizeof (float), /* float_bit */
265 0, /* float_format */
266 8 * sizeof (double), /* double_bit */
267 0, /* double_format */
268 8 * sizeof (long double), /* long_double_bit */
269 0, /* long_double_format */
270 8 * sizeof (void*), /* ptr_bit */
271 8 * sizeof (void*), /* addr_bit */
272 8 * sizeof (void*), /* bfd_vma_bit */
277 0, /* virtual_frame_pointer */
278 0, /* pseudo_register_read */
279 0, /* pseudo_register_write */
281 0, /* num_pseudo_regs */
286 0, /* stab_reg_to_regnum */
287 0, /* ecoff_reg_to_regnum */
288 0, /* dwarf_reg_to_regnum */
289 0, /* sdb_reg_to_regnum */
290 0, /* dwarf2_reg_to_regnum */
291 0, /* register_name */
292 0, /* register_type */
293 generic_register_byte, /* deprecated_register_byte */
294 0, /* unwind_dummy_id */
295 -1, /* deprecated_fp_regnum */
296 0, /* push_dummy_call */
297 0, /* deprecated_push_arguments */
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, /* pointer_to_address */
314 0, /* address_to_pointer */
315 0, /* integer_to_address */
316 0, /* deprecated_store_struct_return */
317 0, /* return_value */
318 0, /* extract_return_value */
319 0, /* store_return_value */
320 0, /* deprecated_extract_return_value */
321 0, /* deprecated_store_return_value */
322 0, /* deprecated_use_struct_convention */
323 0, /* deprecated_extract_struct_value_address */
324 0, /* skip_prologue */
326 0, /* breakpoint_from_pc */
327 0, /* adjust_breakpoint_address */
328 0, /* memory_insert_breakpoint */
329 0, /* memory_remove_breakpoint */
330 0, /* decr_pc_after_break */
331 0, /* deprecated_function_start_offset */
332 generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
333 0, /* fetch_tls_load_module_address */
334 0, /* frame_args_skip */
337 0, /* deprecated_saved_pc_after_call */
338 0, /* frame_num_args */
339 0, /* deprecated_stack_align */
341 0, /* deprecated_reg_struct_has_addr */
342 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
343 0, /* frame_red_zone_size */
344 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
345 0, /* addr_bits_remove */
346 0, /* smash_text_address */
347 0, /* software_single_step */
348 0, /* single_step_through_delay */
350 0, /* skip_trampoline_code */
351 generic_skip_solib_resolver, /* skip_solib_resolver */
352 0, /* in_solib_return_trampoline */
353 generic_in_function_epilogue_p, /* in_function_epilogue_p */
354 construct_inferior_arguments, /* construct_inferior_arguments */
355 0, /* elf_make_msymbol_special */
356 0, /* coff_make_msymbol_special */
357 "malloc", /* name_of_malloc */
358 0, /* cannot_step_breakpoint */
359 0, /* have_nonsteppable_watchpoint */
360 0, /* address_class_type_flags */
361 0, /* address_class_type_flags_to_name */
362 0, /* address_class_name_to_type_flags */
363 default_register_reggroup_p, /* register_reggroup_p */
364 0, /* fetch_pointer_argument */
365 0, /* regset_from_core_section */
366 /* startup_gdbarch() */
369 struct gdbarch *current_gdbarch = &startup_gdbarch;
371 /* Create a new ``struct gdbarch'' based on information provided by
372 ``struct gdbarch_info''. */
375 gdbarch_alloc (const struct gdbarch_info *info,
376 struct gdbarch_tdep *tdep)
378 /* NOTE: The new architecture variable is named ``current_gdbarch''
379 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
380 the current local architecture and not the previous global
381 architecture. This ensures that the new architectures initial
382 values are not influenced by the previous architecture. Once
383 everything is parameterised with gdbarch, this will go away. */
384 struct gdbarch *current_gdbarch;
386 /* Create an obstack for allocating all the per-architecture memory,
387 then use that to allocate the architecture vector. */
388 struct obstack *obstack = XMALLOC (struct obstack);
389 obstack_init (obstack);
390 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
391 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
392 current_gdbarch->obstack = obstack;
394 alloc_gdbarch_data (current_gdbarch);
396 current_gdbarch->tdep = tdep;
398 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
399 current_gdbarch->byte_order = info->byte_order;
400 current_gdbarch->osabi = info->osabi;
402 /* Force the explicit initialization of these. */
403 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
404 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
405 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
406 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
407 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
408 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
409 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
410 current_gdbarch->ptr_bit = TARGET_INT_BIT;
411 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
412 current_gdbarch->char_signed = -1;
413 current_gdbarch->write_pc = generic_target_write_pc;
414 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
415 current_gdbarch->num_regs = -1;
416 current_gdbarch->sp_regnum = -1;
417 current_gdbarch->pc_regnum = -1;
418 current_gdbarch->ps_regnum = -1;
419 current_gdbarch->fp0_regnum = -1;
420 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
421 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
422 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
423 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
424 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
425 current_gdbarch->deprecated_register_byte = generic_register_byte;
426 current_gdbarch->deprecated_fp_regnum = -1;
427 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
428 current_gdbarch->print_registers_info = default_print_registers_info;
429 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
430 current_gdbarch->cannot_fetch_register = cannot_register_not;
431 current_gdbarch->cannot_store_register = cannot_register_not;
432 current_gdbarch->convert_register_p = generic_convert_register_p;
433 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
434 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
435 current_gdbarch->return_value = legacy_return_value;
436 current_gdbarch->extract_return_value = legacy_extract_return_value;
437 current_gdbarch->store_return_value = legacy_store_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->stabs_argument_has_addr = default_stabs_argument_has_addr;
443 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
444 current_gdbarch->addr_bits_remove = core_addr_identity;
445 current_gdbarch->smash_text_address = core_addr_identity;
446 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
447 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
448 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
449 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
450 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
451 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
452 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
453 current_gdbarch->name_of_malloc = "malloc";
454 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
455 /* gdbarch_alloc() */
457 return current_gdbarch;
461 /* Allocate extra space using the per-architecture obstack. */
464 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
466 void *data = obstack_alloc (arch->obstack, size);
467 memset (data, 0, size);
472 /* Free a gdbarch struct. This should never happen in normal
473 operation --- once you've created a gdbarch, you keep it around.
474 However, if an architecture's init function encounters an error
475 building the structure, it may need to clean up a partially
476 constructed gdbarch. */
479 gdbarch_free (struct gdbarch *arch)
481 struct obstack *obstack;
482 gdb_assert (arch != NULL);
483 gdb_assert (!arch->initialized_p);
484 obstack = arch->obstack;
485 obstack_free (obstack, 0); /* Includes the ARCH. */
490 /* Ensure that all values in a GDBARCH are reasonable. */
492 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
493 just happens to match the global variable ``current_gdbarch''. That
494 way macros refering to that variable get the local and not the global
495 version - ulgh. Once everything is parameterised with gdbarch, this
499 verify_gdbarch (struct gdbarch *current_gdbarch)
502 struct cleanup *cleanups;
505 log = mem_fileopen ();
506 cleanups = make_cleanup_ui_file_delete (log);
508 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
509 fprintf_unfiltered (log, "\n\tbyte-order");
510 if (current_gdbarch->bfd_arch_info == NULL)
511 fprintf_unfiltered (log, "\n\tbfd_arch_info");
512 /* Check those that need to be defined for the given multi-arch level. */
513 /* Skip verify of short_bit, invalid_p == 0 */
514 /* Skip verify of int_bit, invalid_p == 0 */
515 /* Skip verify of long_bit, invalid_p == 0 */
516 /* Skip verify of long_long_bit, invalid_p == 0 */
517 /* Skip verify of float_bit, invalid_p == 0 */
518 if (current_gdbarch->float_format == 0)
519 current_gdbarch->float_format = default_float_format (current_gdbarch);
520 /* Skip verify of double_bit, invalid_p == 0 */
521 if (current_gdbarch->double_format == 0)
522 current_gdbarch->double_format = default_double_format (current_gdbarch);
523 /* Skip verify of long_double_bit, invalid_p == 0 */
524 if (current_gdbarch->long_double_format == 0)
525 current_gdbarch->long_double_format = default_double_format (current_gdbarch);
526 /* Skip verify of ptr_bit, invalid_p == 0 */
527 if (current_gdbarch->addr_bit == 0)
528 current_gdbarch->addr_bit = TARGET_PTR_BIT;
529 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
530 if (current_gdbarch->char_signed == -1)
531 current_gdbarch->char_signed = 1;
532 /* Skip verify of read_pc, has predicate */
533 /* Skip verify of write_pc, invalid_p == 0 */
534 /* Skip verify of read_sp, has predicate */
535 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
536 /* Skip verify of pseudo_register_read, has predicate */
537 /* Skip verify of pseudo_register_write, has predicate */
538 if (current_gdbarch->num_regs == -1)
539 fprintf_unfiltered (log, "\n\tnum_regs");
540 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
541 /* Skip verify of sp_regnum, invalid_p == 0 */
542 /* Skip verify of pc_regnum, invalid_p == 0 */
543 /* Skip verify of ps_regnum, invalid_p == 0 */
544 /* Skip verify of fp0_regnum, invalid_p == 0 */
545 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
546 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
547 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
548 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
549 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
550 /* Skip verify of register_type, has predicate */
551 /* Skip verify of deprecated_register_byte, 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 deprecated_push_arguments, has predicate */
556 /* Skip verify of call_dummy_location, invalid_p == 0 */
557 /* Skip verify of push_dummy_code, has predicate */
558 /* Skip verify of print_registers_info, invalid_p == 0 */
559 /* Skip verify of print_float_info, has predicate */
560 /* Skip verify of print_vector_info, has predicate */
561 /* Skip verify of register_sim_regno, invalid_p == 0 */
562 /* Skip verify of register_bytes_ok, has predicate */
563 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
564 /* Skip verify of cannot_store_register, invalid_p == 0 */
565 /* Skip verify of get_longjmp_target, has predicate */
566 /* Skip verify of convert_register_p, 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 deprecated_store_struct_return, has predicate */
571 /* Skip verify of return_value, has predicate */
572 /* Skip verify of extract_return_value, invalid_p == 0 */
573 /* Skip verify of store_return_value, invalid_p == 0 */
574 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
575 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
576 if (current_gdbarch->skip_prologue == 0)
577 fprintf_unfiltered (log, "\n\tskip_prologue");
578 if (current_gdbarch->inner_than == 0)
579 fprintf_unfiltered (log, "\n\tinner_than");
580 if (current_gdbarch->breakpoint_from_pc == 0)
581 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
582 /* Skip verify of adjust_breakpoint_address, has predicate */
583 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
584 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
585 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
586 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
587 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
588 /* Skip verify of fetch_tls_load_module_address, has predicate */
589 /* Skip verify of frame_args_skip, invalid_p == 0 */
590 /* Skip verify of unwind_pc, has predicate */
591 /* Skip verify of unwind_sp, has predicate */
592 /* Skip verify of deprecated_saved_pc_after_call, has predicate */
593 /* Skip verify of frame_num_args, has predicate */
594 /* Skip verify of deprecated_stack_align, has predicate */
595 /* Skip verify of frame_align, has predicate */
596 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
597 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
598 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
599 /* Skip verify of addr_bits_remove, invalid_p == 0 */
600 /* Skip verify of smash_text_address, invalid_p == 0 */
601 /* Skip verify of software_single_step, has predicate */
602 /* Skip verify of single_step_through_delay, has predicate */
603 if (current_gdbarch->print_insn == 0)
604 fprintf_unfiltered (log, "\n\tprint_insn");
605 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
606 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
607 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
608 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
609 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
610 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
611 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
612 /* Skip verify of name_of_malloc, invalid_p == 0 */
613 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
614 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
615 /* Skip verify of address_class_type_flags, has predicate */
616 /* Skip verify of address_class_type_flags_to_name, has predicate */
617 /* Skip verify of address_class_name_to_type_flags, has predicate */
618 /* Skip verify of register_reggroup_p, invalid_p == 0 */
619 /* Skip verify of fetch_pointer_argument, has predicate */
620 /* Skip verify of regset_from_core_section, 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_RETURN_VALUE
841 fprintf_unfiltered (file,
842 "gdbarch_dump: %s # %s\n",
843 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
844 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
846 fprintf_unfiltered (file,
847 "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n",
848 (long) current_gdbarch->deprecated_extract_return_value);
849 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
850 fprintf_unfiltered (file,
851 "gdbarch_dump: %s # %s\n",
852 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
853 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
855 fprintf_unfiltered (file,
856 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
857 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
858 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
859 fprintf_unfiltered (file,
860 "gdbarch_dump: %s # %s\n",
861 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
862 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
864 fprintf_unfiltered (file,
865 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
866 (long) current_gdbarch->deprecated_extract_struct_value_address);
867 #ifdef DEPRECATED_FP_REGNUM
868 fprintf_unfiltered (file,
869 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
870 XSTRING (DEPRECATED_FP_REGNUM));
872 fprintf_unfiltered (file,
873 "gdbarch_dump: deprecated_fp_regnum = %s\n",
874 paddr_d (current_gdbarch->deprecated_fp_regnum));
875 #ifdef DEPRECATED_FUNCTION_START_OFFSET
876 fprintf_unfiltered (file,
877 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
878 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
880 fprintf_unfiltered (file,
881 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
882 paddr_nz (current_gdbarch->deprecated_function_start_offset));
883 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
884 fprintf_unfiltered (file,
885 "gdbarch_dump: %s # %s\n",
886 "DEPRECATED_PUSH_ARGUMENTS_P()",
887 XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
889 fprintf_unfiltered (file,
890 "gdbarch_dump: gdbarch_deprecated_push_arguments_p() = %d\n",
891 gdbarch_deprecated_push_arguments_p (current_gdbarch));
892 #ifdef DEPRECATED_PUSH_ARGUMENTS
893 fprintf_unfiltered (file,
894 "gdbarch_dump: %s # %s\n",
895 "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
896 XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
898 fprintf_unfiltered (file,
899 "gdbarch_dump: deprecated_push_arguments = <0x%lx>\n",
900 (long) current_gdbarch->deprecated_push_arguments);
901 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
902 fprintf_unfiltered (file,
903 "gdbarch_dump: %s # %s\n",
904 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
905 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
907 fprintf_unfiltered (file,
908 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
909 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
910 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
911 fprintf_unfiltered (file,
912 "gdbarch_dump: %s # %s\n",
913 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
914 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
916 fprintf_unfiltered (file,
917 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
918 (long) current_gdbarch->deprecated_reg_struct_has_addr);
919 #ifdef DEPRECATED_REGISTER_BYTE_P
920 fprintf_unfiltered (file,
921 "gdbarch_dump: %s # %s\n",
922 "DEPRECATED_REGISTER_BYTE_P()",
923 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
925 fprintf_unfiltered (file,
926 "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n",
927 gdbarch_deprecated_register_byte_p (current_gdbarch));
928 #ifdef DEPRECATED_REGISTER_BYTE
929 fprintf_unfiltered (file,
930 "gdbarch_dump: %s # %s\n",
931 "DEPRECATED_REGISTER_BYTE(reg_nr)",
932 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
934 fprintf_unfiltered (file,
935 "gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
936 (long) current_gdbarch->deprecated_register_byte);
937 #ifdef DEPRECATED_REGISTER_SIZE
938 fprintf_unfiltered (file,
939 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
940 XSTRING (DEPRECATED_REGISTER_SIZE));
942 fprintf_unfiltered (file,
943 "gdbarch_dump: deprecated_register_size = %s\n",
944 paddr_d (current_gdbarch->deprecated_register_size));
945 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
946 fprintf_unfiltered (file,
947 "gdbarch_dump: %s # %s\n",
948 "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
949 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
951 fprintf_unfiltered (file,
952 "gdbarch_dump: gdbarch_deprecated_saved_pc_after_call_p() = %d\n",
953 gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch));
954 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL
955 fprintf_unfiltered (file,
956 "gdbarch_dump: %s # %s\n",
957 "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
958 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
960 fprintf_unfiltered (file,
961 "gdbarch_dump: deprecated_saved_pc_after_call = <0x%lx>\n",
962 (long) current_gdbarch->deprecated_saved_pc_after_call);
963 #ifdef DEPRECATED_STACK_ALIGN_P
964 fprintf_unfiltered (file,
965 "gdbarch_dump: %s # %s\n",
966 "DEPRECATED_STACK_ALIGN_P()",
967 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
969 fprintf_unfiltered (file,
970 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
971 gdbarch_deprecated_stack_align_p (current_gdbarch));
972 #ifdef DEPRECATED_STACK_ALIGN
973 fprintf_unfiltered (file,
974 "gdbarch_dump: %s # %s\n",
975 "DEPRECATED_STACK_ALIGN(sp)",
976 XSTRING (DEPRECATED_STACK_ALIGN (sp)));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
980 (long) current_gdbarch->deprecated_stack_align);
981 #ifdef DEPRECATED_STORE_RETURN_VALUE
982 fprintf_unfiltered (file,
983 "gdbarch_dump: %s # %s\n",
984 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
985 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
987 fprintf_unfiltered (file,
988 "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n",
989 (long) current_gdbarch->deprecated_store_return_value);
990 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
991 fprintf_unfiltered (file,
992 "gdbarch_dump: %s # %s\n",
993 "DEPRECATED_STORE_STRUCT_RETURN_P()",
994 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
996 fprintf_unfiltered (file,
997 "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
998 gdbarch_deprecated_store_struct_return_p (current_gdbarch));
999 #ifdef DEPRECATED_STORE_STRUCT_RETURN
1000 fprintf_unfiltered (file,
1001 "gdbarch_dump: %s # %s\n",
1002 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
1003 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
1007 (long) current_gdbarch->deprecated_store_struct_return);
1008 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
1009 fprintf_unfiltered (file,
1010 "gdbarch_dump: %s # %s\n",
1011 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
1012 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
1014 fprintf_unfiltered (file,
1015 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
1016 (long) current_gdbarch->deprecated_use_struct_convention);
1017 #ifdef TARGET_DOUBLE_BIT
1018 fprintf_unfiltered (file,
1019 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
1020 XSTRING (TARGET_DOUBLE_BIT));
1022 fprintf_unfiltered (file,
1023 "gdbarch_dump: double_bit = %s\n",
1024 paddr_d (current_gdbarch->double_bit));
1025 #ifdef TARGET_DOUBLE_FORMAT
1026 fprintf_unfiltered (file,
1027 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1028 XSTRING (TARGET_DOUBLE_FORMAT));
1030 fprintf_unfiltered (file,
1031 "gdbarch_dump: double_format = %s\n",
1032 pformat (current_gdbarch->double_format));
1033 #ifdef DWARF2_REG_TO_REGNUM
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: %s # %s\n",
1036 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1037 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1039 fprintf_unfiltered (file,
1040 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
1041 (long) current_gdbarch->dwarf2_reg_to_regnum);
1042 #ifdef DWARF_REG_TO_REGNUM
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: %s # %s\n",
1045 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1046 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1048 fprintf_unfiltered (file,
1049 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
1050 (long) current_gdbarch->dwarf_reg_to_regnum);
1051 #ifdef ECOFF_REG_TO_REGNUM
1052 fprintf_unfiltered (file,
1053 "gdbarch_dump: %s # %s\n",
1054 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1055 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1057 fprintf_unfiltered (file,
1058 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
1059 (long) current_gdbarch->ecoff_reg_to_regnum);
1060 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1061 fprintf_unfiltered (file,
1062 "gdbarch_dump: %s # %s\n",
1063 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1064 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1066 fprintf_unfiltered (file,
1067 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
1068 (long) current_gdbarch->elf_make_msymbol_special);
1069 #ifdef EXTRACT_RETURN_VALUE
1070 fprintf_unfiltered (file,
1071 "gdbarch_dump: %s # %s\n",
1072 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1073 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1075 fprintf_unfiltered (file,
1076 "gdbarch_dump: extract_return_value = <0x%lx>\n",
1077 (long) current_gdbarch->extract_return_value);
1078 #ifdef FETCH_POINTER_ARGUMENT_P
1079 fprintf_unfiltered (file,
1080 "gdbarch_dump: %s # %s\n",
1081 "FETCH_POINTER_ARGUMENT_P()",
1082 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1084 fprintf_unfiltered (file,
1085 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
1086 gdbarch_fetch_pointer_argument_p (current_gdbarch));
1087 #ifdef FETCH_POINTER_ARGUMENT
1088 fprintf_unfiltered (file,
1089 "gdbarch_dump: %s # %s\n",
1090 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1091 XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
1093 fprintf_unfiltered (file,
1094 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1095 (long) current_gdbarch->fetch_pointer_argument);
1096 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS_P
1097 fprintf_unfiltered (file,
1098 "gdbarch_dump: %s # %s\n",
1099 "FETCH_TLS_LOAD_MODULE_ADDRESS_P()",
1100 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS_P ()));
1102 fprintf_unfiltered (file,
1103 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
1104 gdbarch_fetch_tls_load_module_address_p (current_gdbarch));
1105 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS
1106 fprintf_unfiltered (file,
1107 "gdbarch_dump: %s # %s\n",
1108 "FETCH_TLS_LOAD_MODULE_ADDRESS(objfile)",
1109 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS (objfile)));
1111 fprintf_unfiltered (file,
1112 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
1113 (long) current_gdbarch->fetch_tls_load_module_address);
1114 #ifdef TARGET_FLOAT_BIT
1115 fprintf_unfiltered (file,
1116 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1117 XSTRING (TARGET_FLOAT_BIT));
1119 fprintf_unfiltered (file,
1120 "gdbarch_dump: float_bit = %s\n",
1121 paddr_d (current_gdbarch->float_bit));
1122 #ifdef TARGET_FLOAT_FORMAT
1123 fprintf_unfiltered (file,
1124 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1125 XSTRING (TARGET_FLOAT_FORMAT));
1127 fprintf_unfiltered (file,
1128 "gdbarch_dump: float_format = %s\n",
1129 pformat (current_gdbarch->float_format));
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: FP0_REGNUM # %s\n",
1133 XSTRING (FP0_REGNUM));
1135 fprintf_unfiltered (file,
1136 "gdbarch_dump: fp0_regnum = %s\n",
1137 paddr_d (current_gdbarch->fp0_regnum));
1138 fprintf_unfiltered (file,
1139 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1140 gdbarch_frame_align_p (current_gdbarch));
1141 fprintf_unfiltered (file,
1142 "gdbarch_dump: frame_align = <0x%lx>\n",
1143 (long) current_gdbarch->frame_align);
1144 #ifdef FRAME_ARGS_SKIP
1145 fprintf_unfiltered (file,
1146 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1147 XSTRING (FRAME_ARGS_SKIP));
1149 fprintf_unfiltered (file,
1150 "gdbarch_dump: frame_args_skip = 0x%s\n",
1151 paddr_nz (current_gdbarch->frame_args_skip));
1152 #ifdef FRAME_NUM_ARGS_P
1153 fprintf_unfiltered (file,
1154 "gdbarch_dump: %s # %s\n",
1155 "FRAME_NUM_ARGS_P()",
1156 XSTRING (FRAME_NUM_ARGS_P ()));
1158 fprintf_unfiltered (file,
1159 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1160 gdbarch_frame_num_args_p (current_gdbarch));
1161 #ifdef FRAME_NUM_ARGS
1162 fprintf_unfiltered (file,
1163 "gdbarch_dump: %s # %s\n",
1164 "FRAME_NUM_ARGS(frame)",
1165 XSTRING (FRAME_NUM_ARGS (frame)));
1167 fprintf_unfiltered (file,
1168 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1169 (long) current_gdbarch->frame_num_args);
1170 #ifdef FRAME_RED_ZONE_SIZE
1171 fprintf_unfiltered (file,
1172 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1173 XSTRING (FRAME_RED_ZONE_SIZE));
1175 fprintf_unfiltered (file,
1176 "gdbarch_dump: frame_red_zone_size = %s\n",
1177 paddr_d (current_gdbarch->frame_red_zone_size));
1178 #ifdef GET_LONGJMP_TARGET_P
1179 fprintf_unfiltered (file,
1180 "gdbarch_dump: %s # %s\n",
1181 "GET_LONGJMP_TARGET_P()",
1182 XSTRING (GET_LONGJMP_TARGET_P ()));
1184 fprintf_unfiltered (file,
1185 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1186 gdbarch_get_longjmp_target_p (current_gdbarch));
1187 #ifdef GET_LONGJMP_TARGET
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: %s # %s\n",
1190 "GET_LONGJMP_TARGET(pc)",
1191 XSTRING (GET_LONGJMP_TARGET (pc)));
1193 fprintf_unfiltered (file,
1194 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1195 (long) current_gdbarch->get_longjmp_target);
1196 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1197 fprintf_unfiltered (file,
1198 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1199 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1201 fprintf_unfiltered (file,
1202 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1203 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
1204 fprintf_unfiltered (file,
1205 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1206 (long) current_gdbarch->in_function_epilogue_p);
1207 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1208 fprintf_unfiltered (file,
1209 "gdbarch_dump: %s # %s\n",
1210 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1211 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1213 fprintf_unfiltered (file,
1214 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1215 (long) current_gdbarch->in_solib_return_trampoline);
1217 fprintf_unfiltered (file,
1218 "gdbarch_dump: %s # %s\n",
1219 "INNER_THAN(lhs, rhs)",
1220 XSTRING (INNER_THAN (lhs, rhs)));
1222 fprintf_unfiltered (file,
1223 "gdbarch_dump: inner_than = <0x%lx>\n",
1224 (long) current_gdbarch->inner_than);
1225 #ifdef TARGET_INT_BIT
1226 fprintf_unfiltered (file,
1227 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1228 XSTRING (TARGET_INT_BIT));
1230 fprintf_unfiltered (file,
1231 "gdbarch_dump: int_bit = %s\n",
1232 paddr_d (current_gdbarch->int_bit));
1233 fprintf_unfiltered (file,
1234 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1235 gdbarch_integer_to_address_p (current_gdbarch));
1236 fprintf_unfiltered (file,
1237 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1238 (long) current_gdbarch->integer_to_address);
1239 #ifdef TARGET_LONG_BIT
1240 fprintf_unfiltered (file,
1241 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1242 XSTRING (TARGET_LONG_BIT));
1244 fprintf_unfiltered (file,
1245 "gdbarch_dump: long_bit = %s\n",
1246 paddr_d (current_gdbarch->long_bit));
1247 #ifdef TARGET_LONG_DOUBLE_BIT
1248 fprintf_unfiltered (file,
1249 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1250 XSTRING (TARGET_LONG_DOUBLE_BIT));
1252 fprintf_unfiltered (file,
1253 "gdbarch_dump: long_double_bit = %s\n",
1254 paddr_d (current_gdbarch->long_double_bit));
1255 #ifdef TARGET_LONG_DOUBLE_FORMAT
1256 fprintf_unfiltered (file,
1257 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1258 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1260 fprintf_unfiltered (file,
1261 "gdbarch_dump: long_double_format = %s\n",
1262 pformat (current_gdbarch->long_double_format));
1263 #ifdef TARGET_LONG_LONG_BIT
1264 fprintf_unfiltered (file,
1265 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1266 XSTRING (TARGET_LONG_LONG_BIT));
1268 fprintf_unfiltered (file,
1269 "gdbarch_dump: long_long_bit = %s\n",
1270 paddr_d (current_gdbarch->long_long_bit));
1271 #ifdef MEMORY_INSERT_BREAKPOINT
1272 fprintf_unfiltered (file,
1273 "gdbarch_dump: %s # %s\n",
1274 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1275 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1277 fprintf_unfiltered (file,
1278 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1279 (long) current_gdbarch->memory_insert_breakpoint);
1280 #ifdef MEMORY_REMOVE_BREAKPOINT
1281 fprintf_unfiltered (file,
1282 "gdbarch_dump: %s # %s\n",
1283 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1284 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1286 fprintf_unfiltered (file,
1287 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1288 (long) current_gdbarch->memory_remove_breakpoint);
1289 #ifdef NAME_OF_MALLOC
1290 fprintf_unfiltered (file,
1291 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1292 XSTRING (NAME_OF_MALLOC));
1294 fprintf_unfiltered (file,
1295 "gdbarch_dump: name_of_malloc = %s\n",
1297 #ifdef NUM_PSEUDO_REGS
1298 fprintf_unfiltered (file,
1299 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1300 XSTRING (NUM_PSEUDO_REGS));
1302 fprintf_unfiltered (file,
1303 "gdbarch_dump: num_pseudo_regs = %s\n",
1304 paddr_d (current_gdbarch->num_pseudo_regs));
1306 fprintf_unfiltered (file,
1307 "gdbarch_dump: NUM_REGS # %s\n",
1308 XSTRING (NUM_REGS));
1310 fprintf_unfiltered (file,
1311 "gdbarch_dump: num_regs = %s\n",
1312 paddr_d (current_gdbarch->num_regs));
1314 fprintf_unfiltered (file,
1315 "gdbarch_dump: TARGET_OSABI # %s\n",
1316 XSTRING (TARGET_OSABI));
1318 fprintf_unfiltered (file,
1319 "gdbarch_dump: osabi = %s\n",
1320 paddr_d (current_gdbarch->osabi));
1322 fprintf_unfiltered (file,
1323 "gdbarch_dump: PC_REGNUM # %s\n",
1324 XSTRING (PC_REGNUM));
1326 fprintf_unfiltered (file,
1327 "gdbarch_dump: pc_regnum = %s\n",
1328 paddr_d (current_gdbarch->pc_regnum));
1329 #ifdef POINTER_TO_ADDRESS
1330 fprintf_unfiltered (file,
1331 "gdbarch_dump: %s # %s\n",
1332 "POINTER_TO_ADDRESS(type, buf)",
1333 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1335 fprintf_unfiltered (file,
1336 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1337 (long) current_gdbarch->pointer_to_address);
1338 fprintf_unfiltered (file,
1339 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1340 gdbarch_print_float_info_p (current_gdbarch));
1341 fprintf_unfiltered (file,
1342 "gdbarch_dump: print_float_info = <0x%lx>\n",
1343 (long) current_gdbarch->print_float_info);
1344 #ifdef TARGET_PRINT_INSN
1345 fprintf_unfiltered (file,
1346 "gdbarch_dump: %s # %s\n",
1347 "TARGET_PRINT_INSN(vma, info)",
1348 XSTRING (TARGET_PRINT_INSN (vma, info)));
1350 fprintf_unfiltered (file,
1351 "gdbarch_dump: print_insn = <0x%lx>\n",
1352 (long) current_gdbarch->print_insn);
1353 fprintf_unfiltered (file,
1354 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1355 (long) current_gdbarch->print_registers_info);
1356 fprintf_unfiltered (file,
1357 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1358 gdbarch_print_vector_info_p (current_gdbarch));
1359 fprintf_unfiltered (file,
1360 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1361 (long) current_gdbarch->print_vector_info);
1363 fprintf_unfiltered (file,
1364 "gdbarch_dump: PS_REGNUM # %s\n",
1365 XSTRING (PS_REGNUM));
1367 fprintf_unfiltered (file,
1368 "gdbarch_dump: ps_regnum = %s\n",
1369 paddr_d (current_gdbarch->ps_regnum));
1370 fprintf_unfiltered (file,
1371 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1372 gdbarch_pseudo_register_read_p (current_gdbarch));
1373 fprintf_unfiltered (file,
1374 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1375 (long) current_gdbarch->pseudo_register_read);
1376 fprintf_unfiltered (file,
1377 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1378 gdbarch_pseudo_register_write_p (current_gdbarch));
1379 fprintf_unfiltered (file,
1380 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1381 (long) current_gdbarch->pseudo_register_write);
1382 #ifdef TARGET_PTR_BIT
1383 fprintf_unfiltered (file,
1384 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1385 XSTRING (TARGET_PTR_BIT));
1387 fprintf_unfiltered (file,
1388 "gdbarch_dump: ptr_bit = %s\n",
1389 paddr_d (current_gdbarch->ptr_bit));
1390 fprintf_unfiltered (file,
1391 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1392 gdbarch_push_dummy_call_p (current_gdbarch));
1393 fprintf_unfiltered (file,
1394 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1395 (long) current_gdbarch->push_dummy_call);
1396 fprintf_unfiltered (file,
1397 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1398 gdbarch_push_dummy_code_p (current_gdbarch));
1399 fprintf_unfiltered (file,
1400 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1401 (long) current_gdbarch->push_dummy_code);
1402 #ifdef TARGET_READ_PC_P
1403 fprintf_unfiltered (file,
1404 "gdbarch_dump: %s # %s\n",
1405 "TARGET_READ_PC_P()",
1406 XSTRING (TARGET_READ_PC_P ()));
1408 fprintf_unfiltered (file,
1409 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1410 gdbarch_read_pc_p (current_gdbarch));
1411 #ifdef TARGET_READ_PC
1412 fprintf_unfiltered (file,
1413 "gdbarch_dump: %s # %s\n",
1414 "TARGET_READ_PC(ptid)",
1415 XSTRING (TARGET_READ_PC (ptid)));
1417 fprintf_unfiltered (file,
1418 "gdbarch_dump: read_pc = <0x%lx>\n",
1419 (long) current_gdbarch->read_pc);
1420 #ifdef TARGET_READ_SP_P
1421 fprintf_unfiltered (file,
1422 "gdbarch_dump: %s # %s\n",
1423 "TARGET_READ_SP_P()",
1424 XSTRING (TARGET_READ_SP_P ()));
1426 fprintf_unfiltered (file,
1427 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1428 gdbarch_read_sp_p (current_gdbarch));
1429 #ifdef TARGET_READ_SP
1430 fprintf_unfiltered (file,
1431 "gdbarch_dump: %s # %s\n",
1433 XSTRING (TARGET_READ_SP ()));
1435 fprintf_unfiltered (file,
1436 "gdbarch_dump: read_sp = <0x%lx>\n",
1437 (long) current_gdbarch->read_sp);
1438 #ifdef REGISTER_BYTES_OK_P
1439 fprintf_unfiltered (file,
1440 "gdbarch_dump: %s # %s\n",
1441 "REGISTER_BYTES_OK_P()",
1442 XSTRING (REGISTER_BYTES_OK_P ()));
1444 fprintf_unfiltered (file,
1445 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1446 gdbarch_register_bytes_ok_p (current_gdbarch));
1447 #ifdef REGISTER_BYTES_OK
1448 fprintf_unfiltered (file,
1449 "gdbarch_dump: %s # %s\n",
1450 "REGISTER_BYTES_OK(nr_bytes)",
1451 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1453 fprintf_unfiltered (file,
1454 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1455 (long) current_gdbarch->register_bytes_ok);
1456 #ifdef REGISTER_NAME
1457 fprintf_unfiltered (file,
1458 "gdbarch_dump: %s # %s\n",
1459 "REGISTER_NAME(regnr)",
1460 XSTRING (REGISTER_NAME (regnr)));
1462 fprintf_unfiltered (file,
1463 "gdbarch_dump: register_name = <0x%lx>\n",
1464 (long) current_gdbarch->register_name);
1465 fprintf_unfiltered (file,
1466 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1467 (long) current_gdbarch->register_reggroup_p);
1468 #ifdef REGISTER_SIM_REGNO
1469 fprintf_unfiltered (file,
1470 "gdbarch_dump: %s # %s\n",
1471 "REGISTER_SIM_REGNO(reg_nr)",
1472 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1474 fprintf_unfiltered (file,
1475 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1476 (long) current_gdbarch->register_sim_regno);
1477 #ifdef REGISTER_TO_VALUE
1478 fprintf_unfiltered (file,
1479 "gdbarch_dump: %s # %s\n",
1480 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1481 XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
1483 fprintf_unfiltered (file,
1484 "gdbarch_dump: register_to_value = <0x%lx>\n",
1485 (long) current_gdbarch->register_to_value);
1486 fprintf_unfiltered (file,
1487 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1488 gdbarch_register_type_p (current_gdbarch));
1489 fprintf_unfiltered (file,
1490 "gdbarch_dump: register_type = <0x%lx>\n",
1491 (long) current_gdbarch->register_type);
1492 fprintf_unfiltered (file,
1493 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1494 gdbarch_regset_from_core_section_p (current_gdbarch));
1495 fprintf_unfiltered (file,
1496 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1497 (long) current_gdbarch->regset_from_core_section);
1498 fprintf_unfiltered (file,
1499 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1500 (long) current_gdbarch->remote_translate_xfer_address);
1501 fprintf_unfiltered (file,
1502 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1503 gdbarch_return_value_p (current_gdbarch));
1504 fprintf_unfiltered (file,
1505 "gdbarch_dump: return_value = <0x%lx>\n",
1506 (long) current_gdbarch->return_value);
1507 #ifdef SDB_REG_TO_REGNUM
1508 fprintf_unfiltered (file,
1509 "gdbarch_dump: %s # %s\n",
1510 "SDB_REG_TO_REGNUM(sdb_regnr)",
1511 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1513 fprintf_unfiltered (file,
1514 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1515 (long) current_gdbarch->sdb_reg_to_regnum);
1516 #ifdef TARGET_SHORT_BIT
1517 fprintf_unfiltered (file,
1518 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1519 XSTRING (TARGET_SHORT_BIT));
1521 fprintf_unfiltered (file,
1522 "gdbarch_dump: short_bit = %s\n",
1523 paddr_d (current_gdbarch->short_bit));
1524 fprintf_unfiltered (file,
1525 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1526 gdbarch_single_step_through_delay_p (current_gdbarch));
1527 fprintf_unfiltered (file,
1528 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1529 (long) current_gdbarch->single_step_through_delay);
1530 #ifdef SKIP_PROLOGUE
1531 fprintf_unfiltered (file,
1532 "gdbarch_dump: %s # %s\n",
1533 "SKIP_PROLOGUE(ip)",
1534 XSTRING (SKIP_PROLOGUE (ip)));
1536 fprintf_unfiltered (file,
1537 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1538 (long) current_gdbarch->skip_prologue);
1539 fprintf_unfiltered (file,
1540 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1541 (long) current_gdbarch->skip_solib_resolver);
1542 #ifdef SKIP_TRAMPOLINE_CODE
1543 fprintf_unfiltered (file,
1544 "gdbarch_dump: %s # %s\n",
1545 "SKIP_TRAMPOLINE_CODE(pc)",
1546 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1548 fprintf_unfiltered (file,
1549 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1550 (long) current_gdbarch->skip_trampoline_code);
1551 #ifdef SMASH_TEXT_ADDRESS
1552 fprintf_unfiltered (file,
1553 "gdbarch_dump: %s # %s\n",
1554 "SMASH_TEXT_ADDRESS(addr)",
1555 XSTRING (SMASH_TEXT_ADDRESS (addr)));
1557 fprintf_unfiltered (file,
1558 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1559 (long) current_gdbarch->smash_text_address);
1560 #ifdef SOFTWARE_SINGLE_STEP_P
1561 fprintf_unfiltered (file,
1562 "gdbarch_dump: %s # %s\n",
1563 "SOFTWARE_SINGLE_STEP_P()",
1564 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1566 fprintf_unfiltered (file,
1567 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1568 gdbarch_software_single_step_p (current_gdbarch));
1569 #ifdef SOFTWARE_SINGLE_STEP
1570 fprintf_unfiltered (file,
1571 "gdbarch_dump: %s # %s\n",
1572 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1573 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1575 fprintf_unfiltered (file,
1576 "gdbarch_dump: software_single_step = <0x%lx>\n",
1577 (long) current_gdbarch->software_single_step);
1579 fprintf_unfiltered (file,
1580 "gdbarch_dump: SP_REGNUM # %s\n",
1581 XSTRING (SP_REGNUM));
1583 fprintf_unfiltered (file,
1584 "gdbarch_dump: sp_regnum = %s\n",
1585 paddr_d (current_gdbarch->sp_regnum));
1586 #ifdef STAB_REG_TO_REGNUM
1587 fprintf_unfiltered (file,
1588 "gdbarch_dump: %s # %s\n",
1589 "STAB_REG_TO_REGNUM(stab_regnr)",
1590 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
1592 fprintf_unfiltered (file,
1593 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1594 (long) current_gdbarch->stab_reg_to_regnum);
1595 fprintf_unfiltered (file,
1596 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1597 (long) current_gdbarch->stabs_argument_has_addr);
1598 #ifdef STORE_RETURN_VALUE
1599 fprintf_unfiltered (file,
1600 "gdbarch_dump: %s # %s\n",
1601 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1602 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1604 fprintf_unfiltered (file,
1605 "gdbarch_dump: store_return_value = <0x%lx>\n",
1606 (long) current_gdbarch->store_return_value);
1607 fprintf_unfiltered (file,
1608 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1609 gdbarch_unwind_dummy_id_p (current_gdbarch));
1610 fprintf_unfiltered (file,
1611 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1612 (long) current_gdbarch->unwind_dummy_id);
1613 fprintf_unfiltered (file,
1614 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1615 gdbarch_unwind_pc_p (current_gdbarch));
1616 fprintf_unfiltered (file,
1617 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1618 (long) current_gdbarch->unwind_pc);
1619 fprintf_unfiltered (file,
1620 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1621 gdbarch_unwind_sp_p (current_gdbarch));
1622 fprintf_unfiltered (file,
1623 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1624 (long) current_gdbarch->unwind_sp);
1625 #ifdef VALUE_TO_REGISTER
1626 fprintf_unfiltered (file,
1627 "gdbarch_dump: %s # %s\n",
1628 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1629 XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
1631 fprintf_unfiltered (file,
1632 "gdbarch_dump: value_to_register = <0x%lx>\n",
1633 (long) current_gdbarch->value_to_register);
1634 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1635 fprintf_unfiltered (file,
1636 "gdbarch_dump: %s # %s\n",
1637 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1638 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
1640 fprintf_unfiltered (file,
1641 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1642 (long) current_gdbarch->virtual_frame_pointer);
1643 #ifdef TARGET_WRITE_PC
1644 fprintf_unfiltered (file,
1645 "gdbarch_dump: %s # %s\n",
1646 "TARGET_WRITE_PC(val, ptid)",
1647 XSTRING (TARGET_WRITE_PC (val, ptid)));
1649 fprintf_unfiltered (file,
1650 "gdbarch_dump: write_pc = <0x%lx>\n",
1651 (long) current_gdbarch->write_pc);
1652 if (current_gdbarch->dump_tdep != NULL)
1653 current_gdbarch->dump_tdep (current_gdbarch, file);
1656 struct gdbarch_tdep *
1657 gdbarch_tdep (struct gdbarch *gdbarch)
1659 if (gdbarch_debug >= 2)
1660 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1661 return gdbarch->tdep;
1665 const struct bfd_arch_info *
1666 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1668 gdb_assert (gdbarch != NULL);
1669 if (gdbarch_debug >= 2)
1670 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1671 return gdbarch->bfd_arch_info;
1675 gdbarch_byte_order (struct gdbarch *gdbarch)
1677 gdb_assert (gdbarch != NULL);
1678 if (gdbarch_debug >= 2)
1679 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1680 return gdbarch->byte_order;
1684 gdbarch_osabi (struct gdbarch *gdbarch)
1686 gdb_assert (gdbarch != NULL);
1687 if (gdbarch_debug >= 2)
1688 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1689 return gdbarch->osabi;
1693 gdbarch_short_bit (struct gdbarch *gdbarch)
1695 gdb_assert (gdbarch != NULL);
1696 /* Skip verify of short_bit, invalid_p == 0 */
1697 if (gdbarch_debug >= 2)
1698 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1699 return gdbarch->short_bit;
1703 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1706 gdbarch->short_bit = short_bit;
1710 gdbarch_int_bit (struct gdbarch *gdbarch)
1712 gdb_assert (gdbarch != NULL);
1713 /* Skip verify of int_bit, invalid_p == 0 */
1714 if (gdbarch_debug >= 2)
1715 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1716 return gdbarch->int_bit;
1720 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1723 gdbarch->int_bit = int_bit;
1727 gdbarch_long_bit (struct gdbarch *gdbarch)
1729 gdb_assert (gdbarch != NULL);
1730 /* Skip verify of long_bit, invalid_p == 0 */
1731 if (gdbarch_debug >= 2)
1732 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1733 return gdbarch->long_bit;
1737 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1740 gdbarch->long_bit = long_bit;
1744 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1746 gdb_assert (gdbarch != NULL);
1747 /* Skip verify of long_long_bit, invalid_p == 0 */
1748 if (gdbarch_debug >= 2)
1749 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1750 return gdbarch->long_long_bit;
1754 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1757 gdbarch->long_long_bit = long_long_bit;
1761 gdbarch_float_bit (struct gdbarch *gdbarch)
1763 gdb_assert (gdbarch != NULL);
1764 /* Skip verify of float_bit, invalid_p == 0 */
1765 if (gdbarch_debug >= 2)
1766 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1767 return gdbarch->float_bit;
1771 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1774 gdbarch->float_bit = float_bit;
1777 const struct floatformat *
1778 gdbarch_float_format (struct gdbarch *gdbarch)
1780 gdb_assert (gdbarch != NULL);
1781 if (gdbarch_debug >= 2)
1782 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1783 return gdbarch->float_format;
1787 set_gdbarch_float_format (struct gdbarch *gdbarch,
1788 const struct floatformat * float_format)
1790 gdbarch->float_format = float_format;
1794 gdbarch_double_bit (struct gdbarch *gdbarch)
1796 gdb_assert (gdbarch != NULL);
1797 /* Skip verify of double_bit, invalid_p == 0 */
1798 if (gdbarch_debug >= 2)
1799 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1800 return gdbarch->double_bit;
1804 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1807 gdbarch->double_bit = double_bit;
1810 const struct floatformat *
1811 gdbarch_double_format (struct gdbarch *gdbarch)
1813 gdb_assert (gdbarch != NULL);
1814 if (gdbarch_debug >= 2)
1815 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1816 return gdbarch->double_format;
1820 set_gdbarch_double_format (struct gdbarch *gdbarch,
1821 const struct floatformat * double_format)
1823 gdbarch->double_format = double_format;
1827 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1829 gdb_assert (gdbarch != NULL);
1830 /* Skip verify of long_double_bit, invalid_p == 0 */
1831 if (gdbarch_debug >= 2)
1832 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1833 return gdbarch->long_double_bit;
1837 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1838 int long_double_bit)
1840 gdbarch->long_double_bit = long_double_bit;
1843 const struct floatformat *
1844 gdbarch_long_double_format (struct gdbarch *gdbarch)
1846 gdb_assert (gdbarch != NULL);
1847 if (gdbarch_debug >= 2)
1848 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1849 return gdbarch->long_double_format;
1853 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1854 const struct floatformat * long_double_format)
1856 gdbarch->long_double_format = long_double_format;
1860 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1862 gdb_assert (gdbarch != NULL);
1863 /* Skip verify of ptr_bit, invalid_p == 0 */
1864 if (gdbarch_debug >= 2)
1865 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1866 return gdbarch->ptr_bit;
1870 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1873 gdbarch->ptr_bit = ptr_bit;
1877 gdbarch_addr_bit (struct gdbarch *gdbarch)
1879 gdb_assert (gdbarch != NULL);
1880 /* Check variable changed from pre-default. */
1881 gdb_assert (gdbarch->addr_bit != 0);
1882 if (gdbarch_debug >= 2)
1883 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1884 return gdbarch->addr_bit;
1888 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1891 gdbarch->addr_bit = addr_bit;
1895 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1897 gdb_assert (gdbarch != NULL);
1898 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1899 if (gdbarch_debug >= 2)
1900 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1901 return gdbarch->bfd_vma_bit;
1905 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1908 gdbarch->bfd_vma_bit = bfd_vma_bit;
1912 gdbarch_char_signed (struct gdbarch *gdbarch)
1914 gdb_assert (gdbarch != NULL);
1915 /* Check variable changed from pre-default. */
1916 gdb_assert (gdbarch->char_signed != -1);
1917 if (gdbarch_debug >= 2)
1918 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1919 return gdbarch->char_signed;
1923 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1926 gdbarch->char_signed = char_signed;
1930 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1932 gdb_assert (gdbarch != NULL);
1933 return gdbarch->read_pc != NULL;
1937 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
1939 gdb_assert (gdbarch != NULL);
1940 gdb_assert (gdbarch->read_pc != NULL);
1941 if (gdbarch_debug >= 2)
1942 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1943 return gdbarch->read_pc (ptid);
1947 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1948 gdbarch_read_pc_ftype read_pc)
1950 gdbarch->read_pc = read_pc;
1954 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
1956 gdb_assert (gdbarch != NULL);
1957 gdb_assert (gdbarch->write_pc != NULL);
1958 if (gdbarch_debug >= 2)
1959 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1960 gdbarch->write_pc (val, ptid);
1964 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1965 gdbarch_write_pc_ftype write_pc)
1967 gdbarch->write_pc = write_pc;
1971 gdbarch_read_sp_p (struct gdbarch *gdbarch)
1973 gdb_assert (gdbarch != NULL);
1974 return gdbarch->read_sp != NULL;
1978 gdbarch_read_sp (struct gdbarch *gdbarch)
1980 gdb_assert (gdbarch != NULL);
1981 gdb_assert (gdbarch->read_sp != NULL);
1982 if (gdbarch_debug >= 2)
1983 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
1984 return gdbarch->read_sp ();
1988 set_gdbarch_read_sp (struct gdbarch *gdbarch,
1989 gdbarch_read_sp_ftype read_sp)
1991 gdbarch->read_sp = read_sp;
1995 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1997 gdb_assert (gdbarch != NULL);
1998 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1999 if (gdbarch_debug >= 2)
2000 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
2001 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
2005 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
2006 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
2008 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
2012 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
2014 gdb_assert (gdbarch != NULL);
2015 return gdbarch->pseudo_register_read != NULL;
2019 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
2021 gdb_assert (gdbarch != NULL);
2022 gdb_assert (gdbarch->pseudo_register_read != NULL);
2023 if (gdbarch_debug >= 2)
2024 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
2025 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
2029 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
2030 gdbarch_pseudo_register_read_ftype pseudo_register_read)
2032 gdbarch->pseudo_register_read = pseudo_register_read;
2036 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
2038 gdb_assert (gdbarch != NULL);
2039 return gdbarch->pseudo_register_write != NULL;
2043 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
2045 gdb_assert (gdbarch != NULL);
2046 gdb_assert (gdbarch->pseudo_register_write != NULL);
2047 if (gdbarch_debug >= 2)
2048 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
2049 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
2053 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
2054 gdbarch_pseudo_register_write_ftype pseudo_register_write)
2056 gdbarch->pseudo_register_write = pseudo_register_write;
2060 gdbarch_num_regs (struct gdbarch *gdbarch)
2062 gdb_assert (gdbarch != NULL);
2063 /* Check variable changed from pre-default. */
2064 gdb_assert (gdbarch->num_regs != -1);
2065 if (gdbarch_debug >= 2)
2066 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2067 return gdbarch->num_regs;
2071 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2074 gdbarch->num_regs = num_regs;
2078 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2080 gdb_assert (gdbarch != NULL);
2081 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2082 if (gdbarch_debug >= 2)
2083 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2084 return gdbarch->num_pseudo_regs;
2088 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2089 int num_pseudo_regs)
2091 gdbarch->num_pseudo_regs = num_pseudo_regs;
2095 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2097 gdb_assert (gdbarch != NULL);
2098 /* Skip verify of sp_regnum, invalid_p == 0 */
2099 if (gdbarch_debug >= 2)
2100 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2101 return gdbarch->sp_regnum;
2105 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2108 gdbarch->sp_regnum = sp_regnum;
2112 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2114 gdb_assert (gdbarch != NULL);
2115 /* Skip verify of pc_regnum, invalid_p == 0 */
2116 if (gdbarch_debug >= 2)
2117 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2118 return gdbarch->pc_regnum;
2122 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2125 gdbarch->pc_regnum = pc_regnum;
2129 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2131 gdb_assert (gdbarch != NULL);
2132 /* Skip verify of ps_regnum, invalid_p == 0 */
2133 if (gdbarch_debug >= 2)
2134 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2135 return gdbarch->ps_regnum;
2139 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2142 gdbarch->ps_regnum = ps_regnum;
2146 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2148 gdb_assert (gdbarch != NULL);
2149 /* Skip verify of fp0_regnum, invalid_p == 0 */
2150 if (gdbarch_debug >= 2)
2151 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2152 return gdbarch->fp0_regnum;
2156 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2159 gdbarch->fp0_regnum = fp0_regnum;
2163 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2165 gdb_assert (gdbarch != NULL);
2166 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
2167 if (gdbarch_debug >= 2)
2168 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2169 return gdbarch->stab_reg_to_regnum (stab_regnr);
2173 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2174 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2176 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2180 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2182 gdb_assert (gdbarch != NULL);
2183 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
2184 if (gdbarch_debug >= 2)
2185 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2186 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2190 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2191 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2193 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2197 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2199 gdb_assert (gdbarch != NULL);
2200 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
2201 if (gdbarch_debug >= 2)
2202 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2203 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2207 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2208 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2210 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2214 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2216 gdb_assert (gdbarch != NULL);
2217 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
2218 if (gdbarch_debug >= 2)
2219 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2220 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2224 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2225 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2227 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2231 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2233 gdb_assert (gdbarch != NULL);
2234 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
2235 if (gdbarch_debug >= 2)
2236 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2237 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2241 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2242 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2244 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2248 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2250 gdb_assert (gdbarch != NULL);
2251 gdb_assert (gdbarch->register_name != NULL);
2252 if (gdbarch_debug >= 2)
2253 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2254 return gdbarch->register_name (regnr);
2258 set_gdbarch_register_name (struct gdbarch *gdbarch,
2259 gdbarch_register_name_ftype register_name)
2261 gdbarch->register_name = register_name;
2265 gdbarch_register_type_p (struct gdbarch *gdbarch)
2267 gdb_assert (gdbarch != NULL);
2268 return gdbarch->register_type != NULL;
2272 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2274 gdb_assert (gdbarch != NULL);
2275 gdb_assert (gdbarch->register_type != NULL);
2276 if (gdbarch_debug >= 2)
2277 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2278 return gdbarch->register_type (gdbarch, reg_nr);
2282 set_gdbarch_register_type (struct gdbarch *gdbarch,
2283 gdbarch_register_type_ftype register_type)
2285 gdbarch->register_type = register_type;
2289 gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch)
2291 gdb_assert (gdbarch != NULL);
2292 return gdbarch->deprecated_register_byte != generic_register_byte;
2296 gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr)
2298 gdb_assert (gdbarch != NULL);
2299 gdb_assert (gdbarch->deprecated_register_byte != NULL);
2300 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2301 if (gdbarch_debug >= 2)
2302 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n");
2303 return gdbarch->deprecated_register_byte (reg_nr);
2307 set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch,
2308 gdbarch_deprecated_register_byte_ftype deprecated_register_byte)
2310 gdbarch->deprecated_register_byte = deprecated_register_byte;
2314 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
2316 gdb_assert (gdbarch != NULL);
2317 return gdbarch->unwind_dummy_id != NULL;
2321 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
2323 gdb_assert (gdbarch != NULL);
2324 gdb_assert (gdbarch->unwind_dummy_id != NULL);
2325 if (gdbarch_debug >= 2)
2326 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
2327 return gdbarch->unwind_dummy_id (gdbarch, info);
2331 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
2332 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
2334 gdbarch->unwind_dummy_id = unwind_dummy_id;
2338 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2340 gdb_assert (gdbarch != NULL);
2341 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2342 if (gdbarch_debug >= 2)
2343 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2344 return gdbarch->deprecated_fp_regnum;
2348 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2349 int deprecated_fp_regnum)
2351 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2355 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
2357 gdb_assert (gdbarch != NULL);
2358 return gdbarch->push_dummy_call != NULL;
2362 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)
2364 gdb_assert (gdbarch != NULL);
2365 gdb_assert (gdbarch->push_dummy_call != NULL);
2366 if (gdbarch_debug >= 2)
2367 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
2368 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
2372 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2373 gdbarch_push_dummy_call_ftype push_dummy_call)
2375 gdbarch->push_dummy_call = push_dummy_call;
2379 gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch)
2381 gdb_assert (gdbarch != NULL);
2382 return gdbarch->deprecated_push_arguments != NULL;
2386 gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
2388 gdb_assert (gdbarch != NULL);
2389 gdb_assert (gdbarch->deprecated_push_arguments != NULL);
2390 if (gdbarch_debug >= 2)
2391 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n");
2392 return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr);
2396 set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch,
2397 gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments)
2399 gdbarch->deprecated_push_arguments = deprecated_push_arguments;
2403 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
2405 gdb_assert (gdbarch != NULL);
2406 if (gdbarch_debug >= 2)
2407 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
2408 return gdbarch->deprecated_register_size;
2412 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
2413 int deprecated_register_size)
2415 gdbarch->deprecated_register_size = deprecated_register_size;
2419 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2421 gdb_assert (gdbarch != NULL);
2422 /* Skip verify of call_dummy_location, invalid_p == 0 */
2423 if (gdbarch_debug >= 2)
2424 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2425 return gdbarch->call_dummy_location;
2429 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2430 int call_dummy_location)
2432 gdbarch->call_dummy_location = call_dummy_location;
2436 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
2438 gdb_assert (gdbarch != NULL);
2439 return gdbarch->push_dummy_code != NULL;
2443 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)
2445 gdb_assert (gdbarch != NULL);
2446 gdb_assert (gdbarch->push_dummy_code != NULL);
2447 if (gdbarch_debug >= 2)
2448 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
2449 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
2453 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2454 gdbarch_push_dummy_code_ftype push_dummy_code)
2456 gdbarch->push_dummy_code = push_dummy_code;
2460 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2462 gdb_assert (gdbarch != NULL);
2463 gdb_assert (gdbarch->print_registers_info != NULL);
2464 if (gdbarch_debug >= 2)
2465 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2466 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2470 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2471 gdbarch_print_registers_info_ftype print_registers_info)
2473 gdbarch->print_registers_info = print_registers_info;
2477 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2479 gdb_assert (gdbarch != NULL);
2480 return gdbarch->print_float_info != NULL;
2484 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2486 gdb_assert (gdbarch != NULL);
2487 gdb_assert (gdbarch->print_float_info != NULL);
2488 if (gdbarch_debug >= 2)
2489 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2490 gdbarch->print_float_info (gdbarch, file, frame, args);
2494 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2495 gdbarch_print_float_info_ftype print_float_info)
2497 gdbarch->print_float_info = print_float_info;
2501 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2503 gdb_assert (gdbarch != NULL);
2504 return gdbarch->print_vector_info != NULL;
2508 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2510 gdb_assert (gdbarch != NULL);
2511 gdb_assert (gdbarch->print_vector_info != NULL);
2512 if (gdbarch_debug >= 2)
2513 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2514 gdbarch->print_vector_info (gdbarch, file, frame, args);
2518 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2519 gdbarch_print_vector_info_ftype print_vector_info)
2521 gdbarch->print_vector_info = print_vector_info;
2525 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2527 gdb_assert (gdbarch != NULL);
2528 gdb_assert (gdbarch->register_sim_regno != NULL);
2529 if (gdbarch_debug >= 2)
2530 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2531 return gdbarch->register_sim_regno (reg_nr);
2535 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2536 gdbarch_register_sim_regno_ftype register_sim_regno)
2538 gdbarch->register_sim_regno = register_sim_regno;
2542 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
2544 gdb_assert (gdbarch != NULL);
2545 return gdbarch->register_bytes_ok != NULL;
2549 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
2551 gdb_assert (gdbarch != NULL);
2552 gdb_assert (gdbarch->register_bytes_ok != NULL);
2553 if (gdbarch_debug >= 2)
2554 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
2555 return gdbarch->register_bytes_ok (nr_bytes);
2559 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
2560 gdbarch_register_bytes_ok_ftype register_bytes_ok)
2562 gdbarch->register_bytes_ok = register_bytes_ok;
2566 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2568 gdb_assert (gdbarch != NULL);
2569 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2570 if (gdbarch_debug >= 2)
2571 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2572 return gdbarch->cannot_fetch_register (regnum);
2576 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2577 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2579 gdbarch->cannot_fetch_register = cannot_fetch_register;
2583 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2585 gdb_assert (gdbarch != NULL);
2586 gdb_assert (gdbarch->cannot_store_register != NULL);
2587 if (gdbarch_debug >= 2)
2588 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2589 return gdbarch->cannot_store_register (regnum);
2593 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2594 gdbarch_cannot_store_register_ftype cannot_store_register)
2596 gdbarch->cannot_store_register = cannot_store_register;
2600 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2602 gdb_assert (gdbarch != NULL);
2603 return gdbarch->get_longjmp_target != NULL;
2607 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
2609 gdb_assert (gdbarch != NULL);
2610 gdb_assert (gdbarch->get_longjmp_target != NULL);
2611 if (gdbarch_debug >= 2)
2612 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2613 return gdbarch->get_longjmp_target (pc);
2617 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2618 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2620 gdbarch->get_longjmp_target = get_longjmp_target;
2624 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2626 gdb_assert (gdbarch != NULL);
2627 if (gdbarch_debug >= 2)
2628 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2629 return gdbarch->believe_pcc_promotion;
2633 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2634 int believe_pcc_promotion)
2636 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2640 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2642 gdb_assert (gdbarch != NULL);
2643 gdb_assert (gdbarch->convert_register_p != NULL);
2644 if (gdbarch_debug >= 2)
2645 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2646 return gdbarch->convert_register_p (regnum, type);
2650 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2651 gdbarch_convert_register_p_ftype convert_register_p)
2653 gdbarch->convert_register_p = convert_register_p;
2657 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
2659 gdb_assert (gdbarch != NULL);
2660 gdb_assert (gdbarch->register_to_value != NULL);
2661 if (gdbarch_debug >= 2)
2662 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2663 gdbarch->register_to_value (frame, regnum, type, buf);
2667 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2668 gdbarch_register_to_value_ftype register_to_value)
2670 gdbarch->register_to_value = register_to_value;
2674 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2676 gdb_assert (gdbarch != NULL);
2677 gdb_assert (gdbarch->value_to_register != NULL);
2678 if (gdbarch_debug >= 2)
2679 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2680 gdbarch->value_to_register (frame, regnum, type, buf);
2684 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2685 gdbarch_value_to_register_ftype value_to_register)
2687 gdbarch->value_to_register = value_to_register;
2691 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2693 gdb_assert (gdbarch != NULL);
2694 gdb_assert (gdbarch->pointer_to_address != NULL);
2695 if (gdbarch_debug >= 2)
2696 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2697 return gdbarch->pointer_to_address (type, buf);
2701 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2702 gdbarch_pointer_to_address_ftype pointer_to_address)
2704 gdbarch->pointer_to_address = pointer_to_address;
2708 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2710 gdb_assert (gdbarch != NULL);
2711 gdb_assert (gdbarch->address_to_pointer != NULL);
2712 if (gdbarch_debug >= 2)
2713 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2714 gdbarch->address_to_pointer (type, buf, addr);
2718 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2719 gdbarch_address_to_pointer_ftype address_to_pointer)
2721 gdbarch->address_to_pointer = address_to_pointer;
2725 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2727 gdb_assert (gdbarch != NULL);
2728 return gdbarch->integer_to_address != NULL;
2732 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2734 gdb_assert (gdbarch != NULL);
2735 gdb_assert (gdbarch->integer_to_address != NULL);
2736 if (gdbarch_debug >= 2)
2737 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2738 return gdbarch->integer_to_address (gdbarch, type, buf);
2742 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2743 gdbarch_integer_to_address_ftype integer_to_address)
2745 gdbarch->integer_to_address = integer_to_address;
2749 gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch)
2751 gdb_assert (gdbarch != NULL);
2752 return gdbarch->deprecated_store_struct_return != NULL;
2756 gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
2758 gdb_assert (gdbarch != NULL);
2759 gdb_assert (gdbarch->deprecated_store_struct_return != NULL);
2760 if (gdbarch_debug >= 2)
2761 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n");
2762 gdbarch->deprecated_store_struct_return (addr, sp);
2766 set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch,
2767 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return)
2769 gdbarch->deprecated_store_struct_return = deprecated_store_struct_return;
2773 gdbarch_return_value_p (struct gdbarch *gdbarch)
2775 gdb_assert (gdbarch != NULL);
2776 return gdbarch->return_value != legacy_return_value;
2779 enum return_value_convention
2780 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2782 gdb_assert (gdbarch != NULL);
2783 gdb_assert (gdbarch->return_value != NULL);
2784 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2785 if (gdbarch_debug >= 2)
2786 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2787 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2791 set_gdbarch_return_value (struct gdbarch *gdbarch,
2792 gdbarch_return_value_ftype return_value)
2794 gdbarch->return_value = return_value;
2798 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
2800 gdb_assert (gdbarch != NULL);
2801 gdb_assert (gdbarch->extract_return_value != NULL);
2802 if (gdbarch_debug >= 2)
2803 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2804 gdbarch->extract_return_value (type, regcache, valbuf);
2808 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2809 gdbarch_extract_return_value_ftype extract_return_value)
2811 gdbarch->extract_return_value = extract_return_value;
2815 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
2817 gdb_assert (gdbarch != NULL);
2818 gdb_assert (gdbarch->store_return_value != NULL);
2819 if (gdbarch_debug >= 2)
2820 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2821 gdbarch->store_return_value (type, regcache, valbuf);
2825 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2826 gdbarch_store_return_value_ftype store_return_value)
2828 gdbarch->store_return_value = store_return_value;
2832 gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, gdb_byte *regbuf, gdb_byte *valbuf)
2834 gdb_assert (gdbarch != NULL);
2835 gdb_assert (gdbarch->deprecated_extract_return_value != NULL);
2836 if (gdbarch_debug >= 2)
2837 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
2838 gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
2842 set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
2843 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
2845 gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
2849 gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, gdb_byte *valbuf)
2851 gdb_assert (gdbarch != NULL);
2852 gdb_assert (gdbarch->deprecated_store_return_value != NULL);
2853 if (gdbarch_debug >= 2)
2854 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
2855 gdbarch->deprecated_store_return_value (type, valbuf);
2859 set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
2860 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
2862 gdbarch->deprecated_store_return_value = deprecated_store_return_value;
2866 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2868 gdb_assert (gdbarch != NULL);
2869 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2870 if (gdbarch_debug >= 2)
2871 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2872 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2876 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2877 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2879 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2883 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
2885 gdb_assert (gdbarch != NULL);
2886 return gdbarch->deprecated_extract_struct_value_address != NULL;
2890 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
2892 gdb_assert (gdbarch != NULL);
2893 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
2894 if (gdbarch_debug >= 2)
2895 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
2896 return gdbarch->deprecated_extract_struct_value_address (regcache);
2900 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
2901 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
2903 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
2907 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2909 gdb_assert (gdbarch != NULL);
2910 gdb_assert (gdbarch->skip_prologue != NULL);
2911 if (gdbarch_debug >= 2)
2912 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2913 return gdbarch->skip_prologue (ip);
2917 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2918 gdbarch_skip_prologue_ftype skip_prologue)
2920 gdbarch->skip_prologue = skip_prologue;
2924 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2926 gdb_assert (gdbarch != NULL);
2927 gdb_assert (gdbarch->inner_than != NULL);
2928 if (gdbarch_debug >= 2)
2929 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2930 return gdbarch->inner_than (lhs, rhs);
2934 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2935 gdbarch_inner_than_ftype inner_than)
2937 gdbarch->inner_than = inner_than;
2941 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2943 gdb_assert (gdbarch != NULL);
2944 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2945 if (gdbarch_debug >= 2)
2946 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2947 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2951 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2952 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2954 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2958 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2960 gdb_assert (gdbarch != NULL);
2961 return gdbarch->adjust_breakpoint_address != NULL;
2965 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2967 gdb_assert (gdbarch != NULL);
2968 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2969 if (gdbarch_debug >= 2)
2970 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2971 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2975 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2976 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2978 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2982 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, gdb_byte *contents_cache)
2984 gdb_assert (gdbarch != NULL);
2985 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2986 if (gdbarch_debug >= 2)
2987 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2988 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
2992 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2993 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2995 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2999 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, gdb_byte *contents_cache)
3001 gdb_assert (gdbarch != NULL);
3002 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
3003 if (gdbarch_debug >= 2)
3004 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3005 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3009 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3010 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3012 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3016 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
3018 gdb_assert (gdbarch != NULL);
3019 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
3020 if (gdbarch_debug >= 2)
3021 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3022 return gdbarch->decr_pc_after_break;
3026 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3027 CORE_ADDR decr_pc_after_break)
3029 gdbarch->decr_pc_after_break = decr_pc_after_break;
3033 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
3035 gdb_assert (gdbarch != NULL);
3036 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
3037 if (gdbarch_debug >= 2)
3038 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
3039 return gdbarch->deprecated_function_start_offset;
3043 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
3044 CORE_ADDR deprecated_function_start_offset)
3046 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
3050 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)
3052 gdb_assert (gdbarch != NULL);
3053 gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
3054 if (gdbarch_debug >= 2)
3055 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3056 gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
3060 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3061 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3063 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3067 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
3069 gdb_assert (gdbarch != NULL);
3070 return gdbarch->fetch_tls_load_module_address != NULL;
3074 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
3076 gdb_assert (gdbarch != NULL);
3077 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
3078 if (gdbarch_debug >= 2)
3079 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
3080 return gdbarch->fetch_tls_load_module_address (objfile);
3084 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
3085 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
3087 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
3091 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3093 gdb_assert (gdbarch != NULL);
3094 /* Skip verify of frame_args_skip, invalid_p == 0 */
3095 if (gdbarch_debug >= 2)
3096 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3097 return gdbarch->frame_args_skip;
3101 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3102 CORE_ADDR frame_args_skip)
3104 gdbarch->frame_args_skip = frame_args_skip;
3108 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
3110 gdb_assert (gdbarch != NULL);
3111 return gdbarch->unwind_pc != NULL;
3115 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
3117 gdb_assert (gdbarch != NULL);
3118 gdb_assert (gdbarch->unwind_pc != NULL);
3119 if (gdbarch_debug >= 2)
3120 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
3121 return gdbarch->unwind_pc (gdbarch, next_frame);
3125 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
3126 gdbarch_unwind_pc_ftype unwind_pc)
3128 gdbarch->unwind_pc = unwind_pc;
3132 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
3134 gdb_assert (gdbarch != NULL);
3135 return gdbarch->unwind_sp != NULL;
3139 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
3141 gdb_assert (gdbarch != NULL);
3142 gdb_assert (gdbarch->unwind_sp != NULL);
3143 if (gdbarch_debug >= 2)
3144 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
3145 return gdbarch->unwind_sp (gdbarch, next_frame);
3149 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
3150 gdbarch_unwind_sp_ftype unwind_sp)
3152 gdbarch->unwind_sp = unwind_sp;
3156 gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch)
3158 gdb_assert (gdbarch != NULL);
3159 return gdbarch->deprecated_saved_pc_after_call != NULL;
3163 gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
3165 gdb_assert (gdbarch != NULL);
3166 gdb_assert (gdbarch->deprecated_saved_pc_after_call != NULL);
3167 if (gdbarch_debug >= 2)
3168 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_saved_pc_after_call called\n");
3169 return gdbarch->deprecated_saved_pc_after_call (frame);
3173 set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch,
3174 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call)
3176 gdbarch->deprecated_saved_pc_after_call = deprecated_saved_pc_after_call;
3180 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
3182 gdb_assert (gdbarch != NULL);
3183 return gdbarch->frame_num_args != NULL;
3187 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3189 gdb_assert (gdbarch != NULL);
3190 gdb_assert (gdbarch->frame_num_args != NULL);
3191 if (gdbarch_debug >= 2)
3192 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3193 return gdbarch->frame_num_args (frame);
3197 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3198 gdbarch_frame_num_args_ftype frame_num_args)
3200 gdbarch->frame_num_args = frame_num_args;
3204 gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
3206 gdb_assert (gdbarch != NULL);
3207 return gdbarch->deprecated_stack_align != NULL;
3211 gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3213 gdb_assert (gdbarch != NULL);
3214 gdb_assert (gdbarch->deprecated_stack_align != NULL);
3215 if (gdbarch_debug >= 2)
3216 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
3217 return gdbarch->deprecated_stack_align (sp);
3221 set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
3222 gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
3224 gdbarch->deprecated_stack_align = deprecated_stack_align;
3228 gdbarch_frame_align_p (struct gdbarch *gdbarch)
3230 gdb_assert (gdbarch != NULL);
3231 return gdbarch->frame_align != NULL;
3235 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
3237 gdb_assert (gdbarch != NULL);
3238 gdb_assert (gdbarch->frame_align != NULL);
3239 if (gdbarch_debug >= 2)
3240 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
3241 return gdbarch->frame_align (gdbarch, address);
3245 set_gdbarch_frame_align (struct gdbarch *gdbarch,
3246 gdbarch_frame_align_ftype frame_align)
3248 gdbarch->frame_align = frame_align;
3252 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3254 gdb_assert (gdbarch != NULL);
3255 return gdbarch->deprecated_reg_struct_has_addr != NULL;
3259 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3261 gdb_assert (gdbarch != NULL);
3262 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
3263 if (gdbarch_debug >= 2)
3264 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
3265 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
3269 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
3270 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
3272 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
3276 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
3278 gdb_assert (gdbarch != NULL);
3279 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
3280 if (gdbarch_debug >= 2)
3281 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
3282 return gdbarch->stabs_argument_has_addr (gdbarch, type);
3286 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
3287 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
3289 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
3293 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
3295 gdb_assert (gdbarch != NULL);
3296 if (gdbarch_debug >= 2)
3297 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
3298 return gdbarch->frame_red_zone_size;
3302 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
3303 int frame_red_zone_size)
3305 gdbarch->frame_red_zone_size = frame_red_zone_size;
3309 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
3311 gdb_assert (gdbarch != NULL);
3312 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
3313 if (gdbarch_debug >= 2)
3314 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
3315 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
3319 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
3320 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
3322 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
3326 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
3328 gdb_assert (gdbarch != NULL);
3329 gdb_assert (gdbarch->addr_bits_remove != NULL);
3330 if (gdbarch_debug >= 2)
3331 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
3332 return gdbarch->addr_bits_remove (addr);
3336 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
3337 gdbarch_addr_bits_remove_ftype addr_bits_remove)
3339 gdbarch->addr_bits_remove = addr_bits_remove;
3343 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
3345 gdb_assert (gdbarch != NULL);
3346 gdb_assert (gdbarch->smash_text_address != NULL);
3347 if (gdbarch_debug >= 2)
3348 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
3349 return gdbarch->smash_text_address (addr);
3353 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
3354 gdbarch_smash_text_address_ftype smash_text_address)
3356 gdbarch->smash_text_address = smash_text_address;
3360 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
3362 gdb_assert (gdbarch != NULL);
3363 return gdbarch->software_single_step != NULL;
3367 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
3369 gdb_assert (gdbarch != NULL);
3370 gdb_assert (gdbarch->software_single_step != NULL);
3371 if (gdbarch_debug >= 2)
3372 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
3373 gdbarch->software_single_step (sig, insert_breakpoints_p);
3377 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
3378 gdbarch_software_single_step_ftype software_single_step)
3380 gdbarch->software_single_step = software_single_step;
3384 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
3386 gdb_assert (gdbarch != NULL);
3387 return gdbarch->single_step_through_delay != NULL;
3391 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
3393 gdb_assert (gdbarch != NULL);
3394 gdb_assert (gdbarch->single_step_through_delay != NULL);
3395 if (gdbarch_debug >= 2)
3396 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
3397 return gdbarch->single_step_through_delay (gdbarch, frame);
3401 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
3402 gdbarch_single_step_through_delay_ftype single_step_through_delay)
3404 gdbarch->single_step_through_delay = single_step_through_delay;
3408 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
3410 gdb_assert (gdbarch != NULL);
3411 gdb_assert (gdbarch->print_insn != NULL);
3412 if (gdbarch_debug >= 2)
3413 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
3414 return gdbarch->print_insn (vma, info);
3418 set_gdbarch_print_insn (struct gdbarch *gdbarch,
3419 gdbarch_print_insn_ftype print_insn)
3421 gdbarch->print_insn = print_insn;
3425 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
3427 gdb_assert (gdbarch != NULL);
3428 gdb_assert (gdbarch->skip_trampoline_code != NULL);
3429 if (gdbarch_debug >= 2)
3430 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
3431 return gdbarch->skip_trampoline_code (pc);
3435 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
3436 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
3438 gdbarch->skip_trampoline_code = skip_trampoline_code;
3442 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
3444 gdb_assert (gdbarch != NULL);
3445 gdb_assert (gdbarch->skip_solib_resolver != NULL);
3446 if (gdbarch_debug >= 2)
3447 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
3448 return gdbarch->skip_solib_resolver (gdbarch, pc);
3452 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
3453 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
3455 gdbarch->skip_solib_resolver = skip_solib_resolver;
3459 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3461 gdb_assert (gdbarch != NULL);
3462 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
3463 if (gdbarch_debug >= 2)
3464 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
3465 return gdbarch->in_solib_return_trampoline (pc, name);
3469 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3470 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3472 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3476 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3478 gdb_assert (gdbarch != NULL);
3479 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
3480 if (gdbarch_debug >= 2)
3481 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3482 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3486 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3487 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3489 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3493 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
3495 gdb_assert (gdbarch != NULL);
3496 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
3497 if (gdbarch_debug >= 2)
3498 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
3499 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
3503 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
3504 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
3506 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
3510 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3512 gdb_assert (gdbarch != NULL);
3513 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
3514 if (gdbarch_debug >= 2)
3515 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3516 gdbarch->elf_make_msymbol_special (sym, msym);
3520 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
3521 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
3523 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
3527 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
3529 gdb_assert (gdbarch != NULL);
3530 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
3531 if (gdbarch_debug >= 2)
3532 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
3533 gdbarch->coff_make_msymbol_special (val, msym);
3537 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
3538 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
3540 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
3544 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
3546 gdb_assert (gdbarch != NULL);
3547 /* Skip verify of name_of_malloc, invalid_p == 0 */
3548 if (gdbarch_debug >= 2)
3549 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
3550 return gdbarch->name_of_malloc;
3554 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
3555 const char * name_of_malloc)
3557 gdbarch->name_of_malloc = name_of_malloc;
3561 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
3563 gdb_assert (gdbarch != NULL);
3564 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3565 if (gdbarch_debug >= 2)
3566 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
3567 return gdbarch->cannot_step_breakpoint;
3571 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
3572 int cannot_step_breakpoint)
3574 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
3578 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
3580 gdb_assert (gdbarch != NULL);
3581 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3582 if (gdbarch_debug >= 2)
3583 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
3584 return gdbarch->have_nonsteppable_watchpoint;
3588 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
3589 int have_nonsteppable_watchpoint)
3591 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
3595 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
3597 gdb_assert (gdbarch != NULL);
3598 return gdbarch->address_class_type_flags != NULL;
3602 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
3604 gdb_assert (gdbarch != NULL);
3605 gdb_assert (gdbarch->address_class_type_flags != NULL);
3606 if (gdbarch_debug >= 2)
3607 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
3608 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
3612 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
3613 gdbarch_address_class_type_flags_ftype address_class_type_flags)
3615 gdbarch->address_class_type_flags = address_class_type_flags;
3619 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
3621 gdb_assert (gdbarch != NULL);
3622 return gdbarch->address_class_type_flags_to_name != NULL;
3626 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
3628 gdb_assert (gdbarch != NULL);
3629 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
3630 if (gdbarch_debug >= 2)
3631 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
3632 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
3636 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
3637 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
3639 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3643 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3645 gdb_assert (gdbarch != NULL);
3646 return gdbarch->address_class_name_to_type_flags != NULL;
3650 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
3652 gdb_assert (gdbarch != NULL);
3653 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
3654 if (gdbarch_debug >= 2)
3655 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
3656 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
3660 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3661 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3663 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3667 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3669 gdb_assert (gdbarch != NULL);
3670 gdb_assert (gdbarch->register_reggroup_p != NULL);
3671 if (gdbarch_debug >= 2)
3672 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3673 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3677 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3678 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3680 gdbarch->register_reggroup_p = register_reggroup_p;
3684 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3686 gdb_assert (gdbarch != NULL);
3687 return gdbarch->fetch_pointer_argument != NULL;
3691 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3693 gdb_assert (gdbarch != NULL);
3694 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3695 if (gdbarch_debug >= 2)
3696 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3697 return gdbarch->fetch_pointer_argument (frame, argi, type);
3701 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3702 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3704 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3708 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3710 gdb_assert (gdbarch != NULL);
3711 return gdbarch->regset_from_core_section != NULL;
3714 const struct regset *
3715 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3717 gdb_assert (gdbarch != NULL);
3718 gdb_assert (gdbarch->regset_from_core_section != NULL);
3719 if (gdbarch_debug >= 2)
3720 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3721 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3725 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3726 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3728 gdbarch->regset_from_core_section = regset_from_core_section;
3732 /* Keep a registry of per-architecture data-pointers required by GDB
3739 gdbarch_data_pre_init_ftype *pre_init;
3740 gdbarch_data_post_init_ftype *post_init;
3743 struct gdbarch_data_registration
3745 struct gdbarch_data *data;
3746 struct gdbarch_data_registration *next;
3749 struct gdbarch_data_registry
3752 struct gdbarch_data_registration *registrations;
3755 struct gdbarch_data_registry gdbarch_data_registry =
3760 static struct gdbarch_data *
3761 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3762 gdbarch_data_post_init_ftype *post_init)
3764 struct gdbarch_data_registration **curr;
3765 /* Append the new registraration. */
3766 for (curr = &gdbarch_data_registry.registrations;
3768 curr = &(*curr)->next);
3769 (*curr) = XMALLOC (struct gdbarch_data_registration);
3770 (*curr)->next = NULL;
3771 (*curr)->data = XMALLOC (struct gdbarch_data);
3772 (*curr)->data->index = gdbarch_data_registry.nr++;
3773 (*curr)->data->pre_init = pre_init;
3774 (*curr)->data->post_init = post_init;
3775 (*curr)->data->init_p = 1;
3776 return (*curr)->data;
3779 struct gdbarch_data *
3780 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3782 return gdbarch_data_register (pre_init, NULL);
3785 struct gdbarch_data *
3786 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3788 return gdbarch_data_register (NULL, post_init);
3791 /* Create/delete the gdbarch data vector. */
3794 alloc_gdbarch_data (struct gdbarch *gdbarch)
3796 gdb_assert (gdbarch->data == NULL);
3797 gdbarch->nr_data = gdbarch_data_registry.nr;
3798 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3801 /* Initialize the current value of the specified per-architecture
3805 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3806 struct gdbarch_data *data,
3809 gdb_assert (data->index < gdbarch->nr_data);
3810 gdb_assert (gdbarch->data[data->index] == NULL);
3811 gdb_assert (data->pre_init == NULL);
3812 gdbarch->data[data->index] = pointer;
3815 /* Return the current value of the specified per-architecture
3819 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3821 gdb_assert (data->index < gdbarch->nr_data);
3822 if (gdbarch->data[data->index] == NULL)
3824 /* The data-pointer isn't initialized, call init() to get a
3826 if (data->pre_init != NULL)
3827 /* Mid architecture creation: pass just the obstack, and not
3828 the entire architecture, as that way it isn't possible for
3829 pre-init code to refer to undefined architecture
3831 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3832 else if (gdbarch->initialized_p
3833 && data->post_init != NULL)
3834 /* Post architecture creation: pass the entire architecture
3835 (as all fields are valid), but be careful to also detect
3836 recursive references. */
3838 gdb_assert (data->init_p);
3840 gdbarch->data[data->index] = data->post_init (gdbarch);
3844 /* The architecture initialization hasn't completed - punt -
3845 hope that the caller knows what they are doing. Once
3846 deprecated_set_gdbarch_data has been initialized, this can be
3847 changed to an internal error. */
3849 gdb_assert (gdbarch->data[data->index] != NULL);
3851 return gdbarch->data[data->index];
3856 /* Keep a registry of swapped data required by GDB modules. */
3861 struct gdbarch_swap_registration *source;
3862 struct gdbarch_swap *next;
3865 struct gdbarch_swap_registration
3868 unsigned long sizeof_data;
3869 gdbarch_swap_ftype *init;
3870 struct gdbarch_swap_registration *next;
3873 struct gdbarch_swap_registry
3876 struct gdbarch_swap_registration *registrations;
3879 struct gdbarch_swap_registry gdbarch_swap_registry =
3885 deprecated_register_gdbarch_swap (void *data,
3886 unsigned long sizeof_data,
3887 gdbarch_swap_ftype *init)
3889 struct gdbarch_swap_registration **rego;
3890 for (rego = &gdbarch_swap_registry.registrations;
3892 rego = &(*rego)->next);
3893 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3894 (*rego)->next = NULL;
3895 (*rego)->init = init;
3896 (*rego)->data = data;
3897 (*rego)->sizeof_data = sizeof_data;
3901 current_gdbarch_swap_init_hack (void)
3903 struct gdbarch_swap_registration *rego;
3904 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3905 for (rego = gdbarch_swap_registry.registrations;
3909 if (rego->data != NULL)
3911 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3912 struct gdbarch_swap);
3913 (*curr)->source = rego;
3914 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3916 (*curr)->next = NULL;
3917 curr = &(*curr)->next;
3919 if (rego->init != NULL)
3924 static struct gdbarch *
3925 current_gdbarch_swap_out_hack (void)
3927 struct gdbarch *old_gdbarch = current_gdbarch;
3928 struct gdbarch_swap *curr;
3930 gdb_assert (old_gdbarch != NULL);
3931 for (curr = old_gdbarch->swap;
3935 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3936 memset (curr->source->data, 0, curr->source->sizeof_data);
3938 current_gdbarch = NULL;
3943 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3945 struct gdbarch_swap *curr;
3947 gdb_assert (current_gdbarch == NULL);
3948 for (curr = new_gdbarch->swap;
3951 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3952 current_gdbarch = new_gdbarch;
3956 /* Keep a registry of the architectures known by GDB. */
3958 struct gdbarch_registration
3960 enum bfd_architecture bfd_architecture;
3961 gdbarch_init_ftype *init;
3962 gdbarch_dump_tdep_ftype *dump_tdep;
3963 struct gdbarch_list *arches;
3964 struct gdbarch_registration *next;
3967 static struct gdbarch_registration *gdbarch_registry = NULL;
3970 append_name (const char ***buf, int *nr, const char *name)
3972 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3978 gdbarch_printable_names (void)
3980 /* Accumulate a list of names based on the registed list of
3982 enum bfd_architecture a;
3984 const char **arches = NULL;
3985 struct gdbarch_registration *rego;
3986 for (rego = gdbarch_registry;
3990 const struct bfd_arch_info *ap;
3991 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3993 internal_error (__FILE__, __LINE__,
3994 _("gdbarch_architecture_names: multi-arch unknown"));
3997 append_name (&arches, &nr_arches, ap->printable_name);
4002 append_name (&arches, &nr_arches, NULL);
4008 gdbarch_register (enum bfd_architecture bfd_architecture,
4009 gdbarch_init_ftype *init,
4010 gdbarch_dump_tdep_ftype *dump_tdep)
4012 struct gdbarch_registration **curr;
4013 const struct bfd_arch_info *bfd_arch_info;
4014 /* Check that BFD recognizes this architecture */
4015 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4016 if (bfd_arch_info == NULL)
4018 internal_error (__FILE__, __LINE__,
4019 _("gdbarch: Attempt to register unknown architecture (%d)"),
4022 /* Check that we haven't seen this architecture before */
4023 for (curr = &gdbarch_registry;
4025 curr = &(*curr)->next)
4027 if (bfd_architecture == (*curr)->bfd_architecture)
4028 internal_error (__FILE__, __LINE__,
4029 _("gdbarch: Duplicate registraration of architecture (%s)"),
4030 bfd_arch_info->printable_name);
4034 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
4035 bfd_arch_info->printable_name,
4038 (*curr) = XMALLOC (struct gdbarch_registration);
4039 (*curr)->bfd_architecture = bfd_architecture;
4040 (*curr)->init = init;
4041 (*curr)->dump_tdep = dump_tdep;
4042 (*curr)->arches = NULL;
4043 (*curr)->next = NULL;
4047 register_gdbarch_init (enum bfd_architecture bfd_architecture,
4048 gdbarch_init_ftype *init)
4050 gdbarch_register (bfd_architecture, init, NULL);
4054 /* Look for an architecture using gdbarch_info. Base search on only
4055 BFD_ARCH_INFO and BYTE_ORDER. */
4057 struct gdbarch_list *
4058 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4059 const struct gdbarch_info *info)
4061 for (; arches != NULL; arches = arches->next)
4063 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4065 if (info->byte_order != arches->gdbarch->byte_order)
4067 if (info->osabi != arches->gdbarch->osabi)
4075 /* Find an architecture that matches the specified INFO. Create a new
4076 architecture if needed. Return that new architecture. Assumes
4077 that there is no current architecture. */
4079 static struct gdbarch *
4080 find_arch_by_info (struct gdbarch *old_gdbarch, struct gdbarch_info info)
4082 struct gdbarch *new_gdbarch;
4083 struct gdbarch_registration *rego;
4085 /* The existing architecture has been swapped out - all this code
4086 works from a clean slate. */
4087 gdb_assert (current_gdbarch == NULL);
4089 /* Fill in missing parts of the INFO struct using a number of
4090 sources: "set ..."; INFOabfd supplied; and the existing
4092 gdbarch_info_fill (old_gdbarch, &info);
4094 /* Must have found some sort of architecture. */
4095 gdb_assert (info.bfd_arch_info != NULL);
4099 fprintf_unfiltered (gdb_stdlog,
4100 "find_arch_by_info: info.bfd_arch_info %s\n",
4101 (info.bfd_arch_info != NULL
4102 ? info.bfd_arch_info->printable_name
4104 fprintf_unfiltered (gdb_stdlog,
4105 "find_arch_by_info: info.byte_order %d (%s)\n",
4107 (info.byte_order == BFD_ENDIAN_BIG ? "big"
4108 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
4110 fprintf_unfiltered (gdb_stdlog,
4111 "find_arch_by_info: info.osabi %d (%s)\n",
4112 info.osabi, gdbarch_osabi_name (info.osabi));
4113 fprintf_unfiltered (gdb_stdlog,
4114 "find_arch_by_info: info.abfd 0x%lx\n",
4116 fprintf_unfiltered (gdb_stdlog,
4117 "find_arch_by_info: info.tdep_info 0x%lx\n",
4118 (long) info.tdep_info);
4121 /* Find the tdep code that knows about this architecture. */
4122 for (rego = gdbarch_registry;
4125 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4130 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4131 "No matching architecture\n");
4135 /* Ask the tdep code for an architecture that matches "info". */
4136 new_gdbarch = rego->init (info, rego->arches);
4138 /* Did the tdep code like it? No. Reject the change and revert to
4139 the old architecture. */
4140 if (new_gdbarch == NULL)
4143 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4144 "Target rejected architecture\n");
4148 /* Is this a pre-existing architecture (as determined by already
4149 being initialized)? Move it to the front of the architecture
4150 list (keeping the list sorted Most Recently Used). */
4151 if (new_gdbarch->initialized_p)
4153 struct gdbarch_list **list;
4154 struct gdbarch_list *this;
4156 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4157 "Previous architecture 0x%08lx (%s) selected\n",
4159 new_gdbarch->bfd_arch_info->printable_name);
4160 /* Find the existing arch in the list. */
4161 for (list = ®o->arches;
4162 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4163 list = &(*list)->next);
4164 /* It had better be in the list of architectures. */
4165 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4168 (*list) = this->next;
4169 /* Insert THIS at the front. */
4170 this->next = rego->arches;
4171 rego->arches = this;
4176 /* It's a new architecture. */
4178 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4179 "New architecture 0x%08lx (%s) selected\n",
4181 new_gdbarch->bfd_arch_info->printable_name);
4183 /* Insert the new architecture into the front of the architecture
4184 list (keep the list sorted Most Recently Used). */
4186 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4187 this->next = rego->arches;
4188 this->gdbarch = new_gdbarch;
4189 rego->arches = this;
4192 /* Check that the newly installed architecture is valid. Plug in
4193 any post init values. */
4194 new_gdbarch->dump_tdep = rego->dump_tdep;
4195 verify_gdbarch (new_gdbarch);
4196 new_gdbarch->initialized_p = 1;
4198 /* Initialize any per-architecture swap areas. This phase requires
4199 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4200 swap the entire architecture out. */
4201 current_gdbarch = new_gdbarch;
4202 current_gdbarch_swap_init_hack ();
4203 current_gdbarch_swap_out_hack ();
4206 gdbarch_dump (new_gdbarch, gdb_stdlog);
4212 gdbarch_find_by_info (struct gdbarch_info info)
4214 /* Save the previously selected architecture, setting the global to
4215 NULL. This stops things like gdbarch->init() trying to use the
4216 previous architecture's configuration. The previous architecture
4217 may not even be of the same architecture family. The most recent
4218 architecture of the same family is found at the head of the
4219 rego->arches list. */
4220 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
4222 /* Find the specified architecture. */
4223 struct gdbarch *new_gdbarch = find_arch_by_info (old_gdbarch, info);
4225 /* Restore the existing architecture. */
4226 gdb_assert (current_gdbarch == NULL);
4227 current_gdbarch_swap_in_hack (old_gdbarch);
4232 /* Make the specified architecture current, swapping the existing one
4236 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
4238 gdb_assert (new_gdbarch != NULL);
4239 gdb_assert (current_gdbarch != NULL);
4240 gdb_assert (new_gdbarch->initialized_p);
4241 current_gdbarch_swap_out_hack ();
4242 current_gdbarch_swap_in_hack (new_gdbarch);
4243 architecture_changed_event ();
4244 flush_cached_frames ();
4247 extern void _initialize_gdbarch (void);
4250 _initialize_gdbarch (void)
4252 struct cmd_list_element *c;
4254 add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
4255 Set architecture debugging."), _("\
4256 Show architecture debugging."), _("\
4257 When non-zero, architecture debugging is enabled."),
4260 &setdebuglist, &showdebuglist);