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 Free
6 Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 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
;
96 /* target specific vector. */
97 struct gdbarch_tdep
*tdep
;
98 gdbarch_dump_tdep_ftype
*dump_tdep
;
100 /* per-architecture data-pointers */
104 /* per-architecture swap-regions */
105 struct gdbarch_swap
*swap
;
107 /* Multi-arch values.
109 When extending this structure you must:
113 Declare set/get functions and define the corresponding
116 gdbarch_alloc(): If zero/NULL is not a suitable default,
117 initialize the new field.
119 verify_gdbarch(): Confirm that the target updated the field
122 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
125 ``startup_gdbarch()'': Append an initial value to the static
126 variable (base values on the host's c-type system).
128 get_gdbarch(): Implement the set/get functions (probably using
129 the macro's as shortcuts).
138 const struct floatformat
* float_format
;
140 const struct floatformat
* double_format
;
142 const struct floatformat
* long_double_format
;
147 gdbarch_read_pc_ftype
*read_pc
;
148 gdbarch_write_pc_ftype
*write_pc
;
149 gdbarch_read_sp_ftype
*read_sp
;
150 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
151 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
152 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
159 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
160 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
161 gdbarch_dwarf_reg_to_regnum_ftype
*dwarf_reg_to_regnum
;
162 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
163 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
164 gdbarch_register_name_ftype
*register_name
;
165 gdbarch_register_type_ftype
*register_type
;
166 gdbarch_deprecated_register_byte_ftype
*deprecated_register_byte
;
167 gdbarch_unwind_dummy_id_ftype
*unwind_dummy_id
;
168 int deprecated_fp_regnum
;
169 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
170 int deprecated_register_size
;
171 int call_dummy_location
;
172 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
173 gdbarch_print_registers_info_ftype
*print_registers_info
;
174 gdbarch_print_float_info_ftype
*print_float_info
;
175 gdbarch_print_vector_info_ftype
*print_vector_info
;
176 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
177 gdbarch_register_bytes_ok_ftype
*register_bytes_ok
;
178 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
179 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
180 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
181 int believe_pcc_promotion
;
182 gdbarch_convert_register_p_ftype
*convert_register_p
;
183 gdbarch_register_to_value_ftype
*register_to_value
;
184 gdbarch_value_to_register_ftype
*value_to_register
;
185 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
186 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
187 gdbarch_integer_to_address_ftype
*integer_to_address
;
188 gdbarch_deprecated_store_struct_return_ftype
*deprecated_store_struct_return
;
189 gdbarch_return_value_ftype
*return_value
;
190 gdbarch_extract_return_value_ftype
*extract_return_value
;
191 gdbarch_store_return_value_ftype
*store_return_value
;
192 gdbarch_deprecated_extract_return_value_ftype
*deprecated_extract_return_value
;
193 gdbarch_deprecated_store_return_value_ftype
*deprecated_store_return_value
;
194 gdbarch_deprecated_use_struct_convention_ftype
*deprecated_use_struct_convention
;
195 gdbarch_deprecated_extract_struct_value_address_ftype
*deprecated_extract_struct_value_address
;
196 gdbarch_skip_prologue_ftype
*skip_prologue
;
197 gdbarch_inner_than_ftype
*inner_than
;
198 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
199 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
200 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
201 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
202 CORE_ADDR decr_pc_after_break
;
203 CORE_ADDR deprecated_function_start_offset
;
204 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
205 gdbarch_fetch_tls_load_module_address_ftype
*fetch_tls_load_module_address
;
206 CORE_ADDR frame_args_skip
;
207 gdbarch_unwind_pc_ftype
*unwind_pc
;
208 gdbarch_unwind_sp_ftype
*unwind_sp
;
209 gdbarch_deprecated_saved_pc_after_call_ftype
*deprecated_saved_pc_after_call
;
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 */
254 /* target specific vector and its dump routine */
256 /*per-architecture data-pointers and swap regions */
258 /* Multi-arch values */
259 8 * sizeof (short), /* short_bit */
260 8 * sizeof (int), /* int_bit */
261 8 * sizeof (long), /* long_bit */
262 8 * sizeof (LONGEST
), /* long_long_bit */
263 8 * sizeof (float), /* float_bit */
264 0, /* float_format */
265 8 * sizeof (double), /* double_bit */
266 0, /* double_format */
267 8 * sizeof (long double), /* long_double_bit */
268 0, /* long_double_format */
269 8 * sizeof (void*), /* ptr_bit */
270 8 * sizeof (void*), /* addr_bit */
271 8 * sizeof (void*), /* bfd_vma_bit */
276 0, /* virtual_frame_pointer */
277 0, /* pseudo_register_read */
278 0, /* pseudo_register_write */
280 0, /* num_pseudo_regs */
285 0, /* stab_reg_to_regnum */
286 0, /* ecoff_reg_to_regnum */
287 0, /* dwarf_reg_to_regnum */
288 0, /* sdb_reg_to_regnum */
289 0, /* dwarf2_reg_to_regnum */
290 0, /* register_name */
291 0, /* register_type */
292 generic_register_byte
, /* deprecated_register_byte */
293 0, /* unwind_dummy_id */
294 -1, /* deprecated_fp_regnum */
295 0, /* push_dummy_call */
296 0, /* deprecated_register_size */
297 0, /* call_dummy_location */
298 0, /* push_dummy_code */
299 default_print_registers_info
, /* print_registers_info */
300 0, /* print_float_info */
301 0, /* print_vector_info */
302 0, /* register_sim_regno */
303 0, /* register_bytes_ok */
304 0, /* cannot_fetch_register */
305 0, /* cannot_store_register */
306 0, /* get_longjmp_target */
307 0, /* believe_pcc_promotion */
308 0, /* convert_register_p */
309 0, /* register_to_value */
310 0, /* value_to_register */
311 0, /* pointer_to_address */
312 0, /* address_to_pointer */
313 0, /* integer_to_address */
314 0, /* deprecated_store_struct_return */
315 0, /* return_value */
316 0, /* extract_return_value */
317 0, /* store_return_value */
318 0, /* deprecated_extract_return_value */
319 0, /* deprecated_store_return_value */
320 0, /* deprecated_use_struct_convention */
321 0, /* deprecated_extract_struct_value_address */
322 0, /* skip_prologue */
324 0, /* breakpoint_from_pc */
325 0, /* adjust_breakpoint_address */
326 0, /* memory_insert_breakpoint */
327 0, /* memory_remove_breakpoint */
328 0, /* decr_pc_after_break */
329 0, /* deprecated_function_start_offset */
330 generic_remote_translate_xfer_address
, /* remote_translate_xfer_address */
331 0, /* fetch_tls_load_module_address */
332 0, /* frame_args_skip */
335 0, /* deprecated_saved_pc_after_call */
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
;
400 /* Force the explicit initialization of these. */
401 current_gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
402 current_gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
403 current_gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
404 current_gdbarch
->long_long_bit
= 2*TARGET_LONG_BIT
;
405 current_gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
406 current_gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
407 current_gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
408 current_gdbarch
->ptr_bit
= TARGET_INT_BIT
;
409 current_gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
410 current_gdbarch
->char_signed
= -1;
411 current_gdbarch
->write_pc
= generic_target_write_pc
;
412 current_gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
413 current_gdbarch
->num_regs
= -1;
414 current_gdbarch
->sp_regnum
= -1;
415 current_gdbarch
->pc_regnum
= -1;
416 current_gdbarch
->ps_regnum
= -1;
417 current_gdbarch
->fp0_regnum
= -1;
418 current_gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
419 current_gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
420 current_gdbarch
->dwarf_reg_to_regnum
= no_op_reg_to_regnum
;
421 current_gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
422 current_gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
423 current_gdbarch
->deprecated_register_byte
= generic_register_byte
;
424 current_gdbarch
->deprecated_fp_regnum
= -1;
425 current_gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
426 current_gdbarch
->print_registers_info
= default_print_registers_info
;
427 current_gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
428 current_gdbarch
->cannot_fetch_register
= cannot_register_not
;
429 current_gdbarch
->cannot_store_register
= cannot_register_not
;
430 current_gdbarch
->convert_register_p
= generic_convert_register_p
;
431 current_gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
432 current_gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
433 current_gdbarch
->return_value
= legacy_return_value
;
434 current_gdbarch
->extract_return_value
= legacy_extract_return_value
;
435 current_gdbarch
->store_return_value
= legacy_store_return_value
;
436 current_gdbarch
->deprecated_use_struct_convention
= generic_use_struct_convention
;
437 current_gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
438 current_gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
439 current_gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
440 current_gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
441 current_gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
442 current_gdbarch
->addr_bits_remove
= core_addr_identity
;
443 current_gdbarch
->smash_text_address
= core_addr_identity
;
444 current_gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
445 current_gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
446 current_gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
447 current_gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
448 current_gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
449 current_gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
450 current_gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
451 current_gdbarch
->name_of_malloc
= "malloc";
452 current_gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
453 /* gdbarch_alloc() */
455 return current_gdbarch
;
459 /* Allocate extra space using the per-architecture obstack. */
462 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
464 void *data
= obstack_alloc (arch
->obstack
, size
);
465 memset (data
, 0, size
);
470 /* Free a gdbarch struct. This should never happen in normal
471 operation --- once you've created a gdbarch, you keep it around.
472 However, if an architecture's init function encounters an error
473 building the structure, it may need to clean up a partially
474 constructed gdbarch. */
477 gdbarch_free (struct gdbarch
*arch
)
479 struct obstack
*obstack
;
480 gdb_assert (arch
!= NULL
);
481 gdb_assert (!arch
->initialized_p
);
482 obstack
= arch
->obstack
;
483 obstack_free (obstack
, 0); /* Includes the ARCH. */
488 /* Ensure that all values in a GDBARCH are reasonable. */
490 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
491 just happens to match the global variable ``current_gdbarch''. That
492 way macros refering to that variable get the local and not the global
493 version - ulgh. Once everything is parameterised with gdbarch, this
497 verify_gdbarch (struct gdbarch
*current_gdbarch
)
500 struct cleanup
*cleanups
;
503 log
= mem_fileopen ();
504 cleanups
= make_cleanup_ui_file_delete (log
);
506 if (current_gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
507 fprintf_unfiltered (log
, "\n\tbyte-order");
508 if (current_gdbarch
->bfd_arch_info
== NULL
)
509 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
510 /* Check those that need to be defined for the given multi-arch level. */
511 /* Skip verify of short_bit, invalid_p == 0 */
512 /* Skip verify of int_bit, invalid_p == 0 */
513 /* Skip verify of long_bit, invalid_p == 0 */
514 /* Skip verify of long_long_bit, invalid_p == 0 */
515 /* Skip verify of float_bit, invalid_p == 0 */
516 if (current_gdbarch
->float_format
== 0)
517 current_gdbarch
->float_format
= default_float_format (current_gdbarch
);
518 /* Skip verify of double_bit, invalid_p == 0 */
519 if (current_gdbarch
->double_format
== 0)
520 current_gdbarch
->double_format
= default_double_format (current_gdbarch
);
521 /* Skip verify of long_double_bit, invalid_p == 0 */
522 if (current_gdbarch
->long_double_format
== 0)
523 current_gdbarch
->long_double_format
= default_double_format (current_gdbarch
);
524 /* Skip verify of ptr_bit, invalid_p == 0 */
525 if (current_gdbarch
->addr_bit
== 0)
526 current_gdbarch
->addr_bit
= TARGET_PTR_BIT
;
527 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
528 if (current_gdbarch
->char_signed
== -1)
529 current_gdbarch
->char_signed
= 1;
530 /* Skip verify of read_pc, has predicate */
531 /* Skip verify of write_pc, invalid_p == 0 */
532 /* Skip verify of read_sp, has predicate */
533 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
534 /* Skip verify of pseudo_register_read, has predicate */
535 /* Skip verify of pseudo_register_write, has predicate */
536 if (current_gdbarch
->num_regs
== -1)
537 fprintf_unfiltered (log
, "\n\tnum_regs");
538 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
539 /* Skip verify of sp_regnum, invalid_p == 0 */
540 /* Skip verify of pc_regnum, invalid_p == 0 */
541 /* Skip verify of ps_regnum, invalid_p == 0 */
542 /* Skip verify of fp0_regnum, invalid_p == 0 */
543 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
544 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
545 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
546 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
547 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
548 /* Skip verify of register_type, has predicate */
549 /* Skip verify of deprecated_register_byte, has predicate */
550 /* Skip verify of unwind_dummy_id, has predicate */
551 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
552 /* Skip verify of push_dummy_call, has predicate */
553 /* Skip verify of call_dummy_location, invalid_p == 0 */
554 /* Skip verify of push_dummy_code, has predicate */
555 /* Skip verify of print_registers_info, invalid_p == 0 */
556 /* Skip verify of print_float_info, has predicate */
557 /* Skip verify of print_vector_info, has predicate */
558 /* Skip verify of register_sim_regno, invalid_p == 0 */
559 /* Skip verify of register_bytes_ok, has predicate */
560 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
561 /* Skip verify of cannot_store_register, invalid_p == 0 */
562 /* Skip verify of get_longjmp_target, has predicate */
563 /* Skip verify of convert_register_p, invalid_p == 0 */
564 /* Skip verify of pointer_to_address, invalid_p == 0 */
565 /* Skip verify of address_to_pointer, invalid_p == 0 */
566 /* Skip verify of integer_to_address, has predicate */
567 /* Skip verify of deprecated_store_struct_return, has predicate */
568 /* Skip verify of return_value, has predicate */
569 /* Skip verify of extract_return_value, invalid_p == 0 */
570 /* Skip verify of store_return_value, invalid_p == 0 */
571 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
572 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
573 if (current_gdbarch
->skip_prologue
== 0)
574 fprintf_unfiltered (log
, "\n\tskip_prologue");
575 if (current_gdbarch
->inner_than
== 0)
576 fprintf_unfiltered (log
, "\n\tinner_than");
577 if (current_gdbarch
->breakpoint_from_pc
== 0)
578 fprintf_unfiltered (log
, "\n\tbreakpoint_from_pc");
579 /* Skip verify of adjust_breakpoint_address, has predicate */
580 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
581 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
582 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
583 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
584 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
585 /* Skip verify of fetch_tls_load_module_address, has predicate */
586 /* Skip verify of frame_args_skip, invalid_p == 0 */
587 /* Skip verify of unwind_pc, has predicate */
588 /* Skip verify of unwind_sp, has predicate */
589 /* Skip verify of deprecated_saved_pc_after_call, 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_SAVED_PC_AFTER_CALL_P
925 fprintf_unfiltered (file
,
926 "gdbarch_dump: %s # %s\n",
927 "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
928 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
930 fprintf_unfiltered (file
,
931 "gdbarch_dump: gdbarch_deprecated_saved_pc_after_call_p() = %d\n",
932 gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch
));
933 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL
934 fprintf_unfiltered (file
,
935 "gdbarch_dump: %s # %s\n",
936 "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
937 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame
)));
939 fprintf_unfiltered (file
,
940 "gdbarch_dump: deprecated_saved_pc_after_call = <0x%lx>\n",
941 (long) current_gdbarch
->deprecated_saved_pc_after_call
);
942 #ifdef DEPRECATED_STACK_ALIGN_P
943 fprintf_unfiltered (file
,
944 "gdbarch_dump: %s # %s\n",
945 "DEPRECATED_STACK_ALIGN_P()",
946 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
948 fprintf_unfiltered (file
,
949 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
950 gdbarch_deprecated_stack_align_p (current_gdbarch
));
951 #ifdef DEPRECATED_STACK_ALIGN
952 fprintf_unfiltered (file
,
953 "gdbarch_dump: %s # %s\n",
954 "DEPRECATED_STACK_ALIGN(sp)",
955 XSTRING (DEPRECATED_STACK_ALIGN (sp
)));
957 fprintf_unfiltered (file
,
958 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
959 (long) current_gdbarch
->deprecated_stack_align
);
960 #ifdef DEPRECATED_STORE_RETURN_VALUE
961 fprintf_unfiltered (file
,
962 "gdbarch_dump: %s # %s\n",
963 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
964 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type
, valbuf
)));
966 fprintf_unfiltered (file
,
967 "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n",
968 (long) current_gdbarch
->deprecated_store_return_value
);
969 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
970 fprintf_unfiltered (file
,
971 "gdbarch_dump: %s # %s\n",
972 "DEPRECATED_STORE_STRUCT_RETURN_P()",
973 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
975 fprintf_unfiltered (file
,
976 "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
977 gdbarch_deprecated_store_struct_return_p (current_gdbarch
));
978 #ifdef DEPRECATED_STORE_STRUCT_RETURN
979 fprintf_unfiltered (file
,
980 "gdbarch_dump: %s # %s\n",
981 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
982 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr
, sp
)));
984 fprintf_unfiltered (file
,
985 "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
986 (long) current_gdbarch
->deprecated_store_struct_return
);
987 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
988 fprintf_unfiltered (file
,
989 "gdbarch_dump: %s # %s\n",
990 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
991 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p
, value_type
)));
993 fprintf_unfiltered (file
,
994 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
995 (long) current_gdbarch
->deprecated_use_struct_convention
);
996 #ifdef TARGET_DOUBLE_BIT
997 fprintf_unfiltered (file
,
998 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
999 XSTRING (TARGET_DOUBLE_BIT
));
1001 fprintf_unfiltered (file
,
1002 "gdbarch_dump: double_bit = %s\n",
1003 paddr_d (current_gdbarch
->double_bit
));
1004 #ifdef TARGET_DOUBLE_FORMAT
1005 fprintf_unfiltered (file
,
1006 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1007 XSTRING (TARGET_DOUBLE_FORMAT
));
1009 fprintf_unfiltered (file
,
1010 "gdbarch_dump: double_format = %s\n",
1011 pformat (current_gdbarch
->double_format
));
1012 #ifdef DWARF2_REG_TO_REGNUM
1013 fprintf_unfiltered (file
,
1014 "gdbarch_dump: %s # %s\n",
1015 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1016 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr
)));
1018 fprintf_unfiltered (file
,
1019 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
1020 (long) current_gdbarch
->dwarf2_reg_to_regnum
);
1021 #ifdef DWARF_REG_TO_REGNUM
1022 fprintf_unfiltered (file
,
1023 "gdbarch_dump: %s # %s\n",
1024 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1025 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr
)));
1027 fprintf_unfiltered (file
,
1028 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
1029 (long) current_gdbarch
->dwarf_reg_to_regnum
);
1030 #ifdef ECOFF_REG_TO_REGNUM
1031 fprintf_unfiltered (file
,
1032 "gdbarch_dump: %s # %s\n",
1033 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1034 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr
)));
1036 fprintf_unfiltered (file
,
1037 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
1038 (long) current_gdbarch
->ecoff_reg_to_regnum
);
1039 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1040 fprintf_unfiltered (file
,
1041 "gdbarch_dump: %s # %s\n",
1042 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1043 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym
, msym
)));
1045 fprintf_unfiltered (file
,
1046 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
1047 (long) current_gdbarch
->elf_make_msymbol_special
);
1048 #ifdef EXTRACT_RETURN_VALUE
1049 fprintf_unfiltered (file
,
1050 "gdbarch_dump: %s # %s\n",
1051 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1052 XSTRING (EXTRACT_RETURN_VALUE (type
, regcache
, valbuf
)));
1054 fprintf_unfiltered (file
,
1055 "gdbarch_dump: extract_return_value = <0x%lx>\n",
1056 (long) current_gdbarch
->extract_return_value
);
1057 #ifdef FETCH_POINTER_ARGUMENT_P
1058 fprintf_unfiltered (file
,
1059 "gdbarch_dump: %s # %s\n",
1060 "FETCH_POINTER_ARGUMENT_P()",
1061 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1063 fprintf_unfiltered (file
,
1064 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
1065 gdbarch_fetch_pointer_argument_p (current_gdbarch
));
1066 #ifdef FETCH_POINTER_ARGUMENT
1067 fprintf_unfiltered (file
,
1068 "gdbarch_dump: %s # %s\n",
1069 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1070 XSTRING (FETCH_POINTER_ARGUMENT (frame
, argi
, type
)));
1072 fprintf_unfiltered (file
,
1073 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1074 (long) current_gdbarch
->fetch_pointer_argument
);
1075 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS_P
1076 fprintf_unfiltered (file
,
1077 "gdbarch_dump: %s # %s\n",
1078 "FETCH_TLS_LOAD_MODULE_ADDRESS_P()",
1079 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS_P ()));
1081 fprintf_unfiltered (file
,
1082 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
1083 gdbarch_fetch_tls_load_module_address_p (current_gdbarch
));
1084 #ifdef FETCH_TLS_LOAD_MODULE_ADDRESS
1085 fprintf_unfiltered (file
,
1086 "gdbarch_dump: %s # %s\n",
1087 "FETCH_TLS_LOAD_MODULE_ADDRESS(objfile)",
1088 XSTRING (FETCH_TLS_LOAD_MODULE_ADDRESS (objfile
)));
1090 fprintf_unfiltered (file
,
1091 "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
1092 (long) current_gdbarch
->fetch_tls_load_module_address
);
1093 #ifdef TARGET_FLOAT_BIT
1094 fprintf_unfiltered (file
,
1095 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1096 XSTRING (TARGET_FLOAT_BIT
));
1098 fprintf_unfiltered (file
,
1099 "gdbarch_dump: float_bit = %s\n",
1100 paddr_d (current_gdbarch
->float_bit
));
1101 #ifdef TARGET_FLOAT_FORMAT
1102 fprintf_unfiltered (file
,
1103 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1104 XSTRING (TARGET_FLOAT_FORMAT
));
1106 fprintf_unfiltered (file
,
1107 "gdbarch_dump: float_format = %s\n",
1108 pformat (current_gdbarch
->float_format
));
1110 fprintf_unfiltered (file
,
1111 "gdbarch_dump: FP0_REGNUM # %s\n",
1112 XSTRING (FP0_REGNUM
));
1114 fprintf_unfiltered (file
,
1115 "gdbarch_dump: fp0_regnum = %s\n",
1116 paddr_d (current_gdbarch
->fp0_regnum
));
1117 fprintf_unfiltered (file
,
1118 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1119 gdbarch_frame_align_p (current_gdbarch
));
1120 fprintf_unfiltered (file
,
1121 "gdbarch_dump: frame_align = <0x%lx>\n",
1122 (long) current_gdbarch
->frame_align
);
1123 #ifdef FRAME_ARGS_SKIP
1124 fprintf_unfiltered (file
,
1125 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1126 XSTRING (FRAME_ARGS_SKIP
));
1128 fprintf_unfiltered (file
,
1129 "gdbarch_dump: frame_args_skip = 0x%s\n",
1130 paddr_nz (current_gdbarch
->frame_args_skip
));
1131 #ifdef FRAME_NUM_ARGS_P
1132 fprintf_unfiltered (file
,
1133 "gdbarch_dump: %s # %s\n",
1134 "FRAME_NUM_ARGS_P()",
1135 XSTRING (FRAME_NUM_ARGS_P ()));
1137 fprintf_unfiltered (file
,
1138 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1139 gdbarch_frame_num_args_p (current_gdbarch
));
1140 #ifdef FRAME_NUM_ARGS
1141 fprintf_unfiltered (file
,
1142 "gdbarch_dump: %s # %s\n",
1143 "FRAME_NUM_ARGS(frame)",
1144 XSTRING (FRAME_NUM_ARGS (frame
)));
1146 fprintf_unfiltered (file
,
1147 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1148 (long) current_gdbarch
->frame_num_args
);
1149 #ifdef FRAME_RED_ZONE_SIZE
1150 fprintf_unfiltered (file
,
1151 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1152 XSTRING (FRAME_RED_ZONE_SIZE
));
1154 fprintf_unfiltered (file
,
1155 "gdbarch_dump: frame_red_zone_size = %s\n",
1156 paddr_d (current_gdbarch
->frame_red_zone_size
));
1157 #ifdef GET_LONGJMP_TARGET_P
1158 fprintf_unfiltered (file
,
1159 "gdbarch_dump: %s # %s\n",
1160 "GET_LONGJMP_TARGET_P()",
1161 XSTRING (GET_LONGJMP_TARGET_P ()));
1163 fprintf_unfiltered (file
,
1164 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1165 gdbarch_get_longjmp_target_p (current_gdbarch
));
1166 #ifdef GET_LONGJMP_TARGET
1167 fprintf_unfiltered (file
,
1168 "gdbarch_dump: %s # %s\n",
1169 "GET_LONGJMP_TARGET(pc)",
1170 XSTRING (GET_LONGJMP_TARGET (pc
)));
1172 fprintf_unfiltered (file
,
1173 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1174 (long) current_gdbarch
->get_longjmp_target
);
1175 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1176 fprintf_unfiltered (file
,
1177 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1178 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT
));
1180 fprintf_unfiltered (file
,
1181 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1182 paddr_d (current_gdbarch
->have_nonsteppable_watchpoint
));
1183 fprintf_unfiltered (file
,
1184 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1185 (long) current_gdbarch
->in_function_epilogue_p
);
1186 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1187 fprintf_unfiltered (file
,
1188 "gdbarch_dump: %s # %s\n",
1189 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1190 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc
, name
)));
1192 fprintf_unfiltered (file
,
1193 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1194 (long) current_gdbarch
->in_solib_return_trampoline
);
1196 fprintf_unfiltered (file
,
1197 "gdbarch_dump: %s # %s\n",
1198 "INNER_THAN(lhs, rhs)",
1199 XSTRING (INNER_THAN (lhs
, rhs
)));
1201 fprintf_unfiltered (file
,
1202 "gdbarch_dump: inner_than = <0x%lx>\n",
1203 (long) current_gdbarch
->inner_than
);
1204 #ifdef TARGET_INT_BIT
1205 fprintf_unfiltered (file
,
1206 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1207 XSTRING (TARGET_INT_BIT
));
1209 fprintf_unfiltered (file
,
1210 "gdbarch_dump: int_bit = %s\n",
1211 paddr_d (current_gdbarch
->int_bit
));
1212 fprintf_unfiltered (file
,
1213 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1214 gdbarch_integer_to_address_p (current_gdbarch
));
1215 fprintf_unfiltered (file
,
1216 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1217 (long) current_gdbarch
->integer_to_address
);
1218 #ifdef TARGET_LONG_BIT
1219 fprintf_unfiltered (file
,
1220 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1221 XSTRING (TARGET_LONG_BIT
));
1223 fprintf_unfiltered (file
,
1224 "gdbarch_dump: long_bit = %s\n",
1225 paddr_d (current_gdbarch
->long_bit
));
1226 #ifdef TARGET_LONG_DOUBLE_BIT
1227 fprintf_unfiltered (file
,
1228 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1229 XSTRING (TARGET_LONG_DOUBLE_BIT
));
1231 fprintf_unfiltered (file
,
1232 "gdbarch_dump: long_double_bit = %s\n",
1233 paddr_d (current_gdbarch
->long_double_bit
));
1234 #ifdef TARGET_LONG_DOUBLE_FORMAT
1235 fprintf_unfiltered (file
,
1236 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1237 XSTRING (TARGET_LONG_DOUBLE_FORMAT
));
1239 fprintf_unfiltered (file
,
1240 "gdbarch_dump: long_double_format = %s\n",
1241 pformat (current_gdbarch
->long_double_format
));
1242 #ifdef TARGET_LONG_LONG_BIT
1243 fprintf_unfiltered (file
,
1244 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1245 XSTRING (TARGET_LONG_LONG_BIT
));
1247 fprintf_unfiltered (file
,
1248 "gdbarch_dump: long_long_bit = %s\n",
1249 paddr_d (current_gdbarch
->long_long_bit
));
1250 #ifdef MEMORY_INSERT_BREAKPOINT
1251 fprintf_unfiltered (file
,
1252 "gdbarch_dump: %s # %s\n",
1253 "MEMORY_INSERT_BREAKPOINT(bp_tgt)",
1254 XSTRING (MEMORY_INSERT_BREAKPOINT (bp_tgt
)));
1256 fprintf_unfiltered (file
,
1257 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1258 (long) current_gdbarch
->memory_insert_breakpoint
);
1259 #ifdef MEMORY_REMOVE_BREAKPOINT
1260 fprintf_unfiltered (file
,
1261 "gdbarch_dump: %s # %s\n",
1262 "MEMORY_REMOVE_BREAKPOINT(bp_tgt)",
1263 XSTRING (MEMORY_REMOVE_BREAKPOINT (bp_tgt
)));
1265 fprintf_unfiltered (file
,
1266 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1267 (long) current_gdbarch
->memory_remove_breakpoint
);
1268 #ifdef NAME_OF_MALLOC
1269 fprintf_unfiltered (file
,
1270 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1271 XSTRING (NAME_OF_MALLOC
));
1273 fprintf_unfiltered (file
,
1274 "gdbarch_dump: name_of_malloc = %s\n",
1276 #ifdef NUM_PSEUDO_REGS
1277 fprintf_unfiltered (file
,
1278 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1279 XSTRING (NUM_PSEUDO_REGS
));
1281 fprintf_unfiltered (file
,
1282 "gdbarch_dump: num_pseudo_regs = %s\n",
1283 paddr_d (current_gdbarch
->num_pseudo_regs
));
1285 fprintf_unfiltered (file
,
1286 "gdbarch_dump: NUM_REGS # %s\n",
1287 XSTRING (NUM_REGS
));
1289 fprintf_unfiltered (file
,
1290 "gdbarch_dump: num_regs = %s\n",
1291 paddr_d (current_gdbarch
->num_regs
));
1293 fprintf_unfiltered (file
,
1294 "gdbarch_dump: TARGET_OSABI # %s\n",
1295 XSTRING (TARGET_OSABI
));
1297 fprintf_unfiltered (file
,
1298 "gdbarch_dump: osabi = %s\n",
1299 paddr_d (current_gdbarch
->osabi
));
1301 fprintf_unfiltered (file
,
1302 "gdbarch_dump: PC_REGNUM # %s\n",
1303 XSTRING (PC_REGNUM
));
1305 fprintf_unfiltered (file
,
1306 "gdbarch_dump: pc_regnum = %s\n",
1307 paddr_d (current_gdbarch
->pc_regnum
));
1308 #ifdef POINTER_TO_ADDRESS
1309 fprintf_unfiltered (file
,
1310 "gdbarch_dump: %s # %s\n",
1311 "POINTER_TO_ADDRESS(type, buf)",
1312 XSTRING (POINTER_TO_ADDRESS (type
, buf
)));
1314 fprintf_unfiltered (file
,
1315 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1316 (long) current_gdbarch
->pointer_to_address
);
1317 fprintf_unfiltered (file
,
1318 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1319 gdbarch_print_float_info_p (current_gdbarch
));
1320 fprintf_unfiltered (file
,
1321 "gdbarch_dump: print_float_info = <0x%lx>\n",
1322 (long) current_gdbarch
->print_float_info
);
1323 #ifdef TARGET_PRINT_INSN
1324 fprintf_unfiltered (file
,
1325 "gdbarch_dump: %s # %s\n",
1326 "TARGET_PRINT_INSN(vma, info)",
1327 XSTRING (TARGET_PRINT_INSN (vma
, info
)));
1329 fprintf_unfiltered (file
,
1330 "gdbarch_dump: print_insn = <0x%lx>\n",
1331 (long) current_gdbarch
->print_insn
);
1332 fprintf_unfiltered (file
,
1333 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1334 (long) current_gdbarch
->print_registers_info
);
1335 fprintf_unfiltered (file
,
1336 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1337 gdbarch_print_vector_info_p (current_gdbarch
));
1338 fprintf_unfiltered (file
,
1339 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1340 (long) current_gdbarch
->print_vector_info
);
1342 fprintf_unfiltered (file
,
1343 "gdbarch_dump: PS_REGNUM # %s\n",
1344 XSTRING (PS_REGNUM
));
1346 fprintf_unfiltered (file
,
1347 "gdbarch_dump: ps_regnum = %s\n",
1348 paddr_d (current_gdbarch
->ps_regnum
));
1349 fprintf_unfiltered (file
,
1350 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1351 gdbarch_pseudo_register_read_p (current_gdbarch
));
1352 fprintf_unfiltered (file
,
1353 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1354 (long) current_gdbarch
->pseudo_register_read
);
1355 fprintf_unfiltered (file
,
1356 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1357 gdbarch_pseudo_register_write_p (current_gdbarch
));
1358 fprintf_unfiltered (file
,
1359 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1360 (long) current_gdbarch
->pseudo_register_write
);
1361 #ifdef TARGET_PTR_BIT
1362 fprintf_unfiltered (file
,
1363 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1364 XSTRING (TARGET_PTR_BIT
));
1366 fprintf_unfiltered (file
,
1367 "gdbarch_dump: ptr_bit = %s\n",
1368 paddr_d (current_gdbarch
->ptr_bit
));
1369 fprintf_unfiltered (file
,
1370 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1371 gdbarch_push_dummy_call_p (current_gdbarch
));
1372 fprintf_unfiltered (file
,
1373 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1374 (long) current_gdbarch
->push_dummy_call
);
1375 fprintf_unfiltered (file
,
1376 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1377 gdbarch_push_dummy_code_p (current_gdbarch
));
1378 fprintf_unfiltered (file
,
1379 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1380 (long) current_gdbarch
->push_dummy_code
);
1381 #ifdef TARGET_READ_PC_P
1382 fprintf_unfiltered (file
,
1383 "gdbarch_dump: %s # %s\n",
1384 "TARGET_READ_PC_P()",
1385 XSTRING (TARGET_READ_PC_P ()));
1387 fprintf_unfiltered (file
,
1388 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1389 gdbarch_read_pc_p (current_gdbarch
));
1390 #ifdef TARGET_READ_PC
1391 fprintf_unfiltered (file
,
1392 "gdbarch_dump: %s # %s\n",
1393 "TARGET_READ_PC(ptid)",
1394 XSTRING (TARGET_READ_PC (ptid
)));
1396 fprintf_unfiltered (file
,
1397 "gdbarch_dump: read_pc = <0x%lx>\n",
1398 (long) current_gdbarch
->read_pc
);
1399 #ifdef TARGET_READ_SP_P
1400 fprintf_unfiltered (file
,
1401 "gdbarch_dump: %s # %s\n",
1402 "TARGET_READ_SP_P()",
1403 XSTRING (TARGET_READ_SP_P ()));
1405 fprintf_unfiltered (file
,
1406 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1407 gdbarch_read_sp_p (current_gdbarch
));
1408 #ifdef TARGET_READ_SP
1409 fprintf_unfiltered (file
,
1410 "gdbarch_dump: %s # %s\n",
1412 XSTRING (TARGET_READ_SP ()));
1414 fprintf_unfiltered (file
,
1415 "gdbarch_dump: read_sp = <0x%lx>\n",
1416 (long) current_gdbarch
->read_sp
);
1417 #ifdef REGISTER_BYTES_OK_P
1418 fprintf_unfiltered (file
,
1419 "gdbarch_dump: %s # %s\n",
1420 "REGISTER_BYTES_OK_P()",
1421 XSTRING (REGISTER_BYTES_OK_P ()));
1423 fprintf_unfiltered (file
,
1424 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1425 gdbarch_register_bytes_ok_p (current_gdbarch
));
1426 #ifdef REGISTER_BYTES_OK
1427 fprintf_unfiltered (file
,
1428 "gdbarch_dump: %s # %s\n",
1429 "REGISTER_BYTES_OK(nr_bytes)",
1430 XSTRING (REGISTER_BYTES_OK (nr_bytes
)));
1432 fprintf_unfiltered (file
,
1433 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1434 (long) current_gdbarch
->register_bytes_ok
);
1435 #ifdef REGISTER_NAME
1436 fprintf_unfiltered (file
,
1437 "gdbarch_dump: %s # %s\n",
1438 "REGISTER_NAME(regnr)",
1439 XSTRING (REGISTER_NAME (regnr
)));
1441 fprintf_unfiltered (file
,
1442 "gdbarch_dump: register_name = <0x%lx>\n",
1443 (long) current_gdbarch
->register_name
);
1444 fprintf_unfiltered (file
,
1445 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1446 (long) current_gdbarch
->register_reggroup_p
);
1447 #ifdef REGISTER_SIM_REGNO
1448 fprintf_unfiltered (file
,
1449 "gdbarch_dump: %s # %s\n",
1450 "REGISTER_SIM_REGNO(reg_nr)",
1451 XSTRING (REGISTER_SIM_REGNO (reg_nr
)));
1453 fprintf_unfiltered (file
,
1454 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1455 (long) current_gdbarch
->register_sim_regno
);
1456 #ifdef REGISTER_TO_VALUE
1457 fprintf_unfiltered (file
,
1458 "gdbarch_dump: %s # %s\n",
1459 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1460 XSTRING (REGISTER_TO_VALUE (frame
, regnum
, type
, buf
)));
1462 fprintf_unfiltered (file
,
1463 "gdbarch_dump: register_to_value = <0x%lx>\n",
1464 (long) current_gdbarch
->register_to_value
);
1465 fprintf_unfiltered (file
,
1466 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1467 gdbarch_register_type_p (current_gdbarch
));
1468 fprintf_unfiltered (file
,
1469 "gdbarch_dump: register_type = <0x%lx>\n",
1470 (long) current_gdbarch
->register_type
);
1471 fprintf_unfiltered (file
,
1472 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1473 gdbarch_regset_from_core_section_p (current_gdbarch
));
1474 fprintf_unfiltered (file
,
1475 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1476 (long) current_gdbarch
->regset_from_core_section
);
1477 fprintf_unfiltered (file
,
1478 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1479 (long) current_gdbarch
->remote_translate_xfer_address
);
1480 fprintf_unfiltered (file
,
1481 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1482 gdbarch_return_value_p (current_gdbarch
));
1483 fprintf_unfiltered (file
,
1484 "gdbarch_dump: return_value = <0x%lx>\n",
1485 (long) current_gdbarch
->return_value
);
1486 #ifdef SDB_REG_TO_REGNUM
1487 fprintf_unfiltered (file
,
1488 "gdbarch_dump: %s # %s\n",
1489 "SDB_REG_TO_REGNUM(sdb_regnr)",
1490 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr
)));
1492 fprintf_unfiltered (file
,
1493 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1494 (long) current_gdbarch
->sdb_reg_to_regnum
);
1495 #ifdef TARGET_SHORT_BIT
1496 fprintf_unfiltered (file
,
1497 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1498 XSTRING (TARGET_SHORT_BIT
));
1500 fprintf_unfiltered (file
,
1501 "gdbarch_dump: short_bit = %s\n",
1502 paddr_d (current_gdbarch
->short_bit
));
1503 fprintf_unfiltered (file
,
1504 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
1505 gdbarch_single_step_through_delay_p (current_gdbarch
));
1506 fprintf_unfiltered (file
,
1507 "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1508 (long) current_gdbarch
->single_step_through_delay
);
1509 #ifdef SKIP_PROLOGUE
1510 fprintf_unfiltered (file
,
1511 "gdbarch_dump: %s # %s\n",
1512 "SKIP_PROLOGUE(ip)",
1513 XSTRING (SKIP_PROLOGUE (ip
)));
1515 fprintf_unfiltered (file
,
1516 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1517 (long) current_gdbarch
->skip_prologue
);
1518 fprintf_unfiltered (file
,
1519 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1520 (long) current_gdbarch
->skip_solib_resolver
);
1521 #ifdef SKIP_TRAMPOLINE_CODE
1522 fprintf_unfiltered (file
,
1523 "gdbarch_dump: %s # %s\n",
1524 "SKIP_TRAMPOLINE_CODE(pc)",
1525 XSTRING (SKIP_TRAMPOLINE_CODE (pc
)));
1527 fprintf_unfiltered (file
,
1528 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1529 (long) current_gdbarch
->skip_trampoline_code
);
1530 #ifdef SMASH_TEXT_ADDRESS
1531 fprintf_unfiltered (file
,
1532 "gdbarch_dump: %s # %s\n",
1533 "SMASH_TEXT_ADDRESS(addr)",
1534 XSTRING (SMASH_TEXT_ADDRESS (addr
)));
1536 fprintf_unfiltered (file
,
1537 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1538 (long) current_gdbarch
->smash_text_address
);
1539 #ifdef SOFTWARE_SINGLE_STEP_P
1540 fprintf_unfiltered (file
,
1541 "gdbarch_dump: %s # %s\n",
1542 "SOFTWARE_SINGLE_STEP_P()",
1543 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1545 fprintf_unfiltered (file
,
1546 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1547 gdbarch_software_single_step_p (current_gdbarch
));
1548 #ifdef SOFTWARE_SINGLE_STEP
1549 fprintf_unfiltered (file
,
1550 "gdbarch_dump: %s # %s\n",
1551 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1552 XSTRING (SOFTWARE_SINGLE_STEP (sig
, insert_breakpoints_p
)));
1554 fprintf_unfiltered (file
,
1555 "gdbarch_dump: software_single_step = <0x%lx>\n",
1556 (long) current_gdbarch
->software_single_step
);
1558 fprintf_unfiltered (file
,
1559 "gdbarch_dump: SP_REGNUM # %s\n",
1560 XSTRING (SP_REGNUM
));
1562 fprintf_unfiltered (file
,
1563 "gdbarch_dump: sp_regnum = %s\n",
1564 paddr_d (current_gdbarch
->sp_regnum
));
1565 #ifdef STAB_REG_TO_REGNUM
1566 fprintf_unfiltered (file
,
1567 "gdbarch_dump: %s # %s\n",
1568 "STAB_REG_TO_REGNUM(stab_regnr)",
1569 XSTRING (STAB_REG_TO_REGNUM (stab_regnr
)));
1571 fprintf_unfiltered (file
,
1572 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1573 (long) current_gdbarch
->stab_reg_to_regnum
);
1574 fprintf_unfiltered (file
,
1575 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1576 (long) current_gdbarch
->stabs_argument_has_addr
);
1577 #ifdef STORE_RETURN_VALUE
1578 fprintf_unfiltered (file
,
1579 "gdbarch_dump: %s # %s\n",
1580 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1581 XSTRING (STORE_RETURN_VALUE (type
, regcache
, valbuf
)));
1583 fprintf_unfiltered (file
,
1584 "gdbarch_dump: store_return_value = <0x%lx>\n",
1585 (long) current_gdbarch
->store_return_value
);
1586 fprintf_unfiltered (file
,
1587 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1588 gdbarch_unwind_dummy_id_p (current_gdbarch
));
1589 fprintf_unfiltered (file
,
1590 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1591 (long) current_gdbarch
->unwind_dummy_id
);
1592 fprintf_unfiltered (file
,
1593 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1594 gdbarch_unwind_pc_p (current_gdbarch
));
1595 fprintf_unfiltered (file
,
1596 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1597 (long) current_gdbarch
->unwind_pc
);
1598 fprintf_unfiltered (file
,
1599 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1600 gdbarch_unwind_sp_p (current_gdbarch
));
1601 fprintf_unfiltered (file
,
1602 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1603 (long) current_gdbarch
->unwind_sp
);
1604 #ifdef VALUE_TO_REGISTER
1605 fprintf_unfiltered (file
,
1606 "gdbarch_dump: %s # %s\n",
1607 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1608 XSTRING (VALUE_TO_REGISTER (frame
, regnum
, type
, buf
)));
1610 fprintf_unfiltered (file
,
1611 "gdbarch_dump: value_to_register = <0x%lx>\n",
1612 (long) current_gdbarch
->value_to_register
);
1613 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1614 fprintf_unfiltered (file
,
1615 "gdbarch_dump: %s # %s\n",
1616 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1617 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc
, frame_regnum
, frame_offset
)));
1619 fprintf_unfiltered (file
,
1620 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1621 (long) current_gdbarch
->virtual_frame_pointer
);
1622 #ifdef TARGET_WRITE_PC
1623 fprintf_unfiltered (file
,
1624 "gdbarch_dump: %s # %s\n",
1625 "TARGET_WRITE_PC(val, ptid)",
1626 XSTRING (TARGET_WRITE_PC (val
, ptid
)));
1628 fprintf_unfiltered (file
,
1629 "gdbarch_dump: write_pc = <0x%lx>\n",
1630 (long) current_gdbarch
->write_pc
);
1631 if (current_gdbarch
->dump_tdep
!= NULL
)
1632 current_gdbarch
->dump_tdep (current_gdbarch
, file
);
1635 struct gdbarch_tdep
*
1636 gdbarch_tdep (struct gdbarch
*gdbarch
)
1638 if (gdbarch_debug
>= 2)
1639 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1640 return gdbarch
->tdep
;
1644 const struct bfd_arch_info
*
1645 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1647 gdb_assert (gdbarch
!= NULL
);
1648 if (gdbarch_debug
>= 2)
1649 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1650 return gdbarch
->bfd_arch_info
;
1654 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1656 gdb_assert (gdbarch
!= NULL
);
1657 if (gdbarch_debug
>= 2)
1658 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1659 return gdbarch
->byte_order
;
1663 gdbarch_osabi (struct gdbarch
*gdbarch
)
1665 gdb_assert (gdbarch
!= NULL
);
1666 if (gdbarch_debug
>= 2)
1667 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1668 return gdbarch
->osabi
;
1672 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1674 gdb_assert (gdbarch
!= NULL
);
1675 /* Skip verify of short_bit, invalid_p == 0 */
1676 if (gdbarch_debug
>= 2)
1677 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1678 return gdbarch
->short_bit
;
1682 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1685 gdbarch
->short_bit
= short_bit
;
1689 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1691 gdb_assert (gdbarch
!= NULL
);
1692 /* Skip verify of int_bit, invalid_p == 0 */
1693 if (gdbarch_debug
>= 2)
1694 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1695 return gdbarch
->int_bit
;
1699 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1702 gdbarch
->int_bit
= int_bit
;
1706 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1708 gdb_assert (gdbarch
!= NULL
);
1709 /* Skip verify of long_bit, invalid_p == 0 */
1710 if (gdbarch_debug
>= 2)
1711 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1712 return gdbarch
->long_bit
;
1716 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1719 gdbarch
->long_bit
= long_bit
;
1723 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1725 gdb_assert (gdbarch
!= NULL
);
1726 /* Skip verify of long_long_bit, invalid_p == 0 */
1727 if (gdbarch_debug
>= 2)
1728 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1729 return gdbarch
->long_long_bit
;
1733 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1736 gdbarch
->long_long_bit
= long_long_bit
;
1740 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1742 gdb_assert (gdbarch
!= NULL
);
1743 /* Skip verify of float_bit, invalid_p == 0 */
1744 if (gdbarch_debug
>= 2)
1745 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1746 return gdbarch
->float_bit
;
1750 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1753 gdbarch
->float_bit
= float_bit
;
1756 const struct floatformat
*
1757 gdbarch_float_format (struct gdbarch
*gdbarch
)
1759 gdb_assert (gdbarch
!= NULL
);
1760 if (gdbarch_debug
>= 2)
1761 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1762 return gdbarch
->float_format
;
1766 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1767 const struct floatformat
* float_format
)
1769 gdbarch
->float_format
= float_format
;
1773 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1775 gdb_assert (gdbarch
!= NULL
);
1776 /* Skip verify of double_bit, invalid_p == 0 */
1777 if (gdbarch_debug
>= 2)
1778 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1779 return gdbarch
->double_bit
;
1783 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1786 gdbarch
->double_bit
= double_bit
;
1789 const struct floatformat
*
1790 gdbarch_double_format (struct gdbarch
*gdbarch
)
1792 gdb_assert (gdbarch
!= NULL
);
1793 if (gdbarch_debug
>= 2)
1794 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1795 return gdbarch
->double_format
;
1799 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1800 const struct floatformat
* double_format
)
1802 gdbarch
->double_format
= double_format
;
1806 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1808 gdb_assert (gdbarch
!= NULL
);
1809 /* Skip verify of long_double_bit, invalid_p == 0 */
1810 if (gdbarch_debug
>= 2)
1811 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1812 return gdbarch
->long_double_bit
;
1816 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1817 int long_double_bit
)
1819 gdbarch
->long_double_bit
= long_double_bit
;
1822 const struct floatformat
*
1823 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1825 gdb_assert (gdbarch
!= NULL
);
1826 if (gdbarch_debug
>= 2)
1827 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1828 return gdbarch
->long_double_format
;
1832 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1833 const struct floatformat
* long_double_format
)
1835 gdbarch
->long_double_format
= long_double_format
;
1839 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1841 gdb_assert (gdbarch
!= NULL
);
1842 /* Skip verify of ptr_bit, invalid_p == 0 */
1843 if (gdbarch_debug
>= 2)
1844 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1845 return gdbarch
->ptr_bit
;
1849 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1852 gdbarch
->ptr_bit
= ptr_bit
;
1856 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1858 gdb_assert (gdbarch
!= NULL
);
1859 /* Check variable changed from pre-default. */
1860 gdb_assert (gdbarch
->addr_bit
!= 0);
1861 if (gdbarch_debug
>= 2)
1862 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1863 return gdbarch
->addr_bit
;
1867 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1870 gdbarch
->addr_bit
= addr_bit
;
1874 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1876 gdb_assert (gdbarch
!= NULL
);
1877 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1878 if (gdbarch_debug
>= 2)
1879 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1880 return gdbarch
->bfd_vma_bit
;
1884 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1887 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1891 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1893 gdb_assert (gdbarch
!= NULL
);
1894 /* Check variable changed from pre-default. */
1895 gdb_assert (gdbarch
->char_signed
!= -1);
1896 if (gdbarch_debug
>= 2)
1897 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1898 return gdbarch
->char_signed
;
1902 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1905 gdbarch
->char_signed
= char_signed
;
1909 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1911 gdb_assert (gdbarch
!= NULL
);
1912 return gdbarch
->read_pc
!= NULL
;
1916 gdbarch_read_pc (struct gdbarch
*gdbarch
, ptid_t ptid
)
1918 gdb_assert (gdbarch
!= NULL
);
1919 gdb_assert (gdbarch
->read_pc
!= NULL
);
1920 if (gdbarch_debug
>= 2)
1921 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1922 return gdbarch
->read_pc (ptid
);
1926 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1927 gdbarch_read_pc_ftype read_pc
)
1929 gdbarch
->read_pc
= read_pc
;
1933 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, ptid_t ptid
)
1935 gdb_assert (gdbarch
!= NULL
);
1936 gdb_assert (gdbarch
->write_pc
!= NULL
);
1937 if (gdbarch_debug
>= 2)
1938 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1939 gdbarch
->write_pc (val
, ptid
);
1943 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1944 gdbarch_write_pc_ftype write_pc
)
1946 gdbarch
->write_pc
= write_pc
;
1950 gdbarch_read_sp_p (struct gdbarch
*gdbarch
)
1952 gdb_assert (gdbarch
!= NULL
);
1953 return gdbarch
->read_sp
!= NULL
;
1957 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1959 gdb_assert (gdbarch
!= NULL
);
1960 gdb_assert (gdbarch
->read_sp
!= NULL
);
1961 if (gdbarch_debug
>= 2)
1962 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1963 return gdbarch
->read_sp ();
1967 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1968 gdbarch_read_sp_ftype read_sp
)
1970 gdbarch
->read_sp
= read_sp
;
1974 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1976 gdb_assert (gdbarch
!= NULL
);
1977 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1978 if (gdbarch_debug
>= 2)
1979 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1980 gdbarch
->virtual_frame_pointer (pc
, frame_regnum
, frame_offset
);
1984 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1985 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1987 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1991 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1993 gdb_assert (gdbarch
!= NULL
);
1994 return gdbarch
->pseudo_register_read
!= NULL
;
1998 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, gdb_byte
*buf
)
2000 gdb_assert (gdbarch
!= NULL
);
2001 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
2002 if (gdbarch_debug
>= 2)
2003 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
2004 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
2008 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
2009 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
2011 gdbarch
->pseudo_register_read
= pseudo_register_read
;
2015 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
2017 gdb_assert (gdbarch
!= NULL
);
2018 return gdbarch
->pseudo_register_write
!= NULL
;
2022 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const gdb_byte
*buf
)
2024 gdb_assert (gdbarch
!= NULL
);
2025 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
2026 if (gdbarch_debug
>= 2)
2027 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
2028 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
2032 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
2033 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
2035 gdbarch
->pseudo_register_write
= pseudo_register_write
;
2039 gdbarch_num_regs (struct gdbarch
*gdbarch
)
2041 gdb_assert (gdbarch
!= NULL
);
2042 /* Check variable changed from pre-default. */
2043 gdb_assert (gdbarch
->num_regs
!= -1);
2044 if (gdbarch_debug
>= 2)
2045 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
2046 return gdbarch
->num_regs
;
2050 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
2053 gdbarch
->num_regs
= num_regs
;
2057 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
2059 gdb_assert (gdbarch
!= NULL
);
2060 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2061 if (gdbarch_debug
>= 2)
2062 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
2063 return gdbarch
->num_pseudo_regs
;
2067 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
2068 int num_pseudo_regs
)
2070 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
2074 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
2076 gdb_assert (gdbarch
!= NULL
);
2077 /* Skip verify of sp_regnum, invalid_p == 0 */
2078 if (gdbarch_debug
>= 2)
2079 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
2080 return gdbarch
->sp_regnum
;
2084 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
2087 gdbarch
->sp_regnum
= sp_regnum
;
2091 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
2093 gdb_assert (gdbarch
!= NULL
);
2094 /* Skip verify of pc_regnum, invalid_p == 0 */
2095 if (gdbarch_debug
>= 2)
2096 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
2097 return gdbarch
->pc_regnum
;
2101 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
2104 gdbarch
->pc_regnum
= pc_regnum
;
2108 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
2110 gdb_assert (gdbarch
!= NULL
);
2111 /* Skip verify of ps_regnum, invalid_p == 0 */
2112 if (gdbarch_debug
>= 2)
2113 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
2114 return gdbarch
->ps_regnum
;
2118 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
2121 gdbarch
->ps_regnum
= ps_regnum
;
2125 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
2127 gdb_assert (gdbarch
!= NULL
);
2128 /* Skip verify of fp0_regnum, invalid_p == 0 */
2129 if (gdbarch_debug
>= 2)
2130 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
2131 return gdbarch
->fp0_regnum
;
2135 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
2138 gdbarch
->fp0_regnum
= fp0_regnum
;
2142 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
2144 gdb_assert (gdbarch
!= NULL
);
2145 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
2146 if (gdbarch_debug
>= 2)
2147 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
2148 return gdbarch
->stab_reg_to_regnum (stab_regnr
);
2152 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
2153 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
2155 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
2159 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
2161 gdb_assert (gdbarch
!= NULL
);
2162 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
2163 if (gdbarch_debug
>= 2)
2164 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
2165 return gdbarch
->ecoff_reg_to_regnum (ecoff_regnr
);
2169 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
2170 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
2172 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
2176 gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf_regnr
)
2178 gdb_assert (gdbarch
!= NULL
);
2179 gdb_assert (gdbarch
->dwarf_reg_to_regnum
!= NULL
);
2180 if (gdbarch_debug
>= 2)
2181 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf_reg_to_regnum called\n");
2182 return gdbarch
->dwarf_reg_to_regnum (dwarf_regnr
);
2186 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
,
2187 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum
)
2189 gdbarch
->dwarf_reg_to_regnum
= dwarf_reg_to_regnum
;
2193 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
2195 gdb_assert (gdbarch
!= NULL
);
2196 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
2197 if (gdbarch_debug
>= 2)
2198 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
2199 return gdbarch
->sdb_reg_to_regnum (sdb_regnr
);
2203 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
2204 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
2206 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
2210 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
2212 gdb_assert (gdbarch
!= NULL
);
2213 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
2214 if (gdbarch_debug
>= 2)
2215 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
2216 return gdbarch
->dwarf2_reg_to_regnum (dwarf2_regnr
);
2220 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
2221 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
2223 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
2227 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
2229 gdb_assert (gdbarch
!= NULL
);
2230 gdb_assert (gdbarch
->register_name
!= NULL
);
2231 if (gdbarch_debug
>= 2)
2232 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
2233 return gdbarch
->register_name (regnr
);
2237 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
2238 gdbarch_register_name_ftype register_name
)
2240 gdbarch
->register_name
= register_name
;
2244 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
2246 gdb_assert (gdbarch
!= NULL
);
2247 return gdbarch
->register_type
!= NULL
;
2251 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
2253 gdb_assert (gdbarch
!= NULL
);
2254 gdb_assert (gdbarch
->register_type
!= NULL
);
2255 if (gdbarch_debug
>= 2)
2256 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
2257 return gdbarch
->register_type (gdbarch
, reg_nr
);
2261 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
2262 gdbarch_register_type_ftype register_type
)
2264 gdbarch
->register_type
= register_type
;
2268 gdbarch_deprecated_register_byte_p (struct gdbarch
*gdbarch
)
2270 gdb_assert (gdbarch
!= NULL
);
2271 return gdbarch
->deprecated_register_byte
!= generic_register_byte
;
2275 gdbarch_deprecated_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
2277 gdb_assert (gdbarch
!= NULL
);
2278 gdb_assert (gdbarch
->deprecated_register_byte
!= NULL
);
2279 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2280 if (gdbarch_debug
>= 2)
2281 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_byte called\n");
2282 return gdbarch
->deprecated_register_byte (reg_nr
);
2286 set_gdbarch_deprecated_register_byte (struct gdbarch
*gdbarch
,
2287 gdbarch_deprecated_register_byte_ftype deprecated_register_byte
)
2289 gdbarch
->deprecated_register_byte
= deprecated_register_byte
;
2293 gdbarch_unwind_dummy_id_p (struct gdbarch
*gdbarch
)
2295 gdb_assert (gdbarch
!= NULL
);
2296 return gdbarch
->unwind_dummy_id
!= NULL
;
2300 gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*info
)
2302 gdb_assert (gdbarch
!= NULL
);
2303 gdb_assert (gdbarch
->unwind_dummy_id
!= NULL
);
2304 if (gdbarch_debug
>= 2)
2305 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_dummy_id called\n");
2306 return gdbarch
->unwind_dummy_id (gdbarch
, info
);
2310 set_gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
,
2311 gdbarch_unwind_dummy_id_ftype unwind_dummy_id
)
2313 gdbarch
->unwind_dummy_id
= unwind_dummy_id
;
2317 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
2319 gdb_assert (gdbarch
!= NULL
);
2320 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2321 if (gdbarch_debug
>= 2)
2322 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
2323 return gdbarch
->deprecated_fp_regnum
;
2327 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
2328 int deprecated_fp_regnum
)
2330 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
2334 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
2336 gdb_assert (gdbarch
!= NULL
);
2337 return gdbarch
->push_dummy_call
!= NULL
;
2341 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
)
2343 gdb_assert (gdbarch
!= NULL
);
2344 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
2345 if (gdbarch_debug
>= 2)
2346 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
2347 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
2351 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
2352 gdbarch_push_dummy_call_ftype push_dummy_call
)
2354 gdbarch
->push_dummy_call
= push_dummy_call
;
2358 gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
)
2360 gdb_assert (gdbarch
!= NULL
);
2361 if (gdbarch_debug
>= 2)
2362 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_size called\n");
2363 return gdbarch
->deprecated_register_size
;
2367 set_gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
,
2368 int deprecated_register_size
)
2370 gdbarch
->deprecated_register_size
= deprecated_register_size
;
2374 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
2376 gdb_assert (gdbarch
!= NULL
);
2377 /* Skip verify of call_dummy_location, invalid_p == 0 */
2378 if (gdbarch_debug
>= 2)
2379 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
2380 return gdbarch
->call_dummy_location
;
2384 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
2385 int call_dummy_location
)
2387 gdbarch
->call_dummy_location
= call_dummy_location
;
2391 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2393 gdb_assert (gdbarch
!= NULL
);
2394 return gdbarch
->push_dummy_code
!= NULL
;
2398 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
)
2400 gdb_assert (gdbarch
!= NULL
);
2401 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2402 if (gdbarch_debug
>= 2)
2403 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2404 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, using_gcc
, args
, nargs
, value_type
, real_pc
, bp_addr
);
2408 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2409 gdbarch_push_dummy_code_ftype push_dummy_code
)
2411 gdbarch
->push_dummy_code
= push_dummy_code
;
2415 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2417 gdb_assert (gdbarch
!= NULL
);
2418 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2419 if (gdbarch_debug
>= 2)
2420 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2421 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2425 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2426 gdbarch_print_registers_info_ftype print_registers_info
)
2428 gdbarch
->print_registers_info
= print_registers_info
;
2432 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2434 gdb_assert (gdbarch
!= NULL
);
2435 return gdbarch
->print_float_info
!= NULL
;
2439 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2441 gdb_assert (gdbarch
!= NULL
);
2442 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2443 if (gdbarch_debug
>= 2)
2444 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2445 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2449 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2450 gdbarch_print_float_info_ftype print_float_info
)
2452 gdbarch
->print_float_info
= print_float_info
;
2456 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2458 gdb_assert (gdbarch
!= NULL
);
2459 return gdbarch
->print_vector_info
!= NULL
;
2463 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2465 gdb_assert (gdbarch
!= NULL
);
2466 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2467 if (gdbarch_debug
>= 2)
2468 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2469 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2473 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2474 gdbarch_print_vector_info_ftype print_vector_info
)
2476 gdbarch
->print_vector_info
= print_vector_info
;
2480 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2482 gdb_assert (gdbarch
!= NULL
);
2483 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2484 if (gdbarch_debug
>= 2)
2485 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2486 return gdbarch
->register_sim_regno (reg_nr
);
2490 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2491 gdbarch_register_sim_regno_ftype register_sim_regno
)
2493 gdbarch
->register_sim_regno
= register_sim_regno
;
2497 gdbarch_register_bytes_ok_p (struct gdbarch
*gdbarch
)
2499 gdb_assert (gdbarch
!= NULL
);
2500 return gdbarch
->register_bytes_ok
!= NULL
;
2504 gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
, long nr_bytes
)
2506 gdb_assert (gdbarch
!= NULL
);
2507 gdb_assert (gdbarch
->register_bytes_ok
!= NULL
);
2508 if (gdbarch_debug
>= 2)
2509 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes_ok called\n");
2510 return gdbarch
->register_bytes_ok (nr_bytes
);
2514 set_gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
,
2515 gdbarch_register_bytes_ok_ftype register_bytes_ok
)
2517 gdbarch
->register_bytes_ok
= register_bytes_ok
;
2521 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2523 gdb_assert (gdbarch
!= NULL
);
2524 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2525 if (gdbarch_debug
>= 2)
2526 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2527 return gdbarch
->cannot_fetch_register (regnum
);
2531 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2532 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2534 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2538 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2540 gdb_assert (gdbarch
!= NULL
);
2541 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2542 if (gdbarch_debug
>= 2)
2543 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2544 return gdbarch
->cannot_store_register (regnum
);
2548 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2549 gdbarch_cannot_store_register_ftype cannot_store_register
)
2551 gdbarch
->cannot_store_register
= cannot_store_register
;
2555 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2557 gdb_assert (gdbarch
!= NULL
);
2558 return gdbarch
->get_longjmp_target
!= NULL
;
2562 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, CORE_ADDR
*pc
)
2564 gdb_assert (gdbarch
!= NULL
);
2565 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2566 if (gdbarch_debug
>= 2)
2567 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2568 return gdbarch
->get_longjmp_target (pc
);
2572 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2573 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2575 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2579 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2581 gdb_assert (gdbarch
!= NULL
);
2582 if (gdbarch_debug
>= 2)
2583 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2584 return gdbarch
->believe_pcc_promotion
;
2588 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2589 int believe_pcc_promotion
)
2591 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2595 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2597 gdb_assert (gdbarch
!= NULL
);
2598 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2599 if (gdbarch_debug
>= 2)
2600 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2601 return gdbarch
->convert_register_p (regnum
, type
);
2605 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2606 gdbarch_convert_register_p_ftype convert_register_p
)
2608 gdbarch
->convert_register_p
= convert_register_p
;
2612 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, gdb_byte
*buf
)
2614 gdb_assert (gdbarch
!= NULL
);
2615 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2616 if (gdbarch_debug
>= 2)
2617 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2618 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2622 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2623 gdbarch_register_to_value_ftype register_to_value
)
2625 gdbarch
->register_to_value
= register_to_value
;
2629 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const gdb_byte
*buf
)
2631 gdb_assert (gdbarch
!= NULL
);
2632 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2633 if (gdbarch_debug
>= 2)
2634 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2635 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2639 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2640 gdbarch_value_to_register_ftype value_to_register
)
2642 gdbarch
->value_to_register
= value_to_register
;
2646 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2648 gdb_assert (gdbarch
!= NULL
);
2649 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2650 if (gdbarch_debug
>= 2)
2651 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2652 return gdbarch
->pointer_to_address (type
, buf
);
2656 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2657 gdbarch_pointer_to_address_ftype pointer_to_address
)
2659 gdbarch
->pointer_to_address
= pointer_to_address
;
2663 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*buf
, CORE_ADDR addr
)
2665 gdb_assert (gdbarch
!= NULL
);
2666 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2667 if (gdbarch_debug
>= 2)
2668 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2669 gdbarch
->address_to_pointer (type
, buf
, addr
);
2673 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2674 gdbarch_address_to_pointer_ftype address_to_pointer
)
2676 gdbarch
->address_to_pointer
= address_to_pointer
;
2680 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2682 gdb_assert (gdbarch
!= NULL
);
2683 return gdbarch
->integer_to_address
!= NULL
;
2687 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const gdb_byte
*buf
)
2689 gdb_assert (gdbarch
!= NULL
);
2690 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2691 if (gdbarch_debug
>= 2)
2692 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2693 return gdbarch
->integer_to_address (gdbarch
, type
, buf
);
2697 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2698 gdbarch_integer_to_address_ftype integer_to_address
)
2700 gdbarch
->integer_to_address
= integer_to_address
;
2704 gdbarch_deprecated_store_struct_return_p (struct gdbarch
*gdbarch
)
2706 gdb_assert (gdbarch
!= NULL
);
2707 return gdbarch
->deprecated_store_struct_return
!= NULL
;
2711 gdbarch_deprecated_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2713 gdb_assert (gdbarch
!= NULL
);
2714 gdb_assert (gdbarch
->deprecated_store_struct_return
!= NULL
);
2715 if (gdbarch_debug
>= 2)
2716 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_store_struct_return called\n");
2717 gdbarch
->deprecated_store_struct_return (addr
, sp
);
2721 set_gdbarch_deprecated_store_struct_return (struct gdbarch
*gdbarch
,
2722 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return
)
2724 gdbarch
->deprecated_store_struct_return
= deprecated_store_struct_return
;
2728 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2730 gdb_assert (gdbarch
!= NULL
);
2731 return gdbarch
->return_value
!= legacy_return_value
;
2734 enum return_value_convention
2735 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*valtype
, struct regcache
*regcache
, gdb_byte
*readbuf
, const gdb_byte
*writebuf
)
2737 gdb_assert (gdbarch
!= NULL
);
2738 gdb_assert (gdbarch
->return_value
!= NULL
);
2739 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2740 if (gdbarch_debug
>= 2)
2741 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2742 return gdbarch
->return_value (gdbarch
, valtype
, regcache
, readbuf
, writebuf
);
2746 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2747 gdbarch_return_value_ftype return_value
)
2749 gdbarch
->return_value
= return_value
;
2753 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, gdb_byte
*valbuf
)
2755 gdb_assert (gdbarch
!= NULL
);
2756 gdb_assert (gdbarch
->extract_return_value
!= NULL
);
2757 if (gdbarch_debug
>= 2)
2758 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
2759 gdbarch
->extract_return_value (type
, regcache
, valbuf
);
2763 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
2764 gdbarch_extract_return_value_ftype extract_return_value
)
2766 gdbarch
->extract_return_value
= extract_return_value
;
2770 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, const gdb_byte
*valbuf
)
2772 gdb_assert (gdbarch
!= NULL
);
2773 gdb_assert (gdbarch
->store_return_value
!= NULL
);
2774 if (gdbarch_debug
>= 2)
2775 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2776 gdbarch
->store_return_value (type
, regcache
, valbuf
);
2780 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2781 gdbarch_store_return_value_ftype store_return_value
)
2783 gdbarch
->store_return_value
= store_return_value
;
2787 gdbarch_deprecated_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*regbuf
, gdb_byte
*valbuf
)
2789 gdb_assert (gdbarch
!= NULL
);
2790 gdb_assert (gdbarch
->deprecated_extract_return_value
!= NULL
);
2791 if (gdbarch_debug
>= 2)
2792 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_extract_return_value called\n");
2793 gdbarch
->deprecated_extract_return_value (type
, regbuf
, valbuf
);
2797 set_gdbarch_deprecated_extract_return_value (struct gdbarch
*gdbarch
,
2798 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value
)
2800 gdbarch
->deprecated_extract_return_value
= deprecated_extract_return_value
;
2804 gdbarch_deprecated_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, gdb_byte
*valbuf
)
2806 gdb_assert (gdbarch
!= NULL
);
2807 gdb_assert (gdbarch
->deprecated_store_return_value
!= NULL
);
2808 if (gdbarch_debug
>= 2)
2809 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_store_return_value called\n");
2810 gdbarch
->deprecated_store_return_value (type
, valbuf
);
2814 set_gdbarch_deprecated_store_return_value (struct gdbarch
*gdbarch
,
2815 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value
)
2817 gdbarch
->deprecated_store_return_value
= deprecated_store_return_value
;
2821 gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2823 gdb_assert (gdbarch
!= NULL
);
2824 gdb_assert (gdbarch
->deprecated_use_struct_convention
!= NULL
);
2825 if (gdbarch_debug
>= 2)
2826 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_use_struct_convention called\n");
2827 return gdbarch
->deprecated_use_struct_convention (gcc_p
, value_type
);
2831 set_gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
,
2832 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention
)
2834 gdbarch
->deprecated_use_struct_convention
= deprecated_use_struct_convention
;
2838 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch
*gdbarch
)
2840 gdb_assert (gdbarch
!= NULL
);
2841 return gdbarch
->deprecated_extract_struct_value_address
!= NULL
;
2845 gdbarch_deprecated_extract_struct_value_address (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
2847 gdb_assert (gdbarch
!= NULL
);
2848 gdb_assert (gdbarch
->deprecated_extract_struct_value_address
!= NULL
);
2849 if (gdbarch_debug
>= 2)
2850 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_extract_struct_value_address called\n");
2851 return gdbarch
->deprecated_extract_struct_value_address (regcache
);
2855 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch
*gdbarch
,
2856 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address
)
2858 gdbarch
->deprecated_extract_struct_value_address
= deprecated_extract_struct_value_address
;
2862 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2864 gdb_assert (gdbarch
!= NULL
);
2865 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2866 if (gdbarch_debug
>= 2)
2867 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2868 return gdbarch
->skip_prologue (ip
);
2872 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2873 gdbarch_skip_prologue_ftype skip_prologue
)
2875 gdbarch
->skip_prologue
= skip_prologue
;
2879 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2881 gdb_assert (gdbarch
!= NULL
);
2882 gdb_assert (gdbarch
->inner_than
!= NULL
);
2883 if (gdbarch_debug
>= 2)
2884 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2885 return gdbarch
->inner_than (lhs
, rhs
);
2889 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2890 gdbarch_inner_than_ftype inner_than
)
2892 gdbarch
->inner_than
= inner_than
;
2896 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2898 gdb_assert (gdbarch
!= NULL
);
2899 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2900 if (gdbarch_debug
>= 2)
2901 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2902 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2906 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2907 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2909 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2913 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2915 gdb_assert (gdbarch
!= NULL
);
2916 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2920 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2922 gdb_assert (gdbarch
!= NULL
);
2923 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2924 if (gdbarch_debug
>= 2)
2925 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2926 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2930 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2931 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2933 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2937 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2939 gdb_assert (gdbarch
!= NULL
);
2940 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2941 if (gdbarch_debug
>= 2)
2942 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2943 return gdbarch
->memory_insert_breakpoint (bp_tgt
);
2947 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2948 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2950 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2954 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, struct bp_target_info
*bp_tgt
)
2956 gdb_assert (gdbarch
!= NULL
);
2957 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2958 if (gdbarch_debug
>= 2)
2959 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2960 return gdbarch
->memory_remove_breakpoint (bp_tgt
);
2964 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2965 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2967 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2971 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2973 gdb_assert (gdbarch
!= NULL
);
2974 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2975 if (gdbarch_debug
>= 2)
2976 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2977 return gdbarch
->decr_pc_after_break
;
2981 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
2982 CORE_ADDR decr_pc_after_break
)
2984 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
2988 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
2990 gdb_assert (gdbarch
!= NULL
);
2991 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2992 if (gdbarch_debug
>= 2)
2993 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
2994 return gdbarch
->deprecated_function_start_offset
;
2998 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
2999 CORE_ADDR deprecated_function_start_offset
)
3001 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
3005 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
)
3007 gdb_assert (gdbarch
!= NULL
);
3008 gdb_assert (gdbarch
->remote_translate_xfer_address
!= NULL
);
3009 if (gdbarch_debug
>= 2)
3010 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
3011 gdbarch
->remote_translate_xfer_address (gdbarch
, regcache
, gdb_addr
, gdb_len
, rem_addr
, rem_len
);
3015 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
3016 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
3018 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
3022 gdbarch_fetch_tls_load_module_address_p (struct gdbarch
*gdbarch
)
3024 gdb_assert (gdbarch
!= NULL
);
3025 return gdbarch
->fetch_tls_load_module_address
!= NULL
;
3029 gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
, struct objfile
*objfile
)
3031 gdb_assert (gdbarch
!= NULL
);
3032 gdb_assert (gdbarch
->fetch_tls_load_module_address
!= NULL
);
3033 if (gdbarch_debug
>= 2)
3034 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_tls_load_module_address called\n");
3035 return gdbarch
->fetch_tls_load_module_address (objfile
);
3039 set_gdbarch_fetch_tls_load_module_address (struct gdbarch
*gdbarch
,
3040 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address
)
3042 gdbarch
->fetch_tls_load_module_address
= fetch_tls_load_module_address
;
3046 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
3048 gdb_assert (gdbarch
!= NULL
);
3049 /* Skip verify of frame_args_skip, invalid_p == 0 */
3050 if (gdbarch_debug
>= 2)
3051 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
3052 return gdbarch
->frame_args_skip
;
3056 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
3057 CORE_ADDR frame_args_skip
)
3059 gdbarch
->frame_args_skip
= frame_args_skip
;
3063 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
3065 gdb_assert (gdbarch
!= NULL
);
3066 return gdbarch
->unwind_pc
!= NULL
;
3070 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
3072 gdb_assert (gdbarch
!= NULL
);
3073 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
3074 if (gdbarch_debug
>= 2)
3075 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
3076 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
3080 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
3081 gdbarch_unwind_pc_ftype unwind_pc
)
3083 gdbarch
->unwind_pc
= unwind_pc
;
3087 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
3089 gdb_assert (gdbarch
!= NULL
);
3090 return gdbarch
->unwind_sp
!= NULL
;
3094 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
3096 gdb_assert (gdbarch
!= NULL
);
3097 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
3098 if (gdbarch_debug
>= 2)
3099 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
3100 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
3104 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
3105 gdbarch_unwind_sp_ftype unwind_sp
)
3107 gdbarch
->unwind_sp
= unwind_sp
;
3111 gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch
*gdbarch
)
3113 gdb_assert (gdbarch
!= NULL
);
3114 return gdbarch
->deprecated_saved_pc_after_call
!= NULL
;
3118 gdbarch_deprecated_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3120 gdb_assert (gdbarch
!= NULL
);
3121 gdb_assert (gdbarch
->deprecated_saved_pc_after_call
!= NULL
);
3122 if (gdbarch_debug
>= 2)
3123 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_saved_pc_after_call called\n");
3124 return gdbarch
->deprecated_saved_pc_after_call (frame
);
3128 set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch
*gdbarch
,
3129 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call
)
3131 gdbarch
->deprecated_saved_pc_after_call
= deprecated_saved_pc_after_call
;
3135 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
3137 gdb_assert (gdbarch
!= NULL
);
3138 return gdbarch
->frame_num_args
!= NULL
;
3142 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3144 gdb_assert (gdbarch
!= NULL
);
3145 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
3146 if (gdbarch_debug
>= 2)
3147 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
3148 return gdbarch
->frame_num_args (frame
);
3152 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
3153 gdbarch_frame_num_args_ftype frame_num_args
)
3155 gdbarch
->frame_num_args
= frame_num_args
;
3159 gdbarch_deprecated_stack_align_p (struct gdbarch
*gdbarch
)
3161 gdb_assert (gdbarch
!= NULL
);
3162 return gdbarch
->deprecated_stack_align
!= NULL
;
3166 gdbarch_deprecated_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
3168 gdb_assert (gdbarch
!= NULL
);
3169 gdb_assert (gdbarch
->deprecated_stack_align
!= NULL
);
3170 if (gdbarch_debug
>= 2)
3171 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_stack_align called\n");
3172 return gdbarch
->deprecated_stack_align (sp
);
3176 set_gdbarch_deprecated_stack_align (struct gdbarch
*gdbarch
,
3177 gdbarch_deprecated_stack_align_ftype deprecated_stack_align
)
3179 gdbarch
->deprecated_stack_align
= deprecated_stack_align
;
3183 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
3185 gdb_assert (gdbarch
!= NULL
);
3186 return gdbarch
->frame_align
!= NULL
;
3190 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
3192 gdb_assert (gdbarch
!= NULL
);
3193 gdb_assert (gdbarch
->frame_align
!= NULL
);
3194 if (gdbarch_debug
>= 2)
3195 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
3196 return gdbarch
->frame_align (gdbarch
, address
);
3200 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
3201 gdbarch_frame_align_ftype frame_align
)
3203 gdbarch
->frame_align
= frame_align
;
3207 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
3209 gdb_assert (gdbarch
!= NULL
);
3210 return gdbarch
->deprecated_reg_struct_has_addr
!= NULL
;
3214 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
3216 gdb_assert (gdbarch
!= NULL
);
3217 gdb_assert (gdbarch
->deprecated_reg_struct_has_addr
!= NULL
);
3218 if (gdbarch_debug
>= 2)
3219 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_reg_struct_has_addr called\n");
3220 return gdbarch
->deprecated_reg_struct_has_addr (gcc_p
, type
);
3224 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
,
3225 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr
)
3227 gdbarch
->deprecated_reg_struct_has_addr
= deprecated_reg_struct_has_addr
;
3231 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
3233 gdb_assert (gdbarch
!= NULL
);
3234 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
3235 if (gdbarch_debug
>= 2)
3236 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
3237 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
3241 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
3242 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
3244 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
3248 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
3250 gdb_assert (gdbarch
!= NULL
);
3251 if (gdbarch_debug
>= 2)
3252 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
3253 return gdbarch
->frame_red_zone_size
;
3257 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
3258 int frame_red_zone_size
)
3260 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
3264 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
3266 gdb_assert (gdbarch
!= NULL
);
3267 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
3268 if (gdbarch_debug
>= 2)
3269 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
3270 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
3274 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
3275 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
3277 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
3281 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3283 gdb_assert (gdbarch
!= NULL
);
3284 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
3285 if (gdbarch_debug
>= 2)
3286 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
3287 return gdbarch
->addr_bits_remove (addr
);
3291 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
3292 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
3294 gdbarch
->addr_bits_remove
= addr_bits_remove
;
3298 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3300 gdb_assert (gdbarch
!= NULL
);
3301 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
3302 if (gdbarch_debug
>= 2)
3303 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
3304 return gdbarch
->smash_text_address (addr
);
3308 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
3309 gdbarch_smash_text_address_ftype smash_text_address
)
3311 gdbarch
->smash_text_address
= smash_text_address
;
3315 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
3317 gdb_assert (gdbarch
!= NULL
);
3318 return gdbarch
->software_single_step
!= NULL
;
3322 gdbarch_software_single_step (struct gdbarch
*gdbarch
, enum target_signal sig
, int insert_breakpoints_p
)
3324 gdb_assert (gdbarch
!= NULL
);
3325 gdb_assert (gdbarch
->software_single_step
!= NULL
);
3326 if (gdbarch_debug
>= 2)
3327 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
3328 gdbarch
->software_single_step (sig
, insert_breakpoints_p
);
3332 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
3333 gdbarch_software_single_step_ftype software_single_step
)
3335 gdbarch
->software_single_step
= software_single_step
;
3339 gdbarch_single_step_through_delay_p (struct gdbarch
*gdbarch
)
3341 gdb_assert (gdbarch
!= NULL
);
3342 return gdbarch
->single_step_through_delay
!= NULL
;
3346 gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3348 gdb_assert (gdbarch
!= NULL
);
3349 gdb_assert (gdbarch
->single_step_through_delay
!= NULL
);
3350 if (gdbarch_debug
>= 2)
3351 fprintf_unfiltered (gdb_stdlog
, "gdbarch_single_step_through_delay called\n");
3352 return gdbarch
->single_step_through_delay (gdbarch
, frame
);
3356 set_gdbarch_single_step_through_delay (struct gdbarch
*gdbarch
,
3357 gdbarch_single_step_through_delay_ftype single_step_through_delay
)
3359 gdbarch
->single_step_through_delay
= single_step_through_delay
;
3363 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
3365 gdb_assert (gdbarch
!= NULL
);
3366 gdb_assert (gdbarch
->print_insn
!= NULL
);
3367 if (gdbarch_debug
>= 2)
3368 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
3369 return gdbarch
->print_insn (vma
, info
);
3373 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
3374 gdbarch_print_insn_ftype print_insn
)
3376 gdbarch
->print_insn
= print_insn
;
3380 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3382 gdb_assert (gdbarch
!= NULL
);
3383 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
3384 if (gdbarch_debug
>= 2)
3385 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
3386 return gdbarch
->skip_trampoline_code (pc
);
3390 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
3391 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
3393 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
3397 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3399 gdb_assert (gdbarch
!= NULL
);
3400 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
3401 if (gdbarch_debug
>= 2)
3402 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
3403 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
3407 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
3408 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
3410 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
3414 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
3416 gdb_assert (gdbarch
!= NULL
);
3417 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
3418 if (gdbarch_debug
>= 2)
3419 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
3420 return gdbarch
->in_solib_return_trampoline (pc
, name
);
3424 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
3425 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
3427 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
3431 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3433 gdb_assert (gdbarch
!= NULL
);
3434 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
3435 if (gdbarch_debug
>= 2)
3436 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
3437 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
3441 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
3442 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
3444 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
3448 gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, int argc
, char **argv
)
3450 gdb_assert (gdbarch
!= NULL
);
3451 gdb_assert (gdbarch
->construct_inferior_arguments
!= NULL
);
3452 if (gdbarch_debug
>= 2)
3453 fprintf_unfiltered (gdb_stdlog
, "gdbarch_construct_inferior_arguments called\n");
3454 return gdbarch
->construct_inferior_arguments (gdbarch
, argc
, argv
);
3458 set_gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
,
3459 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments
)
3461 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
3465 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
3467 gdb_assert (gdbarch
!= NULL
);
3468 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
3469 if (gdbarch_debug
>= 2)
3470 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
3471 gdbarch
->elf_make_msymbol_special (sym
, msym
);
3475 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
3476 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
3478 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
3482 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
3484 gdb_assert (gdbarch
!= NULL
);
3485 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
3486 if (gdbarch_debug
>= 2)
3487 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
3488 gdbarch
->coff_make_msymbol_special (val
, msym
);
3492 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
3493 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
3495 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
3499 gdbarch_name_of_malloc (struct gdbarch
*gdbarch
)
3501 gdb_assert (gdbarch
!= NULL
);
3502 /* Skip verify of name_of_malloc, invalid_p == 0 */
3503 if (gdbarch_debug
>= 2)
3504 fprintf_unfiltered (gdb_stdlog
, "gdbarch_name_of_malloc called\n");
3505 return gdbarch
->name_of_malloc
;
3509 set_gdbarch_name_of_malloc (struct gdbarch
*gdbarch
,
3510 const char * name_of_malloc
)
3512 gdbarch
->name_of_malloc
= name_of_malloc
;
3516 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
3518 gdb_assert (gdbarch
!= NULL
);
3519 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3520 if (gdbarch_debug
>= 2)
3521 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
3522 return gdbarch
->cannot_step_breakpoint
;
3526 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
3527 int cannot_step_breakpoint
)
3529 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
3533 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
3535 gdb_assert (gdbarch
!= NULL
);
3536 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3537 if (gdbarch_debug
>= 2)
3538 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
3539 return gdbarch
->have_nonsteppable_watchpoint
;
3543 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
3544 int have_nonsteppable_watchpoint
)
3546 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
3550 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
3552 gdb_assert (gdbarch
!= NULL
);
3553 return gdbarch
->address_class_type_flags
!= NULL
;
3557 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
3559 gdb_assert (gdbarch
!= NULL
);
3560 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
3561 if (gdbarch_debug
>= 2)
3562 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
3563 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
3567 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
3568 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
3570 gdbarch
->address_class_type_flags
= address_class_type_flags
;
3574 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
3576 gdb_assert (gdbarch
!= NULL
);
3577 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
3581 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
3583 gdb_assert (gdbarch
!= NULL
);
3584 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
3585 if (gdbarch_debug
>= 2)
3586 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
3587 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
3591 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
3592 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3594 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3598 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3600 gdb_assert (gdbarch
!= NULL
);
3601 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3605 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3607 gdb_assert (gdbarch
!= NULL
);
3608 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3609 if (gdbarch_debug
>= 2)
3610 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3611 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3615 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3616 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3618 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3622 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3624 gdb_assert (gdbarch
!= NULL
);
3625 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3626 if (gdbarch_debug
>= 2)
3627 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3628 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3632 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3633 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3635 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3639 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3641 gdb_assert (gdbarch
!= NULL
);
3642 return gdbarch
->fetch_pointer_argument
!= NULL
;
3646 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3648 gdb_assert (gdbarch
!= NULL
);
3649 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3650 if (gdbarch_debug
>= 2)
3651 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3652 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3656 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3657 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3659 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3663 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3665 gdb_assert (gdbarch
!= NULL
);
3666 return gdbarch
->regset_from_core_section
!= NULL
;
3669 const struct regset
*
3670 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3672 gdb_assert (gdbarch
!= NULL
);
3673 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3674 if (gdbarch_debug
>= 2)
3675 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3676 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3680 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3681 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3683 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3687 /* Keep a registry of per-architecture data-pointers required by GDB
3694 gdbarch_data_pre_init_ftype
*pre_init
;
3695 gdbarch_data_post_init_ftype
*post_init
;
3698 struct gdbarch_data_registration
3700 struct gdbarch_data
*data
;
3701 struct gdbarch_data_registration
*next
;
3704 struct gdbarch_data_registry
3707 struct gdbarch_data_registration
*registrations
;
3710 struct gdbarch_data_registry gdbarch_data_registry
=
3715 static struct gdbarch_data
*
3716 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3717 gdbarch_data_post_init_ftype
*post_init
)
3719 struct gdbarch_data_registration
**curr
;
3720 /* Append the new registraration. */
3721 for (curr
= &gdbarch_data_registry
.registrations
;
3723 curr
= &(*curr
)->next
);
3724 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3725 (*curr
)->next
= NULL
;
3726 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3727 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3728 (*curr
)->data
->pre_init
= pre_init
;
3729 (*curr
)->data
->post_init
= post_init
;
3730 (*curr
)->data
->init_p
= 1;
3731 return (*curr
)->data
;
3734 struct gdbarch_data
*
3735 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3737 return gdbarch_data_register (pre_init
, NULL
);
3740 struct gdbarch_data
*
3741 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3743 return gdbarch_data_register (NULL
, post_init
);
3746 /* Create/delete the gdbarch data vector. */
3749 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3751 gdb_assert (gdbarch
->data
== NULL
);
3752 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3753 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3756 /* Initialize the current value of the specified per-architecture
3760 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3761 struct gdbarch_data
*data
,
3764 gdb_assert (data
->index
< gdbarch
->nr_data
);
3765 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3766 gdb_assert (data
->pre_init
== NULL
);
3767 gdbarch
->data
[data
->index
] = pointer
;
3770 /* Return the current value of the specified per-architecture
3774 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3776 gdb_assert (data
->index
< gdbarch
->nr_data
);
3777 if (gdbarch
->data
[data
->index
] == NULL
)
3779 /* The data-pointer isn't initialized, call init() to get a
3781 if (data
->pre_init
!= NULL
)
3782 /* Mid architecture creation: pass just the obstack, and not
3783 the entire architecture, as that way it isn't possible for
3784 pre-init code to refer to undefined architecture
3786 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3787 else if (gdbarch
->initialized_p
3788 && data
->post_init
!= NULL
)
3789 /* Post architecture creation: pass the entire architecture
3790 (as all fields are valid), but be careful to also detect
3791 recursive references. */
3793 gdb_assert (data
->init_p
);
3795 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3799 /* The architecture initialization hasn't completed - punt -
3800 hope that the caller knows what they are doing. Once
3801 deprecated_set_gdbarch_data has been initialized, this can be
3802 changed to an internal error. */
3804 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3806 return gdbarch
->data
[data
->index
];
3811 /* Keep a registry of swapped data required by GDB modules. */
3816 struct gdbarch_swap_registration
*source
;
3817 struct gdbarch_swap
*next
;
3820 struct gdbarch_swap_registration
3823 unsigned long sizeof_data
;
3824 gdbarch_swap_ftype
*init
;
3825 struct gdbarch_swap_registration
*next
;
3828 struct gdbarch_swap_registry
3831 struct gdbarch_swap_registration
*registrations
;
3834 struct gdbarch_swap_registry gdbarch_swap_registry
=
3840 deprecated_register_gdbarch_swap (void *data
,
3841 unsigned long sizeof_data
,
3842 gdbarch_swap_ftype
*init
)
3844 struct gdbarch_swap_registration
**rego
;
3845 for (rego
= &gdbarch_swap_registry
.registrations
;
3847 rego
= &(*rego
)->next
);
3848 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
3849 (*rego
)->next
= NULL
;
3850 (*rego
)->init
= init
;
3851 (*rego
)->data
= data
;
3852 (*rego
)->sizeof_data
= sizeof_data
;
3856 current_gdbarch_swap_init_hack (void)
3858 struct gdbarch_swap_registration
*rego
;
3859 struct gdbarch_swap
**curr
= ¤t_gdbarch
->swap
;
3860 for (rego
= gdbarch_swap_registry
.registrations
;
3864 if (rego
->data
!= NULL
)
3866 (*curr
) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch
,
3867 struct gdbarch_swap
);
3868 (*curr
)->source
= rego
;
3869 (*curr
)->swap
= gdbarch_obstack_zalloc (current_gdbarch
,
3871 (*curr
)->next
= NULL
;
3872 curr
= &(*curr
)->next
;
3874 if (rego
->init
!= NULL
)
3879 static struct gdbarch
*
3880 current_gdbarch_swap_out_hack (void)
3882 struct gdbarch
*old_gdbarch
= current_gdbarch
;
3883 struct gdbarch_swap
*curr
;
3885 gdb_assert (old_gdbarch
!= NULL
);
3886 for (curr
= old_gdbarch
->swap
;
3890 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
3891 memset (curr
->source
->data
, 0, curr
->source
->sizeof_data
);
3893 current_gdbarch
= NULL
;
3898 current_gdbarch_swap_in_hack (struct gdbarch
*new_gdbarch
)
3900 struct gdbarch_swap
*curr
;
3902 gdb_assert (current_gdbarch
== NULL
);
3903 for (curr
= new_gdbarch
->swap
;
3906 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
3907 current_gdbarch
= new_gdbarch
;
3911 /* Keep a registry of the architectures known by GDB. */
3913 struct gdbarch_registration
3915 enum bfd_architecture bfd_architecture
;
3916 gdbarch_init_ftype
*init
;
3917 gdbarch_dump_tdep_ftype
*dump_tdep
;
3918 struct gdbarch_list
*arches
;
3919 struct gdbarch_registration
*next
;
3922 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3925 append_name (const char ***buf
, int *nr
, const char *name
)
3927 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3933 gdbarch_printable_names (void)
3935 /* Accumulate a list of names based on the registed list of
3937 enum bfd_architecture a
;
3939 const char **arches
= NULL
;
3940 struct gdbarch_registration
*rego
;
3941 for (rego
= gdbarch_registry
;
3945 const struct bfd_arch_info
*ap
;
3946 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3948 internal_error (__FILE__
, __LINE__
,
3949 _("gdbarch_architecture_names: multi-arch unknown"));
3952 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3957 append_name (&arches
, &nr_arches
, NULL
);
3963 gdbarch_register (enum bfd_architecture bfd_architecture
,
3964 gdbarch_init_ftype
*init
,
3965 gdbarch_dump_tdep_ftype
*dump_tdep
)
3967 struct gdbarch_registration
**curr
;
3968 const struct bfd_arch_info
*bfd_arch_info
;
3969 /* Check that BFD recognizes this architecture */
3970 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3971 if (bfd_arch_info
== NULL
)
3973 internal_error (__FILE__
, __LINE__
,
3974 _("gdbarch: Attempt to register unknown architecture (%d)"),
3977 /* Check that we haven't seen this architecture before */
3978 for (curr
= &gdbarch_registry
;
3980 curr
= &(*curr
)->next
)
3982 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3983 internal_error (__FILE__
, __LINE__
,
3984 _("gdbarch: Duplicate registraration of architecture (%s)"),
3985 bfd_arch_info
->printable_name
);
3989 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3990 bfd_arch_info
->printable_name
,
3993 (*curr
) = XMALLOC (struct gdbarch_registration
);
3994 (*curr
)->bfd_architecture
= bfd_architecture
;
3995 (*curr
)->init
= init
;
3996 (*curr
)->dump_tdep
= dump_tdep
;
3997 (*curr
)->arches
= NULL
;
3998 (*curr
)->next
= NULL
;
4002 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
4003 gdbarch_init_ftype
*init
)
4005 gdbarch_register (bfd_architecture
, init
, NULL
);
4009 /* Look for an architecture using gdbarch_info. Base search on only
4010 BFD_ARCH_INFO and BYTE_ORDER. */
4012 struct gdbarch_list
*
4013 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
4014 const struct gdbarch_info
*info
)
4016 for (; arches
!= NULL
; arches
= arches
->next
)
4018 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
4020 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4022 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4030 /* Find an architecture that matches the specified INFO. Create a new
4031 architecture if needed. Return that new architecture. Assumes
4032 that there is no current architecture. */
4034 static struct gdbarch
*
4035 find_arch_by_info (struct gdbarch
*old_gdbarch
, struct gdbarch_info info
)
4037 struct gdbarch
*new_gdbarch
;
4038 struct gdbarch_registration
*rego
;
4040 /* The existing architecture has been swapped out - all this code
4041 works from a clean slate. */
4042 gdb_assert (current_gdbarch
== NULL
);
4044 /* Fill in missing parts of the INFO struct using a number of
4045 sources: "set ..."; INFOabfd supplied; and the existing
4047 gdbarch_info_fill (old_gdbarch
, &info
);
4049 /* Must have found some sort of architecture. */
4050 gdb_assert (info
.bfd_arch_info
!= NULL
);
4054 fprintf_unfiltered (gdb_stdlog
,
4055 "find_arch_by_info: info.bfd_arch_info %s\n",
4056 (info
.bfd_arch_info
!= NULL
4057 ? info
.bfd_arch_info
->printable_name
4059 fprintf_unfiltered (gdb_stdlog
,
4060 "find_arch_by_info: info.byte_order %d (%s)\n",
4062 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4063 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4065 fprintf_unfiltered (gdb_stdlog
,
4066 "find_arch_by_info: info.osabi %d (%s)\n",
4067 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4068 fprintf_unfiltered (gdb_stdlog
,
4069 "find_arch_by_info: info.abfd 0x%lx\n",
4071 fprintf_unfiltered (gdb_stdlog
,
4072 "find_arch_by_info: info.tdep_info 0x%lx\n",
4073 (long) info
.tdep_info
);
4076 /* Find the tdep code that knows about this architecture. */
4077 for (rego
= gdbarch_registry
;
4080 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4085 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4086 "No matching architecture\n");
4090 /* Ask the tdep code for an architecture that matches "info". */
4091 new_gdbarch
= rego
->init (info
, rego
->arches
);
4093 /* Did the tdep code like it? No. Reject the change and revert to
4094 the old architecture. */
4095 if (new_gdbarch
== NULL
)
4098 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4099 "Target rejected architecture\n");
4103 /* Is this a pre-existing architecture (as determined by already
4104 being initialized)? Move it to the front of the architecture
4105 list (keeping the list sorted Most Recently Used). */
4106 if (new_gdbarch
->initialized_p
)
4108 struct gdbarch_list
**list
;
4109 struct gdbarch_list
*this;
4111 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4112 "Previous architecture 0x%08lx (%s) selected\n",
4114 new_gdbarch
->bfd_arch_info
->printable_name
);
4115 /* Find the existing arch in the list. */
4116 for (list
= ®o
->arches
;
4117 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4118 list
= &(*list
)->next
);
4119 /* It had better be in the list of architectures. */
4120 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4123 (*list
) = this->next
;
4124 /* Insert THIS at the front. */
4125 this->next
= rego
->arches
;
4126 rego
->arches
= this;
4131 /* It's a new architecture. */
4133 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4134 "New architecture 0x%08lx (%s) selected\n",
4136 new_gdbarch
->bfd_arch_info
->printable_name
);
4138 /* Insert the new architecture into the front of the architecture
4139 list (keep the list sorted Most Recently Used). */
4141 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4142 this->next
= rego
->arches
;
4143 this->gdbarch
= new_gdbarch
;
4144 rego
->arches
= this;
4147 /* Check that the newly installed architecture is valid. Plug in
4148 any post init values. */
4149 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4150 verify_gdbarch (new_gdbarch
);
4151 new_gdbarch
->initialized_p
= 1;
4153 /* Initialize any per-architecture swap areas. This phase requires
4154 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4155 swap the entire architecture out. */
4156 current_gdbarch
= new_gdbarch
;
4157 current_gdbarch_swap_init_hack ();
4158 current_gdbarch_swap_out_hack ();
4161 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4167 gdbarch_find_by_info (struct gdbarch_info info
)
4169 /* Save the previously selected architecture, setting the global to
4170 NULL. This stops things like gdbarch->init() trying to use the
4171 previous architecture's configuration. The previous architecture
4172 may not even be of the same architecture family. The most recent
4173 architecture of the same family is found at the head of the
4174 rego->arches list. */
4175 struct gdbarch
*old_gdbarch
= current_gdbarch_swap_out_hack ();
4177 /* Find the specified architecture. */
4178 struct gdbarch
*new_gdbarch
= find_arch_by_info (old_gdbarch
, info
);
4180 /* Restore the existing architecture. */
4181 gdb_assert (current_gdbarch
== NULL
);
4182 current_gdbarch_swap_in_hack (old_gdbarch
);
4187 /* Make the specified architecture current, swapping the existing one
4191 deprecated_current_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4193 gdb_assert (new_gdbarch
!= NULL
);
4194 gdb_assert (current_gdbarch
!= NULL
);
4195 gdb_assert (new_gdbarch
->initialized_p
);
4196 current_gdbarch_swap_out_hack ();
4197 current_gdbarch_swap_in_hack (new_gdbarch
);
4198 architecture_changed_event ();
4199 flush_cached_frames ();
4202 extern void _initialize_gdbarch (void);
4205 _initialize_gdbarch (void)
4207 struct cmd_list_element
*c
;
4209 add_setshow_zinteger_cmd ("arch", class_maintenance
, &gdbarch_debug
, _("\
4210 Set architecture debugging."), _("\
4211 Show architecture debugging."), _("\
4212 When non-zero, architecture debugging is enabled."),
4215 &setdebuglist
, &showdebuglist
);