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 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;
66 /* Maintain the struct gdbarch object */
70 /* Has this architecture been fully initialized? */
73 /* An obstack bound to the lifetime of the architecture. */
74 struct obstack *obstack;
76 /* basic architectural information */
77 const struct bfd_arch_info * bfd_arch_info;
81 /* target specific vector. */
82 struct gdbarch_tdep *tdep;
83 gdbarch_dump_tdep_ftype *dump_tdep;
85 /* per-architecture data-pointers */
89 /* per-architecture swap-regions */
90 struct gdbarch_swap *swap;
94 When extending this structure you must:
98 Declare set/get functions and define the corresponding
101 gdbarch_alloc(): If zero/NULL is not a suitable default,
102 initialize the new field.
104 verify_gdbarch(): Confirm that the target updated the field
107 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
110 ``startup_gdbarch()'': Append an initial value to the static
111 variable (base values on the host's c-type system).
113 get_gdbarch(): Implement the set/get functions (probably using
114 the macro's as shortcuts).
129 gdbarch_read_pc_ftype *read_pc;
130 gdbarch_write_pc_ftype *write_pc;
131 gdbarch_read_sp_ftype *read_sp;
132 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
133 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
134 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
141 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
142 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
143 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
144 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
145 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
146 gdbarch_register_name_ftype *register_name;
147 gdbarch_register_type_ftype *register_type;
148 gdbarch_deprecated_register_byte_ftype *deprecated_register_byte;
149 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
150 int deprecated_fp_regnum;
151 gdbarch_push_dummy_call_ftype *push_dummy_call;
152 gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments;
153 int deprecated_register_size;
154 int call_dummy_location;
155 gdbarch_push_dummy_code_ftype *push_dummy_code;
156 gdbarch_print_registers_info_ftype *print_registers_info;
157 gdbarch_print_float_info_ftype *print_float_info;
158 gdbarch_print_vector_info_ftype *print_vector_info;
159 gdbarch_register_sim_regno_ftype *register_sim_regno;
160 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
161 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
162 gdbarch_cannot_store_register_ftype *cannot_store_register;
163 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
164 int believe_pcc_promotion;
165 gdbarch_convert_register_p_ftype *convert_register_p;
166 gdbarch_register_to_value_ftype *register_to_value;
167 gdbarch_value_to_register_ftype *value_to_register;
168 gdbarch_pointer_to_address_ftype *pointer_to_address;
169 gdbarch_address_to_pointer_ftype *address_to_pointer;
170 gdbarch_integer_to_address_ftype *integer_to_address;
171 gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return;
172 gdbarch_return_value_ftype *return_value;
173 gdbarch_extract_return_value_ftype *extract_return_value;
174 gdbarch_store_return_value_ftype *store_return_value;
175 gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
176 gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
177 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
178 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
179 gdbarch_skip_prologue_ftype *skip_prologue;
180 gdbarch_inner_than_ftype *inner_than;
181 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
182 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
183 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
184 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
185 CORE_ADDR decr_pc_after_break;
186 CORE_ADDR deprecated_function_start_offset;
187 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
188 CORE_ADDR frame_args_skip;
189 gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc;
190 gdbarch_unwind_pc_ftype *unwind_pc;
191 gdbarch_unwind_sp_ftype *unwind_sp;
192 gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call;
193 gdbarch_frame_num_args_ftype *frame_num_args;
194 gdbarch_deprecated_stack_align_ftype *deprecated_stack_align;
195 gdbarch_frame_align_ftype *frame_align;
196 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
197 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
198 int frame_red_zone_size;
199 const struct floatformat * float_format;
200 const struct floatformat * double_format;
201 const struct floatformat * long_double_format;
202 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
203 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
204 gdbarch_smash_text_address_ftype *smash_text_address;
205 gdbarch_software_single_step_ftype *software_single_step;
206 gdbarch_print_insn_ftype *print_insn;
207 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
208 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
209 gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
210 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
211 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
212 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
213 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
214 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
215 const char * name_of_malloc;
216 int cannot_step_breakpoint;
217 int have_nonsteppable_watchpoint;
218 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
219 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
220 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
221 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
222 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
223 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
227 /* The default architecture uses host values (for want of a better
230 extern const struct bfd_arch_info bfd_default_arch_struct;
232 struct gdbarch startup_gdbarch =
234 1, /* Always initialized. */
235 NULL, /* The obstack. */
236 /* basic architecture information */
237 &bfd_default_arch_struct, /* bfd_arch_info */
238 BFD_ENDIAN_BIG, /* byte_order */
239 GDB_OSABI_UNKNOWN, /* osabi */
240 /* target specific vector and its dump routine */
242 /*per-architecture data-pointers and swap regions */
244 /* Multi-arch values */
245 8 * sizeof (short), /* short_bit */
246 8 * sizeof (int), /* int_bit */
247 8 * sizeof (long), /* long_bit */
248 8 * sizeof (LONGEST), /* long_long_bit */
249 8 * sizeof (float), /* float_bit */
250 8 * sizeof (double), /* double_bit */
251 8 * sizeof (long double), /* long_double_bit */
252 8 * sizeof (void*), /* ptr_bit */
253 8 * sizeof (void*), /* addr_bit */
254 8 * sizeof (void*), /* bfd_vma_bit */
259 0, /* virtual_frame_pointer */
260 0, /* pseudo_register_read */
261 0, /* pseudo_register_write */
263 0, /* num_pseudo_regs */
268 0, /* stab_reg_to_regnum */
269 0, /* ecoff_reg_to_regnum */
270 0, /* dwarf_reg_to_regnum */
271 0, /* sdb_reg_to_regnum */
272 0, /* dwarf2_reg_to_regnum */
273 0, /* register_name */
274 0, /* register_type */
275 generic_register_byte, /* deprecated_register_byte */
276 0, /* unwind_dummy_id */
277 -1, /* deprecated_fp_regnum */
278 0, /* push_dummy_call */
279 0, /* deprecated_push_arguments */
280 0, /* deprecated_register_size */
281 0, /* call_dummy_location */
282 0, /* push_dummy_code */
283 default_print_registers_info, /* print_registers_info */
284 0, /* print_float_info */
285 0, /* print_vector_info */
286 0, /* register_sim_regno */
287 0, /* register_bytes_ok */
288 0, /* cannot_fetch_register */
289 0, /* cannot_store_register */
290 0, /* get_longjmp_target */
291 0, /* believe_pcc_promotion */
292 0, /* convert_register_p */
293 0, /* register_to_value */
294 0, /* value_to_register */
295 0, /* pointer_to_address */
296 0, /* address_to_pointer */
297 0, /* integer_to_address */
298 0, /* deprecated_store_struct_return */
299 0, /* return_value */
300 0, /* extract_return_value */
301 0, /* store_return_value */
302 0, /* deprecated_extract_return_value */
303 0, /* deprecated_store_return_value */
304 0, /* deprecated_use_struct_convention */
305 0, /* deprecated_extract_struct_value_address */
306 0, /* skip_prologue */
308 0, /* breakpoint_from_pc */
309 0, /* adjust_breakpoint_address */
310 0, /* memory_insert_breakpoint */
311 0, /* memory_remove_breakpoint */
312 0, /* decr_pc_after_break */
313 0, /* deprecated_function_start_offset */
314 generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
315 0, /* frame_args_skip */
316 0, /* deprecated_frame_saved_pc */
319 0, /* deprecated_saved_pc_after_call */
320 0, /* frame_num_args */
321 0, /* deprecated_stack_align */
323 0, /* deprecated_reg_struct_has_addr */
324 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
325 0, /* frame_red_zone_size */
326 0, /* float_format */
327 0, /* double_format */
328 0, /* long_double_format */
329 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
330 0, /* addr_bits_remove */
331 0, /* smash_text_address */
332 0, /* software_single_step */
334 0, /* skip_trampoline_code */
335 generic_skip_solib_resolver, /* skip_solib_resolver */
336 0, /* in_solib_call_trampoline */
337 0, /* in_solib_return_trampoline */
338 generic_in_function_epilogue_p, /* in_function_epilogue_p */
339 construct_inferior_arguments, /* construct_inferior_arguments */
340 0, /* elf_make_msymbol_special */
341 0, /* coff_make_msymbol_special */
342 "malloc", /* name_of_malloc */
343 0, /* cannot_step_breakpoint */
344 0, /* have_nonsteppable_watchpoint */
345 0, /* address_class_type_flags */
346 0, /* address_class_type_flags_to_name */
347 0, /* address_class_name_to_type_flags */
348 default_register_reggroup_p, /* register_reggroup_p */
349 0, /* fetch_pointer_argument */
350 0, /* regset_from_core_section */
351 /* startup_gdbarch() */
354 struct gdbarch *current_gdbarch = &startup_gdbarch;
356 /* Create a new ``struct gdbarch'' based on information provided by
357 ``struct gdbarch_info''. */
360 gdbarch_alloc (const struct gdbarch_info *info,
361 struct gdbarch_tdep *tdep)
363 /* NOTE: The new architecture variable is named ``current_gdbarch''
364 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
365 the current local architecture and not the previous global
366 architecture. This ensures that the new architectures initial
367 values are not influenced by the previous architecture. Once
368 everything is parameterised with gdbarch, this will go away. */
369 struct gdbarch *current_gdbarch;
371 /* Create an obstack for allocating all the per-architecture memory,
372 then use that to allocate the architecture vector. */
373 struct obstack *obstack = XMALLOC (struct obstack);
374 obstack_init (obstack);
375 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
376 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
377 current_gdbarch->obstack = obstack;
379 alloc_gdbarch_data (current_gdbarch);
381 current_gdbarch->tdep = tdep;
383 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
384 current_gdbarch->byte_order = info->byte_order;
385 current_gdbarch->osabi = info->osabi;
387 /* Force the explicit initialization of these. */
388 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
389 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
390 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
391 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
392 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
393 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
394 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
395 current_gdbarch->ptr_bit = TARGET_INT_BIT;
396 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
397 current_gdbarch->char_signed = -1;
398 current_gdbarch->write_pc = generic_target_write_pc;
399 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
400 current_gdbarch->num_regs = -1;
401 current_gdbarch->sp_regnum = -1;
402 current_gdbarch->pc_regnum = -1;
403 current_gdbarch->ps_regnum = -1;
404 current_gdbarch->fp0_regnum = -1;
405 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
406 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
407 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
408 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
409 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
410 current_gdbarch->deprecated_register_byte = generic_register_byte;
411 current_gdbarch->deprecated_fp_regnum = -1;
412 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
413 current_gdbarch->print_registers_info = default_print_registers_info;
414 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
415 current_gdbarch->cannot_fetch_register = cannot_register_not;
416 current_gdbarch->cannot_store_register = cannot_register_not;
417 current_gdbarch->convert_register_p = generic_convert_register_p;
418 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
419 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
420 current_gdbarch->return_value = legacy_return_value;
421 current_gdbarch->extract_return_value = legacy_extract_return_value;
422 current_gdbarch->store_return_value = legacy_store_return_value;
423 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
424 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
425 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
426 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
427 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
428 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
429 current_gdbarch->addr_bits_remove = core_addr_identity;
430 current_gdbarch->smash_text_address = core_addr_identity;
431 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
432 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
433 current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
434 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
435 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
436 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
437 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
438 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
439 current_gdbarch->name_of_malloc = "malloc";
440 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
441 /* gdbarch_alloc() */
443 return current_gdbarch;
447 /* Allocate extra space using the per-architecture obstack. */
450 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
452 void *data = obstack_alloc (arch->obstack, size);
453 memset (data, 0, size);
458 /* Free a gdbarch struct. This should never happen in normal
459 operation --- once you've created a gdbarch, you keep it around.
460 However, if an architecture's init function encounters an error
461 building the structure, it may need to clean up a partially
462 constructed gdbarch. */
465 gdbarch_free (struct gdbarch *arch)
467 struct obstack *obstack;
468 gdb_assert (arch != NULL);
469 gdb_assert (!arch->initialized_p);
470 obstack = arch->obstack;
471 obstack_free (obstack, 0); /* Includes the ARCH. */
476 /* Ensure that all values in a GDBARCH are reasonable. */
478 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
479 just happens to match the global variable ``current_gdbarch''. That
480 way macros refering to that variable get the local and not the global
481 version - ulgh. Once everything is parameterised with gdbarch, this
485 verify_gdbarch (struct gdbarch *current_gdbarch)
488 struct cleanup *cleanups;
491 log = mem_fileopen ();
492 cleanups = make_cleanup_ui_file_delete (log);
494 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
495 fprintf_unfiltered (log, "\n\tbyte-order");
496 if (current_gdbarch->bfd_arch_info == NULL)
497 fprintf_unfiltered (log, "\n\tbfd_arch_info");
498 /* Check those that need to be defined for the given multi-arch level. */
499 /* Skip verify of short_bit, invalid_p == 0 */
500 /* Skip verify of int_bit, invalid_p == 0 */
501 /* Skip verify of long_bit, invalid_p == 0 */
502 /* Skip verify of long_long_bit, invalid_p == 0 */
503 /* Skip verify of float_bit, invalid_p == 0 */
504 /* Skip verify of double_bit, invalid_p == 0 */
505 /* Skip verify of long_double_bit, invalid_p == 0 */
506 /* Skip verify of ptr_bit, invalid_p == 0 */
507 if (current_gdbarch->addr_bit == 0)
508 current_gdbarch->addr_bit = TARGET_PTR_BIT;
509 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
510 if (current_gdbarch->char_signed == -1)
511 current_gdbarch->char_signed = 1;
512 /* Skip verify of read_pc, has predicate */
513 /* Skip verify of write_pc, invalid_p == 0 */
514 /* Skip verify of read_sp, has predicate */
515 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
516 /* Skip verify of pseudo_register_read, has predicate */
517 /* Skip verify of pseudo_register_write, has predicate */
518 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
519 && (current_gdbarch->num_regs == -1))
520 fprintf_unfiltered (log, "\n\tnum_regs");
521 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
522 /* Skip verify of sp_regnum, invalid_p == 0 */
523 /* Skip verify of pc_regnum, invalid_p == 0 */
524 /* Skip verify of ps_regnum, invalid_p == 0 */
525 /* Skip verify of fp0_regnum, invalid_p == 0 */
526 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
527 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
528 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
529 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
530 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
531 /* Skip verify of register_type, has predicate */
532 /* Skip verify of deprecated_register_byte, has predicate */
533 /* Skip verify of unwind_dummy_id, has predicate */
534 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
535 /* Skip verify of push_dummy_call, has predicate */
536 /* Skip verify of deprecated_push_arguments, has predicate */
537 /* Skip verify of call_dummy_location, invalid_p == 0 */
538 /* Skip verify of push_dummy_code, has predicate */
539 /* Skip verify of print_registers_info, invalid_p == 0 */
540 /* Skip verify of print_float_info, has predicate */
541 /* Skip verify of print_vector_info, has predicate */
542 /* Skip verify of register_sim_regno, invalid_p == 0 */
543 /* Skip verify of register_bytes_ok, has predicate */
544 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
545 /* Skip verify of cannot_store_register, invalid_p == 0 */
546 /* Skip verify of get_longjmp_target, has predicate */
547 /* Skip verify of convert_register_p, invalid_p == 0 */
548 /* Skip verify of pointer_to_address, invalid_p == 0 */
549 /* Skip verify of address_to_pointer, invalid_p == 0 */
550 /* Skip verify of integer_to_address, has predicate */
551 /* Skip verify of deprecated_store_struct_return, has predicate */
552 /* Skip verify of return_value, has predicate */
553 /* Skip verify of extract_return_value, invalid_p == 0 */
554 /* Skip verify of store_return_value, invalid_p == 0 */
555 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
556 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
557 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
558 && (current_gdbarch->skip_prologue == 0))
559 fprintf_unfiltered (log, "\n\tskip_prologue");
560 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
561 && (current_gdbarch->inner_than == 0))
562 fprintf_unfiltered (log, "\n\tinner_than");
563 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
564 && (current_gdbarch->breakpoint_from_pc == 0))
565 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
566 /* Skip verify of adjust_breakpoint_address, has predicate */
567 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
568 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
569 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
570 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
571 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
572 /* Skip verify of frame_args_skip, invalid_p == 0 */
573 /* Skip verify of deprecated_frame_saved_pc, has predicate */
574 /* Skip verify of unwind_pc, has predicate */
575 /* Skip verify of unwind_sp, has predicate */
576 /* Skip verify of deprecated_saved_pc_after_call, has predicate */
577 /* Skip verify of frame_num_args, has predicate */
578 /* Skip verify of deprecated_stack_align, has predicate */
579 /* Skip verify of frame_align, has predicate */
580 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
581 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
582 if (current_gdbarch->float_format == 0)
583 current_gdbarch->float_format = default_float_format (current_gdbarch);
584 if (current_gdbarch->double_format == 0)
585 current_gdbarch->double_format = default_double_format (current_gdbarch);
586 if (current_gdbarch->long_double_format == 0)
587 current_gdbarch->long_double_format = default_double_format (current_gdbarch);
588 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
589 /* Skip verify of addr_bits_remove, invalid_p == 0 */
590 /* Skip verify of smash_text_address, invalid_p == 0 */
591 /* Skip verify of software_single_step, has predicate */
592 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
593 && (current_gdbarch->print_insn == 0))
594 fprintf_unfiltered (log, "\n\tprint_insn");
595 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
596 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
597 /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
598 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
599 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
600 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
601 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
602 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
603 /* Skip verify of name_of_malloc, invalid_p == 0 */
604 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
605 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
606 /* Skip verify of address_class_type_flags, has predicate */
607 /* Skip verify of address_class_type_flags_to_name, has predicate */
608 /* Skip verify of address_class_name_to_type_flags, has predicate */
609 /* Skip verify of register_reggroup_p, invalid_p == 0 */
610 /* Skip verify of fetch_pointer_argument, has predicate */
611 /* Skip verify of regset_from_core_section, has predicate */
612 buf = ui_file_xstrdup (log, &dummy);
613 make_cleanup (xfree, buf);
614 if (strlen (buf) > 0)
615 internal_error (__FILE__, __LINE__,
616 "verify_gdbarch: the following are invalid ...%s",
618 do_cleanups (cleanups);
622 /* Print out the details of the current architecture. */
624 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
625 just happens to match the global variable ``current_gdbarch''. That
626 way macros refering to that variable get the local and not the global
627 version - ulgh. Once everything is parameterised with gdbarch, this
631 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
633 fprintf_unfiltered (file,
634 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
636 #ifdef TARGET_ADDR_BIT
637 fprintf_unfiltered (file,
638 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
639 XSTRING (TARGET_ADDR_BIT));
641 fprintf_unfiltered (file,
642 "gdbarch_dump: addr_bit = %s\n",
643 paddr_d (current_gdbarch->addr_bit));
644 #ifdef ADDR_BITS_REMOVE
645 fprintf_unfiltered (file,
646 "gdbarch_dump: %s # %s\n",
647 "ADDR_BITS_REMOVE(addr)",
648 XSTRING (ADDR_BITS_REMOVE (addr)));
650 fprintf_unfiltered (file,
651 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
652 (long) current_gdbarch->addr_bits_remove);
653 fprintf_unfiltered (file,
654 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
655 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
656 fprintf_unfiltered (file,
657 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
658 (long) current_gdbarch->address_class_name_to_type_flags);
659 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
660 fprintf_unfiltered (file,
661 "gdbarch_dump: %s # %s\n",
662 "ADDRESS_CLASS_TYPE_FLAGS_P()",
663 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
665 fprintf_unfiltered (file,
666 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
667 gdbarch_address_class_type_flags_p (current_gdbarch));
668 #ifdef ADDRESS_CLASS_TYPE_FLAGS
669 fprintf_unfiltered (file,
670 "gdbarch_dump: %s # %s\n",
671 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
672 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
674 fprintf_unfiltered (file,
675 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
676 (long) current_gdbarch->address_class_type_flags);
677 fprintf_unfiltered (file,
678 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
679 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
680 fprintf_unfiltered (file,
681 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
682 (long) current_gdbarch->address_class_type_flags_to_name);
683 #ifdef ADDRESS_TO_POINTER
684 fprintf_unfiltered (file,
685 "gdbarch_dump: %s # %s\n",
686 "ADDRESS_TO_POINTER(type, buf, addr)",
687 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
689 fprintf_unfiltered (file,
690 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
691 (long) current_gdbarch->address_to_pointer);
692 fprintf_unfiltered (file,
693 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
694 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
695 fprintf_unfiltered (file,
696 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
697 (long) current_gdbarch->adjust_breakpoint_address);
698 #ifdef BELIEVE_PCC_PROMOTION
699 fprintf_unfiltered (file,
700 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
701 XSTRING (BELIEVE_PCC_PROMOTION));
703 fprintf_unfiltered (file,
704 "gdbarch_dump: believe_pcc_promotion = %s\n",
705 paddr_d (current_gdbarch->believe_pcc_promotion));
706 #ifdef TARGET_ARCHITECTURE
707 fprintf_unfiltered (file,
708 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
709 XSTRING (TARGET_ARCHITECTURE));
711 fprintf_unfiltered (file,
712 "gdbarch_dump: bfd_arch_info = %s\n",
713 TARGET_ARCHITECTURE->printable_name);
714 #ifdef TARGET_BFD_VMA_BIT
715 fprintf_unfiltered (file,
716 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
717 XSTRING (TARGET_BFD_VMA_BIT));
719 fprintf_unfiltered (file,
720 "gdbarch_dump: bfd_vma_bit = %s\n",
721 paddr_d (current_gdbarch->bfd_vma_bit));
722 #ifdef BREAKPOINT_FROM_PC
723 fprintf_unfiltered (file,
724 "gdbarch_dump: %s # %s\n",
725 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
726 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
728 fprintf_unfiltered (file,
729 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
730 (long) current_gdbarch->breakpoint_from_pc);
731 #ifdef TARGET_BYTE_ORDER
732 fprintf_unfiltered (file,
733 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
734 XSTRING (TARGET_BYTE_ORDER));
736 fprintf_unfiltered (file,
737 "gdbarch_dump: byte_order = %s\n",
738 paddr_d (current_gdbarch->byte_order));
739 #ifdef CALL_DUMMY_LOCATION
740 fprintf_unfiltered (file,
741 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
742 XSTRING (CALL_DUMMY_LOCATION));
744 fprintf_unfiltered (file,
745 "gdbarch_dump: call_dummy_location = %s\n",
746 paddr_d (current_gdbarch->call_dummy_location));
747 #ifdef CANNOT_FETCH_REGISTER
748 fprintf_unfiltered (file,
749 "gdbarch_dump: %s # %s\n",
750 "CANNOT_FETCH_REGISTER(regnum)",
751 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
753 fprintf_unfiltered (file,
754 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
755 (long) current_gdbarch->cannot_fetch_register);
756 #ifdef CANNOT_STEP_BREAKPOINT
757 fprintf_unfiltered (file,
758 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
759 XSTRING (CANNOT_STEP_BREAKPOINT));
761 fprintf_unfiltered (file,
762 "gdbarch_dump: cannot_step_breakpoint = %s\n",
763 paddr_d (current_gdbarch->cannot_step_breakpoint));
764 #ifdef CANNOT_STORE_REGISTER
765 fprintf_unfiltered (file,
766 "gdbarch_dump: %s # %s\n",
767 "CANNOT_STORE_REGISTER(regnum)",
768 XSTRING (CANNOT_STORE_REGISTER (regnum)));
770 fprintf_unfiltered (file,
771 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
772 (long) current_gdbarch->cannot_store_register);
773 #ifdef TARGET_CHAR_SIGNED
774 fprintf_unfiltered (file,
775 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
776 XSTRING (TARGET_CHAR_SIGNED));
778 fprintf_unfiltered (file,
779 "gdbarch_dump: char_signed = %s\n",
780 paddr_d (current_gdbarch->char_signed));
781 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
782 fprintf_unfiltered (file,
783 "gdbarch_dump: %s # %s\n",
784 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
785 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
787 fprintf_unfiltered (file,
788 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
789 (long) current_gdbarch->coff_make_msymbol_special);
790 fprintf_unfiltered (file,
791 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
792 (long) current_gdbarch->construct_inferior_arguments);
793 fprintf_unfiltered (file,
794 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
795 (long) current_gdbarch->convert_from_func_ptr_addr);
796 #ifdef CONVERT_REGISTER_P
797 fprintf_unfiltered (file,
798 "gdbarch_dump: %s # %s\n",
799 "CONVERT_REGISTER_P(regnum, type)",
800 XSTRING (CONVERT_REGISTER_P (regnum, type)));
802 fprintf_unfiltered (file,
803 "gdbarch_dump: convert_register_p = <0x%lx>\n",
804 (long) current_gdbarch->convert_register_p);
805 #ifdef DECR_PC_AFTER_BREAK
806 fprintf_unfiltered (file,
807 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
808 XSTRING (DECR_PC_AFTER_BREAK));
810 fprintf_unfiltered (file,
811 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
812 paddr_nz (current_gdbarch->decr_pc_after_break));
813 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
814 fprintf_unfiltered (file,
815 "gdbarch_dump: %s # %s\n",
816 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
817 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
819 fprintf_unfiltered (file,
820 "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n",
821 (long) current_gdbarch->deprecated_extract_return_value);
822 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
823 fprintf_unfiltered (file,
824 "gdbarch_dump: %s # %s\n",
825 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
826 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
828 fprintf_unfiltered (file,
829 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
830 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
831 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
832 fprintf_unfiltered (file,
833 "gdbarch_dump: %s # %s\n",
834 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
835 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
837 fprintf_unfiltered (file,
838 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
839 (long) current_gdbarch->deprecated_extract_struct_value_address);
840 #ifdef DEPRECATED_FP_REGNUM
841 fprintf_unfiltered (file,
842 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
843 XSTRING (DEPRECATED_FP_REGNUM));
845 fprintf_unfiltered (file,
846 "gdbarch_dump: deprecated_fp_regnum = %s\n",
847 paddr_d (current_gdbarch->deprecated_fp_regnum));
848 #ifdef DEPRECATED_FRAME_SAVED_PC_P
849 fprintf_unfiltered (file,
850 "gdbarch_dump: %s # %s\n",
851 "DEPRECATED_FRAME_SAVED_PC_P()",
852 XSTRING (DEPRECATED_FRAME_SAVED_PC_P ()));
854 fprintf_unfiltered (file,
855 "gdbarch_dump: gdbarch_deprecated_frame_saved_pc_p() = %d\n",
856 gdbarch_deprecated_frame_saved_pc_p (current_gdbarch));
857 #ifdef DEPRECATED_FRAME_SAVED_PC
858 fprintf_unfiltered (file,
859 "gdbarch_dump: %s # %s\n",
860 "DEPRECATED_FRAME_SAVED_PC(fi)",
861 XSTRING (DEPRECATED_FRAME_SAVED_PC (fi)));
863 fprintf_unfiltered (file,
864 "gdbarch_dump: deprecated_frame_saved_pc = <0x%lx>\n",
865 (long) current_gdbarch->deprecated_frame_saved_pc);
866 #ifdef DEPRECATED_FUNCTION_START_OFFSET
867 fprintf_unfiltered (file,
868 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
869 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
871 fprintf_unfiltered (file,
872 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
873 paddr_nz (current_gdbarch->deprecated_function_start_offset));
874 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
875 fprintf_unfiltered (file,
876 "gdbarch_dump: %s # %s\n",
877 "DEPRECATED_PUSH_ARGUMENTS_P()",
878 XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
880 fprintf_unfiltered (file,
881 "gdbarch_dump: gdbarch_deprecated_push_arguments_p() = %d\n",
882 gdbarch_deprecated_push_arguments_p (current_gdbarch));
883 #ifdef DEPRECATED_PUSH_ARGUMENTS
884 fprintf_unfiltered (file,
885 "gdbarch_dump: %s # %s\n",
886 "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
887 XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
889 fprintf_unfiltered (file,
890 "gdbarch_dump: deprecated_push_arguments = <0x%lx>\n",
891 (long) current_gdbarch->deprecated_push_arguments);
892 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
893 fprintf_unfiltered (file,
894 "gdbarch_dump: %s # %s\n",
895 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
896 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
898 fprintf_unfiltered (file,
899 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
900 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
901 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
902 fprintf_unfiltered (file,
903 "gdbarch_dump: %s # %s\n",
904 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
905 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
907 fprintf_unfiltered (file,
908 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
909 (long) current_gdbarch->deprecated_reg_struct_has_addr);
910 #ifdef DEPRECATED_REGISTER_BYTE_P
911 fprintf_unfiltered (file,
912 "gdbarch_dump: %s # %s\n",
913 "DEPRECATED_REGISTER_BYTE_P()",
914 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
916 fprintf_unfiltered (file,
917 "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n",
918 gdbarch_deprecated_register_byte_p (current_gdbarch));
919 #ifdef DEPRECATED_REGISTER_BYTE
920 fprintf_unfiltered (file,
921 "gdbarch_dump: %s # %s\n",
922 "DEPRECATED_REGISTER_BYTE(reg_nr)",
923 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
925 fprintf_unfiltered (file,
926 "gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
927 (long) current_gdbarch->deprecated_register_byte);
928 #ifdef DEPRECATED_REGISTER_SIZE
929 fprintf_unfiltered (file,
930 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
931 XSTRING (DEPRECATED_REGISTER_SIZE));
933 fprintf_unfiltered (file,
934 "gdbarch_dump: deprecated_register_size = %s\n",
935 paddr_d (current_gdbarch->deprecated_register_size));
936 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
937 fprintf_unfiltered (file,
938 "gdbarch_dump: %s # %s\n",
939 "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
940 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
942 fprintf_unfiltered (file,
943 "gdbarch_dump: gdbarch_deprecated_saved_pc_after_call_p() = %d\n",
944 gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch));
945 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL
946 fprintf_unfiltered (file,
947 "gdbarch_dump: %s # %s\n",
948 "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
949 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
951 fprintf_unfiltered (file,
952 "gdbarch_dump: deprecated_saved_pc_after_call = <0x%lx>\n",
953 (long) current_gdbarch->deprecated_saved_pc_after_call);
954 #ifdef DEPRECATED_STACK_ALIGN_P
955 fprintf_unfiltered (file,
956 "gdbarch_dump: %s # %s\n",
957 "DEPRECATED_STACK_ALIGN_P()",
958 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
960 fprintf_unfiltered (file,
961 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
962 gdbarch_deprecated_stack_align_p (current_gdbarch));
963 #ifdef DEPRECATED_STACK_ALIGN
964 fprintf_unfiltered (file,
965 "gdbarch_dump: %s # %s\n",
966 "DEPRECATED_STACK_ALIGN(sp)",
967 XSTRING (DEPRECATED_STACK_ALIGN (sp)));
969 fprintf_unfiltered (file,
970 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
971 (long) current_gdbarch->deprecated_stack_align);
972 #ifdef DEPRECATED_STORE_RETURN_VALUE
973 fprintf_unfiltered (file,
974 "gdbarch_dump: %s # %s\n",
975 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
976 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n",
980 (long) current_gdbarch->deprecated_store_return_value);
981 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
982 fprintf_unfiltered (file,
983 "gdbarch_dump: %s # %s\n",
984 "DEPRECATED_STORE_STRUCT_RETURN_P()",
985 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
987 fprintf_unfiltered (file,
988 "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
989 gdbarch_deprecated_store_struct_return_p (current_gdbarch));
990 #ifdef DEPRECATED_STORE_STRUCT_RETURN
991 fprintf_unfiltered (file,
992 "gdbarch_dump: %s # %s\n",
993 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
994 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
996 fprintf_unfiltered (file,
997 "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
998 (long) current_gdbarch->deprecated_store_struct_return);
999 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
1000 fprintf_unfiltered (file,
1001 "gdbarch_dump: %s # %s\n",
1002 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
1003 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
1007 (long) current_gdbarch->deprecated_use_struct_convention);
1008 #ifdef TARGET_DOUBLE_BIT
1009 fprintf_unfiltered (file,
1010 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
1011 XSTRING (TARGET_DOUBLE_BIT));
1013 fprintf_unfiltered (file,
1014 "gdbarch_dump: double_bit = %s\n",
1015 paddr_d (current_gdbarch->double_bit));
1016 #ifdef TARGET_DOUBLE_FORMAT
1017 fprintf_unfiltered (file,
1018 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1019 XSTRING (TARGET_DOUBLE_FORMAT));
1021 fprintf_unfiltered (file,
1022 "gdbarch_dump: double_format = %s\n",
1023 (TARGET_DOUBLE_FORMAT)->name);
1024 #ifdef DWARF2_REG_TO_REGNUM
1025 fprintf_unfiltered (file,
1026 "gdbarch_dump: %s # %s\n",
1027 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1028 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1030 fprintf_unfiltered (file,
1031 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
1032 (long) current_gdbarch->dwarf2_reg_to_regnum);
1033 #ifdef DWARF_REG_TO_REGNUM
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: %s # %s\n",
1036 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1037 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1039 fprintf_unfiltered (file,
1040 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
1041 (long) current_gdbarch->dwarf_reg_to_regnum);
1042 #ifdef ECOFF_REG_TO_REGNUM
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: %s # %s\n",
1045 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1046 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1048 fprintf_unfiltered (file,
1049 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
1050 (long) current_gdbarch->ecoff_reg_to_regnum);
1051 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1052 fprintf_unfiltered (file,
1053 "gdbarch_dump: %s # %s\n",
1054 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1055 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1057 fprintf_unfiltered (file,
1058 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
1059 (long) current_gdbarch->elf_make_msymbol_special);
1060 #ifdef EXTRACT_RETURN_VALUE
1061 fprintf_unfiltered (file,
1062 "gdbarch_dump: %s # %s\n",
1063 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1064 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1066 fprintf_unfiltered (file,
1067 "gdbarch_dump: extract_return_value = <0x%lx>\n",
1068 (long) current_gdbarch->extract_return_value);
1069 #ifdef FETCH_POINTER_ARGUMENT_P
1070 fprintf_unfiltered (file,
1071 "gdbarch_dump: %s # %s\n",
1072 "FETCH_POINTER_ARGUMENT_P()",
1073 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1075 fprintf_unfiltered (file,
1076 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
1077 gdbarch_fetch_pointer_argument_p (current_gdbarch));
1078 #ifdef FETCH_POINTER_ARGUMENT
1079 fprintf_unfiltered (file,
1080 "gdbarch_dump: %s # %s\n",
1081 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1082 XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
1084 fprintf_unfiltered (file,
1085 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1086 (long) current_gdbarch->fetch_pointer_argument);
1087 #ifdef TARGET_FLOAT_BIT
1088 fprintf_unfiltered (file,
1089 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1090 XSTRING (TARGET_FLOAT_BIT));
1092 fprintf_unfiltered (file,
1093 "gdbarch_dump: float_bit = %s\n",
1094 paddr_d (current_gdbarch->float_bit));
1095 #ifdef TARGET_FLOAT_FORMAT
1096 fprintf_unfiltered (file,
1097 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1098 XSTRING (TARGET_FLOAT_FORMAT));
1100 fprintf_unfiltered (file,
1101 "gdbarch_dump: float_format = %s\n",
1102 (TARGET_FLOAT_FORMAT)->name);
1104 fprintf_unfiltered (file,
1105 "gdbarch_dump: FP0_REGNUM # %s\n",
1106 XSTRING (FP0_REGNUM));
1108 fprintf_unfiltered (file,
1109 "gdbarch_dump: fp0_regnum = %s\n",
1110 paddr_d (current_gdbarch->fp0_regnum));
1111 fprintf_unfiltered (file,
1112 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1113 gdbarch_frame_align_p (current_gdbarch));
1114 fprintf_unfiltered (file,
1115 "gdbarch_dump: frame_align = <0x%lx>\n",
1116 (long) current_gdbarch->frame_align);
1117 #ifdef FRAME_ARGS_SKIP
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1120 XSTRING (FRAME_ARGS_SKIP));
1122 fprintf_unfiltered (file,
1123 "gdbarch_dump: frame_args_skip = 0x%s\n",
1124 paddr_nz (current_gdbarch->frame_args_skip));
1125 #ifdef FRAME_NUM_ARGS_P
1126 fprintf_unfiltered (file,
1127 "gdbarch_dump: %s # %s\n",
1128 "FRAME_NUM_ARGS_P()",
1129 XSTRING (FRAME_NUM_ARGS_P ()));
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1133 gdbarch_frame_num_args_p (current_gdbarch));
1134 #ifdef FRAME_NUM_ARGS
1135 fprintf_unfiltered (file,
1136 "gdbarch_dump: %s # %s\n",
1137 "FRAME_NUM_ARGS(frame)",
1138 XSTRING (FRAME_NUM_ARGS (frame)));
1140 fprintf_unfiltered (file,
1141 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1142 (long) current_gdbarch->frame_num_args);
1143 #ifdef FRAME_RED_ZONE_SIZE
1144 fprintf_unfiltered (file,
1145 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1146 XSTRING (FRAME_RED_ZONE_SIZE));
1148 fprintf_unfiltered (file,
1149 "gdbarch_dump: frame_red_zone_size = %s\n",
1150 paddr_d (current_gdbarch->frame_red_zone_size));
1151 #ifdef GET_LONGJMP_TARGET_P
1152 fprintf_unfiltered (file,
1153 "gdbarch_dump: %s # %s\n",
1154 "GET_LONGJMP_TARGET_P()",
1155 XSTRING (GET_LONGJMP_TARGET_P ()));
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1159 gdbarch_get_longjmp_target_p (current_gdbarch));
1160 #ifdef GET_LONGJMP_TARGET
1161 fprintf_unfiltered (file,
1162 "gdbarch_dump: %s # %s\n",
1163 "GET_LONGJMP_TARGET(pc)",
1164 XSTRING (GET_LONGJMP_TARGET (pc)));
1166 fprintf_unfiltered (file,
1167 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1168 (long) current_gdbarch->get_longjmp_target);
1169 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1170 fprintf_unfiltered (file,
1171 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1172 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1174 fprintf_unfiltered (file,
1175 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1176 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
1177 fprintf_unfiltered (file,
1178 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1179 (long) current_gdbarch->in_function_epilogue_p);
1180 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1181 fprintf_unfiltered (file,
1182 "gdbarch_dump: %s # %s\n",
1183 "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1184 XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
1186 fprintf_unfiltered (file,
1187 "gdbarch_dump: in_solib_call_trampoline = <0x%lx>\n",
1188 (long) current_gdbarch->in_solib_call_trampoline);
1189 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1190 fprintf_unfiltered (file,
1191 "gdbarch_dump: %s # %s\n",
1192 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1193 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1195 fprintf_unfiltered (file,
1196 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1197 (long) current_gdbarch->in_solib_return_trampoline);
1199 fprintf_unfiltered (file,
1200 "gdbarch_dump: %s # %s\n",
1201 "INNER_THAN(lhs, rhs)",
1202 XSTRING (INNER_THAN (lhs, rhs)));
1204 fprintf_unfiltered (file,
1205 "gdbarch_dump: inner_than = <0x%lx>\n",
1206 (long) current_gdbarch->inner_than);
1207 #ifdef TARGET_INT_BIT
1208 fprintf_unfiltered (file,
1209 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1210 XSTRING (TARGET_INT_BIT));
1212 fprintf_unfiltered (file,
1213 "gdbarch_dump: int_bit = %s\n",
1214 paddr_d (current_gdbarch->int_bit));
1215 #ifdef INTEGER_TO_ADDRESS_P
1216 fprintf_unfiltered (file,
1217 "gdbarch_dump: %s # %s\n",
1218 "INTEGER_TO_ADDRESS_P()",
1219 XSTRING (INTEGER_TO_ADDRESS_P ()));
1221 fprintf_unfiltered (file,
1222 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1223 gdbarch_integer_to_address_p (current_gdbarch));
1224 #ifdef INTEGER_TO_ADDRESS
1225 fprintf_unfiltered (file,
1226 "gdbarch_dump: %s # %s\n",
1227 "INTEGER_TO_ADDRESS(type, buf)",
1228 XSTRING (INTEGER_TO_ADDRESS (type, buf)));
1230 fprintf_unfiltered (file,
1231 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1232 (long) current_gdbarch->integer_to_address);
1233 #ifdef TARGET_LONG_BIT
1234 fprintf_unfiltered (file,
1235 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1236 XSTRING (TARGET_LONG_BIT));
1238 fprintf_unfiltered (file,
1239 "gdbarch_dump: long_bit = %s\n",
1240 paddr_d (current_gdbarch->long_bit));
1241 #ifdef TARGET_LONG_DOUBLE_BIT
1242 fprintf_unfiltered (file,
1243 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1244 XSTRING (TARGET_LONG_DOUBLE_BIT));
1246 fprintf_unfiltered (file,
1247 "gdbarch_dump: long_double_bit = %s\n",
1248 paddr_d (current_gdbarch->long_double_bit));
1249 #ifdef TARGET_LONG_DOUBLE_FORMAT
1250 fprintf_unfiltered (file,
1251 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1252 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1254 fprintf_unfiltered (file,
1255 "gdbarch_dump: long_double_format = %s\n",
1256 (TARGET_LONG_DOUBLE_FORMAT)->name);
1257 #ifdef TARGET_LONG_LONG_BIT
1258 fprintf_unfiltered (file,
1259 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1260 XSTRING (TARGET_LONG_LONG_BIT));
1262 fprintf_unfiltered (file,
1263 "gdbarch_dump: long_long_bit = %s\n",
1264 paddr_d (current_gdbarch->long_long_bit));
1265 #ifdef MEMORY_INSERT_BREAKPOINT
1266 fprintf_unfiltered (file,
1267 "gdbarch_dump: %s # %s\n",
1268 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1269 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1271 fprintf_unfiltered (file,
1272 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1273 (long) current_gdbarch->memory_insert_breakpoint);
1274 #ifdef MEMORY_REMOVE_BREAKPOINT
1275 fprintf_unfiltered (file,
1276 "gdbarch_dump: %s # %s\n",
1277 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1278 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1280 fprintf_unfiltered (file,
1281 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1282 (long) current_gdbarch->memory_remove_breakpoint);
1283 #ifdef NAME_OF_MALLOC
1284 fprintf_unfiltered (file,
1285 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1286 XSTRING (NAME_OF_MALLOC));
1288 fprintf_unfiltered (file,
1289 "gdbarch_dump: name_of_malloc = %s\n",
1291 #ifdef NUM_PSEUDO_REGS
1292 fprintf_unfiltered (file,
1293 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1294 XSTRING (NUM_PSEUDO_REGS));
1296 fprintf_unfiltered (file,
1297 "gdbarch_dump: num_pseudo_regs = %s\n",
1298 paddr_d (current_gdbarch->num_pseudo_regs));
1300 fprintf_unfiltered (file,
1301 "gdbarch_dump: NUM_REGS # %s\n",
1302 XSTRING (NUM_REGS));
1304 fprintf_unfiltered (file,
1305 "gdbarch_dump: num_regs = %s\n",
1306 paddr_d (current_gdbarch->num_regs));
1308 fprintf_unfiltered (file,
1309 "gdbarch_dump: TARGET_OSABI # %s\n",
1310 XSTRING (TARGET_OSABI));
1312 fprintf_unfiltered (file,
1313 "gdbarch_dump: osabi = %s\n",
1314 paddr_d (current_gdbarch->osabi));
1316 fprintf_unfiltered (file,
1317 "gdbarch_dump: PC_REGNUM # %s\n",
1318 XSTRING (PC_REGNUM));
1320 fprintf_unfiltered (file,
1321 "gdbarch_dump: pc_regnum = %s\n",
1322 paddr_d (current_gdbarch->pc_regnum));
1323 #ifdef POINTER_TO_ADDRESS
1324 fprintf_unfiltered (file,
1325 "gdbarch_dump: %s # %s\n",
1326 "POINTER_TO_ADDRESS(type, buf)",
1327 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1329 fprintf_unfiltered (file,
1330 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1331 (long) current_gdbarch->pointer_to_address);
1332 fprintf_unfiltered (file,
1333 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1334 gdbarch_print_float_info_p (current_gdbarch));
1335 fprintf_unfiltered (file,
1336 "gdbarch_dump: print_float_info = <0x%lx>\n",
1337 (long) current_gdbarch->print_float_info);
1338 #ifdef TARGET_PRINT_INSN
1339 fprintf_unfiltered (file,
1340 "gdbarch_dump: %s # %s\n",
1341 "TARGET_PRINT_INSN(vma, info)",
1342 XSTRING (TARGET_PRINT_INSN (vma, info)));
1344 fprintf_unfiltered (file,
1345 "gdbarch_dump: print_insn = <0x%lx>\n",
1346 (long) current_gdbarch->print_insn);
1347 fprintf_unfiltered (file,
1348 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1349 (long) current_gdbarch->print_registers_info);
1350 fprintf_unfiltered (file,
1351 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1352 gdbarch_print_vector_info_p (current_gdbarch));
1353 fprintf_unfiltered (file,
1354 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1355 (long) current_gdbarch->print_vector_info);
1357 fprintf_unfiltered (file,
1358 "gdbarch_dump: PS_REGNUM # %s\n",
1359 XSTRING (PS_REGNUM));
1361 fprintf_unfiltered (file,
1362 "gdbarch_dump: ps_regnum = %s\n",
1363 paddr_d (current_gdbarch->ps_regnum));
1364 fprintf_unfiltered (file,
1365 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1366 gdbarch_pseudo_register_read_p (current_gdbarch));
1367 fprintf_unfiltered (file,
1368 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1369 (long) current_gdbarch->pseudo_register_read);
1370 fprintf_unfiltered (file,
1371 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1372 gdbarch_pseudo_register_write_p (current_gdbarch));
1373 fprintf_unfiltered (file,
1374 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1375 (long) current_gdbarch->pseudo_register_write);
1376 #ifdef TARGET_PTR_BIT
1377 fprintf_unfiltered (file,
1378 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1379 XSTRING (TARGET_PTR_BIT));
1381 fprintf_unfiltered (file,
1382 "gdbarch_dump: ptr_bit = %s\n",
1383 paddr_d (current_gdbarch->ptr_bit));
1384 fprintf_unfiltered (file,
1385 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1386 gdbarch_push_dummy_call_p (current_gdbarch));
1387 fprintf_unfiltered (file,
1388 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1389 (long) current_gdbarch->push_dummy_call);
1390 fprintf_unfiltered (file,
1391 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1392 gdbarch_push_dummy_code_p (current_gdbarch));
1393 fprintf_unfiltered (file,
1394 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1395 (long) current_gdbarch->push_dummy_code);
1396 #ifdef TARGET_READ_PC_P
1397 fprintf_unfiltered (file,
1398 "gdbarch_dump: %s # %s\n",
1399 "TARGET_READ_PC_P()",
1400 XSTRING (TARGET_READ_PC_P ()));
1402 fprintf_unfiltered (file,
1403 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1404 gdbarch_read_pc_p (current_gdbarch));
1405 #ifdef TARGET_READ_PC
1406 fprintf_unfiltered (file,
1407 "gdbarch_dump: %s # %s\n",
1408 "TARGET_READ_PC(ptid)",
1409 XSTRING (TARGET_READ_PC (ptid)));
1411 fprintf_unfiltered (file,
1412 "gdbarch_dump: read_pc = <0x%lx>\n",
1413 (long) current_gdbarch->read_pc);
1414 #ifdef TARGET_READ_SP_P
1415 fprintf_unfiltered (file,
1416 "gdbarch_dump: %s # %s\n",
1417 "TARGET_READ_SP_P()",
1418 XSTRING (TARGET_READ_SP_P ()));
1420 fprintf_unfiltered (file,
1421 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1422 gdbarch_read_sp_p (current_gdbarch));
1423 #ifdef TARGET_READ_SP
1424 fprintf_unfiltered (file,
1425 "gdbarch_dump: %s # %s\n",
1427 XSTRING (TARGET_READ_SP ()));
1429 fprintf_unfiltered (file,
1430 "gdbarch_dump: read_sp = <0x%lx>\n",
1431 (long) current_gdbarch->read_sp);
1432 #ifdef REGISTER_BYTES_OK_P
1433 fprintf_unfiltered (file,
1434 "gdbarch_dump: %s # %s\n",
1435 "REGISTER_BYTES_OK_P()",
1436 XSTRING (REGISTER_BYTES_OK_P ()));
1438 fprintf_unfiltered (file,
1439 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1440 gdbarch_register_bytes_ok_p (current_gdbarch));
1441 #ifdef REGISTER_BYTES_OK
1442 fprintf_unfiltered (file,
1443 "gdbarch_dump: %s # %s\n",
1444 "REGISTER_BYTES_OK(nr_bytes)",
1445 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1447 fprintf_unfiltered (file,
1448 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1449 (long) current_gdbarch->register_bytes_ok);
1450 #ifdef REGISTER_NAME
1451 fprintf_unfiltered (file,
1452 "gdbarch_dump: %s # %s\n",
1453 "REGISTER_NAME(regnr)",
1454 XSTRING (REGISTER_NAME (regnr)));
1456 fprintf_unfiltered (file,
1457 "gdbarch_dump: register_name = <0x%lx>\n",
1458 (long) current_gdbarch->register_name);
1459 fprintf_unfiltered (file,
1460 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1461 (long) current_gdbarch->register_reggroup_p);
1462 #ifdef REGISTER_SIM_REGNO
1463 fprintf_unfiltered (file,
1464 "gdbarch_dump: %s # %s\n",
1465 "REGISTER_SIM_REGNO(reg_nr)",
1466 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1468 fprintf_unfiltered (file,
1469 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1470 (long) current_gdbarch->register_sim_regno);
1471 #ifdef REGISTER_TO_VALUE
1472 fprintf_unfiltered (file,
1473 "gdbarch_dump: %s # %s\n",
1474 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1475 XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
1477 fprintf_unfiltered (file,
1478 "gdbarch_dump: register_to_value = <0x%lx>\n",
1479 (long) current_gdbarch->register_to_value);
1480 fprintf_unfiltered (file,
1481 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1482 gdbarch_register_type_p (current_gdbarch));
1483 fprintf_unfiltered (file,
1484 "gdbarch_dump: register_type = <0x%lx>\n",
1485 (long) current_gdbarch->register_type);
1486 fprintf_unfiltered (file,
1487 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1488 gdbarch_regset_from_core_section_p (current_gdbarch));
1489 fprintf_unfiltered (file,
1490 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1491 (long) current_gdbarch->regset_from_core_section);
1492 fprintf_unfiltered (file,
1493 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1494 (long) current_gdbarch->remote_translate_xfer_address);
1495 fprintf_unfiltered (file,
1496 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1497 gdbarch_return_value_p (current_gdbarch));
1498 fprintf_unfiltered (file,
1499 "gdbarch_dump: return_value = <0x%lx>\n",
1500 (long) current_gdbarch->return_value);
1501 #ifdef SDB_REG_TO_REGNUM
1502 fprintf_unfiltered (file,
1503 "gdbarch_dump: %s # %s\n",
1504 "SDB_REG_TO_REGNUM(sdb_regnr)",
1505 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1507 fprintf_unfiltered (file,
1508 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1509 (long) current_gdbarch->sdb_reg_to_regnum);
1510 #ifdef TARGET_SHORT_BIT
1511 fprintf_unfiltered (file,
1512 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1513 XSTRING (TARGET_SHORT_BIT));
1515 fprintf_unfiltered (file,
1516 "gdbarch_dump: short_bit = %s\n",
1517 paddr_d (current_gdbarch->short_bit));
1518 #ifdef SKIP_PROLOGUE
1519 fprintf_unfiltered (file,
1520 "gdbarch_dump: %s # %s\n",
1521 "SKIP_PROLOGUE(ip)",
1522 XSTRING (SKIP_PROLOGUE (ip)));
1524 fprintf_unfiltered (file,
1525 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1526 (long) current_gdbarch->skip_prologue);
1527 fprintf_unfiltered (file,
1528 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1529 (long) current_gdbarch->skip_solib_resolver);
1530 #ifdef SKIP_TRAMPOLINE_CODE
1531 fprintf_unfiltered (file,
1532 "gdbarch_dump: %s # %s\n",
1533 "SKIP_TRAMPOLINE_CODE(pc)",
1534 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1536 fprintf_unfiltered (file,
1537 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1538 (long) current_gdbarch->skip_trampoline_code);
1539 #ifdef SMASH_TEXT_ADDRESS
1540 fprintf_unfiltered (file,
1541 "gdbarch_dump: %s # %s\n",
1542 "SMASH_TEXT_ADDRESS(addr)",
1543 XSTRING (SMASH_TEXT_ADDRESS (addr)));
1545 fprintf_unfiltered (file,
1546 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1547 (long) current_gdbarch->smash_text_address);
1548 #ifdef SOFTWARE_SINGLE_STEP_P
1549 fprintf_unfiltered (file,
1550 "gdbarch_dump: %s # %s\n",
1551 "SOFTWARE_SINGLE_STEP_P()",
1552 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1554 fprintf_unfiltered (file,
1555 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1556 gdbarch_software_single_step_p (current_gdbarch));
1557 #ifdef SOFTWARE_SINGLE_STEP
1558 fprintf_unfiltered (file,
1559 "gdbarch_dump: %s # %s\n",
1560 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1561 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1563 fprintf_unfiltered (file,
1564 "gdbarch_dump: software_single_step = <0x%lx>\n",
1565 (long) current_gdbarch->software_single_step);
1567 fprintf_unfiltered (file,
1568 "gdbarch_dump: SP_REGNUM # %s\n",
1569 XSTRING (SP_REGNUM));
1571 fprintf_unfiltered (file,
1572 "gdbarch_dump: sp_regnum = %s\n",
1573 paddr_d (current_gdbarch->sp_regnum));
1574 #ifdef STAB_REG_TO_REGNUM
1575 fprintf_unfiltered (file,
1576 "gdbarch_dump: %s # %s\n",
1577 "STAB_REG_TO_REGNUM(stab_regnr)",
1578 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
1580 fprintf_unfiltered (file,
1581 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1582 (long) current_gdbarch->stab_reg_to_regnum);
1583 fprintf_unfiltered (file,
1584 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1585 (long) current_gdbarch->stabs_argument_has_addr);
1586 #ifdef STORE_RETURN_VALUE
1587 fprintf_unfiltered (file,
1588 "gdbarch_dump: %s # %s\n",
1589 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1590 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1592 fprintf_unfiltered (file,
1593 "gdbarch_dump: store_return_value = <0x%lx>\n",
1594 (long) current_gdbarch->store_return_value);
1595 fprintf_unfiltered (file,
1596 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1597 gdbarch_unwind_dummy_id_p (current_gdbarch));
1598 fprintf_unfiltered (file,
1599 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1600 (long) current_gdbarch->unwind_dummy_id);
1601 fprintf_unfiltered (file,
1602 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1603 gdbarch_unwind_pc_p (current_gdbarch));
1604 fprintf_unfiltered (file,
1605 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1606 (long) current_gdbarch->unwind_pc);
1607 fprintf_unfiltered (file,
1608 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1609 gdbarch_unwind_sp_p (current_gdbarch));
1610 fprintf_unfiltered (file,
1611 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1612 (long) current_gdbarch->unwind_sp);
1613 #ifdef VALUE_TO_REGISTER
1614 fprintf_unfiltered (file,
1615 "gdbarch_dump: %s # %s\n",
1616 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1617 XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
1619 fprintf_unfiltered (file,
1620 "gdbarch_dump: value_to_register = <0x%lx>\n",
1621 (long) current_gdbarch->value_to_register);
1622 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1623 fprintf_unfiltered (file,
1624 "gdbarch_dump: %s # %s\n",
1625 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1626 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
1628 fprintf_unfiltered (file,
1629 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1630 (long) current_gdbarch->virtual_frame_pointer);
1631 #ifdef TARGET_WRITE_PC
1632 fprintf_unfiltered (file,
1633 "gdbarch_dump: %s # %s\n",
1634 "TARGET_WRITE_PC(val, ptid)",
1635 XSTRING (TARGET_WRITE_PC (val, ptid)));
1637 fprintf_unfiltered (file,
1638 "gdbarch_dump: write_pc = <0x%lx>\n",
1639 (long) current_gdbarch->write_pc);
1640 if (current_gdbarch->dump_tdep != NULL)
1641 current_gdbarch->dump_tdep (current_gdbarch, file);
1644 struct gdbarch_tdep *
1645 gdbarch_tdep (struct gdbarch *gdbarch)
1647 if (gdbarch_debug >= 2)
1648 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1649 return gdbarch->tdep;
1653 const struct bfd_arch_info *
1654 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1656 gdb_assert (gdbarch != NULL);
1657 if (gdbarch_debug >= 2)
1658 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1659 return gdbarch->bfd_arch_info;
1663 gdbarch_byte_order (struct gdbarch *gdbarch)
1665 gdb_assert (gdbarch != NULL);
1666 if (gdbarch_debug >= 2)
1667 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1668 return gdbarch->byte_order;
1672 gdbarch_osabi (struct gdbarch *gdbarch)
1674 gdb_assert (gdbarch != NULL);
1675 if (gdbarch_debug >= 2)
1676 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1677 return gdbarch->osabi;
1681 gdbarch_short_bit (struct gdbarch *gdbarch)
1683 gdb_assert (gdbarch != NULL);
1684 /* Skip verify of short_bit, invalid_p == 0 */
1685 if (gdbarch_debug >= 2)
1686 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1687 return gdbarch->short_bit;
1691 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1694 gdbarch->short_bit = short_bit;
1698 gdbarch_int_bit (struct gdbarch *gdbarch)
1700 gdb_assert (gdbarch != NULL);
1701 /* Skip verify of int_bit, invalid_p == 0 */
1702 if (gdbarch_debug >= 2)
1703 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1704 return gdbarch->int_bit;
1708 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1711 gdbarch->int_bit = int_bit;
1715 gdbarch_long_bit (struct gdbarch *gdbarch)
1717 gdb_assert (gdbarch != NULL);
1718 /* Skip verify of long_bit, invalid_p == 0 */
1719 if (gdbarch_debug >= 2)
1720 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1721 return gdbarch->long_bit;
1725 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1728 gdbarch->long_bit = long_bit;
1732 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1734 gdb_assert (gdbarch != NULL);
1735 /* Skip verify of long_long_bit, invalid_p == 0 */
1736 if (gdbarch_debug >= 2)
1737 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1738 return gdbarch->long_long_bit;
1742 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1745 gdbarch->long_long_bit = long_long_bit;
1749 gdbarch_float_bit (struct gdbarch *gdbarch)
1751 gdb_assert (gdbarch != NULL);
1752 /* Skip verify of float_bit, invalid_p == 0 */
1753 if (gdbarch_debug >= 2)
1754 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1755 return gdbarch->float_bit;
1759 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1762 gdbarch->float_bit = float_bit;
1766 gdbarch_double_bit (struct gdbarch *gdbarch)
1768 gdb_assert (gdbarch != NULL);
1769 /* Skip verify of double_bit, invalid_p == 0 */
1770 if (gdbarch_debug >= 2)
1771 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1772 return gdbarch->double_bit;
1776 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1779 gdbarch->double_bit = double_bit;
1783 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1785 gdb_assert (gdbarch != NULL);
1786 /* Skip verify of long_double_bit, invalid_p == 0 */
1787 if (gdbarch_debug >= 2)
1788 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1789 return gdbarch->long_double_bit;
1793 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1794 int long_double_bit)
1796 gdbarch->long_double_bit = long_double_bit;
1800 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1802 gdb_assert (gdbarch != NULL);
1803 /* Skip verify of ptr_bit, invalid_p == 0 */
1804 if (gdbarch_debug >= 2)
1805 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1806 return gdbarch->ptr_bit;
1810 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1813 gdbarch->ptr_bit = ptr_bit;
1817 gdbarch_addr_bit (struct gdbarch *gdbarch)
1819 gdb_assert (gdbarch != NULL);
1820 /* Check variable changed from pre-default. */
1821 gdb_assert (gdbarch->addr_bit != 0);
1822 if (gdbarch_debug >= 2)
1823 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1824 return gdbarch->addr_bit;
1828 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1831 gdbarch->addr_bit = addr_bit;
1835 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
1837 gdb_assert (gdbarch != NULL);
1838 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1839 if (gdbarch_debug >= 2)
1840 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
1841 return gdbarch->bfd_vma_bit;
1845 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
1848 gdbarch->bfd_vma_bit = bfd_vma_bit;
1852 gdbarch_char_signed (struct gdbarch *gdbarch)
1854 gdb_assert (gdbarch != NULL);
1855 /* Check variable changed from pre-default. */
1856 gdb_assert (gdbarch->char_signed != -1);
1857 if (gdbarch_debug >= 2)
1858 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1859 return gdbarch->char_signed;
1863 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1866 gdbarch->char_signed = char_signed;
1870 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1872 gdb_assert (gdbarch != NULL);
1873 return gdbarch->read_pc != NULL;
1877 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
1879 gdb_assert (gdbarch != NULL);
1880 gdb_assert (gdbarch->read_pc != NULL);
1881 if (gdbarch_debug >= 2)
1882 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1883 return gdbarch->read_pc (ptid);
1887 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1888 gdbarch_read_pc_ftype read_pc)
1890 gdbarch->read_pc = read_pc;
1894 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
1896 gdb_assert (gdbarch != NULL);
1897 gdb_assert (gdbarch->write_pc != NULL);
1898 if (gdbarch_debug >= 2)
1899 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1900 gdbarch->write_pc (val, ptid);
1904 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1905 gdbarch_write_pc_ftype write_pc)
1907 gdbarch->write_pc = write_pc;
1911 gdbarch_read_sp_p (struct gdbarch *gdbarch)
1913 gdb_assert (gdbarch != NULL);
1914 return gdbarch->read_sp != NULL;
1918 gdbarch_read_sp (struct gdbarch *gdbarch)
1920 gdb_assert (gdbarch != NULL);
1921 gdb_assert (gdbarch->read_sp != NULL);
1922 if (gdbarch_debug >= 2)
1923 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
1924 return gdbarch->read_sp ();
1928 set_gdbarch_read_sp (struct gdbarch *gdbarch,
1929 gdbarch_read_sp_ftype read_sp)
1931 gdbarch->read_sp = read_sp;
1935 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1937 gdb_assert (gdbarch != NULL);
1938 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1939 if (gdbarch_debug >= 2)
1940 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1941 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
1945 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1946 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1948 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1952 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1954 gdb_assert (gdbarch != NULL);
1955 return gdbarch->pseudo_register_read != NULL;
1959 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf)
1961 gdb_assert (gdbarch != NULL);
1962 gdb_assert (gdbarch->pseudo_register_read != NULL);
1963 if (gdbarch_debug >= 2)
1964 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1965 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1969 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1970 gdbarch_pseudo_register_read_ftype pseudo_register_read)
1972 gdbarch->pseudo_register_read = pseudo_register_read;
1976 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1978 gdb_assert (gdbarch != NULL);
1979 return gdbarch->pseudo_register_write != NULL;
1983 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf)
1985 gdb_assert (gdbarch != NULL);
1986 gdb_assert (gdbarch->pseudo_register_write != NULL);
1987 if (gdbarch_debug >= 2)
1988 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1989 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1993 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1994 gdbarch_pseudo_register_write_ftype pseudo_register_write)
1996 gdbarch->pseudo_register_write = pseudo_register_write;
2000 gdbarch_num_regs (struct gdbarch *gdbarch)
2002 gdb_assert (gdbarch != NULL);
2003 /* Check variable changed from pre-default. */
2004 gdb_assert (gdbarch->num_regs != -1);
2005 if (gdbarch_debug >= 2)
2006 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2007 return gdbarch->num_regs;
2011 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2014 gdbarch->num_regs = num_regs;
2018 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2020 gdb_assert (gdbarch != NULL);
2021 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2022 if (gdbarch_debug >= 2)
2023 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2024 return gdbarch->num_pseudo_regs;
2028 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2029 int num_pseudo_regs)
2031 gdbarch->num_pseudo_regs = num_pseudo_regs;
2035 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2037 gdb_assert (gdbarch != NULL);
2038 /* Skip verify of sp_regnum, invalid_p == 0 */
2039 if (gdbarch_debug >= 2)
2040 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2041 return gdbarch->sp_regnum;
2045 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2048 gdbarch->sp_regnum = sp_regnum;
2052 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2054 gdb_assert (gdbarch != NULL);
2055 /* Skip verify of pc_regnum, invalid_p == 0 */
2056 if (gdbarch_debug >= 2)
2057 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2058 return gdbarch->pc_regnum;
2062 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2065 gdbarch->pc_regnum = pc_regnum;
2069 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2071 gdb_assert (gdbarch != NULL);
2072 /* Skip verify of ps_regnum, invalid_p == 0 */
2073 if (gdbarch_debug >= 2)
2074 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2075 return gdbarch->ps_regnum;
2079 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2082 gdbarch->ps_regnum = ps_regnum;
2086 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2088 gdb_assert (gdbarch != NULL);
2089 /* Skip verify of fp0_regnum, invalid_p == 0 */
2090 if (gdbarch_debug >= 2)
2091 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2092 return gdbarch->fp0_regnum;
2096 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2099 gdbarch->fp0_regnum = fp0_regnum;
2103 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2105 gdb_assert (gdbarch != NULL);
2106 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
2107 if (gdbarch_debug >= 2)
2108 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2109 return gdbarch->stab_reg_to_regnum (stab_regnr);
2113 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2114 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2116 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2120 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2122 gdb_assert (gdbarch != NULL);
2123 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
2124 if (gdbarch_debug >= 2)
2125 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2126 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2130 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2131 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2133 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2137 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2139 gdb_assert (gdbarch != NULL);
2140 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
2141 if (gdbarch_debug >= 2)
2142 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2143 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2147 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2148 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2150 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2154 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2156 gdb_assert (gdbarch != NULL);
2157 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
2158 if (gdbarch_debug >= 2)
2159 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2160 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2164 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2165 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2167 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2171 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2173 gdb_assert (gdbarch != NULL);
2174 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
2175 if (gdbarch_debug >= 2)
2176 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2177 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2181 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2182 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2184 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2188 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2190 gdb_assert (gdbarch != NULL);
2191 gdb_assert (gdbarch->register_name != NULL);
2192 if (gdbarch_debug >= 2)
2193 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2194 return gdbarch->register_name (regnr);
2198 set_gdbarch_register_name (struct gdbarch *gdbarch,
2199 gdbarch_register_name_ftype register_name)
2201 gdbarch->register_name = register_name;
2205 gdbarch_register_type_p (struct gdbarch *gdbarch)
2207 gdb_assert (gdbarch != NULL);
2208 return gdbarch->register_type != NULL;
2212 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2214 gdb_assert (gdbarch != NULL);
2215 gdb_assert (gdbarch->register_type != NULL);
2216 if (gdbarch_debug >= 2)
2217 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2218 return gdbarch->register_type (gdbarch, reg_nr);
2222 set_gdbarch_register_type (struct gdbarch *gdbarch,
2223 gdbarch_register_type_ftype register_type)
2225 gdbarch->register_type = register_type;
2229 gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch)
2231 gdb_assert (gdbarch != NULL);
2232 return gdbarch->deprecated_register_byte != generic_register_byte;
2236 gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr)
2238 gdb_assert (gdbarch != NULL);
2239 gdb_assert (gdbarch->deprecated_register_byte != NULL);
2240 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2241 if (gdbarch_debug >= 2)
2242 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n");
2243 return gdbarch->deprecated_register_byte (reg_nr);
2247 set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch,
2248 gdbarch_deprecated_register_byte_ftype deprecated_register_byte)
2250 gdbarch->deprecated_register_byte = deprecated_register_byte;
2254 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
2256 gdb_assert (gdbarch != NULL);
2257 return gdbarch->unwind_dummy_id != NULL;
2261 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
2263 gdb_assert (gdbarch != NULL);
2264 gdb_assert (gdbarch->unwind_dummy_id != NULL);
2265 if (gdbarch_debug >= 2)
2266 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
2267 return gdbarch->unwind_dummy_id (gdbarch, info);
2271 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
2272 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
2274 gdbarch->unwind_dummy_id = unwind_dummy_id;
2278 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2280 gdb_assert (gdbarch != NULL);
2281 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2282 if (gdbarch_debug >= 2)
2283 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2284 return gdbarch->deprecated_fp_regnum;
2288 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2289 int deprecated_fp_regnum)
2291 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2295 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
2297 gdb_assert (gdbarch != NULL);
2298 return gdbarch->push_dummy_call != NULL;
2302 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)
2304 gdb_assert (gdbarch != NULL);
2305 gdb_assert (gdbarch->push_dummy_call != NULL);
2306 if (gdbarch_debug >= 2)
2307 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
2308 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
2312 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2313 gdbarch_push_dummy_call_ftype push_dummy_call)
2315 gdbarch->push_dummy_call = push_dummy_call;
2319 gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch)
2321 gdb_assert (gdbarch != NULL);
2322 return gdbarch->deprecated_push_arguments != NULL;
2326 gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
2328 gdb_assert (gdbarch != NULL);
2329 gdb_assert (gdbarch->deprecated_push_arguments != NULL);
2330 if (gdbarch_debug >= 2)
2331 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n");
2332 return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr);
2336 set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch,
2337 gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments)
2339 gdbarch->deprecated_push_arguments = deprecated_push_arguments;
2343 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
2345 gdb_assert (gdbarch != NULL);
2346 if (gdbarch_debug >= 2)
2347 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
2348 return gdbarch->deprecated_register_size;
2352 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
2353 int deprecated_register_size)
2355 gdbarch->deprecated_register_size = deprecated_register_size;
2359 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2361 gdb_assert (gdbarch != NULL);
2362 /* Skip verify of call_dummy_location, invalid_p == 0 */
2363 if (gdbarch_debug >= 2)
2364 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2365 return gdbarch->call_dummy_location;
2369 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2370 int call_dummy_location)
2372 gdbarch->call_dummy_location = call_dummy_location;
2376 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
2378 gdb_assert (gdbarch != NULL);
2379 return gdbarch->push_dummy_code != NULL;
2383 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)
2385 gdb_assert (gdbarch != NULL);
2386 gdb_assert (gdbarch->push_dummy_code != NULL);
2387 if (gdbarch_debug >= 2)
2388 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
2389 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
2393 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2394 gdbarch_push_dummy_code_ftype push_dummy_code)
2396 gdbarch->push_dummy_code = push_dummy_code;
2400 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2402 gdb_assert (gdbarch != NULL);
2403 gdb_assert (gdbarch->print_registers_info != NULL);
2404 if (gdbarch_debug >= 2)
2405 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2406 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2410 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2411 gdbarch_print_registers_info_ftype print_registers_info)
2413 gdbarch->print_registers_info = print_registers_info;
2417 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2419 gdb_assert (gdbarch != NULL);
2420 return gdbarch->print_float_info != NULL;
2424 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2426 gdb_assert (gdbarch != NULL);
2427 gdb_assert (gdbarch->print_float_info != NULL);
2428 if (gdbarch_debug >= 2)
2429 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2430 gdbarch->print_float_info (gdbarch, file, frame, args);
2434 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2435 gdbarch_print_float_info_ftype print_float_info)
2437 gdbarch->print_float_info = print_float_info;
2441 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2443 gdb_assert (gdbarch != NULL);
2444 return gdbarch->print_vector_info != NULL;
2448 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2450 gdb_assert (gdbarch != NULL);
2451 gdb_assert (gdbarch->print_vector_info != NULL);
2452 if (gdbarch_debug >= 2)
2453 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2454 gdbarch->print_vector_info (gdbarch, file, frame, args);
2458 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2459 gdbarch_print_vector_info_ftype print_vector_info)
2461 gdbarch->print_vector_info = print_vector_info;
2465 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2467 gdb_assert (gdbarch != NULL);
2468 gdb_assert (gdbarch->register_sim_regno != NULL);
2469 if (gdbarch_debug >= 2)
2470 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2471 return gdbarch->register_sim_regno (reg_nr);
2475 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2476 gdbarch_register_sim_regno_ftype register_sim_regno)
2478 gdbarch->register_sim_regno = register_sim_regno;
2482 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
2484 gdb_assert (gdbarch != NULL);
2485 return gdbarch->register_bytes_ok != NULL;
2489 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
2491 gdb_assert (gdbarch != NULL);
2492 gdb_assert (gdbarch->register_bytes_ok != NULL);
2493 if (gdbarch_debug >= 2)
2494 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
2495 return gdbarch->register_bytes_ok (nr_bytes);
2499 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
2500 gdbarch_register_bytes_ok_ftype register_bytes_ok)
2502 gdbarch->register_bytes_ok = register_bytes_ok;
2506 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2508 gdb_assert (gdbarch != NULL);
2509 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2510 if (gdbarch_debug >= 2)
2511 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2512 return gdbarch->cannot_fetch_register (regnum);
2516 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2517 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2519 gdbarch->cannot_fetch_register = cannot_fetch_register;
2523 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2525 gdb_assert (gdbarch != NULL);
2526 gdb_assert (gdbarch->cannot_store_register != NULL);
2527 if (gdbarch_debug >= 2)
2528 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2529 return gdbarch->cannot_store_register (regnum);
2533 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2534 gdbarch_cannot_store_register_ftype cannot_store_register)
2536 gdbarch->cannot_store_register = cannot_store_register;
2540 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2542 gdb_assert (gdbarch != NULL);
2543 return gdbarch->get_longjmp_target != NULL;
2547 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
2549 gdb_assert (gdbarch != NULL);
2550 gdb_assert (gdbarch->get_longjmp_target != NULL);
2551 if (gdbarch_debug >= 2)
2552 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2553 return gdbarch->get_longjmp_target (pc);
2557 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2558 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2560 gdbarch->get_longjmp_target = get_longjmp_target;
2564 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2566 gdb_assert (gdbarch != NULL);
2567 if (gdbarch_debug >= 2)
2568 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2569 return gdbarch->believe_pcc_promotion;
2573 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2574 int believe_pcc_promotion)
2576 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2580 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2582 gdb_assert (gdbarch != NULL);
2583 gdb_assert (gdbarch->convert_register_p != NULL);
2584 if (gdbarch_debug >= 2)
2585 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2586 return gdbarch->convert_register_p (regnum, type);
2590 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2591 gdbarch_convert_register_p_ftype convert_register_p)
2593 gdbarch->convert_register_p = convert_register_p;
2597 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf)
2599 gdb_assert (gdbarch != NULL);
2600 gdb_assert (gdbarch->register_to_value != NULL);
2601 if (gdbarch_debug >= 2)
2602 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2603 gdbarch->register_to_value (frame, regnum, type, buf);
2607 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2608 gdbarch_register_to_value_ftype register_to_value)
2610 gdbarch->register_to_value = register_to_value;
2614 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf)
2616 gdb_assert (gdbarch != NULL);
2617 gdb_assert (gdbarch->value_to_register != NULL);
2618 if (gdbarch_debug >= 2)
2619 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2620 gdbarch->value_to_register (frame, regnum, type, buf);
2624 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2625 gdbarch_value_to_register_ftype value_to_register)
2627 gdbarch->value_to_register = value_to_register;
2631 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf)
2633 gdb_assert (gdbarch != NULL);
2634 gdb_assert (gdbarch->pointer_to_address != NULL);
2635 if (gdbarch_debug >= 2)
2636 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2637 return gdbarch->pointer_to_address (type, buf);
2641 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2642 gdbarch_pointer_to_address_ftype pointer_to_address)
2644 gdbarch->pointer_to_address = pointer_to_address;
2648 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
2650 gdb_assert (gdbarch != NULL);
2651 gdb_assert (gdbarch->address_to_pointer != NULL);
2652 if (gdbarch_debug >= 2)
2653 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2654 gdbarch->address_to_pointer (type, buf, addr);
2658 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2659 gdbarch_address_to_pointer_ftype address_to_pointer)
2661 gdbarch->address_to_pointer = address_to_pointer;
2665 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2667 gdb_assert (gdbarch != NULL);
2668 return gdbarch->integer_to_address != NULL;
2672 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
2674 gdb_assert (gdbarch != NULL);
2675 gdb_assert (gdbarch->integer_to_address != NULL);
2676 if (gdbarch_debug >= 2)
2677 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2678 return gdbarch->integer_to_address (type, buf);
2682 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2683 gdbarch_integer_to_address_ftype integer_to_address)
2685 gdbarch->integer_to_address = integer_to_address;
2689 gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch)
2691 gdb_assert (gdbarch != NULL);
2692 return gdbarch->deprecated_store_struct_return != NULL;
2696 gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
2698 gdb_assert (gdbarch != NULL);
2699 gdb_assert (gdbarch->deprecated_store_struct_return != NULL);
2700 if (gdbarch_debug >= 2)
2701 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n");
2702 gdbarch->deprecated_store_struct_return (addr, sp);
2706 set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch,
2707 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return)
2709 gdbarch->deprecated_store_struct_return = deprecated_store_struct_return;
2713 gdbarch_return_value_p (struct gdbarch *gdbarch)
2715 gdb_assert (gdbarch != NULL);
2716 return gdbarch->return_value != legacy_return_value;
2719 enum return_value_convention
2720 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf)
2722 gdb_assert (gdbarch != NULL);
2723 gdb_assert (gdbarch->return_value != NULL);
2724 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2725 if (gdbarch_debug >= 2)
2726 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2727 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
2731 set_gdbarch_return_value (struct gdbarch *gdbarch,
2732 gdbarch_return_value_ftype return_value)
2734 gdbarch->return_value = return_value;
2738 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
2740 gdb_assert (gdbarch != NULL);
2741 gdb_assert (gdbarch->extract_return_value != NULL);
2742 if (gdbarch_debug >= 2)
2743 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
2744 gdbarch->extract_return_value (type, regcache, valbuf);
2748 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
2749 gdbarch_extract_return_value_ftype extract_return_value)
2751 gdbarch->extract_return_value = extract_return_value;
2755 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
2757 gdb_assert (gdbarch != NULL);
2758 gdb_assert (gdbarch->store_return_value != NULL);
2759 if (gdbarch_debug >= 2)
2760 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2761 gdbarch->store_return_value (type, regcache, valbuf);
2765 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
2766 gdbarch_store_return_value_ftype store_return_value)
2768 gdbarch->store_return_value = store_return_value;
2772 gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
2774 gdb_assert (gdbarch != NULL);
2775 gdb_assert (gdbarch->deprecated_extract_return_value != NULL);
2776 if (gdbarch_debug >= 2)
2777 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
2778 gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
2782 set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
2783 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
2785 gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
2789 gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
2791 gdb_assert (gdbarch != NULL);
2792 gdb_assert (gdbarch->deprecated_store_return_value != NULL);
2793 if (gdbarch_debug >= 2)
2794 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
2795 gdbarch->deprecated_store_return_value (type, valbuf);
2799 set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
2800 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
2802 gdbarch->deprecated_store_return_value = deprecated_store_return_value;
2806 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2808 gdb_assert (gdbarch != NULL);
2809 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
2810 if (gdbarch_debug >= 2)
2811 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
2812 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
2816 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
2817 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
2819 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
2823 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
2825 gdb_assert (gdbarch != NULL);
2826 return gdbarch->deprecated_extract_struct_value_address != NULL;
2830 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
2832 gdb_assert (gdbarch != NULL);
2833 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
2834 if (gdbarch_debug >= 2)
2835 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
2836 return gdbarch->deprecated_extract_struct_value_address (regcache);
2840 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
2841 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
2843 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
2847 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2849 gdb_assert (gdbarch != NULL);
2850 gdb_assert (gdbarch->skip_prologue != NULL);
2851 if (gdbarch_debug >= 2)
2852 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2853 return gdbarch->skip_prologue (ip);
2857 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2858 gdbarch_skip_prologue_ftype skip_prologue)
2860 gdbarch->skip_prologue = skip_prologue;
2864 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2866 gdb_assert (gdbarch != NULL);
2867 gdb_assert (gdbarch->inner_than != NULL);
2868 if (gdbarch_debug >= 2)
2869 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2870 return gdbarch->inner_than (lhs, rhs);
2874 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2875 gdbarch_inner_than_ftype inner_than)
2877 gdbarch->inner_than = inner_than;
2880 const unsigned char *
2881 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2883 gdb_assert (gdbarch != NULL);
2884 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2885 if (gdbarch_debug >= 2)
2886 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2887 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2891 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2892 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2894 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2898 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2900 gdb_assert (gdbarch != NULL);
2901 return gdbarch->adjust_breakpoint_address != NULL;
2905 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2907 gdb_assert (gdbarch != NULL);
2908 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2909 if (gdbarch_debug >= 2)
2910 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2911 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2915 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2916 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2918 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2922 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
2924 gdb_assert (gdbarch != NULL);
2925 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2926 if (gdbarch_debug >= 2)
2927 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2928 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
2932 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2933 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2935 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2939 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
2941 gdb_assert (gdbarch != NULL);
2942 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2943 if (gdbarch_debug >= 2)
2944 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2945 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
2949 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2950 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2952 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2956 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2958 gdb_assert (gdbarch != NULL);
2959 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2960 if (gdbarch_debug >= 2)
2961 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2962 return gdbarch->decr_pc_after_break;
2966 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2967 CORE_ADDR decr_pc_after_break)
2969 gdbarch->decr_pc_after_break = decr_pc_after_break;
2973 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2975 gdb_assert (gdbarch != NULL);
2976 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2977 if (gdbarch_debug >= 2)
2978 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2979 return gdbarch->deprecated_function_start_offset;
2983 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2984 CORE_ADDR deprecated_function_start_offset)
2986 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2990 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)
2992 gdb_assert (gdbarch != NULL);
2993 gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
2994 if (gdbarch_debug >= 2)
2995 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
2996 gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
3000 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3001 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3003 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3007 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3009 gdb_assert (gdbarch != NULL);
3010 /* Skip verify of frame_args_skip, invalid_p == 0 */
3011 if (gdbarch_debug >= 2)
3012 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3013 return gdbarch->frame_args_skip;
3017 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3018 CORE_ADDR frame_args_skip)
3020 gdbarch->frame_args_skip = frame_args_skip;
3024 gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch)
3026 gdb_assert (gdbarch != NULL);
3027 return gdbarch->deprecated_frame_saved_pc != NULL;
3031 gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
3033 gdb_assert (gdbarch != NULL);
3034 gdb_assert (gdbarch->deprecated_frame_saved_pc != NULL);
3035 if (gdbarch_debug >= 2)
3036 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_saved_pc called\n");
3037 return gdbarch->deprecated_frame_saved_pc (fi);
3041 set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch,
3042 gdbarch_deprecated_frame_saved_pc_ftype deprecated_frame_saved_pc)
3044 gdbarch->deprecated_frame_saved_pc = deprecated_frame_saved_pc;
3048 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
3050 gdb_assert (gdbarch != NULL);
3051 return gdbarch->unwind_pc != NULL;
3055 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
3057 gdb_assert (gdbarch != NULL);
3058 gdb_assert (gdbarch->unwind_pc != NULL);
3059 if (gdbarch_debug >= 2)
3060 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
3061 return gdbarch->unwind_pc (gdbarch, next_frame);
3065 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
3066 gdbarch_unwind_pc_ftype unwind_pc)
3068 gdbarch->unwind_pc = unwind_pc;
3072 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
3074 gdb_assert (gdbarch != NULL);
3075 return gdbarch->unwind_sp != NULL;
3079 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
3081 gdb_assert (gdbarch != NULL);
3082 gdb_assert (gdbarch->unwind_sp != NULL);
3083 if (gdbarch_debug >= 2)
3084 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
3085 return gdbarch->unwind_sp (gdbarch, next_frame);
3089 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
3090 gdbarch_unwind_sp_ftype unwind_sp)
3092 gdbarch->unwind_sp = unwind_sp;
3096 gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch)
3098 gdb_assert (gdbarch != NULL);
3099 return gdbarch->deprecated_saved_pc_after_call != NULL;
3103 gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
3105 gdb_assert (gdbarch != NULL);
3106 gdb_assert (gdbarch->deprecated_saved_pc_after_call != NULL);
3107 if (gdbarch_debug >= 2)
3108 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_saved_pc_after_call called\n");
3109 return gdbarch->deprecated_saved_pc_after_call (frame);
3113 set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch,
3114 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call)
3116 gdbarch->deprecated_saved_pc_after_call = deprecated_saved_pc_after_call;
3120 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
3122 gdb_assert (gdbarch != NULL);
3123 return gdbarch->frame_num_args != NULL;
3127 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3129 gdb_assert (gdbarch != NULL);
3130 gdb_assert (gdbarch->frame_num_args != NULL);
3131 if (gdbarch_debug >= 2)
3132 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3133 return gdbarch->frame_num_args (frame);
3137 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3138 gdbarch_frame_num_args_ftype frame_num_args)
3140 gdbarch->frame_num_args = frame_num_args;
3144 gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
3146 gdb_assert (gdbarch != NULL);
3147 return gdbarch->deprecated_stack_align != NULL;
3151 gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3153 gdb_assert (gdbarch != NULL);
3154 gdb_assert (gdbarch->deprecated_stack_align != NULL);
3155 if (gdbarch_debug >= 2)
3156 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
3157 return gdbarch->deprecated_stack_align (sp);
3161 set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
3162 gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
3164 gdbarch->deprecated_stack_align = deprecated_stack_align;
3168 gdbarch_frame_align_p (struct gdbarch *gdbarch)
3170 gdb_assert (gdbarch != NULL);
3171 return gdbarch->frame_align != NULL;
3175 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
3177 gdb_assert (gdbarch != NULL);
3178 gdb_assert (gdbarch->frame_align != NULL);
3179 if (gdbarch_debug >= 2)
3180 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
3181 return gdbarch->frame_align (gdbarch, address);
3185 set_gdbarch_frame_align (struct gdbarch *gdbarch,
3186 gdbarch_frame_align_ftype frame_align)
3188 gdbarch->frame_align = frame_align;
3192 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3194 gdb_assert (gdbarch != NULL);
3195 return gdbarch->deprecated_reg_struct_has_addr != NULL;
3199 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3201 gdb_assert (gdbarch != NULL);
3202 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
3203 if (gdbarch_debug >= 2)
3204 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
3205 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
3209 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
3210 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
3212 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
3216 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
3218 gdb_assert (gdbarch != NULL);
3219 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
3220 if (gdbarch_debug >= 2)
3221 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
3222 return gdbarch->stabs_argument_has_addr (gdbarch, type);
3226 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
3227 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
3229 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
3233 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
3235 gdb_assert (gdbarch != NULL);
3236 if (gdbarch_debug >= 2)
3237 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
3238 return gdbarch->frame_red_zone_size;
3242 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
3243 int frame_red_zone_size)
3245 gdbarch->frame_red_zone_size = frame_red_zone_size;
3248 const struct floatformat *
3249 gdbarch_float_format (struct gdbarch *gdbarch)
3251 gdb_assert (gdbarch != NULL);
3252 if (gdbarch_debug >= 2)
3253 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
3254 return gdbarch->float_format;
3258 set_gdbarch_float_format (struct gdbarch *gdbarch,
3259 const struct floatformat * float_format)
3261 gdbarch->float_format = float_format;
3264 const struct floatformat *
3265 gdbarch_double_format (struct gdbarch *gdbarch)
3267 gdb_assert (gdbarch != NULL);
3268 if (gdbarch_debug >= 2)
3269 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
3270 return gdbarch->double_format;
3274 set_gdbarch_double_format (struct gdbarch *gdbarch,
3275 const struct floatformat * double_format)
3277 gdbarch->double_format = double_format;
3280 const struct floatformat *
3281 gdbarch_long_double_format (struct gdbarch *gdbarch)
3283 gdb_assert (gdbarch != NULL);
3284 if (gdbarch_debug >= 2)
3285 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
3286 return gdbarch->long_double_format;
3290 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
3291 const struct floatformat * long_double_format)
3293 gdbarch->long_double_format = long_double_format;
3297 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
3299 gdb_assert (gdbarch != NULL);
3300 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
3301 if (gdbarch_debug >= 2)
3302 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
3303 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
3307 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
3308 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
3310 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
3314 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
3316 gdb_assert (gdbarch != NULL);
3317 gdb_assert (gdbarch->addr_bits_remove != NULL);
3318 if (gdbarch_debug >= 2)
3319 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
3320 return gdbarch->addr_bits_remove (addr);
3324 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
3325 gdbarch_addr_bits_remove_ftype addr_bits_remove)
3327 gdbarch->addr_bits_remove = addr_bits_remove;
3331 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
3333 gdb_assert (gdbarch != NULL);
3334 gdb_assert (gdbarch->smash_text_address != NULL);
3335 if (gdbarch_debug >= 2)
3336 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
3337 return gdbarch->smash_text_address (addr);
3341 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
3342 gdbarch_smash_text_address_ftype smash_text_address)
3344 gdbarch->smash_text_address = smash_text_address;
3348 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
3350 gdb_assert (gdbarch != NULL);
3351 return gdbarch->software_single_step != NULL;
3355 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
3357 gdb_assert (gdbarch != NULL);
3358 gdb_assert (gdbarch->software_single_step != NULL);
3359 if (gdbarch_debug >= 2)
3360 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
3361 gdbarch->software_single_step (sig, insert_breakpoints_p);
3365 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
3366 gdbarch_software_single_step_ftype software_single_step)
3368 gdbarch->software_single_step = software_single_step;
3372 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
3374 gdb_assert (gdbarch != NULL);
3375 gdb_assert (gdbarch->print_insn != NULL);
3376 if (gdbarch_debug >= 2)
3377 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
3378 return gdbarch->print_insn (vma, info);
3382 set_gdbarch_print_insn (struct gdbarch *gdbarch,
3383 gdbarch_print_insn_ftype print_insn)
3385 gdbarch->print_insn = print_insn;
3389 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
3391 gdb_assert (gdbarch != NULL);
3392 gdb_assert (gdbarch->skip_trampoline_code != NULL);
3393 if (gdbarch_debug >= 2)
3394 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
3395 return gdbarch->skip_trampoline_code (pc);
3399 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
3400 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
3402 gdbarch->skip_trampoline_code = skip_trampoline_code;
3406 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
3408 gdb_assert (gdbarch != NULL);
3409 gdb_assert (gdbarch->skip_solib_resolver != NULL);
3410 if (gdbarch_debug >= 2)
3411 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
3412 return gdbarch->skip_solib_resolver (gdbarch, pc);
3416 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
3417 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
3419 gdbarch->skip_solib_resolver = skip_solib_resolver;
3423 gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3425 gdb_assert (gdbarch != NULL);
3426 gdb_assert (gdbarch->in_solib_call_trampoline != NULL);
3427 if (gdbarch_debug >= 2)
3428 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
3429 return gdbarch->in_solib_call_trampoline (pc, name);
3433 set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
3434 gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
3436 gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
3440 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3442 gdb_assert (gdbarch != NULL);
3443 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
3444 if (gdbarch_debug >= 2)
3445 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
3446 return gdbarch->in_solib_return_trampoline (pc, name);
3450 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3451 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3453 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3457 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3459 gdb_assert (gdbarch != NULL);
3460 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
3461 if (gdbarch_debug >= 2)
3462 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3463 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3467 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3468 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3470 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3474 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
3476 gdb_assert (gdbarch != NULL);
3477 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
3478 if (gdbarch_debug >= 2)
3479 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
3480 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
3484 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
3485 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
3487 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
3491 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3493 gdb_assert (gdbarch != NULL);
3494 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
3495 if (gdbarch_debug >= 2)
3496 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3497 gdbarch->elf_make_msymbol_special (sym, msym);
3501 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
3502 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
3504 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
3508 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
3510 gdb_assert (gdbarch != NULL);
3511 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
3512 if (gdbarch_debug >= 2)
3513 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
3514 gdbarch->coff_make_msymbol_special (val, msym);
3518 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
3519 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
3521 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
3525 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
3527 gdb_assert (gdbarch != NULL);
3528 /* Skip verify of name_of_malloc, invalid_p == 0 */
3529 if (gdbarch_debug >= 2)
3530 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
3531 return gdbarch->name_of_malloc;
3535 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
3536 const char * name_of_malloc)
3538 gdbarch->name_of_malloc = name_of_malloc;
3542 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
3544 gdb_assert (gdbarch != NULL);
3545 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3546 if (gdbarch_debug >= 2)
3547 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
3548 return gdbarch->cannot_step_breakpoint;
3552 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
3553 int cannot_step_breakpoint)
3555 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
3559 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
3561 gdb_assert (gdbarch != NULL);
3562 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3563 if (gdbarch_debug >= 2)
3564 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
3565 return gdbarch->have_nonsteppable_watchpoint;
3569 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
3570 int have_nonsteppable_watchpoint)
3572 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
3576 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
3578 gdb_assert (gdbarch != NULL);
3579 return gdbarch->address_class_type_flags != NULL;
3583 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
3585 gdb_assert (gdbarch != NULL);
3586 gdb_assert (gdbarch->address_class_type_flags != NULL);
3587 if (gdbarch_debug >= 2)
3588 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
3589 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
3593 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
3594 gdbarch_address_class_type_flags_ftype address_class_type_flags)
3596 gdbarch->address_class_type_flags = address_class_type_flags;
3600 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
3602 gdb_assert (gdbarch != NULL);
3603 return gdbarch->address_class_type_flags_to_name != NULL;
3607 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
3609 gdb_assert (gdbarch != NULL);
3610 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
3611 if (gdbarch_debug >= 2)
3612 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
3613 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
3617 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
3618 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
3620 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3624 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3626 gdb_assert (gdbarch != NULL);
3627 return gdbarch->address_class_name_to_type_flags != NULL;
3631 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
3633 gdb_assert (gdbarch != NULL);
3634 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
3635 if (gdbarch_debug >= 2)
3636 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
3637 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
3641 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3642 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3644 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3648 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3650 gdb_assert (gdbarch != NULL);
3651 gdb_assert (gdbarch->register_reggroup_p != NULL);
3652 if (gdbarch_debug >= 2)
3653 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3654 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3658 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3659 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3661 gdbarch->register_reggroup_p = register_reggroup_p;
3665 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3667 gdb_assert (gdbarch != NULL);
3668 return gdbarch->fetch_pointer_argument != NULL;
3672 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3674 gdb_assert (gdbarch != NULL);
3675 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
3676 if (gdbarch_debug >= 2)
3677 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3678 return gdbarch->fetch_pointer_argument (frame, argi, type);
3682 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3683 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3685 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3689 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3691 gdb_assert (gdbarch != NULL);
3692 return gdbarch->regset_from_core_section != NULL;
3695 const struct regset *
3696 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3698 gdb_assert (gdbarch != NULL);
3699 gdb_assert (gdbarch->regset_from_core_section != NULL);
3700 if (gdbarch_debug >= 2)
3701 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3702 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3706 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3707 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3709 gdbarch->regset_from_core_section = regset_from_core_section;
3713 /* Keep a registry of per-architecture data-pointers required by GDB
3720 gdbarch_data_pre_init_ftype *pre_init;
3721 gdbarch_data_post_init_ftype *post_init;
3724 struct gdbarch_data_registration
3726 struct gdbarch_data *data;
3727 struct gdbarch_data_registration *next;
3730 struct gdbarch_data_registry
3733 struct gdbarch_data_registration *registrations;
3736 struct gdbarch_data_registry gdbarch_data_registry =
3741 static struct gdbarch_data *
3742 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3743 gdbarch_data_post_init_ftype *post_init)
3745 struct gdbarch_data_registration **curr;
3746 /* Append the new registraration. */
3747 for (curr = &gdbarch_data_registry.registrations;
3749 curr = &(*curr)->next);
3750 (*curr) = XMALLOC (struct gdbarch_data_registration);
3751 (*curr)->next = NULL;
3752 (*curr)->data = XMALLOC (struct gdbarch_data);
3753 (*curr)->data->index = gdbarch_data_registry.nr++;
3754 (*curr)->data->pre_init = pre_init;
3755 (*curr)->data->post_init = post_init;
3756 (*curr)->data->init_p = 1;
3757 return (*curr)->data;
3760 struct gdbarch_data *
3761 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3763 return gdbarch_data_register (pre_init, NULL);
3766 struct gdbarch_data *
3767 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3769 return gdbarch_data_register (NULL, post_init);
3772 /* Create/delete the gdbarch data vector. */
3775 alloc_gdbarch_data (struct gdbarch *gdbarch)
3777 gdb_assert (gdbarch->data == NULL);
3778 gdbarch->nr_data = gdbarch_data_registry.nr;
3779 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3782 /* Initialize the current value of the specified per-architecture
3786 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3787 struct gdbarch_data *data,
3790 gdb_assert (data->index < gdbarch->nr_data);
3791 gdb_assert (gdbarch->data[data->index] == NULL);
3792 gdb_assert (data->pre_init == NULL);
3793 gdbarch->data[data->index] = pointer;
3796 /* Return the current value of the specified per-architecture
3800 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3802 gdb_assert (data->index < gdbarch->nr_data);
3803 if (gdbarch->data[data->index] == NULL)
3805 /* The data-pointer isn't initialized, call init() to get a
3807 if (data->pre_init != NULL)
3808 /* Mid architecture creation: pass just the obstack, and not
3809 the entire architecture, as that way it isn't possible for
3810 pre-init code to refer to undefined architecture
3812 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3813 else if (gdbarch->initialized_p
3814 && data->post_init != NULL)
3815 /* Post architecture creation: pass the entire architecture
3816 (as all fields are valid), but be careful to also detect
3817 recursive references. */
3819 gdb_assert (data->init_p);
3821 gdbarch->data[data->index] = data->post_init (gdbarch);
3825 /* The architecture initialization hasn't completed - punt -
3826 hope that the caller knows what they are doing. Once
3827 deprecated_set_gdbarch_data has been initialized, this can be
3828 changed to an internal error. */
3830 gdb_assert (gdbarch->data[data->index] != NULL);
3832 return gdbarch->data[data->index];
3837 /* Keep a registry of swapped data required by GDB modules. */
3842 struct gdbarch_swap_registration *source;
3843 struct gdbarch_swap *next;
3846 struct gdbarch_swap_registration
3849 unsigned long sizeof_data;
3850 gdbarch_swap_ftype *init;
3851 struct gdbarch_swap_registration *next;
3854 struct gdbarch_swap_registry
3857 struct gdbarch_swap_registration *registrations;
3860 struct gdbarch_swap_registry gdbarch_swap_registry =
3866 deprecated_register_gdbarch_swap (void *data,
3867 unsigned long sizeof_data,
3868 gdbarch_swap_ftype *init)
3870 struct gdbarch_swap_registration **rego;
3871 for (rego = &gdbarch_swap_registry.registrations;
3873 rego = &(*rego)->next);
3874 (*rego) = XMALLOC (struct gdbarch_swap_registration);
3875 (*rego)->next = NULL;
3876 (*rego)->init = init;
3877 (*rego)->data = data;
3878 (*rego)->sizeof_data = sizeof_data;
3882 current_gdbarch_swap_init_hack (void)
3884 struct gdbarch_swap_registration *rego;
3885 struct gdbarch_swap **curr = ¤t_gdbarch->swap;
3886 for (rego = gdbarch_swap_registry.registrations;
3890 if (rego->data != NULL)
3892 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
3893 struct gdbarch_swap);
3894 (*curr)->source = rego;
3895 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
3897 (*curr)->next = NULL;
3898 curr = &(*curr)->next;
3900 if (rego->init != NULL)
3905 static struct gdbarch *
3906 current_gdbarch_swap_out_hack (void)
3908 struct gdbarch *old_gdbarch = current_gdbarch;
3909 struct gdbarch_swap *curr;
3911 gdb_assert (old_gdbarch != NULL);
3912 for (curr = old_gdbarch->swap;
3916 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
3917 memset (curr->source->data, 0, curr->source->sizeof_data);
3919 current_gdbarch = NULL;
3924 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
3926 struct gdbarch_swap *curr;
3928 gdb_assert (current_gdbarch == NULL);
3929 for (curr = new_gdbarch->swap;
3932 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
3933 current_gdbarch = new_gdbarch;
3937 /* Keep a registry of the architectures known by GDB. */
3939 struct gdbarch_registration
3941 enum bfd_architecture bfd_architecture;
3942 gdbarch_init_ftype *init;
3943 gdbarch_dump_tdep_ftype *dump_tdep;
3944 struct gdbarch_list *arches;
3945 struct gdbarch_registration *next;
3948 static struct gdbarch_registration *gdbarch_registry = NULL;
3951 append_name (const char ***buf, int *nr, const char *name)
3953 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3959 gdbarch_printable_names (void)
3961 /* Accumulate a list of names based on the registed list of
3963 enum bfd_architecture a;
3965 const char **arches = NULL;
3966 struct gdbarch_registration *rego;
3967 for (rego = gdbarch_registry;
3971 const struct bfd_arch_info *ap;
3972 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3974 internal_error (__FILE__, __LINE__,
3975 "gdbarch_architecture_names: multi-arch unknown");
3978 append_name (&arches, &nr_arches, ap->printable_name);
3983 append_name (&arches, &nr_arches, NULL);
3989 gdbarch_register (enum bfd_architecture bfd_architecture,
3990 gdbarch_init_ftype *init,
3991 gdbarch_dump_tdep_ftype *dump_tdep)
3993 struct gdbarch_registration **curr;
3994 const struct bfd_arch_info *bfd_arch_info;
3995 /* Check that BFD recognizes this architecture */
3996 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3997 if (bfd_arch_info == NULL)
3999 internal_error (__FILE__, __LINE__,
4000 "gdbarch: Attempt to register unknown architecture (%d)",
4003 /* Check that we haven't seen this architecture before */
4004 for (curr = &gdbarch_registry;
4006 curr = &(*curr)->next)
4008 if (bfd_architecture == (*curr)->bfd_architecture)
4009 internal_error (__FILE__, __LINE__,
4010 "gdbarch: Duplicate registraration of architecture (%s)",
4011 bfd_arch_info->printable_name);
4015 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
4016 bfd_arch_info->printable_name,
4019 (*curr) = XMALLOC (struct gdbarch_registration);
4020 (*curr)->bfd_architecture = bfd_architecture;
4021 (*curr)->init = init;
4022 (*curr)->dump_tdep = dump_tdep;
4023 (*curr)->arches = NULL;
4024 (*curr)->next = NULL;
4028 register_gdbarch_init (enum bfd_architecture bfd_architecture,
4029 gdbarch_init_ftype *init)
4031 gdbarch_register (bfd_architecture, init, NULL);
4035 /* Look for an architecture using gdbarch_info. Base search on only
4036 BFD_ARCH_INFO and BYTE_ORDER. */
4038 struct gdbarch_list *
4039 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4040 const struct gdbarch_info *info)
4042 for (; arches != NULL; arches = arches->next)
4044 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4046 if (info->byte_order != arches->gdbarch->byte_order)
4048 if (info->osabi != arches->gdbarch->osabi)
4056 /* Find an architecture that matches the specified INFO. Create a new
4057 architecture if needed. Return that new architecture. Assumes
4058 that there is no current architecture. */
4060 static struct gdbarch *
4061 find_arch_by_info (struct gdbarch *old_gdbarch, struct gdbarch_info info)
4063 struct gdbarch *new_gdbarch;
4064 struct gdbarch_registration *rego;
4066 /* The existing architecture has been swapped out - all this code
4067 works from a clean slate. */
4068 gdb_assert (current_gdbarch == NULL);
4070 /* Fill in missing parts of the INFO struct using a number of
4071 sources: "set ..."; INFOabfd supplied; and the existing
4073 gdbarch_info_fill (old_gdbarch, &info);
4075 /* Must have found some sort of architecture. */
4076 gdb_assert (info.bfd_arch_info != NULL);
4080 fprintf_unfiltered (gdb_stdlog,
4081 "find_arch_by_info: info.bfd_arch_info %s\n",
4082 (info.bfd_arch_info != NULL
4083 ? info.bfd_arch_info->printable_name
4085 fprintf_unfiltered (gdb_stdlog,
4086 "find_arch_by_info: info.byte_order %d (%s)\n",
4088 (info.byte_order == BFD_ENDIAN_BIG ? "big"
4089 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
4091 fprintf_unfiltered (gdb_stdlog,
4092 "find_arch_by_info: info.osabi %d (%s)\n",
4093 info.osabi, gdbarch_osabi_name (info.osabi));
4094 fprintf_unfiltered (gdb_stdlog,
4095 "find_arch_by_info: info.abfd 0x%lx\n",
4097 fprintf_unfiltered (gdb_stdlog,
4098 "find_arch_by_info: info.tdep_info 0x%lx\n",
4099 (long) info.tdep_info);
4102 /* Find the tdep code that knows about this architecture. */
4103 for (rego = gdbarch_registry;
4106 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4111 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4112 "No matching architecture\n");
4116 /* Ask the tdep code for an architecture that matches "info". */
4117 new_gdbarch = rego->init (info, rego->arches);
4119 /* Did the tdep code like it? No. Reject the change and revert to
4120 the old architecture. */
4121 if (new_gdbarch == NULL)
4124 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4125 "Target rejected architecture\n");
4129 /* Is this a pre-existing architecture (as determined by already
4130 being initialized)? Move it to the front of the architecture
4131 list (keeping the list sorted Most Recently Used). */
4132 if (new_gdbarch->initialized_p)
4134 struct gdbarch_list **list;
4135 struct gdbarch_list *this;
4137 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4138 "Previous architecture 0x%08lx (%s) selected\n",
4140 new_gdbarch->bfd_arch_info->printable_name);
4141 /* Find the existing arch in the list. */
4142 for (list = ®o->arches;
4143 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4144 list = &(*list)->next);
4145 /* It had better be in the list of architectures. */
4146 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4149 (*list) = this->next;
4150 /* Insert THIS at the front. */
4151 this->next = rego->arches;
4152 rego->arches = this;
4157 /* It's a new architecture. */
4159 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4160 "New architecture 0x%08lx (%s) selected\n",
4162 new_gdbarch->bfd_arch_info->printable_name);
4164 /* Insert the new architecture into the front of the architecture
4165 list (keep the list sorted Most Recently Used). */
4167 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4168 this->next = rego->arches;
4169 this->gdbarch = new_gdbarch;
4170 rego->arches = this;
4173 /* Check that the newly installed architecture is valid. Plug in
4174 any post init values. */
4175 new_gdbarch->dump_tdep = rego->dump_tdep;
4176 verify_gdbarch (new_gdbarch);
4177 new_gdbarch->initialized_p = 1;
4179 /* Initialize any per-architecture swap areas. This phase requires
4180 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4181 swap the entire architecture out. */
4182 current_gdbarch = new_gdbarch;
4183 current_gdbarch_swap_init_hack ();
4184 current_gdbarch_swap_out_hack ();
4187 gdbarch_dump (new_gdbarch, gdb_stdlog);
4193 gdbarch_find_by_info (struct gdbarch_info info)
4195 /* Save the previously selected architecture, setting the global to
4196 NULL. This stops things like gdbarch->init() trying to use the
4197 previous architecture's configuration. The previous architecture
4198 may not even be of the same architecture family. The most recent
4199 architecture of the same family is found at the head of the
4200 rego->arches list. */
4201 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
4203 /* Find the specified architecture. */
4204 struct gdbarch *new_gdbarch = find_arch_by_info (old_gdbarch, info);
4206 /* Restore the existing architecture. */
4207 gdb_assert (current_gdbarch == NULL);
4208 current_gdbarch_swap_in_hack (old_gdbarch);
4213 /* Make the specified architecture current, swapping the existing one
4217 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
4219 gdb_assert (new_gdbarch != NULL);
4220 gdb_assert (current_gdbarch != NULL);
4221 gdb_assert (new_gdbarch->initialized_p);
4222 current_gdbarch_swap_out_hack ();
4223 current_gdbarch_swap_in_hack (new_gdbarch);
4224 architecture_changed_event ();
4227 extern void _initialize_gdbarch (void);
4230 _initialize_gdbarch (void)
4232 struct cmd_list_element *c;
4234 deprecated_add_show_from_set
4235 (add_set_cmd ("arch",
4238 (char *)&gdbarch_debug,
4239 "Set architecture debugging.\n\
4240 When non-zero, architecture debugging is enabled.", &setdebuglist),
4242 c = add_set_cmd ("archdebug",
4245 (char *)&gdbarch_debug,
4246 "Set architecture debugging.\n\
4247 When non-zero, architecture debugging is enabled.", &setlist);
4249 deprecate_cmd (c, "set debug arch");
4250 deprecate_cmd (deprecated_add_show_from_set (c, &showlist), "show debug arch");