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