2003-05-15 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
CommitLineData
59233f88
AC
1/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
adf40b2e 3/* Dynamic architecture support for GDB, the GNU debugger.
1e698235 4 Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
c906108c 5
c5aa993b 6 This file is part of GDB.
c906108c 7
c5aa993b
JM
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
c906108c 12
c5aa993b
JM
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
c906108c 17
c5aa993b
JM
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
c906108c 22
104c1213
JM
23/* This file was created with the aid of ``gdbarch.sh''.
24
52204a0b 25 The Bourne shell script ``gdbarch.sh'' creates the files
104c1213
JM
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
52204a0b 31 changes into that script. Conversely, when making sweeping changes
104c1213
JM
32 to this file, modifying gdbarch.sh and using its output may prove
33 easier. */
adf40b2e 34
c906108c
SS
35#ifndef GDBARCH_H
36#define GDBARCH_H
37
2bf0cb65 38#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
fd0407d6 39#if !GDB_MULTI_ARCH
67a2b77e 40/* Pull in function declarations refered to, indirectly, via macros. */
67a2b77e 41#include "inferior.h" /* For unsigned_address_to_pointer(). */
e9a2674e 42#include "symfile.h" /* For entry_point_address(). */
fd0407d6 43#endif
2bf0cb65 44
da3331ec
AC
45struct floatformat;
46struct ui_file;
cce74817
JM
47struct frame_info;
48struct value;
b6af0555 49struct objfile;
a2cf933a 50struct minimal_symbol;
049ee0e4 51struct regcache;
b59ff9d5 52struct reggroup;
0f71a2f6 53
0f71a2f6
JM
54extern struct gdbarch *current_gdbarch;
55
56
0f71a2f6
JM
57/* If any of the following are defined, the target wasn't correctly
58 converted. */
59
83905903
AC
60#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
61#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
62#endif
63
0f71a2f6
JM
64
65/* The following are pre-initialized by GDBARCH. */
66
104c1213 67extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
0f71a2f6 68/* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
83905903
AC
69#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE)
70#error "Non multi-arch definition of TARGET_ARCHITECTURE"
71#endif
0f71a2f6 72#if GDB_MULTI_ARCH
6166d547 73#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE)
0f71a2f6
JM
74#define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch))
75#endif
76#endif
77
104c1213 78extern int gdbarch_byte_order (struct gdbarch *gdbarch);
0f71a2f6 79/* set_gdbarch_byte_order() - not applicable - pre-initialized. */
83905903
AC
80#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER)
81#error "Non multi-arch definition of TARGET_BYTE_ORDER"
82#endif
0f71a2f6 83#if GDB_MULTI_ARCH
6166d547 84#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER)
0f71a2f6
JM
85#define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch))
86#endif
87#endif
88
4be87837
DJ
89extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
90/* set_gdbarch_osabi() - not applicable - pre-initialized. */
91#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_OSABI)
92#error "Non multi-arch definition of TARGET_OSABI"
93#endif
94#if GDB_MULTI_ARCH
95#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_OSABI)
96#define TARGET_OSABI (gdbarch_osabi (current_gdbarch))
97#endif
98#endif
99
0f71a2f6 100
99e7bb18 101/* The following are initialized by the target dependent code. */
0f71a2f6 102
66b43ecb
AC
103/* Number of bits in a char or unsigned char for the target machine.
104 Just like CHAR_BIT in <limits.h> but describes the target machine.
e669114a 105 v:2:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
66b43ecb
AC
106
107 Number of bits in a short or unsigned short for the target machine. */
c4093a6a 108
66b43ecb
AC
109/* Default (value) for non- multi-arch platforms. */
110#if (!GDB_MULTI_ARCH) && !defined (TARGET_SHORT_BIT)
111#define TARGET_SHORT_BIT (2*TARGET_CHAR_BIT)
0f71a2f6
JM
112#endif
113
104c1213
JM
114extern int gdbarch_short_bit (struct gdbarch *gdbarch);
115extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
83905903
AC
116#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT)
117#error "Non multi-arch definition of TARGET_SHORT_BIT"
118#endif
0f71a2f6 119#if GDB_MULTI_ARCH
6166d547 120#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT)
0f71a2f6
JM
121#define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
122#endif
123#endif
124
66b43ecb
AC
125/* Number of bits in an int or unsigned int for the target machine. */
126
127/* Default (value) for non- multi-arch platforms. */
128#if (!GDB_MULTI_ARCH) && !defined (TARGET_INT_BIT)
129#define TARGET_INT_BIT (4*TARGET_CHAR_BIT)
130#endif
131
104c1213
JM
132extern int gdbarch_int_bit (struct gdbarch *gdbarch);
133extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
83905903
AC
134#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT)
135#error "Non multi-arch definition of TARGET_INT_BIT"
136#endif
0f71a2f6 137#if GDB_MULTI_ARCH
6166d547 138#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT)
0f71a2f6
JM
139#define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
140#endif
141#endif
142
66b43ecb
AC
143/* Number of bits in a long or unsigned long for the target machine. */
144
145/* Default (value) for non- multi-arch platforms. */
146#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_BIT)
147#define TARGET_LONG_BIT (4*TARGET_CHAR_BIT)
148#endif
149
104c1213
JM
150extern int gdbarch_long_bit (struct gdbarch *gdbarch);
151extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
83905903
AC
152#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT)
153#error "Non multi-arch definition of TARGET_LONG_BIT"
154#endif
0f71a2f6 155#if GDB_MULTI_ARCH
6166d547 156#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT)
0f71a2f6
JM
157#define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
158#endif
159#endif
160
66b43ecb
AC
161/* Number of bits in a long long or unsigned long long for the target
162 machine. */
163
164/* Default (value) for non- multi-arch platforms. */
165#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_LONG_BIT)
166#define TARGET_LONG_LONG_BIT (2*TARGET_LONG_BIT)
167#endif
168
104c1213
JM
169extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
170extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
83905903
AC
171#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT)
172#error "Non multi-arch definition of TARGET_LONG_LONG_BIT"
173#endif
0f71a2f6 174#if GDB_MULTI_ARCH
6166d547 175#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT)
0f71a2f6
JM
176#define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
177#endif
178#endif
179
66b43ecb
AC
180/* Number of bits in a float for the target machine. */
181
182/* Default (value) for non- multi-arch platforms. */
183#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_BIT)
184#define TARGET_FLOAT_BIT (4*TARGET_CHAR_BIT)
185#endif
186
104c1213
JM
187extern int gdbarch_float_bit (struct gdbarch *gdbarch);
188extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
83905903
AC
189#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT)
190#error "Non multi-arch definition of TARGET_FLOAT_BIT"
191#endif
0f71a2f6 192#if GDB_MULTI_ARCH
6166d547 193#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT)
0f71a2f6
JM
194#define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
195#endif
196#endif
197
66b43ecb
AC
198/* Number of bits in a double for the target machine. */
199
200/* Default (value) for non- multi-arch platforms. */
201#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_BIT)
202#define TARGET_DOUBLE_BIT (8*TARGET_CHAR_BIT)
203#endif
204
104c1213
JM
205extern int gdbarch_double_bit (struct gdbarch *gdbarch);
206extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
83905903
AC
207#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT)
208#error "Non multi-arch definition of TARGET_DOUBLE_BIT"
209#endif
0f71a2f6 210#if GDB_MULTI_ARCH
6166d547 211#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT)
0f71a2f6
JM
212#define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
213#endif
214#endif
215
66b43ecb
AC
216/* Number of bits in a long double for the target machine. */
217
218/* Default (value) for non- multi-arch platforms. */
219#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_BIT)
17ef5d92 220#define TARGET_LONG_DOUBLE_BIT (8*TARGET_CHAR_BIT)
66b43ecb
AC
221#endif
222
104c1213
JM
223extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
224extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
83905903
AC
225#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT)
226#error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT"
227#endif
0f71a2f6 228#if GDB_MULTI_ARCH
6166d547 229#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT)
0f71a2f6
JM
230#define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
231#endif
232#endif
233
52204a0b
DT
234/* For most targets, a pointer on the target and its representation as an
235 address in GDB have the same size and "look the same". For such a
236 target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
237 / addr_bit will be set from it.
238
239 If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
240 also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
241
242 ptr_bit is the size of a pointer on the target */
66b43ecb
AC
243
244/* Default (value) for non- multi-arch platforms. */
245#if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT)
246#define TARGET_PTR_BIT (TARGET_INT_BIT)
247#endif
248
249extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
250extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
83905903
AC
251#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT)
252#error "Non multi-arch definition of TARGET_PTR_BIT"
253#endif
66b43ecb
AC
254#if GDB_MULTI_ARCH
255#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT)
256#define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
257#endif
258#endif
259
52204a0b
DT
260/* addr_bit is the size of a target address as represented in gdb */
261
262/* Default (value) for non- multi-arch platforms. */
263#if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT)
264#define TARGET_ADDR_BIT (TARGET_PTR_BIT)
265#endif
266
267extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
268extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
83905903
AC
269#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT)
270#error "Non multi-arch definition of TARGET_ADDR_BIT"
271#endif
52204a0b
DT
272#if GDB_MULTI_ARCH
273#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT)
274#define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
275#endif
276#endif
277
66b43ecb
AC
278/* Number of bits in a BFD_VMA for the target object file format. */
279
280/* Default (value) for non- multi-arch platforms. */
281#if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT)
282#define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address)
283#endif
284
285extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch);
286extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
83905903
AC
287#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT)
288#error "Non multi-arch definition of TARGET_BFD_VMA_BIT"
289#endif
66b43ecb
AC
290#if GDB_MULTI_ARCH
291#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT)
292#define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch))
293#endif
294#endif
295
4e409299
JB
296/* One if `char' acts like `signed char', zero if `unsigned char'. */
297
298/* Default (value) for non- multi-arch platforms. */
299#if (!GDB_MULTI_ARCH) && !defined (TARGET_CHAR_SIGNED)
300#define TARGET_CHAR_SIGNED (1)
301#endif
302
303extern int gdbarch_char_signed (struct gdbarch *gdbarch);
304extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
305#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED)
306#error "Non multi-arch definition of TARGET_CHAR_SIGNED"
307#endif
308#if GDB_MULTI_ARCH
309#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_CHAR_SIGNED)
310#define TARGET_CHAR_SIGNED (gdbarch_char_signed (current_gdbarch))
311#endif
312#endif
313
be8dfb87
AC
314/* Default (function) for non- multi-arch platforms. */
315#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
39f77062 316#define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid))
be8dfb87
AC
317#endif
318
39f77062
KB
319typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid);
320extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid);
104c1213 321extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
83905903
AC
322#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC)
323#error "Non multi-arch definition of TARGET_READ_PC"
324#endif
0f71a2f6 325#if GDB_MULTI_ARCH
6166d547 326#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC)
39f77062 327#define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid))
0f71a2f6
JM
328#endif
329#endif
330
be8dfb87
AC
331/* Default (function) for non- multi-arch platforms. */
332#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC)
39f77062 333#define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid))
be8dfb87
AC
334#endif
335
39f77062
KB
336typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid);
337extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid);
104c1213 338extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
83905903
AC
339#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC)
340#error "Non multi-arch definition of TARGET_WRITE_PC"
341#endif
0f71a2f6 342#if GDB_MULTI_ARCH
6166d547 343#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC)
39f77062 344#define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid))
0f71a2f6
JM
345#endif
346#endif
347
0ba6dca9
AC
348/* This is simply not needed. See value_of_builtin_frame_fp_reg and
349 call_function_by_hand. */
350
351#if defined (DEPRECATED_TARGET_READ_FP)
352/* Legacy for systems yet to multi-arch DEPRECATED_TARGET_READ_FP */
353#if !defined (DEPRECATED_TARGET_READ_FP_P)
354#define DEPRECATED_TARGET_READ_FP_P() (1)
355#endif
356#endif
357
358/* Default predicate for non- multi-arch targets. */
359#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP_P)
360#define DEPRECATED_TARGET_READ_FP_P() (0)
361#endif
362
363extern int gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch);
364#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP_P)
365#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP"
366#endif
367#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP_P)
368#define DEPRECATED_TARGET_READ_FP_P() (gdbarch_deprecated_target_read_fp_p (current_gdbarch))
369#endif
370
be8dfb87 371/* Default (function) for non- multi-arch platforms. */
0ba6dca9
AC
372#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP)
373#define DEPRECATED_TARGET_READ_FP() (internal_error (__FILE__, __LINE__, "DEPRECATED_TARGET_READ_FP"), 0)
be8dfb87
AC
374#endif
375
0ba6dca9
AC
376typedef CORE_ADDR (gdbarch_deprecated_target_read_fp_ftype) (void);
377extern CORE_ADDR gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch);
378extern void set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp);
379#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP)
380#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP"
83905903 381#endif
0f71a2f6 382#if GDB_MULTI_ARCH
0ba6dca9
AC
383#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP)
384#define DEPRECATED_TARGET_READ_FP() (gdbarch_deprecated_target_read_fp (current_gdbarch))
0f71a2f6
JM
385#endif
386#endif
387
be8dfb87
AC
388/* Default (function) for non- multi-arch platforms. */
389#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
390#define TARGET_READ_SP() (generic_target_read_sp ())
391#endif
392
104c1213
JM
393typedef CORE_ADDR (gdbarch_read_sp_ftype) (void);
394extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch);
395extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp);
83905903
AC
396#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP)
397#error "Non multi-arch definition of TARGET_READ_SP"
398#endif
0f71a2f6 399#if GDB_MULTI_ARCH
6166d547 400#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP)
0f71a2f6
JM
401#define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch))
402#endif
403#endif
404
6c0e89ed
AC
405/* The dummy call frame SP should be set by push_dummy_call. */
406
407#if defined (DEPRECATED_DUMMY_WRITE_SP)
408/* Legacy for systems yet to multi-arch DEPRECATED_DUMMY_WRITE_SP */
409#if !defined (DEPRECATED_DUMMY_WRITE_SP_P)
410#define DEPRECATED_DUMMY_WRITE_SP_P() (1)
411#endif
412#endif
413
414/* Default predicate for non- multi-arch targets. */
415#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP_P)
416#define DEPRECATED_DUMMY_WRITE_SP_P() (0)
417#endif
418
419extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch);
420#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P)
421#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP"
422#endif
423#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP_P)
424#define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch))
425#endif
426
be8dfb87 427/* Default (function) for non- multi-arch platforms. */
6c0e89ed
AC
428#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP)
429#define DEPRECATED_DUMMY_WRITE_SP(val) (internal_error (__FILE__, __LINE__, "DEPRECATED_DUMMY_WRITE_SP"), 0)
be8dfb87
AC
430#endif
431
6c0e89ed
AC
432typedef void (gdbarch_deprecated_dummy_write_sp_ftype) (CORE_ADDR val);
433extern void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val);
434extern void set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp);
435#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP)
436#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP"
83905903 437#endif
0f71a2f6 438#if GDB_MULTI_ARCH
6c0e89ed
AC
439#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP)
440#define DEPRECATED_DUMMY_WRITE_SP(val) (gdbarch_deprecated_dummy_write_sp (current_gdbarch, val))
0f71a2f6
JM
441#endif
442#endif
443
39d4ef09
AC
444/* Function for getting target's idea of a frame pointer. FIXME: GDB's
445 whole scheme for dealing with "frames" and "frame pointers" needs a
446 serious shakedown. */
447
448/* Default (function) for non- multi-arch platforms. */
449#if (!GDB_MULTI_ARCH) && !defined (TARGET_VIRTUAL_FRAME_POINTER)
450#define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (legacy_virtual_frame_pointer (pc, frame_regnum, frame_offset))
451#endif
452
453typedef void (gdbarch_virtual_frame_pointer_ftype) (CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
454extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
455extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);
456#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_VIRTUAL_FRAME_POINTER)
457#error "Non multi-arch definition of TARGET_VIRTUAL_FRAME_POINTER"
458#endif
459#if GDB_MULTI_ARCH
460#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_VIRTUAL_FRAME_POINTER)
461#define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (gdbarch_virtual_frame_pointer (current_gdbarch, pc, frame_regnum, frame_offset))
462#endif
463#endif
464
d8124050 465extern int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch);
61a0eb5b 466
d8124050
AC
467typedef void (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf);
468extern void gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf);
469extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read);
61a0eb5b 470
d8124050 471extern int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch);
61a0eb5b 472
d8124050
AC
473typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf);
474extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf);
475extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write);
61a0eb5b 476
104c1213
JM
477extern int gdbarch_num_regs (struct gdbarch *gdbarch);
478extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
83905903
AC
479#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS)
480#error "Non multi-arch definition of NUM_REGS"
481#endif
0f71a2f6 482#if GDB_MULTI_ARCH
6166d547 483#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS)
0f71a2f6
JM
484#define NUM_REGS (gdbarch_num_regs (current_gdbarch))
485#endif
486#endif
487
34620563
AC
488/* This macro gives the number of pseudo-registers that live in the
489 register namespace but do not get fetched or stored on the target.
490 These pseudo-registers may be aliases for other registers,
491 combinations of other registers, or they may be computed by GDB. */
492
0aba1244 493/* Default (value) for non- multi-arch platforms. */
6166d547 494#if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS)
0aba1244
EZ
495#define NUM_PSEUDO_REGS (0)
496#endif
497
498extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
499extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
83905903
AC
500#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS)
501#error "Non multi-arch definition of NUM_PSEUDO_REGS"
502#endif
0aba1244 503#if GDB_MULTI_ARCH
6166d547 504#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS)
0aba1244
EZ
505#define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch))
506#endif
507#endif
508
c2169756
AC
509/* GDB's standard (or well known) register numbers. These can map onto
510 a real register or a pseudo (computed) register or not be defined at
1200cd6e
AC
511 all (-1). */
512
513/* Default (value) for non- multi-arch platforms. */
514#if (!GDB_MULTI_ARCH) && !defined (SP_REGNUM)
515#define SP_REGNUM (-1)
516#endif
c2169756 517
104c1213
JM
518extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
519extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
83905903
AC
520#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
521#error "Non multi-arch definition of SP_REGNUM"
522#endif
0f71a2f6 523#if GDB_MULTI_ARCH
6166d547 524#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM)
0f71a2f6
JM
525#define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
526#endif
527#endif
528
0ba6dca9
AC
529/* This is simply not needed. See value_of_builtin_frame_fp_reg and
530 call_function_by_hand. */
531
1200cd6e 532/* Default (value) for non- multi-arch platforms. */
0ba6dca9
AC
533#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FP_REGNUM)
534#define DEPRECATED_FP_REGNUM (-1)
1200cd6e
AC
535#endif
536
0ba6dca9
AC
537extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
538extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
539#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FP_REGNUM)
540#error "Non multi-arch definition of DEPRECATED_FP_REGNUM"
83905903 541#endif
0f71a2f6 542#if GDB_MULTI_ARCH
0ba6dca9
AC
543#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FP_REGNUM)
544#define DEPRECATED_FP_REGNUM (gdbarch_deprecated_fp_regnum (current_gdbarch))
0f71a2f6
JM
545#endif
546#endif
547
1200cd6e
AC
548/* Default (value) for non- multi-arch platforms. */
549#if (!GDB_MULTI_ARCH) && !defined (PC_REGNUM)
550#define PC_REGNUM (-1)
551#endif
552
104c1213
JM
553extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
554extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
83905903
AC
555#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM)
556#error "Non multi-arch definition of PC_REGNUM"
557#endif
0f71a2f6 558#if GDB_MULTI_ARCH
6166d547 559#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM)
0f71a2f6
JM
560#define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
561#endif
562#endif
563
c2169756
AC
564/* Default (value) for non- multi-arch platforms. */
565#if (!GDB_MULTI_ARCH) && !defined (PS_REGNUM)
566#define PS_REGNUM (-1)
567#endif
568
569extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
570extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
571#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM)
572#error "Non multi-arch definition of PS_REGNUM"
573#endif
574#if GDB_MULTI_ARCH
575#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PS_REGNUM)
576#define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch))
577#endif
578#endif
579
60054393 580/* Default (value) for non- multi-arch platforms. */
6166d547 581#if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM)
60054393
MS
582#define FP0_REGNUM (-1)
583#endif
584
585extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
586extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
83905903
AC
587#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM)
588#error "Non multi-arch definition of FP0_REGNUM"
589#endif
60054393 590#if GDB_MULTI_ARCH
6166d547 591#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM)
60054393
MS
592#define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
593#endif
594#endif
595
03863182 596/* Default (value) for non- multi-arch platforms. */
6166d547 597#if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM)
03863182
AC
598#define NPC_REGNUM (-1)
599#endif
600
601extern int gdbarch_npc_regnum (struct gdbarch *gdbarch);
602extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum);
83905903
AC
603#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM)
604#error "Non multi-arch definition of NPC_REGNUM"
605#endif
03863182 606#if GDB_MULTI_ARCH
6166d547 607#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM)
03863182
AC
608#define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch))
609#endif
610#endif
611
88c72b7d
AC
612/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
613
614/* Default (function) for non- multi-arch platforms. */
615#if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM)
616#define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr))
617#endif
618
619typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
620extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
621extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
83905903
AC
622#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM)
623#error "Non multi-arch definition of STAB_REG_TO_REGNUM"
624#endif
88c72b7d
AC
625#if GDB_MULTI_ARCH
626#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM)
627#define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr))
628#endif
629#endif
630
631/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
632
633/* Default (function) for non- multi-arch platforms. */
634#if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM)
635#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr))
636#endif
637
638typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr);
639extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
640extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
83905903
AC
641#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM)
642#error "Non multi-arch definition of ECOFF_REG_TO_REGNUM"
643#endif
88c72b7d
AC
644#if GDB_MULTI_ARCH
645#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM)
646#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr))
647#endif
648#endif
649
650/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
651
652/* Default (function) for non- multi-arch platforms. */
653#if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM)
654#define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr))
655#endif
656
657typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr);
658extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
659extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
83905903
AC
660#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM)
661#error "Non multi-arch definition of DWARF_REG_TO_REGNUM"
662#endif
88c72b7d
AC
663#if GDB_MULTI_ARCH
664#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM)
665#define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr))
666#endif
667#endif
668
669/* Convert from an sdb register number to an internal gdb register number.
670 This should be defined in tm.h, if REGISTER_NAMES is not set up
671 to map one to one onto the sdb register numbers. */
672
673/* Default (function) for non- multi-arch platforms. */
674#if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM)
675#define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr))
676#endif
677
678typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr);
679extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
680extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
83905903
AC
681#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM)
682#error "Non multi-arch definition of SDB_REG_TO_REGNUM"
683#endif
88c72b7d
AC
684#if GDB_MULTI_ARCH
685#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM)
686#define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
687#endif
688#endif
689
690/* Default (function) for non- multi-arch platforms. */
691#if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM)
692#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr))
693#endif
694
695typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr);
696extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
697extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
83905903
AC
698#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM)
699#error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
700#endif
88c72b7d
AC
701#if GDB_MULTI_ARCH
702#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM)
703#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
704#endif
705#endif
706
33489c5b 707/* Default (function) for non- multi-arch platforms. */
6166d547 708#if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME)
33489c5b
AC
709#define REGISTER_NAME(regnr) (legacy_register_name (regnr))
710#endif
711
fa88f677
AC
712typedef const char * (gdbarch_register_name_ftype) (int regnr);
713extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
104c1213 714extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
83905903
AC
715#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME)
716#error "Non multi-arch definition of REGISTER_NAME"
717#endif
33489c5b 718#if GDB_MULTI_ARCH
6166d547 719#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME)
0f71a2f6
JM
720#define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
721#endif
33489c5b 722#endif
0f71a2f6 723
b1e29e33
AC
724extern int gdbarch_deprecated_register_size (struct gdbarch *gdbarch);
725extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int deprecated_register_size);
726#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_SIZE)
727#error "Non multi-arch definition of DEPRECATED_REGISTER_SIZE"
83905903 728#endif
b1e29e33
AC
729#if !defined (DEPRECATED_REGISTER_SIZE)
730#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch))
0f71a2f6 731#endif
0f71a2f6 732
104c1213
JM
733extern int gdbarch_register_bytes (struct gdbarch *gdbarch);
734extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes);
83905903
AC
735#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES)
736#error "Non multi-arch definition of REGISTER_BYTES"
737#endif
27d94c49 738#if !defined (REGISTER_BYTES)
0f71a2f6
JM
739#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
740#endif
0f71a2f6 741
46654a5b
AC
742/* NOTE: cagney/2002-05-02: This function with predicate has a valid
743 (callable) initial value. As a consequence, even when the predicate
744 is false, the corresponding function works. This simplifies the
745 migration process - old code, calling REGISTER_BYTE, doesn't need to
746 be modified. */
747
748#if defined (REGISTER_BYTE)
749/* Legacy for systems yet to multi-arch REGISTER_BYTE */
750#if !defined (REGISTER_BYTE_P)
751#define REGISTER_BYTE_P() (1)
752#endif
753#endif
754
755/* Default predicate for non- multi-arch targets. */
756#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE_P)
757#define REGISTER_BYTE_P() (0)
758#endif
759
760extern int gdbarch_register_byte_p (struct gdbarch *gdbarch);
761#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE_P)
762#error "Non multi-arch definition of REGISTER_BYTE"
763#endif
764#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE_P)
765#define REGISTER_BYTE_P() (gdbarch_register_byte_p (current_gdbarch))
766#endif
767
a7e3c2ad
AC
768/* Default (function) for non- multi-arch platforms. */
769#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE)
770#define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr))
771#endif
772
104c1213
JM
773typedef int (gdbarch_register_byte_ftype) (int reg_nr);
774extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr);
775extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte);
83905903
AC
776#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE)
777#error "Non multi-arch definition of REGISTER_BYTE"
778#endif
0f71a2f6 779#if GDB_MULTI_ARCH
6166d547 780#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE)
0f71a2f6
JM
781#define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr))
782#endif
783#endif
784
0c92afe8
AC
785/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
786 REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
35cac7cf 787
b2e75d78
AC
788/* Default (function) for non- multi-arch platforms. */
789#if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE)
790#define REGISTER_RAW_SIZE(reg_nr) (generic_register_size (reg_nr))
791#endif
792
104c1213
JM
793typedef int (gdbarch_register_raw_size_ftype) (int reg_nr);
794extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr);
795extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size);
83905903
AC
796#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE)
797#error "Non multi-arch definition of REGISTER_RAW_SIZE"
798#endif
0f71a2f6 799#if GDB_MULTI_ARCH
6166d547 800#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE)
0f71a2f6
JM
801#define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr))
802#endif
803#endif
804
d9d9c31f
AC
805/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
806 DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
807 MAX_REGISTER_SIZE (a constant). */
35cac7cf 808
a0ed5532
AC
809#if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
810/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */
811#if !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
812#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (1)
813#endif
814#endif
815
816/* Default predicate for non- multi-arch targets. */
817#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
818#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (0)
819#endif
820
821extern int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch);
822#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
823#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
824#endif
825#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
826#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_max_register_raw_size_p (current_gdbarch))
827#endif
828
829/* Default (value) for non- multi-arch platforms. */
830#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
831#define DEPRECATED_MAX_REGISTER_RAW_SIZE (0)
832#endif
833
834extern int gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch);
835extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, int deprecated_max_register_raw_size);
836#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
837#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
83905903 838#endif
0f71a2f6 839#if GDB_MULTI_ARCH
a0ed5532
AC
840#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
841#define DEPRECATED_MAX_REGISTER_RAW_SIZE (gdbarch_deprecated_max_register_raw_size (current_gdbarch))
0f71a2f6
JM
842#endif
843#endif
844
0c92afe8
AC
845/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
846 REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
35cac7cf 847
b2e75d78
AC
848/* Default (function) for non- multi-arch platforms. */
849#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE)
850#define REGISTER_VIRTUAL_SIZE(reg_nr) (generic_register_size (reg_nr))
851#endif
852
104c1213
JM
853typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr);
854extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr);
855extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size);
83905903
AC
856#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE)
857#error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE"
858#endif
0f71a2f6 859#if GDB_MULTI_ARCH
6166d547 860#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE)
0f71a2f6
JM
861#define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr))
862#endif
863#endif
864
d9d9c31f
AC
865/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
866 DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
867 MAX_REGISTER_SIZE (a constant). */
35cac7cf 868
a0ed5532
AC
869#if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
870/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */
871#if !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
872#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (1)
873#endif
874#endif
875
876/* Default predicate for non- multi-arch targets. */
877#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
878#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (0)
879#endif
880
881extern int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch);
882#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
883#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
884#endif
885#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
886#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_max_register_virtual_size_p (current_gdbarch))
887#endif
888
889/* Default (value) for non- multi-arch platforms. */
890#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
891#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (0)
892#endif
893
894extern int gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch);
895extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, int deprecated_max_register_virtual_size);
896#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
897#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
83905903 898#endif
0f71a2f6 899#if GDB_MULTI_ARCH
a0ed5532
AC
900#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
901#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (gdbarch_deprecated_max_register_virtual_size (current_gdbarch))
0f71a2f6
JM
902#endif
903#endif
904
0c92afe8
AC
905/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
906 REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
35cac7cf
AC
907
908#if defined (REGISTER_VIRTUAL_TYPE)
909/* Legacy for systems yet to multi-arch REGISTER_VIRTUAL_TYPE */
910#if !defined (REGISTER_VIRTUAL_TYPE_P)
911#define REGISTER_VIRTUAL_TYPE_P() (1)
912#endif
913#endif
914
915/* Default predicate for non- multi-arch targets. */
916#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE_P)
917#define REGISTER_VIRTUAL_TYPE_P() (0)
918#endif
919
920extern int gdbarch_register_virtual_type_p (struct gdbarch *gdbarch);
921#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE_P)
922#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE"
923#endif
924#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE_P)
925#define REGISTER_VIRTUAL_TYPE_P() (gdbarch_register_virtual_type_p (current_gdbarch))
926#endif
927
928/* Default (function) for non- multi-arch platforms. */
929#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE)
930#define REGISTER_VIRTUAL_TYPE(reg_nr) (internal_error (__FILE__, __LINE__, "REGISTER_VIRTUAL_TYPE"), 0)
931#endif
932
104c1213
JM
933typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr);
934extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr);
935extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type);
83905903
AC
936#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE)
937#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE"
938#endif
0f71a2f6 939#if GDB_MULTI_ARCH
6166d547 940#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE)
0f71a2f6
JM
941#define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr))
942#endif
943#endif
944
35cac7cf
AC
945extern int gdbarch_register_type_p (struct gdbarch *gdbarch);
946
947typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr);
948extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr);
949extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type);
950
903ad3a6
AC
951#if defined (DEPRECATED_DO_REGISTERS_INFO)
952/* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */
953#if !defined (DEPRECATED_DO_REGISTERS_INFO_P)
954#define DEPRECATED_DO_REGISTERS_INFO_P() (1)
0ab7a791
AC
955#endif
956#endif
957
958/* Default predicate for non- multi-arch targets. */
903ad3a6
AC
959#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO_P)
960#define DEPRECATED_DO_REGISTERS_INFO_P() (0)
0ab7a791
AC
961#endif
962
903ad3a6
AC
963extern int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch);
964#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO_P)
965#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO"
0ab7a791 966#endif
903ad3a6
AC
967#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO_P)
968#define DEPRECATED_DO_REGISTERS_INFO_P() (gdbarch_deprecated_do_registers_info_p (current_gdbarch))
0ab7a791
AC
969#endif
970
666e11c5 971/* Default (function) for non- multi-arch platforms. */
903ad3a6
AC
972#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO)
973#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DEPRECATED_DO_REGISTERS_INFO"), 0)
666e11c5
EZ
974#endif
975
903ad3a6
AC
976typedef void (gdbarch_deprecated_do_registers_info_ftype) (int reg_nr, int fpregs);
977extern void gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
978extern void set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info);
979#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO)
980#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO"
83905903 981#endif
666e11c5 982#if GDB_MULTI_ARCH
903ad3a6
AC
983#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO)
984#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_deprecated_do_registers_info (current_gdbarch, reg_nr, fpregs))
666e11c5
EZ
985#endif
986#endif
987
0ab7a791
AC
988typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
989extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
990extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
991
23e3a7ac
AC
992extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch);
993
994typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
995extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
5e74b15c 996extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
5e74b15c 997
e76f1f2e
AC
998extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch);
999
1000typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
1001extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
1002extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info);
1003
7c7651b2
AC
1004/* MAP a GDB RAW register number onto a simulator register number. See
1005 also include/...-sim.h. */
1006
1007/* Default (function) for non- multi-arch platforms. */
1008#if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO)
8238d0bf 1009#define REGISTER_SIM_REGNO(reg_nr) (legacy_register_sim_regno (reg_nr))
7c7651b2
AC
1010#endif
1011
1012typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
1013extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
1014extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
83905903
AC
1015#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO)
1016#error "Non multi-arch definition of REGISTER_SIM_REGNO"
1017#endif
7c7651b2
AC
1018#if GDB_MULTI_ARCH
1019#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO)
1020#define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr))
1021#endif
1022#endif
1023
2649061d
AC
1024#if defined (REGISTER_BYTES_OK)
1025/* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */
eee30e78 1026#if !defined (REGISTER_BYTES_OK_P)
2649061d
AC
1027#define REGISTER_BYTES_OK_P() (1)
1028#endif
eee30e78 1029#endif
2649061d
AC
1030
1031/* Default predicate for non- multi-arch targets. */
1032#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P)
1033#define REGISTER_BYTES_OK_P() (0)
1034#endif
1035
1036extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
83905903
AC
1037#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P)
1038#error "Non multi-arch definition of REGISTER_BYTES_OK"
1039#endif
2649061d
AC
1040#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
1041#define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
1042#endif
1043
1044/* Default (function) for non- multi-arch platforms. */
1045#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
8e65ff28 1046#define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0)
2649061d
AC
1047#endif
1048
1049typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes);
1050extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes);
1051extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok);
83905903
AC
1052#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK)
1053#error "Non multi-arch definition of REGISTER_BYTES_OK"
1054#endif
2649061d
AC
1055#if GDB_MULTI_ARCH
1056#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK)
1057#define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
1058#endif
1059#endif
1060
01fb7433
AC
1061/* Default (function) for non- multi-arch platforms. */
1062#if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER)
1063#define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum))
1064#endif
1065
1066typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
1067extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
1068extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
83905903
AC
1069#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER)
1070#error "Non multi-arch definition of CANNOT_FETCH_REGISTER"
1071#endif
01fb7433
AC
1072#if GDB_MULTI_ARCH
1073#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER)
1074#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
1075#endif
1076#endif
1077
1078/* Default (function) for non- multi-arch platforms. */
1079#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER)
1080#define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum))
1081#endif
1082
1083typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
1084extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
1085extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
83905903
AC
1086#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER)
1087#error "Non multi-arch definition of CANNOT_STORE_REGISTER"
1088#endif
01fb7433
AC
1089#if GDB_MULTI_ARCH
1090#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER)
1091#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum))
1092#endif
1093#endif
1094
9df628e0
RE
1095/* setjmp/longjmp support. */
1096
1097#if defined (GET_LONGJMP_TARGET)
1098/* Legacy for systems yet to multi-arch GET_LONGJMP_TARGET */
1099#if !defined (GET_LONGJMP_TARGET_P)
1100#define GET_LONGJMP_TARGET_P() (1)
1101#endif
1102#endif
1103
1104/* Default predicate for non- multi-arch targets. */
1105#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P)
1106#define GET_LONGJMP_TARGET_P() (0)
1107#endif
1108
1109extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
1110#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P)
1111#error "Non multi-arch definition of GET_LONGJMP_TARGET"
1112#endif
1113#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P)
1114#define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch))
1115#endif
1116
1117/* Default (function) for non- multi-arch platforms. */
1118#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET)
1119#define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0)
1120#endif
1121
1122typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc);
1123extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc);
1124extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
1125#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET)
1126#error "Non multi-arch definition of GET_LONGJMP_TARGET"
1127#endif
1128#if GDB_MULTI_ARCH
1129#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET)
1130#define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc))
1131#endif
1132#endif
1133
028c194b
AC
1134/* Non multi-arch DUMMY_FRAMES are a mess (multi-arch ones are not that
1135 much better but at least they are vaguely consistent). The headers
1136 and body contain convoluted #if/#else sequences for determine how
1137 things should be compiled. Instead of trying to mimic that
1138 behaviour here (and hence entrench it further) gdbarch simply
1139 reqires that these methods be set up from the word go. This also
1140 avoids any potential problems with moving beyond multi-arch partial. */
1141
b99fa2d2 1142/* Default (value) for non- multi-arch platforms. */
07555a72
AC
1143#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
1144#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (1)
b99fa2d2
AC
1145#endif
1146
07555a72
AC
1147extern int gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch);
1148extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, int deprecated_use_generic_dummy_frames);
55e1d7e7 1149#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
07555a72 1150#error "Non multi-arch definition of DEPRECATED_USE_GENERIC_DUMMY_FRAMES"
83905903 1151#endif
55e1d7e7 1152#if !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
07555a72 1153#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (gdbarch_deprecated_use_generic_dummy_frames (current_gdbarch))
0f71a2f6 1154#endif
0f71a2f6 1155
7043d8dc
AC
1156/* Replaced by push_dummy_code. */
1157
b99fa2d2
AC
1158/* Default (value) for non- multi-arch platforms. */
1159#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_LOCATION)
1160#define CALL_DUMMY_LOCATION (AT_ENTRY_POINT)
1161#endif
1162
104c1213
JM
1163extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
1164extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
55e1d7e7 1165#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION)
83905903
AC
1166#error "Non multi-arch definition of CALL_DUMMY_LOCATION"
1167#endif
55e1d7e7 1168#if !defined (CALL_DUMMY_LOCATION)
0f71a2f6
JM
1169#define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
1170#endif
0f71a2f6 1171
7043d8dc
AC
1172/* Replaced by push_dummy_code. */
1173
e9a2674e
AC
1174/* Default (function) for non- multi-arch platforms. */
1175#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_ADDRESS)
1176#define CALL_DUMMY_ADDRESS() (entry_point_address ())
1177#endif
1178
104c1213
JM
1179typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void);
1180extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch);
1181extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address);
83905903
AC
1182#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS)
1183#error "Non multi-arch definition of CALL_DUMMY_ADDRESS"
1184#endif
0f71a2f6 1185#if GDB_MULTI_ARCH
6166d547 1186#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS)
0f71a2f6
JM
1187#define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
1188#endif
1189#endif
1190
7043d8dc
AC
1191/* Replaced by push_dummy_code. */
1192
b1e29e33
AC
1193extern CORE_ADDR gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch);
1194extern void set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_start_offset);
1195#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
1196#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_START_OFFSET"
83905903 1197#endif
b1e29e33
AC
1198#if !defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
1199#define DEPRECATED_CALL_DUMMY_START_OFFSET (gdbarch_deprecated_call_dummy_start_offset (current_gdbarch))
0f71a2f6 1200#endif
0f71a2f6 1201
7043d8dc
AC
1202/* Replaced by push_dummy_code. */
1203
b1e29e33
AC
1204extern CORE_ADDR gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
1205extern void set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_breakpoint_offset);
1206#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
1207#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET"
83905903 1208#endif
b1e29e33
AC
1209#if !defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
1210#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch))
0f71a2f6 1211#endif
0f71a2f6 1212
7043d8dc
AC
1213/* Replaced by push_dummy_code. */
1214
b1e29e33
AC
1215extern int gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch);
1216extern void set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, int deprecated_call_dummy_length);
1217#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_LENGTH)
1218#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_LENGTH"
83905903 1219#endif
b1e29e33
AC
1220#if !defined (DEPRECATED_CALL_DUMMY_LENGTH)
1221#define DEPRECATED_CALL_DUMMY_LENGTH (gdbarch_deprecated_call_dummy_length (current_gdbarch))
0f71a2f6 1222#endif
0f71a2f6 1223
ae45cd16
AC
1224/* NOTE: cagney/2002-11-24: This function with predicate has a valid
1225 (callable) initial value. As a consequence, even when the predicate
1226 is false, the corresponding function works. This simplifies the
1227 migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
1228 doesn't need to be modified. */
1229
1230#if defined (DEPRECATED_PC_IN_CALL_DUMMY)
1231/* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */
1232#if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
1233#define DEPRECATED_PC_IN_CALL_DUMMY_P() (1)
1234#endif
1235#endif
1236
1237/* Default predicate for non- multi-arch targets. */
1238#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
1239#define DEPRECATED_PC_IN_CALL_DUMMY_P() (0)
1240#endif
1241
1242extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch);
55e1d7e7 1243#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
ae45cd16
AC
1244#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
1245#endif
55e1d7e7 1246#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
ae45cd16
AC
1247#define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch))
1248#endif
1249
b99fa2d2 1250/* Default (function) for non- multi-arch platforms. */
ae45cd16
AC
1251#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY)
1252#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (generic_pc_in_call_dummy (pc, sp, frame_address))
b99fa2d2
AC
1253#endif
1254
ae45cd16
AC
1255typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
1256extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
1257extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy);
55e1d7e7 1258#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY)
ae45cd16 1259#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
83905903 1260#endif
0f71a2f6 1261#if GDB_MULTI_ARCH
55e1d7e7 1262#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY)
ae45cd16 1263#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
0f71a2f6
JM
1264#endif
1265#endif
1266
7043d8dc
AC
1267/* Replaced by push_dummy_code. */
1268
33489c5b 1269/* Default (value) for non- multi-arch platforms. */
b1e29e33
AC
1270#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_WORDS)
1271#define DEPRECATED_CALL_DUMMY_WORDS (legacy_call_dummy_words)
33489c5b
AC
1272#endif
1273
b1e29e33
AC
1274extern LONGEST * gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch);
1275extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LONGEST * deprecated_call_dummy_words);
1276#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_WORDS)
1277#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_WORDS"
83905903 1278#endif
b1e29e33
AC
1279#if !defined (DEPRECATED_CALL_DUMMY_WORDS)
1280#define DEPRECATED_CALL_DUMMY_WORDS (gdbarch_deprecated_call_dummy_words (current_gdbarch))
0f71a2f6 1281#endif
33489c5b 1282
7043d8dc
AC
1283/* Replaced by push_dummy_code. */
1284
33489c5b 1285/* Default (value) for non- multi-arch platforms. */
b1e29e33
AC
1286#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
1287#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
33489c5b 1288#endif
0f71a2f6 1289
b1e29e33
AC
1290extern int gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch);
1291extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch, int deprecated_sizeof_call_dummy_words);
1292#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
1293#error "Non multi-arch definition of DEPRECATED_SIZEOF_CALL_DUMMY_WORDS"
83905903 1294#endif
b1e29e33
AC
1295#if !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
1296#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (gdbarch_deprecated_sizeof_call_dummy_words (current_gdbarch))
0f71a2f6 1297#endif
0f71a2f6 1298
7043d8dc
AC
1299/* Replaced by push_dummy_code. */
1300
1bf6d5cc
AC
1301#if defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST)
1302/* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_STACK_ADJUST */
1303#if !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P)
1304#define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (1)
83905903 1305#endif
0f71a2f6 1306#endif
1bf6d5cc
AC
1307
1308/* Default predicate for non- multi-arch targets. */
1309#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P)
1310#define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (0)
1311#endif
1312
1313extern int gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch);
1314#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P)
1315#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_STACK_ADJUST"
1316#endif
1317#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P)
1318#define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (gdbarch_deprecated_call_dummy_stack_adjust_p (current_gdbarch))
1319#endif
1320
1321/* Default (value) for non- multi-arch platforms. */
1322#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST)
1323#define DEPRECATED_CALL_DUMMY_STACK_ADJUST (0)
0f71a2f6
JM
1324#endif
1325
1bf6d5cc
AC
1326extern int gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch);
1327extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch, int deprecated_call_dummy_stack_adjust);
1328#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST)
1329#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_STACK_ADJUST"
83905903 1330#endif
0f71a2f6 1331#if GDB_MULTI_ARCH
1bf6d5cc
AC
1332#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST)
1333#define DEPRECATED_CALL_DUMMY_STACK_ADJUST (gdbarch_deprecated_call_dummy_stack_adjust (current_gdbarch))
0f71a2f6
JM
1334#endif
1335#endif
1336
7043d8dc
AC
1337/* Replaced by push_dummy_code. */
1338
b1e29e33
AC
1339#if defined (DEPRECATED_FIX_CALL_DUMMY)
1340/* Legacy for systems yet to multi-arch DEPRECATED_FIX_CALL_DUMMY */
1341#if !defined (DEPRECATED_FIX_CALL_DUMMY_P)
1342#define DEPRECATED_FIX_CALL_DUMMY_P() (1)
e8ab51f7
AC
1343#endif
1344#endif
1345
1346/* Default predicate for non- multi-arch targets. */
b1e29e33
AC
1347#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY_P)
1348#define DEPRECATED_FIX_CALL_DUMMY_P() (0)
e8ab51f7
AC
1349#endif
1350
b1e29e33
AC
1351extern int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch);
1352#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY_P)
1353#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
e8ab51f7 1354#endif
b1e29e33
AC
1355#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY_P)
1356#define DEPRECATED_FIX_CALL_DUMMY_P() (gdbarch_deprecated_fix_call_dummy_p (current_gdbarch))
e8ab51f7
AC
1357#endif
1358
1359/* Default (function) for non- multi-arch platforms. */
b1e29e33
AC
1360#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY)
1361#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "DEPRECATED_FIX_CALL_DUMMY"), 0)
e8ab51f7
AC
1362#endif
1363
b1e29e33
AC
1364typedef void (gdbarch_deprecated_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
1365extern void gdbarch_deprecated_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);
1366extern void set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy);
1367#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY)
1368#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
83905903 1369#endif
0f71a2f6 1370#if GDB_MULTI_ARCH
b1e29e33
AC
1371#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY)
1372#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_deprecated_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
0f71a2f6
JM
1373#endif
1374#endif
1375
b1e29e33 1376/* This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al. */
7043d8dc
AC
1377
1378extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
1379
1380typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr);
1381extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr);
1382extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
1383
2ca6c561
AC
1384#if defined (DEPRECATED_INIT_FRAME_PC_FIRST)
1385/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */
1386#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
1387#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (1)
1388#endif
1389#endif
1390
1391/* Default predicate for non- multi-arch targets. */
1392#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
1393#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (0)
1394#endif
1395
1396extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch);
1397#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
1398#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
1399#endif
1400#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
1401#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch))
1402#endif
1403
10312cc4 1404/* Default (function) for non- multi-arch platforms. */
2ca6c561
AC
1405#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST)
1406#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0)
10312cc4
AC
1407#endif
1408
97f46953
AC
1409typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
1410extern CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
2ca6c561
AC
1411extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first);
1412#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST)
1413#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
83905903 1414#endif
10312cc4 1415#if GDB_MULTI_ARCH
2ca6c561
AC
1416#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST)
1417#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_deprecated_init_frame_pc_first (current_gdbarch, fromleaf, prev))
10312cc4
AC
1418#endif
1419#endif
1420
a5afb99f
AC
1421#if defined (DEPRECATED_INIT_FRAME_PC)
1422/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC */
1423#if !defined (DEPRECATED_INIT_FRAME_PC_P)
1424#define DEPRECATED_INIT_FRAME_PC_P() (1)
1425#endif
1426#endif
1427
1428/* Default predicate for non- multi-arch targets. */
1429#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_P)
1430#define DEPRECATED_INIT_FRAME_PC_P() (0)
1431#endif
1432
1433extern int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch);
1434#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_P)
1435#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC"
1436#endif
1437#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_P)
1438#define DEPRECATED_INIT_FRAME_PC_P() (gdbarch_deprecated_init_frame_pc_p (current_gdbarch))
1439#endif
1440
10312cc4 1441/* Default (function) for non- multi-arch platforms. */
a5afb99f
AC
1442#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC)
1443#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC"), 0)
10312cc4
AC
1444#endif
1445
a5afb99f
AC
1446typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev);
1447extern CORE_ADDR gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
1448extern void set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc);
1449#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC)
1450#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC"
83905903 1451#endif
10312cc4 1452#if GDB_MULTI_ARCH
a5afb99f
AC
1453#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC)
1454#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (gdbarch_deprecated_init_frame_pc (current_gdbarch, fromleaf, prev))
10312cc4
AC
1455#endif
1456#endif
1457
104c1213
JM
1458extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
1459extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion);
83905903
AC
1460#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION)
1461#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION"
1462#endif
0f71a2f6 1463#if GDB_MULTI_ARCH
6166d547 1464#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION)
0f71a2f6
JM
1465#define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
1466#endif
1467#endif
1468
104c1213
JM
1469extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch);
1470extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type);
83905903
AC
1471#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE)
1472#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE"
1473#endif
e669114a 1474#if !defined (BELIEVE_PCC_PROMOTION_TYPE)
0f71a2f6
JM
1475#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
1476#endif
0f71a2f6 1477
129c1cd6
AC
1478#if defined (DEPRECATED_GET_SAVED_REGISTER)
1479/* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */
1480#if !defined (DEPRECATED_GET_SAVED_REGISTER_P)
1481#define DEPRECATED_GET_SAVED_REGISTER_P() (1)
a216a322
AC
1482#endif
1483#endif
1484
1485/* Default predicate for non- multi-arch targets. */
129c1cd6
AC
1486#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER_P)
1487#define DEPRECATED_GET_SAVED_REGISTER_P() (0)
a216a322
AC
1488#endif
1489
129c1cd6
AC
1490extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch);
1491#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P)
1492#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
a216a322 1493#endif
129c1cd6
AC
1494#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER_P)
1495#define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch))
a216a322
AC
1496#endif
1497
e4b415d9 1498/* Default (function) for non- multi-arch platforms. */
129c1cd6
AC
1499#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER)
1500#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "DEPRECATED_GET_SAVED_REGISTER"), 0)
e4b415d9 1501#endif
028c194b 1502
129c1cd6
AC
1503typedef void (gdbarch_deprecated_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
1504extern void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
1505extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register);
1506#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER)
1507#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
83905903 1508#endif
0f71a2f6 1509#if GDB_MULTI_ARCH
129c1cd6
AC
1510#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER)
1511#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
0f71a2f6
JM
1512#endif
1513#endif
1514
33489c5b 1515/* Default (function) for non- multi-arch platforms. */
6166d547 1516#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE)
33489c5b
AC
1517#define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr))
1518#endif
1519
104c1213
JM
1520typedef int (gdbarch_register_convertible_ftype) (int nr);
1521extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr);
1522extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible);
83905903
AC
1523#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE)
1524#error "Non multi-arch definition of REGISTER_CONVERTIBLE"
1525#endif
33489c5b 1526#if GDB_MULTI_ARCH
6166d547 1527#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE)
0f71a2f6
JM
1528#define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr))
1529#endif
33489c5b
AC
1530#endif
1531
1532/* Default (function) for non- multi-arch platforms. */
6166d547 1533#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL)
8e65ff28 1534#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0)
33489c5b 1535#endif
0f71a2f6 1536
104c1213
JM
1537typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
1538extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
1539extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual);
83905903
AC
1540#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL)
1541#error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL"
1542#endif
33489c5b 1543#if GDB_MULTI_ARCH
6166d547 1544#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL)
0f71a2f6
JM
1545#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
1546#endif
33489c5b
AC
1547#endif
1548
1549/* Default (function) for non- multi-arch platforms. */
6166d547 1550#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW)
8e65ff28 1551#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0)
33489c5b 1552#endif
0f71a2f6 1553
104c1213
JM
1554typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to);
1555extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to);
1556extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw);
83905903
AC
1557#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW)
1558#error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW"
1559#endif
33489c5b 1560#if GDB_MULTI_ARCH
6166d547 1561#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW)
0f71a2f6
JM
1562#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
1563#endif
33489c5b
AC
1564#endif
1565
13d01224
AC
1566/* Default (function) for non- multi-arch platforms. */
1567#if (!GDB_MULTI_ARCH) && !defined (CONVERT_REGISTER_P)
1568#define CONVERT_REGISTER_P(regnum) (legacy_convert_register_p (regnum))
1569#endif
1570
1571typedef int (gdbarch_convert_register_p_ftype) (int regnum);
1572extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum);
1573extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
1574#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P)
1575#error "Non multi-arch definition of CONVERT_REGISTER_P"
1576#endif
1577#if GDB_MULTI_ARCH
1578#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_REGISTER_P)
1579#define CONVERT_REGISTER_P(regnum) (gdbarch_convert_register_p (current_gdbarch, regnum))
1580#endif
1581#endif
1582
1583/* Default (function) for non- multi-arch platforms. */
1584#if (!GDB_MULTI_ARCH) && !defined (REGISTER_TO_VALUE)
1585#define REGISTER_TO_VALUE(regnum, type, from, to) (legacy_register_to_value (regnum, type, from, to))
1586#endif
1587
1588typedef void (gdbarch_register_to_value_ftype) (int regnum, struct type *type, char *from, char *to);
1589extern void gdbarch_register_to_value (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
1590extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
1591#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE)
1592#error "Non multi-arch definition of REGISTER_TO_VALUE"
1593#endif
1594#if GDB_MULTI_ARCH
1595#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_TO_VALUE)
1596#define REGISTER_TO_VALUE(regnum, type, from, to) (gdbarch_register_to_value (current_gdbarch, regnum, type, from, to))
1597#endif
1598#endif
1599
1600/* Default (function) for non- multi-arch platforms. */
1601#if (!GDB_MULTI_ARCH) && !defined (VALUE_TO_REGISTER)
1602#define VALUE_TO_REGISTER(type, regnum, from, to) (legacy_value_to_register (type, regnum, from, to))
1603#endif
1604
1605typedef void (gdbarch_value_to_register_ftype) (struct type *type, int regnum, char *from, char *to);
1606extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to);
1607extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
1608#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER)
1609#error "Non multi-arch definition of VALUE_TO_REGISTER"
1610#endif
1611#if GDB_MULTI_ARCH
1612#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (VALUE_TO_REGISTER)
1613#define VALUE_TO_REGISTER(type, regnum, from, to) (gdbarch_value_to_register (current_gdbarch, type, regnum, from, to))
1614#endif
1615#endif
1616
33489c5b 1617/* Default (function) for non- multi-arch platforms. */
6166d547 1618#if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS)
ac2e2ef7 1619#define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf))
33489c5b 1620#endif
4478b372 1621
66140c26
AC
1622typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const void *buf);
1623extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf);
4478b372 1624extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
83905903
AC
1625#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS)
1626#error "Non multi-arch definition of POINTER_TO_ADDRESS"
1627#endif
33489c5b 1628#if GDB_MULTI_ARCH
6166d547 1629#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS)
4478b372
JB
1630#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
1631#endif
33489c5b
AC
1632#endif
1633
1634/* Default (function) for non- multi-arch platforms. */
6166d547 1635#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER)
ac2e2ef7 1636#define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr))
33489c5b 1637#endif
4478b372 1638
ac2e2ef7
AC
1639typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr);
1640extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr);
4478b372 1641extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
83905903
AC
1642#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER)
1643#error "Non multi-arch definition of ADDRESS_TO_POINTER"
1644#endif
33489c5b 1645#if GDB_MULTI_ARCH
6166d547 1646#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER)
4478b372
JB
1647#define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr))
1648#endif
33489c5b
AC
1649#endif
1650
fc0c74b1
AC
1651#if defined (INTEGER_TO_ADDRESS)
1652/* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */
1653#if !defined (INTEGER_TO_ADDRESS_P)
1654#define INTEGER_TO_ADDRESS_P() (1)
1655#endif
1656#endif
1657
1658/* Default predicate for non- multi-arch targets. */
1659#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P)
1660#define INTEGER_TO_ADDRESS_P() (0)
1661#endif
1662
1663extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
1664#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P)
1665#error "Non multi-arch definition of INTEGER_TO_ADDRESS"
1666#endif
1667#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P)
1668#define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch))
1669#endif
1670
1671/* Default (function) for non- multi-arch platforms. */
1672#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS)
73d3c16e 1673#define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0)
fc0c74b1
AC
1674#endif
1675
1676typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf);
1677extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf);
1678extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address);
1679#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS)
1680#error "Non multi-arch definition of INTEGER_TO_ADDRESS"
1681#endif
1682#if GDB_MULTI_ARCH
1683#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS)
1684#define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf))
1685#endif
1686#endif
1687
33489c5b 1688/* Default (function) for non- multi-arch platforms. */
6166d547 1689#if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK)
33489c5b
AC
1690#define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type))
1691#endif
0f71a2f6 1692
71a9f22e
JB
1693typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
1694extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
1695extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack);
83905903
AC
1696#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK)
1697#error "Non multi-arch definition of RETURN_VALUE_ON_STACK"
1698#endif
33489c5b 1699#if GDB_MULTI_ARCH
6166d547 1700#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK)
71a9f22e
JB
1701#define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type))
1702#endif
33489c5b 1703#endif
71a9f22e 1704
b81774d8
AC
1705/* Replaced by PUSH_DUMMY_CALL */
1706
1707#if defined (DEPRECATED_PUSH_ARGUMENTS)
1708/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_ARGUMENTS */
1709#if !defined (DEPRECATED_PUSH_ARGUMENTS_P)
1710#define DEPRECATED_PUSH_ARGUMENTS_P() (1)
1711#endif
1712#endif
1713
1714/* Default predicate for non- multi-arch targets. */
1715#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS_P)
1716#define DEPRECATED_PUSH_ARGUMENTS_P() (0)
1717#endif
1718
1719extern int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch);
1720#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS_P)
1721#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS"
1722#endif
1723#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS_P)
1724#define DEPRECATED_PUSH_ARGUMENTS_P() (gdbarch_deprecated_push_arguments_p (current_gdbarch))
1725#endif
1726
c203844d 1727/* Default (function) for non- multi-arch platforms. */
b81774d8
AC
1728#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS)
1729#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_ARGUMENTS"), 0)
c203844d
AC
1730#endif
1731
b81774d8
AC
1732typedef CORE_ADDR (gdbarch_deprecated_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
1733extern CORE_ADDR gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
1734extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments);
1735#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS)
1736#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS"
83905903 1737#endif
0f71a2f6 1738#if GDB_MULTI_ARCH
b81774d8
AC
1739#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS)
1740#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_deprecated_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
0f71a2f6
JM
1741#endif
1742#endif
1743
b81774d8
AC
1744extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch);
1745
1746typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
1747extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
1748extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call);
1749
f3824013
AC
1750#if defined (DEPRECATED_PUSH_DUMMY_FRAME)
1751/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_DUMMY_FRAME */
1752#if !defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
1753#define DEPRECATED_PUSH_DUMMY_FRAME_P() (1)
1754#endif
1755#endif
1756
1757/* Default predicate for non- multi-arch targets. */
1758#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
1759#define DEPRECATED_PUSH_DUMMY_FRAME_P() (0)
1760#endif
1761
1762extern int gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch);
1763#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
1764#error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME"
1765#endif
1766#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
1767#define DEPRECATED_PUSH_DUMMY_FRAME_P() (gdbarch_deprecated_push_dummy_frame_p (current_gdbarch))
1768#endif
1769
1770/* Default (function) for non- multi-arch platforms. */
1771#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME)
1772#define DEPRECATED_PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_DUMMY_FRAME"), 0)
f3824013
AC
1773#endif
1774
1775typedef void (gdbarch_deprecated_push_dummy_frame_ftype) (void);
1776extern void gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch);
1777extern void set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame);
1778#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME)
1779#error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME"
83905903 1780#endif
0f71a2f6 1781#if GDB_MULTI_ARCH
f3824013
AC
1782#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_DUMMY_FRAME)
1783#define DEPRECATED_PUSH_DUMMY_FRAME (gdbarch_deprecated_push_dummy_frame (current_gdbarch))
0f71a2f6
JM
1784#endif
1785#endif
1786
28f617b3
AC
1787/* NOTE: This can be handled directly in push_dummy_call. */
1788
1789#if defined (DEPRECATED_PUSH_RETURN_ADDRESS)
1790/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_RETURN_ADDRESS */
1791#if !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
1792#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (1)
69a0d5f4
AC
1793#endif
1794#endif
1795
1796/* Default predicate for non- multi-arch targets. */
28f617b3
AC
1797#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
1798#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (0)
69a0d5f4
AC
1799#endif
1800
28f617b3
AC
1801extern int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch);
1802#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
1803#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS"
69a0d5f4 1804#endif
28f617b3
AC
1805#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
1806#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (gdbarch_deprecated_push_return_address_p (current_gdbarch))
69a0d5f4
AC
1807#endif
1808
1809/* Default (function) for non- multi-arch platforms. */
28f617b3
AC
1810#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS)
1811#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_RETURN_ADDRESS"), 0)
69a0d5f4
AC
1812#endif
1813
28f617b3
AC
1814typedef CORE_ADDR (gdbarch_deprecated_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp);
1815extern CORE_ADDR gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp);
1816extern void set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address);
1817#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS)
1818#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS"
83905903 1819#endif
0f71a2f6 1820#if GDB_MULTI_ARCH
28f617b3
AC
1821#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS)
1822#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_deprecated_push_return_address (current_gdbarch, pc, sp))
0f71a2f6
JM
1823#endif
1824#endif
1825
749b82f6
AC
1826#if defined (DEPRECATED_POP_FRAME)
1827/* Legacy for systems yet to multi-arch DEPRECATED_POP_FRAME */
1828#if !defined (DEPRECATED_POP_FRAME_P)
1829#define DEPRECATED_POP_FRAME_P() (1)
dedc2a2b
AC
1830#endif
1831#endif
1832
1833/* Default predicate for non- multi-arch targets. */
749b82f6
AC
1834#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME_P)
1835#define DEPRECATED_POP_FRAME_P() (0)
dedc2a2b
AC
1836#endif
1837
749b82f6
AC
1838extern int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch);
1839#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME_P)
1840#error "Non multi-arch definition of DEPRECATED_POP_FRAME"
dedc2a2b 1841#endif
749b82f6
AC
1842#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME_P)
1843#define DEPRECATED_POP_FRAME_P() (gdbarch_deprecated_pop_frame_p (current_gdbarch))
dedc2a2b
AC
1844#endif
1845
1846/* Default (function) for non- multi-arch platforms. */
749b82f6
AC
1847#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME)
1848#define DEPRECATED_POP_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_POP_FRAME"), 0)
dedc2a2b
AC
1849#endif
1850
749b82f6
AC
1851typedef void (gdbarch_deprecated_pop_frame_ftype) (void);
1852extern void gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch);
1853extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame);
1854#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME)
1855#error "Non multi-arch definition of DEPRECATED_POP_FRAME"
83905903 1856#endif
0f71a2f6 1857#if GDB_MULTI_ARCH
749b82f6
AC
1858#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME)
1859#define DEPRECATED_POP_FRAME (gdbarch_deprecated_pop_frame (current_gdbarch))
0f71a2f6
JM
1860#endif
1861#endif
1862
4183d812
AC
1863/* NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. */
1864
1865#if defined (DEPRECATED_STORE_STRUCT_RETURN)
1866/* Legacy for systems yet to multi-arch DEPRECATED_STORE_STRUCT_RETURN */
1867#if !defined (DEPRECATED_STORE_STRUCT_RETURN_P)
1868#define DEPRECATED_STORE_STRUCT_RETURN_P() (1)
1869#endif
1870#endif
1871
1872/* Default predicate for non- multi-arch targets. */
1873#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_STORE_STRUCT_RETURN_P)
1874#define DEPRECATED_STORE_STRUCT_RETURN_P() (0)
1875#endif
1876
1877extern int gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch);
1878#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN_P)
1879#error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN"
1880#endif
1881#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN_P)
1882#define DEPRECATED_STORE_STRUCT_RETURN_P() (gdbarch_deprecated_store_struct_return_p (current_gdbarch))
1883#endif
1884
1885/* Default (function) for non- multi-arch platforms. */
1886#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_STORE_STRUCT_RETURN)
1887#define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_STORE_STRUCT_RETURN"), 0)
1888#endif
1889
1890typedef void (gdbarch_deprecated_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp);
1891extern void gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp);
1892extern void set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return);
1893#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN)
1894#error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN"
83905903 1895#endif
0f71a2f6 1896#if GDB_MULTI_ARCH
4183d812
AC
1897#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN)
1898#define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (gdbarch_deprecated_store_struct_return (current_gdbarch, addr, sp))
0f71a2f6
JM
1899#endif
1900#endif
1901
ebba8386
AC
1902/* Default (function) for non- multi-arch platforms. */
1903#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE)
1904#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf))
1905#endif
1906
1907typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf);
1908extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf);
1909extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
1910#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
1911#error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
1912#endif
1913#if GDB_MULTI_ARCH
1914#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
1915#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf))
1916#endif
1917#endif
1918
1919/* Default (function) for non- multi-arch platforms. */
1920#if (!GDB_MULTI_ARCH) && !defined (STORE_RETURN_VALUE)
1921#define STORE_RETURN_VALUE(type, regcache, valbuf) (legacy_store_return_value (type, regcache, valbuf))
1922#endif
1923
1924typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const void *valbuf);
1925extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf);
104c1213 1926extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value);
83905903
AC
1927#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE)
1928#error "Non multi-arch definition of STORE_RETURN_VALUE"
1929#endif
0f71a2f6 1930#if GDB_MULTI_ARCH
6166d547 1931#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE)
ebba8386
AC
1932#define STORE_RETURN_VALUE(type, regcache, valbuf) (gdbarch_store_return_value (current_gdbarch, type, regcache, valbuf))
1933#endif
1934#endif
1935
1936typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf);
1937extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf);
1938extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value);
1939#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_RETURN_VALUE)
1940#error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE"
1941#endif
1942#if GDB_MULTI_ARCH
1943#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_RETURN_VALUE)
1944#define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf))
1945#endif
1946#endif
1947
1948typedef void (gdbarch_deprecated_store_return_value_ftype) (struct type *type, char *valbuf);
1949extern void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf);
1950extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value);
1951#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_RETURN_VALUE)
1952#error "Non multi-arch definition of DEPRECATED_STORE_RETURN_VALUE"
1953#endif
1954#if GDB_MULTI_ARCH
1955#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_RETURN_VALUE)
1956#define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf))
0f71a2f6
JM
1957#endif
1958#endif
1959
049ee0e4
AC
1960#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1961/* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
1962#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1963#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
1964#endif
1965#endif
1966
1967/* Default predicate for non- multi-arch targets. */
1968#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1969#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
1970#endif
1971
1972extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
1973#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1974#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
1975#endif
1976#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1977#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
1978#endif
1979
1980/* Default (function) for non- multi-arch platforms. */
1981#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1982#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
1983#endif
1984
1985typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regcache *regcache);
1986extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
1987extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
1988#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1989#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
1990#endif
1991#if GDB_MULTI_ARCH
1992#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1993#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache))
1994#endif
1995#endif
1996
26e9b323
AC
1997#if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
1998/* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */
1999#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
2000#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
d6dd581e
AC
2001#endif
2002#endif
2003
2004/* Default predicate for non- multi-arch targets. */
26e9b323
AC
2005#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
2006#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
d6dd581e
AC
2007#endif
2008
26e9b323
AC
2009extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch);
2010#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
2011#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
83905903 2012#endif
26e9b323
AC
2013#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
2014#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch))
d6dd581e
AC
2015#endif
2016
2017/* Default (function) for non- multi-arch platforms. */
26e9b323
AC
2018#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
2019#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
d6dd581e
AC
2020#endif
2021
26e9b323
AC
2022typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (char *regbuf);
2023extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
2024extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address);
2025#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
2026#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
83905903 2027#endif
0f71a2f6 2028#if GDB_MULTI_ARCH
26e9b323
AC
2029#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
2030#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regbuf))
0f71a2f6
JM
2031#endif
2032#endif
2033
56f12751
AC
2034/* Default (function) for non- multi-arch platforms. */
2035#if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION)
2036#define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type))
2037#endif
2038
104c1213
JM
2039typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
2040extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
2041extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention);
83905903
AC
2042#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION)
2043#error "Non multi-arch definition of USE_STRUCT_CONVENTION"
2044#endif
0f71a2f6 2045#if GDB_MULTI_ARCH
6166d547 2046#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION)
0f71a2f6
JM
2047#define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
2048#endif
2049#endif
2050
f30ee0bc
AC
2051#if defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
2052/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_INIT_SAVED_REGS */
2053#if !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
2054#define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (1)
8f871025
AC
2055#endif
2056#endif
2057
2058/* Default predicate for non- multi-arch targets. */
f30ee0bc
AC
2059#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
2060#define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (0)
8f871025
AC
2061#endif
2062
f30ee0bc
AC
2063extern int gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch);
2064#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
2065#error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS"
8f871025 2066#endif
f30ee0bc
AC
2067#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
2068#define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (gdbarch_deprecated_frame_init_saved_regs_p (current_gdbarch))
8f871025
AC
2069#endif
2070
2071/* Default (function) for non- multi-arch platforms. */
f30ee0bc
AC
2072#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
2073#define DEPRECATED_FRAME_INIT_SAVED_REGS(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_INIT_SAVED_REGS"), 0)
8f871025
AC
2074#endif
2075
f30ee0bc
AC
2076typedef void (gdbarch_deprecated_frame_init_saved_regs_ftype) (struct frame_info *frame);
2077extern void gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame);
2078extern void set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs);
2079#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
2080#error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS"
83905903 2081#endif
0f71a2f6 2082#if GDB_MULTI_ARCH
f30ee0bc
AC
2083#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
2084#define DEPRECATED_FRAME_INIT_SAVED_REGS(frame) (gdbarch_deprecated_frame_init_saved_regs (current_gdbarch, frame))
0f71a2f6
JM
2085#endif
2086#endif
2087
e9582e71
AC
2088#if defined (DEPRECATED_INIT_EXTRA_FRAME_INFO)
2089/* Legacy for systems yet to multi-arch DEPRECATED_INIT_EXTRA_FRAME_INFO */
2090#if !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
2091#define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (1)
5fdff426
AC
2092#endif
2093#endif
2094
2095/* Default predicate for non- multi-arch targets. */
e9582e71
AC
2096#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
2097#define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (0)
5fdff426
AC
2098#endif
2099
e9582e71
AC
2100extern int gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch);
2101#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
2102#error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO"
5fdff426 2103#endif
e9582e71
AC
2104#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
2105#define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (gdbarch_deprecated_init_extra_frame_info_p (current_gdbarch))
5fdff426
AC
2106#endif
2107
2108/* Default (function) for non- multi-arch platforms. */
e9582e71
AC
2109#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO)
2110#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_EXTRA_FRAME_INFO"), 0)
5fdff426
AC
2111#endif
2112
e9582e71
AC
2113typedef void (gdbarch_deprecated_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame);
2114extern void gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame);
2115extern void set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info);
2116#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO)
2117#error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO"
83905903 2118#endif
0f71a2f6 2119#if GDB_MULTI_ARCH
e9582e71
AC
2120#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO)
2121#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_deprecated_init_extra_frame_info (current_gdbarch, fromleaf, frame))
0f71a2f6
JM
2122#endif
2123#endif
2124
104c1213
JM
2125typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip);
2126extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
2127extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
83905903
AC
2128#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE)
2129#error "Non multi-arch definition of SKIP_PROLOGUE"
2130#endif
0f71a2f6 2131#if GDB_MULTI_ARCH
6166d547 2132#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE)
0f71a2f6
JM
2133#define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
2134#endif
2135#endif
2136
33489c5b 2137/* Default (function) for non- multi-arch platforms. */
6166d547 2138#if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P)
33489c5b
AC
2139#define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip))
2140#endif
2141
dad41f9a
AC
2142typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip);
2143extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip);
2144extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p);
83905903
AC
2145#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P)
2146#error "Non multi-arch definition of PROLOGUE_FRAMELESS_P"
2147#endif
33489c5b 2148#if GDB_MULTI_ARCH
6166d547 2149#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P)
dad41f9a
AC
2150#define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip))
2151#endif
33489c5b 2152#endif
dad41f9a 2153
104c1213
JM
2154typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
2155extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
2156extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
83905903
AC
2157#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN)
2158#error "Non multi-arch definition of INNER_THAN"
2159#endif
0f71a2f6 2160#if GDB_MULTI_ARCH
6166d547 2161#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN)
0f71a2f6
JM
2162#define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs))
2163#endif
2164#endif
2165
f4f9705a
AC
2166typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
2167extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
104c1213 2168extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
83905903
AC
2169#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
2170#error "Non multi-arch definition of BREAKPOINT_FROM_PC"
2171#endif
33489c5b 2172#if GDB_MULTI_ARCH
6166d547 2173#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC)
0f71a2f6
JM
2174#define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
2175#endif
33489c5b
AC
2176#endif
2177
2178/* Default (function) for non- multi-arch platforms. */
6166d547 2179#if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT)
33489c5b
AC
2180#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache))
2181#endif
0f71a2f6 2182
917317f4
JM
2183typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
2184extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
2185extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
83905903
AC
2186#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT)
2187#error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT"
2188#endif
33489c5b 2189#if GDB_MULTI_ARCH
6166d547 2190#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT)
917317f4
JM
2191#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache))
2192#endif
33489c5b
AC
2193#endif
2194
2195/* Default (function) for non- multi-arch platforms. */
6166d547 2196#if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT)
33489c5b
AC
2197#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache))
2198#endif
917317f4
JM
2199
2200typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
2201extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
2202extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
83905903
AC
2203#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT)
2204#error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT"
2205#endif
33489c5b 2206#if GDB_MULTI_ARCH
6166d547 2207#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT)
917317f4
JM
2208#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache))
2209#endif
33489c5b 2210#endif
917317f4 2211
104c1213
JM
2212extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
2213extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
83905903
AC
2214#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK)
2215#error "Non multi-arch definition of DECR_PC_AFTER_BREAK"
2216#endif
0f71a2f6 2217#if GDB_MULTI_ARCH
6166d547 2218#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK)
0f71a2f6
JM
2219#define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
2220#endif
2221#endif
2222
e02bc4cc
DS
2223/* Default (function) for non- multi-arch platforms. */
2224#if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED)
2225#define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it))
2226#endif
2227
2228typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it);
2229extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it);
2230extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed);
83905903
AC
2231#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED)
2232#error "Non multi-arch definition of PREPARE_TO_PROCEED"
2233#endif
e02bc4cc
DS
2234#if GDB_MULTI_ARCH
2235#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED)
2236#define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it))
2237#endif
2238#endif
2239
104c1213
JM
2240extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
2241extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
83905903
AC
2242#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
2243#error "Non multi-arch definition of FUNCTION_START_OFFSET"
2244#endif
0f71a2f6 2245#if GDB_MULTI_ARCH
6166d547 2246#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET)
0f71a2f6
JM
2247#define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
2248#endif
2249#endif
2250
f6684c31
AC
2251typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
2252extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
104c1213 2253extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
0f71a2f6 2254
104c1213
JM
2255extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
2256extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
83905903
AC
2257#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP)
2258#error "Non multi-arch definition of FRAME_ARGS_SKIP"
2259#endif
0f71a2f6 2260#if GDB_MULTI_ARCH
6166d547 2261#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP)
0f71a2f6
JM
2262#define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
2263#endif
2264#endif
2265
33489c5b 2266/* Default (function) for non- multi-arch platforms. */
6166d547 2267#if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION)
33489c5b
AC
2268#define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi))
2269#endif
2270
104c1213
JM
2271typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi);
2272extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi);
2273extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation);
83905903
AC
2274#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION)
2275#error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION"
2276#endif
33489c5b 2277#if GDB_MULTI_ARCH
6166d547 2278#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION)
0f71a2f6
JM
2279#define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi))
2280#endif
33489c5b 2281#endif
0f71a2f6 2282
618ce49f
AC
2283#if defined (DEPRECATED_FRAME_CHAIN)
2284/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN */
2285#if !defined (DEPRECATED_FRAME_CHAIN_P)
2286#define DEPRECATED_FRAME_CHAIN_P() (1)
d62d1979
AC
2287#endif
2288#endif
2289
2290/* Default predicate for non- multi-arch targets. */
618ce49f
AC
2291#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_P)
2292#define DEPRECATED_FRAME_CHAIN_P() (0)
d62d1979
AC
2293#endif
2294
618ce49f
AC
2295extern int gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch);
2296#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_P)
2297#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN"
d62d1979 2298#endif
618ce49f
AC
2299#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_P)
2300#define DEPRECATED_FRAME_CHAIN_P() (gdbarch_deprecated_frame_chain_p (current_gdbarch))
d62d1979
AC
2301#endif
2302
2303/* Default (function) for non- multi-arch platforms. */
618ce49f
AC
2304#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN)
2305#define DEPRECATED_FRAME_CHAIN(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN"), 0)
d62d1979
AC
2306#endif
2307
618ce49f
AC
2308typedef CORE_ADDR (gdbarch_deprecated_frame_chain_ftype) (struct frame_info *frame);
2309extern CORE_ADDR gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame);
2310extern void set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain);
2311#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN)
2312#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN"
83905903 2313#endif
0f71a2f6 2314#if GDB_MULTI_ARCH
618ce49f
AC
2315#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN)
2316#define DEPRECATED_FRAME_CHAIN(frame) (gdbarch_deprecated_frame_chain (current_gdbarch, frame))
0f71a2f6
JM
2317#endif
2318#endif
2319
618ce49f
AC
2320#if defined (DEPRECATED_FRAME_CHAIN_VALID)
2321/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN_VALID */
2322#if !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
2323#define DEPRECATED_FRAME_CHAIN_VALID_P() (1)
51603483
DJ
2324#endif
2325#endif
2326
2327/* Default predicate for non- multi-arch targets. */
618ce49f
AC
2328#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
2329#define DEPRECATED_FRAME_CHAIN_VALID_P() (0)
51603483
DJ
2330#endif
2331
618ce49f
AC
2332extern int gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch);
2333#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID_P)
2334#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID"
51603483 2335#endif
618ce49f
AC
2336#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
2337#define DEPRECATED_FRAME_CHAIN_VALID_P() (gdbarch_deprecated_frame_chain_valid_p (current_gdbarch))
51603483 2338#endif
7f55af32
AC
2339
2340/* Default (function) for non- multi-arch platforms. */
618ce49f
AC
2341#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID)
2342#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN_VALID"), 0)
7f55af32 2343#endif
028c194b 2344
618ce49f
AC
2345typedef int (gdbarch_deprecated_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
2346extern int gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe);
2347extern void set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid);
2348#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID)
2349#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID"
83905903 2350#endif
0f71a2f6 2351#if GDB_MULTI_ARCH
618ce49f
AC
2352#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID)
2353#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_deprecated_frame_chain_valid (current_gdbarch, chain, thisframe))
0f71a2f6
JM
2354#endif
2355#endif
2356
8bedc050
AC
2357/* DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC. Please
2358 note, per UNWIND_PC's doco, that while the two have similar
2359 interfaces they have very different underlying implementations. */
12cc2063 2360
8bedc050
AC
2361#if defined (DEPRECATED_FRAME_SAVED_PC)
2362/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_SAVED_PC */
2363#if !defined (DEPRECATED_FRAME_SAVED_PC_P)
2364#define DEPRECATED_FRAME_SAVED_PC_P() (1)
d62d1979
AC
2365#endif
2366#endif
2367
2368/* Default predicate for non- multi-arch targets. */
8bedc050
AC
2369#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC_P)
2370#define DEPRECATED_FRAME_SAVED_PC_P() (0)
d62d1979
AC
2371#endif
2372
8bedc050
AC
2373extern int gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch);
2374#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC_P)
2375#error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
d62d1979 2376#endif
8bedc050
AC
2377#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC_P)
2378#define DEPRECATED_FRAME_SAVED_PC_P() (gdbarch_deprecated_frame_saved_pc_p (current_gdbarch))
d62d1979
AC
2379#endif
2380
2381/* Default (function) for non- multi-arch platforms. */
8bedc050
AC
2382#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC)
2383#define DEPRECATED_FRAME_SAVED_PC(fi) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_SAVED_PC"), 0)
d62d1979
AC
2384#endif
2385
8bedc050
AC
2386typedef CORE_ADDR (gdbarch_deprecated_frame_saved_pc_ftype) (struct frame_info *fi);
2387extern CORE_ADDR gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
2388extern void set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc);
2389#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC)
2390#error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
83905903 2391#endif
0f71a2f6 2392#if GDB_MULTI_ARCH
8bedc050
AC
2393#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC)
2394#define DEPRECATED_FRAME_SAVED_PC(fi) (gdbarch_deprecated_frame_saved_pc (current_gdbarch, fi))
0f71a2f6
JM
2395#endif
2396#endif
2397
12cc2063
AC
2398extern int gdbarch_unwind_pc_p (struct gdbarch *gdbarch);
2399
2400typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
2401extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame);
2402extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc);
2403
f4ded5b1
AC
2404/* Default (function) for non- multi-arch platforms. */
2405#if (!GDB_MULTI_ARCH) && !defined (FRAME_ARGS_ADDRESS)
7d6a26a7 2406#define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi))
f4ded5b1
AC
2407#endif
2408
104c1213
JM
2409typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi);
2410extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi);
2411extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address);
83905903
AC
2412#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS)
2413#error "Non multi-arch definition of FRAME_ARGS_ADDRESS"
2414#endif
0f71a2f6 2415#if GDB_MULTI_ARCH
6166d547 2416#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS)
0f71a2f6
JM
2417#define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi))
2418#endif
2419#endif
2420
f4ded5b1
AC
2421/* Default (function) for non- multi-arch platforms. */
2422#if (!GDB_MULTI_ARCH) && !defined (FRAME_LOCALS_ADDRESS)
7d6a26a7 2423#define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
f4ded5b1
AC
2424#endif
2425
104c1213
JM
2426typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi);
2427extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi);
2428extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address);
83905903
AC
2429#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS)
2430#error "Non multi-arch definition of FRAME_LOCALS_ADDRESS"
2431#endif
0f71a2f6 2432#if GDB_MULTI_ARCH
6166d547 2433#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS)
0f71a2f6
JM
2434#define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi))
2435#endif
2436#endif
2437
6913c89a
AC
2438#if defined (DEPRECATED_SAVED_PC_AFTER_CALL)
2439/* Legacy for systems yet to multi-arch DEPRECATED_SAVED_PC_AFTER_CALL */
2440#if !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
2441#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (1)
4443bd83
AC
2442#endif
2443#endif
2444
2445/* Default predicate for non- multi-arch targets. */
6913c89a
AC
2446#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
2447#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (0)
4443bd83
AC
2448#endif
2449
6913c89a
AC
2450extern int gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch);
2451#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
2452#error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
4443bd83 2453#endif
6913c89a
AC
2454#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
2455#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch))
4443bd83
AC
2456#endif
2457
2458/* Default (function) for non- multi-arch platforms. */
6913c89a
AC
2459#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVED_PC_AFTER_CALL)
2460#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_SAVED_PC_AFTER_CALL"), 0)
4443bd83
AC
2461#endif
2462
6913c89a
AC
2463typedef CORE_ADDR (gdbarch_deprecated_saved_pc_after_call_ftype) (struct frame_info *frame);
2464extern CORE_ADDR gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame);
2465extern void set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call);
2466#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL)
2467#error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
83905903 2468#endif
0f71a2f6 2469#if GDB_MULTI_ARCH
6913c89a
AC
2470#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL)
2471#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (gdbarch_deprecated_saved_pc_after_call (current_gdbarch, frame))
0f71a2f6
JM
2472#endif
2473#endif
2474
104c1213
JM
2475typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
2476extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
2477extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
83905903
AC
2478#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS)
2479#error "Non multi-arch definition of FRAME_NUM_ARGS"
2480#endif
0f71a2f6 2481#if GDB_MULTI_ARCH
6166d547 2482#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS)
0f71a2f6
JM
2483#define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
2484#endif
2485#endif
2486
2ada493a
AC
2487#if defined (STACK_ALIGN)
2488/* Legacy for systems yet to multi-arch STACK_ALIGN */
eee30e78 2489#if !defined (STACK_ALIGN_P)
2ada493a
AC
2490#define STACK_ALIGN_P() (1)
2491#endif
eee30e78 2492#endif
2ada493a 2493
33489c5b 2494/* Default predicate for non- multi-arch targets. */
6166d547 2495#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P)
33489c5b
AC
2496#define STACK_ALIGN_P() (0)
2497#endif
2498
2ada493a 2499extern int gdbarch_stack_align_p (struct gdbarch *gdbarch);
83905903
AC
2500#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P)
2501#error "Non multi-arch definition of STACK_ALIGN"
2502#endif
6166d547 2503#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P)
2ada493a
AC
2504#define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch))
2505#endif
2506
33489c5b 2507/* Default (function) for non- multi-arch platforms. */
6166d547 2508#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN)
8e65ff28 2509#define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0)
33489c5b
AC
2510#endif
2511
2ada493a
AC
2512typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp);
2513extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp);
2514extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align);
83905903
AC
2515#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN)
2516#error "Non multi-arch definition of STACK_ALIGN"
2517#endif
33489c5b 2518#if GDB_MULTI_ARCH
6166d547 2519#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN)
2ada493a
AC
2520#define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp))
2521#endif
33489c5b 2522#endif
2ada493a 2523
dc604539
AC
2524extern int gdbarch_frame_align_p (struct gdbarch *gdbarch);
2525
2526typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADDR address);
2527extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
2528extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
2529
f933a9c5
AC
2530/* NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS. */
2531
0a49d05e 2532/* Default (value) for non- multi-arch platforms. */
f933a9c5
AC
2533#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
2534#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (0)
0a49d05e
AC
2535#endif
2536
f933a9c5
AC
2537extern int gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch);
2538extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, int deprecated_extra_stack_alignment_needed);
2539#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
2540#error "Non multi-arch definition of DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED"
83905903 2541#endif
0a49d05e 2542#if GDB_MULTI_ARCH
f933a9c5
AC
2543#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
2544#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_deprecated_extra_stack_alignment_needed (current_gdbarch))
0a49d05e
AC
2545#endif
2546#endif
2547
d03e67c9
AC
2548#if defined (REG_STRUCT_HAS_ADDR)
2549/* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
eee30e78 2550#if !defined (REG_STRUCT_HAS_ADDR_P)
d03e67c9
AC
2551#define REG_STRUCT_HAS_ADDR_P() (1)
2552#endif
eee30e78 2553#endif
d03e67c9 2554
33489c5b 2555/* Default predicate for non- multi-arch targets. */
6166d547 2556#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P)
33489c5b
AC
2557#define REG_STRUCT_HAS_ADDR_P() (0)
2558#endif
2559
d03e67c9 2560extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch);
83905903
AC
2561#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P)
2562#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
2563#endif
6166d547 2564#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P)
d03e67c9
AC
2565#define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch))
2566#endif
2567
33489c5b 2568/* Default (function) for non- multi-arch platforms. */
6166d547 2569#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR)
8e65ff28 2570#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0)
33489c5b
AC
2571#endif
2572
d03e67c9
AC
2573typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
2574extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
2575extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr);
83905903
AC
2576#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR)
2577#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
2578#endif
33489c5b 2579#if GDB_MULTI_ARCH
6166d547 2580#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR)
d03e67c9
AC
2581#define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type))
2582#endif
33489c5b 2583#endif
d03e67c9 2584
a2ce2e56
AC
2585/* FIXME: kettenis/2003-03-08: This should be replaced by a function
2586 parametrized with (at least) the regcache. */
2587
d1e3cf49
AC
2588#if defined (SAVE_DUMMY_FRAME_TOS)
2589/* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
eee30e78 2590#if !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
2591#define SAVE_DUMMY_FRAME_TOS_P() (1)
2592#endif
eee30e78 2593#endif
d1e3cf49
AC
2594
2595/* Default predicate for non- multi-arch targets. */
6166d547 2596#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
2597#define SAVE_DUMMY_FRAME_TOS_P() (0)
2598#endif
2599
2600extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
83905903
AC
2601#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P)
2602#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
2603#endif
6166d547 2604#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
2605#define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch))
2606#endif
2607
2608/* Default (function) for non- multi-arch platforms. */
6166d547 2609#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS)
8e65ff28 2610#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0)
d1e3cf49
AC
2611#endif
2612
2613typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
2614extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp);
2615extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos);
83905903
AC
2616#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS)
2617#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
2618#endif
d1e3cf49 2619#if GDB_MULTI_ARCH
6166d547 2620#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS)
d1e3cf49
AC
2621#define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp))
2622#endif
2623#endif
2624
6314f104
AC
2625extern int gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch);
2626
2627typedef struct frame_id (gdbarch_unwind_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *info);
2628extern struct frame_id gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info);
2629extern void set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, gdbarch_unwind_dummy_id_ftype *unwind_dummy_id);
2630
58d5518e
ND
2631extern int gdbarch_parm_boundary (struct gdbarch *gdbarch);
2632extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary);
83905903
AC
2633#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY)
2634#error "Non multi-arch definition of PARM_BOUNDARY"
2635#endif
58d5518e
ND
2636#if GDB_MULTI_ARCH
2637#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY)
2638#define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
2639#endif
2640#endif
2641
f0d4cc9e 2642/* Default (value) for non- multi-arch platforms. */
6166d547 2643#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT)
f0d4cc9e
AC
2644#define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch))
2645#endif
2646
2647extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
2648extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
83905903
AC
2649#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
2650#error "Non multi-arch definition of TARGET_FLOAT_FORMAT"
2651#endif
f0d4cc9e 2652#if GDB_MULTI_ARCH
6166d547 2653#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT)
f0d4cc9e
AC
2654#define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch))
2655#endif
2656#endif
2657
2658/* Default (value) for non- multi-arch platforms. */
6166d547 2659#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT)
f0d4cc9e
AC
2660#define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch))
2661#endif
2662
2663extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch);
2664extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format);
83905903
AC
2665#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT)
2666#error "Non multi-arch definition of TARGET_DOUBLE_FORMAT"
2667#endif
f0d4cc9e 2668#if GDB_MULTI_ARCH
6166d547 2669#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT)
f0d4cc9e
AC
2670#define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch))
2671#endif
2672#endif
2673
2674/* Default (value) for non- multi-arch platforms. */
6166d547 2675#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT)
2fa5c1e0 2676#define TARGET_LONG_DOUBLE_FORMAT (default_double_format (current_gdbarch))
f0d4cc9e
AC
2677#endif
2678
2679extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch);
2680extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format);
83905903
AC
2681#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT)
2682#error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT"
2683#endif
f0d4cc9e 2684#if GDB_MULTI_ARCH
6166d547 2685#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT)
f0d4cc9e
AC
2686#define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch))
2687#endif
2688#endif
2689
f517ea4e
PS
2690/* Default (function) for non- multi-arch platforms. */
2691#if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR)
875e1767 2692#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr))
f517ea4e
PS
2693#endif
2694
2695typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr);
2696extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr);
2697extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
83905903
AC
2698#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR)
2699#error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR"
2700#endif
f517ea4e
PS
2701#if GDB_MULTI_ARCH
2702#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR)
2703#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr))
2704#endif
2705#endif
2706
875e1767
AC
2707/* On some machines there are bits in addresses which are not really
2708 part of the address, but are used by the kernel, the hardware, etc.
2709 for special purposes. ADDR_BITS_REMOVE takes out any such bits so
2710 we get a "real" address such as one would find in a symbol table.
2711 This is used only for addresses of instructions, and even then I'm
2712 not sure it's used in all contexts. It exists to deal with there
2713 being a few stray bits in the PC which would mislead us, not as some
2714 sort of generic thing to handle alignment or segmentation (it's
2715 possible it should be in TARGET_READ_PC instead). */
2716
2717/* Default (function) for non- multi-arch platforms. */
2718#if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE)
2719#define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr))
2720#endif
2721
2722typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
2723extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
2724extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
83905903
AC
2725#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE)
2726#error "Non multi-arch definition of ADDR_BITS_REMOVE"
2727#endif
875e1767
AC
2728#if GDB_MULTI_ARCH
2729#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE)
2730#define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
2731#endif
2732#endif
2733
5720643c 2734/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
181c1381
RE
2735 ADDR_BITS_REMOVE. */
2736
2737/* Default (function) for non- multi-arch platforms. */
2738#if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS)
2739#define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr))
2740#endif
2741
2742typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
2743extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
2744extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address);
2745#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS)
2746#error "Non multi-arch definition of SMASH_TEXT_ADDRESS"
2747#endif
2748#if GDB_MULTI_ARCH
2749#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS)
2750#define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr))
2751#endif
2752#endif
2753
64c4637f
AC
2754/* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
2755 the target needs software single step. An ISA method to implement it.
2756
2757 FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
2758 using the breakpoint system instead of blatting memory directly (as with rs6000).
2759
2760 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
2761 single step. If not, then implement single step using breakpoints. */
2762
2763#if defined (SOFTWARE_SINGLE_STEP)
2764/* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
2765#if !defined (SOFTWARE_SINGLE_STEP_P)
2766#define SOFTWARE_SINGLE_STEP_P() (1)
2767#endif
2768#endif
2769
2770/* Default predicate for non- multi-arch targets. */
2771#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
2772#define SOFTWARE_SINGLE_STEP_P() (0)
2773#endif
2774
2775extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
83905903
AC
2776#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
2777#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2778#endif
64c4637f
AC
2779#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
2780#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
2781#endif
2782
2783/* Default (function) for non- multi-arch platforms. */
2784#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
2785#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
2786#endif
2787
2788typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
2789extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
2790extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
83905903
AC
2791#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP)
2792#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2793#endif
64c4637f
AC
2794#if GDB_MULTI_ARCH
2795#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
2796#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
2797#endif
2798#endif
2799
2bf0cb65
EZ
2800/* Default (function) for non- multi-arch platforms. */
2801#if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN)
2802#define TARGET_PRINT_INSN(vma, info) (legacy_print_insn (vma, info))
2803#endif
2804
2805typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, disassemble_info *info);
2806extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info);
2807extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
2808#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN)
2809#error "Non multi-arch definition of TARGET_PRINT_INSN"
2810#endif
2811#if GDB_MULTI_ARCH
2812#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PRINT_INSN)
2813#define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info))
2814#endif
2815#endif
2816
bdcd319a
CV
2817/* Default (function) for non- multi-arch platforms. */
2818#if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE)
2819#define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc))
2820#endif
2821
2822typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc);
2823extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc);
2824extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
2825#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE)
2826#error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE"
2827#endif
2828#if GDB_MULTI_ARCH
2829#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE)
2830#define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
2831#endif
2832#endif
2833
68e9cc94
CV
2834/* For SVR4 shared libraries, each call goes through a small piece of
2835 trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
d50355b6 2836 to nonzero if we are currently stopped in one of these. */
68e9cc94
CV
2837
2838/* Default (function) for non- multi-arch platforms. */
2839#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
2840#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name))
2841#endif
2842
2843typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name);
2844extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2845extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline);
2846#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE)
2847#error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE"
2848#endif
2849#if GDB_MULTI_ARCH
2850#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE)
2851#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name))
2852#endif
2853#endif
2854
d50355b6
MS
2855/* Some systems also have trampoline code for returning from shared libs. */
2856
2857/* Default (function) for non- multi-arch platforms. */
2858#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_RETURN_TRAMPOLINE)
2859#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (generic_in_solib_return_trampoline (pc, name))
2860#endif
2861
2862typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name);
2863extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2864extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
2865#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE)
2866#error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE"
2867#endif
2868#if GDB_MULTI_ARCH
2869#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_RETURN_TRAMPOLINE)
2870#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name))
2871#endif
2872#endif
2873
d7bd68ca
AC
2874/* Sigtramp is a routine that the kernel calls (which then calls the
2875 signal handler). On most machines it is a library routine that is
2876 linked into the executable.
2877
2878 This macro, given a program counter value and the name of the
2879 function in which that PC resides (which can be null if the name is
2880 not known), returns nonzero if the PC and name show that we are in
2881 sigtramp.
2882
2883 On most machines just see if the name is sigtramp (and if we have
2884 no name, assume we are not in sigtramp).
2885
2886 FIXME: cagney/2002-04-21: The function find_pc_partial_function
2887 calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP.
2888 This means PC_IN_SIGTRAMP function can't be implemented by doing its
2889 own local NAME lookup.
2890
2891 FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess.
2892 Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other
2893 does not. */
2894
2895/* Default (function) for non- multi-arch platforms. */
2896#if (!GDB_MULTI_ARCH) && !defined (PC_IN_SIGTRAMP)
2897#define PC_IN_SIGTRAMP(pc, name) (legacy_pc_in_sigtramp (pc, name))
2898#endif
2899
2900typedef int (gdbarch_pc_in_sigtramp_ftype) (CORE_ADDR pc, char *name);
2901extern int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2902extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp);
2903#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_SIGTRAMP)
2904#error "Non multi-arch definition of PC_IN_SIGTRAMP"
2905#endif
2906#if GDB_MULTI_ARCH
2907#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_SIGTRAMP)
2908#define PC_IN_SIGTRAMP(pc, name) (gdbarch_pc_in_sigtramp (current_gdbarch, pc, name))
2909#endif
2910#endif
2911
43156d82
MK
2912#if defined (SIGTRAMP_START)
2913/* Legacy for systems yet to multi-arch SIGTRAMP_START */
2914#if !defined (SIGTRAMP_START_P)
2915#define SIGTRAMP_START_P() (1)
2916#endif
2917#endif
2918
2919/* Default predicate for non- multi-arch targets. */
2920#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START_P)
2921#define SIGTRAMP_START_P() (0)
2922#endif
2923
2924extern int gdbarch_sigtramp_start_p (struct gdbarch *gdbarch);
2925#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START_P)
2926#error "Non multi-arch definition of SIGTRAMP_START"
2927#endif
2928#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START_P)
2929#define SIGTRAMP_START_P() (gdbarch_sigtramp_start_p (current_gdbarch))
2930#endif
2931
2932/* Default (function) for non- multi-arch platforms. */
2933#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START)
2934#define SIGTRAMP_START(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_START"), 0)
2935#endif
2936
2937typedef CORE_ADDR (gdbarch_sigtramp_start_ftype) (CORE_ADDR pc);
2938extern CORE_ADDR gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc);
2939extern void set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, gdbarch_sigtramp_start_ftype *sigtramp_start);
2940#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START)
2941#error "Non multi-arch definition of SIGTRAMP_START"
2942#endif
2943#if GDB_MULTI_ARCH
2944#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START)
2945#define SIGTRAMP_START(pc) (gdbarch_sigtramp_start (current_gdbarch, pc))
2946#endif
2947#endif
2948
e76cff22
AC
2949#if defined (SIGTRAMP_END)
2950/* Legacy for systems yet to multi-arch SIGTRAMP_END */
2951#if !defined (SIGTRAMP_END_P)
2952#define SIGTRAMP_END_P() (1)
2953#endif
2954#endif
2955
2956/* Default predicate for non- multi-arch targets. */
2957#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_END_P)
2958#define SIGTRAMP_END_P() (0)
2959#endif
2960
2961extern int gdbarch_sigtramp_end_p (struct gdbarch *gdbarch);
2962#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END_P)
2963#error "Non multi-arch definition of SIGTRAMP_END"
2964#endif
2965#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_END_P)
2966#define SIGTRAMP_END_P() (gdbarch_sigtramp_end_p (current_gdbarch))
2967#endif
2968
2969/* Default (function) for non- multi-arch platforms. */
2970#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_END)
2971#define SIGTRAMP_END(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_END"), 0)
2972#endif
2973
43156d82
MK
2974typedef CORE_ADDR (gdbarch_sigtramp_end_ftype) (CORE_ADDR pc);
2975extern CORE_ADDR gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc);
2976extern void set_gdbarch_sigtramp_end (struct gdbarch *gdbarch, gdbarch_sigtramp_end_ftype *sigtramp_end);
2977#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END)
2978#error "Non multi-arch definition of SIGTRAMP_END"
2979#endif
2980#if GDB_MULTI_ARCH
2981#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_END)
2982#define SIGTRAMP_END(pc) (gdbarch_sigtramp_end (current_gdbarch, pc))
2983#endif
2984#endif
2985
c12260ac
CV
2986/* A target might have problems with watchpoints as soon as the stack
2987 frame of the current function has been destroyed. This mostly happens
2988 as the first action in a funtion's epilogue. in_function_epilogue_p()
2989 is defined to return a non-zero value if either the given addr is one
2990 instruction after the stack destroying instruction up to the trailing
2991 return instruction or if we can figure out that the stack frame has
2992 already been invalidated regardless of the value of addr. Targets
2993 which don't suffer from that problem could just let this functionality
2994 untouched. */
2995
2996typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
2997extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr);
2998extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p);
2999
552c04a7
TT
3000/* Given a vector of command-line arguments, return a newly allocated
3001 string which, when passed to the create_inferior function, will be
3002 parsed (on Unix systems, by the shell) to yield the same vector.
3003 This function should call error() if the argument vector is not
3004 representable for this target or if this target does not support
3005 command-line arguments.
3006 ARGC is the number of elements in the vector.
3007 ARGV is an array of strings, one per argument. */
3008
3009typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdbarch, int argc, char **argv);
3010extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv);
3011extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments);
3012
b6af0555
JS
3013#if defined (DWARF2_BUILD_FRAME_INFO)
3014/* Legacy for systems yet to multi-arch DWARF2_BUILD_FRAME_INFO */
3015#if !defined (DWARF2_BUILD_FRAME_INFO_P)
3016#define DWARF2_BUILD_FRAME_INFO_P() (1)
3017#endif
3018#endif
3019
3020/* Default predicate for non- multi-arch targets. */
3021#if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO_P)
3022#define DWARF2_BUILD_FRAME_INFO_P() (0)
3023#endif
3024
3025extern int gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch);
3026#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO_P)
3027#error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
3028#endif
3029#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO_P)
3030#define DWARF2_BUILD_FRAME_INFO_P() (gdbarch_dwarf2_build_frame_info_p (current_gdbarch))
3031#endif
3032
3033/* Default (function) for non- multi-arch platforms. */
3034#if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO)
3035#define DWARF2_BUILD_FRAME_INFO(objfile) (internal_error (__FILE__, __LINE__, "DWARF2_BUILD_FRAME_INFO"), 0)
3036#endif
3037
3038typedef void (gdbarch_dwarf2_build_frame_info_ftype) (struct objfile *objfile);
3039extern void gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile);
3040extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info);
3041#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO)
3042#error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
3043#endif
3044#if GDB_MULTI_ARCH
3045#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO)
3046#define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile))
3047#endif
3048#endif
3049
a2cf933a
EZ
3050/* Default (function) for non- multi-arch platforms. */
3051#if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL)
3052#define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (default_elf_make_msymbol_special (sym, msym))
3053#endif
3054
3055typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
3056extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
3057extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
3058#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL)
3059#error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL"
3060#endif
3061#if GDB_MULTI_ARCH
3062#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ELF_MAKE_MSYMBOL_SPECIAL)
3063#define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym))
3064#endif
3065#endif
3066
3067/* Default (function) for non- multi-arch platforms. */
3068#if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL)
3069#define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (default_coff_make_msymbol_special (val, msym))
3070#endif
3071
3072typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
3073extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
3074extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
3075#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL)
3076#error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL"
3077#endif
3078#if GDB_MULTI_ARCH
3079#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COFF_MAKE_MSYMBOL_SPECIAL)
3080#define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym))
3081#endif
3082#endif
3083
5720643c
JB
3084/* Default (value) for non- multi-arch platforms. */
3085#if (!GDB_MULTI_ARCH) && !defined (NAME_OF_MALLOC)
3086#define NAME_OF_MALLOC ("malloc")
3087#endif
3088
3089extern const char * gdbarch_name_of_malloc (struct gdbarch *gdbarch);
3090extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * name_of_malloc);
3091#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NAME_OF_MALLOC)
3092#error "Non multi-arch definition of NAME_OF_MALLOC"
3093#endif
3094#if GDB_MULTI_ARCH
3095#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NAME_OF_MALLOC)
3096#define NAME_OF_MALLOC (gdbarch_name_of_malloc (current_gdbarch))
3097#endif
3098#endif
3099
c4ed33b9
AC
3100/* Default (value) for non- multi-arch platforms. */
3101#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STEP_BREAKPOINT)
3102#define CANNOT_STEP_BREAKPOINT (0)
3103#endif
3104
3105extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
3106extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
3107#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT)
3108#error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT"
3109#endif
3110#if GDB_MULTI_ARCH
3111#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STEP_BREAKPOINT)
3112#define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch))
3113#endif
3114#endif
3115
f74fa174
MM
3116/* Default (value) for non- multi-arch platforms. */
3117#if (!GDB_MULTI_ARCH) && !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
3118#define HAVE_NONSTEPPABLE_WATCHPOINT (0)
3119#endif
3120
3121extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
3122extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
3123#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT)
3124#error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT"
3125#endif
3126#if GDB_MULTI_ARCH
3127#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
3128#define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
3129#endif
3130#endif
3131
8b2dbe47
KB
3132#if defined (ADDRESS_CLASS_TYPE_FLAGS)
3133/* Legacy for systems yet to multi-arch ADDRESS_CLASS_TYPE_FLAGS */
3134#if !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
3135#define ADDRESS_CLASS_TYPE_FLAGS_P() (1)
3136#endif
3137#endif
3138
3139/* Default predicate for non- multi-arch targets. */
3140#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
3141#define ADDRESS_CLASS_TYPE_FLAGS_P() (0)
3142#endif
3143
3144extern int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
3145#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_P)
3146#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
3147#endif
3148#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
3149#define ADDRESS_CLASS_TYPE_FLAGS_P() (gdbarch_address_class_type_flags_p (current_gdbarch))
3150#endif
3151
3152/* Default (function) for non- multi-arch platforms. */
3153#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS)
3154#define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (internal_error (__FILE__, __LINE__, "ADDRESS_CLASS_TYPE_FLAGS"), 0)
3155#endif
3156
3157typedef int (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class);
3158extern int gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class);
3159extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags);
3160#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS)
3161#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
3162#endif
3163#if GDB_MULTI_ARCH
3164#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS)
3165#define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (gdbarch_address_class_type_flags (current_gdbarch, byte_size, dwarf2_addr_class))
3166#endif
3167#endif
3168
8b2dbe47 3169extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch);
8b2dbe47 3170
321432c0
KB
3171typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags);
3172extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags);
8b2dbe47 3173extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name);
8b2dbe47
KB
3174
3175extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch);
8b2dbe47 3176
321432c0
KB
3177typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr);
3178extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr);
8b2dbe47 3179extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags);
8b2dbe47 3180
b59ff9d5
AC
3181/* Is a register in a group */
3182
3183typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
3184extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
3185extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p);
3186
104c1213 3187extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
0f71a2f6
JM
3188
3189
3190/* Mechanism for co-ordinating the selection of a specific
3191 architecture.
3192
3193 GDB targets (*-tdep.c) can register an interest in a specific
3194 architecture. Other GDB components can register a need to maintain
3195 per-architecture data.
3196
3197 The mechanisms below ensures that there is only a loose connection
3198 between the set-architecture command and the various GDB
99e7bb18 3199 components. Each component can independently register their need
0f71a2f6
JM
3200 to maintain architecture specific data with gdbarch.
3201
3202 Pragmatics:
3203
3204 Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
3205 didn't scale.
3206
3207 The more traditional mega-struct containing architecture specific
3208 data for all the various GDB components was also considered. Since
99e7bb18 3209 GDB is built from a variable number of (fairly independent)
0f71a2f6
JM
3210 components it was determined that the global aproach was not
3211 applicable. */
3212
3213
3214/* Register a new architectural family with GDB.
3215
3216 Register support for the specified ARCHITECTURE with GDB. When
3217 gdbarch determines that the specified architecture has been
3218 selected, the corresponding INIT function is called.
3219
3220 --
3221
3222 The INIT function takes two parameters: INFO which contains the
3223 information available to gdbarch about the (possibly new)
3224 architecture; ARCHES which is a list of the previously created
3225 ``struct gdbarch'' for this architecture.
3226
0f79675b
AC
3227 The INFO parameter is, as far as possible, be pre-initialized with
3228 information obtained from INFO.ABFD or the previously selected
3229 architecture.
3230
3231 The ARCHES parameter is a linked list (sorted most recently used)
3232 of all the previously created architures for this architecture
3233 family. The (possibly NULL) ARCHES->gdbarch can used to access
3234 values from the previously selected architecture for this
3235 architecture family. The global ``current_gdbarch'' shall not be
3236 used.
0f71a2f6
JM
3237
3238 The INIT function shall return any of: NULL - indicating that it
ec3d358c 3239 doesn't recognize the selected architecture; an existing ``struct
0f71a2f6
JM
3240 gdbarch'' from the ARCHES list - indicating that the new
3241 architecture is just a synonym for an earlier architecture (see
3242 gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
4b9b3959
AC
3243 - that describes the selected architecture (see gdbarch_alloc()).
3244
3245 The DUMP_TDEP function shall print out all target specific values.
3246 Care should be taken to ensure that the function works in both the
3247 multi-arch and non- multi-arch cases. */
0f71a2f6 3248
adf40b2e
JM
3249struct gdbarch_list
3250{
3251 struct gdbarch *gdbarch;
3252 struct gdbarch_list *next;
3253};
0f71a2f6 3254
adf40b2e
JM
3255struct gdbarch_info
3256{
adf40b2e
JM
3257 /* Use default: NULL (ZERO). */
3258 const struct bfd_arch_info *bfd_arch_info;
0f71a2f6 3259
428721aa 3260 /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
adf40b2e 3261 int byte_order;
0f71a2f6 3262
adf40b2e
JM
3263 /* Use default: NULL (ZERO). */
3264 bfd *abfd;
0f71a2f6 3265
adf40b2e
JM
3266 /* Use default: NULL (ZERO). */
3267 struct gdbarch_tdep_info *tdep_info;
4be87837
DJ
3268
3269 /* Use default: GDB_OSABI_UNINITIALIZED (-1). */
3270 enum gdb_osabi osabi;
adf40b2e 3271};
0f71a2f6 3272
104c1213 3273typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
4b9b3959 3274typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
0f71a2f6 3275
4b9b3959 3276/* DEPRECATED - use gdbarch_register() */
104c1213 3277extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
0f71a2f6 3278
4b9b3959
AC
3279extern void gdbarch_register (enum bfd_architecture architecture,
3280 gdbarch_init_ftype *,
3281 gdbarch_dump_tdep_ftype *);
3282
0f71a2f6 3283
b4a20239
AC
3284/* Return a freshly allocated, NULL terminated, array of the valid
3285 architecture names. Since architectures are registered during the
3286 _initialize phase this function only returns useful information
3287 once initialization has been completed. */
3288
3289extern const char **gdbarch_printable_names (void);
3290
3291
0f71a2f6
JM
3292/* Helper function. Search the list of ARCHES for a GDBARCH that
3293 matches the information provided by INFO. */
3294
104c1213 3295extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
0f71a2f6
JM
3296
3297
3298/* Helper function. Create a preliminary ``struct gdbarch''. Perform
3299 basic initialization using values obtained from the INFO andTDEP
3300 parameters. set_gdbarch_*() functions are called to complete the
3301 initialization of the object. */
3302
104c1213 3303extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
0f71a2f6
JM
3304
3305
4b9b3959
AC
3306/* Helper function. Free a partially-constructed ``struct gdbarch''.
3307 It is assumed that the caller freeds the ``struct
3308 gdbarch_tdep''. */
3309
058f20d5
JB
3310extern void gdbarch_free (struct gdbarch *);
3311
3312
b732d07d 3313/* Helper function. Force an update of the current architecture.
0f71a2f6 3314
b732d07d
AC
3315 The actual architecture selected is determined by INFO, ``(gdb) set
3316 architecture'' et.al., the existing architecture and BFD's default
3317 architecture. INFO should be initialized to zero and then selected
3318 fields should be updated.
0f71a2f6 3319
16f33e29
AC
3320 Returns non-zero if the update succeeds */
3321
3322extern int gdbarch_update_p (struct gdbarch_info info);
0f71a2f6
JM
3323
3324
3325
3326/* Register per-architecture data-pointer.
3327
3328 Reserve space for a per-architecture data-pointer. An identifier
3329 for the reserved data-pointer is returned. That identifer should
95160752 3330 be saved in a local static variable.
0f71a2f6 3331
76860b5f
AC
3332 The per-architecture data-pointer is either initialized explicitly
3333 (set_gdbarch_data()) or implicitly (by INIT() via a call to
3334 gdbarch_data()). FREE() is called to delete either an existing
2af496cb 3335 data-pointer overridden by set_gdbarch_data() or when the
76860b5f 3336 architecture object is being deleted.
0f71a2f6 3337
95160752
AC
3338 When a previously created architecture is re-selected, the
3339 per-architecture data-pointer for that previous architecture is
76860b5f 3340 restored. INIT() is not re-called.
0f71a2f6
JM
3341
3342 Multiple registrarants for any architecture are allowed (and
3343 strongly encouraged). */
3344
95160752 3345struct gdbarch_data;
0f71a2f6 3346
95160752
AC
3347typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
3348typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
3349 void *pointer);
3350extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
3351 gdbarch_data_free_ftype *free);
3352extern void set_gdbarch_data (struct gdbarch *gdbarch,
3353 struct gdbarch_data *data,
3354 void *pointer);
0f71a2f6 3355
451fbdda 3356extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
0f71a2f6
JM
3357
3358
0f71a2f6
JM
3359/* Register per-architecture memory region.
3360
3361 Provide a memory-region swap mechanism. Per-architecture memory
3362 region are created. These memory regions are swapped whenever the
3363 architecture is changed. For a new architecture, the memory region
3364 is initialized with zero (0) and the INIT function is called.
3365
3366 Memory regions are swapped / initialized in the order that they are
3367 registered. NULL DATA and/or INIT values can be specified.
3368
3369 New code should use register_gdbarch_data(). */
3370
104c1213
JM
3371typedef void (gdbarch_swap_ftype) (void);
3372extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init);
e514a9d6 3373#define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL)
0f71a2f6
JM
3374
3375
3376
99e7bb18 3377/* The target-system-dependent byte order is dynamic */
c906108c 3378
adf40b2e 3379extern int target_byte_order;
c906108c
SS
3380#ifndef TARGET_BYTE_ORDER
3381#define TARGET_BYTE_ORDER (target_byte_order + 0)
3382#endif
3383
adf40b2e 3384extern int target_byte_order_auto;
c906108c
SS
3385#ifndef TARGET_BYTE_ORDER_AUTO
3386#define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
3387#endif
3388
3389
3390
99e7bb18 3391/* The target-system-dependent BFD architecture is dynamic */
c906108c 3392
adf40b2e 3393extern int target_architecture_auto;
c906108c
SS
3394#ifndef TARGET_ARCHITECTURE_AUTO
3395#define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
3396#endif
3397
adf40b2e 3398extern const struct bfd_arch_info *target_architecture;
c906108c
SS
3399#ifndef TARGET_ARCHITECTURE
3400#define TARGET_ARCHITECTURE (target_architecture + 0)
3401#endif
3402
c906108c 3403
99e7bb18 3404/* The target-system-dependent disassembler is semi-dynamic */
c906108c 3405
810ecf9f 3406/* Use gdb_disassemble, and gdbarch_print_insn instead. */
d7a27068 3407extern int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info*);
c906108c 3408
810ecf9f
AC
3409/* Use set_gdbarch_print_insn instead. */
3410extern disassemble_info deprecated_tm_print_insn_info;
c906108c 3411
99e7bb18 3412/* Set the dynamic target-system-dependent parameters (architecture,
c906108c
SS
3413 byte-order, ...) using information found in the BFD */
3414
104c1213 3415extern void set_gdbarch_from_file (bfd *);
c906108c
SS
3416
3417
e514a9d6
JM
3418/* Initialize the current architecture to the "first" one we find on
3419 our list. */
3420
3421extern void initialize_current_architecture (void);
3422
ceaa8edf
JB
3423/* For non-multiarched targets, do any initialization of the default
3424 gdbarch object necessary after the _initialize_MODULE functions
3425 have run. */
5ae5f592 3426extern void initialize_non_multiarch (void);
cce74817 3427
c906108c 3428/* gdbarch trace variable */
adf40b2e 3429extern int gdbarch_debug;
c906108c 3430
4b9b3959 3431extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
0f71a2f6 3432
c906108c 3433#endif
This page took 0.46585 seconds and 4 git commands to generate.