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