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