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