rebuild with patched automake
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
CommitLineData
adf40b2e
JM
1/* *INDENT-OFF* */ /* typedef (f)();'' confuses indent */
2/* Dynamic architecture support for GDB, the GNU debugger.
b83266a0 3 Copyright 1998-1999, Free Software Foundation, Inc.
c906108c 4
adf40b2e 5This file is part of GDB.
c906108c 6
adf40b2e
JM
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
c906108c 11
adf40b2e
JM
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
c906108c 20
c906108c
SS
21
22#include "defs.h"
c906108c 23
0f71a2f6
JM
24#if GDB_MULTI_ARCH
25#include "gdbcmd.h"
adf40b2e 26#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
0f71a2f6 27#else
7a292a7a
SS
28/* Just include everything in sight so that the every old definition
29 of macro is visible. */
30#include "gdb_string.h"
31#include <ctype.h>
32#include "symtab.h"
33#include "frame.h"
34#include "inferior.h"
35#include "breakpoint.h"
36#include "wait.h"
37#include "gdbcore.h"
38#include "gdbcmd.h"
39#include "target.h"
40#include "gdbthread.h"
41#include "annotate.h"
42#include "symfile.h" /* for overlay functions */
0f71a2f6 43#endif
7a292a7a 44#include "symcat.h"
c906108c
SS
45
46
0f71a2f6
JM
47/* Convenience macro for allocting typesafe memory. */
48
49#ifndef XMALLOC
50#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
51#endif
52
53
54/* Non-zero if we want to trace architecture code. */
55
56#ifndef GDBARCH_DEBUG
57#define GDBARCH_DEBUG 0
58#endif
59int gdbarch_debug = GDBARCH_DEBUG;
60
61
62/* Maintain the struct gdbarch object */
63
64struct gdbarch
adf40b2e
JM
65{
66 /* basic architectural information */
67 const struct bfd_arch_info * bfd_arch_info;
68 int byte_order;
0f71a2f6 69
adf40b2e
JM
70 /* target specific vector. */
71 struct gdbarch_tdep *tdep;
0f71a2f6 72
adf40b2e
JM
73 /* per-architecture data-pointers */
74 int nr_data;
75 void **data;
0f71a2f6 76
adf40b2e
JM
77 /* per-architecture swap-regions */
78 struct gdbarch_swap *swap;
0f71a2f6 79
adf40b2e 80 /* Multi-arch values.
0f71a2f6 81
adf40b2e 82 When extending this structure you must:
0f71a2f6 83
adf40b2e 84 Add the field below.
0f71a2f6 85
adf40b2e
JM
86 Declare set/get functions and define the corresponding
87 macro in gdbarch.h.
0f71a2f6 88
adf40b2e
JM
89 gdbarch_alloc(): If zero/NULL is not a suitable default,
90 initialize the new field.
0f71a2f6 91
adf40b2e
JM
92 verify_gdbarch(): Confirm that the target updated the field
93 correctly.
0f71a2f6 94
adf40b2e
JM
95 gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
96 field is dumped out
0f71a2f6 97
adf40b2e
JM
98 ``default_gdbarch()'': Append an initial value to the static
99 variable (base values on the host's c-type system).
0f71a2f6 100
adf40b2e
JM
101 get_gdbarch(): Implement the set/get functions (probably using
102 the macro's as shortcuts).
0f71a2f6
JM
103
104 */
105
adf40b2e
JM
106 int ptr_bit;
107 int short_bit;
108 int int_bit;
109 int long_bit;
110 int long_long_bit;
111 int float_bit;
112 int double_bit;
113 int long_double_bit;
114 gdbarch_read_pc_ftype *read_pc;
115 gdbarch_write_pc_ftype *write_pc;
116 gdbarch_read_fp_ftype *read_fp;
117 gdbarch_write_fp_ftype *write_fp;
118 gdbarch_read_sp_ftype *read_sp;
119 gdbarch_write_sp_ftype *write_sp;
120 int num_regs;
121 int sp_regnum;
122 int fp_regnum;
123 int pc_regnum;
124 gdbarch_register_name_ftype *register_name;
125 int register_size;
126 int register_bytes;
127 gdbarch_register_byte_ftype *register_byte;
128 gdbarch_register_raw_size_ftype *register_raw_size;
129 int max_register_raw_size;
130 gdbarch_register_virtual_size_ftype *register_virtual_size;
131 int max_register_virtual_size;
132 gdbarch_register_virtual_type_ftype *register_virtual_type;
133 int use_generic_dummy_frames;
134 int call_dummy_location;
135 gdbarch_call_dummy_address_ftype *call_dummy_address;
136 CORE_ADDR call_dummy_start_offset;
137 CORE_ADDR call_dummy_breakpoint_offset;
138 int call_dummy_breakpoint_offset_p;
139 int call_dummy_length;
140 gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
141 int call_dummy_p;
142 LONGEST * call_dummy_words;
143 int sizeof_call_dummy_words;
144 int call_dummy_stack_adjust_p;
145 int call_dummy_stack_adjust;
146 gdbarch_fix_call_dummy_ftype *fix_call_dummy;
147 int believe_pcc_promotion;
148 int believe_pcc_promotion_type;
149 gdbarch_get_saved_register_ftype *get_saved_register;
150 gdbarch_register_convertible_ftype *register_convertible;
151 gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
152 gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
153 gdbarch_extract_return_value_ftype *extract_return_value;
154 gdbarch_push_arguments_ftype *push_arguments;
155 gdbarch_push_dummy_frame_ftype *push_dummy_frame;
156 gdbarch_push_return_address_ftype *push_return_address;
157 gdbarch_pop_frame_ftype *pop_frame;
158 gdbarch_d10v_make_daddr_ftype *d10v_make_daddr;
159 gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr;
160 gdbarch_d10v_daddr_p_ftype *d10v_daddr_p;
161 gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p;
162 gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw;
163 gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw;
164 gdbarch_store_struct_return_ftype *store_struct_return;
165 gdbarch_store_return_value_ftype *store_return_value;
166 gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
167 gdbarch_use_struct_convention_ftype *use_struct_convention;
168 gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
169 gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
170 gdbarch_skip_prologue_ftype *skip_prologue;
171 gdbarch_inner_than_ftype *inner_than;
172 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
173 CORE_ADDR decr_pc_after_break;
174 CORE_ADDR function_start_offset;
175 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
176 CORE_ADDR frame_args_skip;
177 gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
178 gdbarch_frame_chain_ftype *frame_chain;
179 gdbarch_frame_chain_valid_ftype *frame_chain_valid;
180 gdbarch_frame_saved_pc_ftype *frame_saved_pc;
181 gdbarch_frame_args_address_ftype *frame_args_address;
182 gdbarch_frame_locals_address_ftype *frame_locals_address;
183 gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
184 gdbarch_frame_num_args_ftype *frame_num_args;
185};
0f71a2f6
JM
186
187
188/* The default architecture uses host values (for want of a better
189 choice). */
190
191extern const struct bfd_arch_info bfd_default_arch_struct;
192
adf40b2e 193struct gdbarch default_gdbarch = {
0f71a2f6
JM
194 /* basic architecture information */
195 &bfd_default_arch_struct,
196 BIG_ENDIAN,
197 /* target specific vector */
198 NULL,
199 /*per-architecture data-pointers and swap regions */
200 0, NULL, NULL,
201 /* Multi-arch values */
adf40b2e 202 8 * sizeof (void*),
0f71a2f6
JM
203 8 * sizeof (short),
204 8 * sizeof (int),
205 8 * sizeof (long),
206 8 * sizeof (LONGEST),
207 8 * sizeof (float),
208 8 * sizeof (double),
209 8 * sizeof (long double),
210 0,
211 0,
212 0,
213 0,
214 0,
215 0,
216 0,
217 0,
218 0,
219 0,
220 0,
221 0,
222 0,
223 0,
224 0,
225 0,
226 0,
227 0,
228 0,
229 0,
230 0,
231 0,
232 0,
233 0,
234 0,
235 0,
236 0,
237 0,
238 0,
239 0,
240 0,
241 0,
242 0,
243 0,
244 0,
245 generic_get_saved_register,
246 0,
247 0,
248 0,
249 0,
250 0,
251 0,
252 0,
253 0,
254 0,
255 0,
256 0,
257 0,
258 0,
259 0,
260 0,
261 0,
262 0,
263 0,
264 0,
265 0,
266 0,
267 0,
268 0,
269 0,
270 0,
271 0,
272 0,
273 0,
274 0,
275 0,
276 0,
277 0,
278 0,
279 0,
280 0,
281 /* default_gdbarch() */
282};
283struct gdbarch *current_gdbarch = &default_gdbarch;
284
285
286/* Create a new ``struct gdbarch'' based in information provided by
287 ``struct gdbarch_info''. */
288
289struct gdbarch *
290gdbarch_alloc (info, tdep)
291 const struct gdbarch_info *info;
292 struct gdbarch_tdep *tdep;
293{
294 struct gdbarch *gdbarch = XMALLOC (struct gdbarch);
295 memset (gdbarch, 0, sizeof (*gdbarch));
296
297 gdbarch->tdep = tdep;
298
299 gdbarch->bfd_arch_info = info->bfd_arch_info;
300 gdbarch->byte_order = info->byte_order;
301
302 /* Force the explicit initialization of these. */
303 gdbarch->num_regs = -1;
304 gdbarch->sp_regnum = -1;
305 gdbarch->fp_regnum = -1;
306 gdbarch->pc_regnum = -1;
307 gdbarch->register_size = -1;
308 gdbarch->register_bytes = -1;
309 gdbarch->max_register_raw_size = -1;
310 gdbarch->max_register_virtual_size = -1;
311 gdbarch->use_generic_dummy_frames = -1;
312 gdbarch->call_dummy_start_offset = -1;
313 gdbarch->call_dummy_breakpoint_offset = -1;
314 gdbarch->call_dummy_breakpoint_offset_p = -1;
315 gdbarch->call_dummy_length = -1;
316 gdbarch->call_dummy_p = -1;
317 gdbarch->call_dummy_stack_adjust_p = -1;
318 gdbarch->decr_pc_after_break = -1;
319 gdbarch->function_start_offset = -1;
320 gdbarch->frame_args_skip = -1;
321 /* gdbarch_alloc() */
322
323 return gdbarch;
324}
325
326
327/* Ensure that all values in a GDBARCH are reasonable. */
328
adf40b2e 329static void verify_gdbarch PARAMS ((struct gdbarch *gdbarch));
0f71a2f6
JM
330static void
331verify_gdbarch (gdbarch)
332 struct gdbarch *gdbarch;
333{
334 /* Only perform sanity checks on a multi-arch target. */
335 if (GDB_MULTI_ARCH <= 0)
336 return;
337 /* fundamental */
338 if (gdbarch->byte_order == 0)
339 fatal ("verify_gdbarch: byte-order unset");
340 if (gdbarch->bfd_arch_info == NULL)
341 fatal ("verify_gdbarch: bfd_arch_info unset");
342 /* Check those that need to be defined for the given multi-arch level. */
343 if ((GDB_MULTI_ARCH >= 1)
344 && (gdbarch->ptr_bit == 0))
345 fatal ("gdbarch: verify_gdbarch: ptr_bit invalid");
346 if ((GDB_MULTI_ARCH >= 1)
347 && (gdbarch->short_bit == 0))
348 fatal ("gdbarch: verify_gdbarch: short_bit invalid");
349 if ((GDB_MULTI_ARCH >= 1)
350 && (gdbarch->int_bit == 0))
351 fatal ("gdbarch: verify_gdbarch: int_bit invalid");
352 if ((GDB_MULTI_ARCH >= 1)
353 && (gdbarch->long_bit == 0))
354 fatal ("gdbarch: verify_gdbarch: long_bit invalid");
355 if ((GDB_MULTI_ARCH >= 1)
356 && (gdbarch->long_long_bit == 0))
357 fatal ("gdbarch: verify_gdbarch: long_long_bit invalid");
358 if ((GDB_MULTI_ARCH >= 1)
359 && (gdbarch->float_bit == 0))
360 fatal ("gdbarch: verify_gdbarch: float_bit invalid");
361 if ((GDB_MULTI_ARCH >= 1)
362 && (gdbarch->double_bit == 0))
363 fatal ("gdbarch: verify_gdbarch: double_bit invalid");
364 if ((GDB_MULTI_ARCH >= 1)
365 && (gdbarch->long_double_bit == 0))
366 fatal ("gdbarch: verify_gdbarch: long_double_bit invalid");
367 if ((GDB_MULTI_ARCH >= 1)
368 && (gdbarch->read_pc == 0))
369 fatal ("gdbarch: verify_gdbarch: read_pc invalid");
370 if ((GDB_MULTI_ARCH >= 1)
371 && (gdbarch->write_pc == 0))
372 fatal ("gdbarch: verify_gdbarch: write_pc invalid");
373 if ((GDB_MULTI_ARCH >= 1)
374 && (gdbarch->read_fp == 0))
375 fatal ("gdbarch: verify_gdbarch: read_fp invalid");
376 if ((GDB_MULTI_ARCH >= 1)
377 && (gdbarch->write_fp == 0))
378 fatal ("gdbarch: verify_gdbarch: write_fp invalid");
379 if ((GDB_MULTI_ARCH >= 1)
380 && (gdbarch->read_sp == 0))
381 fatal ("gdbarch: verify_gdbarch: read_sp invalid");
382 if ((GDB_MULTI_ARCH >= 1)
383 && (gdbarch->write_sp == 0))
384 fatal ("gdbarch: verify_gdbarch: write_sp invalid");
385 if ((GDB_MULTI_ARCH >= 2)
386 && (gdbarch->num_regs == -1))
387 fatal ("gdbarch: verify_gdbarch: num_regs invalid");
388 if ((GDB_MULTI_ARCH >= 2)
389 && (gdbarch->sp_regnum == -1))
390 fatal ("gdbarch: verify_gdbarch: sp_regnum invalid");
391 if ((GDB_MULTI_ARCH >= 2)
392 && (gdbarch->fp_regnum == -1))
393 fatal ("gdbarch: verify_gdbarch: fp_regnum invalid");
394 if ((GDB_MULTI_ARCH >= 2)
395 && (gdbarch->pc_regnum == -1))
396 fatal ("gdbarch: verify_gdbarch: pc_regnum invalid");
397 if ((GDB_MULTI_ARCH >= 2)
398 && (gdbarch->register_name == 0))
399 fatal ("gdbarch: verify_gdbarch: register_name invalid");
400 if ((GDB_MULTI_ARCH >= 2)
401 && (gdbarch->register_size == -1))
402 fatal ("gdbarch: verify_gdbarch: register_size invalid");
403 if ((GDB_MULTI_ARCH >= 2)
404 && (gdbarch->register_bytes == -1))
405 fatal ("gdbarch: verify_gdbarch: register_bytes invalid");
406 if ((GDB_MULTI_ARCH >= 2)
407 && (gdbarch->register_byte == 0))
408 fatal ("gdbarch: verify_gdbarch: register_byte invalid");
409 if ((GDB_MULTI_ARCH >= 2)
410 && (gdbarch->register_raw_size == 0))
411 fatal ("gdbarch: verify_gdbarch: register_raw_size invalid");
412 if ((GDB_MULTI_ARCH >= 2)
413 && (gdbarch->max_register_raw_size == -1))
414 fatal ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
415 if ((GDB_MULTI_ARCH >= 2)
416 && (gdbarch->register_virtual_size == 0))
417 fatal ("gdbarch: verify_gdbarch: register_virtual_size invalid");
418 if ((GDB_MULTI_ARCH >= 2)
419 && (gdbarch->max_register_virtual_size == -1))
420 fatal ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
421 if ((GDB_MULTI_ARCH >= 2)
422 && (gdbarch->register_virtual_type == 0))
423 fatal ("gdbarch: verify_gdbarch: register_virtual_type invalid");
424 if ((GDB_MULTI_ARCH >= 1)
425 && (gdbarch->use_generic_dummy_frames == -1))
426 fatal ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
427 if ((GDB_MULTI_ARCH >= 2)
428 && (gdbarch->call_dummy_location == 0))
429 fatal ("gdbarch: verify_gdbarch: call_dummy_location invalid");
430 if ((GDB_MULTI_ARCH >= 2)
431 && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
432 fatal ("gdbarch: verify_gdbarch: call_dummy_address invalid");
433 if ((GDB_MULTI_ARCH >= 2)
434 && (gdbarch->call_dummy_start_offset == -1))
435 fatal ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
436 if ((GDB_MULTI_ARCH >= 2)
437 && (gdbarch->call_dummy_breakpoint_offset == -1))
438 fatal ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
439 if ((GDB_MULTI_ARCH >= 1)
440 && (gdbarch->call_dummy_breakpoint_offset_p == -1))
441 fatal ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
442 if ((GDB_MULTI_ARCH >= 2)
443 && (gdbarch->call_dummy_length == -1))
444 fatal ("gdbarch: verify_gdbarch: call_dummy_length invalid");
445 if ((GDB_MULTI_ARCH >= 2)
446 && (gdbarch->pc_in_call_dummy == 0))
447 fatal ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
448 if ((GDB_MULTI_ARCH >= 1)
449 && (gdbarch->call_dummy_p == -1))
450 fatal ("gdbarch: verify_gdbarch: call_dummy_p invalid");
451 if ((GDB_MULTI_ARCH >= 1)
452 && (gdbarch->call_dummy_stack_adjust_p == -1))
453 fatal ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
454 if ((GDB_MULTI_ARCH >= 2)
455 && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
456 fatal ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
457 if ((GDB_MULTI_ARCH >= 2)
458 && (gdbarch->fix_call_dummy == 0))
459 fatal ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
460 if ((GDB_MULTI_ARCH >= 1)
461 && (gdbarch->get_saved_register == 0))
462 fatal ("gdbarch: verify_gdbarch: get_saved_register invalid");
463 if ((GDB_MULTI_ARCH >= 1)
464 && (gdbarch->register_convertible == 0))
465 fatal ("gdbarch: verify_gdbarch: register_convertible invalid");
466 if ((GDB_MULTI_ARCH >= 2)
467 && (gdbarch->register_convert_to_virtual == 0))
468 fatal ("gdbarch: verify_gdbarch: register_convert_to_virtual invalid");
469 if ((GDB_MULTI_ARCH >= 2)
470 && (gdbarch->register_convert_to_raw == 0))
471 fatal ("gdbarch: verify_gdbarch: register_convert_to_raw invalid");
472 if ((GDB_MULTI_ARCH >= 2)
473 && (gdbarch->extract_return_value == 0))
474 fatal ("gdbarch: verify_gdbarch: extract_return_value invalid");
475 if ((GDB_MULTI_ARCH >= 1)
476 && (gdbarch->push_arguments == 0))
477 fatal ("gdbarch: verify_gdbarch: push_arguments invalid");
478 if ((GDB_MULTI_ARCH >= 2)
479 && (gdbarch->push_dummy_frame == 0))
480 fatal ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
481 if ((GDB_MULTI_ARCH >= 1)
482 && (gdbarch->push_return_address == 0))
483 fatal ("gdbarch: verify_gdbarch: push_return_address invalid");
484 if ((GDB_MULTI_ARCH >= 2)
485 && (gdbarch->pop_frame == 0))
486 fatal ("gdbarch: verify_gdbarch: pop_frame invalid");
487 if ((GDB_MULTI_ARCH >= 2)
488 && (gdbarch->d10v_make_daddr == 0))
489 fatal ("gdbarch: verify_gdbarch: d10v_make_daddr invalid");
490 if ((GDB_MULTI_ARCH >= 2)
491 && (gdbarch->d10v_make_iaddr == 0))
492 fatal ("gdbarch: verify_gdbarch: d10v_make_iaddr invalid");
493 if ((GDB_MULTI_ARCH >= 2)
494 && (gdbarch->d10v_daddr_p == 0))
495 fatal ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
496 if ((GDB_MULTI_ARCH >= 2)
497 && (gdbarch->d10v_iaddr_p == 0))
498 fatal ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
499 if ((GDB_MULTI_ARCH >= 2)
500 && (gdbarch->d10v_convert_daddr_to_raw == 0))
501 fatal ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
502 if ((GDB_MULTI_ARCH >= 2)
503 && (gdbarch->d10v_convert_iaddr_to_raw == 0))
504 fatal ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
505 if ((GDB_MULTI_ARCH >= 2)
506 && (gdbarch->store_struct_return == 0))
507 fatal ("gdbarch: verify_gdbarch: store_struct_return invalid");
508 if ((GDB_MULTI_ARCH >= 2)
509 && (gdbarch->store_return_value == 0))
510 fatal ("gdbarch: verify_gdbarch: store_return_value invalid");
511 if ((GDB_MULTI_ARCH >= 2)
512 && (gdbarch->extract_struct_value_address == 0))
513 fatal ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
514 if ((GDB_MULTI_ARCH >= 2)
515 && (gdbarch->use_struct_convention == 0))
516 fatal ("gdbarch: verify_gdbarch: use_struct_convention invalid");
517 if ((GDB_MULTI_ARCH >= 2)
518 && (gdbarch->frame_init_saved_regs == 0))
519 fatal ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
520 if ((GDB_MULTI_ARCH >= 2)
521 && (gdbarch->init_extra_frame_info == 0))
522 fatal ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
523 if ((GDB_MULTI_ARCH >= 2)
524 && (gdbarch->skip_prologue == 0))
525 fatal ("gdbarch: verify_gdbarch: skip_prologue invalid");
526 if ((GDB_MULTI_ARCH >= 2)
527 && (gdbarch->inner_than == 0))
528 fatal ("gdbarch: verify_gdbarch: inner_than invalid");
529 if ((GDB_MULTI_ARCH >= 2)
530 && (gdbarch->breakpoint_from_pc == 0))
531 fatal ("gdbarch: verify_gdbarch: breakpoint_from_pc invalid");
532 if ((GDB_MULTI_ARCH >= 2)
533 && (gdbarch->decr_pc_after_break == -1))
534 fatal ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
535 if ((GDB_MULTI_ARCH >= 2)
536 && (gdbarch->function_start_offset == -1))
537 fatal ("gdbarch: verify_gdbarch: function_start_offset invalid");
538 if ((GDB_MULTI_ARCH >= 2)
539 && (gdbarch->remote_translate_xfer_address == 0))
540 fatal ("gdbarch: verify_gdbarch: remote_translate_xfer_address invalid");
541 if ((GDB_MULTI_ARCH >= 2)
542 && (gdbarch->frame_args_skip == -1))
543 fatal ("gdbarch: verify_gdbarch: frame_args_skip invalid");
544 if ((GDB_MULTI_ARCH >= 2)
545 && (gdbarch->frameless_function_invocation == 0))
546 fatal ("gdbarch: verify_gdbarch: frameless_function_invocation invalid");
547 if ((GDB_MULTI_ARCH >= 2)
548 && (gdbarch->frame_chain == 0))
549 fatal ("gdbarch: verify_gdbarch: frame_chain invalid");
550 if ((GDB_MULTI_ARCH >= 1)
551 && (gdbarch->frame_chain_valid == 0))
552 fatal ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
553 if ((GDB_MULTI_ARCH >= 2)
554 && (gdbarch->frame_saved_pc == 0))
555 fatal ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
556 if ((GDB_MULTI_ARCH >= 2)
557 && (gdbarch->frame_args_address == 0))
558 fatal ("gdbarch: verify_gdbarch: frame_args_address invalid");
559 if ((GDB_MULTI_ARCH >= 2)
560 && (gdbarch->frame_locals_address == 0))
561 fatal ("gdbarch: verify_gdbarch: frame_locals_address invalid");
562 if ((GDB_MULTI_ARCH >= 2)
563 && (gdbarch->saved_pc_after_call == 0))
564 fatal ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
565 if ((GDB_MULTI_ARCH >= 2)
566 && (gdbarch->frame_num_args == 0))
567 fatal ("gdbarch: verify_gdbarch: frame_num_args invalid");
568}
569
570
571/* Print out the details of the current architecture. */
572
573void
574gdbarch_dump ()
575{
576 if (TARGET_ARCHITECTURE != NULL)
577 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
578 "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
579 TARGET_ARCHITECTURE->printable_name);
0f71a2f6 580 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
581 "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
582 (long) TARGET_BYTE_ORDER);
0f71a2f6 583 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
584 "gdbarch_update: TARGET_PTR_BIT = %ld\n",
585 (long) TARGET_PTR_BIT);
0f71a2f6 586 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
587 "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
588 (long) TARGET_SHORT_BIT);
0f71a2f6 589 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
590 "gdbarch_update: TARGET_INT_BIT = %ld\n",
591 (long) TARGET_INT_BIT);
0f71a2f6 592 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
593 "gdbarch_update: TARGET_LONG_BIT = %ld\n",
594 (long) TARGET_LONG_BIT);
0f71a2f6 595 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
596 "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
597 (long) TARGET_LONG_LONG_BIT);
0f71a2f6 598 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
599 "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
600 (long) TARGET_FLOAT_BIT);
0f71a2f6 601 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
602 "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
603 (long) TARGET_DOUBLE_BIT);
0f71a2f6 604 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
605 "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
606 (long) TARGET_LONG_DOUBLE_BIT);
0f71a2f6 607 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
608 "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
609 (long) current_gdbarch->read_pc
610 /*TARGET_READ_PC ()*/);
0f71a2f6 611 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
612 "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
613 (long) current_gdbarch->write_pc
614 /*TARGET_WRITE_PC ()*/);
0f71a2f6 615 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
616 "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
617 (long) current_gdbarch->read_fp
618 /*TARGET_READ_FP ()*/);
0f71a2f6 619 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
620 "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
621 (long) current_gdbarch->write_fp
622 /*TARGET_WRITE_FP ()*/);
0f71a2f6 623 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
624 "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
625 (long) current_gdbarch->read_sp
626 /*TARGET_READ_SP ()*/);
0f71a2f6 627 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
628 "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
629 (long) current_gdbarch->write_sp
630 /*TARGET_WRITE_SP ()*/);
0f71a2f6 631 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
632 "gdbarch_update: NUM_REGS = %ld\n",
633 (long) NUM_REGS);
0f71a2f6 634 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
635 "gdbarch_update: SP_REGNUM = %ld\n",
636 (long) SP_REGNUM);
0f71a2f6 637 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
638 "gdbarch_update: FP_REGNUM = %ld\n",
639 (long) FP_REGNUM);
0f71a2f6 640 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
641 "gdbarch_update: PC_REGNUM = %ld\n",
642 (long) PC_REGNUM);
0f71a2f6 643 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
644 "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
645 (long) current_gdbarch->register_name
646 /*REGISTER_NAME ()*/);
0f71a2f6 647 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
648 "gdbarch_update: REGISTER_SIZE = %ld\n",
649 (long) REGISTER_SIZE);
0f71a2f6 650 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
651 "gdbarch_update: REGISTER_BYTES = %ld\n",
652 (long) REGISTER_BYTES);
0f71a2f6 653 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
654 "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
655 (long) current_gdbarch->register_byte
656 /*REGISTER_BYTE ()*/);
0f71a2f6 657 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
658 "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
659 (long) current_gdbarch->register_raw_size
660 /*REGISTER_RAW_SIZE ()*/);
0f71a2f6 661 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
662 "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
663 (long) MAX_REGISTER_RAW_SIZE);
0f71a2f6 664 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
665 "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
666 (long) current_gdbarch->register_virtual_size
667 /*REGISTER_VIRTUAL_SIZE ()*/);
0f71a2f6 668 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
669 "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
670 (long) MAX_REGISTER_VIRTUAL_SIZE);
0f71a2f6 671 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
672 "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
673 (long) current_gdbarch->register_virtual_type
674 /*REGISTER_VIRTUAL_TYPE ()*/);
0f71a2f6 675 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
676 "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
677 (long) USE_GENERIC_DUMMY_FRAMES);
0f71a2f6 678 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
679 "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
680 (long) CALL_DUMMY_LOCATION);
0f71a2f6 681 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
682 "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
683 (long) current_gdbarch->call_dummy_address
684 /*CALL_DUMMY_ADDRESS ()*/);
0f71a2f6 685 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
686 "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
687 (long) CALL_DUMMY_START_OFFSET);
0f71a2f6 688 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
689 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
690 (long) CALL_DUMMY_BREAKPOINT_OFFSET);
0f71a2f6 691 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
692 "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
693 (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
0f71a2f6
JM
694 if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
695 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
696 "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
697 (long) CALL_DUMMY_LENGTH);
0f71a2f6 698 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
699 "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
700 (long) current_gdbarch->pc_in_call_dummy
701 /*PC_IN_CALL_DUMMY ()*/);
0f71a2f6 702 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
703 "gdbarch_update: CALL_DUMMY_P = %ld\n",
704 (long) CALL_DUMMY_P);
0f71a2f6 705 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
706 "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
707 (long) CALL_DUMMY_WORDS);
0f71a2f6 708 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
709 "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
710 (long) SIZEOF_CALL_DUMMY_WORDS);
0f71a2f6 711 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
712 "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
713 (long) CALL_DUMMY_STACK_ADJUST_P);
0f71a2f6
JM
714 if (CALL_DUMMY_STACK_ADJUST_P)
715 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
716 "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
717 (long) CALL_DUMMY_STACK_ADJUST);
0f71a2f6 718 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
719 "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
720 (long) current_gdbarch->fix_call_dummy
721 /*FIX_CALL_DUMMY ()*/);
0f71a2f6
JM
722#ifdef BELIEVE_PCC_PROMOTION
723 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
724 "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
725 (long) BELIEVE_PCC_PROMOTION);
0f71a2f6
JM
726#endif
727#ifdef BELIEVE_PCC_PROMOTION_TYPE
728 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
729 "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
730 (long) BELIEVE_PCC_PROMOTION_TYPE);
0f71a2f6
JM
731#endif
732 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
733 "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
734 (long) current_gdbarch->get_saved_register
735 /*GET_SAVED_REGISTER ()*/);
0f71a2f6 736 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
737 "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
738 (long) current_gdbarch->register_convertible
739 /*REGISTER_CONVERTIBLE ()*/);
0f71a2f6 740 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
741 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
742 (long) current_gdbarch->register_convert_to_virtual
743 /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
0f71a2f6 744 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
745 "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
746 (long) current_gdbarch->register_convert_to_raw
747 /*REGISTER_CONVERT_TO_RAW ()*/);
0f71a2f6 748 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
749 "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
750 (long) current_gdbarch->extract_return_value
751 /*EXTRACT_RETURN_VALUE ()*/);
0f71a2f6 752 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
753 "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
754 (long) current_gdbarch->push_arguments
755 /*PUSH_ARGUMENTS ()*/);
0f71a2f6 756 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
757 "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
758 (long) current_gdbarch->push_dummy_frame
759 /*PUSH_DUMMY_FRAME ()*/);
0f71a2f6 760 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
761 "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
762 (long) current_gdbarch->push_return_address
763 /*PUSH_RETURN_ADDRESS ()*/);
0f71a2f6 764 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
765 "gdbarch_update: POP_FRAME = 0x%08lx\n",
766 (long) current_gdbarch->pop_frame
767 /*POP_FRAME ()*/);
0f71a2f6 768 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
769 "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
770 (long) current_gdbarch->d10v_make_daddr
771 /*D10V_MAKE_DADDR ()*/);
0f71a2f6 772 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
773 "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
774 (long) current_gdbarch->d10v_make_iaddr
775 /*D10V_MAKE_IADDR ()*/);
0f71a2f6 776 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
777 "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
778 (long) current_gdbarch->d10v_daddr_p
779 /*D10V_DADDR_P ()*/);
0f71a2f6 780 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
781 "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
782 (long) current_gdbarch->d10v_iaddr_p
783 /*D10V_IADDR_P ()*/);
0f71a2f6 784 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
785 "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
786 (long) current_gdbarch->d10v_convert_daddr_to_raw
787 /*D10V_CONVERT_DADDR_TO_RAW ()*/);
0f71a2f6 788 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
789 "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
790 (long) current_gdbarch->d10v_convert_iaddr_to_raw
791 /*D10V_CONVERT_IADDR_TO_RAW ()*/);
0f71a2f6 792 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
793 "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
794 (long) current_gdbarch->store_struct_return
795 /*STORE_STRUCT_RETURN ()*/);
0f71a2f6 796 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
797 "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
798 (long) current_gdbarch->store_return_value
799 /*STORE_RETURN_VALUE ()*/);
0f71a2f6 800 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
801 "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
802 (long) current_gdbarch->extract_struct_value_address
803 /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
0f71a2f6 804 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
805 "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
806 (long) current_gdbarch->use_struct_convention
807 /*USE_STRUCT_CONVENTION ()*/);
0f71a2f6 808 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
809 "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
810 (long) current_gdbarch->frame_init_saved_regs
811 /*FRAME_INIT_SAVED_REGS ()*/);
0f71a2f6 812 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
813 "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
814 (long) current_gdbarch->init_extra_frame_info
815 /*INIT_EXTRA_FRAME_INFO ()*/);
0f71a2f6 816 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
817 "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
818 (long) current_gdbarch->skip_prologue
819 /*SKIP_PROLOGUE ()*/);
0f71a2f6 820 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
821 "gdbarch_update: INNER_THAN = 0x%08lx\n",
822 (long) current_gdbarch->inner_than
823 /*INNER_THAN ()*/);
0f71a2f6 824 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
825 "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
826 (long) current_gdbarch->breakpoint_from_pc
827 /*BREAKPOINT_FROM_PC ()*/);
0f71a2f6 828 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
829 "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
830 (long) DECR_PC_AFTER_BREAK);
0f71a2f6 831 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
832 "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
833 (long) FUNCTION_START_OFFSET);
0f71a2f6 834 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
835 "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
836 (long) current_gdbarch->remote_translate_xfer_address
837 /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
0f71a2f6 838 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
839 "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
840 (long) FRAME_ARGS_SKIP);
0f71a2f6 841 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
842 "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
843 (long) current_gdbarch->frameless_function_invocation
844 /*FRAMELESS_FUNCTION_INVOCATION ()*/);
0f71a2f6 845 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
846 "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
847 (long) current_gdbarch->frame_chain
848 /*FRAME_CHAIN ()*/);
0f71a2f6 849 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
850 "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
851 (long) current_gdbarch->frame_chain_valid
852 /*FRAME_CHAIN_VALID ()*/);
0f71a2f6 853 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
854 "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
855 (long) current_gdbarch->frame_saved_pc
856 /*FRAME_SAVED_PC ()*/);
0f71a2f6 857 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
858 "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
859 (long) current_gdbarch->frame_args_address
860 /*FRAME_ARGS_ADDRESS ()*/);
0f71a2f6 861 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
862 "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
863 (long) current_gdbarch->frame_locals_address
864 /*FRAME_LOCALS_ADDRESS ()*/);
0f71a2f6 865 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
866 "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
867 (long) current_gdbarch->saved_pc_after_call
868 /*SAVED_PC_AFTER_CALL ()*/);
0f71a2f6 869 fprintf_unfiltered (gdb_stdlog,
adf40b2e
JM
870 "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
871 (long) current_gdbarch->frame_num_args
872 /*FRAME_NUM_ARGS ()*/);
0f71a2f6
JM
873}
874
875struct gdbarch_tdep *
876gdbarch_tdep (gdbarch)
adf40b2e 877 struct gdbarch *gdbarch;
0f71a2f6
JM
878{
879 if (gdbarch_debug >= 2)
880 /* FIXME: gdb_std??? */
881 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
882 return gdbarch->tdep;
883}
884
885
886const struct bfd_arch_info *
887gdbarch_bfd_arch_info (gdbarch)
adf40b2e 888 struct gdbarch *gdbarch;
0f71a2f6
JM
889{
890 if (gdbarch_debug >= 2)
891 /* FIXME: gdb_std??? */
892 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
893 return gdbarch->bfd_arch_info;
894}
895
896int
897gdbarch_byte_order (gdbarch)
adf40b2e 898 struct gdbarch *gdbarch;
0f71a2f6
JM
899{
900 if (gdbarch_debug >= 2)
901 /* FIXME: gdb_std??? */
902 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
903 return gdbarch->byte_order;
904}
905
906int
907gdbarch_ptr_bit (gdbarch)
adf40b2e 908 struct gdbarch *gdbarch;
0f71a2f6
JM
909{
910 if (gdbarch->ptr_bit == 0)
911 fatal ("gdbarch: gdbarch_ptr_bit invalid");
912 if (gdbarch_debug >= 2)
913 /* FIXME: gdb_std??? */
914 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
915 return gdbarch->ptr_bit;
916}
917
918void
919set_gdbarch_ptr_bit (gdbarch, ptr_bit)
adf40b2e
JM
920 struct gdbarch *gdbarch;
921 int ptr_bit;
0f71a2f6
JM
922{
923 gdbarch->ptr_bit = ptr_bit;
924}
925
926int
927gdbarch_short_bit (gdbarch)
adf40b2e 928 struct gdbarch *gdbarch;
0f71a2f6
JM
929{
930 if (gdbarch->short_bit == 0)
931 fatal ("gdbarch: gdbarch_short_bit invalid");
932 if (gdbarch_debug >= 2)
933 /* FIXME: gdb_std??? */
934 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
935 return gdbarch->short_bit;
936}
937
938void
939set_gdbarch_short_bit (gdbarch, short_bit)
adf40b2e
JM
940 struct gdbarch *gdbarch;
941 int short_bit;
0f71a2f6
JM
942{
943 gdbarch->short_bit = short_bit;
944}
945
946int
947gdbarch_int_bit (gdbarch)
adf40b2e 948 struct gdbarch *gdbarch;
0f71a2f6
JM
949{
950 if (gdbarch->int_bit == 0)
951 fatal ("gdbarch: gdbarch_int_bit invalid");
952 if (gdbarch_debug >= 2)
953 /* FIXME: gdb_std??? */
954 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
955 return gdbarch->int_bit;
956}
957
958void
959set_gdbarch_int_bit (gdbarch, int_bit)
adf40b2e
JM
960 struct gdbarch *gdbarch;
961 int int_bit;
0f71a2f6
JM
962{
963 gdbarch->int_bit = int_bit;
964}
965
966int
967gdbarch_long_bit (gdbarch)
adf40b2e 968 struct gdbarch *gdbarch;
0f71a2f6
JM
969{
970 if (gdbarch->long_bit == 0)
971 fatal ("gdbarch: gdbarch_long_bit invalid");
972 if (gdbarch_debug >= 2)
973 /* FIXME: gdb_std??? */
974 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
975 return gdbarch->long_bit;
976}
977
978void
979set_gdbarch_long_bit (gdbarch, long_bit)
adf40b2e
JM
980 struct gdbarch *gdbarch;
981 int long_bit;
0f71a2f6
JM
982{
983 gdbarch->long_bit = long_bit;
984}
985
986int
987gdbarch_long_long_bit (gdbarch)
adf40b2e 988 struct gdbarch *gdbarch;
0f71a2f6
JM
989{
990 if (gdbarch->long_long_bit == 0)
991 fatal ("gdbarch: gdbarch_long_long_bit invalid");
992 if (gdbarch_debug >= 2)
993 /* FIXME: gdb_std??? */
994 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
995 return gdbarch->long_long_bit;
996}
997
998void
999set_gdbarch_long_long_bit (gdbarch, long_long_bit)
adf40b2e
JM
1000 struct gdbarch *gdbarch;
1001 int long_long_bit;
0f71a2f6
JM
1002{
1003 gdbarch->long_long_bit = long_long_bit;
1004}
1005
1006int
1007gdbarch_float_bit (gdbarch)
adf40b2e 1008 struct gdbarch *gdbarch;
0f71a2f6
JM
1009{
1010 if (gdbarch->float_bit == 0)
1011 fatal ("gdbarch: gdbarch_float_bit invalid");
1012 if (gdbarch_debug >= 2)
1013 /* FIXME: gdb_std??? */
1014 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1015 return gdbarch->float_bit;
1016}
1017
1018void
1019set_gdbarch_float_bit (gdbarch, float_bit)
adf40b2e
JM
1020 struct gdbarch *gdbarch;
1021 int float_bit;
0f71a2f6
JM
1022{
1023 gdbarch->float_bit = float_bit;
1024}
1025
1026int
1027gdbarch_double_bit (gdbarch)
adf40b2e 1028 struct gdbarch *gdbarch;
0f71a2f6
JM
1029{
1030 if (gdbarch->double_bit == 0)
1031 fatal ("gdbarch: gdbarch_double_bit invalid");
1032 if (gdbarch_debug >= 2)
1033 /* FIXME: gdb_std??? */
1034 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1035 return gdbarch->double_bit;
1036}
1037
1038void
1039set_gdbarch_double_bit (gdbarch, double_bit)
adf40b2e
JM
1040 struct gdbarch *gdbarch;
1041 int double_bit;
0f71a2f6
JM
1042{
1043 gdbarch->double_bit = double_bit;
1044}
1045
1046int
1047gdbarch_long_double_bit (gdbarch)
adf40b2e 1048 struct gdbarch *gdbarch;
0f71a2f6
JM
1049{
1050 if (gdbarch->long_double_bit == 0)
1051 fatal ("gdbarch: gdbarch_long_double_bit invalid");
1052 if (gdbarch_debug >= 2)
1053 /* FIXME: gdb_std??? */
1054 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1055 return gdbarch->long_double_bit;
1056}
1057
1058void
1059set_gdbarch_long_double_bit (gdbarch, long_double_bit)
adf40b2e
JM
1060 struct gdbarch *gdbarch;
1061 int long_double_bit;
0f71a2f6
JM
1062{
1063 gdbarch->long_double_bit = long_double_bit;
1064}
1065
1066CORE_ADDR
1067gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
1068{
1069 if (gdbarch->read_pc == 0)
1070 fatal ("gdbarch: gdbarch_read_pc invalid");
1071 if (gdbarch_debug >= 2)
1072 /* FIXME: gdb_std??? */
1073 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1074 return gdbarch->read_pc (pid);
1075}
1076
1077void
1078set_gdbarch_read_pc (gdbarch, read_pc)
adf40b2e
JM
1079 struct gdbarch *gdbarch;
1080 gdbarch_read_pc_ftype read_pc;
0f71a2f6
JM
1081{
1082 gdbarch->read_pc = read_pc;
1083}
1084
1085void
1086gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
1087{
1088 if (gdbarch->write_pc == 0)
1089 fatal ("gdbarch: gdbarch_write_pc invalid");
1090 if (gdbarch_debug >= 2)
1091 /* FIXME: gdb_std??? */
1092 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1093 gdbarch->write_pc (val, pid);
1094}
1095
1096void
1097set_gdbarch_write_pc (gdbarch, write_pc)
adf40b2e
JM
1098 struct gdbarch *gdbarch;
1099 gdbarch_write_pc_ftype write_pc;
0f71a2f6
JM
1100{
1101 gdbarch->write_pc = write_pc;
1102}
1103
1104CORE_ADDR
1105gdbarch_read_fp (struct gdbarch *gdbarch)
1106{
1107 if (gdbarch->read_fp == 0)
1108 fatal ("gdbarch: gdbarch_read_fp invalid");
1109 if (gdbarch_debug >= 2)
1110 /* FIXME: gdb_std??? */
1111 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
1112 return gdbarch->read_fp ();
1113}
1114
1115void
1116set_gdbarch_read_fp (gdbarch, read_fp)
adf40b2e
JM
1117 struct gdbarch *gdbarch;
1118 gdbarch_read_fp_ftype read_fp;
0f71a2f6
JM
1119{
1120 gdbarch->read_fp = read_fp;
1121}
1122
1123void
1124gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
1125{
1126 if (gdbarch->write_fp == 0)
1127 fatal ("gdbarch: gdbarch_write_fp invalid");
1128 if (gdbarch_debug >= 2)
1129 /* FIXME: gdb_std??? */
1130 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
1131 gdbarch->write_fp (val);
1132}
1133
1134void
1135set_gdbarch_write_fp (gdbarch, write_fp)
adf40b2e
JM
1136 struct gdbarch *gdbarch;
1137 gdbarch_write_fp_ftype write_fp;
0f71a2f6
JM
1138{
1139 gdbarch->write_fp = write_fp;
1140}
1141
1142CORE_ADDR
1143gdbarch_read_sp (struct gdbarch *gdbarch)
1144{
1145 if (gdbarch->read_sp == 0)
1146 fatal ("gdbarch: gdbarch_read_sp invalid");
1147 if (gdbarch_debug >= 2)
1148 /* FIXME: gdb_std??? */
1149 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
1150 return gdbarch->read_sp ();
1151}
1152
1153void
1154set_gdbarch_read_sp (gdbarch, read_sp)
adf40b2e
JM
1155 struct gdbarch *gdbarch;
1156 gdbarch_read_sp_ftype read_sp;
0f71a2f6
JM
1157{
1158 gdbarch->read_sp = read_sp;
1159}
1160
1161void
1162gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
1163{
1164 if (gdbarch->write_sp == 0)
1165 fatal ("gdbarch: gdbarch_write_sp invalid");
1166 if (gdbarch_debug >= 2)
1167 /* FIXME: gdb_std??? */
1168 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
1169 gdbarch->write_sp (val);
1170}
1171
1172void
1173set_gdbarch_write_sp (gdbarch, write_sp)
adf40b2e
JM
1174 struct gdbarch *gdbarch;
1175 gdbarch_write_sp_ftype write_sp;
0f71a2f6
JM
1176{
1177 gdbarch->write_sp = write_sp;
1178}
1179
1180int
1181gdbarch_num_regs (gdbarch)
adf40b2e 1182 struct gdbarch *gdbarch;
0f71a2f6
JM
1183{
1184 if (gdbarch->num_regs == -1)
1185 fatal ("gdbarch: gdbarch_num_regs invalid");
1186 if (gdbarch_debug >= 2)
1187 /* FIXME: gdb_std??? */
1188 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1189 return gdbarch->num_regs;
1190}
1191
1192void
1193set_gdbarch_num_regs (gdbarch, num_regs)
adf40b2e
JM
1194 struct gdbarch *gdbarch;
1195 int num_regs;
0f71a2f6
JM
1196{
1197 gdbarch->num_regs = num_regs;
1198}
1199
1200int
1201gdbarch_sp_regnum (gdbarch)
adf40b2e 1202 struct gdbarch *gdbarch;
0f71a2f6
JM
1203{
1204 if (gdbarch->sp_regnum == -1)
1205 fatal ("gdbarch: gdbarch_sp_regnum invalid");
1206 if (gdbarch_debug >= 2)
1207 /* FIXME: gdb_std??? */
1208 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1209 return gdbarch->sp_regnum;
1210}
1211
1212void
1213set_gdbarch_sp_regnum (gdbarch, sp_regnum)
adf40b2e
JM
1214 struct gdbarch *gdbarch;
1215 int sp_regnum;
0f71a2f6
JM
1216{
1217 gdbarch->sp_regnum = sp_regnum;
1218}
1219
1220int
1221gdbarch_fp_regnum (gdbarch)
adf40b2e 1222 struct gdbarch *gdbarch;
0f71a2f6
JM
1223{
1224 if (gdbarch->fp_regnum == -1)
1225 fatal ("gdbarch: gdbarch_fp_regnum invalid");
1226 if (gdbarch_debug >= 2)
1227 /* FIXME: gdb_std??? */
1228 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
1229 return gdbarch->fp_regnum;
1230}
1231
1232void
1233set_gdbarch_fp_regnum (gdbarch, fp_regnum)
adf40b2e
JM
1234 struct gdbarch *gdbarch;
1235 int fp_regnum;
0f71a2f6
JM
1236{
1237 gdbarch->fp_regnum = fp_regnum;
1238}
1239
1240int
1241gdbarch_pc_regnum (gdbarch)
adf40b2e 1242 struct gdbarch *gdbarch;
0f71a2f6
JM
1243{
1244 if (gdbarch->pc_regnum == -1)
1245 fatal ("gdbarch: gdbarch_pc_regnum invalid");
1246 if (gdbarch_debug >= 2)
1247 /* FIXME: gdb_std??? */
1248 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1249 return gdbarch->pc_regnum;
1250}
1251
1252void
1253set_gdbarch_pc_regnum (gdbarch, pc_regnum)
adf40b2e
JM
1254 struct gdbarch *gdbarch;
1255 int pc_regnum;
0f71a2f6
JM
1256{
1257 gdbarch->pc_regnum = pc_regnum;
1258}
1259
1260char *
1261gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1262{
1263 if (gdbarch->register_name == 0)
1264 fatal ("gdbarch: gdbarch_register_name invalid");
1265 if (gdbarch_debug >= 2)
1266 /* FIXME: gdb_std??? */
1267 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1268 return gdbarch->register_name (regnr);
1269}
1270
1271void
1272set_gdbarch_register_name (gdbarch, register_name)
adf40b2e
JM
1273 struct gdbarch *gdbarch;
1274 gdbarch_register_name_ftype register_name;
0f71a2f6
JM
1275{
1276 gdbarch->register_name = register_name;
1277}
1278
1279int
1280gdbarch_register_size (gdbarch)
adf40b2e 1281 struct gdbarch *gdbarch;
0f71a2f6
JM
1282{
1283 if (gdbarch->register_size == -1)
1284 fatal ("gdbarch: gdbarch_register_size invalid");
1285 if (gdbarch_debug >= 2)
1286 /* FIXME: gdb_std??? */
1287 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
1288 return gdbarch->register_size;
1289}
1290
1291void
1292set_gdbarch_register_size (gdbarch, register_size)
adf40b2e
JM
1293 struct gdbarch *gdbarch;
1294 int register_size;
0f71a2f6
JM
1295{
1296 gdbarch->register_size = register_size;
1297}
1298
1299int
1300gdbarch_register_bytes (gdbarch)
adf40b2e 1301 struct gdbarch *gdbarch;
0f71a2f6
JM
1302{
1303 if (gdbarch->register_bytes == -1)
1304 fatal ("gdbarch: gdbarch_register_bytes invalid");
1305 if (gdbarch_debug >= 2)
1306 /* FIXME: gdb_std??? */
1307 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
1308 return gdbarch->register_bytes;
1309}
1310
1311void
1312set_gdbarch_register_bytes (gdbarch, register_bytes)
adf40b2e
JM
1313 struct gdbarch *gdbarch;
1314 int register_bytes;
0f71a2f6
JM
1315{
1316 gdbarch->register_bytes = register_bytes;
1317}
1318
1319int
1320gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
1321{
1322 if (gdbarch->register_byte == 0)
1323 fatal ("gdbarch: gdbarch_register_byte invalid");
1324 if (gdbarch_debug >= 2)
1325 /* FIXME: gdb_std??? */
1326 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
1327 return gdbarch->register_byte (reg_nr);
1328}
1329
1330void
1331set_gdbarch_register_byte (gdbarch, register_byte)
adf40b2e
JM
1332 struct gdbarch *gdbarch;
1333 gdbarch_register_byte_ftype register_byte;
0f71a2f6
JM
1334{
1335 gdbarch->register_byte = register_byte;
1336}
1337
1338int
1339gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
1340{
1341 if (gdbarch->register_raw_size == 0)
1342 fatal ("gdbarch: gdbarch_register_raw_size invalid");
1343 if (gdbarch_debug >= 2)
1344 /* FIXME: gdb_std??? */
1345 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
1346 return gdbarch->register_raw_size (reg_nr);
1347}
1348
1349void
1350set_gdbarch_register_raw_size (gdbarch, register_raw_size)
adf40b2e
JM
1351 struct gdbarch *gdbarch;
1352 gdbarch_register_raw_size_ftype register_raw_size;
0f71a2f6
JM
1353{
1354 gdbarch->register_raw_size = register_raw_size;
1355}
1356
1357int
1358gdbarch_max_register_raw_size (gdbarch)
adf40b2e 1359 struct gdbarch *gdbarch;
0f71a2f6
JM
1360{
1361 if (gdbarch->max_register_raw_size == -1)
1362 fatal ("gdbarch: gdbarch_max_register_raw_size invalid");
1363 if (gdbarch_debug >= 2)
1364 /* FIXME: gdb_std??? */
1365 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
1366 return gdbarch->max_register_raw_size;
1367}
1368
1369void
1370set_gdbarch_max_register_raw_size (gdbarch, max_register_raw_size)
adf40b2e
JM
1371 struct gdbarch *gdbarch;
1372 int max_register_raw_size;
0f71a2f6
JM
1373{
1374 gdbarch->max_register_raw_size = max_register_raw_size;
1375}
1376
1377int
1378gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
1379{
1380 if (gdbarch->register_virtual_size == 0)
1381 fatal ("gdbarch: gdbarch_register_virtual_size invalid");
1382 if (gdbarch_debug >= 2)
1383 /* FIXME: gdb_std??? */
1384 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
1385 return gdbarch->register_virtual_size (reg_nr);
1386}
1387
1388void
1389set_gdbarch_register_virtual_size (gdbarch, register_virtual_size)
adf40b2e
JM
1390 struct gdbarch *gdbarch;
1391 gdbarch_register_virtual_size_ftype register_virtual_size;
0f71a2f6
JM
1392{
1393 gdbarch->register_virtual_size = register_virtual_size;
1394}
1395
1396int
1397gdbarch_max_register_virtual_size (gdbarch)
adf40b2e 1398 struct gdbarch *gdbarch;
0f71a2f6
JM
1399{
1400 if (gdbarch->max_register_virtual_size == -1)
1401 fatal ("gdbarch: gdbarch_max_register_virtual_size invalid");
1402 if (gdbarch_debug >= 2)
1403 /* FIXME: gdb_std??? */
1404 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
1405 return gdbarch->max_register_virtual_size;
1406}
1407
1408void
1409set_gdbarch_max_register_virtual_size (gdbarch, max_register_virtual_size)
adf40b2e
JM
1410 struct gdbarch *gdbarch;
1411 int max_register_virtual_size;
0f71a2f6
JM
1412{
1413 gdbarch->max_register_virtual_size = max_register_virtual_size;
1414}
1415
1416struct type *
1417gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
1418{
1419 if (gdbarch->register_virtual_type == 0)
1420 fatal ("gdbarch: gdbarch_register_virtual_type invalid");
1421 if (gdbarch_debug >= 2)
1422 /* FIXME: gdb_std??? */
1423 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
1424 return gdbarch->register_virtual_type (reg_nr);
1425}
1426
1427void
1428set_gdbarch_register_virtual_type (gdbarch, register_virtual_type)
adf40b2e
JM
1429 struct gdbarch *gdbarch;
1430 gdbarch_register_virtual_type_ftype register_virtual_type;
0f71a2f6
JM
1431{
1432 gdbarch->register_virtual_type = register_virtual_type;
1433}
1434
1435int
1436gdbarch_use_generic_dummy_frames (gdbarch)
adf40b2e 1437 struct gdbarch *gdbarch;
0f71a2f6
JM
1438{
1439 if (gdbarch->use_generic_dummy_frames == -1)
1440 fatal ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
1441 if (gdbarch_debug >= 2)
1442 /* FIXME: gdb_std??? */
1443 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
1444 return gdbarch->use_generic_dummy_frames;
1445}
1446
1447void
1448set_gdbarch_use_generic_dummy_frames (gdbarch, use_generic_dummy_frames)
adf40b2e
JM
1449 struct gdbarch *gdbarch;
1450 int use_generic_dummy_frames;
0f71a2f6
JM
1451{
1452 gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
1453}
1454
1455int
1456gdbarch_call_dummy_location (gdbarch)
adf40b2e 1457 struct gdbarch *gdbarch;
0f71a2f6
JM
1458{
1459 if (gdbarch->call_dummy_location == 0)
1460 fatal ("gdbarch: gdbarch_call_dummy_location invalid");
1461 if (gdbarch_debug >= 2)
1462 /* FIXME: gdb_std??? */
1463 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1464 return gdbarch->call_dummy_location;
1465}
1466
1467void
1468set_gdbarch_call_dummy_location (gdbarch, call_dummy_location)
adf40b2e
JM
1469 struct gdbarch *gdbarch;
1470 int call_dummy_location;
0f71a2f6
JM
1471{
1472 gdbarch->call_dummy_location = call_dummy_location;
1473}
1474
1475CORE_ADDR
1476gdbarch_call_dummy_address (struct gdbarch *gdbarch)
1477{
1478 if (gdbarch->call_dummy_address == 0)
1479 fatal ("gdbarch: gdbarch_call_dummy_address invalid");
1480 if (gdbarch_debug >= 2)
1481 /* FIXME: gdb_std??? */
1482 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
1483 return gdbarch->call_dummy_address ();
1484}
1485
1486void
1487set_gdbarch_call_dummy_address (gdbarch, call_dummy_address)
adf40b2e
JM
1488 struct gdbarch *gdbarch;
1489 gdbarch_call_dummy_address_ftype call_dummy_address;
0f71a2f6
JM
1490{
1491 gdbarch->call_dummy_address = call_dummy_address;
1492}
1493
1494CORE_ADDR
1495gdbarch_call_dummy_start_offset (gdbarch)
adf40b2e 1496 struct gdbarch *gdbarch;
0f71a2f6
JM
1497{
1498 if (gdbarch->call_dummy_start_offset == -1)
1499 fatal ("gdbarch: gdbarch_call_dummy_start_offset invalid");
1500 if (gdbarch_debug >= 2)
1501 /* FIXME: gdb_std??? */
1502 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
1503 return gdbarch->call_dummy_start_offset;
1504}
1505
1506void
1507set_gdbarch_call_dummy_start_offset (gdbarch, call_dummy_start_offset)
adf40b2e
JM
1508 struct gdbarch *gdbarch;
1509 CORE_ADDR call_dummy_start_offset;
0f71a2f6
JM
1510{
1511 gdbarch->call_dummy_start_offset = call_dummy_start_offset;
1512}
1513
1514CORE_ADDR
1515gdbarch_call_dummy_breakpoint_offset (gdbarch)
adf40b2e 1516 struct gdbarch *gdbarch;
0f71a2f6
JM
1517{
1518 if (gdbarch->call_dummy_breakpoint_offset == -1)
1519 fatal ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
1520 if (gdbarch_debug >= 2)
1521 /* FIXME: gdb_std??? */
1522 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
1523 return gdbarch->call_dummy_breakpoint_offset;
1524}
1525
1526void
1527set_gdbarch_call_dummy_breakpoint_offset (gdbarch, call_dummy_breakpoint_offset)
adf40b2e
JM
1528 struct gdbarch *gdbarch;
1529 CORE_ADDR call_dummy_breakpoint_offset;
0f71a2f6
JM
1530{
1531 gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
1532}
1533
1534int
1535gdbarch_call_dummy_breakpoint_offset_p (gdbarch)
adf40b2e 1536 struct gdbarch *gdbarch;
0f71a2f6
JM
1537{
1538 if (gdbarch->call_dummy_breakpoint_offset_p == -1)
1539 fatal ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
1540 if (gdbarch_debug >= 2)
1541 /* FIXME: gdb_std??? */
1542 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
1543 return gdbarch->call_dummy_breakpoint_offset_p;
1544}
1545
1546void
1547set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, call_dummy_breakpoint_offset_p)
adf40b2e
JM
1548 struct gdbarch *gdbarch;
1549 int call_dummy_breakpoint_offset_p;
0f71a2f6
JM
1550{
1551 gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
1552}
1553
1554int
1555gdbarch_call_dummy_length (gdbarch)
adf40b2e 1556 struct gdbarch *gdbarch;
0f71a2f6
JM
1557{
1558 if (gdbarch->call_dummy_length == -1)
1559 fatal ("gdbarch: gdbarch_call_dummy_length invalid");
1560 if (gdbarch_debug >= 2)
1561 /* FIXME: gdb_std??? */
1562 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
1563 return gdbarch->call_dummy_length;
1564}
1565
1566void
1567set_gdbarch_call_dummy_length (gdbarch, call_dummy_length)
adf40b2e
JM
1568 struct gdbarch *gdbarch;
1569 int call_dummy_length;
0f71a2f6
JM
1570{
1571 gdbarch->call_dummy_length = call_dummy_length;
1572}
1573
1574int
1575gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
1576{
1577 if (gdbarch->pc_in_call_dummy == 0)
1578 fatal ("gdbarch: gdbarch_pc_in_call_dummy invalid");
1579 if (gdbarch_debug >= 2)
1580 /* FIXME: gdb_std??? */
1581 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
1582 return gdbarch->pc_in_call_dummy (pc, sp, frame_address);
1583}
1584
1585void
1586set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy)
adf40b2e
JM
1587 struct gdbarch *gdbarch;
1588 gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy;
0f71a2f6
JM
1589{
1590 gdbarch->pc_in_call_dummy = pc_in_call_dummy;
1591}
1592
1593int
1594gdbarch_call_dummy_p (gdbarch)
adf40b2e 1595 struct gdbarch *gdbarch;
0f71a2f6
JM
1596{
1597 if (gdbarch->call_dummy_p == -1)
1598 fatal ("gdbarch: gdbarch_call_dummy_p invalid");
1599 if (gdbarch_debug >= 2)
1600 /* FIXME: gdb_std??? */
1601 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
1602 return gdbarch->call_dummy_p;
1603}
1604
1605void
1606set_gdbarch_call_dummy_p (gdbarch, call_dummy_p)
adf40b2e
JM
1607 struct gdbarch *gdbarch;
1608 int call_dummy_p;
0f71a2f6
JM
1609{
1610 gdbarch->call_dummy_p = call_dummy_p;
1611}
1612
1613LONGEST *
1614gdbarch_call_dummy_words (gdbarch)
adf40b2e 1615 struct gdbarch *gdbarch;
0f71a2f6
JM
1616{
1617 if (gdbarch_debug >= 2)
1618 /* FIXME: gdb_std??? */
1619 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
1620 return gdbarch->call_dummy_words;
1621}
1622
1623void
1624set_gdbarch_call_dummy_words (gdbarch, call_dummy_words)
adf40b2e
JM
1625 struct gdbarch *gdbarch;
1626 LONGEST * call_dummy_words;
0f71a2f6
JM
1627{
1628 gdbarch->call_dummy_words = call_dummy_words;
1629}
1630
1631int
1632gdbarch_sizeof_call_dummy_words (gdbarch)
adf40b2e 1633 struct gdbarch *gdbarch;
0f71a2f6
JM
1634{
1635 if (gdbarch_debug >= 2)
1636 /* FIXME: gdb_std??? */
1637 fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
1638 return gdbarch->sizeof_call_dummy_words;
1639}
1640
1641void
1642set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_call_dummy_words)
adf40b2e
JM
1643 struct gdbarch *gdbarch;
1644 int sizeof_call_dummy_words;
0f71a2f6
JM
1645{
1646 gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
1647}
1648
1649int
1650gdbarch_call_dummy_stack_adjust_p (gdbarch)
adf40b2e 1651 struct gdbarch *gdbarch;
0f71a2f6
JM
1652{
1653 if (gdbarch->call_dummy_stack_adjust_p == -1)
1654 fatal ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
1655 if (gdbarch_debug >= 2)
1656 /* FIXME: gdb_std??? */
1657 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
1658 return gdbarch->call_dummy_stack_adjust_p;
1659}
1660
1661void
1662set_gdbarch_call_dummy_stack_adjust_p (gdbarch, call_dummy_stack_adjust_p)
adf40b2e
JM
1663 struct gdbarch *gdbarch;
1664 int call_dummy_stack_adjust_p;
0f71a2f6
JM
1665{
1666 gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
1667}
1668
1669int
1670gdbarch_call_dummy_stack_adjust (gdbarch)
adf40b2e 1671 struct gdbarch *gdbarch;
0f71a2f6
JM
1672{
1673 if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
1674 fatal ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
1675 if (gdbarch_debug >= 2)
1676 /* FIXME: gdb_std??? */
1677 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
1678 return gdbarch->call_dummy_stack_adjust;
1679}
1680
1681void
1682set_gdbarch_call_dummy_stack_adjust (gdbarch, call_dummy_stack_adjust)
adf40b2e
JM
1683 struct gdbarch *gdbarch;
1684 int call_dummy_stack_adjust;
0f71a2f6
JM
1685{
1686 gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
1687}
1688
1689void
1690gdbarch_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)
1691{
1692 if (gdbarch->fix_call_dummy == 0)
1693 fatal ("gdbarch: gdbarch_fix_call_dummy invalid");
1694 if (gdbarch_debug >= 2)
1695 /* FIXME: gdb_std??? */
1696 fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
1697 gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
1698}
1699
1700void
1701set_gdbarch_fix_call_dummy (gdbarch, fix_call_dummy)
adf40b2e
JM
1702 struct gdbarch *gdbarch;
1703 gdbarch_fix_call_dummy_ftype fix_call_dummy;
0f71a2f6
JM
1704{
1705 gdbarch->fix_call_dummy = fix_call_dummy;
1706}
1707
1708int
1709gdbarch_believe_pcc_promotion (gdbarch)
adf40b2e 1710 struct gdbarch *gdbarch;
0f71a2f6
JM
1711{
1712 if (gdbarch_debug >= 2)
1713 /* FIXME: gdb_std??? */
1714 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
1715 return gdbarch->believe_pcc_promotion;
1716}
1717
1718void
1719set_gdbarch_believe_pcc_promotion (gdbarch, believe_pcc_promotion)
adf40b2e
JM
1720 struct gdbarch *gdbarch;
1721 int believe_pcc_promotion;
0f71a2f6
JM
1722{
1723 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
1724}
1725
1726int
1727gdbarch_believe_pcc_promotion_type (gdbarch)
adf40b2e 1728 struct gdbarch *gdbarch;
0f71a2f6
JM
1729{
1730 if (gdbarch_debug >= 2)
1731 /* FIXME: gdb_std??? */
1732 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
1733 return gdbarch->believe_pcc_promotion_type;
1734}
1735
1736void
1737set_gdbarch_believe_pcc_promotion_type (gdbarch, believe_pcc_promotion_type)
adf40b2e
JM
1738 struct gdbarch *gdbarch;
1739 int believe_pcc_promotion_type;
0f71a2f6
JM
1740{
1741 gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
1742}
1743
1744void
adf40b2e 1745gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
0f71a2f6
JM
1746{
1747 if (gdbarch->get_saved_register == 0)
1748 fatal ("gdbarch: gdbarch_get_saved_register invalid");
1749 if (gdbarch_debug >= 2)
1750 /* FIXME: gdb_std??? */
1751 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
1752 gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
1753}
1754
1755void
1756set_gdbarch_get_saved_register (gdbarch, get_saved_register)
adf40b2e
JM
1757 struct gdbarch *gdbarch;
1758 gdbarch_get_saved_register_ftype get_saved_register;
0f71a2f6
JM
1759{
1760 gdbarch->get_saved_register = get_saved_register;
1761}
1762
1763int
1764gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
1765{
1766 if (gdbarch->register_convertible == 0)
1767 fatal ("gdbarch: gdbarch_register_convertible invalid");
1768 if (gdbarch_debug >= 2)
1769 /* FIXME: gdb_std??? */
1770 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
1771 return gdbarch->register_convertible (nr);
1772}
1773
1774void
1775set_gdbarch_register_convertible (gdbarch, register_convertible)
adf40b2e
JM
1776 struct gdbarch *gdbarch;
1777 gdbarch_register_convertible_ftype register_convertible;
0f71a2f6
JM
1778{
1779 gdbarch->register_convertible = register_convertible;
1780}
1781
1782void
1783gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
1784{
1785 if (gdbarch->register_convert_to_virtual == 0)
1786 fatal ("gdbarch: gdbarch_register_convert_to_virtual invalid");
1787 if (gdbarch_debug >= 2)
1788 /* FIXME: gdb_std??? */
1789 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
1790 gdbarch->register_convert_to_virtual (regnum, type, from, to);
1791}
1792
1793void
1794set_gdbarch_register_convert_to_virtual (gdbarch, register_convert_to_virtual)
adf40b2e
JM
1795 struct gdbarch *gdbarch;
1796 gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual;
0f71a2f6
JM
1797{
1798 gdbarch->register_convert_to_virtual = register_convert_to_virtual;
1799}
1800
1801void
1802gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
1803{
1804 if (gdbarch->register_convert_to_raw == 0)
1805 fatal ("gdbarch: gdbarch_register_convert_to_raw invalid");
1806 if (gdbarch_debug >= 2)
1807 /* FIXME: gdb_std??? */
1808 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
1809 gdbarch->register_convert_to_raw (type, regnum, from, to);
1810}
1811
1812void
1813set_gdbarch_register_convert_to_raw (gdbarch, register_convert_to_raw)
adf40b2e
JM
1814 struct gdbarch *gdbarch;
1815 gdbarch_register_convert_to_raw_ftype register_convert_to_raw;
0f71a2f6
JM
1816{
1817 gdbarch->register_convert_to_raw = register_convert_to_raw;
1818}
1819
1820void
1821gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
1822{
1823 if (gdbarch->extract_return_value == 0)
1824 fatal ("gdbarch: gdbarch_extract_return_value invalid");
1825 if (gdbarch_debug >= 2)
1826 /* FIXME: gdb_std??? */
1827 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
1828 gdbarch->extract_return_value (type, regbuf, valbuf);
1829}
1830
1831void
1832set_gdbarch_extract_return_value (gdbarch, extract_return_value)
adf40b2e
JM
1833 struct gdbarch *gdbarch;
1834 gdbarch_extract_return_value_ftype extract_return_value;
0f71a2f6
JM
1835{
1836 gdbarch->extract_return_value = extract_return_value;
1837}
1838
1839CORE_ADDR
1840gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
1841{
1842 if (gdbarch->push_arguments == 0)
1843 fatal ("gdbarch: gdbarch_push_arguments invalid");
1844 if (gdbarch_debug >= 2)
1845 /* FIXME: gdb_std??? */
1846 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
1847 return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr);
1848}
1849
1850void
1851set_gdbarch_push_arguments (gdbarch, push_arguments)
adf40b2e
JM
1852 struct gdbarch *gdbarch;
1853 gdbarch_push_arguments_ftype push_arguments;
0f71a2f6
JM
1854{
1855 gdbarch->push_arguments = push_arguments;
1856}
1857
1858void
1859gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
1860{
1861 if (gdbarch->push_dummy_frame == 0)
1862 fatal ("gdbarch: gdbarch_push_dummy_frame invalid");
1863 if (gdbarch_debug >= 2)
1864 /* FIXME: gdb_std??? */
1865 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
1866 gdbarch->push_dummy_frame ();
1867}
1868
1869void
1870set_gdbarch_push_dummy_frame (gdbarch, push_dummy_frame)
adf40b2e
JM
1871 struct gdbarch *gdbarch;
1872 gdbarch_push_dummy_frame_ftype push_dummy_frame;
0f71a2f6
JM
1873{
1874 gdbarch->push_dummy_frame = push_dummy_frame;
1875}
1876
1877CORE_ADDR
1878gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
1879{
1880 if (gdbarch->push_return_address == 0)
1881 fatal ("gdbarch: gdbarch_push_return_address invalid");
1882 if (gdbarch_debug >= 2)
1883 /* FIXME: gdb_std??? */
1884 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
1885 return gdbarch->push_return_address (pc, sp);
1886}
1887
1888void
1889set_gdbarch_push_return_address (gdbarch, push_return_address)
adf40b2e
JM
1890 struct gdbarch *gdbarch;
1891 gdbarch_push_return_address_ftype push_return_address;
0f71a2f6
JM
1892{
1893 gdbarch->push_return_address = push_return_address;
1894}
1895
1896void
1897gdbarch_pop_frame (struct gdbarch *gdbarch)
1898{
1899 if (gdbarch->pop_frame == 0)
1900 fatal ("gdbarch: gdbarch_pop_frame invalid");
1901 if (gdbarch_debug >= 2)
1902 /* FIXME: gdb_std??? */
1903 fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
1904 gdbarch->pop_frame ();
1905}
1906
1907void
1908set_gdbarch_pop_frame (gdbarch, pop_frame)
adf40b2e
JM
1909 struct gdbarch *gdbarch;
1910 gdbarch_pop_frame_ftype pop_frame;
0f71a2f6
JM
1911{
1912 gdbarch->pop_frame = pop_frame;
1913}
1914
1915CORE_ADDR
1916gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
1917{
1918 if (gdbarch->d10v_make_daddr == 0)
1919 fatal ("gdbarch: gdbarch_d10v_make_daddr invalid");
1920 if (gdbarch_debug >= 2)
1921 /* FIXME: gdb_std??? */
1922 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n");
1923 return gdbarch->d10v_make_daddr (x);
1924}
1925
1926void
1927set_gdbarch_d10v_make_daddr (gdbarch, d10v_make_daddr)
adf40b2e
JM
1928 struct gdbarch *gdbarch;
1929 gdbarch_d10v_make_daddr_ftype d10v_make_daddr;
0f71a2f6
JM
1930{
1931 gdbarch->d10v_make_daddr = d10v_make_daddr;
1932}
1933
1934CORE_ADDR
1935gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
1936{
1937 if (gdbarch->d10v_make_iaddr == 0)
1938 fatal ("gdbarch: gdbarch_d10v_make_iaddr invalid");
1939 if (gdbarch_debug >= 2)
1940 /* FIXME: gdb_std??? */
1941 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n");
1942 return gdbarch->d10v_make_iaddr (x);
1943}
1944
1945void
1946set_gdbarch_d10v_make_iaddr (gdbarch, d10v_make_iaddr)
adf40b2e
JM
1947 struct gdbarch *gdbarch;
1948 gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr;
0f71a2f6
JM
1949{
1950 gdbarch->d10v_make_iaddr = d10v_make_iaddr;
1951}
1952
1953int
1954gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
1955{
1956 if (gdbarch->d10v_daddr_p == 0)
1957 fatal ("gdbarch: gdbarch_d10v_daddr_p invalid");
1958 if (gdbarch_debug >= 2)
1959 /* FIXME: gdb_std??? */
1960 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n");
1961 return gdbarch->d10v_daddr_p (x);
1962}
1963
1964void
1965set_gdbarch_d10v_daddr_p (gdbarch, d10v_daddr_p)
adf40b2e
JM
1966 struct gdbarch *gdbarch;
1967 gdbarch_d10v_daddr_p_ftype d10v_daddr_p;
0f71a2f6
JM
1968{
1969 gdbarch->d10v_daddr_p = d10v_daddr_p;
1970}
1971
1972int
1973gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
1974{
1975 if (gdbarch->d10v_iaddr_p == 0)
1976 fatal ("gdbarch: gdbarch_d10v_iaddr_p invalid");
1977 if (gdbarch_debug >= 2)
1978 /* FIXME: gdb_std??? */
1979 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n");
1980 return gdbarch->d10v_iaddr_p (x);
1981}
1982
1983void
1984set_gdbarch_d10v_iaddr_p (gdbarch, d10v_iaddr_p)
adf40b2e
JM
1985 struct gdbarch *gdbarch;
1986 gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p;
0f71a2f6
JM
1987{
1988 gdbarch->d10v_iaddr_p = d10v_iaddr_p;
1989}
1990
1991CORE_ADDR
1992gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
1993{
1994 if (gdbarch->d10v_convert_daddr_to_raw == 0)
1995 fatal ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
1996 if (gdbarch_debug >= 2)
1997 /* FIXME: gdb_std??? */
1998 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n");
1999 return gdbarch->d10v_convert_daddr_to_raw (x);
2000}
2001
2002void
2003set_gdbarch_d10v_convert_daddr_to_raw (gdbarch, d10v_convert_daddr_to_raw)
adf40b2e
JM
2004 struct gdbarch *gdbarch;
2005 gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw;
0f71a2f6
JM
2006{
2007 gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw;
2008}
2009
2010CORE_ADDR
2011gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
2012{
2013 if (gdbarch->d10v_convert_iaddr_to_raw == 0)
2014 fatal ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
2015 if (gdbarch_debug >= 2)
2016 /* FIXME: gdb_std??? */
2017 fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n");
2018 return gdbarch->d10v_convert_iaddr_to_raw (x);
2019}
2020
2021void
2022set_gdbarch_d10v_convert_iaddr_to_raw (gdbarch, d10v_convert_iaddr_to_raw)
adf40b2e
JM
2023 struct gdbarch *gdbarch;
2024 gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw;
0f71a2f6
JM
2025{
2026 gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw;
2027}
2028
2029void
2030gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
2031{
2032 if (gdbarch->store_struct_return == 0)
2033 fatal ("gdbarch: gdbarch_store_struct_return invalid");
2034 if (gdbarch_debug >= 2)
2035 /* FIXME: gdb_std??? */
2036 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
2037 gdbarch->store_struct_return (addr, sp);
2038}
2039
2040void
2041set_gdbarch_store_struct_return (gdbarch, store_struct_return)
adf40b2e
JM
2042 struct gdbarch *gdbarch;
2043 gdbarch_store_struct_return_ftype store_struct_return;
0f71a2f6
JM
2044{
2045 gdbarch->store_struct_return = store_struct_return;
2046}
2047
2048void
2049gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
2050{
2051 if (gdbarch->store_return_value == 0)
2052 fatal ("gdbarch: gdbarch_store_return_value invalid");
2053 if (gdbarch_debug >= 2)
2054 /* FIXME: gdb_std??? */
2055 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
2056 gdbarch->store_return_value (type, valbuf);
2057}
2058
2059void
2060set_gdbarch_store_return_value (gdbarch, store_return_value)
adf40b2e
JM
2061 struct gdbarch *gdbarch;
2062 gdbarch_store_return_value_ftype store_return_value;
0f71a2f6
JM
2063{
2064 gdbarch->store_return_value = store_return_value;
2065}
2066
2067CORE_ADDR
2068gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
2069{
2070 if (gdbarch->extract_struct_value_address == 0)
2071 fatal ("gdbarch: gdbarch_extract_struct_value_address invalid");
2072 if (gdbarch_debug >= 2)
2073 /* FIXME: gdb_std??? */
2074 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
2075 return gdbarch->extract_struct_value_address (regbuf);
2076}
2077
2078void
2079set_gdbarch_extract_struct_value_address (gdbarch, extract_struct_value_address)
adf40b2e
JM
2080 struct gdbarch *gdbarch;
2081 gdbarch_extract_struct_value_address_ftype extract_struct_value_address;
0f71a2f6
JM
2082{
2083 gdbarch->extract_struct_value_address = extract_struct_value_address;
2084}
2085
2086int
2087gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
2088{
2089 if (gdbarch->use_struct_convention == 0)
2090 fatal ("gdbarch: gdbarch_use_struct_convention invalid");
2091 if (gdbarch_debug >= 2)
2092 /* FIXME: gdb_std??? */
2093 fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
2094 return gdbarch->use_struct_convention (gcc_p, value_type);
2095}
2096
2097void
2098set_gdbarch_use_struct_convention (gdbarch, use_struct_convention)
adf40b2e
JM
2099 struct gdbarch *gdbarch;
2100 gdbarch_use_struct_convention_ftype use_struct_convention;
0f71a2f6
JM
2101{
2102 gdbarch->use_struct_convention = use_struct_convention;
2103}
2104
2105void
2106gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
2107{
2108 if (gdbarch->frame_init_saved_regs == 0)
2109 fatal ("gdbarch: gdbarch_frame_init_saved_regs invalid");
2110 if (gdbarch_debug >= 2)
2111 /* FIXME: gdb_std??? */
2112 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
2113 gdbarch->frame_init_saved_regs (frame);
2114}
2115
2116void
2117set_gdbarch_frame_init_saved_regs (gdbarch, frame_init_saved_regs)
adf40b2e
JM
2118 struct gdbarch *gdbarch;
2119 gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs;
0f71a2f6
JM
2120{
2121 gdbarch->frame_init_saved_regs = frame_init_saved_regs;
2122}
2123
2124void
2125gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
2126{
2127 if (gdbarch->init_extra_frame_info == 0)
2128 fatal ("gdbarch: gdbarch_init_extra_frame_info invalid");
2129 if (gdbarch_debug >= 2)
2130 /* FIXME: gdb_std??? */
2131 fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
2132 gdbarch->init_extra_frame_info (fromleaf, frame);
2133}
2134
2135void
2136set_gdbarch_init_extra_frame_info (gdbarch, init_extra_frame_info)
adf40b2e
JM
2137 struct gdbarch *gdbarch;
2138 gdbarch_init_extra_frame_info_ftype init_extra_frame_info;
0f71a2f6
JM
2139{
2140 gdbarch->init_extra_frame_info = init_extra_frame_info;
2141}
2142
2143CORE_ADDR
2144gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2145{
2146 if (gdbarch->skip_prologue == 0)
2147 fatal ("gdbarch: gdbarch_skip_prologue invalid");
2148 if (gdbarch_debug >= 2)
2149 /* FIXME: gdb_std??? */
2150 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2151 return gdbarch->skip_prologue (ip);
2152}
2153
2154void
2155set_gdbarch_skip_prologue (gdbarch, skip_prologue)
adf40b2e
JM
2156 struct gdbarch *gdbarch;
2157 gdbarch_skip_prologue_ftype skip_prologue;
0f71a2f6
JM
2158{
2159 gdbarch->skip_prologue = skip_prologue;
2160}
2161
2162int
2163gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2164{
2165 if (gdbarch->inner_than == 0)
2166 fatal ("gdbarch: gdbarch_inner_than invalid");
2167 if (gdbarch_debug >= 2)
2168 /* FIXME: gdb_std??? */
2169 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2170 return gdbarch->inner_than (lhs, rhs);
2171}
2172
2173void
2174set_gdbarch_inner_than (gdbarch, inner_than)
adf40b2e
JM
2175 struct gdbarch *gdbarch;
2176 gdbarch_inner_than_ftype inner_than;
0f71a2f6
JM
2177{
2178 gdbarch->inner_than = inner_than;
2179}
2180
2181unsigned char *
adf40b2e 2182gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
0f71a2f6
JM
2183{
2184 if (gdbarch->breakpoint_from_pc == 0)
2185 fatal ("gdbarch: gdbarch_breakpoint_from_pc invalid");
2186 if (gdbarch_debug >= 2)
2187 /* FIXME: gdb_std??? */
2188 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2189 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
2190}
2191
2192void
2193set_gdbarch_breakpoint_from_pc (gdbarch, breakpoint_from_pc)
adf40b2e
JM
2194 struct gdbarch *gdbarch;
2195 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc;
0f71a2f6
JM
2196{
2197 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2198}
2199
2200CORE_ADDR
2201gdbarch_decr_pc_after_break (gdbarch)
adf40b2e 2202 struct gdbarch *gdbarch;
0f71a2f6
JM
2203{
2204 if (gdbarch->decr_pc_after_break == -1)
2205 fatal ("gdbarch: gdbarch_decr_pc_after_break invalid");
2206 if (gdbarch_debug >= 2)
2207 /* FIXME: gdb_std??? */
2208 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2209 return gdbarch->decr_pc_after_break;
2210}
2211
2212void
2213set_gdbarch_decr_pc_after_break (gdbarch, decr_pc_after_break)
adf40b2e
JM
2214 struct gdbarch *gdbarch;
2215 CORE_ADDR decr_pc_after_break;
0f71a2f6
JM
2216{
2217 gdbarch->decr_pc_after_break = decr_pc_after_break;
2218}
2219
2220CORE_ADDR
2221gdbarch_function_start_offset (gdbarch)
adf40b2e 2222 struct gdbarch *gdbarch;
0f71a2f6
JM
2223{
2224 if (gdbarch->function_start_offset == -1)
2225 fatal ("gdbarch: gdbarch_function_start_offset invalid");
2226 if (gdbarch_debug >= 2)
2227 /* FIXME: gdb_std??? */
2228 fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
2229 return gdbarch->function_start_offset;
2230}
2231
2232void
2233set_gdbarch_function_start_offset (gdbarch, function_start_offset)
adf40b2e
JM
2234 struct gdbarch *gdbarch;
2235 CORE_ADDR function_start_offset;
0f71a2f6
JM
2236{
2237 gdbarch->function_start_offset = function_start_offset;
2238}
2239
2240void
adf40b2e 2241gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
0f71a2f6
JM
2242{
2243 if (gdbarch->remote_translate_xfer_address == 0)
2244 fatal ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
2245 if (gdbarch_debug >= 2)
2246 /* FIXME: gdb_std??? */
2247 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
2248 gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
2249}
2250
2251void
2252set_gdbarch_remote_translate_xfer_address (gdbarch, remote_translate_xfer_address)
adf40b2e
JM
2253 struct gdbarch *gdbarch;
2254 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address;
0f71a2f6
JM
2255{
2256 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
2257}
2258
2259CORE_ADDR
2260gdbarch_frame_args_skip (gdbarch)
adf40b2e 2261 struct gdbarch *gdbarch;
0f71a2f6
JM
2262{
2263 if (gdbarch->frame_args_skip == -1)
2264 fatal ("gdbarch: gdbarch_frame_args_skip invalid");
2265 if (gdbarch_debug >= 2)
2266 /* FIXME: gdb_std??? */
2267 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2268 return gdbarch->frame_args_skip;
2269}
2270
2271void
2272set_gdbarch_frame_args_skip (gdbarch, frame_args_skip)
adf40b2e
JM
2273 struct gdbarch *gdbarch;
2274 CORE_ADDR frame_args_skip;
0f71a2f6
JM
2275{
2276 gdbarch->frame_args_skip = frame_args_skip;
2277}
2278
2279int
2280gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
2281{
2282 if (gdbarch->frameless_function_invocation == 0)
2283 fatal ("gdbarch: gdbarch_frameless_function_invocation invalid");
2284 if (gdbarch_debug >= 2)
2285 /* FIXME: gdb_std??? */
2286 fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
2287 return gdbarch->frameless_function_invocation (fi);
2288}
2289
2290void
2291set_gdbarch_frameless_function_invocation (gdbarch, frameless_function_invocation)
adf40b2e
JM
2292 struct gdbarch *gdbarch;
2293 gdbarch_frameless_function_invocation_ftype frameless_function_invocation;
0f71a2f6
JM
2294{
2295 gdbarch->frameless_function_invocation = frameless_function_invocation;
2296}
2297
2298CORE_ADDR
2299gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
2300{
2301 if (gdbarch->frame_chain == 0)
2302 fatal ("gdbarch: gdbarch_frame_chain invalid");
2303 if (gdbarch_debug >= 2)
2304 /* FIXME: gdb_std??? */
2305 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
2306 return gdbarch->frame_chain (frame);
2307}
2308
2309void
2310set_gdbarch_frame_chain (gdbarch, frame_chain)
adf40b2e
JM
2311 struct gdbarch *gdbarch;
2312 gdbarch_frame_chain_ftype frame_chain;
0f71a2f6
JM
2313{
2314 gdbarch->frame_chain = frame_chain;
2315}
2316
2317int
2318gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
2319{
2320 if (gdbarch->frame_chain_valid == 0)
2321 fatal ("gdbarch: gdbarch_frame_chain_valid invalid");
2322 if (gdbarch_debug >= 2)
2323 /* FIXME: gdb_std??? */
2324 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
2325 return gdbarch->frame_chain_valid (chain, thisframe);
2326}
2327
2328void
2329set_gdbarch_frame_chain_valid (gdbarch, frame_chain_valid)
adf40b2e
JM
2330 struct gdbarch *gdbarch;
2331 gdbarch_frame_chain_valid_ftype frame_chain_valid;
0f71a2f6
JM
2332{
2333 gdbarch->frame_chain_valid = frame_chain_valid;
2334}
2335
2336CORE_ADDR
2337gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
2338{
2339 if (gdbarch->frame_saved_pc == 0)
2340 fatal ("gdbarch: gdbarch_frame_saved_pc invalid");
2341 if (gdbarch_debug >= 2)
2342 /* FIXME: gdb_std??? */
2343 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
2344 return gdbarch->frame_saved_pc (fi);
2345}
2346
2347void
2348set_gdbarch_frame_saved_pc (gdbarch, frame_saved_pc)
adf40b2e
JM
2349 struct gdbarch *gdbarch;
2350 gdbarch_frame_saved_pc_ftype frame_saved_pc;
0f71a2f6
JM
2351{
2352 gdbarch->frame_saved_pc = frame_saved_pc;
2353}
2354
2355CORE_ADDR
2356gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
2357{
2358 if (gdbarch->frame_args_address == 0)
2359 fatal ("gdbarch: gdbarch_frame_args_address invalid");
2360 if (gdbarch_debug >= 2)
2361 /* FIXME: gdb_std??? */
2362 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
2363 return gdbarch->frame_args_address (fi);
2364}
2365
2366void
2367set_gdbarch_frame_args_address (gdbarch, frame_args_address)
adf40b2e
JM
2368 struct gdbarch *gdbarch;
2369 gdbarch_frame_args_address_ftype frame_args_address;
0f71a2f6
JM
2370{
2371 gdbarch->frame_args_address = frame_args_address;
2372}
2373
2374CORE_ADDR
2375gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
2376{
2377 if (gdbarch->frame_locals_address == 0)
2378 fatal ("gdbarch: gdbarch_frame_locals_address invalid");
2379 if (gdbarch_debug >= 2)
2380 /* FIXME: gdb_std??? */
2381 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
2382 return gdbarch->frame_locals_address (fi);
2383}
2384
2385void
2386set_gdbarch_frame_locals_address (gdbarch, frame_locals_address)
adf40b2e
JM
2387 struct gdbarch *gdbarch;
2388 gdbarch_frame_locals_address_ftype frame_locals_address;
0f71a2f6
JM
2389{
2390 gdbarch->frame_locals_address = frame_locals_address;
2391}
2392
2393CORE_ADDR
2394gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
2395{
2396 if (gdbarch->saved_pc_after_call == 0)
2397 fatal ("gdbarch: gdbarch_saved_pc_after_call invalid");
2398 if (gdbarch_debug >= 2)
2399 /* FIXME: gdb_std??? */
2400 fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
2401 return gdbarch->saved_pc_after_call (frame);
2402}
2403
2404void
2405set_gdbarch_saved_pc_after_call (gdbarch, saved_pc_after_call)
adf40b2e
JM
2406 struct gdbarch *gdbarch;
2407 gdbarch_saved_pc_after_call_ftype saved_pc_after_call;
0f71a2f6
JM
2408{
2409 gdbarch->saved_pc_after_call = saved_pc_after_call;
2410}
2411
2412int
2413gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2414{
2415 if (gdbarch->frame_num_args == 0)
2416 fatal ("gdbarch: gdbarch_frame_num_args invalid");
2417 if (gdbarch_debug >= 2)
2418 /* FIXME: gdb_std??? */
2419 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2420 return gdbarch->frame_num_args (frame);
2421}
2422
2423void
2424set_gdbarch_frame_num_args (gdbarch, frame_num_args)
adf40b2e
JM
2425 struct gdbarch *gdbarch;
2426 gdbarch_frame_num_args_ftype frame_num_args;
0f71a2f6
JM
2427{
2428 gdbarch->frame_num_args = frame_num_args;
2429}
2430
2431
2432/* Keep a registrary of per-architecture data-pointers required by GDB
2433 modules. */
2434
2435struct gdbarch_data
2436{
2437 int index;
2438};
2439
2440struct gdbarch_data_registration
adf40b2e
JM
2441{
2442 gdbarch_data_ftype *init;
2443 struct gdbarch_data *data;
2444 struct gdbarch_data_registration *next;
2445};
0f71a2f6
JM
2446
2447struct gdbarch_data_registrary
adf40b2e
JM
2448{
2449 int nr;
2450 struct gdbarch_data_registration *registrations;
2451};
0f71a2f6
JM
2452
2453struct gdbarch_data_registrary gdbarch_data_registrary =
2454{
2455 0, NULL,
2456};
2457
2458struct gdbarch_data *
2459register_gdbarch_data (init)
2460 gdbarch_data_ftype *init;
2461{
2462 struct gdbarch_data_registration **curr;
2463 for (curr = &gdbarch_data_registrary.registrations;
2464 (*curr) != NULL;
2465 curr = &(*curr)->next);
2466 (*curr) = XMALLOC (struct gdbarch_data_registration);
2467 (*curr)->next = NULL;
2468 (*curr)->init = init;
2469 (*curr)->data = XMALLOC (struct gdbarch_data);
2470 (*curr)->data->index = gdbarch_data_registrary.nr++;
2471 return (*curr)->data;
2472}
2473
2474
2475/* Walk through all the registered users initializing each in turn. */
2476
2477static void init_gdbarch_data PARAMS ((struct gdbarch *));
2478static void
2479init_gdbarch_data (gdbarch)
2480 struct gdbarch *gdbarch;
2481{
2482 struct gdbarch_data_registration *rego;
2483 gdbarch->nr_data = gdbarch_data_registrary.nr + 1;
adf40b2e 2484 gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data);
0f71a2f6
JM
2485 for (rego = gdbarch_data_registrary.registrations;
2486 rego != NULL;
2487 rego = rego->next)
2488 {
2489 if (rego->data->index < gdbarch->nr_data)
2490 gdbarch->data[rego->data->index] = rego->init ();
2491 }
2492}
2493
2494
2495/* Return the current value of the specified per-architecture
2496 data-pointer. */
2497
2498void *
2499gdbarch_data (data)
2500 struct gdbarch_data *data;
2501{
2502 if (data->index >= current_gdbarch->nr_data)
2503 fatal ("gdbarch_data: request for non-existant data.");
2504 return current_gdbarch->data[data->index];
2505}
2506
2507
2508
2509/* Keep a registrary of swaped data required by GDB modules. */
2510
2511struct gdbarch_swap
2512{
2513 void *swap;
2514 struct gdbarch_swap_registration *source;
2515 struct gdbarch_swap *next;
2516};
2517
2518struct gdbarch_swap_registration
adf40b2e
JM
2519{
2520 void *data;
2521 unsigned long sizeof_data;
2522 gdbarch_swap_ftype *init;
2523 struct gdbarch_swap_registration *next;
2524};
0f71a2f6
JM
2525
2526struct gdbarch_swap_registrary
adf40b2e
JM
2527{
2528 int nr;
2529 struct gdbarch_swap_registration *registrations;
2530};
0f71a2f6 2531
adf40b2e 2532struct gdbarch_swap_registrary gdbarch_swap_registrary =
0f71a2f6
JM
2533{
2534 0, NULL,
2535};
2536
2537void
2538register_gdbarch_swap (data, sizeof_data, init)
2539 void *data;
2540 unsigned long sizeof_data;
2541 gdbarch_swap_ftype *init;
2542{
2543 struct gdbarch_swap_registration **rego;
2544 for (rego = &gdbarch_swap_registrary.registrations;
2545 (*rego) != NULL;
2546 rego = &(*rego)->next);
2547 (*rego) = XMALLOC (struct gdbarch_swap_registration);
2548 (*rego)->next = NULL;
2549 (*rego)->init = init;
2550 (*rego)->data = data;
2551 (*rego)->sizeof_data = sizeof_data;
2552}
2553
2554
2555static void init_gdbarch_swap PARAMS ((struct gdbarch *));
2556static void
2557init_gdbarch_swap (gdbarch)
2558 struct gdbarch *gdbarch;
2559{
2560 struct gdbarch_swap_registration *rego;
2561 struct gdbarch_swap **curr = &gdbarch->swap;
2562 for (rego = gdbarch_swap_registrary.registrations;
2563 rego != NULL;
2564 rego = rego->next)
2565 {
2566 if (rego->data != NULL)
2567 {
2568 (*curr) = XMALLOC (struct gdbarch_swap);
2569 (*curr)->source = rego;
2570 (*curr)->swap = xmalloc (rego->sizeof_data);
2571 (*curr)->next = NULL;
2572 memset (rego->data, 0, rego->sizeof_data);
2573 curr = &(*curr)->next;
2574 }
2575 if (rego->init != NULL)
2576 rego->init ();
2577 }
2578}
2579
2580static void swapout_gdbarch_swap PARAMS ((struct gdbarch *));
2581static void
2582swapout_gdbarch_swap (gdbarch)
2583 struct gdbarch *gdbarch;
2584{
2585 struct gdbarch_swap *curr;
2586 for (curr = gdbarch->swap;
2587 curr != NULL;
2588 curr = curr->next)
2589 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
2590}
2591
2592static void swapin_gdbarch_swap PARAMS ((struct gdbarch *));
2593static void
2594swapin_gdbarch_swap (gdbarch)
2595 struct gdbarch *gdbarch;
2596{
2597 struct gdbarch_swap *curr;
2598 for (curr = gdbarch->swap;
2599 curr != NULL;
2600 curr = curr->next)
2601 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
2602}
2603
2604
2605/* Keep a registrary of the architectures known by GDB. */
2606
2607struct gdbarch_init_registration
2608{
2609 enum bfd_architecture bfd_architecture;
2610 gdbarch_init_ftype *init;
2611 struct gdbarch_list *arches;
2612 struct gdbarch_init_registration *next;
2613};
2614
2615static struct gdbarch_init_registration *gdbarch_init_registrary = NULL;
2616
2617void
2618register_gdbarch_init (bfd_architecture, init)
2619 enum bfd_architecture bfd_architecture;
2620 gdbarch_init_ftype *init;
2621{
2622 struct gdbarch_init_registration **curr;
2623 const struct bfd_arch_info *bfd_arch_info;
2624 /* Check that BFD reconizes this architecture */
2625 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
2626 if (bfd_arch_info == NULL)
2627 {
2628 fatal ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture);
2629 }
2630 /* Check that we haven't seen this architecture before */
2631 for (curr = &gdbarch_init_registrary;
2632 (*curr) != NULL;
2633 curr = &(*curr)->next)
2634 {
2635 if (bfd_architecture == (*curr)->bfd_architecture)
2636 fatal ("gdbarch: Duplicate registraration of architecture (%s)",
2637 bfd_arch_info->printable_name);
2638 }
2639 /* log it */
2640 if (gdbarch_debug)
2641 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
2642 bfd_arch_info->printable_name,
2643 (long) init);
2644 /* Append it */
2645 (*curr) = XMALLOC (struct gdbarch_init_registration);
2646 (*curr)->bfd_architecture = bfd_architecture;
2647 (*curr)->init = init;
2648 (*curr)->arches = NULL;
2649 (*curr)->next = NULL;
2650}
adf40b2e 2651
0f71a2f6
JM
2652
2653
2654/* Look for an architecture using gdbarch_info. Base search on only
2655 BFD_ARCH_INFO and BYTE_ORDER. */
2656
2657struct gdbarch_list *
2658gdbarch_list_lookup_by_info (arches, info)
2659 struct gdbarch_list *arches;
2660 const struct gdbarch_info *info;
2661{
2662 for (; arches != NULL; arches = arches->next)
2663 {
2664 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
2665 continue;
2666 if (info->byte_order != arches->gdbarch->byte_order)
2667 continue;
2668 return arches;
2669 }
2670 return NULL;
2671}
2672
2673
2674/* Update the current architecture. Return ZERO if the update request
2675 failed. */
2676
2677int
2678gdbarch_update (info)
2679 struct gdbarch_info info;
2680{
2681 struct gdbarch *new_gdbarch;
2682 struct gdbarch_list **list;
2683 struct gdbarch_init_registration *rego;
2684
2685 /* Fill in any missing bits. Most important is the bfd_architecture
2686 which is used to select the target architecture. */
2687 if (info.bfd_architecture == bfd_arch_unknown)
2688 {
2689 if (info.bfd_arch_info != NULL)
2690 info.bfd_architecture = info.bfd_arch_info->arch;
2691 else if (info.abfd != NULL)
2692 info.bfd_architecture = bfd_get_arch (info.abfd);
2693 /* FIXME - should query BFD for its default architecture. */
2694 else
2695 info.bfd_architecture = current_gdbarch->bfd_arch_info->arch;
2696 }
2697 if (info.bfd_arch_info == NULL)
2698 {
2699 if (target_architecture_auto && info.abfd != NULL)
2700 info.bfd_arch_info = bfd_get_arch_info (info.abfd);
2701 else
2702 info.bfd_arch_info = current_gdbarch->bfd_arch_info;
2703 }
2704 if (info.byte_order == 0)
2705 {
2706 if (target_byte_order_auto && info.abfd != NULL)
2707 info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
2708 : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
2709 : 0);
2710 else
2711 info.byte_order = current_gdbarch->byte_order;
2712 /* FIXME - should query BFD for its default byte-order. */
2713 }
2714 /* A default for abfd? */
2715
2716 /* Find the target that knows about this architecture. */
2717 for (rego = gdbarch_init_registrary;
2718 rego != NULL && rego->bfd_architecture != info.bfd_architecture;
2719 rego = rego->next);
2720 if (rego == NULL)
2721 {
2722 if (gdbarch_debug)
2723 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n");
2724 return 0;
2725 }
2726
2727 if (gdbarch_debug)
2728 {
2729 fprintf_unfiltered (gdb_stdlog,
2730 "gdbarch_update: info.bfd_architecture %d (%s)\n",
2731 info.bfd_architecture,
adf40b2e 2732 bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
0f71a2f6
JM
2733 fprintf_unfiltered (gdb_stdlog,
2734 "gdbarch_update: info.bfd_arch_info %s\n",
2735 (info.bfd_arch_info != NULL
2736 ? info.bfd_arch_info->printable_name
2737 : "(null)"));
2738 fprintf_unfiltered (gdb_stdlog,
2739 "gdbarch_update: info.byte_order %d (%s)\n",
2740 info.byte_order,
2741 (info.byte_order == BIG_ENDIAN ? "big"
2742 : info.byte_order == LITTLE_ENDIAN ? "little"
2743 : "default"));
2744 fprintf_unfiltered (gdb_stdlog,
2745 "gdbarch_update: info.abfd 0x%lx\n",
2746 (long) info.abfd);
2747 fprintf_unfiltered (gdb_stdlog,
2748 "gdbarch_update: info.tdep_info 0x%lx\n",
2749 (long) info.tdep_info);
2750 }
2751
2752 /* Ask the target for a replacement architecture. */
2753 new_gdbarch = rego->init (info, rego->arches);
2754
2755 /* Did the target like it? No. Reject the change. */
2756 if (new_gdbarch == NULL)
2757 {
2758 if (gdbarch_debug)
2759 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n");
2760 return 0;
2761 }
2762
2763 /* Did the architecture change? No. Do nothing. */
2764 if (current_gdbarch == new_gdbarch)
2765 {
2766 if (gdbarch_debug)
2767 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n",
2768 (long) new_gdbarch,
2769 new_gdbarch->bfd_arch_info->printable_name);
2770 return 1;
2771 }
2772
2773 /* Swap all data belonging to the old target out */
2774 swapout_gdbarch_swap (current_gdbarch);
2775
2776 /* Is this a pre-existing architecture? Yes. Swap it in. */
2777 for (list = &rego->arches;
2778 (*list) != NULL;
2779 list = &(*list)->next)
2780 {
2781 if ((*list)->gdbarch == new_gdbarch)
2782 {
2783 if (gdbarch_debug)
2784 fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
2785 (long) new_gdbarch,
2786 new_gdbarch->bfd_arch_info->printable_name);
2787 current_gdbarch = new_gdbarch;
2788 swapin_gdbarch_swap (new_gdbarch);
2789 return 1;
2790 }
2791 }
adf40b2e 2792
0f71a2f6
JM
2793 /* Append this new architecture to this targets list. */
2794 (*list) = XMALLOC (struct gdbarch_list);
2795 (*list)->next = NULL;
2796 (*list)->gdbarch = new_gdbarch;
2797
2798 /* Switch to this new architecture. Dump it out. */
2799 current_gdbarch = new_gdbarch;
2800 if (gdbarch_debug)
2801 {
2802 fprintf_unfiltered (gdb_stdlog,
adf40b2e 2803 "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
0f71a2f6
JM
2804 (long) new_gdbarch,
2805 new_gdbarch->bfd_arch_info->printable_name);
2806 gdbarch_dump ();
2807 }
adf40b2e 2808
0f71a2f6
JM
2809 /* Check that the newly installed architecture is valid. */
2810 verify_gdbarch (new_gdbarch);
2811
2812 /* Initialize the per-architecture memory (swap) areas.
2813 CURRENT_GDBARCH must be update before these modules are
2814 called. */
2815 init_gdbarch_swap (new_gdbarch);
adf40b2e 2816
0f71a2f6
JM
2817 /* Initialize the per-architecture data-pointer of all parties that
2818 registered an interest in this architecture. CURRENT_GDBARCH
2819 must be updated before these modules are called. */
2820 init_gdbarch_data (new_gdbarch);
adf40b2e 2821
0f71a2f6
JM
2822 return 1;
2823}
c906108c 2824
c906108c
SS
2825
2826
2827/* Functions to manipulate the endianness of the target. */
2828
2829#ifdef TARGET_BYTE_ORDER_SELECTABLE
2830/* compat - Catch old targets that expect a selectable byte-order to
2831 default to BIG_ENDIAN */
2832#ifndef TARGET_BYTE_ORDER_DEFAULT
2833#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
2834#endif
2835#endif
7a292a7a 2836#if !TARGET_BYTE_ORDER_SELECTABLE_P
c906108c
SS
2837#ifndef TARGET_BYTE_ORDER_DEFAULT
2838/* compat - Catch old non byte-order selectable targets that do not
2839 define TARGET_BYTE_ORDER_DEFAULT and instead expect
2840 TARGET_BYTE_ORDER to be used as the default. For targets that
2841 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
2842 below will get a strange compiler warning. */
2843#define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
2844#endif
7a292a7a
SS
2845#endif
2846#ifndef TARGET_BYTE_ORDER_DEFAULT
adf40b2e 2847#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
7a292a7a 2848#endif
c906108c
SS
2849int target_byte_order = TARGET_BYTE_ORDER_DEFAULT;
2850int target_byte_order_auto = 1;
2851
2852/* Chain containing the \"set endian\" commands. */
2853static struct cmd_list_element *endianlist = NULL;
2854
2855/* Called by ``show endian''. */
2856static void show_endian PARAMS ((char *, int));
2857static void
2858show_endian (args, from_tty)
2859 char *args;
2860 int from_tty;
2861{
2862 char *msg =
adf40b2e
JM
2863 (TARGET_BYTE_ORDER_AUTO
2864 ? "The target endianness is set automatically (currently %s endian)\n"
2865 : "The target is assumed to be %s endian\n");
c906108c
SS
2866 printf_unfiltered (msg, (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"));
2867}
2868
2869/* Called if the user enters ``set endian'' without an argument. */
2870static void set_endian PARAMS ((char *, int));
2871static void
2872set_endian (args, from_tty)
2873 char *args;
2874 int from_tty;
2875{
2876 printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n");
2877 show_endian (args, from_tty);
2878}
2879
2880/* Called by ``set endian big''. */
2881static void set_endian_big PARAMS ((char *, int));
2882static void
2883set_endian_big (args, from_tty)
2884 char *args;
2885 int from_tty;
2886{
2887 if (TARGET_BYTE_ORDER_SELECTABLE_P)
2888 {
2889 target_byte_order = BIG_ENDIAN;
2890 target_byte_order_auto = 0;
0f71a2f6
JM
2891 if (GDB_MULTI_ARCH)
2892 {
2893 struct gdbarch_info info;
2894 memset (&info, 0, sizeof info);
2895 info.byte_order = BIG_ENDIAN;
2896 gdbarch_update (info);
2897 }
c906108c
SS
2898 }
2899 else
2900 {
2901 printf_unfiltered ("Byte order is not selectable.");
2902 show_endian (args, from_tty);
2903 }
2904}
2905
2906/* Called by ``set endian little''. */
2907static void set_endian_little PARAMS ((char *, int));
2908static void
2909set_endian_little (args, from_tty)
2910 char *args;
2911 int from_tty;
2912{
2913 if (TARGET_BYTE_ORDER_SELECTABLE_P)
2914 {
2915 target_byte_order = LITTLE_ENDIAN;
2916 target_byte_order_auto = 0;
0f71a2f6
JM
2917 if (GDB_MULTI_ARCH)
2918 {
2919 struct gdbarch_info info;
2920 memset (&info, 0, sizeof info);
2921 info.byte_order = LITTLE_ENDIAN;
2922 gdbarch_update (info);
2923 }
c906108c
SS
2924 }
2925 else
2926 {
2927 printf_unfiltered ("Byte order is not selectable.");
2928 show_endian (args, from_tty);
2929 }
2930}
2931
2932/* Called by ``set endian auto''. */
2933static void set_endian_auto PARAMS ((char *, int));
2934static void
2935set_endian_auto (args, from_tty)
2936 char *args;
2937 int from_tty;
2938{
2939 if (TARGET_BYTE_ORDER_SELECTABLE_P)
2940 {
2941 target_byte_order_auto = 1;
2942 }
2943 else
2944 {
2945 printf_unfiltered ("Byte order is not selectable.");
2946 show_endian (args, from_tty);
2947 }
2948}
2949
2950/* Set the endianness from a BFD. */
2951static void set_endian_from_file PARAMS ((bfd *));
2952static void
2953set_endian_from_file (abfd)
2954 bfd *abfd;
2955{
2956 if (TARGET_BYTE_ORDER_SELECTABLE_P)
2957 {
2958 int want;
adf40b2e 2959
c906108c
SS
2960 if (bfd_big_endian (abfd))
2961 want = BIG_ENDIAN;
2962 else
2963 want = LITTLE_ENDIAN;
2964 if (TARGET_BYTE_ORDER_AUTO)
2965 target_byte_order = want;
2966 else if (TARGET_BYTE_ORDER != want)
2967 warning ("%s endian file does not match %s endian target.",
2968 want == BIG_ENDIAN ? "big" : "little",
2969 TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
2970 }
2971 else
2972 {
2973 if (bfd_big_endian (abfd)
2974 ? TARGET_BYTE_ORDER != BIG_ENDIAN
2975 : TARGET_BYTE_ORDER == BIG_ENDIAN)
2976 warning ("%s endian file does not match %s endian target.",
2977 bfd_big_endian (abfd) ? "big" : "little",
2978 TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
2979 }
2980}
2981
2982
2983
2984/* Functions to manipulate the architecture of the target */
2985
2986int target_architecture_auto = 1;
2987extern const struct bfd_arch_info bfd_default_arch_struct;
2988const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct;
adf40b2e 2989int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *ap));
c906108c
SS
2990
2991/* Do the real work of changing the current architecture */
b83266a0 2992
adf40b2e 2993static int arch_ok PARAMS ((const struct bfd_arch_info *arch));
b83266a0
SS
2994static int
2995arch_ok (arch)
2996 const struct bfd_arch_info *arch;
2997{
2998 /* Should be performing the more basic check that the binary is
2999 compatible with GDB. */
3000 /* Check with the target that the architecture is valid. */
3001 return (target_architecture_hook == NULL
3002 || target_architecture_hook (arch));
3003}
3004
adf40b2e 3005enum set_arch { set_arch_auto, set_arch_manual };
b83266a0 3006
adf40b2e 3007static void set_arch PARAMS ((const struct bfd_arch_info *arch, enum set_arch type));
c906108c 3008static void
7a292a7a 3009set_arch (arch, type)
c906108c 3010 const struct bfd_arch_info *arch;
7a292a7a 3011 enum set_arch type;
c906108c 3012{
7a292a7a 3013 switch (type)
c906108c 3014 {
7a292a7a 3015 case set_arch_auto:
b83266a0 3016 if (!arch_ok (arch))
7a292a7a
SS
3017 warning ("Target may not support %s architecture",
3018 arch->printable_name);
c906108c 3019 target_architecture = arch;
7a292a7a
SS
3020 break;
3021 case set_arch_manual:
b83266a0 3022 if (!arch_ok (arch))
7a292a7a
SS
3023 {
3024 printf_unfiltered ("Target does not support `%s' architecture.\n",
3025 arch->printable_name);
3026 }
3027 else
3028 {
3029 target_architecture_auto = 0;
3030 target_architecture = arch;
3031 }
3032 break;
c906108c 3033 }
0f71a2f6
JM
3034 if (gdbarch_debug)
3035 gdbarch_dump ();
c906108c
SS
3036}
3037
3038/* Called if the user enters ``show architecture'' without an argument. */
3039static void show_architecture PARAMS ((char *, int));
3040static void
3041show_architecture (args, from_tty)
3042 char *args;
3043 int from_tty;
3044{
3045 const char *arch;
3046 arch = TARGET_ARCHITECTURE->printable_name;
3047 if (target_architecture_auto)
3048 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch);
3049 else
3050 printf_filtered ("The target architecture is assumed to be %s\n", arch);
3051}
3052
3053/* Called if the user enters ``set architecture'' with or without an
3054 argument. */
3055static void set_architecture PARAMS ((char *, int));
3056static void
3057set_architecture (args, from_tty)
3058 char *args;
3059 int from_tty;
3060{
3061 if (args == NULL)
3062 {
3063 printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n");
3064 }
3065 else if (strcmp (args, "auto") == 0)
3066 {
3067 target_architecture_auto = 1;
3068 }
0f71a2f6
JM
3069 else if (GDB_MULTI_ARCH)
3070 {
3071 const struct bfd_arch_info *arch = bfd_scan_arch (args);
3072 if (arch == NULL)
3073 printf_unfiltered ("Architecture `%s' not reconized.\n", args);
3074 else
3075 {
3076 struct gdbarch_info info;
3077 memset (&info, 0, sizeof info);
3078 info.bfd_arch_info = arch;
3079 if (gdbarch_update (info))
3080 target_architecture_auto = 0;
3081 else
3082 printf_unfiltered ("Architecture `%s' not reconized.\n", args);
3083 }
3084 }
c906108c
SS
3085 else
3086 {
3087 const struct bfd_arch_info *arch = bfd_scan_arch (args);
3088 if (arch != NULL)
7a292a7a 3089 set_arch (arch, set_arch_manual);
c906108c
SS
3090 else
3091 printf_unfiltered ("Architecture `%s' not reconized.\n", args);
3092 }
3093}
3094
3095/* Called if the user enters ``info architecture'' without an argument. */
3096static void info_architecture PARAMS ((char *, int));
3097static void
3098info_architecture (args, from_tty)
3099 char *args;
3100 int from_tty;
3101{
3102 enum bfd_architecture a;
0f71a2f6
JM
3103 if (GDB_MULTI_ARCH)
3104 {
3105 if (gdbarch_init_registrary != NULL)
3106 {
3107 struct gdbarch_init_registration *rego;
3108 printf_filtered ("Available architectures are:\n");
3109 for (rego = gdbarch_init_registrary;
3110 rego != NULL;
3111 rego = rego->next)
3112 {
3113 const struct bfd_arch_info *ap;
3114 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3115 if (ap != NULL)
3116 {
3117 do
3118 {
3119 printf_filtered (" %s", ap->printable_name);
3120 ap = ap->next;
3121 }
3122 while (ap != NULL);
3123 printf_filtered ("\n");
3124 }
3125 }
3126 }
3127 else
3128 {
3129 printf_filtered ("There are no available architectures.\n");
3130 }
3131 return;
3132 }
c906108c
SS
3133 printf_filtered ("Available architectures are:\n");
3134 for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++)
3135 {
3136 const struct bfd_arch_info *ap = bfd_lookup_arch (a, 0);
3137 if (ap != NULL)
3138 {
3139 do
3140 {
3141 printf_filtered (" %s", ap->printable_name);
3142 ap = ap->next;
3143 }
3144 while (ap != NULL);
3145 printf_filtered ("\n");
3146 }
3147 }
3148}
3149
3150/* Set the architecture from arch/machine */
3151void
3152set_architecture_from_arch_mach (arch, mach)
3153 enum bfd_architecture arch;
3154 unsigned long mach;
3155{
3156 const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach);
3157 if (wanted != NULL)
7a292a7a 3158 set_arch (wanted, set_arch_manual);
c906108c 3159 else
0f71a2f6 3160 fatal ("gdbarch: hardwired architecture/machine not reconized");
c906108c
SS
3161}
3162
3163/* Set the architecture from a BFD */
3164static void set_architecture_from_file PARAMS ((bfd *));
3165static void
3166set_architecture_from_file (abfd)
3167 bfd *abfd;
3168{
3169 const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd);
3170 if (target_architecture_auto)
3171 {
7a292a7a 3172 set_arch (wanted, set_arch_auto);
c906108c
SS
3173 }
3174 else if (wanted != target_architecture)
3175 {
3176 warning ("%s architecture file may be incompatible with %s target.",
3177 wanted->printable_name,
3178 target_architecture->printable_name);
3179 }
3180}
3181
3182
cce74817
JM
3183/* Misc helper functions for targets. */
3184
3185int
3186frame_num_args_unknown (fi)
3187 struct frame_info *fi;
3188{
3189 return -1;
3190}
3191
c906108c 3192
0f71a2f6
JM
3193int
3194generic_register_convertible_not (num)
3195 int num;
3196{
3197 return 0;
3198}
adf40b2e 3199
c906108c
SS
3200/* Disassembler */
3201
3202/* Pointer to the target-dependent disassembly function. */
3203int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info *));
3204disassemble_info tm_print_insn_info;
3205
3206
3207
3208/* Set the dynamic target-system-dependant parameters (architecture,
3209 byte-order) using information found in the BFD */
3210
3211void
3212set_gdbarch_from_file (abfd)
3213 bfd *abfd;
3214{
0f71a2f6
JM
3215 if (GDB_MULTI_ARCH)
3216 {
3217 struct gdbarch_info info;
3218 memset (&info, 0, sizeof info);
3219 info.abfd = abfd;
3220 gdbarch_update (info);
3221 return;
3222 }
c906108c
SS
3223 set_architecture_from_file (abfd);
3224 set_endian_from_file (abfd);
3225}
3226
3227
7a292a7a
SS
3228#if defined (CALL_DUMMY)
3229/* FIXME - this should go away */
3230LONGEST call_dummy_words[] = CALL_DUMMY;
3231int sizeof_call_dummy_words = sizeof (call_dummy_words);
3232#endif
3233
3234
c906108c
SS
3235extern void _initialize_gdbarch PARAMS ((void));
3236void
3237_initialize_gdbarch ()
3238{
3239 add_prefix_cmd ("endian", class_support, set_endian,
3240 "Set endianness of target.",
3241 &endianlist, "set endian ", 0, &setlist);
3242 add_cmd ("big", class_support, set_endian_big,
3243 "Set target as being big endian.", &endianlist);
3244 add_cmd ("little", class_support, set_endian_little,
3245 "Set target as being little endian.", &endianlist);
3246 add_cmd ("auto", class_support, set_endian_auto,
3247 "Select target endianness automatically.", &endianlist);
3248 add_cmd ("endian", class_support, show_endian,
3249 "Show endianness of target.", &showlist);
3250
3251 add_cmd ("architecture", class_support, set_architecture,
3252 "Set architecture of target.", &setlist);
3253 add_alias_cmd ("processor", "architecture", class_support, 1, &setlist);
3254 add_cmd ("architecture", class_support, show_architecture,
3255 "Show architecture of target.", &showlist);
3256 add_cmd ("architecture", class_support, info_architecture,
3257 "List supported target architectures", &infolist);
3258
adf40b2e 3259 INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
c906108c
SS
3260 tm_print_insn_info.flavour = bfd_target_unknown_flavour;
3261 tm_print_insn_info.read_memory_func = dis_asm_read_memory;
3262 tm_print_insn_info.memory_error_func = dis_asm_memory_error;
3263 tm_print_insn_info.print_address_func = dis_asm_print_address;
3264
c906108c
SS
3265 add_show_from_set (add_set_cmd ("archdebug",
3266 class_maintenance,
3267 var_zinteger,
adf40b2e 3268 (char *)&gdbarch_debug,
c906108c
SS
3269 "Set architecture debugging.\n\
3270When non-zero, architecture debugging is enabled.", &setlist),
3271 &showlist);
c906108c 3272}
This page took 0.205567 seconds and 4 git commands to generate.