1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA. */
25 /* This file was created with the aid of ``gdbarch.sh''.
27 The Bourne shell script ``gdbarch.sh'' creates the files
28 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
29 against the existing ``gdbarch.[hc]''. Any differences found
32 If editing this file, please also run gdbarch.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdbarch.sh and using its output may prove
39 #include "arch-utils.h"
42 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
45 #include "floatformat.h"
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
52 #include "gdb_obstack.h"
54 /* Static function declarations */
56 static void alloc_gdbarch_data (struct gdbarch
*);
58 /* Non-zero if we want to trace architecture code. */
61 #define GDBARCH_DEBUG 0
63 int gdbarch_debug
= GDBARCH_DEBUG
;
65 show_gdbarch_debug (struct ui_file
*file
, int from_tty
,
66 struct cmd_list_element
*c
, const char *value
)
68 fprintf_filtered (file
, _("Architecture debugging is %s.\n"), value
);
72 pformat (const struct floatformat
*format
)
81 /* Maintain the struct gdbarch object */
85 /* Has this architecture been fully initialized? */
88 /* An obstack bound to the lifetime of the architecture. */
89 struct obstack
*obstack
;
91 /* basic architectural information */
92 const struct bfd_arch_info
* bfd_arch_info
;
95 const struct target_desc
* target_desc
;
97 /* target specific vector. */
98 struct gdbarch_tdep
*tdep
;
99 gdbarch_dump_tdep_ftype
*dump_tdep
;
101 /* per-architecture data-pointers */
105 /* per-architecture swap-regions */
106 struct gdbarch_swap
*swap
;
108 /* Multi-arch values.
110 When extending this structure you must:
114 Declare set/get functions and define the corresponding
117 gdbarch_alloc(): If zero/NULL is not a suitable default,
118 initialize the new field.
120 verify_gdbarch(): Confirm that the target updated the field
123 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
126 ``startup_gdbarch()'': Append an initial value to the static
127 variable (base values on the host's c-type system).
129 get_gdbarch(): Implement the set/get functions (probably using
130 the macro's as shortcuts).
139 const struct floatformat
* float_format
;
141 const struct floatformat
* double_format
;
143 const struct floatformat
* long_double_format
;
148 gdbarch_read_pc_ftype
*read_pc
;
149 gdbarch_write_pc_ftype
*write_pc
;
150 gdbarch_read_sp_ftype
*read_sp
;
151 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
152 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
153 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
160 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
161 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
162 gdbarch_dwarf_reg_to_regnum_ftype
*dwarf_reg_to_regnum
;
163 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
164 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
165 gdbarch_register_name_ftype
*register_name
;
166 gdbarch_register_type_ftype
*register_type
;
167 gdbarch_deprecated_register_byte_ftype
*deprecated_register_byte
;
168 gdbarch_unwind_dummy_id_ftype
*unwind_dummy_id
;
169 int deprecated_fp_regnum
;
170 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
171 int deprecated_register_size
;
172 int call_dummy_location
;
173 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
174 gdbarch_print_registers_info_ftype
*print_registers_info
;
175 gdbarch_print_float_info_ftype
*print_float_info
;
176 gdbarch_print_vector_info_ftype
*print_vector_info
;
177 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
178 gdbarch_register_bytes_ok_ftype
*register_bytes_ok
;
179 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
180 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
181 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
182 int believe_pcc_promotion
;
183 gdbarch_convert_register_p_ftype
*convert_register_p
;
184 gdbarch_register_to_value_ftype
*register_to_value
;
185 gdbarch_value_to_register_ftype
*value_to_register
;
186 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
187 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
188 gdbarch_integer_to_address_ftype
*integer_to_address
;
189 gdbarch_deprecated_store_struct_return_ftype
*deprecated_store_struct_return
;
190 gdbarch_return_value_ftype
*return_value
;
191 gdbarch_extract_return_value_ftype
*extract_return_value
;
192 gdbarch_store_return_value_ftype
*store_return_value
;
193 gdbarch_deprecated_extract_return_value_ftype
*deprecated_extract_return_value
;
194 gdbarch_deprecated_store_return_value_ftype
*deprecated_store_return_value
;
195 gdbarch_deprecated_use_struct_convention_ftype
*deprecated_use_struct_convention
;
196 gdbarch_deprecated_extract_struct_value_address_ftype
*deprecated_extract_struct_value_address
;
197 gdbarch_skip_prologue_ftype
*skip_prologue
;
198 gdbarch_inner_than_ftype
*inner_than
;
199 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
200 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
201 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
202 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
203 CORE_ADDR decr_pc_after_break
;
204 CORE_ADDR deprecated_function_start_offset
;
205 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
206 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
207 CORE_ADDR frame_args_skip
;
208 gdbarch_unwind_pc_ftype
*unwind_pc
;
209 gdbarch_unwind_sp_ftype
*unwind_sp
;
210 gdbarch_frame_num_args_ftype
*frame_num_args
;
211 gdbarch_deprecated_stack_align_ftype
*deprecated_stack_align
;
212 gdbarch_frame_align_ftype
*frame_align
;
213 gdbarch_deprecated_reg_struct_has_addr_ftype
*deprecated_reg_struct_has_addr
;
214 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
215 int frame_red_zone_size
;
216 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
217 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
218 gdbarch_smash_text_address_ftype
*smash_text_address
;
219 gdbarch_software_single_step_ftype
*software_single_step
;
220 gdbarch_single_step_through_delay_ftype
*single_step_through_delay
;
221 gdbarch_print_insn_ftype
*print_insn
;
222 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
223 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
224 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
225 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
226 gdbarch_construct_inferior_arguments_ftype
*construct_inferior_arguments
;
227 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
228 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
229 const char * name_of_malloc
;
230 int cannot_step_breakpoint
;
231 int have_nonsteppable_watchpoint
;
232 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
233 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
234 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
235 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
236 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
237 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
241 /* The default architecture uses host values (for want of a better
244 extern const struct bfd_arch_info bfd_default_arch_struct
;
246 struct gdbarch startup_gdbarch
=
248 1, /* Always initialized. */
249 NULL
, /* The obstack. */
250 /* basic architecture information */
251 &bfd_default_arch_struct
, /* bfd_arch_info */
252 BFD_ENDIAN_BIG
, /* byte_order */
253 GDB_OSABI_UNKNOWN
, /* osabi */
255 /* target specific vector and its dump routine */
257 /*per-architecture data-pointers and swap regions */
259 /* Multi-arch values */
260 8 * sizeof (short), /* short_bit */
261 8 * sizeof (int), /* int_bit */
262 8 * sizeof (long), /* long_bit */
263 8 * sizeof (LONGEST
), /* long_long_bit */
264 8 * sizeof (float), /* float_bit */
265 0, /* float_format */
266 8 * sizeof (double), /* double_bit */
267 0, /* double_format */
268 8 * sizeof (long double), /* long_double_bit */
269 0, /* long_double_format */
270 8 * sizeof (void*), /* ptr_bit */
271 8 * sizeof (void*), /* addr_bit */
272 8 * sizeof (void*), /* bfd_vma_bit */
277 0, /* virtual_frame_pointer */
278 0, /* pseudo_register_read */
279 0, /* pseudo_register_write */
281 0, /* num_pseudo_regs */
286 0, /* stab_reg_to_regnum */
287 0, /* ecoff_reg_to_regnum */
288 0, /* dwarf_reg_to_regnum */
289 0, /* sdb_reg_to_regnum */
290 0, /* dwarf2_reg_to_regnum */
291 0, /* register_name */
292 0, /* register_type */
293 generic_register_byte
, /* deprecated_register_byte */
294 0, /* unwind_dummy_id */
295 -1, /* deprecated_fp_regnum */
296 0, /* push_dummy_call */
297 0, /* deprecated_register_size */
298 0, /* call_dummy_location */
299 0, /* push_dummy_code */
300 default_print_registers_info
, /* print_registers_info */
301 0, /* print_float_info */
302 0, /* print_vector_info */
303 0, /* register_sim_regno */
304 0, /* register_bytes_ok */
305 0, /* cannot_fetch_register */
306 0, /* cannot_store_register */
307 0, /* get_longjmp_target */
308 0, /* believe_pcc_promotion */
309 0, /* convert_register_p */
310 0, /* register_to_value */
311 0, /* value_to_register */
312 0, /* pointer_to_address */
313 0, /* address_to_pointer */
314 0, /* integer_to_address */
315 0, /* deprecated_store_struct_return */
316 0, /* return_value */
317 0, /* extract_return_value */
318 0, /* store_return_value */
319 0, /* deprecated_extract_return_value */
320 0, /* deprecated_store_return_value */
321 0, /* deprecated_use_struct_convention */
322 0, /* deprecated_extract_struct_value_address */
323 0, /* skip_prologue */
325 0, /* breakpoint_from_pc */
326 0, /* adjust_breakpoint_address */
327 0, /* memory_insert_breakpoint */
328 0, /* memory_remove_breakpoint */
329 0, /* decr_pc_after_break */
330 0, /* deprecated_function_start_offset */
331 generic_remote_translate_xfer_address
, /* remote_translate_xfer_address */
332 0, /* fetch_tls_load_module_address */
333 0, /* frame_args_skip */
336 0, /* frame_num_args */
337 0, /* deprecated_stack_align */
339 0, /* deprecated_reg_struct_has_addr */
340 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
341 0, /* frame_red_zone_size */
342 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
343 0, /* addr_bits_remove */
344 0, /* smash_text_address */
345 0, /* software_single_step */
346 0, /* single_step_through_delay */
348 0, /* skip_trampoline_code */
349 generic_skip_solib_resolver
, /* skip_solib_resolver */
350 0, /* in_solib_return_trampoline */
351 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
352 construct_inferior_arguments
, /* construct_inferior_arguments */
353 0, /* elf_make_msymbol_special */
354 0, /* coff_make_msymbol_special */
355 "malloc", /* name_of_malloc */
356 0, /* cannot_step_breakpoint */
357 0, /* have_nonsteppable_watchpoint */
358 0, /* address_class_type_flags */
359 0, /* address_class_type_flags_to_name */
360 0, /* address_class_name_to_type_flags */
361 default_register_reggroup_p
, /* register_reggroup_p */
362 0, /* fetch_pointer_argument */
363 0, /* regset_from_core_section */
364 /* startup_gdbarch() */
367 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
369 /* Create a new ``struct gdbarch'' based on information provided by
370 ``struct gdbarch_info''. */
373 gdbarch_alloc (const struct gdbarch_info
*info
,
374 struct gdbarch_tdep
*tdep
)
376 /* NOTE: The new architecture variable is named ``current_gdbarch''
377 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
378 the current local architecture and not the previous global
379 architecture. This ensures that the new architectures initial
380 values are not influenced by the previous architecture. Once
381 everything is parameterised with gdbarch, this will go away. */
382 struct gdbarch
*current_gdbarch
;
384 /* Create an obstack for allocating all the per-architecture memory,
385 then use that to allocate the architecture vector. */
386 struct obstack
*obstack
= XMALLOC (struct obstack
);
387 obstack_init (obstack
);
388 current_gdbarch
= obstack_alloc (obstack
, sizeof (*current_gdbarch
));
389 memset (current_gdbarch
, 0, sizeof (*current_gdbarch
));
390 current_gdbarch
->obstack
= obstack
;
392 alloc_gdbarch_data (current_gdbarch
);
394 current_gdbarch
->tdep
= tdep
;
396 current_gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
397 current_gdbarch
->byte_order
= info
->byte_order
;
398 current_gdbarch
->osabi
= info
->osabi
;
399 current_gdbarch
->target_desc
= info
->target_desc
;
401 /* Force the explicit initialization of these. */
402 current_gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
403 current_gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
404 current_gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
405 current_gdbarch
->long_long_bit
= 2*TARGET_LONG_BIT
;
406 current_gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
407 current_gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
408 current_gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
409 current_gdbarch
->ptr_bit
= TARGET_INT_BIT
;
410 current_gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
411 current_gdbarch
->char_signed
= -1;
412 current_gdbarch
->write_pc
= generic_target_write_pc
;
413 current_gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
414 current_gdbarch
->num_regs
= -1;
415 current_gdbarch
->sp_regnum
= -1;
416 current_gdbarch
->pc_regnum
= -1;
417 current_gdbarch
->ps_regnum
= -1;
418 current_gdbarch
->fp0_regnum
= -1;
419 current_gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
420 current_gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
421 current_gdbarch
->dwarf_reg_to_regnum
= no_op_reg_to_regnum
;
422 current_gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
423 current_gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
424 current_gdbarch
->deprecated_register_byte
= generic_register_byte
;
425 current_gdbarch
->deprecated_fp_regnum
= -1;
426 current_gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
427 current_gdbarch
->print_registers_info
= default_print_registers_info
;
428 current_gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
429 current_gdbarch
->cannot_fetch_register
= cannot_register_not
;
430 current_gdbarch
->cannot_store_register
= cannot_register_not
;
431 current_gdbarch
->convert_register_p
= generic_convert_register_p
;
432 current_gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
433 current_gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
434 current_gdbarch
->return_value
= legacy_return_value
;
435 current_gdbarch
->extract_return_value
= legacy_extract_return_value
;
436 current_gdbarch
->store_return_value
= legacy_store_return_value
;
437 current_gdbarch
->deprecated_use_struct_convention
= generic_use_struct_convention
;
438 current_gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
439 current_gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
440 current_gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
441 current_gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
442 current_gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
443 current_gdbarch
->addr_bits_remove
= core_addr_identity
;
444 current_gdbarch
->smash_text_address
= core_addr_identity
;
445 current_gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
446 current_gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
447 current_gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
448 current_gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
449 current_gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
450 current_gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
451 current_gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
452 current_gdbarch
->name_of_malloc
= "malloc";
453 current_gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
454 /* gdbarch_alloc() */
456 return current_gdbarch
;
460 /* Allocate extra space using the per-architecture obstack. */
463 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
465 void *data
= obstack_alloc (arch
->obstack
, size
);
466 memset (data
, 0, size
);
471 /* Free a gdbarch struct. This should never happen in normal
472 operation --- once you've created a gdbarch, you keep it around.
473 However, if an architecture's init function encounters an error
474 building the structure, it may need to clean up a partially
475 constructed gdbarch. */
478 gdbarch_free (struct gdbarch
*arch
)
480 struct obstack
*obstack
;
481 gdb_assert (arch
!= NULL
);
482 gdb_assert (!arch
->initialized_p
);
483 obstack
= arch
->obstack
;
484 obstack_free (obstack
, 0); /* Includes the ARCH. */
489 /* Ensure that all values in a GDBARCH are reasonable. */
491 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
492 just happens to match the global variable ``current_gdbarch''. That
493 way macros refering to that variable get the local and not the global
494 version - ulgh. Once everything is parameterised with gdbarch, this
498 verify_gdbarch (struct gdbarch
*current_gdbarch
)
501 struct cleanup
*cleanups
;
504 log
= mem_fileopen ();
505 cleanups
= make_cleanup_ui_file_delete (log
);
507 if (current_gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
508 fprintf_unfiltered (log
, "\n\tbyte-order");
509 if (current_gdbarch
->bfd_arch_info
== NULL
)
510 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
511 /* Check those that need to be defined for the given multi-arch level. */
512 /* Skip verify of short_bit, invalid_p == 0 */
513 /* Skip verify of int_bit, invalid_p == 0 */
514 /* Skip verify of long_bit, invalid_p == 0 */
515 /* Skip verify of long_long_bit, invalid_p == 0 */
516 /* Skip verify of float_bit, invalid_p == 0 */
517 if (current_gdbarch
->float_format
== 0)
518 current_gdbarch
->float_format
= default_float_format (current_gdbarch
);
519 /* Skip verify of double_bit, invalid_p == 0 */
520 if (current_gdbarch
->double_format
== 0)
521 current_gdbarch
->double_format
= default_double_format (current_gdbarch
);
522 /* Skip verify of long_double_bit, invalid_p == 0 */
523 if (current_gdbarch
->long_double_format
== 0)
524 current_gdbarch
->long_double_format
= default_double_format (current_gdbarch
);
525 /* Skip verify of ptr_bit, invalid_p == 0 */
526 if (current_gdbarch
->addr_bit
== 0)
527 current_gdbarch
->addr_bit
= TARGET_PTR_BIT
;
528 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
529 if (current_gdbarch
->char_signed
== -1)
530 current_gdbarch
->char_signed
= 1;
531 /* Skip verify of read_pc, has predicate */
532 /* Skip verify of write_pc, invalid_p == 0 */
533 /* Skip verify of read_sp, has predicate */
534 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
535 /* Skip verify of pseudo_register_read, has predicate */
536 /* Skip verify of pseudo_register_write, has predicate */
537 if (current_gdbarch
->num_regs
== -1)
538 fprintf_unfiltered (log
, "\n\tnum_regs");
539 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
540 /* Skip verify of sp_regnum, invalid_p == 0 */
541 /* Skip verify of pc_regnum, invalid_p == 0 */
542 /* Skip verify of ps_regnum, invalid_p == 0 */
543 /* Skip verify of fp0_regnum, invalid_p == 0 */
544 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
545 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
546 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
547 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
548 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
549 /* Skip verify of register_type, has predicate */
550 /* Skip verify of deprecated_register_byte, has predicate */
551 /* Skip verify of unwind_dummy_id, has predicate */
552 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
553 /* Skip verify of push_dummy_call, has predicate */
554 /* Skip verify of call_dummy_location, invalid_p == 0 */
555 /* Skip verify of push_dummy_code, has predicate */
556 /* Skip verify of print_registers_info, invalid_p == 0 */
557 /* Skip verify of print_float_info, has predicate */
558 /* Skip verify of print_vector_info, has predicate */
559 /* Skip verify of register_sim_regno, invalid_p == 0 */
560 /* Skip verify of register_bytes_ok, has predicate */
561 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
562 /* Skip verify of cannot_store_register, invalid_p == 0 */
563 /* Skip verify of get_longjmp_target, has predicate */
564 /* Skip verify of convert_register_p, invalid_p == 0 */
565 /* Skip verify of pointer_to_address, invalid_p == 0 */
566 /* Skip verify of address_to_pointer, invalid_p == 0 */
567 /* Skip verify of integer_to_address, has predicate */
568 /* Skip verify of deprecated_store_struct_return, has predicate */
569 /* Skip verify of return_value, has predicate */
570 /* Skip verify of extract_return_value, invalid_p == 0 */
571 /* Skip verify of store_return_value, invalid_p == 0 */
572 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
573 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
574 if (current_gdbarch
->skip_prologue
== 0)
575 fprintf_unfiltered (log
, "\n\tskip_prologue");
576 if (current_gdbarch
->inner_than
== 0)
577 fprintf_unfiltered (log
, "\n\tinner_than");
578 if (current_gdbarch
->breakpoint_from_pc
== 0)
579 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
580 /* Skip verify of adjust_breakpoint_address, has predicate */
581 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
582 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
583 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
584 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
585 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
586 /* Skip verify of fetch_tls_load_module_address, has predicate */
587 /* Skip verify of frame_args_skip, invalid_p == 0 */
588 /* Skip verify of unwind_pc, has predicate */
589 /* Skip verify of unwind_sp, has predicate */
590 /* Skip verify of frame_num_args, has predicate */
591 /* Skip verify of deprecated_stack_align, has predicate */
592 /* Skip verify of frame_align, has predicate */
593 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
594 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
595 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
596 /* Skip verify of addr_bits_remove, invalid_p == 0 */
597 /* Skip verify of smash_text_address, invalid_p == 0 */
598 /* Skip verify of software_single_step, has predicate */
599 /* Skip verify of single_step_through_delay, has predicate */
600 if (current_gdbarch
->print_insn
== 0)
601 fprintf_unfiltered (log
, "\n\tprint_insn");
602 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
603 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
604 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
605 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
606 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
607 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
608 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
609 /* Skip verify of name_of_malloc, invalid_p == 0 */
610 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
611 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
612 /* Skip verify of address_class_type_flags, has predicate */
613 /* Skip verify of address_class_type_flags_to_name, has predicate */
614 /* Skip verify of address_class_name_to_type_flags, has predicate */
615 /* Skip verify of register_reggroup_p, invalid_p == 0 */
616 /* Skip verify of fetch_pointer_argument, has predicate */
617 /* Skip verify of regset_from_core_section, has predicate */
618 buf
= ui_file_xstrdup (log
, &dummy
);
619 make_cleanup (xfree
, buf
);
620 if (strlen (buf
) > 0)
621 internal_error (__FILE__
, __LINE__
,
622 _("verify_gdbarch: the following are invalid ...%s"),
624 do_cleanups (cleanups
);
628 /* Print out the details of the current architecture. */
630 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
631 just happens to match the global variable ``current_gdbarch''. That
632 way macros refering to that variable get the local and not the global
633 version - ulgh. Once everything is parameterised with gdbarch, this
637 gdbarch_dump (struct gdbarch
*current_gdbarch
, struct ui_file
*file
)
639 const char *gdb_xm_file
= "<not-defined>";
640 const char *gdb_nm_file
= "<not-defined>";
641 const char *gdb_tm_file
= "<not-defined>";
642 #if defined (GDB_XM_FILE)
643 gdb_xm_file
= GDB_XM_FILE
;
645 fprintf_unfiltered (file
,
646 "gdbarch_dump: GDB_XM_FILE = %s\n",
648 #if defined (GDB_NM_FILE)
649 gdb_nm_file
= GDB_NM_FILE
;
651 fprintf_unfiltered (file
,
652 "gdbarch_dump: GDB_NM_FILE = %s\n",
654 #if defined (GDB_TM_FILE)
655 gdb_tm_file
= GDB_TM_FILE
;
657 fprintf_unfiltered (file
,
658 "gdbarch_dump: GDB_TM_FILE = %s\n",
660 #ifdef TARGET_ADDR_BIT
661 fprintf_unfiltered (file
,
662 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
663 XSTRING (TARGET_ADDR_BIT
));
665 fprintf_unfiltered (file
,
666 "gdbarch_dump: addr_bit = %s\n",
667 paddr_d (current_gdbarch
->addr_bit
));
668 #ifdef ADDR_BITS_REMOVE
669 fprintf_unfiltered (file
,
670 "gdbarch_dump: %s # %s\n",
671 "ADDR_BITS_REMOVE(addr)",
672 XSTRING (ADDR_BITS_REMOVE (addr
)));
674 fprintf_unfiltered (file
,
675 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
676 (long) current_gdbarch
->addr_bits_remove
);
677 fprintf_unfiltered (file
,
678 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
679 gdbarch_address_class_name_to_type_flags_p (current_gdbarch
));
680 fprintf_unfiltered (file
,
681 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
682 (long) current_gdbarch
->address_class_name_to_type_flags
);
683 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
684 fprintf_unfiltered (file
,
685 "gdbarch_dump: %s # %s\n",
686 "ADDRESS_CLASS_TYPE_FLAGS_P()",
687 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
689 fprintf_unfiltered (file
,
690 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
691 gdbarch_address_class_type_flags_p (current_gdbarch
));
692 #ifdef ADDRESS_CLASS_TYPE_FLAGS
693 fprintf_unfiltered (file
,
694 "gdbarch_dump: %s # %s\n",
695 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
696 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size
, dwarf2_addr_class
)));
698 fprintf_unfiltered (file
,
699 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
700 (long) current_gdbarch
->address_class_type_flags
);
701 fprintf_unfiltered (file
,
702 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
703 gdbarch_address_class_type_flags_to_name_p (current_gdbarch
));
704 fprintf_unfiltered (file
,
705 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
706 (long) current_gdbarch
->address_class_type_flags_to_name
);
707 #ifdef ADDRESS_TO_POINTER
708 fprintf_unfiltered (file
,
709 "gdbarch_dump: %s # %s\n",
710 "ADDRESS_TO_POINTER(type, buf, addr)",
711 XSTRING (ADDRESS_TO_POINTER (type
, buf
, addr
)));
713 fprintf_unfiltered (file
,
714 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
715 (long) current_gdbarch
->address_to_pointer
);
716 fprintf_unfiltered (file
,
717 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
718 gdbarch_adjust_breakpoint_address_p (current_gdbarch
));
719 fprintf_unfiltered (file
,
720 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
721 (long) current_gdbarch
->adjust_breakpoint_address
);
722 #ifdef BELIEVE_PCC_PROMOTION
723 fprintf_unfiltered (file
,
724 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
725 XSTRING (BELIEVE_PCC_PROMOTION
));
727 fprintf_unfiltered (file
,
728 "gdbarch_dump: believe_pcc_promotion = %s\n",
729 paddr_d (current_gdbarch
->believe_pcc_promotion
));
730 #ifdef TARGET_ARCHITECTURE
731 fprintf_unfiltered (file
,
732 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
733 XSTRING (TARGET_ARCHITECTURE
));
735 fprintf_unfiltered (file
,
736 "gdbarch_dump: bfd_arch_info = %s\n",
737 TARGET_ARCHITECTURE
->printable_name
);
738 #ifdef TARGET_BFD_VMA_BIT
739 fprintf_unfiltered (file
,
740 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
741 XSTRING (TARGET_BFD_VMA_BIT
));
743 fprintf_unfiltered (file
,
744 "gdbarch_dump: bfd_vma_bit = %s\n",
745 paddr_d (current_gdbarch
->bfd_vma_bit
));
746 #ifdef BREAKPOINT_FROM_PC
747 fprintf_unfiltered (file
,
748 "gdbarch_dump: %s # %s\n",
749 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
750 XSTRING (BREAKPOINT_FROM_PC (pcptr
, lenptr
)));
752 fprintf_unfiltered (file
,
753 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
754 (long) current_gdbarch
->breakpoint_from_pc
);
755 #ifdef TARGET_BYTE_ORDER
756 fprintf_unfiltered (file
,
757 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
758 XSTRING (TARGET_BYTE_ORDER
));
760 fprintf_unfiltered (file
,
761 "gdbarch_dump: byte_order = %s\n",
762 paddr_d (current_gdbarch
->byte_order
));
763 #ifdef CALL_DUMMY_LOCATION
764 fprintf_unfiltered (file
,
765 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
766 XSTRING (CALL_DUMMY_LOCATION
));
768 fprintf_unfiltered (file
,
769 "gdbarch_dump: call_dummy_location = %s\n",
770 paddr_d (current_gdbarch
->call_dummy_location
));
771 #ifdef CANNOT_FETCH_REGISTER
772 fprintf_unfiltered (file
,
773 "gdbarch_dump: %s # %s\n",
774 "CANNOT_FETCH_REGISTER(regnum)",
775 XSTRING (CANNOT_FETCH_REGISTER (regnum
)));
777 fprintf_unfiltered (file
,
778 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
779 (long) current_gdbarch
->cannot_fetch_register
);
780 #ifdef CANNOT_STEP_BREAKPOINT
781 fprintf_unfiltered (file
,
782 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
783 XSTRING (CANNOT_STEP_BREAKPOINT
));
785 fprintf_unfiltered (file
,
786 "gdbarch_dump: cannot_step_breakpoint = %s\n",
787 paddr_d (current_gdbarch
->cannot_step_breakpoint
));
788 #ifdef CANNOT_STORE_REGISTER
789 fprintf_unfiltered (file
,
790 "gdbarch_dump: %s # %s\n",
791 "CANNOT_STORE_REGISTER(regnum)",
792 XSTRING (CANNOT_STORE_REGISTER (regnum
)));
794 fprintf_unfiltered (file
,
795 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
796 (long) current_gdbarch
->cannot_store_register
);
797 #ifdef TARGET_CHAR_SIGNED
798 fprintf_unfiltered (file
,
799 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
800 XSTRING (TARGET_CHAR_SIGNED
));
802 fprintf_unfiltered (file
,
803 "gdbarch_dump: char_signed = %s\n",
804 paddr_d (current_gdbarch
->char_signed
));
805 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
806 fprintf_unfiltered (file
,
807 "gdbarch_dump: %s # %s\n",
808 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
809 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val
, msym
)));
811 fprintf_unfiltered (file
,
812 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
813 (long) current_gdbarch
->coff_make_msymbol_special
);
814 fprintf_unfiltered (file
,
815 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
816 (long) current_gdbarch
->construct_inferior_arguments
);
817 fprintf_unfiltered (file
,
818 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
819 (long) current_gdbarch
->convert_from_func_ptr_addr
);
820 #ifdef CONVERT_REGISTER_P
821 fprintf_unfiltered (file
,
822 "gdbarch_dump: %s # %s\n",
823 "CONVERT_REGISTER_P(regnum, type)",
824 XSTRING (CONVERT_REGISTER_P (regnum
, type
)));
826 fprintf_unfiltered (file
,
827 "gdbarch_dump: convert_register_p = <0x%lx>\n",
828 (long) current_gdbarch
->convert_register_p
);
829 #ifdef DECR_PC_AFTER_BREAK
830 fprintf_unfiltered (file
,
831 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
832 XSTRING (DECR_PC_AFTER_BREAK
));
834 fprintf_unfiltered (file
,
835 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
836 paddr_nz (current_gdbarch
->decr_pc_after_break
));
837 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
838 fprintf_unfiltered (file
,
839 "gdbarch_dump: %s # %s\n",
840 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
841 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type
, regbuf
, valbuf
)));
843 fprintf_unfiltered (file
,
844 "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n",
845 (long) current_gdbarch
->deprecated_extract_return_value
);
846 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
847 fprintf_unfiltered (file
,
848 "gdbarch_dump: %s # %s\n",
849 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
850 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
852 fprintf_unfiltered (file
,
853 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
854 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch
));
855 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
856 fprintf_unfiltered (file
,
857 "gdbarch_dump: %s # %s\n",
858 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
859 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache
)));
861 fprintf_unfiltered (file
,
862 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
863 (long) current_gdbarch
->deprecated_extract_struct_value_address
);
864 #ifdef DEPRECATED_FP_REGNUM
865 fprintf_unfiltered (file
,
866 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
867 XSTRING (DEPRECATED_FP_REGNUM
));
869 fprintf_unfiltered (file
,
870 "gdbarch_dump: deprecated_fp_regnum = %s\n",
871 paddr_d (current_gdbarch
->deprecated_fp_regnum
));
872 #ifdef DEPRECATED_FUNCTION_START_OFFSET
873 fprintf_unfiltered (file
,
874 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
875 XSTRING (DEPRECATED_FUNCTION_START_OFFSET
));
877 fprintf_unfiltered (file
,
878 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
879 paddr_nz (current_gdbarch
->deprecated_function_start_offset
));
880 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
881 fprintf_unfiltered (file
,
882 "gdbarch_dump: %s # %s\n",
883 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
884 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
886 fprintf_unfiltered (file
,
887 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
888 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch
));
889 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
890 fprintf_unfiltered (file
,
891 "gdbarch_dump: %s # %s\n",
892 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
893 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p
, type
)));
895 fprintf_unfiltered (file
,
896 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
897 (long) current_gdbarch
->deprecated_reg_struct_has_addr
);
898 #ifdef DEPRECATED_REGISTER_BYTE_P
899 fprintf_unfiltered (file
,
900 "gdbarch_dump: %s # %s\n",
901 "DEPRECATED_REGISTER_BYTE_P()",
902 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
904 fprintf_unfiltered (file
,
905 "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n",
906 gdbarch_deprecated_register_byte_p (current_gdbarch
));
907 #ifdef DEPRECATED_REGISTER_BYTE
908 fprintf_unfiltered (file
,
909 "gdbarch_dump: %s # %s\n",
910 "DEPRECATED_REGISTER_BYTE(reg_nr)",
911 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr
)));
913 fprintf_unfiltered (file
,
914 "gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
915 (long) current_gdbarch
->deprecated_register_byte
);
916 #ifdef DEPRECATED_REGISTER_SIZE
917 fprintf_unfiltered (file
,
918 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
919 XSTRING (DEPRECATED_REGISTER_SIZE
));
921 fprintf_unfiltered (file
,
922 "gdbarch_dump: deprecated_register_size = %s\n",
923 paddr_d (current_gdbarch
->deprecated_register_size
));
924 #ifdef DEPRECATED_STACK_ALIGN_P
925 fprintf_unfiltered (file
,
926 "gdbarch_dump: %s # %s\n",
927 "DEPRECATED_STACK_ALIGN_P()",
928 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
930 fprintf_unfiltered (file
,
931 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
932 gdbarch_deprecated_stack_align_p (current_gdbarch
));
933 #ifdef DEPRECATED_STACK_ALIGN
934 fprintf_unfiltered (file
,
935 "gdbarch_dump: %s # %s\n",
936 "DEPRECATED_STACK_ALIGN(sp)",
937 XSTRING (DEPRECATED_STACK_ALIGN (sp
)));
939 fprintf_unfiltered (file
,
940 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
941 (long) current_gdbarch
->deprecated_stack_align
);
942 #ifdef DEPRECATED_STORE_RETURN_VALUE
943 fprintf_unfiltered (file
,
944 "gdbarch_dump: %s # %s\n",
945 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
946 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type
, valbuf
)));
948 fprintf_unfiltered (file
,
949 "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n",
950 (long) current_gdbarch
->deprecated_store_return_value
);
951 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
952 fprintf_unfiltered (file
,
953 "gdbarch_dump: %s # %s\n",
954 "DEPRECATED_STORE_STRUCT_RETURN_P()",
955 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
957 fprintf_unfiltered (file
,
958 "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
959 gdbarch_deprecated_store_struct_return_p (current_gdbarch
));
960 #ifdef DEPRECATED_STORE_STRUCT_RETURN
961 fprintf_unfiltered (file
,
962 "gdbarch_dump: %s # %s\n",
963 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
964 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr
, sp
)));
966 fprintf_unfiltered (file
,
967 "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
968 (long) current_gdbarch
->deprecated_store_struct_return
);
969 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
970 fprintf_unfiltered (file
,
971 "gdbarch_dump: %s # %s\n",
972 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
973 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p
, value_type
)));
975 fprintf_unfiltered (file
,
976 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
977 (long) current_gdbarch
->deprecated_use_struct_convention
);
978 #ifdef TARGET_DOUBLE_BIT
979 fprintf_unfiltered (file
,
980 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
981 XSTRING (TARGET_DOUBLE_BIT
));
983 fprintf_unfiltered (file
,
984 "gdbarch_dump: double_bit = %s\n",
985 paddr_d (current_gdbarch
->double_bit
));
986 #ifdef TARGET_DOUBLE_FORMAT
987 fprintf_unfiltered (file
,
988 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
989 XSTRING (TARGET_DOUBLE_FORMAT
));
991 fprintf_unfiltered (file
,
992 "gdbarch_dump: double_format = %s\n",
993 pformat (current_gdbarch
->double_format
));
994 #ifdef DWARF2_REG_TO_REGNUM
995 fprintf_unfiltered (file
,
996 "gdbarch_dump: %s # %s\n",
997 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
998 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr
)));
1000 fprintf_unfiltered (file
,
1001 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
1002 (long) current_gdbarch
->dwarf2_reg_to_regnum
);
1003 #ifdef DWARF_REG_TO_REGNUM
1004 fprintf_unfiltered (file
,
1005 "gdbarch_dump: %s # %s\n",
1006 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1007 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr
)));
1009 fprintf_unfiltered (file
,
1010 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
1011 (long) current_gdbarch
->dwarf_reg_to_regnum
);
1012 #ifdef ECOFF_REG_TO_REGNUM
1013 fprintf_unfiltered (file
,
1014 "gdbarch_dump: %s # %s\n",
1015 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1016 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr
)));
1018 fprintf_unfiltered (file
,
1019 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
1020 (long) current_gdbarch
->ecoff_reg_to_regnum
);
1021 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1022 fprintf_unfiltered (file
,
1023 "gdbarch_dump: %s # %s\n",
1024 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1025 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym
, msym
)));
1027 fprintf_unfiltered (file
,
1028 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
1029 (long) current_gdbarch
->elf_make_msymbol_special
);
1030 #ifdef EXTRACT_RETURN_VALUE
1031 fprintf_unfiltered (file
,
1032 "gdbarch_dump: %s # %s\n",
1033 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1034 XSTRING (EXTRACT_RETURN_VALUE (type
, regcache
, valbuf
)));
1036 fprintf_unfiltered (file
,
1037 "gdbarch_dump: extract_return_value = <0x%lx>\n",
1038 (long) current_gdbarch
->extract_return_value
);
1039 #ifdef FETCH_POINTER_ARGUMENT_P
1040 fprintf_unfiltered (file
,
1041 "gdbarch_dump: %s # %s\n",
1042 "FETCH_POINTER_ARGUMENT_P()",
1043 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1045 fprintf_unfiltered (file
,
1046 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
1047 gdbarch_fetch_pointer_argument_p (current_gdbarch
));
1048 #ifdef FETCH_POINTER_ARGUMENT
1049 fprintf_unfiltered (file
,
1050 "gdbarch_dump: %s # %s\n",
1051 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1052 XSTRING (FETCH_POINTER_ARGUMENT (frame
, argi
, type
)));
1054 fprintf_unfiltered (file
,
1055 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1056 (long) current_gdbarch
->fetch_pointer_argument
);
1057 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS_P
1058 fprintf_unfiltered (file
,
1059 "gdbarch_dump: %s # %s\n",
1060 "FETCH_TLS_LOAD_MODULE_ADDRESS_P()",
1061 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS_P ()));
1063 fprintf_unfiltered (file
,
1064 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
1065 gdbarch_fetch_tls_load_module_address_p (current_gdbarch
));
1066 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS
1067 fprintf_unfiltered (file
,
1068 "gdbarch_dump: %s # %s\n",
1069 "FETCH_TLS_LOAD_MODULE_ADDRESS(objfile)",
1070 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS (objfile
)));
1072 fprintf_unfiltered (file
,
1073 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
1074 (long) current_gdbarch
->fetch_tls_load_module_address
);
1075 #ifdef TARGET_FLOAT_BIT
1076 fprintf_unfiltered (file
,
1077 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1078 XSTRING (TARGET_FLOAT_BIT
));
1080 fprintf_unfiltered (file
,
1081 "gdbarch_dump: float_bit = %s\n",
1082 paddr_d (current_gdbarch
->float_bit
));
1083 #ifdef TARGET_FLOAT_FORMAT
1084 fprintf_unfiltered (file
,
1085 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1086 XSTRING (TARGET_FLOAT_FORMAT
));
1088 fprintf_unfiltered (file
,
1089 "gdbarch_dump: float_format = %s\n",
1090 pformat (current_gdbarch
->float_format
));
1092 fprintf_unfiltered (file
,
1093 "gdbarch_dump: FP0_REGNUM # %s\n",
1094 XSTRING (FP0_REGNUM
));
1096 fprintf_unfiltered (file
,
1097 "gdbarch_dump: fp0_regnum = %s\n",
1098 paddr_d (current_gdbarch
->fp0_regnum
));
1099 fprintf_unfiltered (file
,
1100 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1101 gdbarch_frame_align_p (current_gdbarch
));
1102 fprintf_unfiltered (file
,
1103 "gdbarch_dump: frame_align = <0x%lx>\n",
1104 (long) current_gdbarch
->frame_align
);
1105 #ifdef FRAME_ARGS_SKIP
1106 fprintf_unfiltered (file
,
1107 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1108 XSTRING (FRAME_ARGS_SKIP
));
1110 fprintf_unfiltered (file
,
1111 "gdbarch_dump: frame_args_skip = 0x%s\n",
1112 paddr_nz (current_gdbarch
->frame_args_skip
));
1113 #ifdef FRAME_NUM_ARGS_P
1114 fprintf_unfiltered (file
,
1115 "gdbarch_dump: %s # %s\n",
1116 "FRAME_NUM_ARGS_P()",
1117 XSTRING (FRAME_NUM_ARGS_P ()));
1119 fprintf_unfiltered (file
,
1120 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1121 gdbarch_frame_num_args_p (current_gdbarch
));
1122 #ifdef FRAME_NUM_ARGS
1123 fprintf_unfiltered (file
,
1124 "gdbarch_dump: %s # %s\n",
1125 "FRAME_NUM_ARGS(frame)",
1126 XSTRING (FRAME_NUM_ARGS (frame
)));
1128 fprintf_unfiltered (file
,
1129 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1130 (long) current_gdbarch
->frame_num_args
);
1131 #ifdef FRAME_RED_ZONE_SIZE
1132 fprintf_unfiltered (file
,
1133 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1134 XSTRING (FRAME_RED_ZONE_SIZE
));
1136 fprintf_unfiltered (file
,
1137 "gdbarch_dump: frame_red_zone_size = %s\n",
1138 paddr_d (current_gdbarch
->frame_red_zone_size
));
1139 #ifdef GET_LONGJMP_TARGET_P
1140 fprintf_unfiltered (file
,
1141 "gdbarch_dump: %s # %s\n",
1142 "GET_LONGJMP_TARGET_P()",
1143 XSTRING (GET_LONGJMP_TARGET_P ()));
1145 fprintf_unfiltered (file
,
1146 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1147 gdbarch_get_longjmp_target_p (current_gdbarch
));
1148 #ifdef GET_LONGJMP_TARGET
1149 fprintf_unfiltered (file
,
1150 "gdbarch_dump: %s # %s\n",
1151 "GET_LONGJMP_TARGET(pc)",
1152 XSTRING (GET_LONGJMP_TARGET (pc
)));
1154 fprintf_unfiltered (file
,
1155 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1156 (long) current_gdbarch
->get_longjmp_target
);
1157 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1158 fprintf_unfiltered (file
,
1159 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1160 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT
));
1162 fprintf_unfiltered (file
,
1163 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1164 paddr_d (current_gdbarch
->have_nonsteppable_watchpoint
));
1165 fprintf_unfiltered (file
,
1166 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1167 (long) current_gdbarch
->in_function_epilogue_p
);
1168 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1169 fprintf_unfiltered (file
,
1170 "gdbarch_dump: %s # %s\n",
1171 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1172 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc
, name
)));
1174 fprintf_unfiltered (file
,
1175 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1176 (long) current_gdbarch
->in_solib_return_trampoline
);
1178 fprintf_unfiltered (file
,
1179 "gdbarch_dump: %s # %s\n",
1180 "INNER_THAN(lhs, rhs)",
1181 XSTRING (INNER_THAN (lhs
, rhs
)));
1183 fprintf_unfiltered (file
,
1184 "gdbarch_dump: inner_than = <0x%lx>\n",
1185 (long) current_gdbarch
->inner_than
);
1186 #ifdef TARGET_INT_BIT
1187 fprintf_unfiltered (file
,
1188 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1189 XSTRING (TARGET_INT_BIT
));
1191 fprintf_unfiltered (file
,
1192 "gdbarch_dump: int_bit = %s\n",
1193 paddr_d (current_gdbarch
->int_bit
));
1194 fprintf_unfiltered (file
,
1195 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1196 gdbarch_integer_to_address_p (current_gdbarch
));
1197 fprintf_unfiltered (file
,
1198 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1199 (long) current_gdbarch
->integer_to_address
);
1200 #ifdef TARGET_LONG_BIT
1201 fprintf_unfiltered (file
,
1202 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1203 XSTRING (TARGET_LONG_BIT
));
1205 fprintf_unfiltered (file
,
1206 "gdbarch_dump: long_bit = %s\n",
1207 paddr_d (current_gdbarch
->long_bit
));
1208 #ifdef TARGET_LONG_DOUBLE_BIT
1209 fprintf_unfiltered (file
,
1210 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1211 XSTRING (TARGET_LONG_DOUBLE_BIT
));
1213 fprintf_unfiltered (file
,
1214 "gdbarch_dump: long_double_bit = %s\n",
1215 paddr_d (current_gdbarch
->long_double_bit
));
1216 #ifdef TARGET_LONG_DOUBLE_FORMAT
1217 fprintf_unfiltered (file
,
1218 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1219 XSTRING (TARGET_LONG_DOUBLE_FORMAT
));
1221 fprintf_unfiltered (file
,
1222 "gdbarch_dump: long_double_format = %s\n",
1223 pformat (current_gdbarch
->long_double_format
));
1224 #ifdef TARGET_LONG_LONG_BIT
1225 fprintf_unfiltered (file
,
1226 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1227 XSTRING (TARGET_LONG_LONG_BIT
));
1229 fprintf_unfiltered (file
,
1230 "gdbarch_dump: long_long_bit = %s\n",
1231 paddr_d (current_gdbarch
->long_long_bit
));
1232 #ifdef MEMORY_INSERT_BREAKPOINT
1233 fprintf_unfiltered (file
,
1234 "gdbarch_dump: %s # %s\n",
1235 "MEMORY_INSERT_BREAKPOINT(bp_tgt)",
1236 XSTRING (MEMORY_INSERT_BREAKPOINT (bp_tgt
)));
1238 fprintf_unfiltered (file
,
1239 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1240 (long) current_gdbarch
->memory_insert_breakpoint
);
1241 #ifdef MEMORY_REMOVE_BREAKPOINT
1242 fprintf_unfiltered (file
,
1243 "gdbarch_dump: %s # %s\n",
1244 "MEMORY_REMOVE_BREAKPOINT(bp_tgt)",
1245 XSTRING (MEMORY_REMOVE_BREAKPOINT (bp_tgt
)));
1247 fprintf_unfiltered (file
,
1248 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1249 (long) current_gdbarch
->memory_remove_breakpoint
);
1250 #ifdef NAME_OF_MALLOC
1251 fprintf_unfiltered (file
,
1252 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1253 XSTRING (NAME_OF_MALLOC
));
1255 fprintf_unfiltered (file
,
1256 "gdbarch_dump: name_of_malloc = %s\n",
1258 #ifdef NUM_PSEUDO_REGS
1259 fprintf_unfiltered (file
,
1260 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1261 XSTRING (NUM_PSEUDO_REGS
));
1263 fprintf_unfiltered (file
,
1264 "gdbarch_dump: num_pseudo_regs = %s\n",
1265 paddr_d (current_gdbarch
->num_pseudo_regs
));
1267 fprintf_unfiltered (file
,
1268 "gdbarch_dump: NUM_REGS # %s\n",
1269 XSTRING (NUM_REGS
));
1271 fprintf_unfiltered (file
,
1272 "gdbarch_dump: num_regs = %s\n",
1273 paddr_d (current_gdbarch
->num_regs
));
1275 fprintf_unfiltered (file
,
1276 "gdbarch_dump: TARGET_OSABI # %s\n",
1277 XSTRING (TARGET_OSABI
));
1279 fprintf_unfiltered (file
,
1280 "gdbarch_dump: osabi = %s\n",
1281 paddr_d (current_gdbarch
->osabi
));
1283 fprintf_unfiltered (file
,
1284 "gdbarch_dump: PC_REGNUM # %s\n",
1285 XSTRING (PC_REGNUM
));
1287 fprintf_unfiltered (file
,
1288 "gdbarch_dump: pc_regnum = %s\n",
1289 paddr_d (current_gdbarch
->pc_regnum
));
1290 #ifdef POINTER_TO_ADDRESS
1291 fprintf_unfiltered (file
,
1292 "gdbarch_dump: %s # %s\n",
1293 "POINTER_TO_ADDRESS(type, buf)",
1294 XSTRING (POINTER_TO_ADDRESS (type
, buf
)));
1296 fprintf_unfiltered (file
,
1297 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1298 (long) current_gdbarch
->pointer_to_address
);
1299 fprintf_unfiltered (file
,
1300 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1301 gdbarch_print_float_info_p (current_gdbarch
));
1302 fprintf_unfiltered (file
,
1303 "gdbarch_dump: print_float_info = <0x%lx>\n",
1304 (long) current_gdbarch
->print_float_info
);
1305 #ifdef TARGET_PRINT_INSN
1306 fprintf_unfiltered (file
,
1307 "gdbarch_dump: %s # %s\n",
1308 "TARGET_PRINT_INSN(vma, info)",
1309 XSTRING (TARGET_PRINT_INSN (vma
, info
)));
1311 fprintf_unfiltered (file
,
1312 "gdbarch_dump: print_insn = <0x%lx>\n",
1313 (long) current_gdbarch
->print_insn
);
1314 fprintf_unfiltered (file
,
1315 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1316 (long) current_gdbarch
->print_registers_info
);
1317 fprintf_unfiltered (file
,
1318 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1319 gdbarch_print_vector_info_p (current_gdbarch
));
1320 fprintf_unfiltered (file
,
1321 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1322 (long) current_gdbarch
->print_vector_info
);
1324 fprintf_unfiltered (file
,
1325 "gdbarch_dump: PS_REGNUM # %s\n",
1326 XSTRING (PS_REGNUM
));
1328 fprintf_unfiltered (file
,
1329 "gdbarch_dump: ps_regnum = %s\n",
1330 paddr_d (current_gdbarch
->ps_regnum
));
1331 fprintf_unfiltered (file
,
1332 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1333 gdbarch_pseudo_register_read_p (current_gdbarch
));
1334 fprintf_unfiltered (file
,
1335 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1336 (long) current_gdbarch
->pseudo_register_read
);
1337 fprintf_unfiltered (file
,
1338 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1339 gdbarch_pseudo_register_write_p (current_gdbarch
));
1340 fprintf_unfiltered (file
,
1341 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1342 (long) current_gdbarch
->pseudo_register_write
);
1343 #ifdef TARGET_PTR_BIT
1344 fprintf_unfiltered (file
,
1345 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1346 XSTRING (TARGET_PTR_BIT
));
1348 fprintf_unfiltered (file
,
1349 "gdbarch_dump: ptr_bit = %s\n",
1350 paddr_d (current_gdbarch
->ptr_bit
));
1351 fprintf_unfiltered (file
,
1352 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1353 gdbarch_push_dummy_call_p (current_gdbarch
));
1354 fprintf_unfiltered (file
,
1355 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1356 (long) current_gdbarch
->push_dummy_call
);
1357 fprintf_unfiltered (file
,
1358 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1359 gdbarch_push_dummy_code_p (current_gdbarch
));
1360 fprintf_unfiltered (file
,
1361 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1362 (long) current_gdbarch
->push_dummy_code
);
1363 #ifdef TARGET_READ_PC_P
1364 fprintf_unfiltered (file
,
1365 "gdbarch_dump: %s # %s\n",
1366 "TARGET_READ_PC_P()",
1367 XSTRING (TARGET_READ_PC_P ()));
1369 fprintf_unfiltered (file
,
1370 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1371 gdbarch_read_pc_p (current_gdbarch
));
1372 #ifdef TARGET_READ_PC
1373 fprintf_unfiltered (file
,
1374 "gdbarch_dump: %s # %s\n",
1375 "TARGET_READ_PC(ptid)",
1376 XSTRING (TARGET_READ_PC (ptid
)));
1378 fprintf_unfiltered (file
,
1379 "gdbarch_dump: read_pc = <0x%lx>\n",
1380 (long) current_gdbarch
->read_pc
);
1381 #ifdef TARGET_READ_SP_P
1382 fprintf_unfiltered (file
,
1383 "gdbarch_dump: %s # %s\n",
1384 "TARGET_READ_SP_P()",
1385 XSTRING (TARGET_READ_SP_P ()));
1387 fprintf_unfiltered (file
,
1388 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1389 gdbarch_read_sp_p (current_gdbarch
));
1390 #ifdef TARGET_READ_SP
1391 fprintf_unfiltered (file
,
1392 "gdbarch_dump: %s # %s\n",
1394 XSTRING (TARGET_READ_SP ()));
1396 fprintf_unfiltered (file
,
1397 "gdbarch_dump: read_sp = <0x%lx>\n",
1398 (long) current_gdbarch
->read_sp
);
1399 #ifdef REGISTER_BYTES_OK_P
1400 fprintf_unfiltered (file
,
1401 "gdbarch_dump: %s # %s\n",
1402 "REGISTER_BYTES_OK_P()",
1403 XSTRING (REGISTER_BYTES_OK_P ()));
1405 fprintf_unfiltered (file
,
1406 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1407 gdbarch_register_bytes_ok_p (current_gdbarch
));
1408 #ifdef REGISTER_BYTES_OK
1409 fprintf_unfiltered (file
,
1410 "gdbarch_dump: %s # %s\n",
1411 "REGISTER_BYTES_OK(nr_bytes)",
1412 XSTRING (REGISTER_BYTES_OK (nr_bytes
)));
1414 fprintf_unfiltered (file
,
1415 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1416 (long) current_gdbarch
->register_bytes_ok
);
1417 #ifdef REGISTER_NAME
1418 fprintf_unfiltered (file
,
1419 "gdbarch_dump: %s # %s\n",
1420 "REGISTER_NAME(regnr)",
1421 XSTRING (REGISTER_NAME (regnr
)));
1423 fprintf_unfiltered (file
,
1424 "gdbarch_dump: register_name = <0x%lx>\n",
1425 (long) current_gdbarch
->register_name
);
1426 fprintf_unfiltered (file
,
1427 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1428 (long) current_gdbarch
->register_reggroup_p
);
1429 #ifdef REGISTER_SIM_REGNO
1430 fprintf_unfiltered (file
,
1431 "gdbarch_dump: %s # %s\n",
1432 "REGISTER_SIM_REGNO(reg_nr)",
1433 XSTRING (REGISTER_SIM_REGNO (reg_nr
)));
1435 fprintf_unfiltered (file
,
1436 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1437 (long) current_gdbarch
->register_sim_regno
);
1438 #ifdef REGISTER_TO_VALUE
1439 fprintf_unfiltered (file
,
1440 "gdbarch_dump: %s # %s\n",
1441 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1442 XSTRING (REGISTER_TO_VALUE (frame
, regnum
, type
, buf
)));
1444 fprintf_unfiltered (file
,
1445 "gdbarch_dump: register_to_value = <0x%lx>\n",
1446 (long) current_gdbarch
->register_to_value
);
1447 fprintf_unfiltered (file
,
1448 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1449 gdbarch_register_type_p (current_gdbarch
));
1450 fprintf_unfiltered (file
,
1451 "gdbarch_dump: register_type = <0x%lx>\n",
1452 (long) current_gdbarch
->register_type
);
1453 fprintf_unfiltered (file
,
1454 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1455 gdbarch_regset_from_core_section_p (current_gdbarch
));
1456 fprintf_unfiltered (file
,
1457 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1458 (long) current_gdbarch
->regset_from_core_section
);
1459 fprintf_unfiltered (file
,
1460 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1461 (long) current_gdbarch
->remote_translate_xfer_address
);
1462 fprintf_unfiltered (file
,
1463 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1464 gdbarch_return_value_p (current_gdbarch
));
1465 fprintf_unfiltered (file
,
1466 "gdbarch_dump: return_value = <0x%lx>\n",
1467 (long) current_gdbarch
->return_value
);
1468 #ifdef SDB_REG_TO_REGNUM
1469 fprintf_unfiltered (file
,
1470 "gdbarch_dump: %s # %s\n",
1471 "SDB_REG_TO_REGNUM(sdb_regnr)",
1472 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr
)));
1474 fprintf_unfiltered (file
,
1475 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1476 (long) current_gdbarch
->sdb_reg_to_regnum
);
1477 #ifdef TARGET_SHORT_BIT
1478 fprintf_unfiltered (file
,
1479 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1480 XSTRING (TARGET_SHORT_BIT
));
1482 fprintf_unfiltered (file
,
1483 "gdbarch_dump: short_bit = %s\n",
1484 paddr_d (current_gdbarch
->short_bit
));
1485 fprintf_unfiltered (file
,
1486 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1487 gdbarch_single_step_through_delay_p (current_gdbarch
));
1488 fprintf_unfiltered (file
,
1489 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1490 (long) current_gdbarch
->single_step_through_delay
);
1491 #ifdef SKIP_PROLOGUE
1492 fprintf_unfiltered (file
,
1493 "gdbarch_dump: %s # %s\n",
1494 "SKIP_PROLOGUE(ip)",
1495 XSTRING (SKIP_PROLOGUE (ip
)));
1497 fprintf_unfiltered (file
,
1498 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1499 (long) current_gdbarch
->skip_prologue
);
1500 fprintf_unfiltered (file
,
1501 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1502 (long) current_gdbarch
->skip_solib_resolver
);
1503 #ifdef SKIP_TRAMPOLINE_CODE
1504 fprintf_unfiltered (file
,
1505 "gdbarch_dump: %s # %s\n",
1506 "SKIP_TRAMPOLINE_CODE(pc)",
1507 XSTRING (SKIP_TRAMPOLINE_CODE (pc
)));
1509 fprintf_unfiltered (file
,
1510 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1511 (long) current_gdbarch
->skip_trampoline_code
);
1512 #ifdef SMASH_TEXT_ADDRESS
1513 fprintf_unfiltered (file
,
1514 "gdbarch_dump: %s # %s\n",
1515 "SMASH_TEXT_ADDRESS(addr)",
1516 XSTRING (SMASH_TEXT_ADDRESS (addr
)));
1518 fprintf_unfiltered (file
,
1519 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1520 (long) current_gdbarch
->smash_text_address
);
1521 #ifdef SOFTWARE_SINGLE_STEP_P
1522 fprintf_unfiltered (file
,
1523 "gdbarch_dump: %s # %s\n",
1524 "SOFTWARE_SINGLE_STEP_P()",
1525 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1527 fprintf_unfiltered (file
,
1528 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1529 gdbarch_software_single_step_p (current_gdbarch
));
1530 #ifdef SOFTWARE_SINGLE_STEP
1531 fprintf_unfiltered (file
,
1532 "gdbarch_dump: %s # %s\n",
1533 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1534 XSTRING (SOFTWARE_SINGLE_STEP (sig
, insert_breakpoints_p
)));
1536 fprintf_unfiltered (file
,
1537 "gdbarch_dump: software_single_step = <0x%lx>\n",
1538 (long) current_gdbarch
->software_single_step
);
1540 fprintf_unfiltered (file
,
1541 "gdbarch_dump: SP_REGNUM # %s\n",
1542 XSTRING (SP_REGNUM
));
1544 fprintf_unfiltered (file
,
1545 "gdbarch_dump: sp_regnum = %s\n",
1546 paddr_d (current_gdbarch
->sp_regnum
));
1547 #ifdef STAB_REG_TO_REGNUM
1548 fprintf_unfiltered (file
,
1549 "gdbarch_dump: %s # %s\n",
1550 "STAB_REG_TO_REGNUM(stab_regnr)",
1551 XSTRING (STAB_REG_TO_REGNUM (stab_regnr
)));
1553 fprintf_unfiltered (file
,
1554 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1555 (long) current_gdbarch
->stab_reg_to_regnum
);
1556 fprintf_unfiltered (file
,
1557 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1558 (long) current_gdbarch
->stabs_argument_has_addr
);
1559 #ifdef STORE_RETURN_VALUE
1560 fprintf_unfiltered (file
,
1561 "gdbarch_dump: %s # %s\n",
1562 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1563 XSTRING (STORE_RETURN_VALUE (type
, regcache
, valbuf
)));
1565 fprintf_unfiltered (file
,
1566 "gdbarch_dump: store_return_value = <0x%lx>\n",
1567 (long) current_gdbarch
->store_return_value
);
1568 fprintf_unfiltered (file
,
1569 "gdbarch_dump: target_desc = %s\n",
1570 paddr_d ((long) current_gdbarch
->target_desc
));
1571 fprintf_unfiltered (file
,
1572 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1573 gdbarch_unwind_dummy_id_p (current_gdbarch
));
1574 fprintf_unfiltered (file
,
1575 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1576 (long) current_gdbarch
->unwind_dummy_id
);
1577 fprintf_unfiltered (file
,
1578 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1579 gdbarch_unwind_pc_p (current_gdbarch
));
1580 fprintf_unfiltered (file
,
1581 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1582 (long) current_gdbarch
->unwind_pc
);
1583 fprintf_unfiltered (file
,
1584 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1585 gdbarch_unwind_sp_p (current_gdbarch
));
1586 fprintf_unfiltered (file
,
1587 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1588 (long) current_gdbarch
->unwind_sp
);
1589 #ifdef VALUE_TO_REGISTER
1590 fprintf_unfiltered (file
,
1591 "gdbarch_dump: %s # %s\n",
1592 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1593 XSTRING (VALUE_TO_REGISTER (frame
, regnum
, type
, buf
)));
1595 fprintf_unfiltered (file
,
1596 "gdbarch_dump: value_to_register = <0x%lx>\n",
1597 (long) current_gdbarch
->value_to_register
);
1598 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1599 fprintf_unfiltered (file
,
1600 "gdbarch_dump: %s # %s\n",
1601 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1602 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc
, frame_regnum
, frame_offset
)));
1604 fprintf_unfiltered (file
,
1605 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1606 (long) current_gdbarch
->virtual_frame_pointer
);
1607 #ifdef TARGET_WRITE_PC
1608 fprintf_unfiltered (file
,
1609 "gdbarch_dump: %s # %s\n",
1610 "TARGET_WRITE_PC(val, ptid)",
1611 XSTRING (TARGET_WRITE_PC (val
, ptid
)));
1613 fprintf_unfiltered (file
,
1614 "gdbarch_dump: write_pc = <0x%lx>\n",
1615 (long) current_gdbarch
->write_pc
);
1616 if (current_gdbarch
->dump_tdep
!= NULL
)
1617 current_gdbarch
->dump_tdep (current_gdbarch
, file
);
1620 struct gdbarch_tdep
*
1621 gdbarch_tdep (struct gdbarch
*gdbarch
)
1623 if (gdbarch_debug
>= 2)
1624 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1625 return gdbarch
->tdep
;
1629 const struct bfd_arch_info
*
1630 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1632 gdb_assert (gdbarch
!= NULL
);
1633 if (gdbarch_debug
>= 2)
1634 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1635 return gdbarch
->bfd_arch_info
;
1639 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1641 gdb_assert (gdbarch
!= NULL
);
1642 if (gdbarch_debug
>= 2)
1643 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1644 return gdbarch
->byte_order
;
1648 gdbarch_osabi (struct gdbarch
*gdbarch
)
1650 gdb_assert (gdbarch
!= NULL
);
1651 if (gdbarch_debug
>= 2)
1652 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1653 return gdbarch
->osabi
;
1656 const struct target_desc
*
1657 gdbarch_target_desc (struct gdbarch
*gdbarch
)
1659 gdb_assert (gdbarch
!= NULL
);
1660 if (gdbarch_debug
>= 2)
1661 fprintf_unfiltered (gdb_stdlog
, "gdbarch_target_desc called\n");
1662 return gdbarch
->target_desc
;
1666 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1668 gdb_assert (gdbarch
!= NULL
);
1669 /* Skip verify of short_bit, invalid_p == 0 */
1670 if (gdbarch_debug
>= 2)
1671 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1672 return gdbarch
->short_bit
;
1676 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1679 gdbarch
->short_bit
= short_bit
;
1683 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1685 gdb_assert (gdbarch
!= NULL
);
1686 /* Skip verify of int_bit, invalid_p == 0 */
1687 if (gdbarch_debug
>= 2)
1688 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1689 return gdbarch
->int_bit
;
1693 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1696 gdbarch
->int_bit
= int_bit
;
1700 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1702 gdb_assert (gdbarch
!= NULL
);
1703 /* Skip verify of long_bit, invalid_p == 0 */
1704 if (gdbarch_debug
>= 2)
1705 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1706 return gdbarch
->long_bit
;
1710 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1713 gdbarch
->long_bit
= long_bit
;
1717 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1719 gdb_assert (gdbarch
!= NULL
);
1720 /* Skip verify of long_long_bit, invalid_p == 0 */
1721 if (gdbarch_debug
>= 2)
1722 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1723 return gdbarch
->long_long_bit
;
1727 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1730 gdbarch
->long_long_bit
= long_long_bit
;
1734 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1736 gdb_assert (gdbarch
!= NULL
);
1737 /* Skip verify of float_bit, invalid_p == 0 */
1738 if (gdbarch_debug
>= 2)
1739 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1740 return gdbarch
->float_bit
;
1744 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1747 gdbarch
->float_bit
= float_bit
;
1750 const struct floatformat
*
1751 gdbarch_float_format (struct gdbarch
*gdbarch
)
1753 gdb_assert (gdbarch
!= NULL
);
1754 if (gdbarch_debug
>= 2)
1755 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1756 return gdbarch
->float_format
;
1760 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1761 const struct floatformat
* float_format
)
1763 gdbarch
->float_format
= float_format
;
1767 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1769 gdb_assert (gdbarch
!= NULL
);
1770 /* Skip verify of double_bit, invalid_p == 0 */
1771 if (gdbarch_debug
>= 2)
1772 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1773 return gdbarch
->double_bit
;
1777 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1780 gdbarch
->double_bit
= double_bit
;
1783 const struct floatformat
*
1784 gdbarch_double_format (struct gdbarch
*gdbarch
)
1786 gdb_assert (gdbarch
!= NULL
);
1787 if (gdbarch_debug
>= 2)
1788 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1789 return gdbarch
->double_format
;
1793 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1794 const struct floatformat
* double_format
)
1796 gdbarch
->double_format
= double_format
;
1800 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1802 gdb_assert (gdbarch
!= NULL
);
1803 /* Skip verify of long_double_bit, invalid_p == 0 */
1804 if (gdbarch_debug
>= 2)
1805 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1806 return gdbarch
->long_double_bit
;
1810 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1811 int long_double_bit
)
1813 gdbarch
->long_double_bit
= long_double_bit
;
1816 const struct floatformat
*
1817 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1819 gdb_assert (gdbarch
!= NULL
);
1820 if (gdbarch_debug
>= 2)
1821 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1822 return gdbarch
->long_double_format
;
1826 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1827 const struct floatformat
* long_double_format
)
1829 gdbarch
->long_double_format
= long_double_format
;
1833 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1835 gdb_assert (gdbarch
!= NULL
);
1836 /* Skip verify of ptr_bit, invalid_p == 0 */
1837 if (gdbarch_debug
>= 2)
1838 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1839 return gdbarch
->ptr_bit
;
1843 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1846 gdbarch
->ptr_bit
= ptr_bit
;
1850 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1852 gdb_assert (gdbarch
!= NULL
);
1853 /* Check variable changed from pre-default. */
1854 gdb_assert (gdbarch
->addr_bit
!= 0);
1855 if (gdbarch_debug
>= 2)
1856 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1857 return gdbarch
->addr_bit
;
1861 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1864 gdbarch
->addr_bit
= addr_bit
;
1868 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1870 gdb_assert (gdbarch
!= NULL
);
1871 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1872 if (gdbarch_debug
>= 2)
1873 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1874 return gdbarch
->bfd_vma_bit
;
1878 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1881 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1885 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1887 gdb_assert (gdbarch
!= NULL
);
1888 /* Check variable changed from pre-default. */
1889 gdb_assert (gdbarch
->char_signed
!= -1);
1890 if (gdbarch_debug
>= 2)
1891 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1892 return gdbarch
->char_signed
;
1896 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1899 gdbarch
->char_signed
= char_signed
;
1903 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1905 gdb_assert (gdbarch
!= NULL
);
1906 return gdbarch
->read_pc
!= NULL
;
1910 gdbarch_read_pc (struct gdbarch
*gdbarch
, ptid_t ptid
)
1912 gdb_assert (gdbarch
!= NULL
);
1913 gdb_assert (gdbarch
->read_pc
!= NULL
);
1914 if (gdbarch_debug
>= 2)
1915 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1916 return gdbarch
->read_pc (ptid
);
1920 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1921 gdbarch_read_pc_ftype read_pc
)
1923 gdbarch
->read_pc
= read_pc
;
1927 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, ptid_t ptid
)
1929 gdb_assert (gdbarch
!= NULL
);
1930 gdb_assert (gdbarch
->write_pc
!= NULL
);
1931 if (gdbarch_debug
>= 2)
1932 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1933 gdbarch
->write_pc (val
, ptid
);
1937 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1938 gdbarch_write_pc_ftype write_pc
)
1940 gdbarch
->write_pc
= write_pc
;
1944 gdbarch_read_sp_p (struct gdbarch
*gdbarch
)
1946 gdb_assert (gdbarch
!= NULL
);
1947 return gdbarch
->read_sp
!= NULL
;
1951 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1953 gdb_assert (gdbarch
!= NULL
);
1954 gdb_assert (gdbarch
->read_sp
!= NULL
);
1955 if (gdbarch_debug
>= 2)
1956 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1957 return gdbarch
->read_sp ();
1961 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1962 gdbarch_read_sp_ftype read_sp
)
1964 gdbarch
->read_sp
= read_sp
;
1968 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1970 gdb_assert (gdbarch
!= NULL
);
1971 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1972 if (gdbarch_debug
>= 2)
1973 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1974 gdbarch
->virtual_frame_pointer (pc
, frame_regnum
, frame_offset
);
1978 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1979 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1981 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1985 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1987 gdb_assert (gdbarch
!= NULL
);
1988 return gdbarch
->pseudo_register_read
!= NULL
;
1992 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
1994 gdb_assert (gdbarch
!= NULL
);
1995 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1996 if (gdbarch_debug
>= 2)
1997 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
1998 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
2002 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
2003 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
2005 gdbarch
->pseudo_register_read
= pseudo_register_read
;
2009 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
2011 gdb_assert (gdbarch
!= NULL
);
2012 return gdbarch
->pseudo_register_write
!= NULL
;
2016 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
2018 gdb_assert (gdbarch
!= NULL
);
2019 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
2020 if (gdbarch_debug
>= 2)
2021 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
2022 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
2026 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
2027 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
2029 gdbarch
->pseudo_register_write
= pseudo_register_write
;
2033 gdbarch_num_regs (struct gdbarch
*gdbarch
)
2035 gdb_assert (gdbarch
!= NULL
);
2036 /* Check variable changed from pre-default. */
2037 gdb_assert (gdbarch
->num_regs
!= -1);
2038 if (gdbarch_debug
>= 2)
2039 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
2040 return gdbarch
->num_regs
;
2044 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
2047 gdbarch
->num_regs
= num_regs
;
2051 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
2053 gdb_assert (gdbarch
!= NULL
);
2054 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2055 if (gdbarch_debug
>= 2)
2056 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
2057 return gdbarch
->num_pseudo_regs
;
2061 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
2062 int num_pseudo_regs
)
2064 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
2068 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
2070 gdb_assert (gdbarch
!= NULL
);
2071 /* Skip verify of sp_regnum, invalid_p == 0 */
2072 if (gdbarch_debug
>= 2)
2073 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
2074 return gdbarch
->sp_regnum
;
2078 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
2081 gdbarch
->sp_regnum
= sp_regnum
;
2085 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
2087 gdb_assert (gdbarch
!= NULL
);
2088 /* Skip verify of pc_regnum, invalid_p == 0 */
2089 if (gdbarch_debug
>= 2)
2090 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
2091 return gdbarch
->pc_regnum
;
2095 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
2098 gdbarch
->pc_regnum
= pc_regnum
;
2102 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
2104 gdb_assert (gdbarch
!= NULL
);
2105 /* Skip verify of ps_regnum, invalid_p == 0 */
2106 if (gdbarch_debug
>= 2)
2107 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
2108 return gdbarch
->ps_regnum
;
2112 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
2115 gdbarch
->ps_regnum
= ps_regnum
;
2119 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
2121 gdb_assert (gdbarch
!= NULL
);
2122 /* Skip verify of fp0_regnum, invalid_p == 0 */
2123 if (gdbarch_debug
>= 2)
2124 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
2125 return gdbarch
->fp0_regnum
;
2129 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
2132 gdbarch
->fp0_regnum
= fp0_regnum
;
2136 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
2138 gdb_assert (gdbarch
!= NULL
);
2139 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
2140 if (gdbarch_debug
>= 2)
2141 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
2142 return gdbarch
->stab_reg_to_regnum (stab_regnr
);
2146 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
2147 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
2149 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
2153 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
2155 gdb_assert (gdbarch
!= NULL
);
2156 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
2157 if (gdbarch_debug
>= 2)
2158 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
2159 return gdbarch
->ecoff_reg_to_regnum (ecoff_regnr
);
2163 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
2164 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
2166 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
2170 gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf_regnr
)
2172 gdb_assert (gdbarch
!= NULL
);
2173 gdb_assert (gdbarch
->dwarf_reg_to_regnum
!= NULL
);
2174 if (gdbarch_debug
>= 2)
2175 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf_reg_to_regnum called\n");
2176 return gdbarch
->dwarf_reg_to_regnum (dwarf_regnr
);
2180 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
,
2181 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum
)
2183 gdbarch
->dwarf_reg_to_regnum
= dwarf_reg_to_regnum
;
2187 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
2189 gdb_assert (gdbarch
!= NULL
);
2190 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
2191 if (gdbarch_debug
>= 2)
2192 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
2193 return gdbarch
->sdb_reg_to_regnum (sdb_regnr
);
2197 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
2198 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
2200 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
2204 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
2206 gdb_assert (gdbarch
!= NULL
);
2207 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
2208 if (gdbarch_debug
>= 2)
2209 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
2210 return gdbarch
->dwarf2_reg_to_regnum (dwarf2_regnr
);
2214 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
2215 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
2217 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
2221 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
2223 gdb_assert (gdbarch
!= NULL
);
2224 gdb_assert (gdbarch
->register_name
!= NULL
);
2225 if (gdbarch_debug
>= 2)
2226 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
2227 return gdbarch
->register_name (regnr
);
2231 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
2232 gdbarch_register_name_ftype register_name
)
2234 gdbarch
->register_name
= register_name
;
2238 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
2240 gdb_assert (gdbarch
!= NULL
);
2241 return gdbarch
->register_type
!= NULL
;
2245 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
2247 gdb_assert (gdbarch
!= NULL
);
2248 gdb_assert (gdbarch
->register_type
!= NULL
);
2249 if (gdbarch_debug
>= 2)
2250 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
2251 return gdbarch
->register_type (gdbarch
, reg_nr
);
2255 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
2256 gdbarch_register_type_ftype register_type
)
2258 gdbarch
->register_type
= register_type
;
2262 gdbarch_deprecated_register_byte_p (struct gdbarch
*gdbarch
)
2264 gdb_assert (gdbarch
!= NULL
);
2265 return gdbarch
->deprecated_register_byte
!= generic_register_byte
;
2269 gdbarch_deprecated_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
2271 gdb_assert (gdbarch
!= NULL
);
2272 gdb_assert (gdbarch
->deprecated_register_byte
!= NULL
);
2273 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2274 if (gdbarch_debug
>= 2)
2275 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_byte called\n");
2276 return gdbarch
->deprecated_register_byte (reg_nr
);
2280 set_gdbarch_deprecated_register_byte (struct gdbarch
*gdbarch
,
2281 gdbarch_deprecated_register_byte_ftype deprecated_register_byte
)
2283 gdbarch
->deprecated_register_byte
= deprecated_register_byte
;
2287 gdbarch_unwind_dummy_id_p (struct gdbarch
*gdbarch
)
2289 gdb_assert (gdbarch
!= NULL
);
2290 return gdbarch
->unwind_dummy_id
!= NULL
;
2294 gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*info
)
2296 gdb_assert (gdbarch
!= NULL
);
2297 gdb_assert (gdbarch
->unwind_dummy_id
!= NULL
);
2298 if (gdbarch_debug
>= 2)
2299 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_dummy_id called\n");
2300 return gdbarch
->unwind_dummy_id (gdbarch
, info
);
2304 set_gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
,
2305 gdbarch_unwind_dummy_id_ftype unwind_dummy_id
)
2307 gdbarch
->unwind_dummy_id
= unwind_dummy_id
;
2311 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
2313 gdb_assert (gdbarch
!= NULL
);
2314 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2315 if (gdbarch_debug
>= 2)
2316 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
2317 return gdbarch
->deprecated_fp_regnum
;
2321 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
2322 int deprecated_fp_regnum
)
2324 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
2328 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
2330 gdb_assert (gdbarch
!= NULL
);
2331 return gdbarch
->push_dummy_call
!= NULL
;
2335 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
)
2337 gdb_assert (gdbarch
!= NULL
);
2338 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
2339 if (gdbarch_debug
>= 2)
2340 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
2341 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
2345 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
2346 gdbarch_push_dummy_call_ftype push_dummy_call
)
2348 gdbarch
->push_dummy_call
= push_dummy_call
;
2352 gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
)
2354 gdb_assert (gdbarch
!= NULL
);
2355 if (gdbarch_debug
>= 2)
2356 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_size called\n");
2357 return gdbarch
->deprecated_register_size
;
2361 set_gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
,
2362 int deprecated_register_size
)
2364 gdbarch
->deprecated_register_size
= deprecated_register_size
;
2368 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
2370 gdb_assert (gdbarch
!= NULL
);
2371 /* Skip verify of call_dummy_location, invalid_p == 0 */
2372 if (gdbarch_debug
>= 2)
2373 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
2374 return gdbarch
->call_dummy_location
;
2378 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
2379 int call_dummy_location
)
2381 gdbarch
->call_dummy_location
= call_dummy_location
;
2385 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2387 gdb_assert (gdbarch
!= NULL
);
2388 return gdbarch
->push_dummy_code
!= NULL
;
2392 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
)
2394 gdb_assert (gdbarch
!= NULL
);
2395 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2396 if (gdbarch_debug
>= 2)
2397 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2398 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, using_gcc
, args
, nargs
, value_type
, real_pc
, bp_addr
);
2402 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2403 gdbarch_push_dummy_code_ftype push_dummy_code
)
2405 gdbarch
->push_dummy_code
= push_dummy_code
;
2409 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2411 gdb_assert (gdbarch
!= NULL
);
2412 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2413 if (gdbarch_debug
>= 2)
2414 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2415 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2419 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2420 gdbarch_print_registers_info_ftype print_registers_info
)
2422 gdbarch
->print_registers_info
= print_registers_info
;
2426 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2428 gdb_assert (gdbarch
!= NULL
);
2429 return gdbarch
->print_float_info
!= NULL
;
2433 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2435 gdb_assert (gdbarch
!= NULL
);
2436 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2437 if (gdbarch_debug
>= 2)
2438 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2439 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2443 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2444 gdbarch_print_float_info_ftype print_float_info
)
2446 gdbarch
->print_float_info
= print_float_info
;
2450 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2452 gdb_assert (gdbarch
!= NULL
);
2453 return gdbarch
->print_vector_info
!= NULL
;
2457 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2459 gdb_assert (gdbarch
!= NULL
);
2460 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2461 if (gdbarch_debug
>= 2)
2462 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2463 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2467 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2468 gdbarch_print_vector_info_ftype print_vector_info
)
2470 gdbarch
->print_vector_info
= print_vector_info
;
2474 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2476 gdb_assert (gdbarch
!= NULL
);
2477 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2478 if (gdbarch_debug
>= 2)
2479 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2480 return gdbarch
->register_sim_regno (reg_nr
);
2484 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2485 gdbarch_register_sim_regno_ftype register_sim_regno
)
2487 gdbarch
->register_sim_regno
= register_sim_regno
;
2491 gdbarch_register_bytes_ok_p (struct gdbarch
*gdbarch
)
2493 gdb_assert (gdbarch
!= NULL
);
2494 return gdbarch
->register_bytes_ok
!= NULL
;
2498 gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
, long nr_bytes
)
2500 gdb_assert (gdbarch
!= NULL
);
2501 gdb_assert (gdbarch
->register_bytes_ok
!= NULL
);
2502 if (gdbarch_debug
>= 2)
2503 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes_ok called\n");
2504 return gdbarch
->register_bytes_ok (nr_bytes
);
2508 set_gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
,
2509 gdbarch_register_bytes_ok_ftype register_bytes_ok
)
2511 gdbarch
->register_bytes_ok
= register_bytes_ok
;
2515 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2517 gdb_assert (gdbarch
!= NULL
);
2518 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2519 if (gdbarch_debug
>= 2)
2520 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2521 return gdbarch
->cannot_fetch_register (regnum
);
2525 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2526 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2528 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2532 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2534 gdb_assert (gdbarch
!= NULL
);
2535 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2536 if (gdbarch_debug
>= 2)
2537 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2538 return gdbarch
->cannot_store_register (regnum
);
2542 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2543 gdbarch_cannot_store_register_ftype cannot_store_register
)
2545 gdbarch
->cannot_store_register
= cannot_store_register
;
2549 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2551 gdb_assert (gdbarch
!= NULL
);
2552 return gdbarch
->get_longjmp_target
!= NULL
;
2556 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, CORE_ADDR
*pc
)
2558 gdb_assert (gdbarch
!= NULL
);
2559 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2560 if (gdbarch_debug
>= 2)
2561 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2562 return gdbarch
->get_longjmp_target (pc
);
2566 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2567 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2569 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2573 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2575 gdb_assert (gdbarch
!= NULL
);
2576 if (gdbarch_debug
>= 2)
2577 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2578 return gdbarch
->believe_pcc_promotion
;
2582 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2583 int believe_pcc_promotion
)
2585 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2589 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2591 gdb_assert (gdbarch
!= NULL
);
2592 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2593 if (gdbarch_debug
>= 2)
2594 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2595 return gdbarch
->convert_register_p (regnum
, type
);
2599 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2600 gdbarch_convert_register_p_ftype convert_register_p
)
2602 gdbarch
->convert_register_p
= convert_register_p
;
2606 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
)
2608 gdb_assert (gdbarch
!= NULL
);
2609 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2610 if (gdbarch_debug
>= 2)
2611 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2612 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2616 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2617 gdbarch_register_to_value_ftype register_to_value
)
2619 gdbarch
->register_to_value
= register_to_value
;
2623 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2625 gdb_assert (gdbarch
!= NULL
);
2626 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2627 if (gdbarch_debug
>= 2)
2628 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2629 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2633 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2634 gdbarch_value_to_register_ftype value_to_register
)
2636 gdbarch
->value_to_register
= value_to_register
;
2640 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2642 gdb_assert (gdbarch
!= NULL
);
2643 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2644 if (gdbarch_debug
>= 2)
2645 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2646 return gdbarch
->pointer_to_address (type
, buf
);
2650 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2651 gdbarch_pointer_to_address_ftype pointer_to_address
)
2653 gdbarch
->pointer_to_address
= pointer_to_address
;
2657 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2659 gdb_assert (gdbarch
!= NULL
);
2660 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2661 if (gdbarch_debug
>= 2)
2662 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2663 gdbarch
->address_to_pointer (type
, buf
, addr
);
2667 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2668 gdbarch_address_to_pointer_ftype address_to_pointer
)
2670 gdbarch
->address_to_pointer
= address_to_pointer
;
2674 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2676 gdb_assert (gdbarch
!= NULL
);
2677 return gdbarch
->integer_to_address
!= NULL
;
2681 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2683 gdb_assert (gdbarch
!= NULL
);
2684 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2685 if (gdbarch_debug
>= 2)
2686 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2687 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2691 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2692 gdbarch_integer_to_address_ftype integer_to_address
)
2694 gdbarch
->integer_to_address
= integer_to_address
;
2698 gdbarch_deprecated_store_struct_return_p (struct gdbarch
*gdbarch
)
2700 gdb_assert (gdbarch
!= NULL
);
2701 return gdbarch
->deprecated_store_struct_return
!= NULL
;
2705 gdbarch_deprecated_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2707 gdb_assert (gdbarch
!= NULL
);
2708 gdb_assert (gdbarch
->deprecated_store_struct_return
!= NULL
);
2709 if (gdbarch_debug
>= 2)
2710 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_store_struct_return called\n");
2711 gdbarch
->deprecated_store_struct_return (addr
, sp
);
2715 set_gdbarch_deprecated_store_struct_return (struct gdbarch
*gdbarch
,
2716 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return
)
2718 gdbarch
->deprecated_store_struct_return
= deprecated_store_struct_return
;
2722 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2724 gdb_assert (gdbarch
!= NULL
);
2725 return gdbarch
->return_value
!= legacy_return_value
;
2728 enum return_value_convention
2729 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2731 gdb_assert (gdbarch
!= NULL
);
2732 gdb_assert (gdbarch
->return_value
!= NULL
);
2733 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2734 if (gdbarch_debug
>= 2)
2735 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2736 return gdbarch
->return_value (gdbarch
, valtype
, regcache
, readbuf
, writebuf
);
2740 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2741 gdbarch_return_value_ftype return_value
)
2743 gdbarch
->return_value
= return_value
;
2747 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, gdb_byte
*valbuf
)
2749 gdb_assert (gdbarch
!= NULL
);
2750 gdb_assert (gdbarch
->extract_return_value
!= NULL
);
2751 if (gdbarch_debug
>= 2)
2752 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
2753 gdbarch
->extract_return_value (type
, regcache
, valbuf
);
2757 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
2758 gdbarch_extract_return_value_ftype extract_return_value
)
2760 gdbarch
->extract_return_value
= extract_return_value
;
2764 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, const gdb_byte
*valbuf
)
2766 gdb_assert (gdbarch
!= NULL
);
2767 gdb_assert (gdbarch
->store_return_value
!= NULL
);
2768 if (gdbarch_debug
>= 2)
2769 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2770 gdbarch
->store_return_value (type
, regcache
, valbuf
);
2774 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2775 gdbarch_store_return_value_ftype store_return_value
)
2777 gdbarch
->store_return_value
= store_return_value
;
2781 gdbarch_deprecated_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*regbuf
, gdb_byte
*valbuf
)
2783 gdb_assert (gdbarch
!= NULL
);
2784 gdb_assert (gdbarch
->deprecated_extract_return_value
!= NULL
);
2785 if (gdbarch_debug
>= 2)
2786 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_extract_return_value called\n");
2787 gdbarch
->deprecated_extract_return_value (type
, regbuf
, valbuf
);
2791 set_gdbarch_deprecated_extract_return_value (struct gdbarch
*gdbarch
,
2792 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value
)
2794 gdbarch
->deprecated_extract_return_value
= deprecated_extract_return_value
;
2798 gdbarch_deprecated_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*valbuf
)
2800 gdb_assert (gdbarch
!= NULL
);
2801 gdb_assert (gdbarch
->deprecated_store_return_value
!= NULL
);
2802 if (gdbarch_debug
>= 2)
2803 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_store_return_value called\n");
2804 gdbarch
->deprecated_store_return_value (type
, valbuf
);
2808 set_gdbarch_deprecated_store_return_value (struct gdbarch
*gdbarch
,
2809 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value
)
2811 gdbarch
->deprecated_store_return_value
= deprecated_store_return_value
;
2815 gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2817 gdb_assert (gdbarch
!= NULL
);
2818 gdb_assert (gdbarch
->deprecated_use_struct_convention
!= NULL
);
2819 if (gdbarch_debug
>= 2)
2820 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_use_struct_convention called\n");
2821 return gdbarch
->deprecated_use_struct_convention (gcc_p
, value_type
);
2825 set_gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
,
2826 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention
)
2828 gdbarch
->deprecated_use_struct_convention
= deprecated_use_struct_convention
;
2832 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch
*gdbarch
)
2834 gdb_assert (gdbarch
!= NULL
);
2835 return gdbarch
->deprecated_extract_struct_value_address
!= NULL
;
2839 gdbarch_deprecated_extract_struct_value_address (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
2841 gdb_assert (gdbarch
!= NULL
);
2842 gdb_assert (gdbarch
->deprecated_extract_struct_value_address
!= NULL
);
2843 if (gdbarch_debug
>= 2)
2844 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_extract_struct_value_address called\n");
2845 return gdbarch
->deprecated_extract_struct_value_address (regcache
);
2849 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch
*gdbarch
,
2850 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address
)
2852 gdbarch
->deprecated_extract_struct_value_address
= deprecated_extract_struct_value_address
;
2856 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2858 gdb_assert (gdbarch
!= NULL
);
2859 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2860 if (gdbarch_debug
>= 2)
2861 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2862 return gdbarch
->skip_prologue (ip
);
2866 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2867 gdbarch_skip_prologue_ftype skip_prologue
)
2869 gdbarch
->skip_prologue
= skip_prologue
;
2873 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2875 gdb_assert (gdbarch
!= NULL
);
2876 gdb_assert (gdbarch
->inner_than
!= NULL
);
2877 if (gdbarch_debug
>= 2)
2878 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2879 return gdbarch
->inner_than (lhs
, rhs
);
2883 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2884 gdbarch_inner_than_ftype inner_than
)
2886 gdbarch
->inner_than
= inner_than
;
2890 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2892 gdb_assert (gdbarch
!= NULL
);
2893 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2894 if (gdbarch_debug
>= 2)
2895 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2896 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2900 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2901 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2903 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2907 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2909 gdb_assert (gdbarch
!= NULL
);
2910 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2914 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2916 gdb_assert (gdbarch
!= NULL
);
2917 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2918 if (gdbarch_debug
>= 2)
2919 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2920 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2924 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2925 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2927 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2931 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2933 gdb_assert (gdbarch
!= NULL
);
2934 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2935 if (gdbarch_debug
>= 2)
2936 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2937 return gdbarch
->memory_insert_breakpoint (bp_tgt
);
2941 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2942 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2944 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2948 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2950 gdb_assert (gdbarch
!= NULL
);
2951 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2952 if (gdbarch_debug
>= 2)
2953 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2954 return gdbarch
->memory_remove_breakpoint (bp_tgt
);
2958 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2959 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2961 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2965 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2967 gdb_assert (gdbarch
!= NULL
);
2968 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2969 if (gdbarch_debug
>= 2)
2970 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2971 return gdbarch
->decr_pc_after_break
;
2975 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2976 CORE_ADDR decr_pc_after_break
)
2978 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2982 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2984 gdb_assert (gdbarch
!= NULL
);
2985 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2986 if (gdbarch_debug
>= 2)
2987 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2988 return gdbarch
->deprecated_function_start_offset
;
2992 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2993 CORE_ADDR deprecated_function_start_offset
)
2995 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
2999 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
)
3001 gdb_assert (gdbarch
!= NULL
);
3002 gdb_assert (gdbarch
->remote_translate_xfer_address
!= NULL
);
3003 if (gdbarch_debug
>= 2)
3004 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
3005 gdbarch
->remote_translate_xfer_address (gdbarch
, regcache
, gdb_addr
, gdb_len
, rem_addr
, rem_len
);
3009 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
3010 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
3012 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
3016 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
3018 gdb_assert (gdbarch
!= NULL
);
3019 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
3023 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
3025 gdb_assert (gdbarch
!= NULL
);
3026 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
3027 if (gdbarch_debug
>= 2)
3028 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
3029 return gdbarch
->fetch_tls_load_module_address (objfile
);
3033 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
3034 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
3036 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
3040 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
3042 gdb_assert (gdbarch
!= NULL
);
3043 /* Skip verify of frame_args_skip, invalid_p == 0 */
3044 if (gdbarch_debug
>= 2)
3045 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
3046 return gdbarch
->frame_args_skip
;
3050 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
3051 CORE_ADDR frame_args_skip
)
3053 gdbarch
->frame_args_skip
= frame_args_skip
;
3057 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
3059 gdb_assert (gdbarch
!= NULL
);
3060 return gdbarch
->unwind_pc
!= NULL
;
3064 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
3066 gdb_assert (gdbarch
!= NULL
);
3067 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
3068 if (gdbarch_debug
>= 2)
3069 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
3070 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
3074 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
3075 gdbarch_unwind_pc_ftype unwind_pc
)
3077 gdbarch
->unwind_pc
= unwind_pc
;
3081 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
3083 gdb_assert (gdbarch
!= NULL
);
3084 return gdbarch
->unwind_sp
!= NULL
;
3088 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
3090 gdb_assert (gdbarch
!= NULL
);
3091 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
3092 if (gdbarch_debug
>= 2)
3093 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
3094 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
3098 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
3099 gdbarch_unwind_sp_ftype unwind_sp
)
3101 gdbarch
->unwind_sp
= unwind_sp
;
3105 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
3107 gdb_assert (gdbarch
!= NULL
);
3108 return gdbarch
->frame_num_args
!= NULL
;
3112 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3114 gdb_assert (gdbarch
!= NULL
);
3115 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
3116 if (gdbarch_debug
>= 2)
3117 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
3118 return gdbarch
->frame_num_args (frame
);
3122 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
3123 gdbarch_frame_num_args_ftype frame_num_args
)
3125 gdbarch
->frame_num_args
= frame_num_args
;
3129 gdbarch_deprecated_stack_align_p (struct gdbarch
*gdbarch
)
3131 gdb_assert (gdbarch
!= NULL
);
3132 return gdbarch
->deprecated_stack_align
!= NULL
;
3136 gdbarch_deprecated_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
3138 gdb_assert (gdbarch
!= NULL
);
3139 gdb_assert (gdbarch
->deprecated_stack_align
!= NULL
);
3140 if (gdbarch_debug
>= 2)
3141 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_stack_align called\n");
3142 return gdbarch
->deprecated_stack_align (sp
);
3146 set_gdbarch_deprecated_stack_align (struct gdbarch
*gdbarch
,
3147 gdbarch_deprecated_stack_align_ftype deprecated_stack_align
)
3149 gdbarch
->deprecated_stack_align
= deprecated_stack_align
;
3153 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
3155 gdb_assert (gdbarch
!= NULL
);
3156 return gdbarch
->frame_align
!= NULL
;
3160 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
3162 gdb_assert (gdbarch
!= NULL
);
3163 gdb_assert (gdbarch
->frame_align
!= NULL
);
3164 if (gdbarch_debug
>= 2)
3165 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
3166 return gdbarch
->frame_align (gdbarch
, address
);
3170 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
3171 gdbarch_frame_align_ftype frame_align
)
3173 gdbarch
->frame_align
= frame_align
;
3177 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
3179 gdb_assert (gdbarch
!= NULL
);
3180 return gdbarch
->deprecated_reg_struct_has_addr
!= NULL
;
3184 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
3186 gdb_assert (gdbarch
!= NULL
);
3187 gdb_assert (gdbarch
->deprecated_reg_struct_has_addr
!= NULL
);
3188 if (gdbarch_debug
>= 2)
3189 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_reg_struct_has_addr called\n");
3190 return gdbarch
->deprecated_reg_struct_has_addr (gcc_p
, type
);
3194 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
,
3195 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr
)
3197 gdbarch
->deprecated_reg_struct_has_addr
= deprecated_reg_struct_has_addr
;
3201 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
3203 gdb_assert (gdbarch
!= NULL
);
3204 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
3205 if (gdbarch_debug
>= 2)
3206 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
3207 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
3211 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
3212 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
3214 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
3218 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
3220 gdb_assert (gdbarch
!= NULL
);
3221 if (gdbarch_debug
>= 2)
3222 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
3223 return gdbarch
->frame_red_zone_size
;
3227 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
3228 int frame_red_zone_size
)
3230 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
3234 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
3236 gdb_assert (gdbarch
!= NULL
);
3237 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
3238 if (gdbarch_debug
>= 2)
3239 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
3240 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
3244 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
3245 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
3247 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
3251 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3253 gdb_assert (gdbarch
!= NULL
);
3254 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
3255 if (gdbarch_debug
>= 2)
3256 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
3257 return gdbarch
->addr_bits_remove (addr
);
3261 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
3262 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
3264 gdbarch
->addr_bits_remove
= addr_bits_remove
;
3268 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3270 gdb_assert (gdbarch
!= NULL
);
3271 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
3272 if (gdbarch_debug
>= 2)
3273 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
3274 return gdbarch
->smash_text_address (addr
);
3278 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
3279 gdbarch_smash_text_address_ftype smash_text_address
)
3281 gdbarch
->smash_text_address
= smash_text_address
;
3285 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
3287 gdb_assert (gdbarch
!= NULL
);
3288 return gdbarch
->software_single_step
!= NULL
;
3292 gdbarch_software_single_step (struct gdbarch
*gdbarch
, enum target_signal sig
, int insert_breakpoints_p
)
3294 gdb_assert (gdbarch
!= NULL
);
3295 gdb_assert (gdbarch
->software_single_step
!= NULL
);
3296 if (gdbarch_debug
>= 2)
3297 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
3298 gdbarch
->software_single_step (sig
, insert_breakpoints_p
);
3302 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
3303 gdbarch_software_single_step_ftype software_single_step
)
3305 gdbarch
->software_single_step
= software_single_step
;
3309 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
3311 gdb_assert (gdbarch
!= NULL
);
3312 return gdbarch
->single_step_through_delay
!= NULL
;
3316 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3318 gdb_assert (gdbarch
!= NULL
);
3319 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
3320 if (gdbarch_debug
>= 2)
3321 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
3322 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
3326 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
3327 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
3329 gdbarch
->single_step_through_delay
= single_step_through_delay
;
3333 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
3335 gdb_assert (gdbarch
!= NULL
);
3336 gdb_assert (gdbarch
->print_insn
!= NULL
);
3337 if (gdbarch_debug
>= 2)
3338 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
3339 return gdbarch
->print_insn (vma
, info
);
3343 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
3344 gdbarch_print_insn_ftype print_insn
)
3346 gdbarch
->print_insn
= print_insn
;
3350 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3352 gdb_assert (gdbarch
!= NULL
);
3353 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
3354 if (gdbarch_debug
>= 2)
3355 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
3356 return gdbarch
->skip_trampoline_code (pc
);
3360 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
3361 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
3363 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
3367 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3369 gdb_assert (gdbarch
!= NULL
);
3370 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
3371 if (gdbarch_debug
>= 2)
3372 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
3373 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
3377 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
3378 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
3380 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
3384 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
3386 gdb_assert (gdbarch
!= NULL
);
3387 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
3388 if (gdbarch_debug
>= 2)
3389 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
3390 return gdbarch
->in_solib_return_trampoline (pc
, name
);
3394 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
3395 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
3397 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
3401 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3403 gdb_assert (gdbarch
!= NULL
);
3404 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
3405 if (gdbarch_debug
>= 2)
3406 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
3407 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
3411 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
3412 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
3414 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
3418 gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, int argc
, char **argv
)
3420 gdb_assert (gdbarch
!= NULL
);
3421 gdb_assert (gdbarch
->construct_inferior_arguments
!= NULL
);
3422 if (gdbarch_debug
>= 2)
3423 fprintf_unfiltered (gdb_stdlog
, "gdbarch_construct_inferior_arguments called\n");
3424 return gdbarch
->construct_inferior_arguments (gdbarch
, argc
, argv
);
3428 set_gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
,
3429 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments
)
3431 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
3435 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
3437 gdb_assert (gdbarch
!= NULL
);
3438 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
3439 if (gdbarch_debug
>= 2)
3440 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
3441 gdbarch
->elf_make_msymbol_special (sym
, msym
);
3445 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
3446 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
3448 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
3452 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
3454 gdb_assert (gdbarch
!= NULL
);
3455 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
3456 if (gdbarch_debug
>= 2)
3457 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
3458 gdbarch
->coff_make_msymbol_special (val
, msym
);
3462 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
3463 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
3465 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
3469 gdbarch_name_of_malloc (struct gdbarch
*gdbarch
)
3471 gdb_assert (gdbarch
!= NULL
);
3472 /* Skip verify of name_of_malloc, invalid_p == 0 */
3473 if (gdbarch_debug
>= 2)
3474 fprintf_unfiltered (gdb_stdlog
, "gdbarch_name_of_malloc called\n");
3475 return gdbarch
->name_of_malloc
;
3479 set_gdbarch_name_of_malloc (struct gdbarch
*gdbarch
,
3480 const char * name_of_malloc
)
3482 gdbarch
->name_of_malloc
= name_of_malloc
;
3486 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
3488 gdb_assert (gdbarch
!= NULL
);
3489 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3490 if (gdbarch_debug
>= 2)
3491 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
3492 return gdbarch
->cannot_step_breakpoint
;
3496 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
3497 int cannot_step_breakpoint
)
3499 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
3503 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
3505 gdb_assert (gdbarch
!= NULL
);
3506 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3507 if (gdbarch_debug
>= 2)
3508 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
3509 return gdbarch
->have_nonsteppable_watchpoint
;
3513 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
3514 int have_nonsteppable_watchpoint
)
3516 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
3520 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
3522 gdb_assert (gdbarch
!= NULL
);
3523 return gdbarch
->address_class_type_flags
!= NULL
;
3527 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
3529 gdb_assert (gdbarch
!= NULL
);
3530 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
3531 if (gdbarch_debug
>= 2)
3532 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
3533 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
3537 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
3538 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
3540 gdbarch
->address_class_type_flags
= address_class_type_flags
;
3544 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
3546 gdb_assert (gdbarch
!= NULL
);
3547 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
3551 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
3553 gdb_assert (gdbarch
!= NULL
);
3554 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
3555 if (gdbarch_debug
>= 2)
3556 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
3557 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
3561 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
3562 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3564 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3568 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3570 gdb_assert (gdbarch
!= NULL
);
3571 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3575 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3577 gdb_assert (gdbarch
!= NULL
);
3578 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3579 if (gdbarch_debug
>= 2)
3580 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3581 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3585 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3586 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3588 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3592 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3594 gdb_assert (gdbarch
!= NULL
);
3595 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3596 if (gdbarch_debug
>= 2)
3597 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3598 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3602 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3603 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3605 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3609 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3611 gdb_assert (gdbarch
!= NULL
);
3612 return gdbarch
->fetch_pointer_argument
!= NULL
;
3616 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3618 gdb_assert (gdbarch
!= NULL
);
3619 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3620 if (gdbarch_debug
>= 2)
3621 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3622 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3626 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3627 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3629 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3633 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3635 gdb_assert (gdbarch
!= NULL
);
3636 return gdbarch
->regset_from_core_section
!= NULL
;
3639 const struct regset
*
3640 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3642 gdb_assert (gdbarch
!= NULL
);
3643 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3644 if (gdbarch_debug
>= 2)
3645 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3646 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3650 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3651 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3653 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3657 /* Keep a registry of per-architecture data-pointers required by GDB
3664 gdbarch_data_pre_init_ftype
*pre_init
;
3665 gdbarch_data_post_init_ftype
*post_init
;
3668 struct gdbarch_data_registration
3670 struct gdbarch_data
*data
;
3671 struct gdbarch_data_registration
*next
;
3674 struct gdbarch_data_registry
3677 struct gdbarch_data_registration
*registrations
;
3680 struct gdbarch_data_registry gdbarch_data_registry
=
3685 static struct gdbarch_data
*
3686 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3687 gdbarch_data_post_init_ftype
*post_init
)
3689 struct gdbarch_data_registration
**curr
;
3690 /* Append the new registraration. */
3691 for (curr
= &gdbarch_data_registry
.registrations
;
3693 curr
= &(*curr
)->next
);
3694 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3695 (*curr
)->next
= NULL
;
3696 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3697 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3698 (*curr
)->data
->pre_init
= pre_init
;
3699 (*curr
)->data
->post_init
= post_init
;
3700 (*curr
)->data
->init_p
= 1;
3701 return (*curr
)->data
;
3704 struct gdbarch_data
*
3705 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3707 return gdbarch_data_register (pre_init
, NULL
);
3710 struct gdbarch_data
*
3711 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3713 return gdbarch_data_register (NULL
, post_init
);
3716 /* Create/delete the gdbarch data vector. */
3719 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3721 gdb_assert (gdbarch
->data
== NULL
);
3722 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3723 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3726 /* Initialize the current value of the specified per-architecture
3730 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3731 struct gdbarch_data
*data
,
3734 gdb_assert (data
->index
< gdbarch
->nr_data
);
3735 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3736 gdb_assert (data
->pre_init
== NULL
);
3737 gdbarch
->data
[data
->index
] = pointer
;
3740 /* Return the current value of the specified per-architecture
3744 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3746 gdb_assert (data
->index
< gdbarch
->nr_data
);
3747 if (gdbarch
->data
[data
->index
] == NULL
)
3749 /* The data-pointer isn't initialized, call init() to get a
3751 if (data
->pre_init
!= NULL
)
3752 /* Mid architecture creation: pass just the obstack, and not
3753 the entire architecture, as that way it isn't possible for
3754 pre-init code to refer to undefined architecture
3756 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3757 else if (gdbarch
->initialized_p
3758 && data
->post_init
!= NULL
)
3759 /* Post architecture creation: pass the entire architecture
3760 (as all fields are valid), but be careful to also detect
3761 recursive references. */
3763 gdb_assert (data
->init_p
);
3765 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3769 /* The architecture initialization hasn't completed - punt -
3770 hope that the caller knows what they are doing. Once
3771 deprecated_set_gdbarch_data has been initialized, this can be
3772 changed to an internal error. */
3774 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3776 return gdbarch
->data
[data
->index
];
3781 /* Keep a registry of swapped data required by GDB modules. */
3786 struct gdbarch_swap_registration
*source
;
3787 struct gdbarch_swap
*next
;
3790 struct gdbarch_swap_registration
3793 unsigned long sizeof_data
;
3794 gdbarch_swap_ftype
*init
;
3795 struct gdbarch_swap_registration
*next
;
3798 struct gdbarch_swap_registry
3801 struct gdbarch_swap_registration
*registrations
;
3804 struct gdbarch_swap_registry gdbarch_swap_registry
=
3810 deprecated_register_gdbarch_swap (void *data
,
3811 unsigned long sizeof_data
,
3812 gdbarch_swap_ftype
*init
)
3814 struct gdbarch_swap_registration
**rego
;
3815 for (rego
= &gdbarch_swap_registry
.registrations
;
3817 rego
= &(*rego
)->next
);
3818 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
3819 (*rego
)->next
= NULL
;
3820 (*rego
)->init
= init
;
3821 (*rego
)->data
= data
;
3822 (*rego
)->sizeof_data
= sizeof_data
;
3826 current_gdbarch_swap_init_hack (void)
3828 struct gdbarch_swap_registration
*rego
;
3829 struct gdbarch_swap
**curr
= ¤t_gdbarch
->swap
;
3830 for (rego
= gdbarch_swap_registry
.registrations
;
3834 if (rego
->data
!= NULL
)
3836 (*curr
) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch
,
3837 struct gdbarch_swap
);
3838 (*curr
)->source
= rego
;
3839 (*curr
)->swap
= gdbarch_obstack_zalloc (current_gdbarch
,
3841 (*curr
)->next
= NULL
;
3842 curr
= &(*curr
)->next
;
3844 if (rego
->init
!= NULL
)
3849 static struct gdbarch
*
3850 current_gdbarch_swap_out_hack (void)
3852 struct gdbarch
*old_gdbarch
= current_gdbarch
;
3853 struct gdbarch_swap
*curr
;
3855 gdb_assert (old_gdbarch
!= NULL
);
3856 for (curr
= old_gdbarch
->swap
;
3860 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
3861 memset (curr
->source
->data
, 0, curr
->source
->sizeof_data
);
3863 current_gdbarch
= NULL
;
3868 current_gdbarch_swap_in_hack (struct gdbarch
*new_gdbarch
)
3870 struct gdbarch_swap
*curr
;
3872 gdb_assert (current_gdbarch
== NULL
);
3873 for (curr
= new_gdbarch
->swap
;
3876 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
3877 current_gdbarch
= new_gdbarch
;
3881 /* Keep a registry of the architectures known by GDB. */
3883 struct gdbarch_registration
3885 enum bfd_architecture bfd_architecture
;
3886 gdbarch_init_ftype
*init
;
3887 gdbarch_dump_tdep_ftype
*dump_tdep
;
3888 struct gdbarch_list
*arches
;
3889 struct gdbarch_registration
*next
;
3892 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3895 append_name (const char ***buf
, int *nr
, const char *name
)
3897 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3903 gdbarch_printable_names (void)
3905 /* Accumulate a list of names based on the registed list of
3907 enum bfd_architecture a
;
3909 const char **arches
= NULL
;
3910 struct gdbarch_registration
*rego
;
3911 for (rego
= gdbarch_registry
;
3915 const struct bfd_arch_info
*ap
;
3916 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3918 internal_error (__FILE__
, __LINE__
,
3919 _("gdbarch_architecture_names: multi-arch unknown"));
3922 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3927 append_name (&arches
, &nr_arches
, NULL
);
3933 gdbarch_register (enum bfd_architecture bfd_architecture
,
3934 gdbarch_init_ftype
*init
,
3935 gdbarch_dump_tdep_ftype
*dump_tdep
)
3937 struct gdbarch_registration
**curr
;
3938 const struct bfd_arch_info
*bfd_arch_info
;
3939 /* Check that BFD recognizes this architecture */
3940 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3941 if (bfd_arch_info
== NULL
)
3943 internal_error (__FILE__
, __LINE__
,
3944 _("gdbarch: Attempt to register unknown architecture (%d)"),
3947 /* Check that we haven't seen this architecture before */
3948 for (curr
= &gdbarch_registry
;
3950 curr
= &(*curr
)->next
)
3952 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3953 internal_error (__FILE__
, __LINE__
,
3954 _("gdbarch: Duplicate registraration of architecture (%s)"),
3955 bfd_arch_info
->printable_name
);
3959 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3960 bfd_arch_info
->printable_name
,
3963 (*curr
) = XMALLOC (struct gdbarch_registration
);
3964 (*curr
)->bfd_architecture
= bfd_architecture
;
3965 (*curr
)->init
= init
;
3966 (*curr
)->dump_tdep
= dump_tdep
;
3967 (*curr
)->arches
= NULL
;
3968 (*curr
)->next
= NULL
;
3972 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3973 gdbarch_init_ftype
*init
)
3975 gdbarch_register (bfd_architecture
, init
, NULL
);
3979 /* Look for an architecture using gdbarch_info. */
3981 struct gdbarch_list
*
3982 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
3983 const struct gdbarch_info
*info
)
3985 for (; arches
!= NULL
; arches
= arches
->next
)
3987 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
3989 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
3991 if (info
->osabi
!= arches
->gdbarch
->osabi
)
3993 if (info
->target_desc
!= arches
->gdbarch
->target_desc
)
4001 /* Find an architecture that matches the specified INFO. Create a new
4002 architecture if needed. Return that new architecture. Assumes
4003 that there is no current architecture. */
4005 static struct gdbarch
*
4006 find_arch_by_info (struct gdbarch_info info
)
4008 struct gdbarch
*new_gdbarch
;
4009 struct gdbarch_registration
*rego
;
4011 /* The existing architecture has been swapped out - all this code
4012 works from a clean slate. */
4013 gdb_assert (current_gdbarch
== NULL
);
4015 /* Fill in missing parts of the INFO struct using a number of
4016 sources: "set ..."; INFOabfd supplied; and the global
4018 gdbarch_info_fill (&info
);
4020 /* Must have found some sort of architecture. */
4021 gdb_assert (info
.bfd_arch_info
!= NULL
);
4025 fprintf_unfiltered (gdb_stdlog
,
4026 "find_arch_by_info: info.bfd_arch_info %s\n",
4027 (info
.bfd_arch_info
!= NULL
4028 ? info
.bfd_arch_info
->printable_name
4030 fprintf_unfiltered (gdb_stdlog
,
4031 "find_arch_by_info: info.byte_order %d (%s)\n",
4033 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4034 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4036 fprintf_unfiltered (gdb_stdlog
,
4037 "find_arch_by_info: info.osabi %d (%s)\n",
4038 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4039 fprintf_unfiltered (gdb_stdlog
,
4040 "find_arch_by_info: info.abfd 0x%lx\n",
4042 fprintf_unfiltered (gdb_stdlog
,
4043 "find_arch_by_info: info.tdep_info 0x%lx\n",
4044 (long) info
.tdep_info
);
4047 /* Find the tdep code that knows about this architecture. */
4048 for (rego
= gdbarch_registry
;
4051 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4056 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4057 "No matching architecture\n");
4061 /* Ask the tdep code for an architecture that matches "info". */
4062 new_gdbarch
= rego
->init (info
, rego
->arches
);
4064 /* Did the tdep code like it? No. Reject the change and revert to
4065 the old architecture. */
4066 if (new_gdbarch
== NULL
)
4069 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4070 "Target rejected architecture\n");
4074 /* Is this a pre-existing architecture (as determined by already
4075 being initialized)? Move it to the front of the architecture
4076 list (keeping the list sorted Most Recently Used). */
4077 if (new_gdbarch
->initialized_p
)
4079 struct gdbarch_list
**list
;
4080 struct gdbarch_list
*this;
4082 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4083 "Previous architecture 0x%08lx (%s) selected\n",
4085 new_gdbarch
->bfd_arch_info
->printable_name
);
4086 /* Find the existing arch in the list. */
4087 for (list
= ®o
->arches
;
4088 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4089 list
= &(*list
)->next
);
4090 /* It had better be in the list of architectures. */
4091 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4094 (*list
) = this->next
;
4095 /* Insert THIS at the front. */
4096 this->next
= rego
->arches
;
4097 rego
->arches
= this;
4102 /* It's a new architecture. */
4104 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4105 "New architecture 0x%08lx (%s) selected\n",
4107 new_gdbarch
->bfd_arch_info
->printable_name
);
4109 /* Insert the new architecture into the front of the architecture
4110 list (keep the list sorted Most Recently Used). */
4112 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4113 this->next
= rego
->arches
;
4114 this->gdbarch
= new_gdbarch
;
4115 rego
->arches
= this;
4118 /* Check that the newly installed architecture is valid. Plug in
4119 any post init values. */
4120 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4121 verify_gdbarch (new_gdbarch
);
4122 new_gdbarch
->initialized_p
= 1;
4124 /* Initialize any per-architecture swap areas. This phase requires
4125 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4126 swap the entire architecture out. */
4127 current_gdbarch
= new_gdbarch
;
4128 current_gdbarch_swap_init_hack ();
4129 current_gdbarch_swap_out_hack ();
4132 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4138 gdbarch_find_by_info (struct gdbarch_info info
)
4140 /* Save the previously selected architecture, setting the global to
4141 NULL. This stops things like gdbarch->init() trying to use the
4142 previous architecture's configuration. The previous architecture
4143 may not even be of the same architecture family. The most recent
4144 architecture of the same family is found at the head of the
4145 rego->arches list. */
4146 struct gdbarch
*old_gdbarch
= current_gdbarch_swap_out_hack ();
4148 /* Find the specified architecture. */
4149 struct gdbarch
*new_gdbarch
= find_arch_by_info (info
);
4151 /* Restore the existing architecture. */
4152 gdb_assert (current_gdbarch
== NULL
);
4153 current_gdbarch_swap_in_hack (old_gdbarch
);
4158 /* Make the specified architecture current, swapping the existing one
4162 deprecated_current_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4164 gdb_assert (new_gdbarch
!= NULL
);
4165 gdb_assert (current_gdbarch
!= NULL
);
4166 gdb_assert (new_gdbarch
->initialized_p
);
4167 current_gdbarch_swap_out_hack ();
4168 current_gdbarch_swap_in_hack (new_gdbarch
);
4169 architecture_changed_event ();
4170 flush_cached_frames ();
4173 extern void _initialize_gdbarch (void);
4176 _initialize_gdbarch (void)
4178 struct cmd_list_element
*c
;
4180 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
4181 Set architecture debugging."), _("\
4182 Show architecture debugging."), _("\
4183 When non-zero, architecture debugging is enabled."),
4186 &setdebuglist
, &showdebuglist
);