2004-06-18 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_use_struct_convention_ftype *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, /* 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->extract_return_value = legacy_extract_return_value;
461 current_gdbarch->store_return_value = legacy_store_return_value;
462 current_gdbarch->use_struct_convention = generic_use_struct_convention;
463 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
464 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
465 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
466 current_gdbarch->deprecated_frame_args_address = get_frame_base;
467 current_gdbarch->deprecated_frame_locals_address = get_frame_base;
468 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
469 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
470 current_gdbarch->addr_bits_remove = core_addr_identity;
471 current_gdbarch->smash_text_address = core_addr_identity;
472 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
473 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
474 current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
475 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
476 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
477 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
478 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
479 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
480 current_gdbarch->name_of_malloc = "malloc";
481 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
482 /* gdbarch_alloc() */
483
484 return current_gdbarch;
485 }
486
487
488 /* Allocate extra space using the per-architecture obstack. */
489
490 void *
491 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
492 {
493 void *data = obstack_alloc (arch->obstack, size);
494 memset (data, 0, size);
495 return data;
496 }
497
498
499 /* Free a gdbarch struct. This should never happen in normal
500 operation --- once you've created a gdbarch, you keep it around.
501 However, if an architecture's init function encounters an error
502 building the structure, it may need to clean up a partially
503 constructed gdbarch. */
504
505 void
506 gdbarch_free (struct gdbarch *arch)
507 {
508 struct obstack *obstack;
509 gdb_assert (arch != NULL);
510 gdb_assert (!arch->initialized_p);
511 obstack = arch->obstack;
512 obstack_free (obstack, 0); /* Includes the ARCH. */
513 xfree (obstack);
514 }
515
516
517 /* Ensure that all values in a GDBARCH are reasonable. */
518
519 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
520 just happens to match the global variable ``current_gdbarch''. That
521 way macros refering to that variable get the local and not the global
522 version - ulgh. Once everything is parameterised with gdbarch, this
523 will go away. */
524
525 static void
526 verify_gdbarch (struct gdbarch *current_gdbarch)
527 {
528 struct ui_file *log;
529 struct cleanup *cleanups;
530 long dummy;
531 char *buf;
532 log = mem_fileopen ();
533 cleanups = make_cleanup_ui_file_delete (log);
534 /* fundamental */
535 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
536 fprintf_unfiltered (log, "\n\tbyte-order");
537 if (current_gdbarch->bfd_arch_info == NULL)
538 fprintf_unfiltered (log, "\n\tbfd_arch_info");
539 /* Check those that need to be defined for the given multi-arch level. */
540 /* Skip verify of short_bit, invalid_p == 0 */
541 /* Skip verify of int_bit, invalid_p == 0 */
542 /* Skip verify of long_bit, invalid_p == 0 */
543 /* Skip verify of long_long_bit, invalid_p == 0 */
544 /* Skip verify of float_bit, invalid_p == 0 */
545 /* Skip verify of double_bit, invalid_p == 0 */
546 /* Skip verify of long_double_bit, invalid_p == 0 */
547 /* Skip verify of ptr_bit, invalid_p == 0 */
548 if (current_gdbarch->addr_bit == 0)
549 current_gdbarch->addr_bit = TARGET_PTR_BIT;
550 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
551 if (current_gdbarch->char_signed == -1)
552 current_gdbarch->char_signed = 1;
553 /* Skip verify of read_pc, has predicate */
554 /* Skip verify of write_pc, invalid_p == 0 */
555 /* Skip verify of read_sp, has predicate */
556 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
557 /* Skip verify of pseudo_register_read, has predicate */
558 /* Skip verify of pseudo_register_write, has predicate */
559 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
560 && (current_gdbarch->num_regs == -1))
561 fprintf_unfiltered (log, "\n\tnum_regs");
562 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
563 /* Skip verify of sp_regnum, invalid_p == 0 */
564 /* Skip verify of pc_regnum, invalid_p == 0 */
565 /* Skip verify of ps_regnum, invalid_p == 0 */
566 /* Skip verify of fp0_regnum, invalid_p == 0 */
567 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
568 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
569 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
570 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
571 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
572 /* Skip verify of register_type, has predicate */
573 /* Skip verify of deprecated_register_virtual_type, has predicate */
574 /* Skip verify of deprecated_register_byte, has predicate */
575 /* Skip verify of deprecated_register_raw_size, has predicate */
576 /* Skip verify of deprecated_register_virtual_size, has predicate */
577 /* Skip verify of unwind_dummy_id, has predicate */
578 /* Skip verify of deprecated_save_dummy_frame_tos, has predicate */
579 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
580 /* Skip verify of deprecated_target_read_fp, has predicate */
581 /* Skip verify of push_dummy_call, has predicate */
582 /* Skip verify of deprecated_push_arguments, has predicate */
583 /* Skip verify of deprecated_push_return_address, has predicate */
584 /* Skip verify of deprecated_dummy_write_sp, has predicate */
585 /* Skip verify of call_dummy_location, invalid_p == 0 */
586 /* Skip verify of push_dummy_code, has predicate */
587 /* Skip verify of deprecated_do_registers_info, has predicate */
588 /* Skip verify of print_registers_info, invalid_p == 0 */
589 /* Skip verify of print_float_info, has predicate */
590 /* Skip verify of print_vector_info, has predicate */
591 /* Skip verify of register_sim_regno, invalid_p == 0 */
592 /* Skip verify of register_bytes_ok, has predicate */
593 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
594 /* Skip verify of cannot_store_register, invalid_p == 0 */
595 /* Skip verify of get_longjmp_target, has predicate */
596 /* Skip verify of deprecated_init_frame_pc, has predicate */
597 /* Skip verify of deprecated_get_saved_register, has predicate */
598 /* Skip verify of convert_register_p, invalid_p == 0 */
599 /* Skip verify of pointer_to_address, invalid_p == 0 */
600 /* Skip verify of address_to_pointer, invalid_p == 0 */
601 /* Skip verify of integer_to_address, has predicate */
602 /* Skip verify of deprecated_pop_frame, has predicate */
603 /* Skip verify of deprecated_store_struct_return, has predicate */
604 /* Skip verify of return_value, has predicate */
605 /* Skip verify of extract_return_value, invalid_p == 0 */
606 /* Skip verify of store_return_value, invalid_p == 0 */
607 /* Skip verify of use_struct_convention, invalid_p == 0 */
608 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
609 /* Skip verify of deprecated_frame_init_saved_regs, has predicate */
610 /* Skip verify of deprecated_init_extra_frame_info, has predicate */
611 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
612 && (current_gdbarch->skip_prologue == 0))
613 fprintf_unfiltered (log, "\n\tskip_prologue");
614 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
615 && (current_gdbarch->inner_than == 0))
616 fprintf_unfiltered (log, "\n\tinner_than");
617 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
618 && (current_gdbarch->breakpoint_from_pc == 0))
619 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
620 /* Skip verify of adjust_breakpoint_address, has predicate */
621 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
622 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
623 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
624 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
625 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
626 /* Skip verify of frame_args_skip, invalid_p == 0 */
627 /* Skip verify of deprecated_frameless_function_invocation, has predicate */
628 /* Skip verify of deprecated_frame_chain, has predicate */
629 /* Skip verify of deprecated_frame_chain_valid, has predicate */
630 /* Skip verify of deprecated_frame_saved_pc, has predicate */
631 /* Skip verify of unwind_pc, has predicate */
632 /* Skip verify of unwind_sp, has predicate */
633 /* Skip verify of deprecated_frame_args_address, has predicate */
634 /* Skip verify of deprecated_frame_locals_address, has predicate */
635 /* Skip verify of deprecated_saved_pc_after_call, has predicate */
636 /* Skip verify of frame_num_args, has predicate */
637 /* Skip verify of deprecated_stack_align, has predicate */
638 /* Skip verify of frame_align, has predicate */
639 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
640 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
641 if (current_gdbarch->float_format == 0)
642 current_gdbarch->float_format = default_float_format (current_gdbarch);
643 if (current_gdbarch->double_format == 0)
644 current_gdbarch->double_format = default_double_format (current_gdbarch);
645 if (current_gdbarch->long_double_format == 0)
646 current_gdbarch->long_double_format = default_double_format (current_gdbarch);
647 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
648 /* Skip verify of addr_bits_remove, invalid_p == 0 */
649 /* Skip verify of smash_text_address, invalid_p == 0 */
650 /* Skip verify of software_single_step, has predicate */
651 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
652 && (current_gdbarch->print_insn == 0))
653 fprintf_unfiltered (log, "\n\tprint_insn");
654 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
655 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
656 /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
657 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
658 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
659 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
660 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
661 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
662 /* Skip verify of name_of_malloc, invalid_p == 0 */
663 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
664 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
665 /* Skip verify of address_class_type_flags, has predicate */
666 /* Skip verify of address_class_type_flags_to_name, has predicate */
667 /* Skip verify of address_class_name_to_type_flags, has predicate */
668 /* Skip verify of register_reggroup_p, invalid_p == 0 */
669 /* Skip verify of fetch_pointer_argument, has predicate */
670 /* Skip verify of regset_from_core_section, has predicate */
671 buf = ui_file_xstrdup (log, &dummy);
672 make_cleanup (xfree, buf);
673 if (strlen (buf) > 0)
674 internal_error (__FILE__, __LINE__,
675 "verify_gdbarch: the following are invalid ...%s",
676 buf);
677 do_cleanups (cleanups);
678 }
679
680
681 /* Print out the details of the current architecture. */
682
683 /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
684 just happens to match the global variable ``current_gdbarch''. That
685 way macros refering to that variable get the local and not the global
686 version - ulgh. Once everything is parameterised with gdbarch, this
687 will go away. */
688
689 void
690 gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
691 {
692 fprintf_unfiltered (file,
693 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
694 GDB_MULTI_ARCH);
695 fprintf_unfiltered (file,
696 "gdbarch_dump: convert_from_func_ptr_addr = 0x%08lx\n",
697 (long) current_gdbarch->convert_from_func_ptr_addr);
698 fprintf_unfiltered (file,
699 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
700 gdbarch_frame_align_p (current_gdbarch));
701 fprintf_unfiltered (file,
702 "gdbarch_dump: frame_align = 0x%08lx\n",
703 (long) current_gdbarch->frame_align);
704 fprintf_unfiltered (file,
705 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
706 gdbarch_regset_from_core_section_p (current_gdbarch));
707 fprintf_unfiltered (file,
708 "gdbarch_dump: regset_from_core_section = 0x%08lx\n",
709 (long) current_gdbarch->regset_from_core_section);
710 fprintf_unfiltered (file,
711 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
712 gdbarch_return_value_p (current_gdbarch));
713 fprintf_unfiltered (file,
714 "gdbarch_dump: return_value = 0x%08lx\n",
715 (long) current_gdbarch->return_value);
716 fprintf_unfiltered (file,
717 "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
718 (long) current_gdbarch->in_function_epilogue_p);
719 fprintf_unfiltered (file,
720 "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
721 (long) current_gdbarch->register_reggroup_p);
722 fprintf_unfiltered (file,
723 "gdbarch_dump: stabs_argument_has_addr = 0x%08lx\n",
724 (long) current_gdbarch->stabs_argument_has_addr);
725 fprintf_unfiltered (file,
726 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
727 gdbarch_pseudo_register_read_p (current_gdbarch));
728 fprintf_unfiltered (file,
729 "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
730 (long) current_gdbarch->pseudo_register_read);
731 fprintf_unfiltered (file,
732 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
733 gdbarch_pseudo_register_write_p (current_gdbarch));
734 fprintf_unfiltered (file,
735 "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
736 (long) current_gdbarch->pseudo_register_write);
737 fprintf_unfiltered (file,
738 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
739 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
740 fprintf_unfiltered (file,
741 "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
742 (long) current_gdbarch->address_class_name_to_type_flags);
743 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
744 fprintf_unfiltered (file,
745 "gdbarch_dump: %s # %s\n",
746 "ADDRESS_CLASS_TYPE_FLAGS_P()",
747 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
748 fprintf_unfiltered (file,
749 "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_P() = %d\n",
750 ADDRESS_CLASS_TYPE_FLAGS_P ());
751 #endif
752 #ifdef ADDRESS_CLASS_TYPE_FLAGS
753 fprintf_unfiltered (file,
754 "gdbarch_dump: %s # %s\n",
755 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
756 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
757 fprintf_unfiltered (file,
758 "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n",
759 (long) current_gdbarch->address_class_type_flags
760 /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
761 #endif
762 fprintf_unfiltered (file,
763 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
764 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
765 fprintf_unfiltered (file,
766 "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
767 (long) current_gdbarch->address_class_type_flags_to_name);
768 #ifdef ADDRESS_TO_POINTER
769 fprintf_unfiltered (file,
770 "gdbarch_dump: %s # %s\n",
771 "ADDRESS_TO_POINTER(type, buf, addr)",
772 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
773 fprintf_unfiltered (file,
774 "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n",
775 (long) current_gdbarch->address_to_pointer
776 /*ADDRESS_TO_POINTER ()*/);
777 #endif
778 #ifdef ADDR_BITS_REMOVE
779 fprintf_unfiltered (file,
780 "gdbarch_dump: %s # %s\n",
781 "ADDR_BITS_REMOVE(addr)",
782 XSTRING (ADDR_BITS_REMOVE (addr)));
783 fprintf_unfiltered (file,
784 "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n",
785 (long) current_gdbarch->addr_bits_remove
786 /*ADDR_BITS_REMOVE ()*/);
787 #endif
788 fprintf_unfiltered (file,
789 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
790 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
791 fprintf_unfiltered (file,
792 "gdbarch_dump: adjust_breakpoint_address = 0x%08lx\n",
793 (long) current_gdbarch->adjust_breakpoint_address);
794 #ifdef BELIEVE_PCC_PROMOTION
795 fprintf_unfiltered (file,
796 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
797 XSTRING (BELIEVE_PCC_PROMOTION));
798 fprintf_unfiltered (file,
799 "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n",
800 BELIEVE_PCC_PROMOTION);
801 #endif
802 #ifdef BREAKPOINT_FROM_PC
803 fprintf_unfiltered (file,
804 "gdbarch_dump: %s # %s\n",
805 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
806 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
807 fprintf_unfiltered (file,
808 "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n",
809 (long) current_gdbarch->breakpoint_from_pc
810 /*BREAKPOINT_FROM_PC ()*/);
811 #endif
812 #ifdef CALL_DUMMY_LOCATION
813 fprintf_unfiltered (file,
814 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
815 XSTRING (CALL_DUMMY_LOCATION));
816 fprintf_unfiltered (file,
817 "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
818 CALL_DUMMY_LOCATION);
819 #endif
820 #ifdef CANNOT_FETCH_REGISTER
821 fprintf_unfiltered (file,
822 "gdbarch_dump: %s # %s\n",
823 "CANNOT_FETCH_REGISTER(regnum)",
824 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
825 fprintf_unfiltered (file,
826 "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n",
827 (long) current_gdbarch->cannot_fetch_register
828 /*CANNOT_FETCH_REGISTER ()*/);
829 #endif
830 #ifdef CANNOT_STEP_BREAKPOINT
831 fprintf_unfiltered (file,
832 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
833 XSTRING (CANNOT_STEP_BREAKPOINT));
834 fprintf_unfiltered (file,
835 "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
836 CANNOT_STEP_BREAKPOINT);
837 #endif
838 #ifdef CANNOT_STORE_REGISTER
839 fprintf_unfiltered (file,
840 "gdbarch_dump: %s # %s\n",
841 "CANNOT_STORE_REGISTER(regnum)",
842 XSTRING (CANNOT_STORE_REGISTER (regnum)));
843 fprintf_unfiltered (file,
844 "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n",
845 (long) current_gdbarch->cannot_store_register
846 /*CANNOT_STORE_REGISTER ()*/);
847 #endif
848 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
849 fprintf_unfiltered (file,
850 "gdbarch_dump: %s # %s\n",
851 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
852 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
853 fprintf_unfiltered (file,
854 "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
855 (long) current_gdbarch->coff_make_msymbol_special
856 /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
857 #endif
858 fprintf_unfiltered (file,
859 "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
860 (long) current_gdbarch->construct_inferior_arguments);
861 #ifdef CONVERT_REGISTER_P
862 fprintf_unfiltered (file,
863 "gdbarch_dump: %s # %s\n",
864 "CONVERT_REGISTER_P(regnum, type)",
865 XSTRING (CONVERT_REGISTER_P (regnum, type)));
866 fprintf_unfiltered (file,
867 "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n",
868 (long) current_gdbarch->convert_register_p
869 /*CONVERT_REGISTER_P ()*/);
870 #endif
871 #ifdef DECR_PC_AFTER_BREAK
872 fprintf_unfiltered (file,
873 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
874 XSTRING (DECR_PC_AFTER_BREAK));
875 fprintf_unfiltered (file,
876 "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
877 (long) DECR_PC_AFTER_BREAK);
878 #endif
879 #ifdef DEPRECATED_DO_REGISTERS_INFO_P
880 fprintf_unfiltered (file,
881 "gdbarch_dump: %s # %s\n",
882 "DEPRECATED_DO_REGISTERS_INFO_P()",
883 XSTRING (DEPRECATED_DO_REGISTERS_INFO_P ()));
884 fprintf_unfiltered (file,
885 "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO_P() = %d\n",
886 DEPRECATED_DO_REGISTERS_INFO_P ());
887 #endif
888 #ifdef DEPRECATED_DO_REGISTERS_INFO
889 fprintf_unfiltered (file,
890 "gdbarch_dump: %s # %s\n",
891 "DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)",
892 XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs)));
893 fprintf_unfiltered (file,
894 "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n",
895 (long) current_gdbarch->deprecated_do_registers_info
896 /*DEPRECATED_DO_REGISTERS_INFO ()*/);
897 #endif
898 #ifdef DEPRECATED_DUMMY_WRITE_SP_P
899 fprintf_unfiltered (file,
900 "gdbarch_dump: %s # %s\n",
901 "DEPRECATED_DUMMY_WRITE_SP_P()",
902 XSTRING (DEPRECATED_DUMMY_WRITE_SP_P ()));
903 fprintf_unfiltered (file,
904 "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP_P() = %d\n",
905 DEPRECATED_DUMMY_WRITE_SP_P ());
906 #endif
907 #ifdef DEPRECATED_DUMMY_WRITE_SP
908 fprintf_unfiltered (file,
909 "gdbarch_dump: %s # %s\n",
910 "DEPRECATED_DUMMY_WRITE_SP(val)",
911 XSTRING (DEPRECATED_DUMMY_WRITE_SP (val)));
912 fprintf_unfiltered (file,
913 "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP = <0x%08lx>\n",
914 (long) current_gdbarch->deprecated_dummy_write_sp
915 /*DEPRECATED_DUMMY_WRITE_SP ()*/);
916 #endif
917 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
918 fprintf_unfiltered (file,
919 "gdbarch_dump: %s # %s\n",
920 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
921 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
922 fprintf_unfiltered (file,
923 "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n",
924 (long) current_gdbarch->deprecated_extract_return_value
925 /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
926 #endif
927 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
928 fprintf_unfiltered (file,
929 "gdbarch_dump: %s # %s\n",
930 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
931 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
932 fprintf_unfiltered (file,
933 "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n",
934 DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ());
935 #endif
936 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
937 fprintf_unfiltered (file,
938 "gdbarch_dump: %s # %s\n",
939 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
940 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
941 fprintf_unfiltered (file,
942 "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
943 (long) current_gdbarch->deprecated_extract_struct_value_address
944 /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
945 #endif
946 #ifdef DEPRECATED_FP_REGNUM
947 fprintf_unfiltered (file,
948 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
949 XSTRING (DEPRECATED_FP_REGNUM));
950 fprintf_unfiltered (file,
951 "gdbarch_dump: DEPRECATED_FP_REGNUM = %d\n",
952 DEPRECATED_FP_REGNUM);
953 #endif
954 #ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P
955 fprintf_unfiltered (file,
956 "gdbarch_dump: %s # %s\n",
957 "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P()",
958 XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ()));
959 fprintf_unfiltered (file,
960 "gdbarch_dump: DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P() = %d\n",
961 DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ());
962 #endif
963 #ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION
964 fprintf_unfiltered (file,
965 "gdbarch_dump: %s # %s\n",
966 "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION(fi)",
967 XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (fi)));
968 fprintf_unfiltered (file,
969 "gdbarch_dump: DEPRECATED_FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n",
970 (long) current_gdbarch->deprecated_frameless_function_invocation
971 /*DEPRECATED_FRAMELESS_FUNCTION_INVOCATION ()*/);
972 #endif
973 #ifdef DEPRECATED_FRAME_ARGS_ADDRESS_P
974 fprintf_unfiltered (file,
975 "gdbarch_dump: %s # %s\n",
976 "DEPRECATED_FRAME_ARGS_ADDRESS_P()",
977 XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS_P ()));
978 fprintf_unfiltered (file,
979 "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS_P() = %d\n",
980 DEPRECATED_FRAME_ARGS_ADDRESS_P ());
981 #endif
982 #ifdef DEPRECATED_FRAME_ARGS_ADDRESS
983 fprintf_unfiltered (file,
984 "gdbarch_dump: %s # %s\n",
985 "DEPRECATED_FRAME_ARGS_ADDRESS(fi)",
986 XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS (fi)));
987 fprintf_unfiltered (file,
988 "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS = <0x%08lx>\n",
989 (long) current_gdbarch->deprecated_frame_args_address
990 /*DEPRECATED_FRAME_ARGS_ADDRESS ()*/);
991 #endif
992 #ifdef DEPRECATED_FRAME_CHAIN_P
993 fprintf_unfiltered (file,
994 "gdbarch_dump: %s # %s\n",
995 "DEPRECATED_FRAME_CHAIN_P()",
996 XSTRING (DEPRECATED_FRAME_CHAIN_P ()));
997 fprintf_unfiltered (file,
998 "gdbarch_dump: DEPRECATED_FRAME_CHAIN_P() = %d\n",
999 DEPRECATED_FRAME_CHAIN_P ());
1000 #endif
1001 #ifdef DEPRECATED_FRAME_CHAIN
1002 fprintf_unfiltered (file,
1003 "gdbarch_dump: %s # %s\n",
1004 "DEPRECATED_FRAME_CHAIN(frame)",
1005 XSTRING (DEPRECATED_FRAME_CHAIN (frame)));
1006 fprintf_unfiltered (file,
1007 "gdbarch_dump: DEPRECATED_FRAME_CHAIN = <0x%08lx>\n",
1008 (long) current_gdbarch->deprecated_frame_chain
1009 /*DEPRECATED_FRAME_CHAIN ()*/);
1010 #endif
1011 #ifdef DEPRECATED_FRAME_CHAIN_VALID_P
1012 fprintf_unfiltered (file,
1013 "gdbarch_dump: %s # %s\n",
1014 "DEPRECATED_FRAME_CHAIN_VALID_P()",
1015 XSTRING (DEPRECATED_FRAME_CHAIN_VALID_P ()));
1016 fprintf_unfiltered (file,
1017 "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID_P() = %d\n",
1018 DEPRECATED_FRAME_CHAIN_VALID_P ());
1019 #endif
1020 #ifdef DEPRECATED_FRAME_CHAIN_VALID
1021 fprintf_unfiltered (file,
1022 "gdbarch_dump: %s # %s\n",
1023 "DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe)",
1024 XSTRING (DEPRECATED_FRAME_CHAIN_VALID (chain, thisframe)));
1025 fprintf_unfiltered (file,
1026 "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID = <0x%08lx>\n",
1027 (long) current_gdbarch->deprecated_frame_chain_valid
1028 /*DEPRECATED_FRAME_CHAIN_VALID ()*/);
1029 #endif
1030 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P
1031 fprintf_unfiltered (file,
1032 "gdbarch_dump: %s # %s\n",
1033 "DEPRECATED_FRAME_INIT_SAVED_REGS_P()",
1034 XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()));
1035 fprintf_unfiltered (file,
1036 "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS_P() = %d\n",
1037 DEPRECATED_FRAME_INIT_SAVED_REGS_P ());
1038 #endif
1039 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: %s # %s\n",
1042 "DEPRECATED_FRAME_INIT_SAVED_REGS(frame)",
1043 XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS (frame)));
1044 fprintf_unfiltered (file,
1045 "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS = <0x%08lx>\n",
1046 (long) current_gdbarch->deprecated_frame_init_saved_regs
1047 /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/);
1048 #endif
1049 #ifdef DEPRECATED_FRAME_LOCALS_ADDRESS_P
1050 fprintf_unfiltered (file,
1051 "gdbarch_dump: %s # %s\n",
1052 "DEPRECATED_FRAME_LOCALS_ADDRESS_P()",
1053 XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS_P ()));
1054 fprintf_unfiltered (file,
1055 "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS_P() = %d\n",
1056 DEPRECATED_FRAME_LOCALS_ADDRESS_P ());
1057 #endif
1058 #ifdef DEPRECATED_FRAME_LOCALS_ADDRESS
1059 fprintf_unfiltered (file,
1060 "gdbarch_dump: %s # %s\n",
1061 "DEPRECATED_FRAME_LOCALS_ADDRESS(fi)",
1062 XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS (fi)));
1063 fprintf_unfiltered (file,
1064 "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS = <0x%08lx>\n",
1065 (long) current_gdbarch->deprecated_frame_locals_address
1066 /*DEPRECATED_FRAME_LOCALS_ADDRESS ()*/);
1067 #endif
1068 #ifdef DEPRECATED_FRAME_SAVED_PC_P
1069 fprintf_unfiltered (file,
1070 "gdbarch_dump: %s # %s\n",
1071 "DEPRECATED_FRAME_SAVED_PC_P()",
1072 XSTRING (DEPRECATED_FRAME_SAVED_PC_P ()));
1073 fprintf_unfiltered (file,
1074 "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC_P() = %d\n",
1075 DEPRECATED_FRAME_SAVED_PC_P ());
1076 #endif
1077 #ifdef DEPRECATED_FRAME_SAVED_PC
1078 fprintf_unfiltered (file,
1079 "gdbarch_dump: %s # %s\n",
1080 "DEPRECATED_FRAME_SAVED_PC(fi)",
1081 XSTRING (DEPRECATED_FRAME_SAVED_PC (fi)));
1082 fprintf_unfiltered (file,
1083 "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC = <0x%08lx>\n",
1084 (long) current_gdbarch->deprecated_frame_saved_pc
1085 /*DEPRECATED_FRAME_SAVED_PC ()*/);
1086 #endif
1087 #ifdef DEPRECATED_FUNCTION_START_OFFSET
1088 fprintf_unfiltered (file,
1089 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
1090 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
1091 fprintf_unfiltered (file,
1092 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET = %ld\n",
1093 (long) DEPRECATED_FUNCTION_START_OFFSET);
1094 #endif
1095 #ifdef DEPRECATED_GET_SAVED_REGISTER_P
1096 fprintf_unfiltered (file,
1097 "gdbarch_dump: %s # %s\n",
1098 "DEPRECATED_GET_SAVED_REGISTER_P()",
1099 XSTRING (DEPRECATED_GET_SAVED_REGISTER_P ()));
1100 fprintf_unfiltered (file,
1101 "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER_P() = %d\n",
1102 DEPRECATED_GET_SAVED_REGISTER_P ());
1103 #endif
1104 #ifdef DEPRECATED_GET_SAVED_REGISTER
1105 fprintf_unfiltered (file,
1106 "gdbarch_dump: %s # %s\n",
1107 "DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1108 XSTRING (DEPRECATED_GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1109 fprintf_unfiltered (file,
1110 "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER = <0x%08lx>\n",
1111 (long) current_gdbarch->deprecated_get_saved_register
1112 /*DEPRECATED_GET_SAVED_REGISTER ()*/);
1113 #endif
1114 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
1115 fprintf_unfiltered (file,
1116 "gdbarch_dump: %s # %s\n",
1117 "DEPRECATED_INIT_EXTRA_FRAME_INFO_P()",
1118 XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()));
1119 fprintf_unfiltered (file,
1120 "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO_P() = %d\n",
1121 DEPRECATED_INIT_EXTRA_FRAME_INFO_P ());
1122 #endif
1123 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO
1124 fprintf_unfiltered (file,
1125 "gdbarch_dump: %s # %s\n",
1126 "DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1127 XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1128 fprintf_unfiltered (file,
1129 "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO = <0x%08lx>\n",
1130 (long) current_gdbarch->deprecated_init_extra_frame_info
1131 /*DEPRECATED_INIT_EXTRA_FRAME_INFO ()*/);
1132 #endif
1133 #ifdef DEPRECATED_INIT_FRAME_PC_P
1134 fprintf_unfiltered (file,
1135 "gdbarch_dump: %s # %s\n",
1136 "DEPRECATED_INIT_FRAME_PC_P()",
1137 XSTRING (DEPRECATED_INIT_FRAME_PC_P ()));
1138 fprintf_unfiltered (file,
1139 "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_P() = %d\n",
1140 DEPRECATED_INIT_FRAME_PC_P ());
1141 #endif
1142 #ifdef DEPRECATED_INIT_FRAME_PC
1143 fprintf_unfiltered (file,
1144 "gdbarch_dump: %s # %s\n",
1145 "DEPRECATED_INIT_FRAME_PC(fromleaf, prev)",
1146 XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev)));
1147 fprintf_unfiltered (file,
1148 "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n",
1149 (long) current_gdbarch->deprecated_init_frame_pc
1150 /*DEPRECATED_INIT_FRAME_PC ()*/);
1151 #endif
1152 #ifdef DEPRECATED_POP_FRAME_P
1153 fprintf_unfiltered (file,
1154 "gdbarch_dump: %s # %s\n",
1155 "DEPRECATED_POP_FRAME_P()",
1156 XSTRING (DEPRECATED_POP_FRAME_P ()));
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: DEPRECATED_POP_FRAME_P() = %d\n",
1159 DEPRECATED_POP_FRAME_P ());
1160 #endif
1161 #ifdef DEPRECATED_POP_FRAME
1162 fprintf_unfiltered (file,
1163 "gdbarch_dump: %s # %s\n",
1164 "DEPRECATED_POP_FRAME(-)",
1165 XSTRING (DEPRECATED_POP_FRAME (-)));
1166 fprintf_unfiltered (file,
1167 "gdbarch_dump: DEPRECATED_POP_FRAME = <0x%08lx>\n",
1168 (long) current_gdbarch->deprecated_pop_frame
1169 /*DEPRECATED_POP_FRAME ()*/);
1170 #endif
1171 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
1172 fprintf_unfiltered (file,
1173 "gdbarch_dump: %s # %s\n",
1174 "DEPRECATED_PUSH_ARGUMENTS_P()",
1175 XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
1176 fprintf_unfiltered (file,
1177 "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS_P() = %d\n",
1178 DEPRECATED_PUSH_ARGUMENTS_P ());
1179 #endif
1180 #ifdef DEPRECATED_PUSH_ARGUMENTS
1181 fprintf_unfiltered (file,
1182 "gdbarch_dump: %s # %s\n",
1183 "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1184 XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
1185 fprintf_unfiltered (file,
1186 "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS = <0x%08lx>\n",
1187 (long) current_gdbarch->deprecated_push_arguments
1188 /*DEPRECATED_PUSH_ARGUMENTS ()*/);
1189 #endif
1190 #ifdef DEPRECATED_PUSH_RETURN_ADDRESS_P
1191 fprintf_unfiltered (file,
1192 "gdbarch_dump: %s # %s\n",
1193 "DEPRECATED_PUSH_RETURN_ADDRESS_P()",
1194 XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS_P ()));
1195 fprintf_unfiltered (file,
1196 "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS_P() = %d\n",
1197 DEPRECATED_PUSH_RETURN_ADDRESS_P ());
1198 #endif
1199 #ifdef DEPRECATED_PUSH_RETURN_ADDRESS
1200 fprintf_unfiltered (file,
1201 "gdbarch_dump: %s # %s\n",
1202 "DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp)",
1203 XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS (pc, sp)));
1204 fprintf_unfiltered (file,
1205 "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS = <0x%08lx>\n",
1206 (long) current_gdbarch->deprecated_push_return_address
1207 /*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
1208 #endif
1209 #ifdef DEPRECATED_REGISTER_BYTE_P
1210 fprintf_unfiltered (file,
1211 "gdbarch_dump: %s # %s\n",
1212 "DEPRECATED_REGISTER_BYTE_P()",
1213 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
1214 fprintf_unfiltered (file,
1215 "gdbarch_dump: DEPRECATED_REGISTER_BYTE_P() = %d\n",
1216 DEPRECATED_REGISTER_BYTE_P ());
1217 #endif
1218 #ifdef DEPRECATED_REGISTER_BYTE
1219 fprintf_unfiltered (file,
1220 "gdbarch_dump: %s # %s\n",
1221 "DEPRECATED_REGISTER_BYTE(reg_nr)",
1222 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
1223 fprintf_unfiltered (file,
1224 "gdbarch_dump: DEPRECATED_REGISTER_BYTE = <0x%08lx>\n",
1225 (long) current_gdbarch->deprecated_register_byte
1226 /*DEPRECATED_REGISTER_BYTE ()*/);
1227 #endif
1228 #ifdef DEPRECATED_REGISTER_BYTES
1229 fprintf_unfiltered (file,
1230 "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n",
1231 XSTRING (DEPRECATED_REGISTER_BYTES));
1232 fprintf_unfiltered (file,
1233 "gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n",
1234 DEPRECATED_REGISTER_BYTES);
1235 #endif
1236 #ifdef DEPRECATED_REGISTER_RAW_SIZE_P
1237 fprintf_unfiltered (file,
1238 "gdbarch_dump: %s # %s\n",
1239 "DEPRECATED_REGISTER_RAW_SIZE_P()",
1240 XSTRING (DEPRECATED_REGISTER_RAW_SIZE_P ()));
1241 fprintf_unfiltered (file,
1242 "gdbarch_dump: DEPRECATED_REGISTER_RAW_SIZE_P() = %d\n",
1243 DEPRECATED_REGISTER_RAW_SIZE_P ());
1244 #endif
1245 #ifdef DEPRECATED_REGISTER_RAW_SIZE
1246 fprintf_unfiltered (file,
1247 "gdbarch_dump: %s # %s\n",
1248 "DEPRECATED_REGISTER_RAW_SIZE(reg_nr)",
1249 XSTRING (DEPRECATED_REGISTER_RAW_SIZE (reg_nr)));
1250 fprintf_unfiltered (file,
1251 "gdbarch_dump: DEPRECATED_REGISTER_RAW_SIZE = <0x%08lx>\n",
1252 (long) current_gdbarch->deprecated_register_raw_size
1253 /*DEPRECATED_REGISTER_RAW_SIZE ()*/);
1254 #endif
1255 #ifdef DEPRECATED_REGISTER_SIZE
1256 fprintf_unfiltered (file,
1257 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
1258 XSTRING (DEPRECATED_REGISTER_SIZE));
1259 fprintf_unfiltered (file,
1260 "gdbarch_dump: DEPRECATED_REGISTER_SIZE = %d\n",
1261 DEPRECATED_REGISTER_SIZE);
1262 #endif
1263 #ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE_P
1264 fprintf_unfiltered (file,
1265 "gdbarch_dump: %s # %s\n",
1266 "DEPRECATED_REGISTER_VIRTUAL_SIZE_P()",
1267 XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE_P ()));
1268 fprintf_unfiltered (file,
1269 "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_SIZE_P() = %d\n",
1270 DEPRECATED_REGISTER_VIRTUAL_SIZE_P ());
1271 #endif
1272 #ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE
1273 fprintf_unfiltered (file,
1274 "gdbarch_dump: %s # %s\n",
1275 "DEPRECATED_REGISTER_VIRTUAL_SIZE(reg_nr)",
1276 XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE (reg_nr)));
1277 fprintf_unfiltered (file,
1278 "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_SIZE = <0x%08lx>\n",
1279 (long) current_gdbarch->deprecated_register_virtual_size
1280 /*DEPRECATED_REGISTER_VIRTUAL_SIZE ()*/);
1281 #endif
1282 #ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE_P
1283 fprintf_unfiltered (file,
1284 "gdbarch_dump: %s # %s\n",
1285 "DEPRECATED_REGISTER_VIRTUAL_TYPE_P()",
1286 XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE_P ()));
1287 fprintf_unfiltered (file,
1288 "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_TYPE_P() = %d\n",
1289 DEPRECATED_REGISTER_VIRTUAL_TYPE_P ());
1290 #endif
1291 #ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE
1292 fprintf_unfiltered (file,
1293 "gdbarch_dump: %s # %s\n",
1294 "DEPRECATED_REGISTER_VIRTUAL_TYPE(reg_nr)",
1295 XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr)));
1296 fprintf_unfiltered (file,
1297 "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_TYPE = <0x%08lx>\n",
1298 (long) current_gdbarch->deprecated_register_virtual_type
1299 /*DEPRECATED_REGISTER_VIRTUAL_TYPE ()*/);
1300 #endif
1301 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
1302 fprintf_unfiltered (file,
1303 "gdbarch_dump: %s # %s\n",
1304 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
1305 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
1306 fprintf_unfiltered (file,
1307 "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR_P() = %d\n",
1308 DEPRECATED_REG_STRUCT_HAS_ADDR_P ());
1309 #endif
1310 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
1311 fprintf_unfiltered (file,
1312 "gdbarch_dump: %s # %s\n",
1313 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
1314 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
1315 fprintf_unfiltered (file,
1316 "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR = <0x%08lx>\n",
1317 (long) current_gdbarch->deprecated_reg_struct_has_addr
1318 /*DEPRECATED_REG_STRUCT_HAS_ADDR ()*/);
1319 #endif
1320 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
1321 fprintf_unfiltered (file,
1322 "gdbarch_dump: %s # %s\n",
1323 "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
1324 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
1325 fprintf_unfiltered (file,
1326 "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL_P() = %d\n",
1327 DEPRECATED_SAVED_PC_AFTER_CALL_P ());
1328 #endif
1329 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL
1330 fprintf_unfiltered (file,
1331 "gdbarch_dump: %s # %s\n",
1332 "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
1333 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
1334 fprintf_unfiltered (file,
1335 "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL = <0x%08lx>\n",
1336 (long) current_gdbarch->deprecated_saved_pc_after_call
1337 /*DEPRECATED_SAVED_PC_AFTER_CALL ()*/);
1338 #endif
1339 #ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS_P
1340 fprintf_unfiltered (file,
1341 "gdbarch_dump: %s # %s\n",
1342 "DEPRECATED_SAVE_DUMMY_FRAME_TOS_P()",
1343 XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ()));
1344 fprintf_unfiltered (file,
1345 "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() = %d\n",
1346 DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ());
1347 #endif
1348 #ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS
1349 fprintf_unfiltered (file,
1350 "gdbarch_dump: %s # %s\n",
1351 "DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp)",
1352 XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp)));
1353 fprintf_unfiltered (file,
1354 "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n",
1355 (long) current_gdbarch->deprecated_save_dummy_frame_tos
1356 /*DEPRECATED_SAVE_DUMMY_FRAME_TOS ()*/);
1357 #endif
1358 #ifdef DEPRECATED_STACK_ALIGN_P
1359 fprintf_unfiltered (file,
1360 "gdbarch_dump: %s # %s\n",
1361 "DEPRECATED_STACK_ALIGN_P()",
1362 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
1363 fprintf_unfiltered (file,
1364 "gdbarch_dump: DEPRECATED_STACK_ALIGN_P() = %d\n",
1365 DEPRECATED_STACK_ALIGN_P ());
1366 #endif
1367 #ifdef DEPRECATED_STACK_ALIGN
1368 fprintf_unfiltered (file,
1369 "gdbarch_dump: %s # %s\n",
1370 "DEPRECATED_STACK_ALIGN(sp)",
1371 XSTRING (DEPRECATED_STACK_ALIGN (sp)));
1372 fprintf_unfiltered (file,
1373 "gdbarch_dump: DEPRECATED_STACK_ALIGN = <0x%08lx>\n",
1374 (long) current_gdbarch->deprecated_stack_align
1375 /*DEPRECATED_STACK_ALIGN ()*/);
1376 #endif
1377 #ifdef DEPRECATED_STORE_RETURN_VALUE
1378 fprintf_unfiltered (file,
1379 "gdbarch_dump: %s # %s\n",
1380 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
1381 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
1382 fprintf_unfiltered (file,
1383 "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n",
1384 (long) current_gdbarch->deprecated_store_return_value
1385 /*DEPRECATED_STORE_RETURN_VALUE ()*/);
1386 #endif
1387 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
1388 fprintf_unfiltered (file,
1389 "gdbarch_dump: %s # %s\n",
1390 "DEPRECATED_STORE_STRUCT_RETURN_P()",
1391 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
1392 fprintf_unfiltered (file,
1393 "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN_P() = %d\n",
1394 DEPRECATED_STORE_STRUCT_RETURN_P ());
1395 #endif
1396 #ifdef DEPRECATED_STORE_STRUCT_RETURN
1397 fprintf_unfiltered (file,
1398 "gdbarch_dump: %s # %s\n",
1399 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
1400 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
1401 fprintf_unfiltered (file,
1402 "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN = <0x%08lx>\n",
1403 (long) current_gdbarch->deprecated_store_struct_return
1404 /*DEPRECATED_STORE_STRUCT_RETURN ()*/);
1405 #endif
1406 #ifdef DEPRECATED_TARGET_READ_FP_P
1407 fprintf_unfiltered (file,
1408 "gdbarch_dump: %s # %s\n",
1409 "DEPRECATED_TARGET_READ_FP_P()",
1410 XSTRING (DEPRECATED_TARGET_READ_FP_P ()));
1411 fprintf_unfiltered (file,
1412 "gdbarch_dump: DEPRECATED_TARGET_READ_FP_P() = %d\n",
1413 DEPRECATED_TARGET_READ_FP_P ());
1414 #endif
1415 #ifdef DEPRECATED_TARGET_READ_FP
1416 fprintf_unfiltered (file,
1417 "gdbarch_dump: %s # %s\n",
1418 "DEPRECATED_TARGET_READ_FP()",
1419 XSTRING (DEPRECATED_TARGET_READ_FP ()));
1420 fprintf_unfiltered (file,
1421 "gdbarch_dump: DEPRECATED_TARGET_READ_FP = <0x%08lx>\n",
1422 (long) current_gdbarch->deprecated_target_read_fp
1423 /*DEPRECATED_TARGET_READ_FP ()*/);
1424 #endif
1425 #ifdef DWARF2_REG_TO_REGNUM
1426 fprintf_unfiltered (file,
1427 "gdbarch_dump: %s # %s\n",
1428 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1429 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1430 fprintf_unfiltered (file,
1431 "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n",
1432 (long) current_gdbarch->dwarf2_reg_to_regnum
1433 /*DWARF2_REG_TO_REGNUM ()*/);
1434 #endif
1435 #ifdef DWARF_REG_TO_REGNUM
1436 fprintf_unfiltered (file,
1437 "gdbarch_dump: %s # %s\n",
1438 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1439 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1440 fprintf_unfiltered (file,
1441 "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n",
1442 (long) current_gdbarch->dwarf_reg_to_regnum
1443 /*DWARF_REG_TO_REGNUM ()*/);
1444 #endif
1445 #ifdef ECOFF_REG_TO_REGNUM
1446 fprintf_unfiltered (file,
1447 "gdbarch_dump: %s # %s\n",
1448 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1449 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1450 fprintf_unfiltered (file,
1451 "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n",
1452 (long) current_gdbarch->ecoff_reg_to_regnum
1453 /*ECOFF_REG_TO_REGNUM ()*/);
1454 #endif
1455 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1456 fprintf_unfiltered (file,
1457 "gdbarch_dump: %s # %s\n",
1458 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1459 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1460 fprintf_unfiltered (file,
1461 "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
1462 (long) current_gdbarch->elf_make_msymbol_special
1463 /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
1464 #endif
1465 #ifdef EXTRACT_RETURN_VALUE
1466 fprintf_unfiltered (file,
1467 "gdbarch_dump: %s # %s\n",
1468 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1469 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1470 fprintf_unfiltered (file,
1471 "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n",
1472 (long) current_gdbarch->extract_return_value
1473 /*EXTRACT_RETURN_VALUE ()*/);
1474 #endif
1475 #ifdef FETCH_POINTER_ARGUMENT_P
1476 fprintf_unfiltered (file,
1477 "gdbarch_dump: %s # %s\n",
1478 "FETCH_POINTER_ARGUMENT_P()",
1479 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1480 fprintf_unfiltered (file,
1481 "gdbarch_dump: FETCH_POINTER_ARGUMENT_P() = %d\n",
1482 FETCH_POINTER_ARGUMENT_P ());
1483 #endif
1484 #ifdef FETCH_POINTER_ARGUMENT
1485 fprintf_unfiltered (file,
1486 "gdbarch_dump: %s # %s\n",
1487 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1488 XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
1489 fprintf_unfiltered (file,
1490 "gdbarch_dump: FETCH_POINTER_ARGUMENT = <0x%08lx>\n",
1491 (long) current_gdbarch->fetch_pointer_argument
1492 /*FETCH_POINTER_ARGUMENT ()*/);
1493 #endif
1494 #ifdef FP0_REGNUM
1495 fprintf_unfiltered (file,
1496 "gdbarch_dump: FP0_REGNUM # %s\n",
1497 XSTRING (FP0_REGNUM));
1498 fprintf_unfiltered (file,
1499 "gdbarch_dump: FP0_REGNUM = %d\n",
1500 FP0_REGNUM);
1501 #endif
1502 #ifdef FRAME_ARGS_SKIP
1503 fprintf_unfiltered (file,
1504 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1505 XSTRING (FRAME_ARGS_SKIP));
1506 fprintf_unfiltered (file,
1507 "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1508 (long) FRAME_ARGS_SKIP);
1509 #endif
1510 #ifdef FRAME_NUM_ARGS_P
1511 fprintf_unfiltered (file,
1512 "gdbarch_dump: %s # %s\n",
1513 "FRAME_NUM_ARGS_P()",
1514 XSTRING (FRAME_NUM_ARGS_P ()));
1515 fprintf_unfiltered (file,
1516 "gdbarch_dump: FRAME_NUM_ARGS_P() = %d\n",
1517 FRAME_NUM_ARGS_P ());
1518 #endif
1519 #ifdef FRAME_NUM_ARGS
1520 fprintf_unfiltered (file,
1521 "gdbarch_dump: %s # %s\n",
1522 "FRAME_NUM_ARGS(frame)",
1523 XSTRING (FRAME_NUM_ARGS (frame)));
1524 fprintf_unfiltered (file,
1525 "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n",
1526 (long) current_gdbarch->frame_num_args
1527 /*FRAME_NUM_ARGS ()*/);
1528 #endif
1529 #ifdef FRAME_RED_ZONE_SIZE
1530 fprintf_unfiltered (file,
1531 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1532 XSTRING (FRAME_RED_ZONE_SIZE));
1533 fprintf_unfiltered (file,
1534 "gdbarch_dump: FRAME_RED_ZONE_SIZE = %d\n",
1535 FRAME_RED_ZONE_SIZE);
1536 #endif
1537 #ifdef GET_LONGJMP_TARGET_P
1538 fprintf_unfiltered (file,
1539 "gdbarch_dump: %s # %s\n",
1540 "GET_LONGJMP_TARGET_P()",
1541 XSTRING (GET_LONGJMP_TARGET_P ()));
1542 fprintf_unfiltered (file,
1543 "gdbarch_dump: GET_LONGJMP_TARGET_P() = %d\n",
1544 GET_LONGJMP_TARGET_P ());
1545 #endif
1546 #ifdef GET_LONGJMP_TARGET
1547 fprintf_unfiltered (file,
1548 "gdbarch_dump: %s # %s\n",
1549 "GET_LONGJMP_TARGET(pc)",
1550 XSTRING (GET_LONGJMP_TARGET (pc)));
1551 fprintf_unfiltered (file,
1552 "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n",
1553 (long) current_gdbarch->get_longjmp_target
1554 /*GET_LONGJMP_TARGET ()*/);
1555 #endif
1556 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1557 fprintf_unfiltered (file,
1558 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1559 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1560 fprintf_unfiltered (file,
1561 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n",
1562 HAVE_NONSTEPPABLE_WATCHPOINT);
1563 #endif
1564 #ifdef INNER_THAN
1565 fprintf_unfiltered (file,
1566 "gdbarch_dump: %s # %s\n",
1567 "INNER_THAN(lhs, rhs)",
1568 XSTRING (INNER_THAN (lhs, rhs)));
1569 fprintf_unfiltered (file,
1570 "gdbarch_dump: INNER_THAN = <0x%08lx>\n",
1571 (long) current_gdbarch->inner_than
1572 /*INNER_THAN ()*/);
1573 #endif
1574 #ifdef INTEGER_TO_ADDRESS_P
1575 fprintf_unfiltered (file,
1576 "gdbarch_dump: %s # %s\n",
1577 "INTEGER_TO_ADDRESS_P()",
1578 XSTRING (INTEGER_TO_ADDRESS_P ()));
1579 fprintf_unfiltered (file,
1580 "gdbarch_dump: INTEGER_TO_ADDRESS_P() = %d\n",
1581 INTEGER_TO_ADDRESS_P ());
1582 #endif
1583 #ifdef INTEGER_TO_ADDRESS
1584 fprintf_unfiltered (file,
1585 "gdbarch_dump: %s # %s\n",
1586 "INTEGER_TO_ADDRESS(type, buf)",
1587 XSTRING (INTEGER_TO_ADDRESS (type, buf)));
1588 fprintf_unfiltered (file,
1589 "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n",
1590 (long) current_gdbarch->integer_to_address
1591 /*INTEGER_TO_ADDRESS ()*/);
1592 #endif
1593 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1594 fprintf_unfiltered (file,
1595 "gdbarch_dump: %s # %s\n",
1596 "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1597 XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
1598 fprintf_unfiltered (file,
1599 "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n",
1600 (long) current_gdbarch->in_solib_call_trampoline
1601 /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
1602 #endif
1603 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1604 fprintf_unfiltered (file,
1605 "gdbarch_dump: %s # %s\n",
1606 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1607 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1608 fprintf_unfiltered (file,
1609 "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n",
1610 (long) current_gdbarch->in_solib_return_trampoline
1611 /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
1612 #endif
1613 #ifdef MEMORY_INSERT_BREAKPOINT
1614 fprintf_unfiltered (file,
1615 "gdbarch_dump: %s # %s\n",
1616 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1617 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1618 fprintf_unfiltered (file,
1619 "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n",
1620 (long) current_gdbarch->memory_insert_breakpoint
1621 /*MEMORY_INSERT_BREAKPOINT ()*/);
1622 #endif
1623 #ifdef MEMORY_REMOVE_BREAKPOINT
1624 fprintf_unfiltered (file,
1625 "gdbarch_dump: %s # %s\n",
1626 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1627 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1628 fprintf_unfiltered (file,
1629 "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n",
1630 (long) current_gdbarch->memory_remove_breakpoint
1631 /*MEMORY_REMOVE_BREAKPOINT ()*/);
1632 #endif
1633 #ifdef NAME_OF_MALLOC
1634 fprintf_unfiltered (file,
1635 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1636 XSTRING (NAME_OF_MALLOC));
1637 fprintf_unfiltered (file,
1638 "gdbarch_dump: NAME_OF_MALLOC = %s\n",
1639 NAME_OF_MALLOC);
1640 #endif
1641 #ifdef NUM_PSEUDO_REGS
1642 fprintf_unfiltered (file,
1643 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1644 XSTRING (NUM_PSEUDO_REGS));
1645 fprintf_unfiltered (file,
1646 "gdbarch_dump: NUM_PSEUDO_REGS = %d\n",
1647 NUM_PSEUDO_REGS);
1648 #endif
1649 #ifdef NUM_REGS
1650 fprintf_unfiltered (file,
1651 "gdbarch_dump: NUM_REGS # %s\n",
1652 XSTRING (NUM_REGS));
1653 fprintf_unfiltered (file,
1654 "gdbarch_dump: NUM_REGS = %d\n",
1655 NUM_REGS);
1656 #endif
1657 #ifdef PC_REGNUM
1658 fprintf_unfiltered (file,
1659 "gdbarch_dump: PC_REGNUM # %s\n",
1660 XSTRING (PC_REGNUM));
1661 fprintf_unfiltered (file,
1662 "gdbarch_dump: PC_REGNUM = %d\n",
1663 PC_REGNUM);
1664 #endif
1665 #ifdef POINTER_TO_ADDRESS
1666 fprintf_unfiltered (file,
1667 "gdbarch_dump: %s # %s\n",
1668 "POINTER_TO_ADDRESS(type, buf)",
1669 XSTRING (POINTER_TO_ADDRESS (type, buf)));
1670 fprintf_unfiltered (file,
1671 "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n",
1672 (long) current_gdbarch->pointer_to_address
1673 /*POINTER_TO_ADDRESS ()*/);
1674 #endif
1675 fprintf_unfiltered (file,
1676 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1677 gdbarch_print_float_info_p (current_gdbarch));
1678 fprintf_unfiltered (file,
1679 "gdbarch_dump: print_float_info = 0x%08lx\n",
1680 (long) current_gdbarch->print_float_info);
1681 fprintf_unfiltered (file,
1682 "gdbarch_dump: print_registers_info = 0x%08lx\n",
1683 (long) current_gdbarch->print_registers_info);
1684 fprintf_unfiltered (file,
1685 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1686 gdbarch_print_vector_info_p (current_gdbarch));
1687 fprintf_unfiltered (file,
1688 "gdbarch_dump: print_vector_info = 0x%08lx\n",
1689 (long) current_gdbarch->print_vector_info);
1690 #ifdef PS_REGNUM
1691 fprintf_unfiltered (file,
1692 "gdbarch_dump: PS_REGNUM # %s\n",
1693 XSTRING (PS_REGNUM));
1694 fprintf_unfiltered (file,
1695 "gdbarch_dump: PS_REGNUM = %d\n",
1696 PS_REGNUM);
1697 #endif
1698 fprintf_unfiltered (file,
1699 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1700 gdbarch_push_dummy_call_p (current_gdbarch));
1701 fprintf_unfiltered (file,
1702 "gdbarch_dump: push_dummy_call = 0x%08lx\n",
1703 (long) current_gdbarch->push_dummy_call);
1704 fprintf_unfiltered (file,
1705 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1706 gdbarch_push_dummy_code_p (current_gdbarch));
1707 fprintf_unfiltered (file,
1708 "gdbarch_dump: push_dummy_code = 0x%08lx\n",
1709 (long) current_gdbarch->push_dummy_code);
1710 #ifdef REGISTER_BYTES_OK_P
1711 fprintf_unfiltered (file,
1712 "gdbarch_dump: %s # %s\n",
1713 "REGISTER_BYTES_OK_P()",
1714 XSTRING (REGISTER_BYTES_OK_P ()));
1715 fprintf_unfiltered (file,
1716 "gdbarch_dump: REGISTER_BYTES_OK_P() = %d\n",
1717 REGISTER_BYTES_OK_P ());
1718 #endif
1719 #ifdef REGISTER_BYTES_OK
1720 fprintf_unfiltered (file,
1721 "gdbarch_dump: %s # %s\n",
1722 "REGISTER_BYTES_OK(nr_bytes)",
1723 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1724 fprintf_unfiltered (file,
1725 "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n",
1726 (long) current_gdbarch->register_bytes_ok
1727 /*REGISTER_BYTES_OK ()*/);
1728 #endif
1729 #ifdef REGISTER_NAME
1730 fprintf_unfiltered (file,
1731 "gdbarch_dump: %s # %s\n",
1732 "REGISTER_NAME(regnr)",
1733 XSTRING (REGISTER_NAME (regnr)));
1734 fprintf_unfiltered (file,
1735 "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n",
1736 (long) current_gdbarch->register_name
1737 /*REGISTER_NAME ()*/);
1738 #endif
1739 #ifdef REGISTER_SIM_REGNO
1740 fprintf_unfiltered (file,
1741 "gdbarch_dump: %s # %s\n",
1742 "REGISTER_SIM_REGNO(reg_nr)",
1743 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1744 fprintf_unfiltered (file,
1745 "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n",
1746 (long) current_gdbarch->register_sim_regno
1747 /*REGISTER_SIM_REGNO ()*/);
1748 #endif
1749 #ifdef REGISTER_TO_VALUE
1750 fprintf_unfiltered (file,
1751 "gdbarch_dump: %s # %s\n",
1752 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1753 XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
1754 fprintf_unfiltered (file,
1755 "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n",
1756 (long) current_gdbarch->register_to_value
1757 /*REGISTER_TO_VALUE ()*/);
1758 #endif
1759 fprintf_unfiltered (file,
1760 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1761 gdbarch_register_type_p (current_gdbarch));
1762 fprintf_unfiltered (file,
1763 "gdbarch_dump: register_type = 0x%08lx\n",
1764 (long) current_gdbarch->register_type);
1765 fprintf_unfiltered (file,
1766 "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n",
1767 (long) current_gdbarch->remote_translate_xfer_address);
1768 #ifdef SDB_REG_TO_REGNUM
1769 fprintf_unfiltered (file,
1770 "gdbarch_dump: %s # %s\n",
1771 "SDB_REG_TO_REGNUM(sdb_regnr)",
1772 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1773 fprintf_unfiltered (file,
1774 "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n",
1775 (long) current_gdbarch->sdb_reg_to_regnum
1776 /*SDB_REG_TO_REGNUM ()*/);
1777 #endif
1778 #ifdef SKIP_PROLOGUE
1779 fprintf_unfiltered (file,
1780 "gdbarch_dump: %s # %s\n",
1781 "SKIP_PROLOGUE(ip)",
1782 XSTRING (SKIP_PROLOGUE (ip)));
1783 fprintf_unfiltered (file,
1784 "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n",
1785 (long) current_gdbarch->skip_prologue
1786 /*SKIP_PROLOGUE ()*/);
1787 #endif
1788 fprintf_unfiltered (file,
1789 "gdbarch_dump: skip_solib_resolver = 0x%08lx\n",
1790 (long) current_gdbarch->skip_solib_resolver);
1791 #ifdef SKIP_TRAMPOLINE_CODE
1792 fprintf_unfiltered (file,
1793 "gdbarch_dump: %s # %s\n",
1794 "SKIP_TRAMPOLINE_CODE(pc)",
1795 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1796 fprintf_unfiltered (file,
1797 "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n",
1798 (long) current_gdbarch->skip_trampoline_code
1799 /*SKIP_TRAMPOLINE_CODE ()*/);
1800 #endif
1801 #ifdef SMASH_TEXT_ADDRESS
1802 fprintf_unfiltered (file,
1803 "gdbarch_dump: %s # %s\n",
1804 "SMASH_TEXT_ADDRESS(addr)",
1805 XSTRING (SMASH_TEXT_ADDRESS (addr)));
1806 fprintf_unfiltered (file,
1807 "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n",
1808 (long) current_gdbarch->smash_text_address
1809 /*SMASH_TEXT_ADDRESS ()*/);
1810 #endif
1811 #ifdef SOFTWARE_SINGLE_STEP_P
1812 fprintf_unfiltered (file,
1813 "gdbarch_dump: %s # %s\n",
1814 "SOFTWARE_SINGLE_STEP_P()",
1815 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
1816 fprintf_unfiltered (file,
1817 "gdbarch_dump: SOFTWARE_SINGLE_STEP_P() = %d\n",
1818 SOFTWARE_SINGLE_STEP_P ());
1819 #endif
1820 #ifdef SOFTWARE_SINGLE_STEP
1821 fprintf_unfiltered (file,
1822 "gdbarch_dump: %s # %s\n",
1823 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
1824 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
1825 fprintf_unfiltered (file,
1826 "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n",
1827 (long) current_gdbarch->software_single_step
1828 /*SOFTWARE_SINGLE_STEP ()*/);
1829 #endif
1830 #ifdef SP_REGNUM
1831 fprintf_unfiltered (file,
1832 "gdbarch_dump: SP_REGNUM # %s\n",
1833 XSTRING (SP_REGNUM));
1834 fprintf_unfiltered (file,
1835 "gdbarch_dump: SP_REGNUM = %d\n",
1836 SP_REGNUM);
1837 #endif
1838 #ifdef STAB_REG_TO_REGNUM
1839 fprintf_unfiltered (file,
1840 "gdbarch_dump: %s # %s\n",
1841 "STAB_REG_TO_REGNUM(stab_regnr)",
1842 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
1843 fprintf_unfiltered (file,
1844 "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n",
1845 (long) current_gdbarch->stab_reg_to_regnum
1846 /*STAB_REG_TO_REGNUM ()*/);
1847 #endif
1848 #ifdef STORE_RETURN_VALUE
1849 fprintf_unfiltered (file,
1850 "gdbarch_dump: %s # %s\n",
1851 "STORE_RETURN_VALUE(type, regcache, valbuf)",
1852 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
1853 fprintf_unfiltered (file,
1854 "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n",
1855 (long) current_gdbarch->store_return_value
1856 /*STORE_RETURN_VALUE ()*/);
1857 #endif
1858 #ifdef TARGET_ADDR_BIT
1859 fprintf_unfiltered (file,
1860 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
1861 XSTRING (TARGET_ADDR_BIT));
1862 fprintf_unfiltered (file,
1863 "gdbarch_dump: TARGET_ADDR_BIT = %d\n",
1864 TARGET_ADDR_BIT);
1865 #endif
1866 #ifdef TARGET_ARCHITECTURE
1867 fprintf_unfiltered (file,
1868 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
1869 XSTRING (TARGET_ARCHITECTURE));
1870 if (TARGET_ARCHITECTURE != NULL)
1871 fprintf_unfiltered (file,
1872 "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
1873 TARGET_ARCHITECTURE->printable_name);
1874 #endif
1875 #ifdef TARGET_BFD_VMA_BIT
1876 fprintf_unfiltered (file,
1877 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
1878 XSTRING (TARGET_BFD_VMA_BIT));
1879 fprintf_unfiltered (file,
1880 "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n",
1881 TARGET_BFD_VMA_BIT);
1882 #endif
1883 #ifdef TARGET_BYTE_ORDER
1884 fprintf_unfiltered (file,
1885 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
1886 XSTRING (TARGET_BYTE_ORDER));
1887 fprintf_unfiltered (file,
1888 "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
1889 (long) TARGET_BYTE_ORDER);
1890 #endif
1891 #ifdef TARGET_CHAR_SIGNED
1892 fprintf_unfiltered (file,
1893 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
1894 XSTRING (TARGET_CHAR_SIGNED));
1895 fprintf_unfiltered (file,
1896 "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
1897 TARGET_CHAR_SIGNED);
1898 #endif
1899 #ifdef TARGET_DOUBLE_BIT
1900 fprintf_unfiltered (file,
1901 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
1902 XSTRING (TARGET_DOUBLE_BIT));
1903 fprintf_unfiltered (file,
1904 "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n",
1905 TARGET_DOUBLE_BIT);
1906 #endif
1907 #ifdef TARGET_DOUBLE_FORMAT
1908 fprintf_unfiltered (file,
1909 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1910 XSTRING (TARGET_DOUBLE_FORMAT));
1911 fprintf_unfiltered (file,
1912 "gdbarch_dump: TARGET_DOUBLE_FORMAT = %s\n",
1913 (TARGET_DOUBLE_FORMAT)->name);
1914 #endif
1915 #ifdef TARGET_FLOAT_BIT
1916 fprintf_unfiltered (file,
1917 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1918 XSTRING (TARGET_FLOAT_BIT));
1919 fprintf_unfiltered (file,
1920 "gdbarch_dump: TARGET_FLOAT_BIT = %d\n",
1921 TARGET_FLOAT_BIT);
1922 #endif
1923 #ifdef TARGET_FLOAT_FORMAT
1924 fprintf_unfiltered (file,
1925 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1926 XSTRING (TARGET_FLOAT_FORMAT));
1927 fprintf_unfiltered (file,
1928 "gdbarch_dump: TARGET_FLOAT_FORMAT = %s\n",
1929 (TARGET_FLOAT_FORMAT)->name);
1930 #endif
1931 #ifdef TARGET_INT_BIT
1932 fprintf_unfiltered (file,
1933 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1934 XSTRING (TARGET_INT_BIT));
1935 fprintf_unfiltered (file,
1936 "gdbarch_dump: TARGET_INT_BIT = %d\n",
1937 TARGET_INT_BIT);
1938 #endif
1939 #ifdef TARGET_LONG_BIT
1940 fprintf_unfiltered (file,
1941 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1942 XSTRING (TARGET_LONG_BIT));
1943 fprintf_unfiltered (file,
1944 "gdbarch_dump: TARGET_LONG_BIT = %d\n",
1945 TARGET_LONG_BIT);
1946 #endif
1947 #ifdef TARGET_LONG_DOUBLE_BIT
1948 fprintf_unfiltered (file,
1949 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1950 XSTRING (TARGET_LONG_DOUBLE_BIT));
1951 fprintf_unfiltered (file,
1952 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n",
1953 TARGET_LONG_DOUBLE_BIT);
1954 #endif
1955 #ifdef TARGET_LONG_DOUBLE_FORMAT
1956 fprintf_unfiltered (file,
1957 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1958 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1959 fprintf_unfiltered (file,
1960 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %s\n",
1961 (TARGET_LONG_DOUBLE_FORMAT)->name);
1962 #endif
1963 #ifdef TARGET_LONG_LONG_BIT
1964 fprintf_unfiltered (file,
1965 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1966 XSTRING (TARGET_LONG_LONG_BIT));
1967 fprintf_unfiltered (file,
1968 "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n",
1969 TARGET_LONG_LONG_BIT);
1970 #endif
1971 #ifdef TARGET_OSABI
1972 fprintf_unfiltered (file,
1973 "gdbarch_dump: TARGET_OSABI # %s\n",
1974 XSTRING (TARGET_OSABI));
1975 fprintf_unfiltered (file,
1976 "gdbarch_dump: TARGET_OSABI = %ld\n",
1977 (long) TARGET_OSABI);
1978 #endif
1979 #ifdef TARGET_PRINT_INSN
1980 fprintf_unfiltered (file,
1981 "gdbarch_dump: %s # %s\n",
1982 "TARGET_PRINT_INSN(vma, info)",
1983 XSTRING (TARGET_PRINT_INSN (vma, info)));
1984 fprintf_unfiltered (file,
1985 "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n",
1986 (long) current_gdbarch->print_insn
1987 /*TARGET_PRINT_INSN ()*/);
1988 #endif
1989 #ifdef TARGET_PTR_BIT
1990 fprintf_unfiltered (file,
1991 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1992 XSTRING (TARGET_PTR_BIT));
1993 fprintf_unfiltered (file,
1994 "gdbarch_dump: TARGET_PTR_BIT = %d\n",
1995 TARGET_PTR_BIT);
1996 #endif
1997 #ifdef TARGET_READ_PC_P
1998 fprintf_unfiltered (file,
1999 "gdbarch_dump: %s # %s\n",
2000 "TARGET_READ_PC_P()",
2001 XSTRING (TARGET_READ_PC_P ()));
2002 fprintf_unfiltered (file,
2003 "gdbarch_dump: TARGET_READ_PC_P() = %d\n",
2004 TARGET_READ_PC_P ());
2005 #endif
2006 #ifdef TARGET_READ_PC
2007 fprintf_unfiltered (file,
2008 "gdbarch_dump: %s # %s\n",
2009 "TARGET_READ_PC(ptid)",
2010 XSTRING (TARGET_READ_PC (ptid)));
2011 fprintf_unfiltered (file,
2012 "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n",
2013 (long) current_gdbarch->read_pc
2014 /*TARGET_READ_PC ()*/);
2015 #endif
2016 #ifdef TARGET_READ_SP_P
2017 fprintf_unfiltered (file,
2018 "gdbarch_dump: %s # %s\n",
2019 "TARGET_READ_SP_P()",
2020 XSTRING (TARGET_READ_SP_P ()));
2021 fprintf_unfiltered (file,
2022 "gdbarch_dump: TARGET_READ_SP_P() = %d\n",
2023 TARGET_READ_SP_P ());
2024 #endif
2025 #ifdef TARGET_READ_SP
2026 fprintf_unfiltered (file,
2027 "gdbarch_dump: %s # %s\n",
2028 "TARGET_READ_SP()",
2029 XSTRING (TARGET_READ_SP ()));
2030 fprintf_unfiltered (file,
2031 "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n",
2032 (long) current_gdbarch->read_sp
2033 /*TARGET_READ_SP ()*/);
2034 #endif
2035 #ifdef TARGET_SHORT_BIT
2036 fprintf_unfiltered (file,
2037 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
2038 XSTRING (TARGET_SHORT_BIT));
2039 fprintf_unfiltered (file,
2040 "gdbarch_dump: TARGET_SHORT_BIT = %d\n",
2041 TARGET_SHORT_BIT);
2042 #endif
2043 #ifdef TARGET_VIRTUAL_FRAME_POINTER
2044 fprintf_unfiltered (file,
2045 "gdbarch_dump: %s # %s\n",
2046 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
2047 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
2048 fprintf_unfiltered (file,
2049 "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n",
2050 (long) current_gdbarch->virtual_frame_pointer
2051 /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
2052 #endif
2053 #ifdef TARGET_WRITE_PC
2054 fprintf_unfiltered (file,
2055 "gdbarch_dump: %s # %s\n",
2056 "TARGET_WRITE_PC(val, ptid)",
2057 XSTRING (TARGET_WRITE_PC (val, ptid)));
2058 fprintf_unfiltered (file,
2059 "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n",
2060 (long) current_gdbarch->write_pc
2061 /*TARGET_WRITE_PC ()*/);
2062 #endif
2063 fprintf_unfiltered (file,
2064 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
2065 gdbarch_unwind_dummy_id_p (current_gdbarch));
2066 fprintf_unfiltered (file,
2067 "gdbarch_dump: unwind_dummy_id = 0x%08lx\n",
2068 (long) current_gdbarch->unwind_dummy_id);
2069 fprintf_unfiltered (file,
2070 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
2071 gdbarch_unwind_pc_p (current_gdbarch));
2072 fprintf_unfiltered (file,
2073 "gdbarch_dump: unwind_pc = 0x%08lx\n",
2074 (long) current_gdbarch->unwind_pc);
2075 fprintf_unfiltered (file,
2076 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
2077 gdbarch_unwind_sp_p (current_gdbarch));
2078 fprintf_unfiltered (file,
2079 "gdbarch_dump: unwind_sp = 0x%08lx\n",
2080 (long) current_gdbarch->unwind_sp);
2081 #ifdef USE_STRUCT_CONVENTION
2082 fprintf_unfiltered (file,
2083 "gdbarch_dump: %s # %s\n",
2084 "USE_STRUCT_CONVENTION(gcc_p, value_type)",
2085 XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
2086 fprintf_unfiltered (file,
2087 "gdbarch_dump: USE_STRUCT_CONVENTION = <0x%08lx>\n",
2088 (long) current_gdbarch->use_struct_convention
2089 /*USE_STRUCT_CONVENTION ()*/);
2090 #endif
2091 #ifdef VALUE_TO_REGISTER
2092 fprintf_unfiltered (file,
2093 "gdbarch_dump: %s # %s\n",
2094 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
2095 XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
2096 fprintf_unfiltered (file,
2097 "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n",
2098 (long) current_gdbarch->value_to_register
2099 /*VALUE_TO_REGISTER ()*/);
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 != NULL;
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 if (gdbarch_debug >= 2)
3468 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
3469 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
3470 }
3471
3472 void
3473 set_gdbarch_return_value (struct gdbarch *gdbarch,
3474 gdbarch_return_value_ftype return_value)
3475 {
3476 gdbarch->return_value = return_value;
3477 }
3478
3479 void
3480 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
3481 {
3482 gdb_assert (gdbarch != NULL);
3483 gdb_assert (gdbarch->extract_return_value != NULL);
3484 if (gdbarch_debug >= 2)
3485 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
3486 gdbarch->extract_return_value (type, regcache, valbuf);
3487 }
3488
3489 void
3490 set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
3491 gdbarch_extract_return_value_ftype extract_return_value)
3492 {
3493 gdbarch->extract_return_value = extract_return_value;
3494 }
3495
3496 void
3497 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
3498 {
3499 gdb_assert (gdbarch != NULL);
3500 gdb_assert (gdbarch->store_return_value != NULL);
3501 if (gdbarch_debug >= 2)
3502 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
3503 gdbarch->store_return_value (type, regcache, valbuf);
3504 }
3505
3506 void
3507 set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3508 gdbarch_store_return_value_ftype store_return_value)
3509 {
3510 gdbarch->store_return_value = store_return_value;
3511 }
3512
3513 void
3514 gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
3515 {
3516 gdb_assert (gdbarch != NULL);
3517 gdb_assert (gdbarch->deprecated_extract_return_value != NULL);
3518 if (gdbarch_debug >= 2)
3519 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
3520 gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
3521 }
3522
3523 void
3524 set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
3525 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
3526 {
3527 gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
3528 }
3529
3530 void
3531 gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3532 {
3533 gdb_assert (gdbarch != NULL);
3534 gdb_assert (gdbarch->deprecated_store_return_value != NULL);
3535 if (gdbarch_debug >= 2)
3536 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
3537 gdbarch->deprecated_store_return_value (type, valbuf);
3538 }
3539
3540 void
3541 set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
3542 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
3543 {
3544 gdbarch->deprecated_store_return_value = deprecated_store_return_value;
3545 }
3546
3547 int
3548 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
3549 {
3550 gdb_assert (gdbarch != NULL);
3551 gdb_assert (gdbarch->use_struct_convention != NULL);
3552 if (gdbarch_debug >= 2)
3553 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
3554 return gdbarch->use_struct_convention (gcc_p, value_type);
3555 }
3556
3557 void
3558 set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
3559 gdbarch_use_struct_convention_ftype use_struct_convention)
3560 {
3561 gdbarch->use_struct_convention = use_struct_convention;
3562 }
3563
3564 int
3565 gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
3566 {
3567 gdb_assert (gdbarch != NULL);
3568 return gdbarch->deprecated_extract_struct_value_address != NULL;
3569 }
3570
3571 CORE_ADDR
3572 gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
3573 {
3574 gdb_assert (gdbarch != NULL);
3575 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
3576 if (gdbarch_debug >= 2)
3577 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
3578 return gdbarch->deprecated_extract_struct_value_address (regcache);
3579 }
3580
3581 void
3582 set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
3583 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
3584 {
3585 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
3586 }
3587
3588 int
3589 gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch)
3590 {
3591 gdb_assert (gdbarch != NULL);
3592 return gdbarch->deprecated_frame_init_saved_regs != NULL;
3593 }
3594
3595 void
3596 gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
3597 {
3598 gdb_assert (gdbarch != NULL);
3599 gdb_assert (gdbarch->deprecated_frame_init_saved_regs != NULL);
3600 if (gdbarch_debug >= 2)
3601 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_init_saved_regs called\n");
3602 gdbarch->deprecated_frame_init_saved_regs (frame);
3603 }
3604
3605 void
3606 set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch,
3607 gdbarch_deprecated_frame_init_saved_regs_ftype deprecated_frame_init_saved_regs)
3608 {
3609 gdbarch->deprecated_frame_init_saved_regs = deprecated_frame_init_saved_regs;
3610 }
3611
3612 int
3613 gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch)
3614 {
3615 gdb_assert (gdbarch != NULL);
3616 return gdbarch->deprecated_init_extra_frame_info != NULL;
3617 }
3618
3619 void
3620 gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
3621 {
3622 gdb_assert (gdbarch != NULL);
3623 gdb_assert (gdbarch->deprecated_init_extra_frame_info != NULL);
3624 if (gdbarch_debug >= 2)
3625 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_extra_frame_info called\n");
3626 gdbarch->deprecated_init_extra_frame_info (fromleaf, frame);
3627 }
3628
3629 void
3630 set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch,
3631 gdbarch_deprecated_init_extra_frame_info_ftype deprecated_init_extra_frame_info)
3632 {
3633 gdbarch->deprecated_init_extra_frame_info = deprecated_init_extra_frame_info;
3634 }
3635
3636 CORE_ADDR
3637 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
3638 {
3639 gdb_assert (gdbarch != NULL);
3640 gdb_assert (gdbarch->skip_prologue != NULL);
3641 if (gdbarch_debug >= 2)
3642 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
3643 return gdbarch->skip_prologue (ip);
3644 }
3645
3646 void
3647 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
3648 gdbarch_skip_prologue_ftype skip_prologue)
3649 {
3650 gdbarch->skip_prologue = skip_prologue;
3651 }
3652
3653 int
3654 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
3655 {
3656 gdb_assert (gdbarch != NULL);
3657 gdb_assert (gdbarch->inner_than != NULL);
3658 if (gdbarch_debug >= 2)
3659 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
3660 return gdbarch->inner_than (lhs, rhs);
3661 }
3662
3663 void
3664 set_gdbarch_inner_than (struct gdbarch *gdbarch,
3665 gdbarch_inner_than_ftype inner_than)
3666 {
3667 gdbarch->inner_than = inner_than;
3668 }
3669
3670 const unsigned char *
3671 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
3672 {
3673 gdb_assert (gdbarch != NULL);
3674 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
3675 if (gdbarch_debug >= 2)
3676 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
3677 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
3678 }
3679
3680 void
3681 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
3682 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
3683 {
3684 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
3685 }
3686
3687 int
3688 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
3689 {
3690 gdb_assert (gdbarch != NULL);
3691 return gdbarch->adjust_breakpoint_address != NULL;
3692 }
3693
3694 CORE_ADDR
3695 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
3696 {
3697 gdb_assert (gdbarch != NULL);
3698 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
3699 if (gdbarch_debug >= 2)
3700 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
3701 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
3702 }
3703
3704 void
3705 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
3706 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
3707 {
3708 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
3709 }
3710
3711 int
3712 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3713 {
3714 gdb_assert (gdbarch != NULL);
3715 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
3716 if (gdbarch_debug >= 2)
3717 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
3718 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
3719 }
3720
3721 void
3722 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
3723 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
3724 {
3725 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
3726 }
3727
3728 int
3729 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3730 {
3731 gdb_assert (gdbarch != NULL);
3732 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
3733 if (gdbarch_debug >= 2)
3734 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3735 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3736 }
3737
3738 void
3739 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3740 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3741 {
3742 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3743 }
3744
3745 CORE_ADDR
3746 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
3747 {
3748 gdb_assert (gdbarch != NULL);
3749 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
3750 if (gdbarch_debug >= 2)
3751 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3752 return gdbarch->decr_pc_after_break;
3753 }
3754
3755 void
3756 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3757 CORE_ADDR decr_pc_after_break)
3758 {
3759 gdbarch->decr_pc_after_break = decr_pc_after_break;
3760 }
3761
3762 CORE_ADDR
3763 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
3764 {
3765 gdb_assert (gdbarch != NULL);
3766 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
3767 if (gdbarch_debug >= 2)
3768 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
3769 return gdbarch->deprecated_function_start_offset;
3770 }
3771
3772 void
3773 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
3774 CORE_ADDR deprecated_function_start_offset)
3775 {
3776 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
3777 }
3778
3779 void
3780 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)
3781 {
3782 gdb_assert (gdbarch != NULL);
3783 gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
3784 if (gdbarch_debug >= 2)
3785 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
3786 gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
3787 }
3788
3789 void
3790 set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3791 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
3792 {
3793 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3794 }
3795
3796 CORE_ADDR
3797 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
3798 {
3799 gdb_assert (gdbarch != NULL);
3800 /* Skip verify of frame_args_skip, invalid_p == 0 */
3801 if (gdbarch_debug >= 2)
3802 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3803 return gdbarch->frame_args_skip;
3804 }
3805
3806 void
3807 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3808 CORE_ADDR frame_args_skip)
3809 {
3810 gdbarch->frame_args_skip = frame_args_skip;
3811 }
3812
3813 int
3814 gdbarch_deprecated_frameless_function_invocation_p (struct gdbarch *gdbarch)
3815 {
3816 gdb_assert (gdbarch != NULL);
3817 return gdbarch->deprecated_frameless_function_invocation != NULL;
3818 }
3819
3820 int
3821 gdbarch_deprecated_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
3822 {
3823 gdb_assert (gdbarch != NULL);
3824 gdb_assert (gdbarch->deprecated_frameless_function_invocation != NULL);
3825 if (gdbarch_debug >= 2)
3826 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frameless_function_invocation called\n");
3827 return gdbarch->deprecated_frameless_function_invocation (fi);
3828 }
3829
3830 void
3831 set_gdbarch_deprecated_frameless_function_invocation (struct gdbarch *gdbarch,
3832 gdbarch_deprecated_frameless_function_invocation_ftype deprecated_frameless_function_invocation)
3833 {
3834 gdbarch->deprecated_frameless_function_invocation = deprecated_frameless_function_invocation;
3835 }
3836
3837 int
3838 gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch)
3839 {
3840 gdb_assert (gdbarch != NULL);
3841 return gdbarch->deprecated_frame_chain != NULL;
3842 }
3843
3844 CORE_ADDR
3845 gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
3846 {
3847 gdb_assert (gdbarch != NULL);
3848 gdb_assert (gdbarch->deprecated_frame_chain != NULL);
3849 if (gdbarch_debug >= 2)
3850 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain called\n");
3851 return gdbarch->deprecated_frame_chain (frame);
3852 }
3853
3854 void
3855 set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch,
3856 gdbarch_deprecated_frame_chain_ftype deprecated_frame_chain)
3857 {
3858 gdbarch->deprecated_frame_chain = deprecated_frame_chain;
3859 }
3860
3861 int
3862 gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch)
3863 {
3864 gdb_assert (gdbarch != NULL);
3865 return gdbarch->deprecated_frame_chain_valid != NULL;
3866 }
3867
3868 int
3869 gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
3870 {
3871 gdb_assert (gdbarch != NULL);
3872 gdb_assert (gdbarch->deprecated_frame_chain_valid != NULL);
3873 if (gdbarch_debug >= 2)
3874 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain_valid called\n");
3875 return gdbarch->deprecated_frame_chain_valid (chain, thisframe);
3876 }
3877
3878 void
3879 set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch,
3880 gdbarch_deprecated_frame_chain_valid_ftype deprecated_frame_chain_valid)
3881 {
3882 gdbarch->deprecated_frame_chain_valid = deprecated_frame_chain_valid;
3883 }
3884
3885 int
3886 gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch)
3887 {
3888 gdb_assert (gdbarch != NULL);
3889 return gdbarch->deprecated_frame_saved_pc != NULL;
3890 }
3891
3892 CORE_ADDR
3893 gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
3894 {
3895 gdb_assert (gdbarch != NULL);
3896 gdb_assert (gdbarch->deprecated_frame_saved_pc != NULL);
3897 if (gdbarch_debug >= 2)
3898 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_saved_pc called\n");
3899 return gdbarch->deprecated_frame_saved_pc (fi);
3900 }
3901
3902 void
3903 set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch,
3904 gdbarch_deprecated_frame_saved_pc_ftype deprecated_frame_saved_pc)
3905 {
3906 gdbarch->deprecated_frame_saved_pc = deprecated_frame_saved_pc;
3907 }
3908
3909 int
3910 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
3911 {
3912 gdb_assert (gdbarch != NULL);
3913 return gdbarch->unwind_pc != NULL;
3914 }
3915
3916 CORE_ADDR
3917 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
3918 {
3919 gdb_assert (gdbarch != NULL);
3920 gdb_assert (gdbarch->unwind_pc != NULL);
3921 if (gdbarch_debug >= 2)
3922 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
3923 return gdbarch->unwind_pc (gdbarch, next_frame);
3924 }
3925
3926 void
3927 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
3928 gdbarch_unwind_pc_ftype unwind_pc)
3929 {
3930 gdbarch->unwind_pc = unwind_pc;
3931 }
3932
3933 int
3934 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
3935 {
3936 gdb_assert (gdbarch != NULL);
3937 return gdbarch->unwind_sp != NULL;
3938 }
3939
3940 CORE_ADDR
3941 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
3942 {
3943 gdb_assert (gdbarch != NULL);
3944 gdb_assert (gdbarch->unwind_sp != NULL);
3945 if (gdbarch_debug >= 2)
3946 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
3947 return gdbarch->unwind_sp (gdbarch, next_frame);
3948 }
3949
3950 void
3951 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
3952 gdbarch_unwind_sp_ftype unwind_sp)
3953 {
3954 gdbarch->unwind_sp = unwind_sp;
3955 }
3956
3957 int
3958 gdbarch_deprecated_frame_args_address_p (struct gdbarch *gdbarch)
3959 {
3960 gdb_assert (gdbarch != NULL);
3961 return gdbarch->deprecated_frame_args_address != get_frame_base;
3962 }
3963
3964 CORE_ADDR
3965 gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
3966 {
3967 gdb_assert (gdbarch != NULL);
3968 gdb_assert (gdbarch->deprecated_frame_args_address != NULL);
3969 /* Do not check predicate: gdbarch->deprecated_frame_args_address != get_frame_base, allow call. */
3970 if (gdbarch_debug >= 2)
3971 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_args_address called\n");
3972 return gdbarch->deprecated_frame_args_address (fi);
3973 }
3974
3975 void
3976 set_gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch,
3977 gdbarch_deprecated_frame_args_address_ftype deprecated_frame_args_address)
3978 {
3979 gdbarch->deprecated_frame_args_address = deprecated_frame_args_address;
3980 }
3981
3982 int
3983 gdbarch_deprecated_frame_locals_address_p (struct gdbarch *gdbarch)
3984 {
3985 gdb_assert (gdbarch != NULL);
3986 return gdbarch->deprecated_frame_locals_address != get_frame_base;
3987 }
3988
3989 CORE_ADDR
3990 gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
3991 {
3992 gdb_assert (gdbarch != NULL);
3993 gdb_assert (gdbarch->deprecated_frame_locals_address != NULL);
3994 /* Do not check predicate: gdbarch->deprecated_frame_locals_address != get_frame_base, allow call. */
3995 if (gdbarch_debug >= 2)
3996 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_locals_address called\n");
3997 return gdbarch->deprecated_frame_locals_address (fi);
3998 }
3999
4000 void
4001 set_gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch,
4002 gdbarch_deprecated_frame_locals_address_ftype deprecated_frame_locals_address)
4003 {
4004 gdbarch->deprecated_frame_locals_address = deprecated_frame_locals_address;
4005 }
4006
4007 int
4008 gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch)
4009 {
4010 gdb_assert (gdbarch != NULL);
4011 return gdbarch->deprecated_saved_pc_after_call != NULL;
4012 }
4013
4014 CORE_ADDR
4015 gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
4016 {
4017 gdb_assert (gdbarch != NULL);
4018 gdb_assert (gdbarch->deprecated_saved_pc_after_call != NULL);
4019 if (gdbarch_debug >= 2)
4020 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_saved_pc_after_call called\n");
4021 return gdbarch->deprecated_saved_pc_after_call (frame);
4022 }
4023
4024 void
4025 set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch,
4026 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call)
4027 {
4028 gdbarch->deprecated_saved_pc_after_call = deprecated_saved_pc_after_call;
4029 }
4030
4031 int
4032 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
4033 {
4034 gdb_assert (gdbarch != NULL);
4035 return gdbarch->frame_num_args != NULL;
4036 }
4037
4038 int
4039 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
4040 {
4041 gdb_assert (gdbarch != NULL);
4042 gdb_assert (gdbarch->frame_num_args != NULL);
4043 if (gdbarch_debug >= 2)
4044 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
4045 return gdbarch->frame_num_args (frame);
4046 }
4047
4048 void
4049 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
4050 gdbarch_frame_num_args_ftype frame_num_args)
4051 {
4052 gdbarch->frame_num_args = frame_num_args;
4053 }
4054
4055 int
4056 gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
4057 {
4058 gdb_assert (gdbarch != NULL);
4059 return gdbarch->deprecated_stack_align != NULL;
4060 }
4061
4062 CORE_ADDR
4063 gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
4064 {
4065 gdb_assert (gdbarch != NULL);
4066 gdb_assert (gdbarch->deprecated_stack_align != NULL);
4067 if (gdbarch_debug >= 2)
4068 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
4069 return gdbarch->deprecated_stack_align (sp);
4070 }
4071
4072 void
4073 set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
4074 gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
4075 {
4076 gdbarch->deprecated_stack_align = deprecated_stack_align;
4077 }
4078
4079 int
4080 gdbarch_frame_align_p (struct gdbarch *gdbarch)
4081 {
4082 gdb_assert (gdbarch != NULL);
4083 return gdbarch->frame_align != NULL;
4084 }
4085
4086 CORE_ADDR
4087 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
4088 {
4089 gdb_assert (gdbarch != NULL);
4090 gdb_assert (gdbarch->frame_align != NULL);
4091 if (gdbarch_debug >= 2)
4092 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
4093 return gdbarch->frame_align (gdbarch, address);
4094 }
4095
4096 void
4097 set_gdbarch_frame_align (struct gdbarch *gdbarch,
4098 gdbarch_frame_align_ftype frame_align)
4099 {
4100 gdbarch->frame_align = frame_align;
4101 }
4102
4103 int
4104 gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
4105 {
4106 gdb_assert (gdbarch != NULL);
4107 return gdbarch->deprecated_reg_struct_has_addr != NULL;
4108 }
4109
4110 int
4111 gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
4112 {
4113 gdb_assert (gdbarch != NULL);
4114 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
4115 if (gdbarch_debug >= 2)
4116 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
4117 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
4118 }
4119
4120 void
4121 set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
4122 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
4123 {
4124 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
4125 }
4126
4127 int
4128 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
4129 {
4130 gdb_assert (gdbarch != NULL);
4131 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
4132 if (gdbarch_debug >= 2)
4133 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
4134 return gdbarch->stabs_argument_has_addr (gdbarch, type);
4135 }
4136
4137 void
4138 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
4139 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
4140 {
4141 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
4142 }
4143
4144 int
4145 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
4146 {
4147 gdb_assert (gdbarch != NULL);
4148 if (gdbarch_debug >= 2)
4149 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
4150 return gdbarch->frame_red_zone_size;
4151 }
4152
4153 void
4154 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
4155 int frame_red_zone_size)
4156 {
4157 gdbarch->frame_red_zone_size = frame_red_zone_size;
4158 }
4159
4160 const struct floatformat *
4161 gdbarch_float_format (struct gdbarch *gdbarch)
4162 {
4163 gdb_assert (gdbarch != NULL);
4164 if (gdbarch_debug >= 2)
4165 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
4166 return gdbarch->float_format;
4167 }
4168
4169 void
4170 set_gdbarch_float_format (struct gdbarch *gdbarch,
4171 const struct floatformat * float_format)
4172 {
4173 gdbarch->float_format = float_format;
4174 }
4175
4176 const struct floatformat *
4177 gdbarch_double_format (struct gdbarch *gdbarch)
4178 {
4179 gdb_assert (gdbarch != NULL);
4180 if (gdbarch_debug >= 2)
4181 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
4182 return gdbarch->double_format;
4183 }
4184
4185 void
4186 set_gdbarch_double_format (struct gdbarch *gdbarch,
4187 const struct floatformat * double_format)
4188 {
4189 gdbarch->double_format = double_format;
4190 }
4191
4192 const struct floatformat *
4193 gdbarch_long_double_format (struct gdbarch *gdbarch)
4194 {
4195 gdb_assert (gdbarch != NULL);
4196 if (gdbarch_debug >= 2)
4197 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
4198 return gdbarch->long_double_format;
4199 }
4200
4201 void
4202 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
4203 const struct floatformat * long_double_format)
4204 {
4205 gdbarch->long_double_format = long_double_format;
4206 }
4207
4208 CORE_ADDR
4209 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
4210 {
4211 gdb_assert (gdbarch != NULL);
4212 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
4213 if (gdbarch_debug >= 2)
4214 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
4215 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
4216 }
4217
4218 void
4219 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
4220 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
4221 {
4222 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
4223 }
4224
4225 CORE_ADDR
4226 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
4227 {
4228 gdb_assert (gdbarch != NULL);
4229 gdb_assert (gdbarch->addr_bits_remove != NULL);
4230 if (gdbarch_debug >= 2)
4231 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
4232 return gdbarch->addr_bits_remove (addr);
4233 }
4234
4235 void
4236 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
4237 gdbarch_addr_bits_remove_ftype addr_bits_remove)
4238 {
4239 gdbarch->addr_bits_remove = addr_bits_remove;
4240 }
4241
4242 CORE_ADDR
4243 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
4244 {
4245 gdb_assert (gdbarch != NULL);
4246 gdb_assert (gdbarch->smash_text_address != NULL);
4247 if (gdbarch_debug >= 2)
4248 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
4249 return gdbarch->smash_text_address (addr);
4250 }
4251
4252 void
4253 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
4254 gdbarch_smash_text_address_ftype smash_text_address)
4255 {
4256 gdbarch->smash_text_address = smash_text_address;
4257 }
4258
4259 int
4260 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
4261 {
4262 gdb_assert (gdbarch != NULL);
4263 return gdbarch->software_single_step != NULL;
4264 }
4265
4266 void
4267 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
4268 {
4269 gdb_assert (gdbarch != NULL);
4270 gdb_assert (gdbarch->software_single_step != NULL);
4271 if (gdbarch_debug >= 2)
4272 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
4273 gdbarch->software_single_step (sig, insert_breakpoints_p);
4274 }
4275
4276 void
4277 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
4278 gdbarch_software_single_step_ftype software_single_step)
4279 {
4280 gdbarch->software_single_step = software_single_step;
4281 }
4282
4283 int
4284 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
4285 {
4286 gdb_assert (gdbarch != NULL);
4287 gdb_assert (gdbarch->print_insn != NULL);
4288 if (gdbarch_debug >= 2)
4289 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
4290 return gdbarch->print_insn (vma, info);
4291 }
4292
4293 void
4294 set_gdbarch_print_insn (struct gdbarch *gdbarch,
4295 gdbarch_print_insn_ftype print_insn)
4296 {
4297 gdbarch->print_insn = print_insn;
4298 }
4299
4300 CORE_ADDR
4301 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
4302 {
4303 gdb_assert (gdbarch != NULL);
4304 gdb_assert (gdbarch->skip_trampoline_code != NULL);
4305 if (gdbarch_debug >= 2)
4306 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
4307 return gdbarch->skip_trampoline_code (pc);
4308 }
4309
4310 void
4311 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
4312 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
4313 {
4314 gdbarch->skip_trampoline_code = skip_trampoline_code;
4315 }
4316
4317 CORE_ADDR
4318 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
4319 {
4320 gdb_assert (gdbarch != NULL);
4321 gdb_assert (gdbarch->skip_solib_resolver != NULL);
4322 if (gdbarch_debug >= 2)
4323 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
4324 return gdbarch->skip_solib_resolver (gdbarch, pc);
4325 }
4326
4327 void
4328 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
4329 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
4330 {
4331 gdbarch->skip_solib_resolver = skip_solib_resolver;
4332 }
4333
4334 int
4335 gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4336 {
4337 gdb_assert (gdbarch != NULL);
4338 gdb_assert (gdbarch->in_solib_call_trampoline != NULL);
4339 if (gdbarch_debug >= 2)
4340 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
4341 return gdbarch->in_solib_call_trampoline (pc, name);
4342 }
4343
4344 void
4345 set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
4346 gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
4347 {
4348 gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
4349 }
4350
4351 int
4352 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4353 {
4354 gdb_assert (gdbarch != NULL);
4355 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
4356 if (gdbarch_debug >= 2)
4357 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
4358 return gdbarch->in_solib_return_trampoline (pc, name);
4359 }
4360
4361 void
4362 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
4363 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
4364 {
4365 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
4366 }
4367
4368 int
4369 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
4370 {
4371 gdb_assert (gdbarch != NULL);
4372 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
4373 if (gdbarch_debug >= 2)
4374 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
4375 return gdbarch->in_function_epilogue_p (gdbarch, addr);
4376 }
4377
4378 void
4379 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
4380 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
4381 {
4382 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
4383 }
4384
4385 char *
4386 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
4387 {
4388 gdb_assert (gdbarch != NULL);
4389 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
4390 if (gdbarch_debug >= 2)
4391 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
4392 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
4393 }
4394
4395 void
4396 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
4397 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
4398 {
4399 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
4400 }
4401
4402 void
4403 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
4404 {
4405 gdb_assert (gdbarch != NULL);
4406 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
4407 if (gdbarch_debug >= 2)
4408 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
4409 gdbarch->elf_make_msymbol_special (sym, msym);
4410 }
4411
4412 void
4413 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
4414 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
4415 {
4416 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
4417 }
4418
4419 void
4420 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
4421 {
4422 gdb_assert (gdbarch != NULL);
4423 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
4424 if (gdbarch_debug >= 2)
4425 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
4426 gdbarch->coff_make_msymbol_special (val, msym);
4427 }
4428
4429 void
4430 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
4431 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
4432 {
4433 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
4434 }
4435
4436 const char *
4437 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
4438 {
4439 gdb_assert (gdbarch != NULL);
4440 /* Skip verify of name_of_malloc, invalid_p == 0 */
4441 if (gdbarch_debug >= 2)
4442 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
4443 return gdbarch->name_of_malloc;
4444 }
4445
4446 void
4447 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
4448 const char * name_of_malloc)
4449 {
4450 gdbarch->name_of_malloc = name_of_malloc;
4451 }
4452
4453 int
4454 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
4455 {
4456 gdb_assert (gdbarch != NULL);
4457 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
4458 if (gdbarch_debug >= 2)
4459 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
4460 return gdbarch->cannot_step_breakpoint;
4461 }
4462
4463 void
4464 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
4465 int cannot_step_breakpoint)
4466 {
4467 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
4468 }
4469
4470 int
4471 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
4472 {
4473 gdb_assert (gdbarch != NULL);
4474 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
4475 if (gdbarch_debug >= 2)
4476 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
4477 return gdbarch->have_nonsteppable_watchpoint;
4478 }
4479
4480 void
4481 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
4482 int have_nonsteppable_watchpoint)
4483 {
4484 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
4485 }
4486
4487 int
4488 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
4489 {
4490 gdb_assert (gdbarch != NULL);
4491 return gdbarch->address_class_type_flags != NULL;
4492 }
4493
4494 int
4495 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
4496 {
4497 gdb_assert (gdbarch != NULL);
4498 gdb_assert (gdbarch->address_class_type_flags != NULL);
4499 if (gdbarch_debug >= 2)
4500 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
4501 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
4502 }
4503
4504 void
4505 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
4506 gdbarch_address_class_type_flags_ftype address_class_type_flags)
4507 {
4508 gdbarch->address_class_type_flags = address_class_type_flags;
4509 }
4510
4511 int
4512 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
4513 {
4514 gdb_assert (gdbarch != NULL);
4515 return gdbarch->address_class_type_flags_to_name != NULL;
4516 }
4517
4518 const char *
4519 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
4520 {
4521 gdb_assert (gdbarch != NULL);
4522 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
4523 if (gdbarch_debug >= 2)
4524 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
4525 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
4526 }
4527
4528 void
4529 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
4530 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
4531 {
4532 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
4533 }
4534
4535 int
4536 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
4537 {
4538 gdb_assert (gdbarch != NULL);
4539 return gdbarch->address_class_name_to_type_flags != NULL;
4540 }
4541
4542 int
4543 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
4544 {
4545 gdb_assert (gdbarch != NULL);
4546 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
4547 if (gdbarch_debug >= 2)
4548 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
4549 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
4550 }
4551
4552 void
4553 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
4554 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
4555 {
4556 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
4557 }
4558
4559 int
4560 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
4561 {
4562 gdb_assert (gdbarch != NULL);
4563 gdb_assert (gdbarch->register_reggroup_p != NULL);
4564 if (gdbarch_debug >= 2)
4565 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
4566 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
4567 }
4568
4569 void
4570 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
4571 gdbarch_register_reggroup_p_ftype register_reggroup_p)
4572 {
4573 gdbarch->register_reggroup_p = register_reggroup_p;
4574 }
4575
4576 int
4577 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
4578 {
4579 gdb_assert (gdbarch != NULL);
4580 return gdbarch->fetch_pointer_argument != NULL;
4581 }
4582
4583 CORE_ADDR
4584 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
4585 {
4586 gdb_assert (gdbarch != NULL);
4587 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
4588 if (gdbarch_debug >= 2)
4589 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
4590 return gdbarch->fetch_pointer_argument (frame, argi, type);
4591 }
4592
4593 void
4594 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
4595 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
4596 {
4597 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
4598 }
4599
4600 int
4601 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
4602 {
4603 gdb_assert (gdbarch != NULL);
4604 return gdbarch->regset_from_core_section != NULL;
4605 }
4606
4607 const struct regset *
4608 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
4609 {
4610 gdb_assert (gdbarch != NULL);
4611 gdb_assert (gdbarch->regset_from_core_section != NULL);
4612 if (gdbarch_debug >= 2)
4613 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
4614 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
4615 }
4616
4617 void
4618 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
4619 gdbarch_regset_from_core_section_ftype regset_from_core_section)
4620 {
4621 gdbarch->regset_from_core_section = regset_from_core_section;
4622 }
4623
4624
4625 /* Keep a registry of per-architecture data-pointers required by GDB
4626 modules. */
4627
4628 struct gdbarch_data
4629 {
4630 unsigned index;
4631 int init_p;
4632 gdbarch_data_pre_init_ftype *pre_init;
4633 gdbarch_data_post_init_ftype *post_init;
4634 };
4635
4636 struct gdbarch_data_registration
4637 {
4638 struct gdbarch_data *data;
4639 struct gdbarch_data_registration *next;
4640 };
4641
4642 struct gdbarch_data_registry
4643 {
4644 unsigned nr;
4645 struct gdbarch_data_registration *registrations;
4646 };
4647
4648 struct gdbarch_data_registry gdbarch_data_registry =
4649 {
4650 0, NULL,
4651 };
4652
4653 static struct gdbarch_data *
4654 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
4655 gdbarch_data_post_init_ftype *post_init)
4656 {
4657 struct gdbarch_data_registration **curr;
4658 /* Append the new registraration. */
4659 for (curr = &gdbarch_data_registry.registrations;
4660 (*curr) != NULL;
4661 curr = &(*curr)->next);
4662 (*curr) = XMALLOC (struct gdbarch_data_registration);
4663 (*curr)->next = NULL;
4664 (*curr)->data = XMALLOC (struct gdbarch_data);
4665 (*curr)->data->index = gdbarch_data_registry.nr++;
4666 (*curr)->data->pre_init = pre_init;
4667 (*curr)->data->post_init = post_init;
4668 (*curr)->data->init_p = 1;
4669 return (*curr)->data;
4670 }
4671
4672 struct gdbarch_data *
4673 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
4674 {
4675 return gdbarch_data_register (pre_init, NULL);
4676 }
4677
4678 struct gdbarch_data *
4679 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
4680 {
4681 return gdbarch_data_register (NULL, post_init);
4682 }
4683
4684 /* Create/delete the gdbarch data vector. */
4685
4686 static void
4687 alloc_gdbarch_data (struct gdbarch *gdbarch)
4688 {
4689 gdb_assert (gdbarch->data == NULL);
4690 gdbarch->nr_data = gdbarch_data_registry.nr;
4691 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
4692 }
4693
4694 /* Initialize the current value of the specified per-architecture
4695 data-pointer. */
4696
4697 void
4698 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
4699 struct gdbarch_data *data,
4700 void *pointer)
4701 {
4702 gdb_assert (data->index < gdbarch->nr_data);
4703 gdb_assert (gdbarch->data[data->index] == NULL);
4704 gdb_assert (data->pre_init == NULL);
4705 gdbarch->data[data->index] = pointer;
4706 }
4707
4708 /* Return the current value of the specified per-architecture
4709 data-pointer. */
4710
4711 void *
4712 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
4713 {
4714 gdb_assert (data->index < gdbarch->nr_data);
4715 if (gdbarch->data[data->index] == NULL)
4716 {
4717 /* The data-pointer isn't initialized, call init() to get a
4718 value. */
4719 if (data->pre_init != NULL)
4720 /* Mid architecture creation: pass just the obstack, and not
4721 the entire architecture, as that way it isn't possible for
4722 pre-init code to refer to undefined architecture
4723 fields. */
4724 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
4725 else if (gdbarch->initialized_p
4726 && data->post_init != NULL)
4727 /* Post architecture creation: pass the entire architecture
4728 (as all fields are valid), but be careful to also detect
4729 recursive references. */
4730 {
4731 gdb_assert (data->init_p);
4732 data->init_p = 0;
4733 gdbarch->data[data->index] = data->post_init (gdbarch);
4734 data->init_p = 1;
4735 }
4736 else
4737 /* The architecture initialization hasn't completed - punt -
4738 hope that the caller knows what they are doing. Once
4739 deprecated_set_gdbarch_data has been initialized, this can be
4740 changed to an internal error. */
4741 return NULL;
4742 gdb_assert (gdbarch->data[data->index] != NULL);
4743 }
4744 return gdbarch->data[data->index];
4745 }
4746
4747
4748
4749 /* Keep a registry of swapped data required by GDB modules. */
4750
4751 struct gdbarch_swap
4752 {
4753 void *swap;
4754 struct gdbarch_swap_registration *source;
4755 struct gdbarch_swap *next;
4756 };
4757
4758 struct gdbarch_swap_registration
4759 {
4760 void *data;
4761 unsigned long sizeof_data;
4762 gdbarch_swap_ftype *init;
4763 struct gdbarch_swap_registration *next;
4764 };
4765
4766 struct gdbarch_swap_registry
4767 {
4768 int nr;
4769 struct gdbarch_swap_registration *registrations;
4770 };
4771
4772 struct gdbarch_swap_registry gdbarch_swap_registry =
4773 {
4774 0, NULL,
4775 };
4776
4777 void
4778 deprecated_register_gdbarch_swap (void *data,
4779 unsigned long sizeof_data,
4780 gdbarch_swap_ftype *init)
4781 {
4782 struct gdbarch_swap_registration **rego;
4783 for (rego = &gdbarch_swap_registry.registrations;
4784 (*rego) != NULL;
4785 rego = &(*rego)->next);
4786 (*rego) = XMALLOC (struct gdbarch_swap_registration);
4787 (*rego)->next = NULL;
4788 (*rego)->init = init;
4789 (*rego)->data = data;
4790 (*rego)->sizeof_data = sizeof_data;
4791 }
4792
4793 static void
4794 current_gdbarch_swap_init_hack (void)
4795 {
4796 struct gdbarch_swap_registration *rego;
4797 struct gdbarch_swap **curr = &current_gdbarch->swap;
4798 for (rego = gdbarch_swap_registry.registrations;
4799 rego != NULL;
4800 rego = rego->next)
4801 {
4802 if (rego->data != NULL)
4803 {
4804 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
4805 struct gdbarch_swap);
4806 (*curr)->source = rego;
4807 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
4808 rego->sizeof_data);
4809 (*curr)->next = NULL;
4810 curr = &(*curr)->next;
4811 }
4812 if (rego->init != NULL)
4813 rego->init ();
4814 }
4815 }
4816
4817 static struct gdbarch *
4818 current_gdbarch_swap_out_hack (void)
4819 {
4820 struct gdbarch *old_gdbarch = current_gdbarch;
4821 struct gdbarch_swap *curr;
4822
4823 gdb_assert (old_gdbarch != NULL);
4824 for (curr = old_gdbarch->swap;
4825 curr != NULL;
4826 curr = curr->next)
4827 {
4828 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
4829 memset (curr->source->data, 0, curr->source->sizeof_data);
4830 }
4831 current_gdbarch = NULL;
4832 return old_gdbarch;
4833 }
4834
4835 static void
4836 current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
4837 {
4838 struct gdbarch_swap *curr;
4839
4840 gdb_assert (current_gdbarch == NULL);
4841 for (curr = new_gdbarch->swap;
4842 curr != NULL;
4843 curr = curr->next)
4844 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
4845 current_gdbarch = new_gdbarch;
4846 }
4847
4848
4849 /* Keep a registry of the architectures known by GDB. */
4850
4851 struct gdbarch_registration
4852 {
4853 enum bfd_architecture bfd_architecture;
4854 gdbarch_init_ftype *init;
4855 gdbarch_dump_tdep_ftype *dump_tdep;
4856 struct gdbarch_list *arches;
4857 struct gdbarch_registration *next;
4858 };
4859
4860 static struct gdbarch_registration *gdbarch_registry = NULL;
4861
4862 static void
4863 append_name (const char ***buf, int *nr, const char *name)
4864 {
4865 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4866 (*buf)[*nr] = name;
4867 *nr += 1;
4868 }
4869
4870 const char **
4871 gdbarch_printable_names (void)
4872 {
4873 /* Accumulate a list of names based on the registed list of
4874 architectures. */
4875 enum bfd_architecture a;
4876 int nr_arches = 0;
4877 const char **arches = NULL;
4878 struct gdbarch_registration *rego;
4879 for (rego = gdbarch_registry;
4880 rego != NULL;
4881 rego = rego->next)
4882 {
4883 const struct bfd_arch_info *ap;
4884 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4885 if (ap == NULL)
4886 internal_error (__FILE__, __LINE__,
4887 "gdbarch_architecture_names: multi-arch unknown");
4888 do
4889 {
4890 append_name (&arches, &nr_arches, ap->printable_name);
4891 ap = ap->next;
4892 }
4893 while (ap != NULL);
4894 }
4895 append_name (&arches, &nr_arches, NULL);
4896 return arches;
4897 }
4898
4899
4900 void
4901 gdbarch_register (enum bfd_architecture bfd_architecture,
4902 gdbarch_init_ftype *init,
4903 gdbarch_dump_tdep_ftype *dump_tdep)
4904 {
4905 struct gdbarch_registration **curr;
4906 const struct bfd_arch_info *bfd_arch_info;
4907 /* Check that BFD recognizes this architecture */
4908 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4909 if (bfd_arch_info == NULL)
4910 {
4911 internal_error (__FILE__, __LINE__,
4912 "gdbarch: Attempt to register unknown architecture (%d)",
4913 bfd_architecture);
4914 }
4915 /* Check that we haven't seen this architecture before */
4916 for (curr = &gdbarch_registry;
4917 (*curr) != NULL;
4918 curr = &(*curr)->next)
4919 {
4920 if (bfd_architecture == (*curr)->bfd_architecture)
4921 internal_error (__FILE__, __LINE__,
4922 "gdbarch: Duplicate registraration of architecture (%s)",
4923 bfd_arch_info->printable_name);
4924 }
4925 /* log it */
4926 if (gdbarch_debug)
4927 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
4928 bfd_arch_info->printable_name,
4929 (long) init);
4930 /* Append it */
4931 (*curr) = XMALLOC (struct gdbarch_registration);
4932 (*curr)->bfd_architecture = bfd_architecture;
4933 (*curr)->init = init;
4934 (*curr)->dump_tdep = dump_tdep;
4935 (*curr)->arches = NULL;
4936 (*curr)->next = NULL;
4937 }
4938
4939 void
4940 register_gdbarch_init (enum bfd_architecture bfd_architecture,
4941 gdbarch_init_ftype *init)
4942 {
4943 gdbarch_register (bfd_architecture, init, NULL);
4944 }
4945
4946
4947 /* Look for an architecture using gdbarch_info. Base search on only
4948 BFD_ARCH_INFO and BYTE_ORDER. */
4949
4950 struct gdbarch_list *
4951 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4952 const struct gdbarch_info *info)
4953 {
4954 for (; arches != NULL; arches = arches->next)
4955 {
4956 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4957 continue;
4958 if (info->byte_order != arches->gdbarch->byte_order)
4959 continue;
4960 if (info->osabi != arches->gdbarch->osabi)
4961 continue;
4962 return arches;
4963 }
4964 return NULL;
4965 }
4966
4967
4968 /* Find an architecture that matches the specified INFO. Create a new
4969 architecture if needed. Return that new architecture. Assumes
4970 that there is no current architecture. */
4971
4972 static struct gdbarch *
4973 find_arch_by_info (struct gdbarch *old_gdbarch, struct gdbarch_info info)
4974 {
4975 struct gdbarch *new_gdbarch;
4976 struct gdbarch_registration *rego;
4977
4978 /* The existing architecture has been swapped out - all this code
4979 works from a clean slate. */
4980 gdb_assert (current_gdbarch == NULL);
4981
4982 /* Fill in missing parts of the INFO struct using a number of
4983 sources: "set ..."; INFOabfd supplied; and the existing
4984 architecture. */
4985 gdbarch_info_fill (old_gdbarch, &info);
4986
4987 /* Must have found some sort of architecture. */
4988 gdb_assert (info.bfd_arch_info != NULL);
4989
4990 if (gdbarch_debug)
4991 {
4992 fprintf_unfiltered (gdb_stdlog,
4993 "find_arch_by_info: info.bfd_arch_info %s\n",
4994 (info.bfd_arch_info != NULL
4995 ? info.bfd_arch_info->printable_name
4996 : "(null)"));
4997 fprintf_unfiltered (gdb_stdlog,
4998 "find_arch_by_info: info.byte_order %d (%s)\n",
4999 info.byte_order,
5000 (info.byte_order == BFD_ENDIAN_BIG ? "big"
5001 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
5002 : "default"));
5003 fprintf_unfiltered (gdb_stdlog,
5004 "find_arch_by_info: info.osabi %d (%s)\n",
5005 info.osabi, gdbarch_osabi_name (info.osabi));
5006 fprintf_unfiltered (gdb_stdlog,
5007 "find_arch_by_info: info.abfd 0x%lx\n",
5008 (long) info.abfd);
5009 fprintf_unfiltered (gdb_stdlog,
5010 "find_arch_by_info: info.tdep_info 0x%lx\n",
5011 (long) info.tdep_info);
5012 }
5013
5014 /* Find the tdep code that knows about this architecture. */
5015 for (rego = gdbarch_registry;
5016 rego != NULL;
5017 rego = rego->next)
5018 if (rego->bfd_architecture == info.bfd_arch_info->arch)
5019 break;
5020 if (rego == NULL)
5021 {
5022 if (gdbarch_debug)
5023 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
5024 "No matching architecture\n");
5025 return 0;
5026 }
5027
5028 /* Ask the tdep code for an architecture that matches "info". */
5029 new_gdbarch = rego->init (info, rego->arches);
5030
5031 /* Did the tdep code like it? No. Reject the change and revert to
5032 the old architecture. */
5033 if (new_gdbarch == NULL)
5034 {
5035 if (gdbarch_debug)
5036 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
5037 "Target rejected architecture\n");
5038 return NULL;
5039 }
5040
5041 /* Is this a pre-existing architecture (as determined by already
5042 being initialized)? Move it to the front of the architecture
5043 list (keeping the list sorted Most Recently Used). */
5044 if (new_gdbarch->initialized_p)
5045 {
5046 struct gdbarch_list **list;
5047 struct gdbarch_list *this;
5048 if (gdbarch_debug)
5049 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
5050 "Previous architecture 0x%08lx (%s) selected\n",
5051 (long) new_gdbarch,
5052 new_gdbarch->bfd_arch_info->printable_name);
5053 /* Find the existing arch in the list. */
5054 for (list = &rego->arches;
5055 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
5056 list = &(*list)->next);
5057 /* It had better be in the list of architectures. */
5058 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
5059 /* Unlink THIS. */
5060 this = (*list);
5061 (*list) = this->next;
5062 /* Insert THIS at the front. */
5063 this->next = rego->arches;
5064 rego->arches = this;
5065 /* Return it. */
5066 return new_gdbarch;
5067 }
5068
5069 /* It's a new architecture. */
5070 if (gdbarch_debug)
5071 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
5072 "New architecture 0x%08lx (%s) selected\n",
5073 (long) new_gdbarch,
5074 new_gdbarch->bfd_arch_info->printable_name);
5075
5076 /* Insert the new architecture into the front of the architecture
5077 list (keep the list sorted Most Recently Used). */
5078 {
5079 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
5080 this->next = rego->arches;
5081 this->gdbarch = new_gdbarch;
5082 rego->arches = this;
5083 }
5084
5085 /* Check that the newly installed architecture is valid. Plug in
5086 any post init values. */
5087 new_gdbarch->dump_tdep = rego->dump_tdep;
5088 verify_gdbarch (new_gdbarch);
5089 new_gdbarch->initialized_p = 1;
5090
5091 /* Initialize any per-architecture swap areas. This phase requires
5092 a valid global CURRENT_GDBARCH. Set it momentarially, and then
5093 swap the entire architecture out. */
5094 current_gdbarch = new_gdbarch;
5095 current_gdbarch_swap_init_hack ();
5096 current_gdbarch_swap_out_hack ();
5097
5098 if (gdbarch_debug)
5099 gdbarch_dump (new_gdbarch, gdb_stdlog);
5100
5101 return new_gdbarch;
5102 }
5103
5104 struct gdbarch *
5105 gdbarch_find_by_info (struct gdbarch_info info)
5106 {
5107 /* Save the previously selected architecture, setting the global to
5108 NULL. This stops things like gdbarch->init() trying to use the
5109 previous architecture's configuration. The previous architecture
5110 may not even be of the same architecture family. The most recent
5111 architecture of the same family is found at the head of the
5112 rego->arches list. */
5113 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
5114
5115 /* Find the specified architecture. */
5116 struct gdbarch *new_gdbarch = find_arch_by_info (old_gdbarch, info);
5117
5118 /* Restore the existing architecture. */
5119 gdb_assert (current_gdbarch == NULL);
5120 current_gdbarch_swap_in_hack (old_gdbarch);
5121
5122 return new_gdbarch;
5123 }
5124
5125 /* Make the specified architecture current, swapping the existing one
5126 out. */
5127
5128 void
5129 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
5130 {
5131 gdb_assert (new_gdbarch != NULL);
5132 gdb_assert (current_gdbarch != NULL);
5133 gdb_assert (new_gdbarch->initialized_p);
5134 current_gdbarch_swap_out_hack ();
5135 current_gdbarch_swap_in_hack (new_gdbarch);
5136 architecture_changed_event ();
5137 }
5138
5139 extern void _initialize_gdbarch (void);
5140
5141 void
5142 _initialize_gdbarch (void)
5143 {
5144 struct cmd_list_element *c;
5145
5146 add_show_from_set (add_set_cmd ("arch",
5147 class_maintenance,
5148 var_zinteger,
5149 (char *)&gdbarch_debug,
5150 "Set architecture debugging.\n\
5151 When non-zero, architecture debugging is enabled.", &setdebuglist),
5152 &showdebuglist);
5153 c = add_set_cmd ("archdebug",
5154 class_maintenance,
5155 var_zinteger,
5156 (char *)&gdbarch_debug,
5157 "Set architecture debugging.\n\
5158 When non-zero, architecture debugging is enabled.", &setlist);
5159
5160 deprecate_cmd (c, "set debug arch");
5161 deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
5162 }
This page took 0.200312 seconds and 4 git commands to generate.