2004-08-02 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4
5 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
6 Software Foundation, Inc.
7
8 This file is part of GDB.
9
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.
14
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.
19
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. */
24
25 /* This file was created with the aid of ``gdbarch.sh''.
26
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
30 being reported.
31
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
35 easier. */
36
37
38 #include "defs.h"
39 #include "arch-utils.h"
40
41 #include "gdbcmd.h"
42 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
43 #include "symcat.h"
44
45 #include "floatformat.h"
46
47 #include "gdb_assert.h"
48 #include "gdb_string.h"
49 #include "gdb-events.h"
50 #include "reggroups.h"
51 #include "osabi.h"
52 #include "gdb_obstack.h"
53
54 /* Static function declarations */
55
56 static void alloc_gdbarch_data (struct gdbarch *);
57
58 /* Non-zero if we want to trace architecture code. */
59
60 #ifndef GDBARCH_DEBUG
61 #define GDBARCH_DEBUG 0
62 #endif
63 int gdbarch_debug = GDBARCH_DEBUG;
64
65
66 /* Maintain the struct gdbarch object */
67
68 struct gdbarch
69 {
70 /* Has this architecture been fully initialized? */
71 int initialized_p;
72
73 /* An obstack bound to the lifetime of the architecture. */
74 struct obstack *obstack;
75
76 /* basic architectural information */
77 const struct bfd_arch_info * bfd_arch_info;
78 int byte_order;
79 enum gdb_osabi osabi;
80
81 /* target specific vector. */
82 struct gdbarch_tdep *tdep;
83 gdbarch_dump_tdep_ftype *dump_tdep;
84
85 /* per-architecture data-pointers */
86 unsigned nr_data;
87 void **data;
88
89 /* per-architecture swap-regions */
90 struct gdbarch_swap *swap;
91
92 /* Multi-arch values.
93
94 When extending this structure you must:
95
96 Add the field below.
97
98 Declare set/get functions and define the corresponding
99 macro in gdbarch.h.
100
101 gdbarch_alloc(): If zero/NULL is not a suitable default,
102 initialize the new field.
103
104 verify_gdbarch(): Confirm that the target updated the field
105 correctly.
106
107 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
108 field is dumped out
109
110 ``startup_gdbarch()'': Append an initial value to the static
111 variable (base values on the host's c-type system).
112
113 get_gdbarch(): Implement the set/get functions (probably using
114 the macro's as shortcuts).
115
116 */
117
118 int short_bit;
119 int int_bit;
120 int long_bit;
121 int long_long_bit;
122 int float_bit;
123 int double_bit;
124 int long_double_bit;
125 int ptr_bit;
126 int addr_bit;
127 int bfd_vma_bit;
128 int char_signed;
129 gdbarch_read_pc_ftype *read_pc;
130 gdbarch_write_pc_ftype *write_pc;
131 gdbarch_read_sp_ftype *read_sp;
132 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
133 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
134 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
135 int num_regs;
136 int num_pseudo_regs;
137 int sp_regnum;
138 int pc_regnum;
139 int ps_regnum;
140 int fp0_regnum;
141 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
142 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
143 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
144 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
145 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
146 gdbarch_register_name_ftype *register_name;
147 gdbarch_register_type_ftype *register_type;
148 gdbarch_deprecated_register_byte_ftype *deprecated_register_byte;
149 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
150 int deprecated_fp_regnum;
151 gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp;
152 gdbarch_push_dummy_call_ftype *push_dummy_call;
153 gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments;
154 int deprecated_register_size;
155 int call_dummy_location;
156 gdbarch_push_dummy_code_ftype *push_dummy_code;
157 gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info;
158 gdbarch_print_registers_info_ftype *print_registers_info;
159 gdbarch_print_float_info_ftype *print_float_info;
160 gdbarch_print_vector_info_ftype *print_vector_info;
161 gdbarch_register_sim_regno_ftype *register_sim_regno;
162 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
163 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
164 gdbarch_cannot_store_register_ftype *cannot_store_register;
165 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
166 gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
167 int believe_pcc_promotion;
168 gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register;
169 gdbarch_convert_register_p_ftype *convert_register_p;
170 gdbarch_register_to_value_ftype *register_to_value;
171 gdbarch_value_to_register_ftype *value_to_register;
172 gdbarch_pointer_to_address_ftype *pointer_to_address;
173 gdbarch_address_to_pointer_ftype *address_to_pointer;
174 gdbarch_integer_to_address_ftype *integer_to_address;
175 gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame;
176 gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return;
177 gdbarch_return_value_ftype *return_value;
178 gdbarch_extract_return_value_ftype *extract_return_value;
179 gdbarch_store_return_value_ftype *store_return_value;
180 gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
181 gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
182 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
183 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
184 gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs;
185 gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info;
186 gdbarch_skip_prologue_ftype *skip_prologue;
187 gdbarch_inner_than_ftype *inner_than;
188 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
189 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
190 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
191 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
192 CORE_ADDR decr_pc_after_break;
193 CORE_ADDR deprecated_function_start_offset;
194 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
195 CORE_ADDR frame_args_skip;
196 gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain;
197 gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid;
198 gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc;
199 gdbarch_unwind_pc_ftype *unwind_pc;
200 gdbarch_unwind_sp_ftype *unwind_sp;
201 gdbarch_deprecated_frame_args_address_ftype *deprecated_frame_args_address;
202 gdbarch_deprecated_frame_locals_address_ftype *deprecated_frame_locals_address;
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 const struct floatformat * float_format;
211 const struct floatformat * double_format;
212 const struct floatformat * long_double_format;
213 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
214 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
215 gdbarch_smash_text_address_ftype *smash_text_address;
216 gdbarch_software_single_step_ftype *software_single_step;
217 gdbarch_print_insn_ftype *print_insn;
218 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
219 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
220 gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
221 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
222 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
223 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
224 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
225 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
226 const char * name_of_malloc;
227 int cannot_step_breakpoint;
228 int have_nonsteppable_watchpoint;
229 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
230 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
231 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
232 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
233 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
234 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
235 };
236
237
238 /* The default architecture uses host values (for want of a better
239 choice). */
240
241 extern const struct bfd_arch_info bfd_default_arch_struct;
242
243 struct gdbarch startup_gdbarch =
244 {
245 1, /* Always initialized. */
246 NULL, /* The obstack. */
247 /* basic architecture information */
248 &bfd_default_arch_struct, /* bfd_arch_info */
249 BFD_ENDIAN_BIG, /* byte_order */
250 GDB_OSABI_UNKNOWN, /* osabi */
251 /* target specific vector and its dump routine */
252 NULL, NULL,
253 /*per-architecture data-pointers and swap regions */
254 0, NULL, NULL,
255 /* Multi-arch values */
256 8 * sizeof (short), /* short_bit */
257 8 * sizeof (int), /* int_bit */
258 8 * sizeof (long), /* long_bit */
259 8 * sizeof (LONGEST), /* long_long_bit */
260 8 * sizeof (float), /* float_bit */
261 8 * sizeof (double), /* double_bit */
262 8 * sizeof (long double), /* long_double_bit */
263 8 * sizeof (void*), /* ptr_bit */
264 8 * sizeof (void*), /* addr_bit */
265 8 * sizeof (void*), /* bfd_vma_bit */
266 1, /* char_signed */
267 0, /* read_pc */
268 0, /* write_pc */
269 0, /* read_sp */
270 0, /* virtual_frame_pointer */
271 0, /* pseudo_register_read */
272 0, /* pseudo_register_write */
273 0, /* num_regs */
274 0, /* num_pseudo_regs */
275 -1, /* sp_regnum */
276 -1, /* pc_regnum */
277 -1, /* ps_regnum */
278 0, /* fp0_regnum */
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, /* deprecated_target_read_fp */
290 0, /* push_dummy_call */
291 0, /* deprecated_push_arguments */
292 0, /* deprecated_register_size */
293 0, /* call_dummy_location */
294 0, /* push_dummy_code */
295 0, /* deprecated_do_registers_info */
296 default_print_registers_info, /* print_registers_info */
297 0, /* print_float_info */
298 0, /* print_vector_info */
299 0, /* register_sim_regno */
300 0, /* register_bytes_ok */
301 0, /* cannot_fetch_register */
302 0, /* cannot_store_register */
303 0, /* get_longjmp_target */
304 0, /* deprecated_init_frame_pc */
305 0, /* believe_pcc_promotion */
306 0, /* deprecated_get_saved_register */
307 0, /* convert_register_p */
308 0, /* register_to_value */
309 0, /* value_to_register */
310 0, /* pointer_to_address */
311 0, /* address_to_pointer */
312 0, /* integer_to_address */
313 0, /* deprecated_pop_frame */
314 0, /* deprecated_store_struct_return */
315 0, /* return_value */
316 0, /* extract_return_value */
317 0, /* store_return_value */
318 0, /* deprecated_extract_return_value */
319 0, /* deprecated_store_return_value */
320 0, /* deprecated_use_struct_convention */
321 0, /* deprecated_extract_struct_value_address */
322 0, /* deprecated_frame_init_saved_regs */
323 0, /* deprecated_init_extra_frame_info */
324 0, /* skip_prologue */
325 0, /* inner_than */
326 0, /* breakpoint_from_pc */
327 0, /* adjust_breakpoint_address */
328 0, /* memory_insert_breakpoint */
329 0, /* memory_remove_breakpoint */
330 0, /* decr_pc_after_break */
331 0, /* deprecated_function_start_offset */
332 generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
333 0, /* frame_args_skip */
334 0, /* deprecated_frame_chain */
335 0, /* deprecated_frame_chain_valid */
336 0, /* deprecated_frame_saved_pc */
337 0, /* unwind_pc */
338 0, /* unwind_sp */
339 get_frame_base, /* deprecated_frame_args_address */
340 get_frame_base, /* deprecated_frame_locals_address */
341 0, /* deprecated_saved_pc_after_call */
342 0, /* frame_num_args */
343 0, /* deprecated_stack_align */
344 0, /* frame_align */
345 0, /* deprecated_reg_struct_has_addr */
346 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
347 0, /* frame_red_zone_size */
348 0, /* float_format */
349 0, /* double_format */
350 0, /* long_double_format */
351 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
352 0, /* addr_bits_remove */
353 0, /* smash_text_address */
354 0, /* software_single_step */
355 0, /* print_insn */
356 0, /* skip_trampoline_code */
357 generic_skip_solib_resolver, /* skip_solib_resolver */
358 0, /* in_solib_call_trampoline */
359 0, /* in_solib_return_trampoline */
360 generic_in_function_epilogue_p, /* in_function_epilogue_p */
361 construct_inferior_arguments, /* construct_inferior_arguments */
362 0, /* elf_make_msymbol_special */
363 0, /* coff_make_msymbol_special */
364 "malloc", /* name_of_malloc */
365 0, /* cannot_step_breakpoint */
366 0, /* have_nonsteppable_watchpoint */
367 0, /* address_class_type_flags */
368 0, /* address_class_type_flags_to_name */
369 0, /* address_class_name_to_type_flags */
370 default_register_reggroup_p, /* register_reggroup_p */
371 0, /* fetch_pointer_argument */
372 0, /* regset_from_core_section */
373 /* startup_gdbarch() */
374 };
375
376 struct gdbarch *current_gdbarch = &startup_gdbarch;
377
378 /* Create a new ``struct gdbarch'' based on information provided by
379 ``struct gdbarch_info''. */
380
381 struct gdbarch *
382 gdbarch_alloc (const struct gdbarch_info *info,
383 struct gdbarch_tdep *tdep)
384 {
385 /* NOTE: The new architecture variable is named ``current_gdbarch''
386 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
387 the current local architecture and not the previous global
388 architecture. This ensures that the new architectures initial
389 values are not influenced by the previous architecture. Once
390 everything is parameterised with gdbarch, this will go away. */
391 struct gdbarch *current_gdbarch;
392
393 /* Create an obstack for allocating all the per-architecture memory,
394 then use that to allocate the architecture vector. */
395 struct obstack *obstack = XMALLOC (struct obstack);
396 obstack_init (obstack);
397 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
398 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
399 current_gdbarch->obstack = obstack;
400
401 alloc_gdbarch_data (current_gdbarch);
402
403 current_gdbarch->tdep = tdep;
404
405 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
406 current_gdbarch->byte_order = info->byte_order;
407 current_gdbarch->osabi = info->osabi;
408
409 /* Force the explicit initialization of these. */
410 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
411 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
412 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
413 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
414 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
415 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
416 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
417 current_gdbarch->ptr_bit = TARGET_INT_BIT;
418 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
419 current_gdbarch->char_signed = -1;
420 current_gdbarch->write_pc = generic_target_write_pc;
421 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
422 current_gdbarch->num_regs = -1;
423 current_gdbarch->sp_regnum = -1;
424 current_gdbarch->pc_regnum = -1;
425 current_gdbarch->ps_regnum = -1;
426 current_gdbarch->fp0_regnum = -1;
427 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
428 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
429 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
430 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
431 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
432 current_gdbarch->deprecated_register_byte = generic_register_byte;
433 current_gdbarch->deprecated_fp_regnum = -1;
434 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
435 current_gdbarch->print_registers_info = default_print_registers_info;
436 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
437 current_gdbarch->cannot_fetch_register = cannot_register_not;
438 current_gdbarch->cannot_store_register = cannot_register_not;
439 current_gdbarch->convert_register_p = generic_convert_register_p;
440 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
441 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
442 current_gdbarch->return_value = legacy_return_value;
443 current_gdbarch->extract_return_value = legacy_extract_return_value;
444 current_gdbarch->store_return_value = legacy_store_return_value;
445 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
446 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
447 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
448 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
449 current_gdbarch->deprecated_frame_args_address = get_frame_base;
450 current_gdbarch->deprecated_frame_locals_address = get_frame_base;
451 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
452 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
453 current_gdbarch->addr_bits_remove = core_addr_identity;
454 current_gdbarch->smash_text_address = core_addr_identity;
455 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
456 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
457 current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
458 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
459 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
460 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
461 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
462 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
463 current_gdbarch->name_of_malloc = "malloc";
464 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
465 /* gdbarch_alloc() */
466
467 return current_gdbarch;
468 }
469
470
471 /* Allocate extra space using the per-architecture obstack. */
472
473 void *
474 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
475 {
476 void *data = obstack_alloc (arch->obstack, size);
477 memset (data, 0, size);
478 return data;
479 }
480
481
482 /* Free a gdbarch struct. This should never happen in normal
483 operation --- once you've created a gdbarch, you keep it around.
484 However, if an architecture's init function encounters an error
485 building the structure, it may need to clean up a partially
486 constructed gdbarch. */
487
488 void
489 gdbarch_free (struct gdbarch *arch)
490 {
491 struct obstack *obstack;
492 gdb_assert (arch != NULL);
493 gdb_assert (!arch->initialized_p);
494 obstack = arch->obstack;
495 obstack_free (obstack, 0); /* Includes the ARCH. */
496 xfree (obstack);
497 }
498
499
500 /* Ensure that all values in a GDBARCH are reasonable. */
501
502 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
503 just happens to match the global variable ``current_gdbarch''. That
504 way macros refering to that variable get the local and not the global
505 version - ulgh. Once everything is parameterised with gdbarch, this
506 will go away. */
507
508 static void
509 verify_gdbarch (struct gdbarch *current_gdbarch)
510 {
511 struct ui_file *log;
512 struct cleanup *cleanups;
513 long dummy;
514 char *buf;
515 log = mem_fileopen ();
516 cleanups = make_cleanup_ui_file_delete (log);
517 /* fundamental */
518 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
519 fprintf_unfiltered (log, "\n\tbyte-order");
520 if (current_gdbarch->bfd_arch_info == NULL)
521 fprintf_unfiltered (log, "\n\tbfd_arch_info");
522 /* Check those that need to be defined for the given multi-arch level. */
523 /* Skip verify of short_bit, invalid_p == 0 */
524 /* Skip verify of int_bit, invalid_p == 0 */
525 /* Skip verify of long_bit, invalid_p == 0 */
526 /* Skip verify of long_long_bit, invalid_p == 0 */
527 /* Skip verify of float_bit, invalid_p == 0 */
528 /* Skip verify of double_bit, invalid_p == 0 */
529 /* Skip verify of long_double_bit, invalid_p == 0 */
530 /* Skip verify of ptr_bit, invalid_p == 0 */
531 if (current_gdbarch->addr_bit == 0)
532 current_gdbarch->addr_bit = TARGET_PTR_BIT;
533 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
534 if (current_gdbarch->char_signed == -1)
535 current_gdbarch->char_signed = 1;
536 /* Skip verify of read_pc, has predicate */
537 /* Skip verify of write_pc, invalid_p == 0 */
538 /* Skip verify of read_sp, has predicate */
539 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
540 /* Skip verify of pseudo_register_read, has predicate */
541 /* Skip verify of pseudo_register_write, has predicate */
542 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
543 && (current_gdbarch->num_regs == -1))
544 fprintf_unfiltered (log, "\n\tnum_regs");
545 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
546 /* Skip verify of sp_regnum, invalid_p == 0 */
547 /* Skip verify of pc_regnum, invalid_p == 0 */
548 /* Skip verify of ps_regnum, invalid_p == 0 */
549 /* Skip verify of fp0_regnum, invalid_p == 0 */
550 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
551 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
552 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
553 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
554 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
555 /* Skip verify of register_type, has predicate */
556 /* Skip verify of deprecated_register_byte, has predicate */
557 /* Skip verify of unwind_dummy_id, has predicate */
558 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
559 /* Skip verify of deprecated_target_read_fp, has predicate */
560 /* Skip verify of push_dummy_call, has predicate */
561 /* Skip verify of deprecated_push_arguments, has predicate */
562 /* Skip verify of call_dummy_location, invalid_p == 0 */
563 /* Skip verify of push_dummy_code, has predicate */
564 /* Skip verify of deprecated_do_registers_info, has predicate */
565 /* Skip verify of print_registers_info, invalid_p == 0 */
566 /* Skip verify of print_float_info, has predicate */
567 /* Skip verify of print_vector_info, has predicate */
568 /* Skip verify of register_sim_regno, invalid_p == 0 */
569 /* Skip verify of register_bytes_ok, has predicate */
570 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
571 /* Skip verify of cannot_store_register, invalid_p == 0 */
572 /* Skip verify of get_longjmp_target, has predicate */
573 /* Skip verify of deprecated_init_frame_pc, has predicate */
574 /* Skip verify of deprecated_get_saved_register, has predicate */
575 /* Skip verify of convert_register_p, invalid_p == 0 */
576 /* Skip verify of pointer_to_address, invalid_p == 0 */
577 /* Skip verify of address_to_pointer, invalid_p == 0 */
578 /* Skip verify of integer_to_address, has predicate */
579 /* Skip verify of deprecated_pop_frame, has predicate */
580 /* Skip verify of deprecated_store_struct_return, has predicate */
581 /* Skip verify of return_value, has predicate */
582 /* Skip verify of extract_return_value, invalid_p == 0 */
583 /* Skip verify of store_return_value, invalid_p == 0 */
584 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
585 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
586 /* Skip verify of deprecated_frame_init_saved_regs, has predicate */
587 /* Skip verify of deprecated_init_extra_frame_info, has predicate */
588 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
589 && (current_gdbarch->skip_prologue == 0))
590 fprintf_unfiltered (log, "\n\tskip_prologue");
591 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
592 && (current_gdbarch->inner_than == 0))
593 fprintf_unfiltered (log, "\n\tinner_than");
594 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
595 && (current_gdbarch->breakpoint_from_pc == 0))
596 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
597 /* Skip verify of adjust_breakpoint_address, has predicate */
598 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
599 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
600 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
601 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
602 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
603 /* Skip verify of frame_args_skip, invalid_p == 0 */
604 /* Skip verify of deprecated_frame_chain, has predicate */
605 /* Skip verify of deprecated_frame_chain_valid, has predicate */
606 /* Skip verify of deprecated_frame_saved_pc, has predicate */
607 /* Skip verify of unwind_pc, has predicate */
608 /* Skip verify of unwind_sp, has predicate */
609 /* Skip verify of deprecated_frame_args_address, has predicate */
610 /* Skip verify of deprecated_frame_locals_address, has predicate */
611 /* Skip verify of deprecated_saved_pc_after_call, has predicate */
612 /* Skip verify of frame_num_args, has predicate */
613 /* Skip verify of deprecated_stack_align, has predicate */
614 /* Skip verify of frame_align, has predicate */
615 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
616 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
617 if (current_gdbarch->float_format == 0)
618 current_gdbarch->float_format = default_float_format (current_gdbarch);
619 if (current_gdbarch->double_format == 0)
620 current_gdbarch->double_format = default_double_format (current_gdbarch);
621 if (current_gdbarch->long_double_format == 0)
622 current_gdbarch->long_double_format = default_double_format (current_gdbarch);
623 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
624 /* Skip verify of addr_bits_remove, invalid_p == 0 */
625 /* Skip verify of smash_text_address, invalid_p == 0 */
626 /* Skip verify of software_single_step, has predicate */
627 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
628 && (current_gdbarch->print_insn == 0))
629 fprintf_unfiltered (log, "\n\tprint_insn");
630 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
631 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
632 /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
633 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
634 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
635 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
636 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
637 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
638 /* Skip verify of name_of_malloc, invalid_p == 0 */
639 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
640 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
641 /* Skip verify of address_class_type_flags, has predicate */
642 /* Skip verify of address_class_type_flags_to_name, has predicate */
643 /* Skip verify of address_class_name_to_type_flags, has predicate */
644 /* Skip verify of register_reggroup_p, invalid_p == 0 */
645 /* Skip verify of fetch_pointer_argument, has predicate */
646 /* Skip verify of regset_from_core_section, has predicate */
647 buf = ui_file_xstrdup (log, &dummy);
648 make_cleanup (xfree, buf);
649 if (strlen (buf) > 0)
650 internal_error (__FILE__, __LINE__,
651 "verify_gdbarch: the following are invalid ...%s",
652 buf);
653 do_cleanups (cleanups);
654 }
655
656
657 /* Print out the details of the current architecture. */
658
659 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
660 just happens to match the global variable ``current_gdbarch''. That
661 way macros refering to that variable get the local and not the global
662 version - ulgh. Once everything is parameterised with gdbarch, this
663 will go away. */
664
665 void
666 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
667 {
668 fprintf_unfiltered (file,
669 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
670 GDB_MULTI_ARCH);
671 #ifdef TARGET_ADDR_BIT
672 fprintf_unfiltered (file,
673 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
674 XSTRING (TARGET_ADDR_BIT));
675 #endif
676 fprintf_unfiltered (file,
677 "gdbarch_dump: addr_bit = %s\n",
678 paddr_d (current_gdbarch->addr_bit));
679 #ifdef ADDR_BITS_REMOVE
680 fprintf_unfiltered (file,
681 "gdbarch_dump: %s # %s\n",
682 "ADDR_BITS_REMOVE(addr)",
683 XSTRING (ADDR_BITS_REMOVE (addr)));
684 #endif
685 fprintf_unfiltered (file,
686 "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
687 (long) current_gdbarch->addr_bits_remove);
688 fprintf_unfiltered (file,
689 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
690 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
691 fprintf_unfiltered (file,
692 "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
693 (long) current_gdbarch->address_class_name_to_type_flags);
694 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
695 fprintf_unfiltered (file,
696 "gdbarch_dump: %s # %s\n",
697 "ADDRESS_CLASS_TYPE_FLAGS_P()",
698 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
699 #endif
700 fprintf_unfiltered (file,
701 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
702 gdbarch_address_class_type_flags_p (current_gdbarch));
703 #ifdef ADDRESS_CLASS_TYPE_FLAGS
704 fprintf_unfiltered (file,
705 "gdbarch_dump: %s # %s\n",
706 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
707 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
708 #endif
709 fprintf_unfiltered (file,
710 "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
711 (long) current_gdbarch->address_class_type_flags);
712 fprintf_unfiltered (file,
713 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
714 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
715 fprintf_unfiltered (file,
716 "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
717 (long) current_gdbarch->address_class_type_flags_to_name);
718 #ifdef ADDRESS_TO_POINTER
719 fprintf_unfiltered (file,
720 "gdbarch_dump: %s # %s\n",
721 "ADDRESS_TO_POINTER(type, buf, addr)",
722 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
723 #endif
724 fprintf_unfiltered (file,
725 "gdbarch_dump: address_to_pointer = <0x%lx>\n",
726 (long) current_gdbarch->address_to_pointer);
727 fprintf_unfiltered (file,
728 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
729 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
730 fprintf_unfiltered (file,
731 "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
732 (long) current_gdbarch->adjust_breakpoint_address);
733 #ifdef BELIEVE_PCC_PROMOTION
734 fprintf_unfiltered (file,
735 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
736 XSTRING (BELIEVE_PCC_PROMOTION));
737 #endif
738 fprintf_unfiltered (file,
739 "gdbarch_dump: believe_pcc_promotion = %s\n",
740 paddr_d (current_gdbarch->believe_pcc_promotion));
741 #ifdef TARGET_ARCHITECTURE
742 fprintf_unfiltered (file,
743 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
744 XSTRING (TARGET_ARCHITECTURE));
745 #endif
746 fprintf_unfiltered (file,
747 "gdbarch_dump: bfd_arch_info = %s\n",
748 TARGET_ARCHITECTURE->printable_name);
749 #ifdef TARGET_BFD_VMA_BIT
750 fprintf_unfiltered (file,
751 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
752 XSTRING (TARGET_BFD_VMA_BIT));
753 #endif
754 fprintf_unfiltered (file,
755 "gdbarch_dump: bfd_vma_bit = %s\n",
756 paddr_d (current_gdbarch->bfd_vma_bit));
757 #ifdef BREAKPOINT_FROM_PC
758 fprintf_unfiltered (file,
759 "gdbarch_dump: %s # %s\n",
760 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
761 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
762 #endif
763 fprintf_unfiltered (file,
764 "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
765 (long) current_gdbarch->breakpoint_from_pc);
766 #ifdef TARGET_BYTE_ORDER
767 fprintf_unfiltered (file,
768 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
769 XSTRING (TARGET_BYTE_ORDER));
770 #endif
771 fprintf_unfiltered (file,
772 "gdbarch_dump: byte_order = %s\n",
773 paddr_d (current_gdbarch->byte_order));
774 #ifdef CALL_DUMMY_LOCATION
775 fprintf_unfiltered (file,
776 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
777 XSTRING (CALL_DUMMY_LOCATION));
778 #endif
779 fprintf_unfiltered (file,
780 "gdbarch_dump: call_dummy_location = %s\n",
781 paddr_d (current_gdbarch->call_dummy_location));
782 #ifdef CANNOT_FETCH_REGISTER
783 fprintf_unfiltered (file,
784 "gdbarch_dump: %s # %s\n",
785 "CANNOT_FETCH_REGISTER(regnum)",
786 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
787 #endif
788 fprintf_unfiltered (file,
789 "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
790 (long) current_gdbarch->cannot_fetch_register);
791 #ifdef CANNOT_STEP_BREAKPOINT
792 fprintf_unfiltered (file,
793 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
794 XSTRING (CANNOT_STEP_BREAKPOINT));
795 #endif
796 fprintf_unfiltered (file,
797 "gdbarch_dump: cannot_step_breakpoint = %s\n",
798 paddr_d (current_gdbarch->cannot_step_breakpoint));
799 #ifdef CANNOT_STORE_REGISTER
800 fprintf_unfiltered (file,
801 "gdbarch_dump: %s # %s\n",
802 "CANNOT_STORE_REGISTER(regnum)",
803 XSTRING (CANNOT_STORE_REGISTER (regnum)));
804 #endif
805 fprintf_unfiltered (file,
806 "gdbarch_dump: cannot_store_register = <0x%lx>\n",
807 (long) current_gdbarch->cannot_store_register);
808 #ifdef TARGET_CHAR_SIGNED
809 fprintf_unfiltered (file,
810 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
811 XSTRING (TARGET_CHAR_SIGNED));
812 #endif
813 fprintf_unfiltered (file,
814 "gdbarch_dump: char_signed = %s\n",
815 paddr_d (current_gdbarch->char_signed));
816 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
817 fprintf_unfiltered (file,
818 "gdbarch_dump: %s # %s\n",
819 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
820 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
821 #endif
822 fprintf_unfiltered (file,
823 "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
824 (long) current_gdbarch->coff_make_msymbol_special);
825 fprintf_unfiltered (file,
826 "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
827 (long) current_gdbarch->construct_inferior_arguments);
828 fprintf_unfiltered (file,
829 "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
830 (long) current_gdbarch->convert_from_func_ptr_addr);
831 #ifdef CONVERT_REGISTER_P
832 fprintf_unfiltered (file,
833 "gdbarch_dump: %s # %s\n",
834 "CONVERT_REGISTER_P(regnum, type)",
835 XSTRING (CONVERT_REGISTER_P (regnum, type)));
836 #endif
837 fprintf_unfiltered (file,
838 "gdbarch_dump: convert_register_p = <0x%lx>\n",
839 (long) current_gdbarch->convert_register_p);
840 #ifdef DECR_PC_AFTER_BREAK
841 fprintf_unfiltered (file,
842 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
843 XSTRING (DECR_PC_AFTER_BREAK));
844 #endif
845 fprintf_unfiltered (file,
846 "gdbarch_dump: decr_pc_after_break = 0x%s\n",
847 paddr_nz (current_gdbarch->decr_pc_after_break));
848 #ifdef DEPRECATED_DO_REGISTERS_INFO_P
849 fprintf_unfiltered (file,
850 "gdbarch_dump: %s # %s\n",
851 "DEPRECATED_DO_REGISTERS_INFO_P()",
852 XSTRING (DEPRECATED_DO_REGISTERS_INFO_P ()));
853 #endif
854 fprintf_unfiltered (file,
855 "gdbarch_dump: gdbarch_deprecated_do_registers_info_p() = %d\n",
856 gdbarch_deprecated_do_registers_info_p (current_gdbarch));
857 #ifdef DEPRECATED_DO_REGISTERS_INFO
858 fprintf_unfiltered (file,
859 "gdbarch_dump: %s # %s\n",
860 "DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)",
861 XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs)));
862 #endif
863 fprintf_unfiltered (file,
864 "gdbarch_dump: deprecated_do_registers_info = <0x%lx>\n",
865 (long) current_gdbarch->deprecated_do_registers_info);
866 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
867 fprintf_unfiltered (file,
868 "gdbarch_dump: %s # %s\n",
869 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
870 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
871 #endif
872 fprintf_unfiltered (file,
873 "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n",
874 (long) current_gdbarch->deprecated_extract_return_value);
875 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
876 fprintf_unfiltered (file,
877 "gdbarch_dump: %s # %s\n",
878 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
879 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
880 #endif
881 fprintf_unfiltered (file,
882 "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
883 gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
884 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
885 fprintf_unfiltered (file,
886 "gdbarch_dump: %s # %s\n",
887 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
888 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
889 #endif
890 fprintf_unfiltered (file,
891 "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
892 (long) current_gdbarch->deprecated_extract_struct_value_address);
893 #ifdef DEPRECATED_FP_REGNUM
894 fprintf_unfiltered (file,
895 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
896 XSTRING (DEPRECATED_FP_REGNUM));
897 #endif
898 fprintf_unfiltered (file,
899 "gdbarch_dump: deprecated_fp_regnum = %s\n",
900 paddr_d (current_gdbarch->deprecated_fp_regnum));
901 #ifdef DEPRECATED_FRAME_ARGS_ADDRESS_P
902 fprintf_unfiltered (file,
903 "gdbarch_dump: %s # %s\n",
904 "DEPRECATED_FRAME_ARGS_ADDRESS_P()",
905 XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS_P ()));
906 #endif
907 fprintf_unfiltered (file,
908 "gdbarch_dump: gdbarch_deprecated_frame_args_address_p() = %d\n",
909 gdbarch_deprecated_frame_args_address_p (current_gdbarch));
910 #ifdef DEPRECATED_FRAME_ARGS_ADDRESS
911 fprintf_unfiltered (file,
912 "gdbarch_dump: %s # %s\n",
913 "DEPRECATED_FRAME_ARGS_ADDRESS(fi)",
914 XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS (fi)));
915 #endif
916 fprintf_unfiltered (file,
917 "gdbarch_dump: deprecated_frame_args_address = <0x%lx>\n",
918 (long) current_gdbarch->deprecated_frame_args_address);
919 #ifdef DEPRECATED_FRAME_CHAIN_P
920 fprintf_unfiltered (file,
921 "gdbarch_dump: %s # %s\n",
922 "DEPRECATED_FRAME_CHAIN_P()",
923 XSTRING (DEPRECATED_FRAME_CHAIN_P ()));
924 #endif
925 fprintf_unfiltered (file,
926 "gdbarch_dump: gdbarch_deprecated_frame_chain_p() = %d\n",
927 gdbarch_deprecated_frame_chain_p (current_gdbarch));
928 #ifdef DEPRECATED_FRAME_CHAIN
929 fprintf_unfiltered (file,
930 "gdbarch_dump: %s # %s\n",
931 "DEPRECATED_FRAME_CHAIN(frame)",
932 XSTRING (DEPRECATED_FRAME_CHAIN (frame)));
933 #endif
934 fprintf_unfiltered (file,
935 "gdbarch_dump: deprecated_frame_chain = <0x%lx>\n",
936 (long) current_gdbarch->deprecated_frame_chain);
937 #ifdef DEPRECATED_FRAME_CHAIN_VALID_P
938 fprintf_unfiltered (file,
939 "gdbarch_dump: %s # %s\n",
940 "DEPRECATED_FRAME_CHAIN_VALID_P()",
941 XSTRING (DEPRECATED_FRAME_CHAIN_VALID_P ()));
942 #endif
943 fprintf_unfiltered (file,
944 "gdbarch_dump: gdbarch_deprecated_frame_chain_valid_p() = %d\n",
945 gdbarch_deprecated_frame_chain_valid_p (current_gdbarch));
946 #ifdef DEPRECATED_FRAME_CHAIN_VALID
947 fprintf_unfiltered (file,
948 "gdbarch_dump: %s # %s\n",
949 "DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe)",
950 XSTRING (DEPRECATED_FRAME_CHAIN_VALID (chain, thisframe)));
951 #endif
952 fprintf_unfiltered (file,
953 "gdbarch_dump: deprecated_frame_chain_valid = <0x%lx>\n",
954 (long) current_gdbarch->deprecated_frame_chain_valid);
955 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P
956 fprintf_unfiltered (file,
957 "gdbarch_dump: %s # %s\n",
958 "DEPRECATED_FRAME_INIT_SAVED_REGS_P()",
959 XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()));
960 #endif
961 fprintf_unfiltered (file,
962 "gdbarch_dump: gdbarch_deprecated_frame_init_saved_regs_p() = %d\n",
963 gdbarch_deprecated_frame_init_saved_regs_p (current_gdbarch));
964 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS
965 fprintf_unfiltered (file,
966 "gdbarch_dump: %s # %s\n",
967 "DEPRECATED_FRAME_INIT_SAVED_REGS(frame)",
968 XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS (frame)));
969 #endif
970 fprintf_unfiltered (file,
971 "gdbarch_dump: deprecated_frame_init_saved_regs = <0x%lx>\n",
972 (long) current_gdbarch->deprecated_frame_init_saved_regs);
973 #ifdef DEPRECATED_FRAME_LOCALS_ADDRESS_P
974 fprintf_unfiltered (file,
975 "gdbarch_dump: %s # %s\n",
976 "DEPRECATED_FRAME_LOCALS_ADDRESS_P()",
977 XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS_P ()));
978 #endif
979 fprintf_unfiltered (file,
980 "gdbarch_dump: gdbarch_deprecated_frame_locals_address_p() = %d\n",
981 gdbarch_deprecated_frame_locals_address_p (current_gdbarch));
982 #ifdef DEPRECATED_FRAME_LOCALS_ADDRESS
983 fprintf_unfiltered (file,
984 "gdbarch_dump: %s # %s\n",
985 "DEPRECATED_FRAME_LOCALS_ADDRESS(fi)",
986 XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS (fi)));
987 #endif
988 fprintf_unfiltered (file,
989 "gdbarch_dump: deprecated_frame_locals_address = <0x%lx>\n",
990 (long) current_gdbarch->deprecated_frame_locals_address);
991 #ifdef DEPRECATED_FRAME_SAVED_PC_P
992 fprintf_unfiltered (file,
993 "gdbarch_dump: %s # %s\n",
994 "DEPRECATED_FRAME_SAVED_PC_P()",
995 XSTRING (DEPRECATED_FRAME_SAVED_PC_P ()));
996 #endif
997 fprintf_unfiltered (file,
998 "gdbarch_dump: gdbarch_deprecated_frame_saved_pc_p() = %d\n",
999 gdbarch_deprecated_frame_saved_pc_p (current_gdbarch));
1000 #ifdef DEPRECATED_FRAME_SAVED_PC
1001 fprintf_unfiltered (file,
1002 "gdbarch_dump: %s # %s\n",
1003 "DEPRECATED_FRAME_SAVED_PC(fi)",
1004 XSTRING (DEPRECATED_FRAME_SAVED_PC (fi)));
1005 #endif
1006 fprintf_unfiltered (file,
1007 "gdbarch_dump: deprecated_frame_saved_pc = <0x%lx>\n",
1008 (long) current_gdbarch->deprecated_frame_saved_pc);
1009 #ifdef DEPRECATED_FUNCTION_START_OFFSET
1010 fprintf_unfiltered (file,
1011 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
1012 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
1013 #endif
1014 fprintf_unfiltered (file,
1015 "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
1016 paddr_nz (current_gdbarch->deprecated_function_start_offset));
1017 #ifdef DEPRECATED_GET_SAVED_REGISTER_P
1018 fprintf_unfiltered (file,
1019 "gdbarch_dump: %s # %s\n",
1020 "DEPRECATED_GET_SAVED_REGISTER_P()",
1021 XSTRING (DEPRECATED_GET_SAVED_REGISTER_P ()));
1022 #endif
1023 fprintf_unfiltered (file,
1024 "gdbarch_dump: gdbarch_deprecated_get_saved_register_p() = %d\n",
1025 gdbarch_deprecated_get_saved_register_p (current_gdbarch));
1026 #ifdef DEPRECATED_GET_SAVED_REGISTER
1027 fprintf_unfiltered (file,
1028 "gdbarch_dump: %s # %s\n",
1029 "DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1030 XSTRING (DEPRECATED_GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1031 #endif
1032 fprintf_unfiltered (file,
1033 "gdbarch_dump: deprecated_get_saved_register = <0x%lx>\n",
1034 (long) current_gdbarch->deprecated_get_saved_register);
1035 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
1036 fprintf_unfiltered (file,
1037 "gdbarch_dump: %s # %s\n",
1038 "DEPRECATED_INIT_EXTRA_FRAME_INFO_P()",
1039 XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()));
1040 #endif
1041 fprintf_unfiltered (file,
1042 "gdbarch_dump: gdbarch_deprecated_init_extra_frame_info_p() = %d\n",
1043 gdbarch_deprecated_init_extra_frame_info_p (current_gdbarch));
1044 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO
1045 fprintf_unfiltered (file,
1046 "gdbarch_dump: %s # %s\n",
1047 "DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1048 XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1049 #endif
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: deprecated_init_extra_frame_info = <0x%lx>\n",
1052 (long) current_gdbarch->deprecated_init_extra_frame_info);
1053 #ifdef DEPRECATED_INIT_FRAME_PC_P
1054 fprintf_unfiltered (file,
1055 "gdbarch_dump: %s # %s\n",
1056 "DEPRECATED_INIT_FRAME_PC_P()",
1057 XSTRING (DEPRECATED_INIT_FRAME_PC_P ()));
1058 #endif
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: gdbarch_deprecated_init_frame_pc_p() = %d\n",
1061 gdbarch_deprecated_init_frame_pc_p (current_gdbarch));
1062 #ifdef DEPRECATED_INIT_FRAME_PC
1063 fprintf_unfiltered (file,
1064 "gdbarch_dump: %s # %s\n",
1065 "DEPRECATED_INIT_FRAME_PC(fromleaf, prev)",
1066 XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev)));
1067 #endif
1068 fprintf_unfiltered (file,
1069 "gdbarch_dump: deprecated_init_frame_pc = <0x%lx>\n",
1070 (long) current_gdbarch->deprecated_init_frame_pc);
1071 #ifdef DEPRECATED_POP_FRAME_P
1072 fprintf_unfiltered (file,
1073 "gdbarch_dump: %s # %s\n",
1074 "DEPRECATED_POP_FRAME_P()",
1075 XSTRING (DEPRECATED_POP_FRAME_P ()));
1076 #endif
1077 fprintf_unfiltered (file,
1078 "gdbarch_dump: gdbarch_deprecated_pop_frame_p() = %d\n",
1079 gdbarch_deprecated_pop_frame_p (current_gdbarch));
1080 #ifdef DEPRECATED_POP_FRAME
1081 fprintf_unfiltered (file,
1082 "gdbarch_dump: %s # %s\n",
1083 "DEPRECATED_POP_FRAME(-)",
1084 XSTRING (DEPRECATED_POP_FRAME (-)));
1085 #endif
1086 fprintf_unfiltered (file,
1087 "gdbarch_dump: deprecated_pop_frame = <0x%lx>\n",
1088 (long) current_gdbarch->deprecated_pop_frame);
1089 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
1090 fprintf_unfiltered (file,
1091 "gdbarch_dump: %s # %s\n",
1092 "DEPRECATED_PUSH_ARGUMENTS_P()",
1093 XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
1094 #endif
1095 fprintf_unfiltered (file,
1096 "gdbarch_dump: gdbarch_deprecated_push_arguments_p() = %d\n",
1097 gdbarch_deprecated_push_arguments_p (current_gdbarch));
1098 #ifdef DEPRECATED_PUSH_ARGUMENTS
1099 fprintf_unfiltered (file,
1100 "gdbarch_dump: %s # %s\n",
1101 "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1102 XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
1103 #endif
1104 fprintf_unfiltered (file,
1105 "gdbarch_dump: deprecated_push_arguments = <0x%lx>\n",
1106 (long) current_gdbarch->deprecated_push_arguments);
1107 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
1108 fprintf_unfiltered (file,
1109 "gdbarch_dump: %s # %s\n",
1110 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
1111 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
1112 #endif
1113 fprintf_unfiltered (file,
1114 "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
1115 gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
1116 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
1117 fprintf_unfiltered (file,
1118 "gdbarch_dump: %s # %s\n",
1119 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
1120 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
1121 #endif
1122 fprintf_unfiltered (file,
1123 "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
1124 (long) current_gdbarch->deprecated_reg_struct_has_addr);
1125 #ifdef DEPRECATED_REGISTER_BYTE_P
1126 fprintf_unfiltered (file,
1127 "gdbarch_dump: %s # %s\n",
1128 "DEPRECATED_REGISTER_BYTE_P()",
1129 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
1130 #endif
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n",
1133 gdbarch_deprecated_register_byte_p (current_gdbarch));
1134 #ifdef DEPRECATED_REGISTER_BYTE
1135 fprintf_unfiltered (file,
1136 "gdbarch_dump: %s # %s\n",
1137 "DEPRECATED_REGISTER_BYTE(reg_nr)",
1138 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
1139 #endif
1140 fprintf_unfiltered (file,
1141 "gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
1142 (long) current_gdbarch->deprecated_register_byte);
1143 #ifdef DEPRECATED_REGISTER_SIZE
1144 fprintf_unfiltered (file,
1145 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
1146 XSTRING (DEPRECATED_REGISTER_SIZE));
1147 #endif
1148 fprintf_unfiltered (file,
1149 "gdbarch_dump: deprecated_register_size = %s\n",
1150 paddr_d (current_gdbarch->deprecated_register_size));
1151 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
1152 fprintf_unfiltered (file,
1153 "gdbarch_dump: %s # %s\n",
1154 "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
1155 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
1156 #endif
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: gdbarch_deprecated_saved_pc_after_call_p() = %d\n",
1159 gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch));
1160 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL
1161 fprintf_unfiltered (file,
1162 "gdbarch_dump: %s # %s\n",
1163 "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
1164 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
1165 #endif
1166 fprintf_unfiltered (file,
1167 "gdbarch_dump: deprecated_saved_pc_after_call = <0x%lx>\n",
1168 (long) current_gdbarch->deprecated_saved_pc_after_call);
1169 #ifdef DEPRECATED_STACK_ALIGN_P
1170 fprintf_unfiltered (file,
1171 "gdbarch_dump: %s # %s\n",
1172 "DEPRECATED_STACK_ALIGN_P()",
1173 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
1174 #endif
1175 fprintf_unfiltered (file,
1176 "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
1177 gdbarch_deprecated_stack_align_p (current_gdbarch));
1178 #ifdef DEPRECATED_STACK_ALIGN
1179 fprintf_unfiltered (file,
1180 "gdbarch_dump: %s # %s\n",
1181 "DEPRECATED_STACK_ALIGN(sp)",
1182 XSTRING (DEPRECATED_STACK_ALIGN (sp)));
1183 #endif
1184 fprintf_unfiltered (file,
1185 "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
1186 (long) current_gdbarch->deprecated_stack_align);
1187 #ifdef DEPRECATED_STORE_RETURN_VALUE
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: %s # %s\n",
1190 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
1191 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
1192 #endif
1193 fprintf_unfiltered (file,
1194 "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n",
1195 (long) current_gdbarch->deprecated_store_return_value);
1196 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
1197 fprintf_unfiltered (file,
1198 "gdbarch_dump: %s # %s\n",
1199 "DEPRECATED_STORE_STRUCT_RETURN_P()",
1200 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
1201 #endif
1202 fprintf_unfiltered (file,
1203 "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
1204 gdbarch_deprecated_store_struct_return_p (current_gdbarch));
1205 #ifdef DEPRECATED_STORE_STRUCT_RETURN
1206 fprintf_unfiltered (file,
1207 "gdbarch_dump: %s # %s\n",
1208 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
1209 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
1210 #endif
1211 fprintf_unfiltered (file,
1212 "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
1213 (long) current_gdbarch->deprecated_store_struct_return);
1214 #ifdef DEPRECATED_TARGET_READ_FP_P
1215 fprintf_unfiltered (file,
1216 "gdbarch_dump: %s # %s\n",
1217 "DEPRECATED_TARGET_READ_FP_P()",
1218 XSTRING (DEPRECATED_TARGET_READ_FP_P ()));
1219 #endif
1220 fprintf_unfiltered (file,
1221 "gdbarch_dump: gdbarch_deprecated_target_read_fp_p() = %d\n",
1222 gdbarch_deprecated_target_read_fp_p (current_gdbarch));
1223 #ifdef DEPRECATED_TARGET_READ_FP
1224 fprintf_unfiltered (file,
1225 "gdbarch_dump: %s # %s\n",
1226 "DEPRECATED_TARGET_READ_FP()",
1227 XSTRING (DEPRECATED_TARGET_READ_FP ()));
1228 #endif
1229 fprintf_unfiltered (file,
1230 "gdbarch_dump: deprecated_target_read_fp = <0x%lx>\n",
1231 (long) current_gdbarch->deprecated_target_read_fp);
1232 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
1233 fprintf_unfiltered (file,
1234 "gdbarch_dump: %s # %s\n",
1235 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
1236 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
1237 #endif
1238 fprintf_unfiltered (file,
1239 "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
1240 (long) current_gdbarch->deprecated_use_struct_convention);
1241 #ifdef TARGET_DOUBLE_BIT
1242 fprintf_unfiltered (file,
1243 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
1244 XSTRING (TARGET_DOUBLE_BIT));
1245 #endif
1246 fprintf_unfiltered (file,
1247 "gdbarch_dump: double_bit = %s\n",
1248 paddr_d (current_gdbarch->double_bit));
1249 #ifdef TARGET_DOUBLE_FORMAT
1250 fprintf_unfiltered (file,
1251 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1252 XSTRING (TARGET_DOUBLE_FORMAT));
1253 #endif
1254 fprintf_unfiltered (file,
1255 "gdbarch_dump: double_format = %s\n",
1256 (TARGET_DOUBLE_FORMAT)->name);
1257 #ifdef DWARF2_REG_TO_REGNUM
1258 fprintf_unfiltered (file,
1259 "gdbarch_dump: %s # %s\n",
1260 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1261 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1262 #endif
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
1265 (long) current_gdbarch->dwarf2_reg_to_regnum);
1266 #ifdef DWARF_REG_TO_REGNUM
1267 fprintf_unfiltered (file,
1268 "gdbarch_dump: %s # %s\n",
1269 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1270 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1271 #endif
1272 fprintf_unfiltered (file,
1273 "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
1274 (long) current_gdbarch->dwarf_reg_to_regnum);
1275 #ifdef ECOFF_REG_TO_REGNUM
1276 fprintf_unfiltered (file,
1277 "gdbarch_dump: %s # %s\n",
1278 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1279 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1280 #endif
1281 fprintf_unfiltered (file,
1282 "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
1283 (long) current_gdbarch->ecoff_reg_to_regnum);
1284 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1285 fprintf_unfiltered (file,
1286 "gdbarch_dump: %s # %s\n",
1287 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1288 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1289 #endif
1290 fprintf_unfiltered (file,
1291 "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
1292 (long) current_gdbarch->elf_make_msymbol_special);
1293 #ifdef EXTRACT_RETURN_VALUE
1294 fprintf_unfiltered (file,
1295 "gdbarch_dump: %s # %s\n",
1296 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1297 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1298 #endif
1299 fprintf_unfiltered (file,
1300 "gdbarch_dump: extract_return_value = <0x%lx>\n",
1301 (long) current_gdbarch->extract_return_value);
1302 #ifdef FETCH_POINTER_ARGUMENT_P
1303 fprintf_unfiltered (file,
1304 "gdbarch_dump: %s # %s\n",
1305 "FETCH_POINTER_ARGUMENT_P()",
1306 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1307 #endif
1308 fprintf_unfiltered (file,
1309 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
1310 gdbarch_fetch_pointer_argument_p (current_gdbarch));
1311 #ifdef FETCH_POINTER_ARGUMENT
1312 fprintf_unfiltered (file,
1313 "gdbarch_dump: %s # %s\n",
1314 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1315 XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
1316 #endif
1317 fprintf_unfiltered (file,
1318 "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
1319 (long) current_gdbarch->fetch_pointer_argument);
1320 #ifdef TARGET_FLOAT_BIT
1321 fprintf_unfiltered (file,
1322 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1323 XSTRING (TARGET_FLOAT_BIT));
1324 #endif
1325 fprintf_unfiltered (file,
1326 "gdbarch_dump: float_bit = %s\n",
1327 paddr_d (current_gdbarch->float_bit));
1328 #ifdef TARGET_FLOAT_FORMAT
1329 fprintf_unfiltered (file,
1330 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1331 XSTRING (TARGET_FLOAT_FORMAT));
1332 #endif
1333 fprintf_unfiltered (file,
1334 "gdbarch_dump: float_format = %s\n",
1335 (TARGET_FLOAT_FORMAT)->name);
1336 #ifdef FP0_REGNUM
1337 fprintf_unfiltered (file,
1338 "gdbarch_dump: FP0_REGNUM # %s\n",
1339 XSTRING (FP0_REGNUM));
1340 #endif
1341 fprintf_unfiltered (file,
1342 "gdbarch_dump: fp0_regnum = %s\n",
1343 paddr_d (current_gdbarch->fp0_regnum));
1344 fprintf_unfiltered (file,
1345 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1346 gdbarch_frame_align_p (current_gdbarch));
1347 fprintf_unfiltered (file,
1348 "gdbarch_dump: frame_align = <0x%lx>\n",
1349 (long) current_gdbarch->frame_align);
1350 #ifdef FRAME_ARGS_SKIP
1351 fprintf_unfiltered (file,
1352 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1353 XSTRING (FRAME_ARGS_SKIP));
1354 #endif
1355 fprintf_unfiltered (file,
1356 "gdbarch_dump: frame_args_skip = 0x%s\n",
1357 paddr_nz (current_gdbarch->frame_args_skip));
1358 #ifdef FRAME_NUM_ARGS_P
1359 fprintf_unfiltered (file,
1360 "gdbarch_dump: %s # %s\n",
1361 "FRAME_NUM_ARGS_P()",
1362 XSTRING (FRAME_NUM_ARGS_P ()));
1363 #endif
1364 fprintf_unfiltered (file,
1365 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
1366 gdbarch_frame_num_args_p (current_gdbarch));
1367 #ifdef FRAME_NUM_ARGS
1368 fprintf_unfiltered (file,
1369 "gdbarch_dump: %s # %s\n",
1370 "FRAME_NUM_ARGS(frame)",
1371 XSTRING (FRAME_NUM_ARGS (frame)));
1372 #endif
1373 fprintf_unfiltered (file,
1374 "gdbarch_dump: frame_num_args = <0x%lx>\n",
1375 (long) current_gdbarch->frame_num_args);
1376 #ifdef FRAME_RED_ZONE_SIZE
1377 fprintf_unfiltered (file,
1378 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1379 XSTRING (FRAME_RED_ZONE_SIZE));
1380 #endif
1381 fprintf_unfiltered (file,
1382 "gdbarch_dump: frame_red_zone_size = %s\n",
1383 paddr_d (current_gdbarch->frame_red_zone_size));
1384 #ifdef GET_LONGJMP_TARGET_P
1385 fprintf_unfiltered (file,
1386 "gdbarch_dump: %s # %s\n",
1387 "GET_LONGJMP_TARGET_P()",
1388 XSTRING (GET_LONGJMP_TARGET_P ()));
1389 #endif
1390 fprintf_unfiltered (file,
1391 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
1392 gdbarch_get_longjmp_target_p (current_gdbarch));
1393 #ifdef GET_LONGJMP_TARGET
1394 fprintf_unfiltered (file,
1395 "gdbarch_dump: %s # %s\n",
1396 "GET_LONGJMP_TARGET(pc)",
1397 XSTRING (GET_LONGJMP_TARGET (pc)));
1398 #endif
1399 fprintf_unfiltered (file,
1400 "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
1401 (long) current_gdbarch->get_longjmp_target);
1402 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1403 fprintf_unfiltered (file,
1404 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1405 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1406 #endif
1407 fprintf_unfiltered (file,
1408 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
1409 paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
1410 fprintf_unfiltered (file,
1411 "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
1412 (long) current_gdbarch->in_function_epilogue_p);
1413 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1414 fprintf_unfiltered (file,
1415 "gdbarch_dump: %s # %s\n",
1416 "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1417 XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
1418 #endif
1419 fprintf_unfiltered (file,
1420 "gdbarch_dump: in_solib_call_trampoline = <0x%lx>\n",
1421 (long) current_gdbarch->in_solib_call_trampoline);
1422 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1423 fprintf_unfiltered (file,
1424 "gdbarch_dump: %s # %s\n",
1425 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1426 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1427 #endif
1428 fprintf_unfiltered (file,
1429 "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
1430 (long) current_gdbarch->in_solib_return_trampoline);
1431 #ifdef INNER_THAN
1432 fprintf_unfiltered (file,
1433 "gdbarch_dump: %s # %s\n",
1434 "INNER_THAN(lhs, rhs)",
1435 XSTRING (INNER_THAN (lhs, rhs)));
1436 #endif
1437 fprintf_unfiltered (file,
1438 "gdbarch_dump: inner_than = <0x%lx>\n",
1439 (long) current_gdbarch->inner_than);
1440 #ifdef TARGET_INT_BIT
1441 fprintf_unfiltered (file,
1442 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1443 XSTRING (TARGET_INT_BIT));
1444 #endif
1445 fprintf_unfiltered (file,
1446 "gdbarch_dump: int_bit = %s\n",
1447 paddr_d (current_gdbarch->int_bit));
1448 #ifdef INTEGER_TO_ADDRESS_P
1449 fprintf_unfiltered (file,
1450 "gdbarch_dump: %s # %s\n",
1451 "INTEGER_TO_ADDRESS_P()",
1452 XSTRING (INTEGER_TO_ADDRESS_P ()));
1453 #endif
1454 fprintf_unfiltered (file,
1455 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
1456 gdbarch_integer_to_address_p (current_gdbarch));
1457 #ifdef INTEGER_TO_ADDRESS
1458 fprintf_unfiltered (file,
1459 "gdbarch_dump: %s # %s\n",
1460 "INTEGER_TO_ADDRESS(type, buf)",
1461 XSTRING (INTEGER_TO_ADDRESS (type, buf)));
1462 #endif
1463 fprintf_unfiltered (file,
1464 "gdbarch_dump: integer_to_address = <0x%lx>\n",
1465 (long) current_gdbarch->integer_to_address);
1466 #ifdef TARGET_LONG_BIT
1467 fprintf_unfiltered (file,
1468 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1469 XSTRING (TARGET_LONG_BIT));
1470 #endif
1471 fprintf_unfiltered (file,
1472 "gdbarch_dump: long_bit = %s\n",
1473 paddr_d (current_gdbarch->long_bit));
1474 #ifdef TARGET_LONG_DOUBLE_BIT
1475 fprintf_unfiltered (file,
1476 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1477 XSTRING (TARGET_LONG_DOUBLE_BIT));
1478 #endif
1479 fprintf_unfiltered (file,
1480 "gdbarch_dump: long_double_bit = %s\n",
1481 paddr_d (current_gdbarch->long_double_bit));
1482 #ifdef TARGET_LONG_DOUBLE_FORMAT
1483 fprintf_unfiltered (file,
1484 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1485 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1486 #endif
1487 fprintf_unfiltered (file,
1488 "gdbarch_dump: long_double_format = %s\n",
1489 (TARGET_LONG_DOUBLE_FORMAT)->name);
1490 #ifdef TARGET_LONG_LONG_BIT
1491 fprintf_unfiltered (file,
1492 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1493 XSTRING (TARGET_LONG_LONG_BIT));
1494 #endif
1495 fprintf_unfiltered (file,
1496 "gdbarch_dump: long_long_bit = %s\n",
1497 paddr_d (current_gdbarch->long_long_bit));
1498 #ifdef MEMORY_INSERT_BREAKPOINT
1499 fprintf_unfiltered (file,
1500 "gdbarch_dump: %s # %s\n",
1501 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1502 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1503 #endif
1504 fprintf_unfiltered (file,
1505 "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
1506 (long) current_gdbarch->memory_insert_breakpoint);
1507 #ifdef MEMORY_REMOVE_BREAKPOINT
1508 fprintf_unfiltered (file,
1509 "gdbarch_dump: %s # %s\n",
1510 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1511 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1512 #endif
1513 fprintf_unfiltered (file,
1514 "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
1515 (long) current_gdbarch->memory_remove_breakpoint);
1516 #ifdef NAME_OF_MALLOC
1517 fprintf_unfiltered (file,
1518 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1519 XSTRING (NAME_OF_MALLOC));
1520 #endif
1521 fprintf_unfiltered (file,
1522 "gdbarch_dump: name_of_malloc = %s\n",
1523 NAME_OF_MALLOC);
1524 #ifdef NUM_PSEUDO_REGS
1525 fprintf_unfiltered (file,
1526 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1527 XSTRING (NUM_PSEUDO_REGS));
1528 #endif
1529 fprintf_unfiltered (file,
1530 "gdbarch_dump: num_pseudo_regs = %s\n",
1531 paddr_d (current_gdbarch->num_pseudo_regs));
1532 #ifdef NUM_REGS
1533 fprintf_unfiltered (file,
1534 "gdbarch_dump: NUM_REGS # %s\n",
1535 XSTRING (NUM_REGS));
1536 #endif
1537 fprintf_unfiltered (file,
1538 "gdbarch_dump: num_regs = %s\n",
1539 paddr_d (current_gdbarch->num_regs));
1540 #ifdef TARGET_OSABI
1541 fprintf_unfiltered (file,
1542 "gdbarch_dump: TARGET_OSABI # %s\n",
1543 XSTRING (TARGET_OSABI));
1544 #endif
1545 fprintf_unfiltered (file,
1546 "gdbarch_dump: osabi = %s\n",
1547 paddr_d (current_gdbarch->osabi));
1548 #ifdef PC_REGNUM
1549 fprintf_unfiltered (file,
1550 "gdbarch_dump: PC_REGNUM # %s\n",
1551 XSTRING (PC_REGNUM));
1552 #endif
1553 fprintf_unfiltered (file,
1554 "gdbarch_dump: pc_regnum = %s\n",
1555 paddr_d (current_gdbarch->pc_regnum));
1556 #ifdef POINTER_TO_ADDRESS
1557 fprintf_unfiltered (file,
1558 "gdbarch_dump: %s # %s\n",
1559 "POINTER_TO_ADDRESS(type, buf)",
1560 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1561 #endif
1562 fprintf_unfiltered (file,
1563 "gdbarch_dump: pointer_to_address = <0x%lx>\n",
1564 (long) current_gdbarch->pointer_to_address);
1565 fprintf_unfiltered (file,
1566 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1567 gdbarch_print_float_info_p (current_gdbarch));
1568 fprintf_unfiltered (file,
1569 "gdbarch_dump: print_float_info = <0x%lx>\n",
1570 (long) current_gdbarch->print_float_info);
1571 #ifdef TARGET_PRINT_INSN
1572 fprintf_unfiltered (file,
1573 "gdbarch_dump: %s # %s\n",
1574 "TARGET_PRINT_INSN(vma, info)",
1575 XSTRING (TARGET_PRINT_INSN (vma, info)));
1576 #endif
1577 fprintf_unfiltered (file,
1578 "gdbarch_dump: print_insn = <0x%lx>\n",
1579 (long) current_gdbarch->print_insn);
1580 fprintf_unfiltered (file,
1581 "gdbarch_dump: print_registers_info = <0x%lx>\n",
1582 (long) current_gdbarch->print_registers_info);
1583 fprintf_unfiltered (file,
1584 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1585 gdbarch_print_vector_info_p (current_gdbarch));
1586 fprintf_unfiltered (file,
1587 "gdbarch_dump: print_vector_info = <0x%lx>\n",
1588 (long) current_gdbarch->print_vector_info);
1589 #ifdef PS_REGNUM
1590 fprintf_unfiltered (file,
1591 "gdbarch_dump: PS_REGNUM # %s\n",
1592 XSTRING (PS_REGNUM));
1593 #endif
1594 fprintf_unfiltered (file,
1595 "gdbarch_dump: ps_regnum = %s\n",
1596 paddr_d (current_gdbarch->ps_regnum));
1597 fprintf_unfiltered (file,
1598 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1599 gdbarch_pseudo_register_read_p (current_gdbarch));
1600 fprintf_unfiltered (file,
1601 "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
1602 (long) current_gdbarch->pseudo_register_read);
1603 fprintf_unfiltered (file,
1604 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1605 gdbarch_pseudo_register_write_p (current_gdbarch));
1606 fprintf_unfiltered (file,
1607 "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
1608 (long) current_gdbarch->pseudo_register_write);
1609 #ifdef TARGET_PTR_BIT
1610 fprintf_unfiltered (file,
1611 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1612 XSTRING (TARGET_PTR_BIT));
1613 #endif
1614 fprintf_unfiltered (file,
1615 "gdbarch_dump: ptr_bit = %s\n",
1616 paddr_d (current_gdbarch->ptr_bit));
1617 fprintf_unfiltered (file,
1618 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1619 gdbarch_push_dummy_call_p (current_gdbarch));
1620 fprintf_unfiltered (file,
1621 "gdbarch_dump: push_dummy_call = <0x%lx>\n",
1622 (long) current_gdbarch->push_dummy_call);
1623 fprintf_unfiltered (file,
1624 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1625 gdbarch_push_dummy_code_p (current_gdbarch));
1626 fprintf_unfiltered (file,
1627 "gdbarch_dump: push_dummy_code = <0x%lx>\n",
1628 (long) current_gdbarch->push_dummy_code);
1629 #ifdef TARGET_READ_PC_P
1630 fprintf_unfiltered (file,
1631 "gdbarch_dump: %s # %s\n",
1632 "TARGET_READ_PC_P()",
1633 XSTRING (TARGET_READ_PC_P ()));
1634 #endif
1635 fprintf_unfiltered (file,
1636 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
1637 gdbarch_read_pc_p (current_gdbarch));
1638 #ifdef TARGET_READ_PC
1639 fprintf_unfiltered (file,
1640 "gdbarch_dump: %s # %s\n",
1641 "TARGET_READ_PC(ptid)",
1642 XSTRING (TARGET_READ_PC (ptid)));
1643 #endif
1644 fprintf_unfiltered (file,
1645 "gdbarch_dump: read_pc = <0x%lx>\n",
1646 (long) current_gdbarch->read_pc);
1647 #ifdef TARGET_READ_SP_P
1648 fprintf_unfiltered (file,
1649 "gdbarch_dump: %s # %s\n",
1650 "TARGET_READ_SP_P()",
1651 XSTRING (TARGET_READ_SP_P ()));
1652 #endif
1653 fprintf_unfiltered (file,
1654 "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
1655 gdbarch_read_sp_p (current_gdbarch));
1656 #ifdef TARGET_READ_SP
1657 fprintf_unfiltered (file,
1658 "gdbarch_dump: %s # %s\n",
1659 "TARGET_READ_SP()",
1660 XSTRING (TARGET_READ_SP ()));
1661 #endif
1662 fprintf_unfiltered (file,
1663 "gdbarch_dump: read_sp = <0x%lx>\n",
1664 (long) current_gdbarch->read_sp);
1665 #ifdef REGISTER_BYTES_OK_P
1666 fprintf_unfiltered (file,
1667 "gdbarch_dump: %s # %s\n",
1668 "REGISTER_BYTES_OK_P()",
1669 XSTRING (REGISTER_BYTES_OK_P ()));
1670 #endif
1671 fprintf_unfiltered (file,
1672 "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
1673 gdbarch_register_bytes_ok_p (current_gdbarch));
1674 #ifdef REGISTER_BYTES_OK
1675 fprintf_unfiltered (file,
1676 "gdbarch_dump: %s # %s\n",
1677 "REGISTER_BYTES_OK(nr_bytes)",
1678 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1679 #endif
1680 fprintf_unfiltered (file,
1681 "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
1682 (long) current_gdbarch->register_bytes_ok);
1683 #ifdef REGISTER_NAME
1684 fprintf_unfiltered (file,
1685 "gdbarch_dump: %s # %s\n",
1686 "REGISTER_NAME(regnr)",
1687 XSTRING (REGISTER_NAME (regnr)));
1688 #endif
1689 fprintf_unfiltered (file,
1690 "gdbarch_dump: register_name = <0x%lx>\n",
1691 (long) current_gdbarch->register_name);
1692 fprintf_unfiltered (file,
1693 "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
1694 (long) current_gdbarch->register_reggroup_p);
1695 #ifdef REGISTER_SIM_REGNO
1696 fprintf_unfiltered (file,
1697 "gdbarch_dump: %s # %s\n",
1698 "REGISTER_SIM_REGNO(reg_nr)",
1699 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1700 #endif
1701 fprintf_unfiltered (file,
1702 "gdbarch_dump: register_sim_regno = <0x%lx>\n",
1703 (long) current_gdbarch->register_sim_regno);
1704 #ifdef REGISTER_TO_VALUE
1705 fprintf_unfiltered (file,
1706 "gdbarch_dump: %s # %s\n",
1707 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1708 XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
1709 #endif
1710 fprintf_unfiltered (file,
1711 "gdbarch_dump: register_to_value = <0x%lx>\n",
1712 (long) current_gdbarch->register_to_value);
1713 fprintf_unfiltered (file,
1714 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1715 gdbarch_register_type_p (current_gdbarch));
1716 fprintf_unfiltered (file,
1717 "gdbarch_dump: register_type = <0x%lx>\n",
1718 (long) current_gdbarch->register_type);
1719 fprintf_unfiltered (file,
1720 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1721 gdbarch_regset_from_core_section_p (current_gdbarch));
1722 fprintf_unfiltered (file,
1723 "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
1724 (long) current_gdbarch->regset_from_core_section);
1725 fprintf_unfiltered (file,
1726 "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
1727 (long) current_gdbarch->remote_translate_xfer_address);
1728 fprintf_unfiltered (file,
1729 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1730 gdbarch_return_value_p (current_gdbarch));
1731 fprintf_unfiltered (file,
1732 "gdbarch_dump: return_value = <0x%lx>\n",
1733 (long) current_gdbarch->return_value);
1734 #ifdef SDB_REG_TO_REGNUM
1735 fprintf_unfiltered (file,
1736 "gdbarch_dump: %s # %s\n",
1737 "SDB_REG_TO_REGNUM(sdb_regnr)",
1738 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1739 #endif
1740 fprintf_unfiltered (file,
1741 "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
1742 (long) current_gdbarch->sdb_reg_to_regnum);
1743 #ifdef TARGET_SHORT_BIT
1744 fprintf_unfiltered (file,
1745 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1746 XSTRING (TARGET_SHORT_BIT));
1747 #endif
1748 fprintf_unfiltered (file,
1749 "gdbarch_dump: short_bit = %s\n",
1750 paddr_d (current_gdbarch->short_bit));
1751 #ifdef SKIP_PROLOGUE
1752 fprintf_unfiltered (file,
1753 "gdbarch_dump: %s # %s\n",
1754 "SKIP_PROLOGUE(ip)",
1755 XSTRING (SKIP_PROLOGUE (ip)));
1756 #endif
1757 fprintf_unfiltered (file,
1758 "gdbarch_dump: skip_prologue = <0x%lx>\n",
1759 (long) current_gdbarch->skip_prologue);
1760 fprintf_unfiltered (file,
1761 "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1762 (long) current_gdbarch->skip_solib_resolver);
1763 #ifdef SKIP_TRAMPOLINE_CODE
1764 fprintf_unfiltered (file,
1765 "gdbarch_dump: %s # %s\n",
1766 "SKIP_TRAMPOLINE_CODE(pc)",
1767 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1768 #endif
1769 fprintf_unfiltered (file,
1770 "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1771 (long) current_gdbarch->skip_trampoline_code);
1772 #ifdef SMASH_TEXT_ADDRESS
1773 fprintf_unfiltered (file,
1774 "gdbarch_dump: %s # %s\n",
1775 "SMASH_TEXT_ADDRESS(addr)",
1776 XSTRING (SMASH_TEXT_ADDRESS (addr)));
1777 #endif
1778 fprintf_unfiltered (file,
1779 "gdbarch_dump: smash_text_address = <0x%lx>\n",
1780 (long) current_gdbarch->smash_text_address);
1781 #ifdef SOFTWARE_SINGLE_STEP_P
1782 fprintf_unfiltered (file,
1783 "gdbarch_dump: %s # %s\n",
1784 "SOFTWARE_SINGLE_STEP_P()",
1785 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1786 #endif
1787 fprintf_unfiltered (file,
1788 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1789 gdbarch_software_single_step_p (current_gdbarch));
1790 #ifdef SOFTWARE_SINGLE_STEP
1791 fprintf_unfiltered (file,
1792 "gdbarch_dump: %s # %s\n",
1793 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1794 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1795 #endif
1796 fprintf_unfiltered (file,
1797 "gdbarch_dump: software_single_step = <0x%lx>\n",
1798 (long) current_gdbarch->software_single_step);
1799 #ifdef SP_REGNUM
1800 fprintf_unfiltered (file,
1801 "gdbarch_dump: SP_REGNUM # %s\n",
1802 XSTRING (SP_REGNUM));
1803 #endif
1804 fprintf_unfiltered (file,
1805 "gdbarch_dump: sp_regnum = %s\n",
1806 paddr_d (current_gdbarch->sp_regnum));
1807 #ifdef STAB_REG_TO_REGNUM
1808 fprintf_unfiltered (file,
1809 "gdbarch_dump: %s # %s\n",
1810 "STAB_REG_TO_REGNUM(stab_regnr)",
1811 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
1812 #endif
1813 fprintf_unfiltered (file,
1814 "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1815 (long) current_gdbarch->stab_reg_to_regnum);
1816 fprintf_unfiltered (file,
1817 "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1818 (long) current_gdbarch->stabs_argument_has_addr);
1819 #ifdef STORE_RETURN_VALUE
1820 fprintf_unfiltered (file,
1821 "gdbarch_dump: %s # %s\n",
1822 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1823 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1824 #endif
1825 fprintf_unfiltered (file,
1826 "gdbarch_dump: store_return_value = <0x%lx>\n",
1827 (long) current_gdbarch->store_return_value);
1828 fprintf_unfiltered (file,
1829 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
1830 gdbarch_unwind_dummy_id_p (current_gdbarch));
1831 fprintf_unfiltered (file,
1832 "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
1833 (long) current_gdbarch->unwind_dummy_id);
1834 fprintf_unfiltered (file,
1835 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1836 gdbarch_unwind_pc_p (current_gdbarch));
1837 fprintf_unfiltered (file,
1838 "gdbarch_dump: unwind_pc = <0x%lx>\n",
1839 (long) current_gdbarch->unwind_pc);
1840 fprintf_unfiltered (file,
1841 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1842 gdbarch_unwind_sp_p (current_gdbarch));
1843 fprintf_unfiltered (file,
1844 "gdbarch_dump: unwind_sp = <0x%lx>\n",
1845 (long) current_gdbarch->unwind_sp);
1846 #ifdef VALUE_TO_REGISTER
1847 fprintf_unfiltered (file,
1848 "gdbarch_dump: %s # %s\n",
1849 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
1850 XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
1851 #endif
1852 fprintf_unfiltered (file,
1853 "gdbarch_dump: value_to_register = <0x%lx>\n",
1854 (long) current_gdbarch->value_to_register);
1855 #ifdef TARGET_VIRTUAL_FRAME_POINTER
1856 fprintf_unfiltered (file,
1857 "gdbarch_dump: %s # %s\n",
1858 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
1859 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
1860 #endif
1861 fprintf_unfiltered (file,
1862 "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1863 (long) current_gdbarch->virtual_frame_pointer);
1864 #ifdef TARGET_WRITE_PC
1865 fprintf_unfiltered (file,
1866 "gdbarch_dump: %s # %s\n",
1867 "TARGET_WRITE_PC(val, ptid)",
1868 XSTRING (TARGET_WRITE_PC (val, ptid)));
1869 #endif
1870 fprintf_unfiltered (file,
1871 "gdbarch_dump: write_pc = <0x%lx>\n",
1872 (long) current_gdbarch->write_pc);
1873 if (current_gdbarch->dump_tdep != NULL)
1874 current_gdbarch->dump_tdep (current_gdbarch, file);
1875 }
1876
1877 struct gdbarch_tdep *
1878 gdbarch_tdep (struct gdbarch *gdbarch)
1879 {
1880 if (gdbarch_debug >= 2)
1881 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1882 return gdbarch->tdep;
1883 }
1884
1885
1886 const struct bfd_arch_info *
1887 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1888 {
1889 gdb_assert (gdbarch != NULL);
1890 if (gdbarch_debug >= 2)
1891 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1892 return gdbarch->bfd_arch_info;
1893 }
1894
1895 int
1896 gdbarch_byte_order (struct gdbarch *gdbarch)
1897 {
1898 gdb_assert (gdbarch != NULL);
1899 if (gdbarch_debug >= 2)
1900 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1901 return gdbarch->byte_order;
1902 }
1903
1904 enum gdb_osabi
1905 gdbarch_osabi (struct gdbarch *gdbarch)
1906 {
1907 gdb_assert (gdbarch != NULL);
1908 if (gdbarch_debug >= 2)
1909 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1910 return gdbarch->osabi;
1911 }
1912
1913 int
1914 gdbarch_short_bit (struct gdbarch *gdbarch)
1915 {
1916 gdb_assert (gdbarch != NULL);
1917 /* Skip verify of short_bit, invalid_p == 0 */
1918 if (gdbarch_debug >= 2)
1919 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1920 return gdbarch->short_bit;
1921 }
1922
1923 void
1924 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1925 int short_bit)
1926 {
1927 gdbarch->short_bit = short_bit;
1928 }
1929
1930 int
1931 gdbarch_int_bit (struct gdbarch *gdbarch)
1932 {
1933 gdb_assert (gdbarch != NULL);
1934 /* Skip verify of int_bit, invalid_p == 0 */
1935 if (gdbarch_debug >= 2)
1936 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1937 return gdbarch->int_bit;
1938 }
1939
1940 void
1941 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1942 int int_bit)
1943 {
1944 gdbarch->int_bit = int_bit;
1945 }
1946
1947 int
1948 gdbarch_long_bit (struct gdbarch *gdbarch)
1949 {
1950 gdb_assert (gdbarch != NULL);
1951 /* Skip verify of long_bit, invalid_p == 0 */
1952 if (gdbarch_debug >= 2)
1953 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1954 return gdbarch->long_bit;
1955 }
1956
1957 void
1958 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1959 int long_bit)
1960 {
1961 gdbarch->long_bit = long_bit;
1962 }
1963
1964 int
1965 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1966 {
1967 gdb_assert (gdbarch != NULL);
1968 /* Skip verify of long_long_bit, invalid_p == 0 */
1969 if (gdbarch_debug >= 2)
1970 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1971 return gdbarch->long_long_bit;
1972 }
1973
1974 void
1975 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1976 int long_long_bit)
1977 {
1978 gdbarch->long_long_bit = long_long_bit;
1979 }
1980
1981 int
1982 gdbarch_float_bit (struct gdbarch *gdbarch)
1983 {
1984 gdb_assert (gdbarch != NULL);
1985 /* Skip verify of float_bit, invalid_p == 0 */
1986 if (gdbarch_debug >= 2)
1987 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1988 return gdbarch->float_bit;
1989 }
1990
1991 void
1992 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1993 int float_bit)
1994 {
1995 gdbarch->float_bit = float_bit;
1996 }
1997
1998 int
1999 gdbarch_double_bit (struct gdbarch *gdbarch)
2000 {
2001 gdb_assert (gdbarch != NULL);
2002 /* Skip verify of double_bit, invalid_p == 0 */
2003 if (gdbarch_debug >= 2)
2004 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
2005 return gdbarch->double_bit;
2006 }
2007
2008 void
2009 set_gdbarch_double_bit (struct gdbarch *gdbarch,
2010 int double_bit)
2011 {
2012 gdbarch->double_bit = double_bit;
2013 }
2014
2015 int
2016 gdbarch_long_double_bit (struct gdbarch *gdbarch)
2017 {
2018 gdb_assert (gdbarch != NULL);
2019 /* Skip verify of long_double_bit, invalid_p == 0 */
2020 if (gdbarch_debug >= 2)
2021 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2022 return gdbarch->long_double_bit;
2023 }
2024
2025 void
2026 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2027 int long_double_bit)
2028 {
2029 gdbarch->long_double_bit = long_double_bit;
2030 }
2031
2032 int
2033 gdbarch_ptr_bit (struct gdbarch *gdbarch)
2034 {
2035 gdb_assert (gdbarch != NULL);
2036 /* Skip verify of ptr_bit, invalid_p == 0 */
2037 if (gdbarch_debug >= 2)
2038 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
2039 return gdbarch->ptr_bit;
2040 }
2041
2042 void
2043 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
2044 int ptr_bit)
2045 {
2046 gdbarch->ptr_bit = ptr_bit;
2047 }
2048
2049 int
2050 gdbarch_addr_bit (struct gdbarch *gdbarch)
2051 {
2052 gdb_assert (gdbarch != NULL);
2053 /* Check variable changed from pre-default. */
2054 gdb_assert (gdbarch->addr_bit != 0);
2055 if (gdbarch_debug >= 2)
2056 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
2057 return gdbarch->addr_bit;
2058 }
2059
2060 void
2061 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
2062 int addr_bit)
2063 {
2064 gdbarch->addr_bit = addr_bit;
2065 }
2066
2067 int
2068 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
2069 {
2070 gdb_assert (gdbarch != NULL);
2071 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
2072 if (gdbarch_debug >= 2)
2073 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
2074 return gdbarch->bfd_vma_bit;
2075 }
2076
2077 void
2078 set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
2079 int bfd_vma_bit)
2080 {
2081 gdbarch->bfd_vma_bit = bfd_vma_bit;
2082 }
2083
2084 int
2085 gdbarch_char_signed (struct gdbarch *gdbarch)
2086 {
2087 gdb_assert (gdbarch != NULL);
2088 /* Check variable changed from pre-default. */
2089 gdb_assert (gdbarch->char_signed != -1);
2090 if (gdbarch_debug >= 2)
2091 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
2092 return gdbarch->char_signed;
2093 }
2094
2095 void
2096 set_gdbarch_char_signed (struct gdbarch *gdbarch,
2097 int char_signed)
2098 {
2099 gdbarch->char_signed = char_signed;
2100 }
2101
2102 int
2103 gdbarch_read_pc_p (struct gdbarch *gdbarch)
2104 {
2105 gdb_assert (gdbarch != NULL);
2106 return gdbarch->read_pc != NULL;
2107 }
2108
2109 CORE_ADDR
2110 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
2111 {
2112 gdb_assert (gdbarch != NULL);
2113 gdb_assert (gdbarch->read_pc != NULL);
2114 if (gdbarch_debug >= 2)
2115 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
2116 return gdbarch->read_pc (ptid);
2117 }
2118
2119 void
2120 set_gdbarch_read_pc (struct gdbarch *gdbarch,
2121 gdbarch_read_pc_ftype read_pc)
2122 {
2123 gdbarch->read_pc = read_pc;
2124 }
2125
2126 void
2127 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
2128 {
2129 gdb_assert (gdbarch != NULL);
2130 gdb_assert (gdbarch->write_pc != NULL);
2131 if (gdbarch_debug >= 2)
2132 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
2133 gdbarch->write_pc (val, ptid);
2134 }
2135
2136 void
2137 set_gdbarch_write_pc (struct gdbarch *gdbarch,
2138 gdbarch_write_pc_ftype write_pc)
2139 {
2140 gdbarch->write_pc = write_pc;
2141 }
2142
2143 int
2144 gdbarch_read_sp_p (struct gdbarch *gdbarch)
2145 {
2146 gdb_assert (gdbarch != NULL);
2147 return gdbarch->read_sp != NULL;
2148 }
2149
2150 CORE_ADDR
2151 gdbarch_read_sp (struct gdbarch *gdbarch)
2152 {
2153 gdb_assert (gdbarch != NULL);
2154 gdb_assert (gdbarch->read_sp != NULL);
2155 if (gdbarch_debug >= 2)
2156 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2157 return gdbarch->read_sp ();
2158 }
2159
2160 void
2161 set_gdbarch_read_sp (struct gdbarch *gdbarch,
2162 gdbarch_read_sp_ftype read_sp)
2163 {
2164 gdbarch->read_sp = read_sp;
2165 }
2166
2167 void
2168 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
2169 {
2170 gdb_assert (gdbarch != NULL);
2171 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
2172 if (gdbarch_debug >= 2)
2173 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
2174 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
2175 }
2176
2177 void
2178 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
2179 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
2180 {
2181 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
2182 }
2183
2184 int
2185 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
2186 {
2187 gdb_assert (gdbarch != NULL);
2188 return gdbarch->pseudo_register_read != NULL;
2189 }
2190
2191 void
2192 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf)
2193 {
2194 gdb_assert (gdbarch != NULL);
2195 gdb_assert (gdbarch->pseudo_register_read != NULL);
2196 if (gdbarch_debug >= 2)
2197 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
2198 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
2199 }
2200
2201 void
2202 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
2203 gdbarch_pseudo_register_read_ftype pseudo_register_read)
2204 {
2205 gdbarch->pseudo_register_read = pseudo_register_read;
2206 }
2207
2208 int
2209 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
2210 {
2211 gdb_assert (gdbarch != NULL);
2212 return gdbarch->pseudo_register_write != NULL;
2213 }
2214
2215 void
2216 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf)
2217 {
2218 gdb_assert (gdbarch != NULL);
2219 gdb_assert (gdbarch->pseudo_register_write != NULL);
2220 if (gdbarch_debug >= 2)
2221 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
2222 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
2223 }
2224
2225 void
2226 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
2227 gdbarch_pseudo_register_write_ftype pseudo_register_write)
2228 {
2229 gdbarch->pseudo_register_write = pseudo_register_write;
2230 }
2231
2232 int
2233 gdbarch_num_regs (struct gdbarch *gdbarch)
2234 {
2235 gdb_assert (gdbarch != NULL);
2236 /* Check variable changed from pre-default. */
2237 gdb_assert (gdbarch->num_regs != -1);
2238 if (gdbarch_debug >= 2)
2239 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2240 return gdbarch->num_regs;
2241 }
2242
2243 void
2244 set_gdbarch_num_regs (struct gdbarch *gdbarch,
2245 int num_regs)
2246 {
2247 gdbarch->num_regs = num_regs;
2248 }
2249
2250 int
2251 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2252 {
2253 gdb_assert (gdbarch != NULL);
2254 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2255 if (gdbarch_debug >= 2)
2256 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2257 return gdbarch->num_pseudo_regs;
2258 }
2259
2260 void
2261 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2262 int num_pseudo_regs)
2263 {
2264 gdbarch->num_pseudo_regs = num_pseudo_regs;
2265 }
2266
2267 int
2268 gdbarch_sp_regnum (struct gdbarch *gdbarch)
2269 {
2270 gdb_assert (gdbarch != NULL);
2271 /* Skip verify of sp_regnum, invalid_p == 0 */
2272 if (gdbarch_debug >= 2)
2273 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2274 return gdbarch->sp_regnum;
2275 }
2276
2277 void
2278 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2279 int sp_regnum)
2280 {
2281 gdbarch->sp_regnum = sp_regnum;
2282 }
2283
2284 int
2285 gdbarch_pc_regnum (struct gdbarch *gdbarch)
2286 {
2287 gdb_assert (gdbarch != NULL);
2288 /* Skip verify of pc_regnum, invalid_p == 0 */
2289 if (gdbarch_debug >= 2)
2290 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2291 return gdbarch->pc_regnum;
2292 }
2293
2294 void
2295 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2296 int pc_regnum)
2297 {
2298 gdbarch->pc_regnum = pc_regnum;
2299 }
2300
2301 int
2302 gdbarch_ps_regnum (struct gdbarch *gdbarch)
2303 {
2304 gdb_assert (gdbarch != NULL);
2305 /* Skip verify of ps_regnum, invalid_p == 0 */
2306 if (gdbarch_debug >= 2)
2307 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2308 return gdbarch->ps_regnum;
2309 }
2310
2311 void
2312 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2313 int ps_regnum)
2314 {
2315 gdbarch->ps_regnum = ps_regnum;
2316 }
2317
2318 int
2319 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2320 {
2321 gdb_assert (gdbarch != NULL);
2322 /* Skip verify of fp0_regnum, invalid_p == 0 */
2323 if (gdbarch_debug >= 2)
2324 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2325 return gdbarch->fp0_regnum;
2326 }
2327
2328 void
2329 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2330 int fp0_regnum)
2331 {
2332 gdbarch->fp0_regnum = fp0_regnum;
2333 }
2334
2335 int
2336 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2337 {
2338 gdb_assert (gdbarch != NULL);
2339 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
2340 if (gdbarch_debug >= 2)
2341 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2342 return gdbarch->stab_reg_to_regnum (stab_regnr);
2343 }
2344
2345 void
2346 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2347 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2348 {
2349 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2350 }
2351
2352 int
2353 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2354 {
2355 gdb_assert (gdbarch != NULL);
2356 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
2357 if (gdbarch_debug >= 2)
2358 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2359 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2360 }
2361
2362 void
2363 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2364 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2365 {
2366 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2367 }
2368
2369 int
2370 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2371 {
2372 gdb_assert (gdbarch != NULL);
2373 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
2374 if (gdbarch_debug >= 2)
2375 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2376 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2377 }
2378
2379 void
2380 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2381 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2382 {
2383 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2384 }
2385
2386 int
2387 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2388 {
2389 gdb_assert (gdbarch != NULL);
2390 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
2391 if (gdbarch_debug >= 2)
2392 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2393 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2394 }
2395
2396 void
2397 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2398 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2399 {
2400 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2401 }
2402
2403 int
2404 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2405 {
2406 gdb_assert (gdbarch != NULL);
2407 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
2408 if (gdbarch_debug >= 2)
2409 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2410 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2411 }
2412
2413 void
2414 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2415 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2416 {
2417 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2418 }
2419
2420 const char *
2421 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2422 {
2423 gdb_assert (gdbarch != NULL);
2424 gdb_assert (gdbarch->register_name != NULL);
2425 if (gdbarch_debug >= 2)
2426 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2427 return gdbarch->register_name (regnr);
2428 }
2429
2430 void
2431 set_gdbarch_register_name (struct gdbarch *gdbarch,
2432 gdbarch_register_name_ftype register_name)
2433 {
2434 gdbarch->register_name = register_name;
2435 }
2436
2437 int
2438 gdbarch_register_type_p (struct gdbarch *gdbarch)
2439 {
2440 gdb_assert (gdbarch != NULL);
2441 return gdbarch->register_type != NULL;
2442 }
2443
2444 struct type *
2445 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2446 {
2447 gdb_assert (gdbarch != NULL);
2448 gdb_assert (gdbarch->register_type != NULL);
2449 if (gdbarch_debug >= 2)
2450 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2451 return gdbarch->register_type (gdbarch, reg_nr);
2452 }
2453
2454 void
2455 set_gdbarch_register_type (struct gdbarch *gdbarch,
2456 gdbarch_register_type_ftype register_type)
2457 {
2458 gdbarch->register_type = register_type;
2459 }
2460
2461 int
2462 gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch)
2463 {
2464 gdb_assert (gdbarch != NULL);
2465 return gdbarch->deprecated_register_byte != generic_register_byte;
2466 }
2467
2468 int
2469 gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr)
2470 {
2471 gdb_assert (gdbarch != NULL);
2472 gdb_assert (gdbarch->deprecated_register_byte != NULL);
2473 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
2474 if (gdbarch_debug >= 2)
2475 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n");
2476 return gdbarch->deprecated_register_byte (reg_nr);
2477 }
2478
2479 void
2480 set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch,
2481 gdbarch_deprecated_register_byte_ftype deprecated_register_byte)
2482 {
2483 gdbarch->deprecated_register_byte = deprecated_register_byte;
2484 }
2485
2486 int
2487 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
2488 {
2489 gdb_assert (gdbarch != NULL);
2490 return gdbarch->unwind_dummy_id != NULL;
2491 }
2492
2493 struct frame_id
2494 gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
2495 {
2496 gdb_assert (gdbarch != NULL);
2497 gdb_assert (gdbarch->unwind_dummy_id != NULL);
2498 if (gdbarch_debug >= 2)
2499 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
2500 return gdbarch->unwind_dummy_id (gdbarch, info);
2501 }
2502
2503 void
2504 set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
2505 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
2506 {
2507 gdbarch->unwind_dummy_id = unwind_dummy_id;
2508 }
2509
2510 int
2511 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2512 {
2513 gdb_assert (gdbarch != NULL);
2514 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2515 if (gdbarch_debug >= 2)
2516 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2517 return gdbarch->deprecated_fp_regnum;
2518 }
2519
2520 void
2521 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2522 int deprecated_fp_regnum)
2523 {
2524 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2525 }
2526
2527 int
2528 gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch)
2529 {
2530 gdb_assert (gdbarch != NULL);
2531 return gdbarch->deprecated_target_read_fp != NULL;
2532 }
2533
2534 CORE_ADDR
2535 gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch)
2536 {
2537 gdb_assert (gdbarch != NULL);
2538 gdb_assert (gdbarch->deprecated_target_read_fp != NULL);
2539 if (gdbarch_debug >= 2)
2540 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_target_read_fp called\n");
2541 return gdbarch->deprecated_target_read_fp ();
2542 }
2543
2544 void
2545 set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch,
2546 gdbarch_deprecated_target_read_fp_ftype deprecated_target_read_fp)
2547 {
2548 gdbarch->deprecated_target_read_fp = deprecated_target_read_fp;
2549 }
2550
2551 int
2552 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
2553 {
2554 gdb_assert (gdbarch != NULL);
2555 return gdbarch->push_dummy_call != NULL;
2556 }
2557
2558 CORE_ADDR
2559 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)
2560 {
2561 gdb_assert (gdbarch != NULL);
2562 gdb_assert (gdbarch->push_dummy_call != NULL);
2563 if (gdbarch_debug >= 2)
2564 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
2565 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
2566 }
2567
2568 void
2569 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2570 gdbarch_push_dummy_call_ftype push_dummy_call)
2571 {
2572 gdbarch->push_dummy_call = push_dummy_call;
2573 }
2574
2575 int
2576 gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch)
2577 {
2578 gdb_assert (gdbarch != NULL);
2579 return gdbarch->deprecated_push_arguments != NULL;
2580 }
2581
2582 CORE_ADDR
2583 gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
2584 {
2585 gdb_assert (gdbarch != NULL);
2586 gdb_assert (gdbarch->deprecated_push_arguments != NULL);
2587 if (gdbarch_debug >= 2)
2588 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n");
2589 return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr);
2590 }
2591
2592 void
2593 set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch,
2594 gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments)
2595 {
2596 gdbarch->deprecated_push_arguments = deprecated_push_arguments;
2597 }
2598
2599 int
2600 gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
2601 {
2602 gdb_assert (gdbarch != NULL);
2603 if (gdbarch_debug >= 2)
2604 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
2605 return gdbarch->deprecated_register_size;
2606 }
2607
2608 void
2609 set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
2610 int deprecated_register_size)
2611 {
2612 gdbarch->deprecated_register_size = deprecated_register_size;
2613 }
2614
2615 int
2616 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2617 {
2618 gdb_assert (gdbarch != NULL);
2619 /* Skip verify of call_dummy_location, invalid_p == 0 */
2620 if (gdbarch_debug >= 2)
2621 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2622 return gdbarch->call_dummy_location;
2623 }
2624
2625 void
2626 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2627 int call_dummy_location)
2628 {
2629 gdbarch->call_dummy_location = call_dummy_location;
2630 }
2631
2632 int
2633 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
2634 {
2635 gdb_assert (gdbarch != NULL);
2636 return gdbarch->push_dummy_code != NULL;
2637 }
2638
2639 CORE_ADDR
2640 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)
2641 {
2642 gdb_assert (gdbarch != NULL);
2643 gdb_assert (gdbarch->push_dummy_code != NULL);
2644 if (gdbarch_debug >= 2)
2645 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
2646 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
2647 }
2648
2649 void
2650 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2651 gdbarch_push_dummy_code_ftype push_dummy_code)
2652 {
2653 gdbarch->push_dummy_code = push_dummy_code;
2654 }
2655
2656 int
2657 gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch)
2658 {
2659 gdb_assert (gdbarch != NULL);
2660 return gdbarch->deprecated_do_registers_info != NULL;
2661 }
2662
2663 void
2664 gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
2665 {
2666 gdb_assert (gdbarch != NULL);
2667 gdb_assert (gdbarch->deprecated_do_registers_info != NULL);
2668 if (gdbarch_debug >= 2)
2669 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_do_registers_info called\n");
2670 gdbarch->deprecated_do_registers_info (reg_nr, fpregs);
2671 }
2672
2673 void
2674 set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch,
2675 gdbarch_deprecated_do_registers_info_ftype deprecated_do_registers_info)
2676 {
2677 gdbarch->deprecated_do_registers_info = deprecated_do_registers_info;
2678 }
2679
2680 void
2681 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2682 {
2683 gdb_assert (gdbarch != NULL);
2684 gdb_assert (gdbarch->print_registers_info != NULL);
2685 if (gdbarch_debug >= 2)
2686 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2687 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2688 }
2689
2690 void
2691 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2692 gdbarch_print_registers_info_ftype print_registers_info)
2693 {
2694 gdbarch->print_registers_info = print_registers_info;
2695 }
2696
2697 int
2698 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2699 {
2700 gdb_assert (gdbarch != NULL);
2701 return gdbarch->print_float_info != NULL;
2702 }
2703
2704 void
2705 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2706 {
2707 gdb_assert (gdbarch != NULL);
2708 gdb_assert (gdbarch->print_float_info != NULL);
2709 if (gdbarch_debug >= 2)
2710 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2711 gdbarch->print_float_info (gdbarch, file, frame, args);
2712 }
2713
2714 void
2715 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2716 gdbarch_print_float_info_ftype print_float_info)
2717 {
2718 gdbarch->print_float_info = print_float_info;
2719 }
2720
2721 int
2722 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2723 {
2724 gdb_assert (gdbarch != NULL);
2725 return gdbarch->print_vector_info != NULL;
2726 }
2727
2728 void
2729 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2730 {
2731 gdb_assert (gdbarch != NULL);
2732 gdb_assert (gdbarch->print_vector_info != NULL);
2733 if (gdbarch_debug >= 2)
2734 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2735 gdbarch->print_vector_info (gdbarch, file, frame, args);
2736 }
2737
2738 void
2739 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2740 gdbarch_print_vector_info_ftype print_vector_info)
2741 {
2742 gdbarch->print_vector_info = print_vector_info;
2743 }
2744
2745 int
2746 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
2747 {
2748 gdb_assert (gdbarch != NULL);
2749 gdb_assert (gdbarch->register_sim_regno != NULL);
2750 if (gdbarch_debug >= 2)
2751 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
2752 return gdbarch->register_sim_regno (reg_nr);
2753 }
2754
2755 void
2756 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2757 gdbarch_register_sim_regno_ftype register_sim_regno)
2758 {
2759 gdbarch->register_sim_regno = register_sim_regno;
2760 }
2761
2762 int
2763 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
2764 {
2765 gdb_assert (gdbarch != NULL);
2766 return gdbarch->register_bytes_ok != NULL;
2767 }
2768
2769 int
2770 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
2771 {
2772 gdb_assert (gdbarch != NULL);
2773 gdb_assert (gdbarch->register_bytes_ok != NULL);
2774 if (gdbarch_debug >= 2)
2775 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
2776 return gdbarch->register_bytes_ok (nr_bytes);
2777 }
2778
2779 void
2780 set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
2781 gdbarch_register_bytes_ok_ftype register_bytes_ok)
2782 {
2783 gdbarch->register_bytes_ok = register_bytes_ok;
2784 }
2785
2786 int
2787 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
2788 {
2789 gdb_assert (gdbarch != NULL);
2790 gdb_assert (gdbarch->cannot_fetch_register != NULL);
2791 if (gdbarch_debug >= 2)
2792 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
2793 return gdbarch->cannot_fetch_register (regnum);
2794 }
2795
2796 void
2797 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2798 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2799 {
2800 gdbarch->cannot_fetch_register = cannot_fetch_register;
2801 }
2802
2803 int
2804 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
2805 {
2806 gdb_assert (gdbarch != NULL);
2807 gdb_assert (gdbarch->cannot_store_register != NULL);
2808 if (gdbarch_debug >= 2)
2809 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
2810 return gdbarch->cannot_store_register (regnum);
2811 }
2812
2813 void
2814 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2815 gdbarch_cannot_store_register_ftype cannot_store_register)
2816 {
2817 gdbarch->cannot_store_register = cannot_store_register;
2818 }
2819
2820 int
2821 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
2822 {
2823 gdb_assert (gdbarch != NULL);
2824 return gdbarch->get_longjmp_target != NULL;
2825 }
2826
2827 int
2828 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
2829 {
2830 gdb_assert (gdbarch != NULL);
2831 gdb_assert (gdbarch->get_longjmp_target != NULL);
2832 if (gdbarch_debug >= 2)
2833 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
2834 return gdbarch->get_longjmp_target (pc);
2835 }
2836
2837 void
2838 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2839 gdbarch_get_longjmp_target_ftype get_longjmp_target)
2840 {
2841 gdbarch->get_longjmp_target = get_longjmp_target;
2842 }
2843
2844 int
2845 gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch)
2846 {
2847 gdb_assert (gdbarch != NULL);
2848 return gdbarch->deprecated_init_frame_pc != NULL;
2849 }
2850
2851 CORE_ADDR
2852 gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
2853 {
2854 gdb_assert (gdbarch != NULL);
2855 gdb_assert (gdbarch->deprecated_init_frame_pc != NULL);
2856 if (gdbarch_debug >= 2)
2857 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc called\n");
2858 return gdbarch->deprecated_init_frame_pc (fromleaf, prev);
2859 }
2860
2861 void
2862 set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch,
2863 gdbarch_deprecated_init_frame_pc_ftype deprecated_init_frame_pc)
2864 {
2865 gdbarch->deprecated_init_frame_pc = deprecated_init_frame_pc;
2866 }
2867
2868 int
2869 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
2870 {
2871 gdb_assert (gdbarch != NULL);
2872 if (gdbarch_debug >= 2)
2873 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2874 return gdbarch->believe_pcc_promotion;
2875 }
2876
2877 void
2878 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2879 int believe_pcc_promotion)
2880 {
2881 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2882 }
2883
2884 int
2885 gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch)
2886 {
2887 gdb_assert (gdbarch != NULL);
2888 return gdbarch->deprecated_get_saved_register != NULL;
2889 }
2890
2891 void
2892 gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
2893 {
2894 gdb_assert (gdbarch != NULL);
2895 gdb_assert (gdbarch->deprecated_get_saved_register != NULL);
2896 if (gdbarch_debug >= 2)
2897 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_get_saved_register called\n");
2898 gdbarch->deprecated_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
2899 }
2900
2901 void
2902 set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch,
2903 gdbarch_deprecated_get_saved_register_ftype deprecated_get_saved_register)
2904 {
2905 gdbarch->deprecated_get_saved_register = deprecated_get_saved_register;
2906 }
2907
2908 int
2909 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
2910 {
2911 gdb_assert (gdbarch != NULL);
2912 gdb_assert (gdbarch->convert_register_p != NULL);
2913 if (gdbarch_debug >= 2)
2914 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
2915 return gdbarch->convert_register_p (regnum, type);
2916 }
2917
2918 void
2919 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2920 gdbarch_convert_register_p_ftype convert_register_p)
2921 {
2922 gdbarch->convert_register_p = convert_register_p;
2923 }
2924
2925 void
2926 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf)
2927 {
2928 gdb_assert (gdbarch != NULL);
2929 gdb_assert (gdbarch->register_to_value != NULL);
2930 if (gdbarch_debug >= 2)
2931 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2932 gdbarch->register_to_value (frame, regnum, type, buf);
2933 }
2934
2935 void
2936 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2937 gdbarch_register_to_value_ftype register_to_value)
2938 {
2939 gdbarch->register_to_value = register_to_value;
2940 }
2941
2942 void
2943 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf)
2944 {
2945 gdb_assert (gdbarch != NULL);
2946 gdb_assert (gdbarch->value_to_register != NULL);
2947 if (gdbarch_debug >= 2)
2948 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2949 gdbarch->value_to_register (frame, regnum, type, buf);
2950 }
2951
2952 void
2953 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2954 gdbarch_value_to_register_ftype value_to_register)
2955 {
2956 gdbarch->value_to_register = value_to_register;
2957 }
2958
2959 CORE_ADDR
2960 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf)
2961 {
2962 gdb_assert (gdbarch != NULL);
2963 gdb_assert (gdbarch->pointer_to_address != NULL);
2964 if (gdbarch_debug >= 2)
2965 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2966 return gdbarch->pointer_to_address (type, buf);
2967 }
2968
2969 void
2970 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2971 gdbarch_pointer_to_address_ftype pointer_to_address)
2972 {
2973 gdbarch->pointer_to_address = pointer_to_address;
2974 }
2975
2976 void
2977 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
2978 {
2979 gdb_assert (gdbarch != NULL);
2980 gdb_assert (gdbarch->address_to_pointer != NULL);
2981 if (gdbarch_debug >= 2)
2982 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2983 gdbarch->address_to_pointer (type, buf, addr);
2984 }
2985
2986 void
2987 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2988 gdbarch_address_to_pointer_ftype address_to_pointer)
2989 {
2990 gdbarch->address_to_pointer = address_to_pointer;
2991 }
2992
2993 int
2994 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2995 {
2996 gdb_assert (gdbarch != NULL);
2997 return gdbarch->integer_to_address != NULL;
2998 }
2999
3000 CORE_ADDR
3001 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
3002 {
3003 gdb_assert (gdbarch != NULL);
3004 gdb_assert (gdbarch->integer_to_address != NULL);
3005 if (gdbarch_debug >= 2)
3006 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
3007 return gdbarch->integer_to_address (type, buf);
3008 }
3009
3010 void
3011 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
3012 gdbarch_integer_to_address_ftype integer_to_address)
3013 {
3014 gdbarch->integer_to_address = integer_to_address;
3015 }
3016
3017 int
3018 gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch)
3019 {
3020 gdb_assert (gdbarch != NULL);
3021 return gdbarch->deprecated_pop_frame != NULL;
3022 }
3023
3024 void
3025 gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch)
3026 {
3027 gdb_assert (gdbarch != NULL);
3028 gdb_assert (gdbarch->deprecated_pop_frame != NULL);
3029 if (gdbarch_debug >= 2)
3030 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pop_frame called\n");
3031 gdbarch->deprecated_pop_frame ();
3032 }
3033
3034 void
3035 set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch,
3036 gdbarch_deprecated_pop_frame_ftype deprecated_pop_frame)
3037 {
3038 gdbarch->deprecated_pop_frame = deprecated_pop_frame;
3039 }
3040
3041 int
3042 gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch)
3043 {
3044 gdb_assert (gdbarch != NULL);
3045 return gdbarch->deprecated_store_struct_return != NULL;
3046 }
3047
3048 void
3049 gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
3050 {
3051 gdb_assert (gdbarch != NULL);
3052 gdb_assert (gdbarch->deprecated_store_struct_return != NULL);
3053 if (gdbarch_debug >= 2)
3054 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n");
3055 gdbarch->deprecated_store_struct_return (addr, sp);
3056 }
3057
3058 void
3059 set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch,
3060 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return)
3061 {
3062 gdbarch->deprecated_store_struct_return = deprecated_store_struct_return;
3063 }
3064
3065 int
3066 gdbarch_return_value_p (struct gdbarch *gdbarch)
3067 {
3068 gdb_assert (gdbarch != NULL);
3069 return gdbarch->return_value != legacy_return_value;
3070 }
3071
3072 enum return_value_convention
3073 gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf)
3074 {
3075 gdb_assert (gdbarch != NULL);
3076 gdb_assert (gdbarch->return_value != NULL);
3077 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
3078 if (gdbarch_debug >= 2)
3079 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
3080 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
3081 }
3082
3083 void
3084 set_gdbarch_return_value (struct gdbarch *gdbarch,
3085 gdbarch_return_value_ftype return_value)
3086 {
3087 gdbarch->return_value = return_value;
3088 }
3089
3090 void
3091 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
3092 {
3093 gdb_assert (gdbarch != NULL);
3094 gdb_assert (gdbarch->extract_return_value != NULL);
3095 if (gdbarch_debug >= 2)
3096 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
3097 gdbarch->extract_return_value (type, regcache, valbuf);
3098 }
3099
3100 void
3101 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
3102 gdbarch_extract_return_value_ftype extract_return_value)
3103 {
3104 gdbarch->extract_return_value = extract_return_value;
3105 }
3106
3107 void
3108 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
3109 {
3110 gdb_assert (gdbarch != NULL);
3111 gdb_assert (gdbarch->store_return_value != NULL);
3112 if (gdbarch_debug >= 2)
3113 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3114 gdbarch->store_return_value (type, regcache, valbuf);
3115 }
3116
3117 void
3118 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3119 gdbarch_store_return_value_ftype store_return_value)
3120 {
3121 gdbarch->store_return_value = store_return_value;
3122 }
3123
3124 void
3125 gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
3126 {
3127 gdb_assert (gdbarch != NULL);
3128 gdb_assert (gdbarch->deprecated_extract_return_value != NULL);
3129 if (gdbarch_debug >= 2)
3130 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
3131 gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
3132 }
3133
3134 void
3135 set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
3136 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
3137 {
3138 gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
3139 }
3140
3141 void
3142 gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3143 {
3144 gdb_assert (gdbarch != NULL);
3145 gdb_assert (gdbarch->deprecated_store_return_value != NULL);
3146 if (gdbarch_debug >= 2)
3147 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
3148 gdbarch->deprecated_store_return_value (type, valbuf);
3149 }
3150
3151 void
3152 set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
3153 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
3154 {
3155 gdbarch->deprecated_store_return_value = deprecated_store_return_value;
3156 }
3157
3158 int
3159 gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
3160 {
3161 gdb_assert (gdbarch != NULL);
3162 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
3163 if (gdbarch_debug >= 2)
3164 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
3165 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
3166 }
3167
3168 void
3169 set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
3170 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
3171 {
3172 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
3173 }
3174
3175 int
3176 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
3177 {
3178 gdb_assert (gdbarch != NULL);
3179 return gdbarch->deprecated_extract_struct_value_address != NULL;
3180 }
3181
3182 CORE_ADDR
3183 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
3184 {
3185 gdb_assert (gdbarch != NULL);
3186 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
3187 if (gdbarch_debug >= 2)
3188 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
3189 return gdbarch->deprecated_extract_struct_value_address (regcache);
3190 }
3191
3192 void
3193 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
3194 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
3195 {
3196 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
3197 }
3198
3199 int
3200 gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch)
3201 {
3202 gdb_assert (gdbarch != NULL);
3203 return gdbarch->deprecated_frame_init_saved_regs != NULL;
3204 }
3205
3206 void
3207 gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
3208 {
3209 gdb_assert (gdbarch != NULL);
3210 gdb_assert (gdbarch->deprecated_frame_init_saved_regs != NULL);
3211 if (gdbarch_debug >= 2)
3212 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_init_saved_regs called\n");
3213 gdbarch->deprecated_frame_init_saved_regs (frame);
3214 }
3215
3216 void
3217 set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch,
3218 gdbarch_deprecated_frame_init_saved_regs_ftype deprecated_frame_init_saved_regs)
3219 {
3220 gdbarch->deprecated_frame_init_saved_regs = deprecated_frame_init_saved_regs;
3221 }
3222
3223 int
3224 gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch)
3225 {
3226 gdb_assert (gdbarch != NULL);
3227 return gdbarch->deprecated_init_extra_frame_info != NULL;
3228 }
3229
3230 void
3231 gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
3232 {
3233 gdb_assert (gdbarch != NULL);
3234 gdb_assert (gdbarch->deprecated_init_extra_frame_info != NULL);
3235 if (gdbarch_debug >= 2)
3236 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_extra_frame_info called\n");
3237 gdbarch->deprecated_init_extra_frame_info (fromleaf, frame);
3238 }
3239
3240 void
3241 set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch,
3242 gdbarch_deprecated_init_extra_frame_info_ftype deprecated_init_extra_frame_info)
3243 {
3244 gdbarch->deprecated_init_extra_frame_info = deprecated_init_extra_frame_info;
3245 }
3246
3247 CORE_ADDR
3248 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
3249 {
3250 gdb_assert (gdbarch != NULL);
3251 gdb_assert (gdbarch->skip_prologue != NULL);
3252 if (gdbarch_debug >= 2)
3253 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
3254 return gdbarch->skip_prologue (ip);
3255 }
3256
3257 void
3258 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
3259 gdbarch_skip_prologue_ftype skip_prologue)
3260 {
3261 gdbarch->skip_prologue = skip_prologue;
3262 }
3263
3264 int
3265 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
3266 {
3267 gdb_assert (gdbarch != NULL);
3268 gdb_assert (gdbarch->inner_than != NULL);
3269 if (gdbarch_debug >= 2)
3270 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
3271 return gdbarch->inner_than (lhs, rhs);
3272 }
3273
3274 void
3275 set_gdbarch_inner_than (struct gdbarch *gdbarch,
3276 gdbarch_inner_than_ftype inner_than)
3277 {
3278 gdbarch->inner_than = inner_than;
3279 }
3280
3281 const unsigned char *
3282 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
3283 {
3284 gdb_assert (gdbarch != NULL);
3285 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
3286 if (gdbarch_debug >= 2)
3287 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
3288 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
3289 }
3290
3291 void
3292 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
3293 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
3294 {
3295 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
3296 }
3297
3298 int
3299 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
3300 {
3301 gdb_assert (gdbarch != NULL);
3302 return gdbarch->adjust_breakpoint_address != NULL;
3303 }
3304
3305 CORE_ADDR
3306 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
3307 {
3308 gdb_assert (gdbarch != NULL);
3309 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
3310 if (gdbarch_debug >= 2)
3311 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
3312 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
3313 }
3314
3315 void
3316 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
3317 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
3318 {
3319 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
3320 }
3321
3322 int
3323 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3324 {
3325 gdb_assert (gdbarch != NULL);
3326 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
3327 if (gdbarch_debug >= 2)
3328 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
3329 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
3330 }
3331
3332 void
3333 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
3334 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
3335 {
3336 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
3337 }
3338
3339 int
3340 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3341 {
3342 gdb_assert (gdbarch != NULL);
3343 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
3344 if (gdbarch_debug >= 2)
3345 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3346 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3347 }
3348
3349 void
3350 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3351 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3352 {
3353 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3354 }
3355
3356 CORE_ADDR
3357 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
3358 {
3359 gdb_assert (gdbarch != NULL);
3360 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
3361 if (gdbarch_debug >= 2)
3362 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3363 return gdbarch->decr_pc_after_break;
3364 }
3365
3366 void
3367 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3368 CORE_ADDR decr_pc_after_break)
3369 {
3370 gdbarch->decr_pc_after_break = decr_pc_after_break;
3371 }
3372
3373 CORE_ADDR
3374 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
3375 {
3376 gdb_assert (gdbarch != NULL);
3377 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
3378 if (gdbarch_debug >= 2)
3379 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
3380 return gdbarch->deprecated_function_start_offset;
3381 }
3382
3383 void
3384 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
3385 CORE_ADDR deprecated_function_start_offset)
3386 {
3387 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
3388 }
3389
3390 void
3391 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)
3392 {
3393 gdb_assert (gdbarch != NULL);
3394 gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
3395 if (gdbarch_debug >= 2)
3396 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3397 gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
3398 }
3399
3400 void
3401 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3402 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3403 {
3404 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3405 }
3406
3407 CORE_ADDR
3408 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3409 {
3410 gdb_assert (gdbarch != NULL);
3411 /* Skip verify of frame_args_skip, invalid_p == 0 */
3412 if (gdbarch_debug >= 2)
3413 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3414 return gdbarch->frame_args_skip;
3415 }
3416
3417 void
3418 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3419 CORE_ADDR frame_args_skip)
3420 {
3421 gdbarch->frame_args_skip = frame_args_skip;
3422 }
3423
3424 int
3425 gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch)
3426 {
3427 gdb_assert (gdbarch != NULL);
3428 return gdbarch->deprecated_frame_chain != NULL;
3429 }
3430
3431 CORE_ADDR
3432 gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
3433 {
3434 gdb_assert (gdbarch != NULL);
3435 gdb_assert (gdbarch->deprecated_frame_chain != NULL);
3436 if (gdbarch_debug >= 2)
3437 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain called\n");
3438 return gdbarch->deprecated_frame_chain (frame);
3439 }
3440
3441 void
3442 set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch,
3443 gdbarch_deprecated_frame_chain_ftype deprecated_frame_chain)
3444 {
3445 gdbarch->deprecated_frame_chain = deprecated_frame_chain;
3446 }
3447
3448 int
3449 gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch)
3450 {
3451 gdb_assert (gdbarch != NULL);
3452 return gdbarch->deprecated_frame_chain_valid != NULL;
3453 }
3454
3455 int
3456 gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
3457 {
3458 gdb_assert (gdbarch != NULL);
3459 gdb_assert (gdbarch->deprecated_frame_chain_valid != NULL);
3460 if (gdbarch_debug >= 2)
3461 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain_valid called\n");
3462 return gdbarch->deprecated_frame_chain_valid (chain, thisframe);
3463 }
3464
3465 void
3466 set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch,
3467 gdbarch_deprecated_frame_chain_valid_ftype deprecated_frame_chain_valid)
3468 {
3469 gdbarch->deprecated_frame_chain_valid = deprecated_frame_chain_valid;
3470 }
3471
3472 int
3473 gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch)
3474 {
3475 gdb_assert (gdbarch != NULL);
3476 return gdbarch->deprecated_frame_saved_pc != NULL;
3477 }
3478
3479 CORE_ADDR
3480 gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
3481 {
3482 gdb_assert (gdbarch != NULL);
3483 gdb_assert (gdbarch->deprecated_frame_saved_pc != NULL);
3484 if (gdbarch_debug >= 2)
3485 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_saved_pc called\n");
3486 return gdbarch->deprecated_frame_saved_pc (fi);
3487 }
3488
3489 void
3490 set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch,
3491 gdbarch_deprecated_frame_saved_pc_ftype deprecated_frame_saved_pc)
3492 {
3493 gdbarch->deprecated_frame_saved_pc = deprecated_frame_saved_pc;
3494 }
3495
3496 int
3497 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
3498 {
3499 gdb_assert (gdbarch != NULL);
3500 return gdbarch->unwind_pc != NULL;
3501 }
3502
3503 CORE_ADDR
3504 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
3505 {
3506 gdb_assert (gdbarch != NULL);
3507 gdb_assert (gdbarch->unwind_pc != NULL);
3508 if (gdbarch_debug >= 2)
3509 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
3510 return gdbarch->unwind_pc (gdbarch, next_frame);
3511 }
3512
3513 void
3514 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
3515 gdbarch_unwind_pc_ftype unwind_pc)
3516 {
3517 gdbarch->unwind_pc = unwind_pc;
3518 }
3519
3520 int
3521 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
3522 {
3523 gdb_assert (gdbarch != NULL);
3524 return gdbarch->unwind_sp != NULL;
3525 }
3526
3527 CORE_ADDR
3528 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
3529 {
3530 gdb_assert (gdbarch != NULL);
3531 gdb_assert (gdbarch->unwind_sp != NULL);
3532 if (gdbarch_debug >= 2)
3533 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
3534 return gdbarch->unwind_sp (gdbarch, next_frame);
3535 }
3536
3537 void
3538 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
3539 gdbarch_unwind_sp_ftype unwind_sp)
3540 {
3541 gdbarch->unwind_sp = unwind_sp;
3542 }
3543
3544 int
3545 gdbarch_deprecated_frame_args_address_p (struct gdbarch *gdbarch)
3546 {
3547 gdb_assert (gdbarch != NULL);
3548 return gdbarch->deprecated_frame_args_address != get_frame_base;
3549 }
3550
3551 CORE_ADDR
3552 gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
3553 {
3554 gdb_assert (gdbarch != NULL);
3555 gdb_assert (gdbarch->deprecated_frame_args_address != NULL);
3556 /* Do not check predicate: gdbarch->deprecated_frame_args_address != get_frame_base, allow call. */
3557 if (gdbarch_debug >= 2)
3558 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_args_address called\n");
3559 return gdbarch->deprecated_frame_args_address (fi);
3560 }
3561
3562 void
3563 set_gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch,
3564 gdbarch_deprecated_frame_args_address_ftype deprecated_frame_args_address)
3565 {
3566 gdbarch->deprecated_frame_args_address = deprecated_frame_args_address;
3567 }
3568
3569 int
3570 gdbarch_deprecated_frame_locals_address_p (struct gdbarch *gdbarch)
3571 {
3572 gdb_assert (gdbarch != NULL);
3573 return gdbarch->deprecated_frame_locals_address != get_frame_base;
3574 }
3575
3576 CORE_ADDR
3577 gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
3578 {
3579 gdb_assert (gdbarch != NULL);
3580 gdb_assert (gdbarch->deprecated_frame_locals_address != NULL);
3581 /* Do not check predicate: gdbarch->deprecated_frame_locals_address != get_frame_base, allow call. */
3582 if (gdbarch_debug >= 2)
3583 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_locals_address called\n");
3584 return gdbarch->deprecated_frame_locals_address (fi);
3585 }
3586
3587 void
3588 set_gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch,
3589 gdbarch_deprecated_frame_locals_address_ftype deprecated_frame_locals_address)
3590 {
3591 gdbarch->deprecated_frame_locals_address = deprecated_frame_locals_address;
3592 }
3593
3594 int
3595 gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch)
3596 {
3597 gdb_assert (gdbarch != NULL);
3598 return gdbarch->deprecated_saved_pc_after_call != NULL;
3599 }
3600
3601 CORE_ADDR
3602 gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
3603 {
3604 gdb_assert (gdbarch != NULL);
3605 gdb_assert (gdbarch->deprecated_saved_pc_after_call != NULL);
3606 if (gdbarch_debug >= 2)
3607 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_saved_pc_after_call called\n");
3608 return gdbarch->deprecated_saved_pc_after_call (frame);
3609 }
3610
3611 void
3612 set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch,
3613 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call)
3614 {
3615 gdbarch->deprecated_saved_pc_after_call = deprecated_saved_pc_after_call;
3616 }
3617
3618 int
3619 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
3620 {
3621 gdb_assert (gdbarch != NULL);
3622 return gdbarch->frame_num_args != NULL;
3623 }
3624
3625 int
3626 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
3627 {
3628 gdb_assert (gdbarch != NULL);
3629 gdb_assert (gdbarch->frame_num_args != NULL);
3630 if (gdbarch_debug >= 2)
3631 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3632 return gdbarch->frame_num_args (frame);
3633 }
3634
3635 void
3636 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3637 gdbarch_frame_num_args_ftype frame_num_args)
3638 {
3639 gdbarch->frame_num_args = frame_num_args;
3640 }
3641
3642 int
3643 gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
3644 {
3645 gdb_assert (gdbarch != NULL);
3646 return gdbarch->deprecated_stack_align != NULL;
3647 }
3648
3649 CORE_ADDR
3650 gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
3651 {
3652 gdb_assert (gdbarch != NULL);
3653 gdb_assert (gdbarch->deprecated_stack_align != NULL);
3654 if (gdbarch_debug >= 2)
3655 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
3656 return gdbarch->deprecated_stack_align (sp);
3657 }
3658
3659 void
3660 set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
3661 gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
3662 {
3663 gdbarch->deprecated_stack_align = deprecated_stack_align;
3664 }
3665
3666 int
3667 gdbarch_frame_align_p (struct gdbarch *gdbarch)
3668 {
3669 gdb_assert (gdbarch != NULL);
3670 return gdbarch->frame_align != NULL;
3671 }
3672
3673 CORE_ADDR
3674 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
3675 {
3676 gdb_assert (gdbarch != NULL);
3677 gdb_assert (gdbarch->frame_align != NULL);
3678 if (gdbarch_debug >= 2)
3679 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
3680 return gdbarch->frame_align (gdbarch, address);
3681 }
3682
3683 void
3684 set_gdbarch_frame_align (struct gdbarch *gdbarch,
3685 gdbarch_frame_align_ftype frame_align)
3686 {
3687 gdbarch->frame_align = frame_align;
3688 }
3689
3690 int
3691 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
3692 {
3693 gdb_assert (gdbarch != NULL);
3694 return gdbarch->deprecated_reg_struct_has_addr != NULL;
3695 }
3696
3697 int
3698 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
3699 {
3700 gdb_assert (gdbarch != NULL);
3701 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
3702 if (gdbarch_debug >= 2)
3703 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
3704 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
3705 }
3706
3707 void
3708 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
3709 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
3710 {
3711 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
3712 }
3713
3714 int
3715 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
3716 {
3717 gdb_assert (gdbarch != NULL);
3718 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
3719 if (gdbarch_debug >= 2)
3720 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
3721 return gdbarch->stabs_argument_has_addr (gdbarch, type);
3722 }
3723
3724 void
3725 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
3726 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
3727 {
3728 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
3729 }
3730
3731 int
3732 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
3733 {
3734 gdb_assert (gdbarch != NULL);
3735 if (gdbarch_debug >= 2)
3736 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
3737 return gdbarch->frame_red_zone_size;
3738 }
3739
3740 void
3741 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
3742 int frame_red_zone_size)
3743 {
3744 gdbarch->frame_red_zone_size = frame_red_zone_size;
3745 }
3746
3747 const struct floatformat *
3748 gdbarch_float_format (struct gdbarch *gdbarch)
3749 {
3750 gdb_assert (gdbarch != NULL);
3751 if (gdbarch_debug >= 2)
3752 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
3753 return gdbarch->float_format;
3754 }
3755
3756 void
3757 set_gdbarch_float_format (struct gdbarch *gdbarch,
3758 const struct floatformat * float_format)
3759 {
3760 gdbarch->float_format = float_format;
3761 }
3762
3763 const struct floatformat *
3764 gdbarch_double_format (struct gdbarch *gdbarch)
3765 {
3766 gdb_assert (gdbarch != NULL);
3767 if (gdbarch_debug >= 2)
3768 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
3769 return gdbarch->double_format;
3770 }
3771
3772 void
3773 set_gdbarch_double_format (struct gdbarch *gdbarch,
3774 const struct floatformat * double_format)
3775 {
3776 gdbarch->double_format = double_format;
3777 }
3778
3779 const struct floatformat *
3780 gdbarch_long_double_format (struct gdbarch *gdbarch)
3781 {
3782 gdb_assert (gdbarch != NULL);
3783 if (gdbarch_debug >= 2)
3784 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
3785 return gdbarch->long_double_format;
3786 }
3787
3788 void
3789 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
3790 const struct floatformat * long_double_format)
3791 {
3792 gdbarch->long_double_format = long_double_format;
3793 }
3794
3795 CORE_ADDR
3796 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
3797 {
3798 gdb_assert (gdbarch != NULL);
3799 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
3800 if (gdbarch_debug >= 2)
3801 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
3802 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
3803 }
3804
3805 void
3806 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
3807 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
3808 {
3809 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
3810 }
3811
3812 CORE_ADDR
3813 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
3814 {
3815 gdb_assert (gdbarch != NULL);
3816 gdb_assert (gdbarch->addr_bits_remove != NULL);
3817 if (gdbarch_debug >= 2)
3818 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
3819 return gdbarch->addr_bits_remove (addr);
3820 }
3821
3822 void
3823 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
3824 gdbarch_addr_bits_remove_ftype addr_bits_remove)
3825 {
3826 gdbarch->addr_bits_remove = addr_bits_remove;
3827 }
3828
3829 CORE_ADDR
3830 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
3831 {
3832 gdb_assert (gdbarch != NULL);
3833 gdb_assert (gdbarch->smash_text_address != NULL);
3834 if (gdbarch_debug >= 2)
3835 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
3836 return gdbarch->smash_text_address (addr);
3837 }
3838
3839 void
3840 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
3841 gdbarch_smash_text_address_ftype smash_text_address)
3842 {
3843 gdbarch->smash_text_address = smash_text_address;
3844 }
3845
3846 int
3847 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
3848 {
3849 gdb_assert (gdbarch != NULL);
3850 return gdbarch->software_single_step != NULL;
3851 }
3852
3853 void
3854 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
3855 {
3856 gdb_assert (gdbarch != NULL);
3857 gdb_assert (gdbarch->software_single_step != NULL);
3858 if (gdbarch_debug >= 2)
3859 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
3860 gdbarch->software_single_step (sig, insert_breakpoints_p);
3861 }
3862
3863 void
3864 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
3865 gdbarch_software_single_step_ftype software_single_step)
3866 {
3867 gdbarch->software_single_step = software_single_step;
3868 }
3869
3870 int
3871 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
3872 {
3873 gdb_assert (gdbarch != NULL);
3874 gdb_assert (gdbarch->print_insn != NULL);
3875 if (gdbarch_debug >= 2)
3876 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
3877 return gdbarch->print_insn (vma, info);
3878 }
3879
3880 void
3881 set_gdbarch_print_insn (struct gdbarch *gdbarch,
3882 gdbarch_print_insn_ftype print_insn)
3883 {
3884 gdbarch->print_insn = print_insn;
3885 }
3886
3887 CORE_ADDR
3888 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
3889 {
3890 gdb_assert (gdbarch != NULL);
3891 gdb_assert (gdbarch->skip_trampoline_code != NULL);
3892 if (gdbarch_debug >= 2)
3893 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
3894 return gdbarch->skip_trampoline_code (pc);
3895 }
3896
3897 void
3898 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
3899 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
3900 {
3901 gdbarch->skip_trampoline_code = skip_trampoline_code;
3902 }
3903
3904 CORE_ADDR
3905 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
3906 {
3907 gdb_assert (gdbarch != NULL);
3908 gdb_assert (gdbarch->skip_solib_resolver != NULL);
3909 if (gdbarch_debug >= 2)
3910 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
3911 return gdbarch->skip_solib_resolver (gdbarch, pc);
3912 }
3913
3914 void
3915 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
3916 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
3917 {
3918 gdbarch->skip_solib_resolver = skip_solib_resolver;
3919 }
3920
3921 int
3922 gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3923 {
3924 gdb_assert (gdbarch != NULL);
3925 gdb_assert (gdbarch->in_solib_call_trampoline != NULL);
3926 if (gdbarch_debug >= 2)
3927 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
3928 return gdbarch->in_solib_call_trampoline (pc, name);
3929 }
3930
3931 void
3932 set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
3933 gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
3934 {
3935 gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
3936 }
3937
3938 int
3939 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
3940 {
3941 gdb_assert (gdbarch != NULL);
3942 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
3943 if (gdbarch_debug >= 2)
3944 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
3945 return gdbarch->in_solib_return_trampoline (pc, name);
3946 }
3947
3948 void
3949 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3950 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3951 {
3952 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3953 }
3954
3955 int
3956 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3957 {
3958 gdb_assert (gdbarch != NULL);
3959 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
3960 if (gdbarch_debug >= 2)
3961 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3962 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3963 }
3964
3965 void
3966 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3967 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3968 {
3969 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3970 }
3971
3972 char *
3973 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
3974 {
3975 gdb_assert (gdbarch != NULL);
3976 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
3977 if (gdbarch_debug >= 2)
3978 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
3979 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
3980 }
3981
3982 void
3983 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
3984 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
3985 {
3986 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
3987 }
3988
3989 void
3990 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3991 {
3992 gdb_assert (gdbarch != NULL);
3993 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
3994 if (gdbarch_debug >= 2)
3995 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3996 gdbarch->elf_make_msymbol_special (sym, msym);
3997 }
3998
3999 void
4000 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
4001 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
4002 {
4003 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
4004 }
4005
4006 void
4007 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
4008 {
4009 gdb_assert (gdbarch != NULL);
4010 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
4011 if (gdbarch_debug >= 2)
4012 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
4013 gdbarch->coff_make_msymbol_special (val, msym);
4014 }
4015
4016 void
4017 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
4018 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
4019 {
4020 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
4021 }
4022
4023 const char *
4024 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
4025 {
4026 gdb_assert (gdbarch != NULL);
4027 /* Skip verify of name_of_malloc, invalid_p == 0 */
4028 if (gdbarch_debug >= 2)
4029 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
4030 return gdbarch->name_of_malloc;
4031 }
4032
4033 void
4034 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
4035 const char * name_of_malloc)
4036 {
4037 gdbarch->name_of_malloc = name_of_malloc;
4038 }
4039
4040 int
4041 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
4042 {
4043 gdb_assert (gdbarch != NULL);
4044 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
4045 if (gdbarch_debug >= 2)
4046 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
4047 return gdbarch->cannot_step_breakpoint;
4048 }
4049
4050 void
4051 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
4052 int cannot_step_breakpoint)
4053 {
4054 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
4055 }
4056
4057 int
4058 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
4059 {
4060 gdb_assert (gdbarch != NULL);
4061 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
4062 if (gdbarch_debug >= 2)
4063 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
4064 return gdbarch->have_nonsteppable_watchpoint;
4065 }
4066
4067 void
4068 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
4069 int have_nonsteppable_watchpoint)
4070 {
4071 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
4072 }
4073
4074 int
4075 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
4076 {
4077 gdb_assert (gdbarch != NULL);
4078 return gdbarch->address_class_type_flags != NULL;
4079 }
4080
4081 int
4082 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
4083 {
4084 gdb_assert (gdbarch != NULL);
4085 gdb_assert (gdbarch->address_class_type_flags != NULL);
4086 if (gdbarch_debug >= 2)
4087 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
4088 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
4089 }
4090
4091 void
4092 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
4093 gdbarch_address_class_type_flags_ftype address_class_type_flags)
4094 {
4095 gdbarch->address_class_type_flags = address_class_type_flags;
4096 }
4097
4098 int
4099 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
4100 {
4101 gdb_assert (gdbarch != NULL);
4102 return gdbarch->address_class_type_flags_to_name != NULL;
4103 }
4104
4105 const char *
4106 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
4107 {
4108 gdb_assert (gdbarch != NULL);
4109 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
4110 if (gdbarch_debug >= 2)
4111 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
4112 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
4113 }
4114
4115 void
4116 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
4117 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
4118 {
4119 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
4120 }
4121
4122 int
4123 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
4124 {
4125 gdb_assert (gdbarch != NULL);
4126 return gdbarch->address_class_name_to_type_flags != NULL;
4127 }
4128
4129 int
4130 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
4131 {
4132 gdb_assert (gdbarch != NULL);
4133 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
4134 if (gdbarch_debug >= 2)
4135 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
4136 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
4137 }
4138
4139 void
4140 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
4141 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
4142 {
4143 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
4144 }
4145
4146 int
4147 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
4148 {
4149 gdb_assert (gdbarch != NULL);
4150 gdb_assert (gdbarch->register_reggroup_p != NULL);
4151 if (gdbarch_debug >= 2)
4152 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
4153 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
4154 }
4155
4156 void
4157 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
4158 gdbarch_register_reggroup_p_ftype register_reggroup_p)
4159 {
4160 gdbarch->register_reggroup_p = register_reggroup_p;
4161 }
4162
4163 int
4164 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
4165 {
4166 gdb_assert (gdbarch != NULL);
4167 return gdbarch->fetch_pointer_argument != NULL;
4168 }
4169
4170 CORE_ADDR
4171 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
4172 {
4173 gdb_assert (gdbarch != NULL);
4174 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
4175 if (gdbarch_debug >= 2)
4176 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
4177 return gdbarch->fetch_pointer_argument (frame, argi, type);
4178 }
4179
4180 void
4181 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
4182 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
4183 {
4184 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
4185 }
4186
4187 int
4188 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
4189 {
4190 gdb_assert (gdbarch != NULL);
4191 return gdbarch->regset_from_core_section != NULL;
4192 }
4193
4194 const struct regset *
4195 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
4196 {
4197 gdb_assert (gdbarch != NULL);
4198 gdb_assert (gdbarch->regset_from_core_section != NULL);
4199 if (gdbarch_debug >= 2)
4200 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
4201 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
4202 }
4203
4204 void
4205 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
4206 gdbarch_regset_from_core_section_ftype regset_from_core_section)
4207 {
4208 gdbarch->regset_from_core_section = regset_from_core_section;
4209 }
4210
4211
4212 /* Keep a registry of per-architecture data-pointers required by GDB
4213 modules. */
4214
4215 struct gdbarch_data
4216 {
4217 unsigned index;
4218 int init_p;
4219 gdbarch_data_pre_init_ftype *pre_init;
4220 gdbarch_data_post_init_ftype *post_init;
4221 };
4222
4223 struct gdbarch_data_registration
4224 {
4225 struct gdbarch_data *data;
4226 struct gdbarch_data_registration *next;
4227 };
4228
4229 struct gdbarch_data_registry
4230 {
4231 unsigned nr;
4232 struct gdbarch_data_registration *registrations;
4233 };
4234
4235 struct gdbarch_data_registry gdbarch_data_registry =
4236 {
4237 0, NULL,
4238 };
4239
4240 static struct gdbarch_data *
4241 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
4242 gdbarch_data_post_init_ftype *post_init)
4243 {
4244 struct gdbarch_data_registration **curr;
4245 /* Append the new registraration. */
4246 for (curr = &gdbarch_data_registry.registrations;
4247 (*curr) != NULL;
4248 curr = &(*curr)->next);
4249 (*curr) = XMALLOC (struct gdbarch_data_registration);
4250 (*curr)->next = NULL;
4251 (*curr)->data = XMALLOC (struct gdbarch_data);
4252 (*curr)->data->index = gdbarch_data_registry.nr++;
4253 (*curr)->data->pre_init = pre_init;
4254 (*curr)->data->post_init = post_init;
4255 (*curr)->data->init_p = 1;
4256 return (*curr)->data;
4257 }
4258
4259 struct gdbarch_data *
4260 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
4261 {
4262 return gdbarch_data_register (pre_init, NULL);
4263 }
4264
4265 struct gdbarch_data *
4266 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
4267 {
4268 return gdbarch_data_register (NULL, post_init);
4269 }
4270
4271 /* Create/delete the gdbarch data vector. */
4272
4273 static void
4274 alloc_gdbarch_data (struct gdbarch *gdbarch)
4275 {
4276 gdb_assert (gdbarch->data == NULL);
4277 gdbarch->nr_data = gdbarch_data_registry.nr;
4278 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
4279 }
4280
4281 /* Initialize the current value of the specified per-architecture
4282 data-pointer. */
4283
4284 void
4285 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
4286 struct gdbarch_data *data,
4287 void *pointer)
4288 {
4289 gdb_assert (data->index < gdbarch->nr_data);
4290 gdb_assert (gdbarch->data[data->index] == NULL);
4291 gdb_assert (data->pre_init == NULL);
4292 gdbarch->data[data->index] = pointer;
4293 }
4294
4295 /* Return the current value of the specified per-architecture
4296 data-pointer. */
4297
4298 void *
4299 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
4300 {
4301 gdb_assert (data->index < gdbarch->nr_data);
4302 if (gdbarch->data[data->index] == NULL)
4303 {
4304 /* The data-pointer isn't initialized, call init() to get a
4305 value. */
4306 if (data->pre_init != NULL)
4307 /* Mid architecture creation: pass just the obstack, and not
4308 the entire architecture, as that way it isn't possible for
4309 pre-init code to refer to undefined architecture
4310 fields. */
4311 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
4312 else if (gdbarch->initialized_p
4313 && data->post_init != NULL)
4314 /* Post architecture creation: pass the entire architecture
4315 (as all fields are valid), but be careful to also detect
4316 recursive references. */
4317 {
4318 gdb_assert (data->init_p);
4319 data->init_p = 0;
4320 gdbarch->data[data->index] = data->post_init (gdbarch);
4321 data->init_p = 1;
4322 }
4323 else
4324 /* The architecture initialization hasn't completed - punt -
4325 hope that the caller knows what they are doing. Once
4326 deprecated_set_gdbarch_data has been initialized, this can be
4327 changed to an internal error. */
4328 return NULL;
4329 gdb_assert (gdbarch->data[data->index] != NULL);
4330 }
4331 return gdbarch->data[data->index];
4332 }
4333
4334
4335
4336 /* Keep a registry of swapped data required by GDB modules. */
4337
4338 struct gdbarch_swap
4339 {
4340 void *swap;
4341 struct gdbarch_swap_registration *source;
4342 struct gdbarch_swap *next;
4343 };
4344
4345 struct gdbarch_swap_registration
4346 {
4347 void *data;
4348 unsigned long sizeof_data;
4349 gdbarch_swap_ftype *init;
4350 struct gdbarch_swap_registration *next;
4351 };
4352
4353 struct gdbarch_swap_registry
4354 {
4355 int nr;
4356 struct gdbarch_swap_registration *registrations;
4357 };
4358
4359 struct gdbarch_swap_registry gdbarch_swap_registry =
4360 {
4361 0, NULL,
4362 };
4363
4364 void
4365 deprecated_register_gdbarch_swap (void *data,
4366 unsigned long sizeof_data,
4367 gdbarch_swap_ftype *init)
4368 {
4369 struct gdbarch_swap_registration **rego;
4370 for (rego = &gdbarch_swap_registry.registrations;
4371 (*rego) != NULL;
4372 rego = &(*rego)->next);
4373 (*rego) = XMALLOC (struct gdbarch_swap_registration);
4374 (*rego)->next = NULL;
4375 (*rego)->init = init;
4376 (*rego)->data = data;
4377 (*rego)->sizeof_data = sizeof_data;
4378 }
4379
4380 static void
4381 current_gdbarch_swap_init_hack (void)
4382 {
4383 struct gdbarch_swap_registration *rego;
4384 struct gdbarch_swap **curr = &current_gdbarch->swap;
4385 for (rego = gdbarch_swap_registry.registrations;
4386 rego != NULL;
4387 rego = rego->next)
4388 {
4389 if (rego->data != NULL)
4390 {
4391 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
4392 struct gdbarch_swap);
4393 (*curr)->source = rego;
4394 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
4395 rego->sizeof_data);
4396 (*curr)->next = NULL;
4397 curr = &(*curr)->next;
4398 }
4399 if (rego->init != NULL)
4400 rego->init ();
4401 }
4402 }
4403
4404 static struct gdbarch *
4405 current_gdbarch_swap_out_hack (void)
4406 {
4407 struct gdbarch *old_gdbarch = current_gdbarch;
4408 struct gdbarch_swap *curr;
4409
4410 gdb_assert (old_gdbarch != NULL);
4411 for (curr = old_gdbarch->swap;
4412 curr != NULL;
4413 curr = curr->next)
4414 {
4415 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
4416 memset (curr->source->data, 0, curr->source->sizeof_data);
4417 }
4418 current_gdbarch = NULL;
4419 return old_gdbarch;
4420 }
4421
4422 static void
4423 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
4424 {
4425 struct gdbarch_swap *curr;
4426
4427 gdb_assert (current_gdbarch == NULL);
4428 for (curr = new_gdbarch->swap;
4429 curr != NULL;
4430 curr = curr->next)
4431 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
4432 current_gdbarch = new_gdbarch;
4433 }
4434
4435
4436 /* Keep a registry of the architectures known by GDB. */
4437
4438 struct gdbarch_registration
4439 {
4440 enum bfd_architecture bfd_architecture;
4441 gdbarch_init_ftype *init;
4442 gdbarch_dump_tdep_ftype *dump_tdep;
4443 struct gdbarch_list *arches;
4444 struct gdbarch_registration *next;
4445 };
4446
4447 static struct gdbarch_registration *gdbarch_registry = NULL;
4448
4449 static void
4450 append_name (const char ***buf, int *nr, const char *name)
4451 {
4452 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4453 (*buf)[*nr] = name;
4454 *nr += 1;
4455 }
4456
4457 const char **
4458 gdbarch_printable_names (void)
4459 {
4460 /* Accumulate a list of names based on the registed list of
4461 architectures. */
4462 enum bfd_architecture a;
4463 int nr_arches = 0;
4464 const char **arches = NULL;
4465 struct gdbarch_registration *rego;
4466 for (rego = gdbarch_registry;
4467 rego != NULL;
4468 rego = rego->next)
4469 {
4470 const struct bfd_arch_info *ap;
4471 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4472 if (ap == NULL)
4473 internal_error (__FILE__, __LINE__,
4474 "gdbarch_architecture_names: multi-arch unknown");
4475 do
4476 {
4477 append_name (&arches, &nr_arches, ap->printable_name);
4478 ap = ap->next;
4479 }
4480 while (ap != NULL);
4481 }
4482 append_name (&arches, &nr_arches, NULL);
4483 return arches;
4484 }
4485
4486
4487 void
4488 gdbarch_register (enum bfd_architecture bfd_architecture,
4489 gdbarch_init_ftype *init,
4490 gdbarch_dump_tdep_ftype *dump_tdep)
4491 {
4492 struct gdbarch_registration **curr;
4493 const struct bfd_arch_info *bfd_arch_info;
4494 /* Check that BFD recognizes this architecture */
4495 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4496 if (bfd_arch_info == NULL)
4497 {
4498 internal_error (__FILE__, __LINE__,
4499 "gdbarch: Attempt to register unknown architecture (%d)",
4500 bfd_architecture);
4501 }
4502 /* Check that we haven't seen this architecture before */
4503 for (curr = &gdbarch_registry;
4504 (*curr) != NULL;
4505 curr = &(*curr)->next)
4506 {
4507 if (bfd_architecture == (*curr)->bfd_architecture)
4508 internal_error (__FILE__, __LINE__,
4509 "gdbarch: Duplicate registraration of architecture (%s)",
4510 bfd_arch_info->printable_name);
4511 }
4512 /* log it */
4513 if (gdbarch_debug)
4514 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
4515 bfd_arch_info->printable_name,
4516 (long) init);
4517 /* Append it */
4518 (*curr) = XMALLOC (struct gdbarch_registration);
4519 (*curr)->bfd_architecture = bfd_architecture;
4520 (*curr)->init = init;
4521 (*curr)->dump_tdep = dump_tdep;
4522 (*curr)->arches = NULL;
4523 (*curr)->next = NULL;
4524 }
4525
4526 void
4527 register_gdbarch_init (enum bfd_architecture bfd_architecture,
4528 gdbarch_init_ftype *init)
4529 {
4530 gdbarch_register (bfd_architecture, init, NULL);
4531 }
4532
4533
4534 /* Look for an architecture using gdbarch_info. Base search on only
4535 BFD_ARCH_INFO and BYTE_ORDER. */
4536
4537 struct gdbarch_list *
4538 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4539 const struct gdbarch_info *info)
4540 {
4541 for (; arches != NULL; arches = arches->next)
4542 {
4543 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4544 continue;
4545 if (info->byte_order != arches->gdbarch->byte_order)
4546 continue;
4547 if (info->osabi != arches->gdbarch->osabi)
4548 continue;
4549 return arches;
4550 }
4551 return NULL;
4552 }
4553
4554
4555 /* Find an architecture that matches the specified INFO. Create a new
4556 architecture if needed. Return that new architecture. Assumes
4557 that there is no current architecture. */
4558
4559 static struct gdbarch *
4560 find_arch_by_info (struct gdbarch *old_gdbarch, struct gdbarch_info info)
4561 {
4562 struct gdbarch *new_gdbarch;
4563 struct gdbarch_registration *rego;
4564
4565 /* The existing architecture has been swapped out - all this code
4566 works from a clean slate. */
4567 gdb_assert (current_gdbarch == NULL);
4568
4569 /* Fill in missing parts of the INFO struct using a number of
4570 sources: "set ..."; INFOabfd supplied; and the existing
4571 architecture. */
4572 gdbarch_info_fill (old_gdbarch, &info);
4573
4574 /* Must have found some sort of architecture. */
4575 gdb_assert (info.bfd_arch_info != NULL);
4576
4577 if (gdbarch_debug)
4578 {
4579 fprintf_unfiltered (gdb_stdlog,
4580 "find_arch_by_info: info.bfd_arch_info %s\n",
4581 (info.bfd_arch_info != NULL
4582 ? info.bfd_arch_info->printable_name
4583 : "(null)"));
4584 fprintf_unfiltered (gdb_stdlog,
4585 "find_arch_by_info: info.byte_order %d (%s)\n",
4586 info.byte_order,
4587 (info.byte_order == BFD_ENDIAN_BIG ? "big"
4588 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
4589 : "default"));
4590 fprintf_unfiltered (gdb_stdlog,
4591 "find_arch_by_info: info.osabi %d (%s)\n",
4592 info.osabi, gdbarch_osabi_name (info.osabi));
4593 fprintf_unfiltered (gdb_stdlog,
4594 "find_arch_by_info: info.abfd 0x%lx\n",
4595 (long) info.abfd);
4596 fprintf_unfiltered (gdb_stdlog,
4597 "find_arch_by_info: info.tdep_info 0x%lx\n",
4598 (long) info.tdep_info);
4599 }
4600
4601 /* Find the tdep code that knows about this architecture. */
4602 for (rego = gdbarch_registry;
4603 rego != NULL;
4604 rego = rego->next)
4605 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4606 break;
4607 if (rego == NULL)
4608 {
4609 if (gdbarch_debug)
4610 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4611 "No matching architecture\n");
4612 return 0;
4613 }
4614
4615 /* Ask the tdep code for an architecture that matches "info". */
4616 new_gdbarch = rego->init (info, rego->arches);
4617
4618 /* Did the tdep code like it? No. Reject the change and revert to
4619 the old architecture. */
4620 if (new_gdbarch == NULL)
4621 {
4622 if (gdbarch_debug)
4623 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4624 "Target rejected architecture\n");
4625 return NULL;
4626 }
4627
4628 /* Is this a pre-existing architecture (as determined by already
4629 being initialized)? Move it to the front of the architecture
4630 list (keeping the list sorted Most Recently Used). */
4631 if (new_gdbarch->initialized_p)
4632 {
4633 struct gdbarch_list **list;
4634 struct gdbarch_list *this;
4635 if (gdbarch_debug)
4636 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4637 "Previous architecture 0x%08lx (%s) selected\n",
4638 (long) new_gdbarch,
4639 new_gdbarch->bfd_arch_info->printable_name);
4640 /* Find the existing arch in the list. */
4641 for (list = &rego->arches;
4642 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4643 list = &(*list)->next);
4644 /* It had better be in the list of architectures. */
4645 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4646 /* Unlink THIS. */
4647 this = (*list);
4648 (*list) = this->next;
4649 /* Insert THIS at the front. */
4650 this->next = rego->arches;
4651 rego->arches = this;
4652 /* Return it. */
4653 return new_gdbarch;
4654 }
4655
4656 /* It's a new architecture. */
4657 if (gdbarch_debug)
4658 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
4659 "New architecture 0x%08lx (%s) selected\n",
4660 (long) new_gdbarch,
4661 new_gdbarch->bfd_arch_info->printable_name);
4662
4663 /* Insert the new architecture into the front of the architecture
4664 list (keep the list sorted Most Recently Used). */
4665 {
4666 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
4667 this->next = rego->arches;
4668 this->gdbarch = new_gdbarch;
4669 rego->arches = this;
4670 }
4671
4672 /* Check that the newly installed architecture is valid. Plug in
4673 any post init values. */
4674 new_gdbarch->dump_tdep = rego->dump_tdep;
4675 verify_gdbarch (new_gdbarch);
4676 new_gdbarch->initialized_p = 1;
4677
4678 /* Initialize any per-architecture swap areas. This phase requires
4679 a valid global CURRENT_GDBARCH. Set it momentarially, and then
4680 swap the entire architecture out. */
4681 current_gdbarch = new_gdbarch;
4682 current_gdbarch_swap_init_hack ();
4683 current_gdbarch_swap_out_hack ();
4684
4685 if (gdbarch_debug)
4686 gdbarch_dump (new_gdbarch, gdb_stdlog);
4687
4688 return new_gdbarch;
4689 }
4690
4691 struct gdbarch *
4692 gdbarch_find_by_info (struct gdbarch_info info)
4693 {
4694 /* Save the previously selected architecture, setting the global to
4695 NULL. This stops things like gdbarch->init() trying to use the
4696 previous architecture's configuration. The previous architecture
4697 may not even be of the same architecture family. The most recent
4698 architecture of the same family is found at the head of the
4699 rego->arches list. */
4700 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
4701
4702 /* Find the specified architecture. */
4703 struct gdbarch *new_gdbarch = find_arch_by_info (old_gdbarch, info);
4704
4705 /* Restore the existing architecture. */
4706 gdb_assert (current_gdbarch == NULL);
4707 current_gdbarch_swap_in_hack (old_gdbarch);
4708
4709 return new_gdbarch;
4710 }
4711
4712 /* Make the specified architecture current, swapping the existing one
4713 out. */
4714
4715 void
4716 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
4717 {
4718 gdb_assert (new_gdbarch != NULL);
4719 gdb_assert (current_gdbarch != NULL);
4720 gdb_assert (new_gdbarch->initialized_p);
4721 current_gdbarch_swap_out_hack ();
4722 current_gdbarch_swap_in_hack (new_gdbarch);
4723 architecture_changed_event ();
4724 }
4725
4726 extern void _initialize_gdbarch (void);
4727
4728 void
4729 _initialize_gdbarch (void)
4730 {
4731 struct cmd_list_element *c;
4732
4733 deprecated_add_show_from_set
4734 (add_set_cmd ("arch",
4735 class_maintenance,
4736 var_zinteger,
4737 (char *)&gdbarch_debug,
4738 "Set architecture debugging.\n\
4739 When non-zero, architecture debugging is enabled.", &setdebuglist),
4740 &showdebuglist);
4741 c = add_set_cmd ("archdebug",
4742 class_maintenance,
4743 var_zinteger,
4744 (char *)&gdbarch_debug,
4745 "Set architecture debugging.\n\
4746 When non-zero, architecture debugging is enabled.", &setlist);
4747
4748 deprecate_cmd (c, "set debug arch");
4749 deprecate_cmd (deprecated_add_show_from_set (c, &showlist), "show debug arch");
4750 }
This page took 0.12685 seconds and 5 git commands to generate.