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