1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
3 /* Dynamic architecture support for GDB, the GNU debugger.
5 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
6 Software Foundation, Inc.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 /* This file was created with the aid of ``gdbarch.sh''.
27 The Bourne shell script ``gdbarch.sh'' creates the files
28 ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
29 against the existing ``gdbarch.[hc]''. Any differences found
32 If editing this file, please also run gdbarch.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdbarch.sh and using its output may prove
39 #include "arch-utils.h"
42 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
45 #include "floatformat.h"
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
52 #include "gdb_obstack.h"
54 /* Static function declarations */
56 static void alloc_gdbarch_data (struct gdbarch
*);
58 /* Non-zero if we want to trace architecture code. */
61 #define GDBARCH_DEBUG 0
63 int gdbarch_debug
= GDBARCH_DEBUG
;
66 pformat (const struct floatformat
*format
)
75 /* Maintain the struct gdbarch object */
79 /* Has this architecture been fully initialized? */
82 /* An obstack bound to the lifetime of the architecture. */
83 struct obstack
*obstack
;
85 /* basic architectural information */
86 const struct bfd_arch_info
* bfd_arch_info
;
90 /* target specific vector. */
91 struct gdbarch_tdep
*tdep
;
92 gdbarch_dump_tdep_ftype
*dump_tdep
;
94 /* per-architecture data-pointers */
98 /* per-architecture swap-regions */
99 struct gdbarch_swap
*swap
;
101 /* Multi-arch values.
103 When extending this structure you must:
107 Declare set/get functions and define the corresponding
110 gdbarch_alloc(): If zero/NULL is not a suitable default,
111 initialize the new field.
113 verify_gdbarch(): Confirm that the target updated the field
116 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
119 ``startup_gdbarch()'': Append an initial value to the static
120 variable (base values on the host's c-type system).
122 get_gdbarch(): Implement the set/get functions (probably using
123 the macro's as shortcuts).
132 const struct floatformat
* float_format
;
134 const struct floatformat
* double_format
;
136 const struct floatformat
* long_double_format
;
141 gdbarch_read_pc_ftype
*read_pc
;
142 gdbarch_write_pc_ftype
*write_pc
;
143 gdbarch_read_sp_ftype
*read_sp
;
144 gdbarch_virtual_frame_pointer_ftype
*virtual_frame_pointer
;
145 gdbarch_pseudo_register_read_ftype
*pseudo_register_read
;
146 gdbarch_pseudo_register_write_ftype
*pseudo_register_write
;
153 gdbarch_stab_reg_to_regnum_ftype
*stab_reg_to_regnum
;
154 gdbarch_ecoff_reg_to_regnum_ftype
*ecoff_reg_to_regnum
;
155 gdbarch_dwarf_reg_to_regnum_ftype
*dwarf_reg_to_regnum
;
156 gdbarch_sdb_reg_to_regnum_ftype
*sdb_reg_to_regnum
;
157 gdbarch_dwarf2_reg_to_regnum_ftype
*dwarf2_reg_to_regnum
;
158 gdbarch_register_name_ftype
*register_name
;
159 gdbarch_register_type_ftype
*register_type
;
160 gdbarch_deprecated_register_byte_ftype
*deprecated_register_byte
;
161 gdbarch_unwind_dummy_id_ftype
*unwind_dummy_id
;
162 int deprecated_fp_regnum
;
163 gdbarch_push_dummy_call_ftype
*push_dummy_call
;
164 gdbarch_deprecated_push_arguments_ftype
*deprecated_push_arguments
;
165 int deprecated_register_size
;
166 int call_dummy_location
;
167 gdbarch_push_dummy_code_ftype
*push_dummy_code
;
168 gdbarch_print_registers_info_ftype
*print_registers_info
;
169 gdbarch_print_float_info_ftype
*print_float_info
;
170 gdbarch_print_vector_info_ftype
*print_vector_info
;
171 gdbarch_register_sim_regno_ftype
*register_sim_regno
;
172 gdbarch_register_bytes_ok_ftype
*register_bytes_ok
;
173 gdbarch_cannot_fetch_register_ftype
*cannot_fetch_register
;
174 gdbarch_cannot_store_register_ftype
*cannot_store_register
;
175 gdbarch_get_longjmp_target_ftype
*get_longjmp_target
;
176 int believe_pcc_promotion
;
177 gdbarch_convert_register_p_ftype
*convert_register_p
;
178 gdbarch_register_to_value_ftype
*register_to_value
;
179 gdbarch_value_to_register_ftype
*value_to_register
;
180 gdbarch_pointer_to_address_ftype
*pointer_to_address
;
181 gdbarch_address_to_pointer_ftype
*address_to_pointer
;
182 gdbarch_integer_to_address_ftype
*integer_to_address
;
183 gdbarch_deprecated_store_struct_return_ftype
*deprecated_store_struct_return
;
184 gdbarch_return_value_ftype
*return_value
;
185 gdbarch_extract_return_value_ftype
*extract_return_value
;
186 gdbarch_store_return_value_ftype
*store_return_value
;
187 gdbarch_deprecated_extract_return_value_ftype
*deprecated_extract_return_value
;
188 gdbarch_deprecated_store_return_value_ftype
*deprecated_store_return_value
;
189 gdbarch_deprecated_use_struct_convention_ftype
*deprecated_use_struct_convention
;
190 gdbarch_deprecated_extract_struct_value_address_ftype
*deprecated_extract_struct_value_address
;
191 gdbarch_skip_prologue_ftype
*skip_prologue
;
192 gdbarch_inner_than_ftype
*inner_than
;
193 gdbarch_breakpoint_from_pc_ftype
*breakpoint_from_pc
;
194 gdbarch_adjust_breakpoint_address_ftype
*adjust_breakpoint_address
;
195 gdbarch_memory_insert_breakpoint_ftype
*memory_insert_breakpoint
;
196 gdbarch_memory_remove_breakpoint_ftype
*memory_remove_breakpoint
;
197 CORE_ADDR decr_pc_after_break
;
198 CORE_ADDR deprecated_function_start_offset
;
199 gdbarch_remote_translate_xfer_address_ftype
*remote_translate_xfer_address
;
200 CORE_ADDR frame_args_skip
;
201 gdbarch_unwind_pc_ftype
*unwind_pc
;
202 gdbarch_unwind_sp_ftype
*unwind_sp
;
203 gdbarch_deprecated_saved_pc_after_call_ftype
*deprecated_saved_pc_after_call
;
204 gdbarch_frame_num_args_ftype
*frame_num_args
;
205 gdbarch_deprecated_stack_align_ftype
*deprecated_stack_align
;
206 gdbarch_frame_align_ftype
*frame_align
;
207 gdbarch_deprecated_reg_struct_has_addr_ftype
*deprecated_reg_struct_has_addr
;
208 gdbarch_stabs_argument_has_addr_ftype
*stabs_argument_has_addr
;
209 int frame_red_zone_size
;
210 gdbarch_convert_from_func_ptr_addr_ftype
*convert_from_func_ptr_addr
;
211 gdbarch_addr_bits_remove_ftype
*addr_bits_remove
;
212 gdbarch_smash_text_address_ftype
*smash_text_address
;
213 gdbarch_software_single_step_ftype
*software_single_step
;
214 gdbarch_print_insn_ftype
*print_insn
;
215 gdbarch_skip_trampoline_code_ftype
*skip_trampoline_code
;
216 gdbarch_skip_solib_resolver_ftype
*skip_solib_resolver
;
217 gdbarch_in_solib_call_trampoline_ftype
*in_solib_call_trampoline
;
218 gdbarch_in_solib_return_trampoline_ftype
*in_solib_return_trampoline
;
219 gdbarch_in_function_epilogue_p_ftype
*in_function_epilogue_p
;
220 gdbarch_construct_inferior_arguments_ftype
*construct_inferior_arguments
;
221 gdbarch_elf_make_msymbol_special_ftype
*elf_make_msymbol_special
;
222 gdbarch_coff_make_msymbol_special_ftype
*coff_make_msymbol_special
;
223 const char * name_of_malloc
;
224 int cannot_step_breakpoint
;
225 int have_nonsteppable_watchpoint
;
226 gdbarch_address_class_type_flags_ftype
*address_class_type_flags
;
227 gdbarch_address_class_type_flags_to_name_ftype
*address_class_type_flags_to_name
;
228 gdbarch_address_class_name_to_type_flags_ftype
*address_class_name_to_type_flags
;
229 gdbarch_register_reggroup_p_ftype
*register_reggroup_p
;
230 gdbarch_fetch_pointer_argument_ftype
*fetch_pointer_argument
;
231 gdbarch_regset_from_core_section_ftype
*regset_from_core_section
;
235 /* The default architecture uses host values (for want of a better
238 extern const struct bfd_arch_info bfd_default_arch_struct
;
240 struct gdbarch startup_gdbarch
=
242 1, /* Always initialized. */
243 NULL
, /* The obstack. */
244 /* basic architecture information */
245 &bfd_default_arch_struct
, /* bfd_arch_info */
246 BFD_ENDIAN_BIG
, /* byte_order */
247 GDB_OSABI_UNKNOWN
, /* osabi */
248 /* target specific vector and its dump routine */
250 /*per-architecture data-pointers and swap regions */
252 /* Multi-arch values */
253 8 * sizeof (short), /* short_bit */
254 8 * sizeof (int), /* int_bit */
255 8 * sizeof (long), /* long_bit */
256 8 * sizeof (LONGEST
), /* long_long_bit */
257 8 * sizeof (float), /* float_bit */
258 0, /* float_format */
259 8 * sizeof (double), /* double_bit */
260 0, /* double_format */
261 8 * sizeof (long double), /* long_double_bit */
262 0, /* long_double_format */
263 8 * sizeof (void*), /* ptr_bit */
264 8 * sizeof (void*), /* addr_bit */
265 8 * sizeof (void*), /* bfd_vma_bit */
270 0, /* virtual_frame_pointer */
271 0, /* pseudo_register_read */
272 0, /* pseudo_register_write */
274 0, /* num_pseudo_regs */
279 0, /* stab_reg_to_regnum */
280 0, /* ecoff_reg_to_regnum */
281 0, /* dwarf_reg_to_regnum */
282 0, /* sdb_reg_to_regnum */
283 0, /* dwarf2_reg_to_regnum */
284 0, /* register_name */
285 0, /* register_type */
286 generic_register_byte
, /* deprecated_register_byte */
287 0, /* unwind_dummy_id */
288 -1, /* deprecated_fp_regnum */
289 0, /* push_dummy_call */
290 0, /* deprecated_push_arguments */
291 0, /* deprecated_register_size */
292 0, /* call_dummy_location */
293 0, /* push_dummy_code */
294 default_print_registers_info
, /* print_registers_info */
295 0, /* print_float_info */
296 0, /* print_vector_info */
297 0, /* register_sim_regno */
298 0, /* register_bytes_ok */
299 0, /* cannot_fetch_register */
300 0, /* cannot_store_register */
301 0, /* get_longjmp_target */
302 0, /* believe_pcc_promotion */
303 0, /* convert_register_p */
304 0, /* register_to_value */
305 0, /* value_to_register */
306 0, /* pointer_to_address */
307 0, /* address_to_pointer */
308 0, /* integer_to_address */
309 0, /* deprecated_store_struct_return */
310 0, /* return_value */
311 0, /* extract_return_value */
312 0, /* store_return_value */
313 0, /* deprecated_extract_return_value */
314 0, /* deprecated_store_return_value */
315 0, /* deprecated_use_struct_convention */
316 0, /* deprecated_extract_struct_value_address */
317 0, /* skip_prologue */
319 0, /* breakpoint_from_pc */
320 0, /* adjust_breakpoint_address */
321 0, /* memory_insert_breakpoint */
322 0, /* memory_remove_breakpoint */
323 0, /* decr_pc_after_break */
324 0, /* deprecated_function_start_offset */
325 generic_remote_translate_xfer_address
, /* remote_translate_xfer_address */
326 0, /* frame_args_skip */
329 0, /* deprecated_saved_pc_after_call */
330 0, /* frame_num_args */
331 0, /* deprecated_stack_align */
333 0, /* deprecated_reg_struct_has_addr */
334 default_stabs_argument_has_addr
, /* stabs_argument_has_addr */
335 0, /* frame_red_zone_size */
336 convert_from_func_ptr_addr_identity
, /* convert_from_func_ptr_addr */
337 0, /* addr_bits_remove */
338 0, /* smash_text_address */
339 0, /* software_single_step */
341 0, /* skip_trampoline_code */
342 generic_skip_solib_resolver
, /* skip_solib_resolver */
343 0, /* in_solib_call_trampoline */
344 0, /* in_solib_return_trampoline */
345 generic_in_function_epilogue_p
, /* in_function_epilogue_p */
346 construct_inferior_arguments
, /* construct_inferior_arguments */
347 0, /* elf_make_msymbol_special */
348 0, /* coff_make_msymbol_special */
349 "malloc", /* name_of_malloc */
350 0, /* cannot_step_breakpoint */
351 0, /* have_nonsteppable_watchpoint */
352 0, /* address_class_type_flags */
353 0, /* address_class_type_flags_to_name */
354 0, /* address_class_name_to_type_flags */
355 default_register_reggroup_p
, /* register_reggroup_p */
356 0, /* fetch_pointer_argument */
357 0, /* regset_from_core_section */
358 /* startup_gdbarch() */
361 struct gdbarch
*current_gdbarch
= &startup_gdbarch
;
363 /* Create a new ``struct gdbarch'' based on information provided by
364 ``struct gdbarch_info''. */
367 gdbarch_alloc (const struct gdbarch_info
*info
,
368 struct gdbarch_tdep
*tdep
)
370 /* NOTE: The new architecture variable is named ``current_gdbarch''
371 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
372 the current local architecture and not the previous global
373 architecture. This ensures that the new architectures initial
374 values are not influenced by the previous architecture. Once
375 everything is parameterised with gdbarch, this will go away. */
376 struct gdbarch
*current_gdbarch
;
378 /* Create an obstack for allocating all the per-architecture memory,
379 then use that to allocate the architecture vector. */
380 struct obstack
*obstack
= XMALLOC (struct obstack
);
381 obstack_init (obstack
);
382 current_gdbarch
= obstack_alloc (obstack
, sizeof (*current_gdbarch
));
383 memset (current_gdbarch
, 0, sizeof (*current_gdbarch
));
384 current_gdbarch
->obstack
= obstack
;
386 alloc_gdbarch_data (current_gdbarch
);
388 current_gdbarch
->tdep
= tdep
;
390 current_gdbarch
->bfd_arch_info
= info
->bfd_arch_info
;
391 current_gdbarch
->byte_order
= info
->byte_order
;
392 current_gdbarch
->osabi
= info
->osabi
;
394 /* Force the explicit initialization of these. */
395 current_gdbarch
->short_bit
= 2*TARGET_CHAR_BIT
;
396 current_gdbarch
->int_bit
= 4*TARGET_CHAR_BIT
;
397 current_gdbarch
->long_bit
= 4*TARGET_CHAR_BIT
;
398 current_gdbarch
->long_long_bit
= 2*TARGET_LONG_BIT
;
399 current_gdbarch
->float_bit
= 4*TARGET_CHAR_BIT
;
400 current_gdbarch
->double_bit
= 8*TARGET_CHAR_BIT
;
401 current_gdbarch
->long_double_bit
= 8*TARGET_CHAR_BIT
;
402 current_gdbarch
->ptr_bit
= TARGET_INT_BIT
;
403 current_gdbarch
->bfd_vma_bit
= TARGET_ARCHITECTURE
->bits_per_address
;
404 current_gdbarch
->char_signed
= -1;
405 current_gdbarch
->write_pc
= generic_target_write_pc
;
406 current_gdbarch
->virtual_frame_pointer
= legacy_virtual_frame_pointer
;
407 current_gdbarch
->num_regs
= -1;
408 current_gdbarch
->sp_regnum
= -1;
409 current_gdbarch
->pc_regnum
= -1;
410 current_gdbarch
->ps_regnum
= -1;
411 current_gdbarch
->fp0_regnum
= -1;
412 current_gdbarch
->stab_reg_to_regnum
= no_op_reg_to_regnum
;
413 current_gdbarch
->ecoff_reg_to_regnum
= no_op_reg_to_regnum
;
414 current_gdbarch
->dwarf_reg_to_regnum
= no_op_reg_to_regnum
;
415 current_gdbarch
->sdb_reg_to_regnum
= no_op_reg_to_regnum
;
416 current_gdbarch
->dwarf2_reg_to_regnum
= no_op_reg_to_regnum
;
417 current_gdbarch
->deprecated_register_byte
= generic_register_byte
;
418 current_gdbarch
->deprecated_fp_regnum
= -1;
419 current_gdbarch
->call_dummy_location
= AT_ENTRY_POINT
;
420 current_gdbarch
->print_registers_info
= default_print_registers_info
;
421 current_gdbarch
->register_sim_regno
= legacy_register_sim_regno
;
422 current_gdbarch
->cannot_fetch_register
= cannot_register_not
;
423 current_gdbarch
->cannot_store_register
= cannot_register_not
;
424 current_gdbarch
->convert_register_p
= generic_convert_register_p
;
425 current_gdbarch
->pointer_to_address
= unsigned_pointer_to_address
;
426 current_gdbarch
->address_to_pointer
= unsigned_address_to_pointer
;
427 current_gdbarch
->return_value
= legacy_return_value
;
428 current_gdbarch
->extract_return_value
= legacy_extract_return_value
;
429 current_gdbarch
->store_return_value
= legacy_store_return_value
;
430 current_gdbarch
->deprecated_use_struct_convention
= generic_use_struct_convention
;
431 current_gdbarch
->memory_insert_breakpoint
= default_memory_insert_breakpoint
;
432 current_gdbarch
->memory_remove_breakpoint
= default_memory_remove_breakpoint
;
433 current_gdbarch
->remote_translate_xfer_address
= generic_remote_translate_xfer_address
;
434 current_gdbarch
->stabs_argument_has_addr
= default_stabs_argument_has_addr
;
435 current_gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr_identity
;
436 current_gdbarch
->addr_bits_remove
= core_addr_identity
;
437 current_gdbarch
->smash_text_address
= core_addr_identity
;
438 current_gdbarch
->skip_trampoline_code
= generic_skip_trampoline_code
;
439 current_gdbarch
->skip_solib_resolver
= generic_skip_solib_resolver
;
440 current_gdbarch
->in_solib_call_trampoline
= generic_in_solib_call_trampoline
;
441 current_gdbarch
->in_solib_return_trampoline
= generic_in_solib_return_trampoline
;
442 current_gdbarch
->in_function_epilogue_p
= generic_in_function_epilogue_p
;
443 current_gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
444 current_gdbarch
->elf_make_msymbol_special
= default_elf_make_msymbol_special
;
445 current_gdbarch
->coff_make_msymbol_special
= default_coff_make_msymbol_special
;
446 current_gdbarch
->name_of_malloc
= "malloc";
447 current_gdbarch
->register_reggroup_p
= default_register_reggroup_p
;
448 /* gdbarch_alloc() */
450 return current_gdbarch
;
454 /* Allocate extra space using the per-architecture obstack. */
457 gdbarch_obstack_zalloc (struct gdbarch
*arch
, long size
)
459 void *data
= obstack_alloc (arch
->obstack
, size
);
460 memset (data
, 0, size
);
465 /* Free a gdbarch struct. This should never happen in normal
466 operation --- once you've created a gdbarch, you keep it around.
467 However, if an architecture's init function encounters an error
468 building the structure, it may need to clean up a partially
469 constructed gdbarch. */
472 gdbarch_free (struct gdbarch
*arch
)
474 struct obstack
*obstack
;
475 gdb_assert (arch
!= NULL
);
476 gdb_assert (!arch
->initialized_p
);
477 obstack
= arch
->obstack
;
478 obstack_free (obstack
, 0); /* Includes the ARCH. */
483 /* Ensure that all values in a GDBARCH are reasonable. */
485 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
486 just happens to match the global variable ``current_gdbarch''. That
487 way macros refering to that variable get the local and not the global
488 version - ulgh. Once everything is parameterised with gdbarch, this
492 verify_gdbarch (struct gdbarch
*current_gdbarch
)
495 struct cleanup
*cleanups
;
498 log
= mem_fileopen ();
499 cleanups
= make_cleanup_ui_file_delete (log
);
501 if (current_gdbarch
->byte_order
== BFD_ENDIAN_UNKNOWN
)
502 fprintf_unfiltered (log
, "\n\tbyte-order");
503 if (current_gdbarch
->bfd_arch_info
== NULL
)
504 fprintf_unfiltered (log
, "\n\tbfd_arch_info");
505 /* Check those that need to be defined for the given multi-arch level. */
506 /* Skip verify of short_bit, invalid_p == 0 */
507 /* Skip verify of int_bit, invalid_p == 0 */
508 /* Skip verify of long_bit, invalid_p == 0 */
509 /* Skip verify of long_long_bit, invalid_p == 0 */
510 /* Skip verify of float_bit, invalid_p == 0 */
511 if (current_gdbarch
->float_format
== 0)
512 current_gdbarch
->float_format
= default_float_format (current_gdbarch
);
513 /* Skip verify of double_bit, invalid_p == 0 */
514 if (current_gdbarch
->double_format
== 0)
515 current_gdbarch
->double_format
= default_double_format (current_gdbarch
);
516 /* Skip verify of long_double_bit, invalid_p == 0 */
517 if (current_gdbarch
->long_double_format
== 0)
518 current_gdbarch
->long_double_format
= default_double_format (current_gdbarch
);
519 /* Skip verify of ptr_bit, invalid_p == 0 */
520 if (current_gdbarch
->addr_bit
== 0)
521 current_gdbarch
->addr_bit
= TARGET_PTR_BIT
;
522 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
523 if (current_gdbarch
->char_signed
== -1)
524 current_gdbarch
->char_signed
= 1;
525 /* Skip verify of read_pc, has predicate */
526 /* Skip verify of write_pc, invalid_p == 0 */
527 /* Skip verify of read_sp, has predicate */
528 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
529 /* Skip verify of pseudo_register_read, has predicate */
530 /* Skip verify of pseudo_register_write, has predicate */
531 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
532 && (current_gdbarch
->num_regs
== -1))
533 fprintf_unfiltered (log
, "\n\tnum_regs");
534 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
535 /* Skip verify of sp_regnum, invalid_p == 0 */
536 /* Skip verify of pc_regnum, invalid_p == 0 */
537 /* Skip verify of ps_regnum, invalid_p == 0 */
538 /* Skip verify of fp0_regnum, invalid_p == 0 */
539 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
540 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
541 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
542 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
543 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
544 /* Skip verify of register_type, has predicate */
545 /* Skip verify of deprecated_register_byte, has predicate */
546 /* Skip verify of unwind_dummy_id, has predicate */
547 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
548 /* Skip verify of push_dummy_call, has predicate */
549 /* Skip verify of deprecated_push_arguments, has predicate */
550 /* Skip verify of call_dummy_location, invalid_p == 0 */
551 /* Skip verify of push_dummy_code, has predicate */
552 /* Skip verify of print_registers_info, invalid_p == 0 */
553 /* Skip verify of print_float_info, has predicate */
554 /* Skip verify of print_vector_info, has predicate */
555 /* Skip verify of register_sim_regno, invalid_p == 0 */
556 /* Skip verify of register_bytes_ok, has predicate */
557 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
558 /* Skip verify of cannot_store_register, invalid_p == 0 */
559 /* Skip verify of get_longjmp_target, has predicate */
560 /* Skip verify of convert_register_p, invalid_p == 0 */
561 /* Skip verify of pointer_to_address, invalid_p == 0 */
562 /* Skip verify of address_to_pointer, invalid_p == 0 */
563 /* Skip verify of integer_to_address, has predicate */
564 /* Skip verify of deprecated_store_struct_return, has predicate */
565 /* Skip verify of return_value, has predicate */
566 /* Skip verify of extract_return_value, invalid_p == 0 */
567 /* Skip verify of store_return_value, invalid_p == 0 */
568 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
569 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
570 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
571 && (current_gdbarch
->skip_prologue
== 0))
572 fprintf_unfiltered (log
, "\n\tskip_prologue");
573 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
574 && (current_gdbarch
->inner_than
== 0))
575 fprintf_unfiltered (log
, "\n\tinner_than");
576 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
577 && (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 frame_args_skip, invalid_p == 0 */
586 /* Skip verify of unwind_pc, has predicate */
587 /* Skip verify of unwind_sp, has predicate */
588 /* Skip verify of deprecated_saved_pc_after_call, has predicate */
589 /* Skip verify of frame_num_args, has predicate */
590 /* Skip verify of deprecated_stack_align, has predicate */
591 /* Skip verify of frame_align, has predicate */
592 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
593 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
594 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
595 /* Skip verify of addr_bits_remove, invalid_p == 0 */
596 /* Skip verify of smash_text_address, invalid_p == 0 */
597 /* Skip verify of software_single_step, has predicate */
598 if ((GDB_MULTI_ARCH
> GDB_MULTI_ARCH_PARTIAL
)
599 && (current_gdbarch
->print_insn
== 0))
600 fprintf_unfiltered (log
, "\n\tprint_insn");
601 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
602 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
603 /* Skip verify of in_solib_call_trampoline, 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 fprintf_unfiltered (file
,
640 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
642 #ifdef TARGET_ADDR_BIT
643 fprintf_unfiltered (file
,
644 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
645 XSTRING (TARGET_ADDR_BIT
));
647 fprintf_unfiltered (file
,
648 "gdbarch_dump: addr_bit = %s\n",
649 paddr_d (current_gdbarch
->addr_bit
));
650 #ifdef ADDR_BITS_REMOVE
651 fprintf_unfiltered (file
,
652 "gdbarch_dump: %s # %s\n",
653 "ADDR_BITS_REMOVE(addr)",
654 XSTRING (ADDR_BITS_REMOVE (addr
)));
656 fprintf_unfiltered (file
,
657 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
658 (long) current_gdbarch
->addr_bits_remove
);
659 fprintf_unfiltered (file
,
660 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
661 gdbarch_address_class_name_to_type_flags_p (current_gdbarch
));
662 fprintf_unfiltered (file
,
663 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
664 (long) current_gdbarch
->address_class_name_to_type_flags
);
665 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
666 fprintf_unfiltered (file
,
667 "gdbarch_dump: %s # %s\n",
668 "ADDRESS_CLASS_TYPE_FLAGS_P()",
669 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
671 fprintf_unfiltered (file
,
672 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
673 gdbarch_address_class_type_flags_p (current_gdbarch
));
674 #ifdef ADDRESS_CLASS_TYPE_FLAGS
675 fprintf_unfiltered (file
,
676 "gdbarch_dump: %s # %s\n",
677 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
678 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size
, dwarf2_addr_class
)));
680 fprintf_unfiltered (file
,
681 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
682 (long) current_gdbarch
->address_class_type_flags
);
683 fprintf_unfiltered (file
,
684 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
685 gdbarch_address_class_type_flags_to_name_p (current_gdbarch
));
686 fprintf_unfiltered (file
,
687 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
688 (long) current_gdbarch
->address_class_type_flags_to_name
);
689 #ifdef ADDRESS_TO_POINTER
690 fprintf_unfiltered (file
,
691 "gdbarch_dump: %s # %s\n",
692 "ADDRESS_TO_POINTER(type, buf, addr)",
693 XSTRING (ADDRESS_TO_POINTER (type
, buf
, addr
)));
695 fprintf_unfiltered (file
,
696 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
697 (long) current_gdbarch
->address_to_pointer
);
698 fprintf_unfiltered (file
,
699 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
700 gdbarch_adjust_breakpoint_address_p (current_gdbarch
));
701 fprintf_unfiltered (file
,
702 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
703 (long) current_gdbarch
->adjust_breakpoint_address
);
704 #ifdef BELIEVE_PCC_PROMOTION
705 fprintf_unfiltered (file
,
706 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
707 XSTRING (BELIEVE_PCC_PROMOTION
));
709 fprintf_unfiltered (file
,
710 "gdbarch_dump: believe_pcc_promotion = %s\n",
711 paddr_d (current_gdbarch
->believe_pcc_promotion
));
712 #ifdef TARGET_ARCHITECTURE
713 fprintf_unfiltered (file
,
714 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
715 XSTRING (TARGET_ARCHITECTURE
));
717 fprintf_unfiltered (file
,
718 "gdbarch_dump: bfd_arch_info = %s\n",
719 TARGET_ARCHITECTURE
->printable_name
);
720 #ifdef TARGET_BFD_VMA_BIT
721 fprintf_unfiltered (file
,
722 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
723 XSTRING (TARGET_BFD_VMA_BIT
));
725 fprintf_unfiltered (file
,
726 "gdbarch_dump: bfd_vma_bit = %s\n",
727 paddr_d (current_gdbarch
->bfd_vma_bit
));
728 #ifdef BREAKPOINT_FROM_PC
729 fprintf_unfiltered (file
,
730 "gdbarch_dump: %s # %s\n",
731 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
732 XSTRING (BREAKPOINT_FROM_PC (pcptr
, lenptr
)));
734 fprintf_unfiltered (file
,
735 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
736 (long) current_gdbarch
->breakpoint_from_pc
);
737 #ifdef TARGET_BYTE_ORDER
738 fprintf_unfiltered (file
,
739 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
740 XSTRING (TARGET_BYTE_ORDER
));
742 fprintf_unfiltered (file
,
743 "gdbarch_dump: byte_order = %s\n",
744 paddr_d (current_gdbarch
->byte_order
));
745 #ifdef CALL_DUMMY_LOCATION
746 fprintf_unfiltered (file
,
747 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
748 XSTRING (CALL_DUMMY_LOCATION
));
750 fprintf_unfiltered (file
,
751 "gdbarch_dump: call_dummy_location = %s\n",
752 paddr_d (current_gdbarch
->call_dummy_location
));
753 #ifdef CANNOT_FETCH_REGISTER
754 fprintf_unfiltered (file
,
755 "gdbarch_dump: %s # %s\n",
756 "CANNOT_FETCH_REGISTER(regnum)",
757 XSTRING (CANNOT_FETCH_REGISTER (regnum
)));
759 fprintf_unfiltered (file
,
760 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
761 (long) current_gdbarch
->cannot_fetch_register
);
762 #ifdef CANNOT_STEP_BREAKPOINT
763 fprintf_unfiltered (file
,
764 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
765 XSTRING (CANNOT_STEP_BREAKPOINT
));
767 fprintf_unfiltered (file
,
768 "gdbarch_dump: cannot_step_breakpoint = %s\n",
769 paddr_d (current_gdbarch
->cannot_step_breakpoint
));
770 #ifdef CANNOT_STORE_REGISTER
771 fprintf_unfiltered (file
,
772 "gdbarch_dump: %s # %s\n",
773 "CANNOT_STORE_REGISTER(regnum)",
774 XSTRING (CANNOT_STORE_REGISTER (regnum
)));
776 fprintf_unfiltered (file
,
777 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
778 (long) current_gdbarch
->cannot_store_register
);
779 #ifdef TARGET_CHAR_SIGNED
780 fprintf_unfiltered (file
,
781 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
782 XSTRING (TARGET_CHAR_SIGNED
));
784 fprintf_unfiltered (file
,
785 "gdbarch_dump: char_signed = %s\n",
786 paddr_d (current_gdbarch
->char_signed
));
787 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
788 fprintf_unfiltered (file
,
789 "gdbarch_dump: %s # %s\n",
790 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
791 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val
, msym
)));
793 fprintf_unfiltered (file
,
794 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
795 (long) current_gdbarch
->coff_make_msymbol_special
);
796 fprintf_unfiltered (file
,
797 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
798 (long) current_gdbarch
->construct_inferior_arguments
);
799 fprintf_unfiltered (file
,
800 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
801 (long) current_gdbarch
->convert_from_func_ptr_addr
);
802 #ifdef CONVERT_REGISTER_P
803 fprintf_unfiltered (file
,
804 "gdbarch_dump: %s # %s\n",
805 "CONVERT_REGISTER_P(regnum, type)",
806 XSTRING (CONVERT_REGISTER_P (regnum
, type
)));
808 fprintf_unfiltered (file
,
809 "gdbarch_dump: convert_register_p = <0x%lx>\n",
810 (long) current_gdbarch
->convert_register_p
);
811 #ifdef DECR_PC_AFTER_BREAK
812 fprintf_unfiltered (file
,
813 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
814 XSTRING (DECR_PC_AFTER_BREAK
));
816 fprintf_unfiltered (file
,
817 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
818 paddr_nz (current_gdbarch
->decr_pc_after_break
));
819 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
820 fprintf_unfiltered (file
,
821 "gdbarch_dump: %s # %s\n",
822 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
823 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type
, regbuf
, valbuf
)));
825 fprintf_unfiltered (file
,
826 "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n",
827 (long) current_gdbarch
->deprecated_extract_return_value
);
828 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
829 fprintf_unfiltered (file
,
830 "gdbarch_dump: %s # %s\n",
831 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
832 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
834 fprintf_unfiltered (file
,
835 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
836 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch
));
837 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
838 fprintf_unfiltered (file
,
839 "gdbarch_dump: %s # %s\n",
840 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
841 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache
)));
843 fprintf_unfiltered (file
,
844 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
845 (long) current_gdbarch
->deprecated_extract_struct_value_address
);
846 #ifdef DEPRECATED_FP_REGNUM
847 fprintf_unfiltered (file
,
848 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
849 XSTRING (DEPRECATED_FP_REGNUM
));
851 fprintf_unfiltered (file
,
852 "gdbarch_dump: deprecated_fp_regnum = %s\n",
853 paddr_d (current_gdbarch
->deprecated_fp_regnum
));
854 #ifdef DEPRECATED_FUNCTION_START_OFFSET
855 fprintf_unfiltered (file
,
856 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
857 XSTRING (DEPRECATED_FUNCTION_START_OFFSET
));
859 fprintf_unfiltered (file
,
860 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
861 paddr_nz (current_gdbarch
->deprecated_function_start_offset
));
862 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
863 fprintf_unfiltered (file
,
864 "gdbarch_dump: %s # %s\n",
865 "DEPRECATED_PUSH_ARGUMENTS_P()",
866 XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
868 fprintf_unfiltered (file
,
869 "gdbarch_dump: gdbarch_deprecated_push_arguments_p() = %d\n",
870 gdbarch_deprecated_push_arguments_p (current_gdbarch
));
871 #ifdef DEPRECATED_PUSH_ARGUMENTS
872 fprintf_unfiltered (file
,
873 "gdbarch_dump: %s # %s\n",
874 "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
875 XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs
, args
, sp
, struct_return
, struct_addr
)));
877 fprintf_unfiltered (file
,
878 "gdbarch_dump: deprecated_push_arguments = <0x%lx>\n",
879 (long) current_gdbarch
->deprecated_push_arguments
);
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 TARGET_FLOAT_BIT
1076 fprintf_unfiltered (file
,
1077 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1078 XSTRING (TARGET_FLOAT_BIT
));
1080 fprintf_unfiltered (file
,
1081 "gdbarch_dump: float_bit = %s\n",
1082 paddr_d (current_gdbarch
->float_bit
));
1083 #ifdef TARGET_FLOAT_FORMAT
1084 fprintf_unfiltered (file
,
1085 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1086 XSTRING (TARGET_FLOAT_FORMAT
));
1088 fprintf_unfiltered (file
,
1089 "gdbarch_dump: float_format = %s\n",
1090 pformat (current_gdbarch
->float_format
));
1092 fprintf_unfiltered (file
,
1093 "gdbarch_dump: FP0_REGNUM # %s\n",
1094 XSTRING (FP0_REGNUM
));
1096 fprintf_unfiltered (file
,
1097 "gdbarch_dump: fp0_regnum = %s\n",
1098 paddr_d (current_gdbarch
->fp0_regnum
));
1099 fprintf_unfiltered (file
,
1100 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1101 gdbarch_frame_align_p (current_gdbarch
));
1102 fprintf_unfiltered (file
,
1103 "gdbarch_dump: frame_align = <0x%lx>\n",
1104 (long) current_gdbarch
->frame_align
);
1105 #ifdef FRAME_ARGS_SKIP
1106 fprintf_unfiltered (file
,
1107 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1108 XSTRING (FRAME_ARGS_SKIP
));
1110 fprintf_unfiltered (file
,
1111 "gdbarch_dump: frame_args_skip = 0x%s\n",
1112 paddr_nz (current_gdbarch
->frame_args_skip
));
1113 #ifdef FRAME_NUM_ARGS_P
1114 fprintf_unfiltered (file
,
1115 "gdbarch_dump: %s # %s\n",
1116 "FRAME_NUM_ARGS_P()",
1117 XSTRING (FRAME_NUM_ARGS_P ()));
1119 fprintf_unfiltered (file
,
1120 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1121 gdbarch_frame_num_args_p (current_gdbarch
));
1122 #ifdef FRAME_NUM_ARGS
1123 fprintf_unfiltered (file
,
1124 "gdbarch_dump: %s # %s\n",
1125 "FRAME_NUM_ARGS(frame)",
1126 XSTRING (FRAME_NUM_ARGS (frame
)));
1128 fprintf_unfiltered (file
,
1129 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1130 (long) current_gdbarch
->frame_num_args
);
1131 #ifdef FRAME_RED_ZONE_SIZE
1132 fprintf_unfiltered (file
,
1133 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1134 XSTRING (FRAME_RED_ZONE_SIZE
));
1136 fprintf_unfiltered (file
,
1137 "gdbarch_dump: frame_red_zone_size = %s\n",
1138 paddr_d (current_gdbarch
->frame_red_zone_size
));
1139 #ifdef GET_LONGJMP_TARGET_P
1140 fprintf_unfiltered (file
,
1141 "gdbarch_dump: %s # %s\n",
1142 "GET_LONGJMP_TARGET_P()",
1143 XSTRING (GET_LONGJMP_TARGET_P ()));
1145 fprintf_unfiltered (file
,
1146 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1147 gdbarch_get_longjmp_target_p (current_gdbarch
));
1148 #ifdef GET_LONGJMP_TARGET
1149 fprintf_unfiltered (file
,
1150 "gdbarch_dump: %s # %s\n",
1151 "GET_LONGJMP_TARGET(pc)",
1152 XSTRING (GET_LONGJMP_TARGET (pc
)));
1154 fprintf_unfiltered (file
,
1155 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1156 (long) current_gdbarch
->get_longjmp_target
);
1157 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1158 fprintf_unfiltered (file
,
1159 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1160 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT
));
1162 fprintf_unfiltered (file
,
1163 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1164 paddr_d (current_gdbarch
->have_nonsteppable_watchpoint
));
1165 fprintf_unfiltered (file
,
1166 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1167 (long) current_gdbarch
->in_function_epilogue_p
);
1168 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1169 fprintf_unfiltered (file
,
1170 "gdbarch_dump: %s # %s\n",
1171 "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1172 XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc
, name
)));
1174 fprintf_unfiltered (file
,
1175 "gdbarch_dump: in_solib_call_trampoline = <0x%lx>\n",
1176 (long) current_gdbarch
->in_solib_call_trampoline
);
1177 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1178 fprintf_unfiltered (file
,
1179 "gdbarch_dump: %s # %s\n",
1180 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1181 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc
, name
)));
1183 fprintf_unfiltered (file
,
1184 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1185 (long) current_gdbarch
->in_solib_return_trampoline
);
1187 fprintf_unfiltered (file
,
1188 "gdbarch_dump: %s # %s\n",
1189 "INNER_THAN(lhs, rhs)",
1190 XSTRING (INNER_THAN (lhs
, rhs
)));
1192 fprintf_unfiltered (file
,
1193 "gdbarch_dump: inner_than = <0x%lx>\n",
1194 (long) current_gdbarch
->inner_than
);
1195 #ifdef TARGET_INT_BIT
1196 fprintf_unfiltered (file
,
1197 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1198 XSTRING (TARGET_INT_BIT
));
1200 fprintf_unfiltered (file
,
1201 "gdbarch_dump: int_bit = %s\n",
1202 paddr_d (current_gdbarch
->int_bit
));
1203 #ifdef INTEGER_TO_ADDRESS_P
1204 fprintf_unfiltered (file
,
1205 "gdbarch_dump: %s # %s\n",
1206 "INTEGER_TO_ADDRESS_P()",
1207 XSTRING (INTEGER_TO_ADDRESS_P ()));
1209 fprintf_unfiltered (file
,
1210 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1211 gdbarch_integer_to_address_p (current_gdbarch
));
1212 #ifdef INTEGER_TO_ADDRESS
1213 fprintf_unfiltered (file
,
1214 "gdbarch_dump: %s # %s\n",
1215 "INTEGER_TO_ADDRESS(type, buf)",
1216 XSTRING (INTEGER_TO_ADDRESS (type
, buf
)));
1218 fprintf_unfiltered (file
,
1219 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1220 (long) current_gdbarch
->integer_to_address
);
1221 #ifdef TARGET_LONG_BIT
1222 fprintf_unfiltered (file
,
1223 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1224 XSTRING (TARGET_LONG_BIT
));
1226 fprintf_unfiltered (file
,
1227 "gdbarch_dump: long_bit = %s\n",
1228 paddr_d (current_gdbarch
->long_bit
));
1229 #ifdef TARGET_LONG_DOUBLE_BIT
1230 fprintf_unfiltered (file
,
1231 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1232 XSTRING (TARGET_LONG_DOUBLE_BIT
));
1234 fprintf_unfiltered (file
,
1235 "gdbarch_dump: long_double_bit = %s\n",
1236 paddr_d (current_gdbarch
->long_double_bit
));
1237 #ifdef TARGET_LONG_DOUBLE_FORMAT
1238 fprintf_unfiltered (file
,
1239 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1240 XSTRING (TARGET_LONG_DOUBLE_FORMAT
));
1242 fprintf_unfiltered (file
,
1243 "gdbarch_dump: long_double_format = %s\n",
1244 pformat (current_gdbarch
->long_double_format
));
1245 #ifdef TARGET_LONG_LONG_BIT
1246 fprintf_unfiltered (file
,
1247 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1248 XSTRING (TARGET_LONG_LONG_BIT
));
1250 fprintf_unfiltered (file
,
1251 "gdbarch_dump: long_long_bit = %s\n",
1252 paddr_d (current_gdbarch
->long_long_bit
));
1253 #ifdef MEMORY_INSERT_BREAKPOINT
1254 fprintf_unfiltered (file
,
1255 "gdbarch_dump: %s # %s\n",
1256 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1257 XSTRING (MEMORY_INSERT_BREAKPOINT (addr
, contents_cache
)));
1259 fprintf_unfiltered (file
,
1260 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1261 (long) current_gdbarch
->memory_insert_breakpoint
);
1262 #ifdef MEMORY_REMOVE_BREAKPOINT
1263 fprintf_unfiltered (file
,
1264 "gdbarch_dump: %s # %s\n",
1265 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1266 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr
, contents_cache
)));
1268 fprintf_unfiltered (file
,
1269 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1270 (long) current_gdbarch
->memory_remove_breakpoint
);
1271 #ifdef NAME_OF_MALLOC
1272 fprintf_unfiltered (file
,
1273 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1274 XSTRING (NAME_OF_MALLOC
));
1276 fprintf_unfiltered (file
,
1277 "gdbarch_dump: name_of_malloc = %s\n",
1279 #ifdef NUM_PSEUDO_REGS
1280 fprintf_unfiltered (file
,
1281 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1282 XSTRING (NUM_PSEUDO_REGS
));
1284 fprintf_unfiltered (file
,
1285 "gdbarch_dump: num_pseudo_regs = %s\n",
1286 paddr_d (current_gdbarch
->num_pseudo_regs
));
1288 fprintf_unfiltered (file
,
1289 "gdbarch_dump: NUM_REGS # %s\n",
1290 XSTRING (NUM_REGS
));
1292 fprintf_unfiltered (file
,
1293 "gdbarch_dump: num_regs = %s\n",
1294 paddr_d (current_gdbarch
->num_regs
));
1296 fprintf_unfiltered (file
,
1297 "gdbarch_dump: TARGET_OSABI # %s\n",
1298 XSTRING (TARGET_OSABI
));
1300 fprintf_unfiltered (file
,
1301 "gdbarch_dump: osabi = %s\n",
1302 paddr_d (current_gdbarch
->osabi
));
1304 fprintf_unfiltered (file
,
1305 "gdbarch_dump: PC_REGNUM # %s\n",
1306 XSTRING (PC_REGNUM
));
1308 fprintf_unfiltered (file
,
1309 "gdbarch_dump: pc_regnum = %s\n",
1310 paddr_d (current_gdbarch
->pc_regnum
));
1311 #ifdef POINTER_TO_ADDRESS
1312 fprintf_unfiltered (file
,
1313 "gdbarch_dump: %s # %s\n",
1314 "POINTER_TO_ADDRESS(type, buf)",
1315 XSTRING (POINTER_TO_ADDRESS (type
, buf
)));
1317 fprintf_unfiltered (file
,
1318 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1319 (long) current_gdbarch
->pointer_to_address
);
1320 fprintf_unfiltered (file
,
1321 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1322 gdbarch_print_float_info_p (current_gdbarch
));
1323 fprintf_unfiltered (file
,
1324 "gdbarch_dump: print_float_info = <0x%lx>\n",
1325 (long) current_gdbarch
->print_float_info
);
1326 #ifdef TARGET_PRINT_INSN
1327 fprintf_unfiltered (file
,
1328 "gdbarch_dump: %s # %s\n",
1329 "TARGET_PRINT_INSN(vma, info)",
1330 XSTRING (TARGET_PRINT_INSN (vma
, info
)));
1332 fprintf_unfiltered (file
,
1333 "gdbarch_dump: print_insn = <0x%lx>\n",
1334 (long) current_gdbarch
->print_insn
);
1335 fprintf_unfiltered (file
,
1336 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1337 (long) current_gdbarch
->print_registers_info
);
1338 fprintf_unfiltered (file
,
1339 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1340 gdbarch_print_vector_info_p (current_gdbarch
));
1341 fprintf_unfiltered (file
,
1342 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1343 (long) current_gdbarch
->print_vector_info
);
1345 fprintf_unfiltered (file
,
1346 "gdbarch_dump: PS_REGNUM # %s\n",
1347 XSTRING (PS_REGNUM
));
1349 fprintf_unfiltered (file
,
1350 "gdbarch_dump: ps_regnum = %s\n",
1351 paddr_d (current_gdbarch
->ps_regnum
));
1352 fprintf_unfiltered (file
,
1353 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1354 gdbarch_pseudo_register_read_p (current_gdbarch
));
1355 fprintf_unfiltered (file
,
1356 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1357 (long) current_gdbarch
->pseudo_register_read
);
1358 fprintf_unfiltered (file
,
1359 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1360 gdbarch_pseudo_register_write_p (current_gdbarch
));
1361 fprintf_unfiltered (file
,
1362 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1363 (long) current_gdbarch
->pseudo_register_write
);
1364 #ifdef TARGET_PTR_BIT
1365 fprintf_unfiltered (file
,
1366 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1367 XSTRING (TARGET_PTR_BIT
));
1369 fprintf_unfiltered (file
,
1370 "gdbarch_dump: ptr_bit = %s\n",
1371 paddr_d (current_gdbarch
->ptr_bit
));
1372 fprintf_unfiltered (file
,
1373 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1374 gdbarch_push_dummy_call_p (current_gdbarch
));
1375 fprintf_unfiltered (file
,
1376 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1377 (long) current_gdbarch
->push_dummy_call
);
1378 fprintf_unfiltered (file
,
1379 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1380 gdbarch_push_dummy_code_p (current_gdbarch
));
1381 fprintf_unfiltered (file
,
1382 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1383 (long) current_gdbarch
->push_dummy_code
);
1384 #ifdef TARGET_READ_PC_P
1385 fprintf_unfiltered (file
,
1386 "gdbarch_dump: %s # %s\n",
1387 "TARGET_READ_PC_P()",
1388 XSTRING (TARGET_READ_PC_P ()));
1390 fprintf_unfiltered (file
,
1391 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1392 gdbarch_read_pc_p (current_gdbarch
));
1393 #ifdef TARGET_READ_PC
1394 fprintf_unfiltered (file
,
1395 "gdbarch_dump: %s # %s\n",
1396 "TARGET_READ_PC(ptid)",
1397 XSTRING (TARGET_READ_PC (ptid
)));
1399 fprintf_unfiltered (file
,
1400 "gdbarch_dump: read_pc = <0x%lx>\n",
1401 (long) current_gdbarch
->read_pc
);
1402 #ifdef TARGET_READ_SP_P
1403 fprintf_unfiltered (file
,
1404 "gdbarch_dump: %s # %s\n",
1405 "TARGET_READ_SP_P()",
1406 XSTRING (TARGET_READ_SP_P ()));
1408 fprintf_unfiltered (file
,
1409 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1410 gdbarch_read_sp_p (current_gdbarch
));
1411 #ifdef TARGET_READ_SP
1412 fprintf_unfiltered (file
,
1413 "gdbarch_dump: %s # %s\n",
1415 XSTRING (TARGET_READ_SP ()));
1417 fprintf_unfiltered (file
,
1418 "gdbarch_dump: read_sp = <0x%lx>\n",
1419 (long) current_gdbarch
->read_sp
);
1420 #ifdef REGISTER_BYTES_OK_P
1421 fprintf_unfiltered (file
,
1422 "gdbarch_dump: %s # %s\n",
1423 "REGISTER_BYTES_OK_P()",
1424 XSTRING (REGISTER_BYTES_OK_P ()));
1426 fprintf_unfiltered (file
,
1427 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1428 gdbarch_register_bytes_ok_p (current_gdbarch
));
1429 #ifdef REGISTER_BYTES_OK
1430 fprintf_unfiltered (file
,
1431 "gdbarch_dump: %s # %s\n",
1432 "REGISTER_BYTES_OK(nr_bytes)",
1433 XSTRING (REGISTER_BYTES_OK (nr_bytes
)));
1435 fprintf_unfiltered (file
,
1436 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1437 (long) current_gdbarch
->register_bytes_ok
);
1438 #ifdef REGISTER_NAME
1439 fprintf_unfiltered (file
,
1440 "gdbarch_dump: %s # %s\n",
1441 "REGISTER_NAME(regnr)",
1442 XSTRING (REGISTER_NAME (regnr
)));
1444 fprintf_unfiltered (file
,
1445 "gdbarch_dump: register_name = <0x%lx>\n",
1446 (long) current_gdbarch
->register_name
);
1447 fprintf_unfiltered (file
,
1448 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1449 (long) current_gdbarch
->register_reggroup_p
);
1450 #ifdef REGISTER_SIM_REGNO
1451 fprintf_unfiltered (file
,
1452 "gdbarch_dump: %s # %s\n",
1453 "REGISTER_SIM_REGNO(reg_nr)",
1454 XSTRING (REGISTER_SIM_REGNO (reg_nr
)));
1456 fprintf_unfiltered (file
,
1457 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1458 (long) current_gdbarch
->register_sim_regno
);
1459 #ifdef REGISTER_TO_VALUE
1460 fprintf_unfiltered (file
,
1461 "gdbarch_dump: %s # %s\n",
1462 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1463 XSTRING (REGISTER_TO_VALUE (frame
, regnum
, type
, buf
)));
1465 fprintf_unfiltered (file
,
1466 "gdbarch_dump: register_to_value = <0x%lx>\n",
1467 (long) current_gdbarch
->register_to_value
);
1468 fprintf_unfiltered (file
,
1469 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1470 gdbarch_register_type_p (current_gdbarch
));
1471 fprintf_unfiltered (file
,
1472 "gdbarch_dump: register_type = <0x%lx>\n",
1473 (long) current_gdbarch
->register_type
);
1474 fprintf_unfiltered (file
,
1475 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1476 gdbarch_regset_from_core_section_p (current_gdbarch
));
1477 fprintf_unfiltered (file
,
1478 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1479 (long) current_gdbarch
->regset_from_core_section
);
1480 fprintf_unfiltered (file
,
1481 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1482 (long) current_gdbarch
->remote_translate_xfer_address
);
1483 fprintf_unfiltered (file
,
1484 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1485 gdbarch_return_value_p (current_gdbarch
));
1486 fprintf_unfiltered (file
,
1487 "gdbarch_dump: return_value = <0x%lx>\n",
1488 (long) current_gdbarch
->return_value
);
1489 #ifdef SDB_REG_TO_REGNUM
1490 fprintf_unfiltered (file
,
1491 "gdbarch_dump: %s # %s\n",
1492 "SDB_REG_TO_REGNUM(sdb_regnr)",
1493 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr
)));
1495 fprintf_unfiltered (file
,
1496 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1497 (long) current_gdbarch
->sdb_reg_to_regnum
);
1498 #ifdef TARGET_SHORT_BIT
1499 fprintf_unfiltered (file
,
1500 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1501 XSTRING (TARGET_SHORT_BIT
));
1503 fprintf_unfiltered (file
,
1504 "gdbarch_dump: short_bit = %s\n",
1505 paddr_d (current_gdbarch
->short_bit
));
1506 #ifdef SKIP_PROLOGUE
1507 fprintf_unfiltered (file
,
1508 "gdbarch_dump: %s # %s\n",
1509 "SKIP_PROLOGUE(ip)",
1510 XSTRING (SKIP_PROLOGUE (ip
)));
1512 fprintf_unfiltered (file
,
1513 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1514 (long) current_gdbarch
->skip_prologue
);
1515 fprintf_unfiltered (file
,
1516 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1517 (long) current_gdbarch
->skip_solib_resolver
);
1518 #ifdef SKIP_TRAMPOLINE_CODE
1519 fprintf_unfiltered (file
,
1520 "gdbarch_dump: %s # %s\n",
1521 "SKIP_TRAMPOLINE_CODE(pc)",
1522 XSTRING (SKIP_TRAMPOLINE_CODE (pc
)));
1524 fprintf_unfiltered (file
,
1525 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1526 (long) current_gdbarch
->skip_trampoline_code
);
1527 #ifdef SMASH_TEXT_ADDRESS
1528 fprintf_unfiltered (file
,
1529 "gdbarch_dump: %s # %s\n",
1530 "SMASH_TEXT_ADDRESS(addr)",
1531 XSTRING (SMASH_TEXT_ADDRESS (addr
)));
1533 fprintf_unfiltered (file
,
1534 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1535 (long) current_gdbarch
->smash_text_address
);
1536 #ifdef SOFTWARE_SINGLE_STEP_P
1537 fprintf_unfiltered (file
,
1538 "gdbarch_dump: %s # %s\n",
1539 "SOFTWARE_SINGLE_STEP_P()",
1540 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1542 fprintf_unfiltered (file
,
1543 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1544 gdbarch_software_single_step_p (current_gdbarch
));
1545 #ifdef SOFTWARE_SINGLE_STEP
1546 fprintf_unfiltered (file
,
1547 "gdbarch_dump: %s # %s\n",
1548 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1549 XSTRING (SOFTWARE_SINGLE_STEP (sig
, insert_breakpoints_p
)));
1551 fprintf_unfiltered (file
,
1552 "gdbarch_dump: software_single_step = <0x%lx>\n",
1553 (long) current_gdbarch
->software_single_step
);
1555 fprintf_unfiltered (file
,
1556 "gdbarch_dump: SP_REGNUM # %s\n",
1557 XSTRING (SP_REGNUM
));
1559 fprintf_unfiltered (file
,
1560 "gdbarch_dump: sp_regnum = %s\n",
1561 paddr_d (current_gdbarch
->sp_regnum
));
1562 #ifdef STAB_REG_TO_REGNUM
1563 fprintf_unfiltered (file
,
1564 "gdbarch_dump: %s # %s\n",
1565 "STAB_REG_TO_REGNUM(stab_regnr)",
1566 XSTRING (STAB_REG_TO_REGNUM (stab_regnr
)));
1568 fprintf_unfiltered (file
,
1569 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1570 (long) current_gdbarch
->stab_reg_to_regnum
);
1571 fprintf_unfiltered (file
,
1572 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1573 (long) current_gdbarch
->stabs_argument_has_addr
);
1574 #ifdef STORE_RETURN_VALUE
1575 fprintf_unfiltered (file
,
1576 "gdbarch_dump: %s # %s\n",
1577 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1578 XSTRING (STORE_RETURN_VALUE (type
, regcache
, valbuf
)));
1580 fprintf_unfiltered (file
,
1581 "gdbarch_dump: store_return_value = <0x%lx>\n",
1582 (long) current_gdbarch
->store_return_value
);
1583 fprintf_unfiltered (file
,
1584 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1585 gdbarch_unwind_dummy_id_p (current_gdbarch
));
1586 fprintf_unfiltered (file
,
1587 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1588 (long) current_gdbarch
->unwind_dummy_id
);
1589 fprintf_unfiltered (file
,
1590 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1591 gdbarch_unwind_pc_p (current_gdbarch
));
1592 fprintf_unfiltered (file
,
1593 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1594 (long) current_gdbarch
->unwind_pc
);
1595 fprintf_unfiltered (file
,
1596 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1597 gdbarch_unwind_sp_p (current_gdbarch
));
1598 fprintf_unfiltered (file
,
1599 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1600 (long) current_gdbarch
->unwind_sp
);
1601 #ifdef VALUE_TO_REGISTER
1602 fprintf_unfiltered (file
,
1603 "gdbarch_dump: %s # %s\n",
1604 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1605 XSTRING (VALUE_TO_REGISTER (frame
, regnum
, type
, buf
)));
1607 fprintf_unfiltered (file
,
1608 "gdbarch_dump: value_to_register = <0x%lx>\n",
1609 (long) current_gdbarch
->value_to_register
);
1610 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1611 fprintf_unfiltered (file
,
1612 "gdbarch_dump: %s # %s\n",
1613 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1614 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc
, frame_regnum
, frame_offset
)));
1616 fprintf_unfiltered (file
,
1617 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1618 (long) current_gdbarch
->virtual_frame_pointer
);
1619 #ifdef TARGET_WRITE_PC
1620 fprintf_unfiltered (file
,
1621 "gdbarch_dump: %s # %s\n",
1622 "TARGET_WRITE_PC(val, ptid)",
1623 XSTRING (TARGET_WRITE_PC (val
, ptid
)));
1625 fprintf_unfiltered (file
,
1626 "gdbarch_dump: write_pc = <0x%lx>\n",
1627 (long) current_gdbarch
->write_pc
);
1628 if (current_gdbarch
->dump_tdep
!= NULL
)
1629 current_gdbarch
->dump_tdep (current_gdbarch
, file
);
1632 struct gdbarch_tdep
*
1633 gdbarch_tdep (struct gdbarch
*gdbarch
)
1635 if (gdbarch_debug
>= 2)
1636 fprintf_unfiltered (gdb_stdlog
, "gdbarch_tdep called\n");
1637 return gdbarch
->tdep
;
1641 const struct bfd_arch_info
*
1642 gdbarch_bfd_arch_info (struct gdbarch
*gdbarch
)
1644 gdb_assert (gdbarch
!= NULL
);
1645 if (gdbarch_debug
>= 2)
1646 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_arch_info called\n");
1647 return gdbarch
->bfd_arch_info
;
1651 gdbarch_byte_order (struct gdbarch
*gdbarch
)
1653 gdb_assert (gdbarch
!= NULL
);
1654 if (gdbarch_debug
>= 2)
1655 fprintf_unfiltered (gdb_stdlog
, "gdbarch_byte_order called\n");
1656 return gdbarch
->byte_order
;
1660 gdbarch_osabi (struct gdbarch
*gdbarch
)
1662 gdb_assert (gdbarch
!= NULL
);
1663 if (gdbarch_debug
>= 2)
1664 fprintf_unfiltered (gdb_stdlog
, "gdbarch_osabi called\n");
1665 return gdbarch
->osabi
;
1669 gdbarch_short_bit (struct gdbarch
*gdbarch
)
1671 gdb_assert (gdbarch
!= NULL
);
1672 /* Skip verify of short_bit, invalid_p == 0 */
1673 if (gdbarch_debug
>= 2)
1674 fprintf_unfiltered (gdb_stdlog
, "gdbarch_short_bit called\n");
1675 return gdbarch
->short_bit
;
1679 set_gdbarch_short_bit (struct gdbarch
*gdbarch
,
1682 gdbarch
->short_bit
= short_bit
;
1686 gdbarch_int_bit (struct gdbarch
*gdbarch
)
1688 gdb_assert (gdbarch
!= NULL
);
1689 /* Skip verify of int_bit, invalid_p == 0 */
1690 if (gdbarch_debug
>= 2)
1691 fprintf_unfiltered (gdb_stdlog
, "gdbarch_int_bit called\n");
1692 return gdbarch
->int_bit
;
1696 set_gdbarch_int_bit (struct gdbarch
*gdbarch
,
1699 gdbarch
->int_bit
= int_bit
;
1703 gdbarch_long_bit (struct gdbarch
*gdbarch
)
1705 gdb_assert (gdbarch
!= NULL
);
1706 /* Skip verify of long_bit, invalid_p == 0 */
1707 if (gdbarch_debug
>= 2)
1708 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_bit called\n");
1709 return gdbarch
->long_bit
;
1713 set_gdbarch_long_bit (struct gdbarch
*gdbarch
,
1716 gdbarch
->long_bit
= long_bit
;
1720 gdbarch_long_long_bit (struct gdbarch
*gdbarch
)
1722 gdb_assert (gdbarch
!= NULL
);
1723 /* Skip verify of long_long_bit, invalid_p == 0 */
1724 if (gdbarch_debug
>= 2)
1725 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_long_bit called\n");
1726 return gdbarch
->long_long_bit
;
1730 set_gdbarch_long_long_bit (struct gdbarch
*gdbarch
,
1733 gdbarch
->long_long_bit
= long_long_bit
;
1737 gdbarch_float_bit (struct gdbarch
*gdbarch
)
1739 gdb_assert (gdbarch
!= NULL
);
1740 /* Skip verify of float_bit, invalid_p == 0 */
1741 if (gdbarch_debug
>= 2)
1742 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_bit called\n");
1743 return gdbarch
->float_bit
;
1747 set_gdbarch_float_bit (struct gdbarch
*gdbarch
,
1750 gdbarch
->float_bit
= float_bit
;
1753 const struct floatformat
*
1754 gdbarch_float_format (struct gdbarch
*gdbarch
)
1756 gdb_assert (gdbarch
!= NULL
);
1757 if (gdbarch_debug
>= 2)
1758 fprintf_unfiltered (gdb_stdlog
, "gdbarch_float_format called\n");
1759 return gdbarch
->float_format
;
1763 set_gdbarch_float_format (struct gdbarch
*gdbarch
,
1764 const struct floatformat
* float_format
)
1766 gdbarch
->float_format
= float_format
;
1770 gdbarch_double_bit (struct gdbarch
*gdbarch
)
1772 gdb_assert (gdbarch
!= NULL
);
1773 /* Skip verify of double_bit, invalid_p == 0 */
1774 if (gdbarch_debug
>= 2)
1775 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_bit called\n");
1776 return gdbarch
->double_bit
;
1780 set_gdbarch_double_bit (struct gdbarch
*gdbarch
,
1783 gdbarch
->double_bit
= double_bit
;
1786 const struct floatformat
*
1787 gdbarch_double_format (struct gdbarch
*gdbarch
)
1789 gdb_assert (gdbarch
!= NULL
);
1790 if (gdbarch_debug
>= 2)
1791 fprintf_unfiltered (gdb_stdlog
, "gdbarch_double_format called\n");
1792 return gdbarch
->double_format
;
1796 set_gdbarch_double_format (struct gdbarch
*gdbarch
,
1797 const struct floatformat
* double_format
)
1799 gdbarch
->double_format
= double_format
;
1803 gdbarch_long_double_bit (struct gdbarch
*gdbarch
)
1805 gdb_assert (gdbarch
!= NULL
);
1806 /* Skip verify of long_double_bit, invalid_p == 0 */
1807 if (gdbarch_debug
>= 2)
1808 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_bit called\n");
1809 return gdbarch
->long_double_bit
;
1813 set_gdbarch_long_double_bit (struct gdbarch
*gdbarch
,
1814 int long_double_bit
)
1816 gdbarch
->long_double_bit
= long_double_bit
;
1819 const struct floatformat
*
1820 gdbarch_long_double_format (struct gdbarch
*gdbarch
)
1822 gdb_assert (gdbarch
!= NULL
);
1823 if (gdbarch_debug
>= 2)
1824 fprintf_unfiltered (gdb_stdlog
, "gdbarch_long_double_format called\n");
1825 return gdbarch
->long_double_format
;
1829 set_gdbarch_long_double_format (struct gdbarch
*gdbarch
,
1830 const struct floatformat
* long_double_format
)
1832 gdbarch
->long_double_format
= long_double_format
;
1836 gdbarch_ptr_bit (struct gdbarch
*gdbarch
)
1838 gdb_assert (gdbarch
!= NULL
);
1839 /* Skip verify of ptr_bit, invalid_p == 0 */
1840 if (gdbarch_debug
>= 2)
1841 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ptr_bit called\n");
1842 return gdbarch
->ptr_bit
;
1846 set_gdbarch_ptr_bit (struct gdbarch
*gdbarch
,
1849 gdbarch
->ptr_bit
= ptr_bit
;
1853 gdbarch_addr_bit (struct gdbarch
*gdbarch
)
1855 gdb_assert (gdbarch
!= NULL
);
1856 /* Check variable changed from pre-default. */
1857 gdb_assert (gdbarch
->addr_bit
!= 0);
1858 if (gdbarch_debug
>= 2)
1859 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bit called\n");
1860 return gdbarch
->addr_bit
;
1864 set_gdbarch_addr_bit (struct gdbarch
*gdbarch
,
1867 gdbarch
->addr_bit
= addr_bit
;
1871 gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
)
1873 gdb_assert (gdbarch
!= NULL
);
1874 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
1875 if (gdbarch_debug
>= 2)
1876 fprintf_unfiltered (gdb_stdlog
, "gdbarch_bfd_vma_bit called\n");
1877 return gdbarch
->bfd_vma_bit
;
1881 set_gdbarch_bfd_vma_bit (struct gdbarch
*gdbarch
,
1884 gdbarch
->bfd_vma_bit
= bfd_vma_bit
;
1888 gdbarch_char_signed (struct gdbarch
*gdbarch
)
1890 gdb_assert (gdbarch
!= NULL
);
1891 /* Check variable changed from pre-default. */
1892 gdb_assert (gdbarch
->char_signed
!= -1);
1893 if (gdbarch_debug
>= 2)
1894 fprintf_unfiltered (gdb_stdlog
, "gdbarch_char_signed called\n");
1895 return gdbarch
->char_signed
;
1899 set_gdbarch_char_signed (struct gdbarch
*gdbarch
,
1902 gdbarch
->char_signed
= char_signed
;
1906 gdbarch_read_pc_p (struct gdbarch
*gdbarch
)
1908 gdb_assert (gdbarch
!= NULL
);
1909 return gdbarch
->read_pc
!= NULL
;
1913 gdbarch_read_pc (struct gdbarch
*gdbarch
, ptid_t ptid
)
1915 gdb_assert (gdbarch
!= NULL
);
1916 gdb_assert (gdbarch
->read_pc
!= NULL
);
1917 if (gdbarch_debug
>= 2)
1918 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_pc called\n");
1919 return gdbarch
->read_pc (ptid
);
1923 set_gdbarch_read_pc (struct gdbarch
*gdbarch
,
1924 gdbarch_read_pc_ftype read_pc
)
1926 gdbarch
->read_pc
= read_pc
;
1930 gdbarch_write_pc (struct gdbarch
*gdbarch
, CORE_ADDR val
, ptid_t ptid
)
1932 gdb_assert (gdbarch
!= NULL
);
1933 gdb_assert (gdbarch
->write_pc
!= NULL
);
1934 if (gdbarch_debug
>= 2)
1935 fprintf_unfiltered (gdb_stdlog
, "gdbarch_write_pc called\n");
1936 gdbarch
->write_pc (val
, ptid
);
1940 set_gdbarch_write_pc (struct gdbarch
*gdbarch
,
1941 gdbarch_write_pc_ftype write_pc
)
1943 gdbarch
->write_pc
= write_pc
;
1947 gdbarch_read_sp_p (struct gdbarch
*gdbarch
)
1949 gdb_assert (gdbarch
!= NULL
);
1950 return gdbarch
->read_sp
!= NULL
;
1954 gdbarch_read_sp (struct gdbarch
*gdbarch
)
1956 gdb_assert (gdbarch
!= NULL
);
1957 gdb_assert (gdbarch
->read_sp
!= NULL
);
1958 if (gdbarch_debug
>= 2)
1959 fprintf_unfiltered (gdb_stdlog
, "gdbarch_read_sp called\n");
1960 return gdbarch
->read_sp ();
1964 set_gdbarch_read_sp (struct gdbarch
*gdbarch
,
1965 gdbarch_read_sp_ftype read_sp
)
1967 gdbarch
->read_sp
= read_sp
;
1971 gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
, CORE_ADDR pc
, int *frame_regnum
, LONGEST
*frame_offset
)
1973 gdb_assert (gdbarch
!= NULL
);
1974 gdb_assert (gdbarch
->virtual_frame_pointer
!= NULL
);
1975 if (gdbarch_debug
>= 2)
1976 fprintf_unfiltered (gdb_stdlog
, "gdbarch_virtual_frame_pointer called\n");
1977 gdbarch
->virtual_frame_pointer (pc
, frame_regnum
, frame_offset
);
1981 set_gdbarch_virtual_frame_pointer (struct gdbarch
*gdbarch
,
1982 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer
)
1984 gdbarch
->virtual_frame_pointer
= virtual_frame_pointer
;
1988 gdbarch_pseudo_register_read_p (struct gdbarch
*gdbarch
)
1990 gdb_assert (gdbarch
!= NULL
);
1991 return gdbarch
->pseudo_register_read
!= NULL
;
1995 gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, void *buf
)
1997 gdb_assert (gdbarch
!= NULL
);
1998 gdb_assert (gdbarch
->pseudo_register_read
!= NULL
);
1999 if (gdbarch_debug
>= 2)
2000 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_read called\n");
2001 gdbarch
->pseudo_register_read (gdbarch
, regcache
, cookednum
, buf
);
2005 set_gdbarch_pseudo_register_read (struct gdbarch
*gdbarch
,
2006 gdbarch_pseudo_register_read_ftype pseudo_register_read
)
2008 gdbarch
->pseudo_register_read
= pseudo_register_read
;
2012 gdbarch_pseudo_register_write_p (struct gdbarch
*gdbarch
)
2014 gdb_assert (gdbarch
!= NULL
);
2015 return gdbarch
->pseudo_register_write
!= NULL
;
2019 gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
, struct regcache
*regcache
, int cookednum
, const void *buf
)
2021 gdb_assert (gdbarch
!= NULL
);
2022 gdb_assert (gdbarch
->pseudo_register_write
!= NULL
);
2023 if (gdbarch_debug
>= 2)
2024 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pseudo_register_write called\n");
2025 gdbarch
->pseudo_register_write (gdbarch
, regcache
, cookednum
, buf
);
2029 set_gdbarch_pseudo_register_write (struct gdbarch
*gdbarch
,
2030 gdbarch_pseudo_register_write_ftype pseudo_register_write
)
2032 gdbarch
->pseudo_register_write
= pseudo_register_write
;
2036 gdbarch_num_regs (struct gdbarch
*gdbarch
)
2038 gdb_assert (gdbarch
!= NULL
);
2039 /* Check variable changed from pre-default. */
2040 gdb_assert (gdbarch
->num_regs
!= -1);
2041 if (gdbarch_debug
>= 2)
2042 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_regs called\n");
2043 return gdbarch
->num_regs
;
2047 set_gdbarch_num_regs (struct gdbarch
*gdbarch
,
2050 gdbarch
->num_regs
= num_regs
;
2054 gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
)
2056 gdb_assert (gdbarch
!= NULL
);
2057 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2058 if (gdbarch_debug
>= 2)
2059 fprintf_unfiltered (gdb_stdlog
, "gdbarch_num_pseudo_regs called\n");
2060 return gdbarch
->num_pseudo_regs
;
2064 set_gdbarch_num_pseudo_regs (struct gdbarch
*gdbarch
,
2065 int num_pseudo_regs
)
2067 gdbarch
->num_pseudo_regs
= num_pseudo_regs
;
2071 gdbarch_sp_regnum (struct gdbarch
*gdbarch
)
2073 gdb_assert (gdbarch
!= NULL
);
2074 /* Skip verify of sp_regnum, invalid_p == 0 */
2075 if (gdbarch_debug
>= 2)
2076 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sp_regnum called\n");
2077 return gdbarch
->sp_regnum
;
2081 set_gdbarch_sp_regnum (struct gdbarch
*gdbarch
,
2084 gdbarch
->sp_regnum
= sp_regnum
;
2088 gdbarch_pc_regnum (struct gdbarch
*gdbarch
)
2090 gdb_assert (gdbarch
!= NULL
);
2091 /* Skip verify of pc_regnum, invalid_p == 0 */
2092 if (gdbarch_debug
>= 2)
2093 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pc_regnum called\n");
2094 return gdbarch
->pc_regnum
;
2098 set_gdbarch_pc_regnum (struct gdbarch
*gdbarch
,
2101 gdbarch
->pc_regnum
= pc_regnum
;
2105 gdbarch_ps_regnum (struct gdbarch
*gdbarch
)
2107 gdb_assert (gdbarch
!= NULL
);
2108 /* Skip verify of ps_regnum, invalid_p == 0 */
2109 if (gdbarch_debug
>= 2)
2110 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ps_regnum called\n");
2111 return gdbarch
->ps_regnum
;
2115 set_gdbarch_ps_regnum (struct gdbarch
*gdbarch
,
2118 gdbarch
->ps_regnum
= ps_regnum
;
2122 gdbarch_fp0_regnum (struct gdbarch
*gdbarch
)
2124 gdb_assert (gdbarch
!= NULL
);
2125 /* Skip verify of fp0_regnum, invalid_p == 0 */
2126 if (gdbarch_debug
>= 2)
2127 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fp0_regnum called\n");
2128 return gdbarch
->fp0_regnum
;
2132 set_gdbarch_fp0_regnum (struct gdbarch
*gdbarch
,
2135 gdbarch
->fp0_regnum
= fp0_regnum
;
2139 gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
, int stab_regnr
)
2141 gdb_assert (gdbarch
!= NULL
);
2142 gdb_assert (gdbarch
->stab_reg_to_regnum
!= NULL
);
2143 if (gdbarch_debug
>= 2)
2144 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stab_reg_to_regnum called\n");
2145 return gdbarch
->stab_reg_to_regnum (stab_regnr
);
2149 set_gdbarch_stab_reg_to_regnum (struct gdbarch
*gdbarch
,
2150 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum
)
2152 gdbarch
->stab_reg_to_regnum
= stab_reg_to_regnum
;
2156 gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
, int ecoff_regnr
)
2158 gdb_assert (gdbarch
!= NULL
);
2159 gdb_assert (gdbarch
->ecoff_reg_to_regnum
!= NULL
);
2160 if (gdbarch_debug
>= 2)
2161 fprintf_unfiltered (gdb_stdlog
, "gdbarch_ecoff_reg_to_regnum called\n");
2162 return gdbarch
->ecoff_reg_to_regnum (ecoff_regnr
);
2166 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch
*gdbarch
,
2167 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum
)
2169 gdbarch
->ecoff_reg_to_regnum
= ecoff_reg_to_regnum
;
2173 gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf_regnr
)
2175 gdb_assert (gdbarch
!= NULL
);
2176 gdb_assert (gdbarch
->dwarf_reg_to_regnum
!= NULL
);
2177 if (gdbarch_debug
>= 2)
2178 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf_reg_to_regnum called\n");
2179 return gdbarch
->dwarf_reg_to_regnum (dwarf_regnr
);
2183 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch
*gdbarch
,
2184 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum
)
2186 gdbarch
->dwarf_reg_to_regnum
= dwarf_reg_to_regnum
;
2190 gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
, int sdb_regnr
)
2192 gdb_assert (gdbarch
!= NULL
);
2193 gdb_assert (gdbarch
->sdb_reg_to_regnum
!= NULL
);
2194 if (gdbarch_debug
>= 2)
2195 fprintf_unfiltered (gdb_stdlog
, "gdbarch_sdb_reg_to_regnum called\n");
2196 return gdbarch
->sdb_reg_to_regnum (sdb_regnr
);
2200 set_gdbarch_sdb_reg_to_regnum (struct gdbarch
*gdbarch
,
2201 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum
)
2203 gdbarch
->sdb_reg_to_regnum
= sdb_reg_to_regnum
;
2207 gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
, int dwarf2_regnr
)
2209 gdb_assert (gdbarch
!= NULL
);
2210 gdb_assert (gdbarch
->dwarf2_reg_to_regnum
!= NULL
);
2211 if (gdbarch_debug
>= 2)
2212 fprintf_unfiltered (gdb_stdlog
, "gdbarch_dwarf2_reg_to_regnum called\n");
2213 return gdbarch
->dwarf2_reg_to_regnum (dwarf2_regnr
);
2217 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch
*gdbarch
,
2218 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum
)
2220 gdbarch
->dwarf2_reg_to_regnum
= dwarf2_reg_to_regnum
;
2224 gdbarch_register_name (struct gdbarch
*gdbarch
, int regnr
)
2226 gdb_assert (gdbarch
!= NULL
);
2227 gdb_assert (gdbarch
->register_name
!= NULL
);
2228 if (gdbarch_debug
>= 2)
2229 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_name called\n");
2230 return gdbarch
->register_name (regnr
);
2234 set_gdbarch_register_name (struct gdbarch
*gdbarch
,
2235 gdbarch_register_name_ftype register_name
)
2237 gdbarch
->register_name
= register_name
;
2241 gdbarch_register_type_p (struct gdbarch
*gdbarch
)
2243 gdb_assert (gdbarch
!= NULL
);
2244 return gdbarch
->register_type
!= NULL
;
2248 gdbarch_register_type (struct gdbarch
*gdbarch
, int reg_nr
)
2250 gdb_assert (gdbarch
!= NULL
);
2251 gdb_assert (gdbarch
->register_type
!= NULL
);
2252 if (gdbarch_debug
>= 2)
2253 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_type called\n");
2254 return gdbarch
->register_type (gdbarch
, reg_nr
);
2258 set_gdbarch_register_type (struct gdbarch
*gdbarch
,
2259 gdbarch_register_type_ftype register_type
)
2261 gdbarch
->register_type
= register_type
;
2265 gdbarch_deprecated_register_byte_p (struct gdbarch
*gdbarch
)
2267 gdb_assert (gdbarch
!= NULL
);
2268 return gdbarch
->deprecated_register_byte
!= generic_register_byte
;
2272 gdbarch_deprecated_register_byte (struct gdbarch
*gdbarch
, int reg_nr
)
2274 gdb_assert (gdbarch
!= NULL
);
2275 gdb_assert (gdbarch
->deprecated_register_byte
!= NULL
);
2276 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2277 if (gdbarch_debug
>= 2)
2278 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_byte called\n");
2279 return gdbarch
->deprecated_register_byte (reg_nr
);
2283 set_gdbarch_deprecated_register_byte (struct gdbarch
*gdbarch
,
2284 gdbarch_deprecated_register_byte_ftype deprecated_register_byte
)
2286 gdbarch
->deprecated_register_byte
= deprecated_register_byte
;
2290 gdbarch_unwind_dummy_id_p (struct gdbarch
*gdbarch
)
2292 gdb_assert (gdbarch
!= NULL
);
2293 return gdbarch
->unwind_dummy_id
!= NULL
;
2297 gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
, struct frame_info
*info
)
2299 gdb_assert (gdbarch
!= NULL
);
2300 gdb_assert (gdbarch
->unwind_dummy_id
!= NULL
);
2301 if (gdbarch_debug
>= 2)
2302 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_dummy_id called\n");
2303 return gdbarch
->unwind_dummy_id (gdbarch
, info
);
2307 set_gdbarch_unwind_dummy_id (struct gdbarch
*gdbarch
,
2308 gdbarch_unwind_dummy_id_ftype unwind_dummy_id
)
2310 gdbarch
->unwind_dummy_id
= unwind_dummy_id
;
2314 gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
)
2316 gdb_assert (gdbarch
!= NULL
);
2317 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2318 if (gdbarch_debug
>= 2)
2319 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_fp_regnum called\n");
2320 return gdbarch
->deprecated_fp_regnum
;
2324 set_gdbarch_deprecated_fp_regnum (struct gdbarch
*gdbarch
,
2325 int deprecated_fp_regnum
)
2327 gdbarch
->deprecated_fp_regnum
= deprecated_fp_regnum
;
2331 gdbarch_push_dummy_call_p (struct gdbarch
*gdbarch
)
2333 gdb_assert (gdbarch
!= NULL
);
2334 return gdbarch
->push_dummy_call
!= NULL
;
2338 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
)
2340 gdb_assert (gdbarch
!= NULL
);
2341 gdb_assert (gdbarch
->push_dummy_call
!= NULL
);
2342 if (gdbarch_debug
>= 2)
2343 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_call called\n");
2344 return gdbarch
->push_dummy_call (gdbarch
, function
, regcache
, bp_addr
, nargs
, args
, sp
, struct_return
, struct_addr
);
2348 set_gdbarch_push_dummy_call (struct gdbarch
*gdbarch
,
2349 gdbarch_push_dummy_call_ftype push_dummy_call
)
2351 gdbarch
->push_dummy_call
= push_dummy_call
;
2355 gdbarch_deprecated_push_arguments_p (struct gdbarch
*gdbarch
)
2357 gdb_assert (gdbarch
!= NULL
);
2358 return gdbarch
->deprecated_push_arguments
!= NULL
;
2362 gdbarch_deprecated_push_arguments (struct gdbarch
*gdbarch
, int nargs
, struct value
**args
, CORE_ADDR sp
, int struct_return
, CORE_ADDR struct_addr
)
2364 gdb_assert (gdbarch
!= NULL
);
2365 gdb_assert (gdbarch
->deprecated_push_arguments
!= NULL
);
2366 if (gdbarch_debug
>= 2)
2367 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_push_arguments called\n");
2368 return gdbarch
->deprecated_push_arguments (nargs
, args
, sp
, struct_return
, struct_addr
);
2372 set_gdbarch_deprecated_push_arguments (struct gdbarch
*gdbarch
,
2373 gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments
)
2375 gdbarch
->deprecated_push_arguments
= deprecated_push_arguments
;
2379 gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
)
2381 gdb_assert (gdbarch
!= NULL
);
2382 if (gdbarch_debug
>= 2)
2383 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_register_size called\n");
2384 return gdbarch
->deprecated_register_size
;
2388 set_gdbarch_deprecated_register_size (struct gdbarch
*gdbarch
,
2389 int deprecated_register_size
)
2391 gdbarch
->deprecated_register_size
= deprecated_register_size
;
2395 gdbarch_call_dummy_location (struct gdbarch
*gdbarch
)
2397 gdb_assert (gdbarch
!= NULL
);
2398 /* Skip verify of call_dummy_location, invalid_p == 0 */
2399 if (gdbarch_debug
>= 2)
2400 fprintf_unfiltered (gdb_stdlog
, "gdbarch_call_dummy_location called\n");
2401 return gdbarch
->call_dummy_location
;
2405 set_gdbarch_call_dummy_location (struct gdbarch
*gdbarch
,
2406 int call_dummy_location
)
2408 gdbarch
->call_dummy_location
= call_dummy_location
;
2412 gdbarch_push_dummy_code_p (struct gdbarch
*gdbarch
)
2414 gdb_assert (gdbarch
!= NULL
);
2415 return gdbarch
->push_dummy_code
!= NULL
;
2419 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
)
2421 gdb_assert (gdbarch
!= NULL
);
2422 gdb_assert (gdbarch
->push_dummy_code
!= NULL
);
2423 if (gdbarch_debug
>= 2)
2424 fprintf_unfiltered (gdb_stdlog
, "gdbarch_push_dummy_code called\n");
2425 return gdbarch
->push_dummy_code (gdbarch
, sp
, funaddr
, using_gcc
, args
, nargs
, value_type
, real_pc
, bp_addr
);
2429 set_gdbarch_push_dummy_code (struct gdbarch
*gdbarch
,
2430 gdbarch_push_dummy_code_ftype push_dummy_code
)
2432 gdbarch
->push_dummy_code
= push_dummy_code
;
2436 gdbarch_print_registers_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, int regnum
, int all
)
2438 gdb_assert (gdbarch
!= NULL
);
2439 gdb_assert (gdbarch
->print_registers_info
!= NULL
);
2440 if (gdbarch_debug
>= 2)
2441 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_registers_info called\n");
2442 gdbarch
->print_registers_info (gdbarch
, file
, frame
, regnum
, all
);
2446 set_gdbarch_print_registers_info (struct gdbarch
*gdbarch
,
2447 gdbarch_print_registers_info_ftype print_registers_info
)
2449 gdbarch
->print_registers_info
= print_registers_info
;
2453 gdbarch_print_float_info_p (struct gdbarch
*gdbarch
)
2455 gdb_assert (gdbarch
!= NULL
);
2456 return gdbarch
->print_float_info
!= NULL
;
2460 gdbarch_print_float_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2462 gdb_assert (gdbarch
!= NULL
);
2463 gdb_assert (gdbarch
->print_float_info
!= NULL
);
2464 if (gdbarch_debug
>= 2)
2465 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_float_info called\n");
2466 gdbarch
->print_float_info (gdbarch
, file
, frame
, args
);
2470 set_gdbarch_print_float_info (struct gdbarch
*gdbarch
,
2471 gdbarch_print_float_info_ftype print_float_info
)
2473 gdbarch
->print_float_info
= print_float_info
;
2477 gdbarch_print_vector_info_p (struct gdbarch
*gdbarch
)
2479 gdb_assert (gdbarch
!= NULL
);
2480 return gdbarch
->print_vector_info
!= NULL
;
2484 gdbarch_print_vector_info (struct gdbarch
*gdbarch
, struct ui_file
*file
, struct frame_info
*frame
, const char *args
)
2486 gdb_assert (gdbarch
!= NULL
);
2487 gdb_assert (gdbarch
->print_vector_info
!= NULL
);
2488 if (gdbarch_debug
>= 2)
2489 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_vector_info called\n");
2490 gdbarch
->print_vector_info (gdbarch
, file
, frame
, args
);
2494 set_gdbarch_print_vector_info (struct gdbarch
*gdbarch
,
2495 gdbarch_print_vector_info_ftype print_vector_info
)
2497 gdbarch
->print_vector_info
= print_vector_info
;
2501 gdbarch_register_sim_regno (struct gdbarch
*gdbarch
, int reg_nr
)
2503 gdb_assert (gdbarch
!= NULL
);
2504 gdb_assert (gdbarch
->register_sim_regno
!= NULL
);
2505 if (gdbarch_debug
>= 2)
2506 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_sim_regno called\n");
2507 return gdbarch
->register_sim_regno (reg_nr
);
2511 set_gdbarch_register_sim_regno (struct gdbarch
*gdbarch
,
2512 gdbarch_register_sim_regno_ftype register_sim_regno
)
2514 gdbarch
->register_sim_regno
= register_sim_regno
;
2518 gdbarch_register_bytes_ok_p (struct gdbarch
*gdbarch
)
2520 gdb_assert (gdbarch
!= NULL
);
2521 return gdbarch
->register_bytes_ok
!= NULL
;
2525 gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
, long nr_bytes
)
2527 gdb_assert (gdbarch
!= NULL
);
2528 gdb_assert (gdbarch
->register_bytes_ok
!= NULL
);
2529 if (gdbarch_debug
>= 2)
2530 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_bytes_ok called\n");
2531 return gdbarch
->register_bytes_ok (nr_bytes
);
2535 set_gdbarch_register_bytes_ok (struct gdbarch
*gdbarch
,
2536 gdbarch_register_bytes_ok_ftype register_bytes_ok
)
2538 gdbarch
->register_bytes_ok
= register_bytes_ok
;
2542 gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
, int regnum
)
2544 gdb_assert (gdbarch
!= NULL
);
2545 gdb_assert (gdbarch
->cannot_fetch_register
!= NULL
);
2546 if (gdbarch_debug
>= 2)
2547 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_fetch_register called\n");
2548 return gdbarch
->cannot_fetch_register (regnum
);
2552 set_gdbarch_cannot_fetch_register (struct gdbarch
*gdbarch
,
2553 gdbarch_cannot_fetch_register_ftype cannot_fetch_register
)
2555 gdbarch
->cannot_fetch_register
= cannot_fetch_register
;
2559 gdbarch_cannot_store_register (struct gdbarch
*gdbarch
, int regnum
)
2561 gdb_assert (gdbarch
!= NULL
);
2562 gdb_assert (gdbarch
->cannot_store_register
!= NULL
);
2563 if (gdbarch_debug
>= 2)
2564 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_store_register called\n");
2565 return gdbarch
->cannot_store_register (regnum
);
2569 set_gdbarch_cannot_store_register (struct gdbarch
*gdbarch
,
2570 gdbarch_cannot_store_register_ftype cannot_store_register
)
2572 gdbarch
->cannot_store_register
= cannot_store_register
;
2576 gdbarch_get_longjmp_target_p (struct gdbarch
*gdbarch
)
2578 gdb_assert (gdbarch
!= NULL
);
2579 return gdbarch
->get_longjmp_target
!= NULL
;
2583 gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
, CORE_ADDR
*pc
)
2585 gdb_assert (gdbarch
!= NULL
);
2586 gdb_assert (gdbarch
->get_longjmp_target
!= NULL
);
2587 if (gdbarch_debug
>= 2)
2588 fprintf_unfiltered (gdb_stdlog
, "gdbarch_get_longjmp_target called\n");
2589 return gdbarch
->get_longjmp_target (pc
);
2593 set_gdbarch_get_longjmp_target (struct gdbarch
*gdbarch
,
2594 gdbarch_get_longjmp_target_ftype get_longjmp_target
)
2596 gdbarch
->get_longjmp_target
= get_longjmp_target
;
2600 gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
)
2602 gdb_assert (gdbarch
!= NULL
);
2603 if (gdbarch_debug
>= 2)
2604 fprintf_unfiltered (gdb_stdlog
, "gdbarch_believe_pcc_promotion called\n");
2605 return gdbarch
->believe_pcc_promotion
;
2609 set_gdbarch_believe_pcc_promotion (struct gdbarch
*gdbarch
,
2610 int believe_pcc_promotion
)
2612 gdbarch
->believe_pcc_promotion
= believe_pcc_promotion
;
2616 gdbarch_convert_register_p (struct gdbarch
*gdbarch
, int regnum
, struct type
*type
)
2618 gdb_assert (gdbarch
!= NULL
);
2619 gdb_assert (gdbarch
->convert_register_p
!= NULL
);
2620 if (gdbarch_debug
>= 2)
2621 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_register_p called\n");
2622 return gdbarch
->convert_register_p (regnum
, type
);
2626 set_gdbarch_convert_register_p (struct gdbarch
*gdbarch
,
2627 gdbarch_convert_register_p_ftype convert_register_p
)
2629 gdbarch
->convert_register_p
= convert_register_p
;
2633 gdbarch_register_to_value (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, void *buf
)
2635 gdb_assert (gdbarch
!= NULL
);
2636 gdb_assert (gdbarch
->register_to_value
!= NULL
);
2637 if (gdbarch_debug
>= 2)
2638 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_to_value called\n");
2639 gdbarch
->register_to_value (frame
, regnum
, type
, buf
);
2643 set_gdbarch_register_to_value (struct gdbarch
*gdbarch
,
2644 gdbarch_register_to_value_ftype register_to_value
)
2646 gdbarch
->register_to_value
= register_to_value
;
2650 gdbarch_value_to_register (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int regnum
, struct type
*type
, const void *buf
)
2652 gdb_assert (gdbarch
!= NULL
);
2653 gdb_assert (gdbarch
->value_to_register
!= NULL
);
2654 if (gdbarch_debug
>= 2)
2655 fprintf_unfiltered (gdb_stdlog
, "gdbarch_value_to_register called\n");
2656 gdbarch
->value_to_register (frame
, regnum
, type
, buf
);
2660 set_gdbarch_value_to_register (struct gdbarch
*gdbarch
,
2661 gdbarch_value_to_register_ftype value_to_register
)
2663 gdbarch
->value_to_register
= value_to_register
;
2667 gdbarch_pointer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, const void *buf
)
2669 gdb_assert (gdbarch
!= NULL
);
2670 gdb_assert (gdbarch
->pointer_to_address
!= NULL
);
2671 if (gdbarch_debug
>= 2)
2672 fprintf_unfiltered (gdb_stdlog
, "gdbarch_pointer_to_address called\n");
2673 return gdbarch
->pointer_to_address (type
, buf
);
2677 set_gdbarch_pointer_to_address (struct gdbarch
*gdbarch
,
2678 gdbarch_pointer_to_address_ftype pointer_to_address
)
2680 gdbarch
->pointer_to_address
= pointer_to_address
;
2684 gdbarch_address_to_pointer (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
, CORE_ADDR addr
)
2686 gdb_assert (gdbarch
!= NULL
);
2687 gdb_assert (gdbarch
->address_to_pointer
!= NULL
);
2688 if (gdbarch_debug
>= 2)
2689 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_to_pointer called\n");
2690 gdbarch
->address_to_pointer (type
, buf
, addr
);
2694 set_gdbarch_address_to_pointer (struct gdbarch
*gdbarch
,
2695 gdbarch_address_to_pointer_ftype address_to_pointer
)
2697 gdbarch
->address_to_pointer
= address_to_pointer
;
2701 gdbarch_integer_to_address_p (struct gdbarch
*gdbarch
)
2703 gdb_assert (gdbarch
!= NULL
);
2704 return gdbarch
->integer_to_address
!= NULL
;
2708 gdbarch_integer_to_address (struct gdbarch
*gdbarch
, struct type
*type
, void *buf
)
2710 gdb_assert (gdbarch
!= NULL
);
2711 gdb_assert (gdbarch
->integer_to_address
!= NULL
);
2712 if (gdbarch_debug
>= 2)
2713 fprintf_unfiltered (gdb_stdlog
, "gdbarch_integer_to_address called\n");
2714 return gdbarch
->integer_to_address (type
, buf
);
2718 set_gdbarch_integer_to_address (struct gdbarch
*gdbarch
,
2719 gdbarch_integer_to_address_ftype integer_to_address
)
2721 gdbarch
->integer_to_address
= integer_to_address
;
2725 gdbarch_deprecated_store_struct_return_p (struct gdbarch
*gdbarch
)
2727 gdb_assert (gdbarch
!= NULL
);
2728 return gdbarch
->deprecated_store_struct_return
!= NULL
;
2732 gdbarch_deprecated_store_struct_return (struct gdbarch
*gdbarch
, CORE_ADDR addr
, CORE_ADDR sp
)
2734 gdb_assert (gdbarch
!= NULL
);
2735 gdb_assert (gdbarch
->deprecated_store_struct_return
!= NULL
);
2736 if (gdbarch_debug
>= 2)
2737 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_store_struct_return called\n");
2738 gdbarch
->deprecated_store_struct_return (addr
, sp
);
2742 set_gdbarch_deprecated_store_struct_return (struct gdbarch
*gdbarch
,
2743 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return
)
2745 gdbarch
->deprecated_store_struct_return
= deprecated_store_struct_return
;
2749 gdbarch_return_value_p (struct gdbarch
*gdbarch
)
2751 gdb_assert (gdbarch
!= NULL
);
2752 return gdbarch
->return_value
!= legacy_return_value
;
2755 enum return_value_convention
2756 gdbarch_return_value (struct gdbarch
*gdbarch
, struct type
*valtype
, struct regcache
*regcache
, void *readbuf
, const void *writebuf
)
2758 gdb_assert (gdbarch
!= NULL
);
2759 gdb_assert (gdbarch
->return_value
!= NULL
);
2760 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
2761 if (gdbarch_debug
>= 2)
2762 fprintf_unfiltered (gdb_stdlog
, "gdbarch_return_value called\n");
2763 return gdbarch
->return_value (gdbarch
, valtype
, regcache
, readbuf
, writebuf
);
2767 set_gdbarch_return_value (struct gdbarch
*gdbarch
,
2768 gdbarch_return_value_ftype return_value
)
2770 gdbarch
->return_value
= return_value
;
2774 gdbarch_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, void *valbuf
)
2776 gdb_assert (gdbarch
!= NULL
);
2777 gdb_assert (gdbarch
->extract_return_value
!= NULL
);
2778 if (gdbarch_debug
>= 2)
2779 fprintf_unfiltered (gdb_stdlog
, "gdbarch_extract_return_value called\n");
2780 gdbarch
->extract_return_value (type
, regcache
, valbuf
);
2784 set_gdbarch_extract_return_value (struct gdbarch
*gdbarch
,
2785 gdbarch_extract_return_value_ftype extract_return_value
)
2787 gdbarch
->extract_return_value
= extract_return_value
;
2791 gdbarch_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, struct regcache
*regcache
, const void *valbuf
)
2793 gdb_assert (gdbarch
!= NULL
);
2794 gdb_assert (gdbarch
->store_return_value
!= NULL
);
2795 if (gdbarch_debug
>= 2)
2796 fprintf_unfiltered (gdb_stdlog
, "gdbarch_store_return_value called\n");
2797 gdbarch
->store_return_value (type
, regcache
, valbuf
);
2801 set_gdbarch_store_return_value (struct gdbarch
*gdbarch
,
2802 gdbarch_store_return_value_ftype store_return_value
)
2804 gdbarch
->store_return_value
= store_return_value
;
2808 gdbarch_deprecated_extract_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *regbuf
, char *valbuf
)
2810 gdb_assert (gdbarch
!= NULL
);
2811 gdb_assert (gdbarch
->deprecated_extract_return_value
!= NULL
);
2812 if (gdbarch_debug
>= 2)
2813 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_extract_return_value called\n");
2814 gdbarch
->deprecated_extract_return_value (type
, regbuf
, valbuf
);
2818 set_gdbarch_deprecated_extract_return_value (struct gdbarch
*gdbarch
,
2819 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value
)
2821 gdbarch
->deprecated_extract_return_value
= deprecated_extract_return_value
;
2825 gdbarch_deprecated_store_return_value (struct gdbarch
*gdbarch
, struct type
*type
, char *valbuf
)
2827 gdb_assert (gdbarch
!= NULL
);
2828 gdb_assert (gdbarch
->deprecated_store_return_value
!= NULL
);
2829 if (gdbarch_debug
>= 2)
2830 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_store_return_value called\n");
2831 gdbarch
->deprecated_store_return_value (type
, valbuf
);
2835 set_gdbarch_deprecated_store_return_value (struct gdbarch
*gdbarch
,
2836 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value
)
2838 gdbarch
->deprecated_store_return_value
= deprecated_store_return_value
;
2842 gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*value_type
)
2844 gdb_assert (gdbarch
!= NULL
);
2845 gdb_assert (gdbarch
->deprecated_use_struct_convention
!= NULL
);
2846 if (gdbarch_debug
>= 2)
2847 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_use_struct_convention called\n");
2848 return gdbarch
->deprecated_use_struct_convention (gcc_p
, value_type
);
2852 set_gdbarch_deprecated_use_struct_convention (struct gdbarch
*gdbarch
,
2853 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention
)
2855 gdbarch
->deprecated_use_struct_convention
= deprecated_use_struct_convention
;
2859 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch
*gdbarch
)
2861 gdb_assert (gdbarch
!= NULL
);
2862 return gdbarch
->deprecated_extract_struct_value_address
!= NULL
;
2866 gdbarch_deprecated_extract_struct_value_address (struct gdbarch
*gdbarch
, struct regcache
*regcache
)
2868 gdb_assert (gdbarch
!= NULL
);
2869 gdb_assert (gdbarch
->deprecated_extract_struct_value_address
!= NULL
);
2870 if (gdbarch_debug
>= 2)
2871 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_extract_struct_value_address called\n");
2872 return gdbarch
->deprecated_extract_struct_value_address (regcache
);
2876 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch
*gdbarch
,
2877 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address
)
2879 gdbarch
->deprecated_extract_struct_value_address
= deprecated_extract_struct_value_address
;
2883 gdbarch_skip_prologue (struct gdbarch
*gdbarch
, CORE_ADDR ip
)
2885 gdb_assert (gdbarch
!= NULL
);
2886 gdb_assert (gdbarch
->skip_prologue
!= NULL
);
2887 if (gdbarch_debug
>= 2)
2888 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_prologue called\n");
2889 return gdbarch
->skip_prologue (ip
);
2893 set_gdbarch_skip_prologue (struct gdbarch
*gdbarch
,
2894 gdbarch_skip_prologue_ftype skip_prologue
)
2896 gdbarch
->skip_prologue
= skip_prologue
;
2900 gdbarch_inner_than (struct gdbarch
*gdbarch
, CORE_ADDR lhs
, CORE_ADDR rhs
)
2902 gdb_assert (gdbarch
!= NULL
);
2903 gdb_assert (gdbarch
->inner_than
!= NULL
);
2904 if (gdbarch_debug
>= 2)
2905 fprintf_unfiltered (gdb_stdlog
, "gdbarch_inner_than called\n");
2906 return gdbarch
->inner_than (lhs
, rhs
);
2910 set_gdbarch_inner_than (struct gdbarch
*gdbarch
,
2911 gdbarch_inner_than_ftype inner_than
)
2913 gdbarch
->inner_than
= inner_than
;
2916 const unsigned char *
2917 gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
, CORE_ADDR
*pcptr
, int *lenptr
)
2919 gdb_assert (gdbarch
!= NULL
);
2920 gdb_assert (gdbarch
->breakpoint_from_pc
!= NULL
);
2921 if (gdbarch_debug
>= 2)
2922 fprintf_unfiltered (gdb_stdlog
, "gdbarch_breakpoint_from_pc called\n");
2923 return gdbarch
->breakpoint_from_pc (pcptr
, lenptr
);
2927 set_gdbarch_breakpoint_from_pc (struct gdbarch
*gdbarch
,
2928 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc
)
2930 gdbarch
->breakpoint_from_pc
= breakpoint_from_pc
;
2934 gdbarch_adjust_breakpoint_address_p (struct gdbarch
*gdbarch
)
2936 gdb_assert (gdbarch
!= NULL
);
2937 return gdbarch
->adjust_breakpoint_address
!= NULL
;
2941 gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
, CORE_ADDR bpaddr
)
2943 gdb_assert (gdbarch
!= NULL
);
2944 gdb_assert (gdbarch
->adjust_breakpoint_address
!= NULL
);
2945 if (gdbarch_debug
>= 2)
2946 fprintf_unfiltered (gdb_stdlog
, "gdbarch_adjust_breakpoint_address called\n");
2947 return gdbarch
->adjust_breakpoint_address (gdbarch
, bpaddr
);
2951 set_gdbarch_adjust_breakpoint_address (struct gdbarch
*gdbarch
,
2952 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address
)
2954 gdbarch
->adjust_breakpoint_address
= adjust_breakpoint_address
;
2958 gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2960 gdb_assert (gdbarch
!= NULL
);
2961 gdb_assert (gdbarch
->memory_insert_breakpoint
!= NULL
);
2962 if (gdbarch_debug
>= 2)
2963 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_insert_breakpoint called\n");
2964 return gdbarch
->memory_insert_breakpoint (addr
, contents_cache
);
2968 set_gdbarch_memory_insert_breakpoint (struct gdbarch
*gdbarch
,
2969 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint
)
2971 gdbarch
->memory_insert_breakpoint
= memory_insert_breakpoint
;
2975 gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
, CORE_ADDR addr
, char *contents_cache
)
2977 gdb_assert (gdbarch
!= NULL
);
2978 gdb_assert (gdbarch
->memory_remove_breakpoint
!= NULL
);
2979 if (gdbarch_debug
>= 2)
2980 fprintf_unfiltered (gdb_stdlog
, "gdbarch_memory_remove_breakpoint called\n");
2981 return gdbarch
->memory_remove_breakpoint (addr
, contents_cache
);
2985 set_gdbarch_memory_remove_breakpoint (struct gdbarch
*gdbarch
,
2986 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint
)
2988 gdbarch
->memory_remove_breakpoint
= memory_remove_breakpoint
;
2992 gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
)
2994 gdb_assert (gdbarch
!= NULL
);
2995 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2996 if (gdbarch_debug
>= 2)
2997 fprintf_unfiltered (gdb_stdlog
, "gdbarch_decr_pc_after_break called\n");
2998 return gdbarch
->decr_pc_after_break
;
3002 set_gdbarch_decr_pc_after_break (struct gdbarch
*gdbarch
,
3003 CORE_ADDR decr_pc_after_break
)
3005 gdbarch
->decr_pc_after_break
= decr_pc_after_break
;
3009 gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
)
3011 gdb_assert (gdbarch
!= NULL
);
3012 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
3013 if (gdbarch_debug
>= 2)
3014 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_function_start_offset called\n");
3015 return gdbarch
->deprecated_function_start_offset
;
3019 set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch
,
3020 CORE_ADDR deprecated_function_start_offset
)
3022 gdbarch
->deprecated_function_start_offset
= deprecated_function_start_offset
;
3026 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
)
3028 gdb_assert (gdbarch
!= NULL
);
3029 gdb_assert (gdbarch
->remote_translate_xfer_address
!= NULL
);
3030 if (gdbarch_debug
>= 2)
3031 fprintf_unfiltered (gdb_stdlog
, "gdbarch_remote_translate_xfer_address called\n");
3032 gdbarch
->remote_translate_xfer_address (gdbarch
, regcache
, gdb_addr
, gdb_len
, rem_addr
, rem_len
);
3036 set_gdbarch_remote_translate_xfer_address (struct gdbarch
*gdbarch
,
3037 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address
)
3039 gdbarch
->remote_translate_xfer_address
= remote_translate_xfer_address
;
3043 gdbarch_frame_args_skip (struct gdbarch
*gdbarch
)
3045 gdb_assert (gdbarch
!= NULL
);
3046 /* Skip verify of frame_args_skip, invalid_p == 0 */
3047 if (gdbarch_debug
>= 2)
3048 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_args_skip called\n");
3049 return gdbarch
->frame_args_skip
;
3053 set_gdbarch_frame_args_skip (struct gdbarch
*gdbarch
,
3054 CORE_ADDR frame_args_skip
)
3056 gdbarch
->frame_args_skip
= frame_args_skip
;
3060 gdbarch_unwind_pc_p (struct gdbarch
*gdbarch
)
3062 gdb_assert (gdbarch
!= NULL
);
3063 return gdbarch
->unwind_pc
!= NULL
;
3067 gdbarch_unwind_pc (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
3069 gdb_assert (gdbarch
!= NULL
);
3070 gdb_assert (gdbarch
->unwind_pc
!= NULL
);
3071 if (gdbarch_debug
>= 2)
3072 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_pc called\n");
3073 return gdbarch
->unwind_pc (gdbarch
, next_frame
);
3077 set_gdbarch_unwind_pc (struct gdbarch
*gdbarch
,
3078 gdbarch_unwind_pc_ftype unwind_pc
)
3080 gdbarch
->unwind_pc
= unwind_pc
;
3084 gdbarch_unwind_sp_p (struct gdbarch
*gdbarch
)
3086 gdb_assert (gdbarch
!= NULL
);
3087 return gdbarch
->unwind_sp
!= NULL
;
3091 gdbarch_unwind_sp (struct gdbarch
*gdbarch
, struct frame_info
*next_frame
)
3093 gdb_assert (gdbarch
!= NULL
);
3094 gdb_assert (gdbarch
->unwind_sp
!= NULL
);
3095 if (gdbarch_debug
>= 2)
3096 fprintf_unfiltered (gdb_stdlog
, "gdbarch_unwind_sp called\n");
3097 return gdbarch
->unwind_sp (gdbarch
, next_frame
);
3101 set_gdbarch_unwind_sp (struct gdbarch
*gdbarch
,
3102 gdbarch_unwind_sp_ftype unwind_sp
)
3104 gdbarch
->unwind_sp
= unwind_sp
;
3108 gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch
*gdbarch
)
3110 gdb_assert (gdbarch
!= NULL
);
3111 return gdbarch
->deprecated_saved_pc_after_call
!= NULL
;
3115 gdbarch_deprecated_saved_pc_after_call (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3117 gdb_assert (gdbarch
!= NULL
);
3118 gdb_assert (gdbarch
->deprecated_saved_pc_after_call
!= NULL
);
3119 if (gdbarch_debug
>= 2)
3120 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_saved_pc_after_call called\n");
3121 return gdbarch
->deprecated_saved_pc_after_call (frame
);
3125 set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch
*gdbarch
,
3126 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call
)
3128 gdbarch
->deprecated_saved_pc_after_call
= deprecated_saved_pc_after_call
;
3132 gdbarch_frame_num_args_p (struct gdbarch
*gdbarch
)
3134 gdb_assert (gdbarch
!= NULL
);
3135 return gdbarch
->frame_num_args
!= NULL
;
3139 gdbarch_frame_num_args (struct gdbarch
*gdbarch
, struct frame_info
*frame
)
3141 gdb_assert (gdbarch
!= NULL
);
3142 gdb_assert (gdbarch
->frame_num_args
!= NULL
);
3143 if (gdbarch_debug
>= 2)
3144 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_num_args called\n");
3145 return gdbarch
->frame_num_args (frame
);
3149 set_gdbarch_frame_num_args (struct gdbarch
*gdbarch
,
3150 gdbarch_frame_num_args_ftype frame_num_args
)
3152 gdbarch
->frame_num_args
= frame_num_args
;
3156 gdbarch_deprecated_stack_align_p (struct gdbarch
*gdbarch
)
3158 gdb_assert (gdbarch
!= NULL
);
3159 return gdbarch
->deprecated_stack_align
!= NULL
;
3163 gdbarch_deprecated_stack_align (struct gdbarch
*gdbarch
, CORE_ADDR sp
)
3165 gdb_assert (gdbarch
!= NULL
);
3166 gdb_assert (gdbarch
->deprecated_stack_align
!= NULL
);
3167 if (gdbarch_debug
>= 2)
3168 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_stack_align called\n");
3169 return gdbarch
->deprecated_stack_align (sp
);
3173 set_gdbarch_deprecated_stack_align (struct gdbarch
*gdbarch
,
3174 gdbarch_deprecated_stack_align_ftype deprecated_stack_align
)
3176 gdbarch
->deprecated_stack_align
= deprecated_stack_align
;
3180 gdbarch_frame_align_p (struct gdbarch
*gdbarch
)
3182 gdb_assert (gdbarch
!= NULL
);
3183 return gdbarch
->frame_align
!= NULL
;
3187 gdbarch_frame_align (struct gdbarch
*gdbarch
, CORE_ADDR address
)
3189 gdb_assert (gdbarch
!= NULL
);
3190 gdb_assert (gdbarch
->frame_align
!= NULL
);
3191 if (gdbarch_debug
>= 2)
3192 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_align called\n");
3193 return gdbarch
->frame_align (gdbarch
, address
);
3197 set_gdbarch_frame_align (struct gdbarch
*gdbarch
,
3198 gdbarch_frame_align_ftype frame_align
)
3200 gdbarch
->frame_align
= frame_align
;
3204 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch
*gdbarch
)
3206 gdb_assert (gdbarch
!= NULL
);
3207 return gdbarch
->deprecated_reg_struct_has_addr
!= NULL
;
3211 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
, int gcc_p
, struct type
*type
)
3213 gdb_assert (gdbarch
!= NULL
);
3214 gdb_assert (gdbarch
->deprecated_reg_struct_has_addr
!= NULL
);
3215 if (gdbarch_debug
>= 2)
3216 fprintf_unfiltered (gdb_stdlog
, "gdbarch_deprecated_reg_struct_has_addr called\n");
3217 return gdbarch
->deprecated_reg_struct_has_addr (gcc_p
, type
);
3221 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch
*gdbarch
,
3222 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr
)
3224 gdbarch
->deprecated_reg_struct_has_addr
= deprecated_reg_struct_has_addr
;
3228 gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
, struct type
*type
)
3230 gdb_assert (gdbarch
!= NULL
);
3231 gdb_assert (gdbarch
->stabs_argument_has_addr
!= NULL
);
3232 if (gdbarch_debug
>= 2)
3233 fprintf_unfiltered (gdb_stdlog
, "gdbarch_stabs_argument_has_addr called\n");
3234 return gdbarch
->stabs_argument_has_addr (gdbarch
, type
);
3238 set_gdbarch_stabs_argument_has_addr (struct gdbarch
*gdbarch
,
3239 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr
)
3241 gdbarch
->stabs_argument_has_addr
= stabs_argument_has_addr
;
3245 gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
)
3247 gdb_assert (gdbarch
!= NULL
);
3248 if (gdbarch_debug
>= 2)
3249 fprintf_unfiltered (gdb_stdlog
, "gdbarch_frame_red_zone_size called\n");
3250 return gdbarch
->frame_red_zone_size
;
3254 set_gdbarch_frame_red_zone_size (struct gdbarch
*gdbarch
,
3255 int frame_red_zone_size
)
3257 gdbarch
->frame_red_zone_size
= frame_red_zone_size
;
3261 gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
, CORE_ADDR addr
, struct target_ops
*targ
)
3263 gdb_assert (gdbarch
!= NULL
);
3264 gdb_assert (gdbarch
->convert_from_func_ptr_addr
!= NULL
);
3265 if (gdbarch_debug
>= 2)
3266 fprintf_unfiltered (gdb_stdlog
, "gdbarch_convert_from_func_ptr_addr called\n");
3267 return gdbarch
->convert_from_func_ptr_addr (gdbarch
, addr
, targ
);
3271 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch
*gdbarch
,
3272 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr
)
3274 gdbarch
->convert_from_func_ptr_addr
= convert_from_func_ptr_addr
;
3278 gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3280 gdb_assert (gdbarch
!= NULL
);
3281 gdb_assert (gdbarch
->addr_bits_remove
!= NULL
);
3282 if (gdbarch_debug
>= 2)
3283 fprintf_unfiltered (gdb_stdlog
, "gdbarch_addr_bits_remove called\n");
3284 return gdbarch
->addr_bits_remove (addr
);
3288 set_gdbarch_addr_bits_remove (struct gdbarch
*gdbarch
,
3289 gdbarch_addr_bits_remove_ftype addr_bits_remove
)
3291 gdbarch
->addr_bits_remove
= addr_bits_remove
;
3295 gdbarch_smash_text_address (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3297 gdb_assert (gdbarch
!= NULL
);
3298 gdb_assert (gdbarch
->smash_text_address
!= NULL
);
3299 if (gdbarch_debug
>= 2)
3300 fprintf_unfiltered (gdb_stdlog
, "gdbarch_smash_text_address called\n");
3301 return gdbarch
->smash_text_address (addr
);
3305 set_gdbarch_smash_text_address (struct gdbarch
*gdbarch
,
3306 gdbarch_smash_text_address_ftype smash_text_address
)
3308 gdbarch
->smash_text_address
= smash_text_address
;
3312 gdbarch_software_single_step_p (struct gdbarch
*gdbarch
)
3314 gdb_assert (gdbarch
!= NULL
);
3315 return gdbarch
->software_single_step
!= NULL
;
3319 gdbarch_software_single_step (struct gdbarch
*gdbarch
, enum target_signal sig
, int insert_breakpoints_p
)
3321 gdb_assert (gdbarch
!= NULL
);
3322 gdb_assert (gdbarch
->software_single_step
!= NULL
);
3323 if (gdbarch_debug
>= 2)
3324 fprintf_unfiltered (gdb_stdlog
, "gdbarch_software_single_step called\n");
3325 gdbarch
->software_single_step (sig
, insert_breakpoints_p
);
3329 set_gdbarch_software_single_step (struct gdbarch
*gdbarch
,
3330 gdbarch_software_single_step_ftype software_single_step
)
3332 gdbarch
->software_single_step
= software_single_step
;
3336 gdbarch_print_insn (struct gdbarch
*gdbarch
, bfd_vma vma
, struct disassemble_info
*info
)
3338 gdb_assert (gdbarch
!= NULL
);
3339 gdb_assert (gdbarch
->print_insn
!= NULL
);
3340 if (gdbarch_debug
>= 2)
3341 fprintf_unfiltered (gdb_stdlog
, "gdbarch_print_insn called\n");
3342 return gdbarch
->print_insn (vma
, info
);
3346 set_gdbarch_print_insn (struct gdbarch
*gdbarch
,
3347 gdbarch_print_insn_ftype print_insn
)
3349 gdbarch
->print_insn
= print_insn
;
3353 gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3355 gdb_assert (gdbarch
!= NULL
);
3356 gdb_assert (gdbarch
->skip_trampoline_code
!= NULL
);
3357 if (gdbarch_debug
>= 2)
3358 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_trampoline_code called\n");
3359 return gdbarch
->skip_trampoline_code (pc
);
3363 set_gdbarch_skip_trampoline_code (struct gdbarch
*gdbarch
,
3364 gdbarch_skip_trampoline_code_ftype skip_trampoline_code
)
3366 gdbarch
->skip_trampoline_code
= skip_trampoline_code
;
3370 gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
, CORE_ADDR pc
)
3372 gdb_assert (gdbarch
!= NULL
);
3373 gdb_assert (gdbarch
->skip_solib_resolver
!= NULL
);
3374 if (gdbarch_debug
>= 2)
3375 fprintf_unfiltered (gdb_stdlog
, "gdbarch_skip_solib_resolver called\n");
3376 return gdbarch
->skip_solib_resolver (gdbarch
, pc
);
3380 set_gdbarch_skip_solib_resolver (struct gdbarch
*gdbarch
,
3381 gdbarch_skip_solib_resolver_ftype skip_solib_resolver
)
3383 gdbarch
->skip_solib_resolver
= skip_solib_resolver
;
3387 gdbarch_in_solib_call_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
3389 gdb_assert (gdbarch
!= NULL
);
3390 gdb_assert (gdbarch
->in_solib_call_trampoline
!= NULL
);
3391 if (gdbarch_debug
>= 2)
3392 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_call_trampoline called\n");
3393 return gdbarch
->in_solib_call_trampoline (pc
, name
);
3397 set_gdbarch_in_solib_call_trampoline (struct gdbarch
*gdbarch
,
3398 gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline
)
3400 gdbarch
->in_solib_call_trampoline
= in_solib_call_trampoline
;
3404 gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
, CORE_ADDR pc
, char *name
)
3406 gdb_assert (gdbarch
!= NULL
);
3407 gdb_assert (gdbarch
->in_solib_return_trampoline
!= NULL
);
3408 if (gdbarch_debug
>= 2)
3409 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_solib_return_trampoline called\n");
3410 return gdbarch
->in_solib_return_trampoline (pc
, name
);
3414 set_gdbarch_in_solib_return_trampoline (struct gdbarch
*gdbarch
,
3415 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline
)
3417 gdbarch
->in_solib_return_trampoline
= in_solib_return_trampoline
;
3421 gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
, CORE_ADDR addr
)
3423 gdb_assert (gdbarch
!= NULL
);
3424 gdb_assert (gdbarch
->in_function_epilogue_p
!= NULL
);
3425 if (gdbarch_debug
>= 2)
3426 fprintf_unfiltered (gdb_stdlog
, "gdbarch_in_function_epilogue_p called\n");
3427 return gdbarch
->in_function_epilogue_p (gdbarch
, addr
);
3431 set_gdbarch_in_function_epilogue_p (struct gdbarch
*gdbarch
,
3432 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p
)
3434 gdbarch
->in_function_epilogue_p
= in_function_epilogue_p
;
3438 gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
, int argc
, char **argv
)
3440 gdb_assert (gdbarch
!= NULL
);
3441 gdb_assert (gdbarch
->construct_inferior_arguments
!= NULL
);
3442 if (gdbarch_debug
>= 2)
3443 fprintf_unfiltered (gdb_stdlog
, "gdbarch_construct_inferior_arguments called\n");
3444 return gdbarch
->construct_inferior_arguments (gdbarch
, argc
, argv
);
3448 set_gdbarch_construct_inferior_arguments (struct gdbarch
*gdbarch
,
3449 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments
)
3451 gdbarch
->construct_inferior_arguments
= construct_inferior_arguments
;
3455 gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
, asymbol
*sym
, struct minimal_symbol
*msym
)
3457 gdb_assert (gdbarch
!= NULL
);
3458 gdb_assert (gdbarch
->elf_make_msymbol_special
!= NULL
);
3459 if (gdbarch_debug
>= 2)
3460 fprintf_unfiltered (gdb_stdlog
, "gdbarch_elf_make_msymbol_special called\n");
3461 gdbarch
->elf_make_msymbol_special (sym
, msym
);
3465 set_gdbarch_elf_make_msymbol_special (struct gdbarch
*gdbarch
,
3466 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special
)
3468 gdbarch
->elf_make_msymbol_special
= elf_make_msymbol_special
;
3472 gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
, int val
, struct minimal_symbol
*msym
)
3474 gdb_assert (gdbarch
!= NULL
);
3475 gdb_assert (gdbarch
->coff_make_msymbol_special
!= NULL
);
3476 if (gdbarch_debug
>= 2)
3477 fprintf_unfiltered (gdb_stdlog
, "gdbarch_coff_make_msymbol_special called\n");
3478 gdbarch
->coff_make_msymbol_special (val
, msym
);
3482 set_gdbarch_coff_make_msymbol_special (struct gdbarch
*gdbarch
,
3483 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special
)
3485 gdbarch
->coff_make_msymbol_special
= coff_make_msymbol_special
;
3489 gdbarch_name_of_malloc (struct gdbarch
*gdbarch
)
3491 gdb_assert (gdbarch
!= NULL
);
3492 /* Skip verify of name_of_malloc, invalid_p == 0 */
3493 if (gdbarch_debug
>= 2)
3494 fprintf_unfiltered (gdb_stdlog
, "gdbarch_name_of_malloc called\n");
3495 return gdbarch
->name_of_malloc
;
3499 set_gdbarch_name_of_malloc (struct gdbarch
*gdbarch
,
3500 const char * name_of_malloc
)
3502 gdbarch
->name_of_malloc
= name_of_malloc
;
3506 gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
)
3508 gdb_assert (gdbarch
!= NULL
);
3509 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3510 if (gdbarch_debug
>= 2)
3511 fprintf_unfiltered (gdb_stdlog
, "gdbarch_cannot_step_breakpoint called\n");
3512 return gdbarch
->cannot_step_breakpoint
;
3516 set_gdbarch_cannot_step_breakpoint (struct gdbarch
*gdbarch
,
3517 int cannot_step_breakpoint
)
3519 gdbarch
->cannot_step_breakpoint
= cannot_step_breakpoint
;
3523 gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
)
3525 gdb_assert (gdbarch
!= NULL
);
3526 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3527 if (gdbarch_debug
>= 2)
3528 fprintf_unfiltered (gdb_stdlog
, "gdbarch_have_nonsteppable_watchpoint called\n");
3529 return gdbarch
->have_nonsteppable_watchpoint
;
3533 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch
*gdbarch
,
3534 int have_nonsteppable_watchpoint
)
3536 gdbarch
->have_nonsteppable_watchpoint
= have_nonsteppable_watchpoint
;
3540 gdbarch_address_class_type_flags_p (struct gdbarch
*gdbarch
)
3542 gdb_assert (gdbarch
!= NULL
);
3543 return gdbarch
->address_class_type_flags
!= NULL
;
3547 gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
, int byte_size
, int dwarf2_addr_class
)
3549 gdb_assert (gdbarch
!= NULL
);
3550 gdb_assert (gdbarch
->address_class_type_flags
!= NULL
);
3551 if (gdbarch_debug
>= 2)
3552 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags called\n");
3553 return gdbarch
->address_class_type_flags (byte_size
, dwarf2_addr_class
);
3557 set_gdbarch_address_class_type_flags (struct gdbarch
*gdbarch
,
3558 gdbarch_address_class_type_flags_ftype address_class_type_flags
)
3560 gdbarch
->address_class_type_flags
= address_class_type_flags
;
3564 gdbarch_address_class_type_flags_to_name_p (struct gdbarch
*gdbarch
)
3566 gdb_assert (gdbarch
!= NULL
);
3567 return gdbarch
->address_class_type_flags_to_name
!= NULL
;
3571 gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
, int type_flags
)
3573 gdb_assert (gdbarch
!= NULL
);
3574 gdb_assert (gdbarch
->address_class_type_flags_to_name
!= NULL
);
3575 if (gdbarch_debug
>= 2)
3576 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_type_flags_to_name called\n");
3577 return gdbarch
->address_class_type_flags_to_name (gdbarch
, type_flags
);
3581 set_gdbarch_address_class_type_flags_to_name (struct gdbarch
*gdbarch
,
3582 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name
)
3584 gdbarch
->address_class_type_flags_to_name
= address_class_type_flags_to_name
;
3588 gdbarch_address_class_name_to_type_flags_p (struct gdbarch
*gdbarch
)
3590 gdb_assert (gdbarch
!= NULL
);
3591 return gdbarch
->address_class_name_to_type_flags
!= NULL
;
3595 gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
, const char *name
, int *type_flags_ptr
)
3597 gdb_assert (gdbarch
!= NULL
);
3598 gdb_assert (gdbarch
->address_class_name_to_type_flags
!= NULL
);
3599 if (gdbarch_debug
>= 2)
3600 fprintf_unfiltered (gdb_stdlog
, "gdbarch_address_class_name_to_type_flags called\n");
3601 return gdbarch
->address_class_name_to_type_flags (gdbarch
, name
, type_flags_ptr
);
3605 set_gdbarch_address_class_name_to_type_flags (struct gdbarch
*gdbarch
,
3606 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags
)
3608 gdbarch
->address_class_name_to_type_flags
= address_class_name_to_type_flags
;
3612 gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
, int regnum
, struct reggroup
*reggroup
)
3614 gdb_assert (gdbarch
!= NULL
);
3615 gdb_assert (gdbarch
->register_reggroup_p
!= NULL
);
3616 if (gdbarch_debug
>= 2)
3617 fprintf_unfiltered (gdb_stdlog
, "gdbarch_register_reggroup_p called\n");
3618 return gdbarch
->register_reggroup_p (gdbarch
, regnum
, reggroup
);
3622 set_gdbarch_register_reggroup_p (struct gdbarch
*gdbarch
,
3623 gdbarch_register_reggroup_p_ftype register_reggroup_p
)
3625 gdbarch
->register_reggroup_p
= register_reggroup_p
;
3629 gdbarch_fetch_pointer_argument_p (struct gdbarch
*gdbarch
)
3631 gdb_assert (gdbarch
!= NULL
);
3632 return gdbarch
->fetch_pointer_argument
!= NULL
;
3636 gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
, struct frame_info
*frame
, int argi
, struct type
*type
)
3638 gdb_assert (gdbarch
!= NULL
);
3639 gdb_assert (gdbarch
->fetch_pointer_argument
!= NULL
);
3640 if (gdbarch_debug
>= 2)
3641 fprintf_unfiltered (gdb_stdlog
, "gdbarch_fetch_pointer_argument called\n");
3642 return gdbarch
->fetch_pointer_argument (frame
, argi
, type
);
3646 set_gdbarch_fetch_pointer_argument (struct gdbarch
*gdbarch
,
3647 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument
)
3649 gdbarch
->fetch_pointer_argument
= fetch_pointer_argument
;
3653 gdbarch_regset_from_core_section_p (struct gdbarch
*gdbarch
)
3655 gdb_assert (gdbarch
!= NULL
);
3656 return gdbarch
->regset_from_core_section
!= NULL
;
3659 const struct regset
*
3660 gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
, const char *sect_name
, size_t sect_size
)
3662 gdb_assert (gdbarch
!= NULL
);
3663 gdb_assert (gdbarch
->regset_from_core_section
!= NULL
);
3664 if (gdbarch_debug
>= 2)
3665 fprintf_unfiltered (gdb_stdlog
, "gdbarch_regset_from_core_section called\n");
3666 return gdbarch
->regset_from_core_section (gdbarch
, sect_name
, sect_size
);
3670 set_gdbarch_regset_from_core_section (struct gdbarch
*gdbarch
,
3671 gdbarch_regset_from_core_section_ftype regset_from_core_section
)
3673 gdbarch
->regset_from_core_section
= regset_from_core_section
;
3677 /* Keep a registry of per-architecture data-pointers required by GDB
3684 gdbarch_data_pre_init_ftype
*pre_init
;
3685 gdbarch_data_post_init_ftype
*post_init
;
3688 struct gdbarch_data_registration
3690 struct gdbarch_data
*data
;
3691 struct gdbarch_data_registration
*next
;
3694 struct gdbarch_data_registry
3697 struct gdbarch_data_registration
*registrations
;
3700 struct gdbarch_data_registry gdbarch_data_registry
=
3705 static struct gdbarch_data
*
3706 gdbarch_data_register (gdbarch_data_pre_init_ftype
*pre_init
,
3707 gdbarch_data_post_init_ftype
*post_init
)
3709 struct gdbarch_data_registration
**curr
;
3710 /* Append the new registraration. */
3711 for (curr
= &gdbarch_data_registry
.registrations
;
3713 curr
= &(*curr
)->next
);
3714 (*curr
) = XMALLOC (struct gdbarch_data_registration
);
3715 (*curr
)->next
= NULL
;
3716 (*curr
)->data
= XMALLOC (struct gdbarch_data
);
3717 (*curr
)->data
->index
= gdbarch_data_registry
.nr
++;
3718 (*curr
)->data
->pre_init
= pre_init
;
3719 (*curr
)->data
->post_init
= post_init
;
3720 (*curr
)->data
->init_p
= 1;
3721 return (*curr
)->data
;
3724 struct gdbarch_data
*
3725 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype
*pre_init
)
3727 return gdbarch_data_register (pre_init
, NULL
);
3730 struct gdbarch_data
*
3731 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype
*post_init
)
3733 return gdbarch_data_register (NULL
, post_init
);
3736 /* Create/delete the gdbarch data vector. */
3739 alloc_gdbarch_data (struct gdbarch
*gdbarch
)
3741 gdb_assert (gdbarch
->data
== NULL
);
3742 gdbarch
->nr_data
= gdbarch_data_registry
.nr
;
3743 gdbarch
->data
= GDBARCH_OBSTACK_CALLOC (gdbarch
, gdbarch
->nr_data
, void *);
3746 /* Initialize the current value of the specified per-architecture
3750 deprecated_set_gdbarch_data (struct gdbarch
*gdbarch
,
3751 struct gdbarch_data
*data
,
3754 gdb_assert (data
->index
< gdbarch
->nr_data
);
3755 gdb_assert (gdbarch
->data
[data
->index
] == NULL
);
3756 gdb_assert (data
->pre_init
== NULL
);
3757 gdbarch
->data
[data
->index
] = pointer
;
3760 /* Return the current value of the specified per-architecture
3764 gdbarch_data (struct gdbarch
*gdbarch
, struct gdbarch_data
*data
)
3766 gdb_assert (data
->index
< gdbarch
->nr_data
);
3767 if (gdbarch
->data
[data
->index
] == NULL
)
3769 /* The data-pointer isn't initialized, call init() to get a
3771 if (data
->pre_init
!= NULL
)
3772 /* Mid architecture creation: pass just the obstack, and not
3773 the entire architecture, as that way it isn't possible for
3774 pre-init code to refer to undefined architecture
3776 gdbarch
->data
[data
->index
] = data
->pre_init (gdbarch
->obstack
);
3777 else if (gdbarch
->initialized_p
3778 && data
->post_init
!= NULL
)
3779 /* Post architecture creation: pass the entire architecture
3780 (as all fields are valid), but be careful to also detect
3781 recursive references. */
3783 gdb_assert (data
->init_p
);
3785 gdbarch
->data
[data
->index
] = data
->post_init (gdbarch
);
3789 /* The architecture initialization hasn't completed - punt -
3790 hope that the caller knows what they are doing. Once
3791 deprecated_set_gdbarch_data has been initialized, this can be
3792 changed to an internal error. */
3794 gdb_assert (gdbarch
->data
[data
->index
] != NULL
);
3796 return gdbarch
->data
[data
->index
];
3801 /* Keep a registry of swapped data required by GDB modules. */
3806 struct gdbarch_swap_registration
*source
;
3807 struct gdbarch_swap
*next
;
3810 struct gdbarch_swap_registration
3813 unsigned long sizeof_data
;
3814 gdbarch_swap_ftype
*init
;
3815 struct gdbarch_swap_registration
*next
;
3818 struct gdbarch_swap_registry
3821 struct gdbarch_swap_registration
*registrations
;
3824 struct gdbarch_swap_registry gdbarch_swap_registry
=
3830 deprecated_register_gdbarch_swap (void *data
,
3831 unsigned long sizeof_data
,
3832 gdbarch_swap_ftype
*init
)
3834 struct gdbarch_swap_registration
**rego
;
3835 for (rego
= &gdbarch_swap_registry
.registrations
;
3837 rego
= &(*rego
)->next
);
3838 (*rego
) = XMALLOC (struct gdbarch_swap_registration
);
3839 (*rego
)->next
= NULL
;
3840 (*rego
)->init
= init
;
3841 (*rego
)->data
= data
;
3842 (*rego
)->sizeof_data
= sizeof_data
;
3846 current_gdbarch_swap_init_hack (void)
3848 struct gdbarch_swap_registration
*rego
;
3849 struct gdbarch_swap
**curr
= ¤t_gdbarch
->swap
;
3850 for (rego
= gdbarch_swap_registry
.registrations
;
3854 if (rego
->data
!= NULL
)
3856 (*curr
) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch
,
3857 struct gdbarch_swap
);
3858 (*curr
)->source
= rego
;
3859 (*curr
)->swap
= gdbarch_obstack_zalloc (current_gdbarch
,
3861 (*curr
)->next
= NULL
;
3862 curr
= &(*curr
)->next
;
3864 if (rego
->init
!= NULL
)
3869 static struct gdbarch
*
3870 current_gdbarch_swap_out_hack (void)
3872 struct gdbarch
*old_gdbarch
= current_gdbarch
;
3873 struct gdbarch_swap
*curr
;
3875 gdb_assert (old_gdbarch
!= NULL
);
3876 for (curr
= old_gdbarch
->swap
;
3880 memcpy (curr
->swap
, curr
->source
->data
, curr
->source
->sizeof_data
);
3881 memset (curr
->source
->data
, 0, curr
->source
->sizeof_data
);
3883 current_gdbarch
= NULL
;
3888 current_gdbarch_swap_in_hack (struct gdbarch
*new_gdbarch
)
3890 struct gdbarch_swap
*curr
;
3892 gdb_assert (current_gdbarch
== NULL
);
3893 for (curr
= new_gdbarch
->swap
;
3896 memcpy (curr
->source
->data
, curr
->swap
, curr
->source
->sizeof_data
);
3897 current_gdbarch
= new_gdbarch
;
3901 /* Keep a registry of the architectures known by GDB. */
3903 struct gdbarch_registration
3905 enum bfd_architecture bfd_architecture
;
3906 gdbarch_init_ftype
*init
;
3907 gdbarch_dump_tdep_ftype
*dump_tdep
;
3908 struct gdbarch_list
*arches
;
3909 struct gdbarch_registration
*next
;
3912 static struct gdbarch_registration
*gdbarch_registry
= NULL
;
3915 append_name (const char ***buf
, int *nr
, const char *name
)
3917 *buf
= xrealloc (*buf
, sizeof (char**) * (*nr
+ 1));
3923 gdbarch_printable_names (void)
3925 /* Accumulate a list of names based on the registed list of
3927 enum bfd_architecture a
;
3929 const char **arches
= NULL
;
3930 struct gdbarch_registration
*rego
;
3931 for (rego
= gdbarch_registry
;
3935 const struct bfd_arch_info
*ap
;
3936 ap
= bfd_lookup_arch (rego
->bfd_architecture
, 0);
3938 internal_error (__FILE__
, __LINE__
,
3939 "gdbarch_architecture_names: multi-arch unknown");
3942 append_name (&arches
, &nr_arches
, ap
->printable_name
);
3947 append_name (&arches
, &nr_arches
, NULL
);
3953 gdbarch_register (enum bfd_architecture bfd_architecture
,
3954 gdbarch_init_ftype
*init
,
3955 gdbarch_dump_tdep_ftype
*dump_tdep
)
3957 struct gdbarch_registration
**curr
;
3958 const struct bfd_arch_info
*bfd_arch_info
;
3959 /* Check that BFD recognizes this architecture */
3960 bfd_arch_info
= bfd_lookup_arch (bfd_architecture
, 0);
3961 if (bfd_arch_info
== NULL
)
3963 internal_error (__FILE__
, __LINE__
,
3964 "gdbarch: Attempt to register unknown architecture (%d)",
3967 /* Check that we haven't seen this architecture before */
3968 for (curr
= &gdbarch_registry
;
3970 curr
= &(*curr
)->next
)
3972 if (bfd_architecture
== (*curr
)->bfd_architecture
)
3973 internal_error (__FILE__
, __LINE__
,
3974 "gdbarch: Duplicate registraration of architecture (%s)",
3975 bfd_arch_info
->printable_name
);
3979 fprintf_unfiltered (gdb_stdlog
, "register_gdbarch_init (%s, 0x%08lx)\n",
3980 bfd_arch_info
->printable_name
,
3983 (*curr
) = XMALLOC (struct gdbarch_registration
);
3984 (*curr
)->bfd_architecture
= bfd_architecture
;
3985 (*curr
)->init
= init
;
3986 (*curr
)->dump_tdep
= dump_tdep
;
3987 (*curr
)->arches
= NULL
;
3988 (*curr
)->next
= NULL
;
3992 register_gdbarch_init (enum bfd_architecture bfd_architecture
,
3993 gdbarch_init_ftype
*init
)
3995 gdbarch_register (bfd_architecture
, init
, NULL
);
3999 /* Look for an architecture using gdbarch_info. Base search on only
4000 BFD_ARCH_INFO and BYTE_ORDER. */
4002 struct gdbarch_list
*
4003 gdbarch_list_lookup_by_info (struct gdbarch_list
*arches
,
4004 const struct gdbarch_info
*info
)
4006 for (; arches
!= NULL
; arches
= arches
->next
)
4008 if (info
->bfd_arch_info
!= arches
->gdbarch
->bfd_arch_info
)
4010 if (info
->byte_order
!= arches
->gdbarch
->byte_order
)
4012 if (info
->osabi
!= arches
->gdbarch
->osabi
)
4020 /* Find an architecture that matches the specified INFO. Create a new
4021 architecture if needed. Return that new architecture. Assumes
4022 that there is no current architecture. */
4024 static struct gdbarch
*
4025 find_arch_by_info (struct gdbarch
*old_gdbarch
, struct gdbarch_info info
)
4027 struct gdbarch
*new_gdbarch
;
4028 struct gdbarch_registration
*rego
;
4030 /* The existing architecture has been swapped out - all this code
4031 works from a clean slate. */
4032 gdb_assert (current_gdbarch
== NULL
);
4034 /* Fill in missing parts of the INFO struct using a number of
4035 sources: "set ..."; INFOabfd supplied; and the existing
4037 gdbarch_info_fill (old_gdbarch
, &info
);
4039 /* Must have found some sort of architecture. */
4040 gdb_assert (info
.bfd_arch_info
!= NULL
);
4044 fprintf_unfiltered (gdb_stdlog
,
4045 "find_arch_by_info: info.bfd_arch_info %s\n",
4046 (info
.bfd_arch_info
!= NULL
4047 ? info
.bfd_arch_info
->printable_name
4049 fprintf_unfiltered (gdb_stdlog
,
4050 "find_arch_by_info: info.byte_order %d (%s)\n",
4052 (info
.byte_order
== BFD_ENDIAN_BIG
? "big"
4053 : info
.byte_order
== BFD_ENDIAN_LITTLE
? "little"
4055 fprintf_unfiltered (gdb_stdlog
,
4056 "find_arch_by_info: info.osabi %d (%s)\n",
4057 info
.osabi
, gdbarch_osabi_name (info
.osabi
));
4058 fprintf_unfiltered (gdb_stdlog
,
4059 "find_arch_by_info: info.abfd 0x%lx\n",
4061 fprintf_unfiltered (gdb_stdlog
,
4062 "find_arch_by_info: info.tdep_info 0x%lx\n",
4063 (long) info
.tdep_info
);
4066 /* Find the tdep code that knows about this architecture. */
4067 for (rego
= gdbarch_registry
;
4070 if (rego
->bfd_architecture
== info
.bfd_arch_info
->arch
)
4075 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4076 "No matching architecture\n");
4080 /* Ask the tdep code for an architecture that matches "info". */
4081 new_gdbarch
= rego
->init (info
, rego
->arches
);
4083 /* Did the tdep code like it? No. Reject the change and revert to
4084 the old architecture. */
4085 if (new_gdbarch
== NULL
)
4088 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4089 "Target rejected architecture\n");
4093 /* Is this a pre-existing architecture (as determined by already
4094 being initialized)? Move it to the front of the architecture
4095 list (keeping the list sorted Most Recently Used). */
4096 if (new_gdbarch
->initialized_p
)
4098 struct gdbarch_list
**list
;
4099 struct gdbarch_list
*this;
4101 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4102 "Previous architecture 0x%08lx (%s) selected\n",
4104 new_gdbarch
->bfd_arch_info
->printable_name
);
4105 /* Find the existing arch in the list. */
4106 for (list
= ®o
->arches
;
4107 (*list
) != NULL
&& (*list
)->gdbarch
!= new_gdbarch
;
4108 list
= &(*list
)->next
);
4109 /* It had better be in the list of architectures. */
4110 gdb_assert ((*list
) != NULL
&& (*list
)->gdbarch
== new_gdbarch
);
4113 (*list
) = this->next
;
4114 /* Insert THIS at the front. */
4115 this->next
= rego
->arches
;
4116 rego
->arches
= this;
4121 /* It's a new architecture. */
4123 fprintf_unfiltered (gdb_stdlog
, "find_arch_by_info: "
4124 "New architecture 0x%08lx (%s) selected\n",
4126 new_gdbarch
->bfd_arch_info
->printable_name
);
4128 /* Insert the new architecture into the front of the architecture
4129 list (keep the list sorted Most Recently Used). */
4131 struct gdbarch_list
*this = XMALLOC (struct gdbarch_list
);
4132 this->next
= rego
->arches
;
4133 this->gdbarch
= new_gdbarch
;
4134 rego
->arches
= this;
4137 /* Check that the newly installed architecture is valid. Plug in
4138 any post init values. */
4139 new_gdbarch
->dump_tdep
= rego
->dump_tdep
;
4140 verify_gdbarch (new_gdbarch
);
4141 new_gdbarch
->initialized_p
= 1;
4143 /* Initialize any per-architecture swap areas. This phase requires
4144 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4145 swap the entire architecture out. */
4146 current_gdbarch
= new_gdbarch
;
4147 current_gdbarch_swap_init_hack ();
4148 current_gdbarch_swap_out_hack ();
4151 gdbarch_dump (new_gdbarch
, gdb_stdlog
);
4157 gdbarch_find_by_info (struct gdbarch_info info
)
4159 /* Save the previously selected architecture, setting the global to
4160 NULL. This stops things like gdbarch->init() trying to use the
4161 previous architecture's configuration. The previous architecture
4162 may not even be of the same architecture family. The most recent
4163 architecture of the same family is found at the head of the
4164 rego->arches list. */
4165 struct gdbarch
*old_gdbarch
= current_gdbarch_swap_out_hack ();
4167 /* Find the specified architecture. */
4168 struct gdbarch
*new_gdbarch
= find_arch_by_info (old_gdbarch
, info
);
4170 /* Restore the existing architecture. */
4171 gdb_assert (current_gdbarch
== NULL
);
4172 current_gdbarch_swap_in_hack (old_gdbarch
);
4177 /* Make the specified architecture current, swapping the existing one
4181 deprecated_current_gdbarch_select_hack (struct gdbarch
*new_gdbarch
)
4183 gdb_assert (new_gdbarch
!= NULL
);
4184 gdb_assert (current_gdbarch
!= NULL
);
4185 gdb_assert (new_gdbarch
->initialized_p
);
4186 current_gdbarch_swap_out_hack ();
4187 current_gdbarch_swap_in_hack (new_gdbarch
);
4188 architecture_changed_event ();
4191 extern void _initialize_gdbarch (void);
4194 _initialize_gdbarch (void)
4196 struct cmd_list_element
*c
;
4198 deprecated_add_show_from_set
4199 (add_set_cmd ("arch",
4202 (char *)&gdbarch_debug
,
4203 "Set architecture debugging.\n\
4204 When non-zero, architecture debugging is enabled.", &setdebuglist
),
4206 c
= add_set_cmd ("archdebug",
4209 (char *)&gdbarch_debug
,
4210 "Set architecture debugging.\n\
4211 When non-zero, architecture debugging is enabled.", &setlist
);
4213 deprecate_cmd (c
, "set debug arch");
4214 deprecate_cmd (deprecated_add_show_from_set (c
, &showlist
), "show debug arch");