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