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