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