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