2003-05-08 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
33489c5b 2166/* Default (function) for non- multi-arch platforms. */
6166d547 2167#if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC)
33489c5b
AC
2168#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr))
2169#endif
2170
f4f9705a
AC
2171typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
2172extern const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
104c1213 2173extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
83905903
AC
2174#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
2175#error "Non multi-arch definition of BREAKPOINT_FROM_PC"
2176#endif
33489c5b 2177#if GDB_MULTI_ARCH
6166d547 2178#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC)
0f71a2f6
JM
2179#define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
2180#endif
33489c5b
AC
2181#endif
2182
2183/* Default (function) for non- multi-arch platforms. */
6166d547 2184#if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT)
33489c5b
AC
2185#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache))
2186#endif
0f71a2f6 2187
917317f4
JM
2188typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
2189extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
2190extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
83905903
AC
2191#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT)
2192#error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT"
2193#endif
33489c5b 2194#if GDB_MULTI_ARCH
6166d547 2195#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT)
917317f4
JM
2196#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache))
2197#endif
33489c5b
AC
2198#endif
2199
2200/* Default (function) for non- multi-arch platforms. */
6166d547 2201#if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT)
33489c5b
AC
2202#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache))
2203#endif
917317f4
JM
2204
2205typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
2206extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
2207extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
83905903
AC
2208#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT)
2209#error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT"
2210#endif
33489c5b 2211#if GDB_MULTI_ARCH
6166d547 2212#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT)
917317f4
JM
2213#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache))
2214#endif
33489c5b 2215#endif
917317f4 2216
104c1213
JM
2217extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
2218extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
83905903
AC
2219#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK)
2220#error "Non multi-arch definition of DECR_PC_AFTER_BREAK"
2221#endif
0f71a2f6 2222#if GDB_MULTI_ARCH
6166d547 2223#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK)
0f71a2f6
JM
2224#define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
2225#endif
2226#endif
2227
e02bc4cc
DS
2228/* Default (function) for non- multi-arch platforms. */
2229#if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED)
2230#define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it))
2231#endif
2232
2233typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it);
2234extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it);
2235extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed);
83905903
AC
2236#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED)
2237#error "Non multi-arch definition of PREPARE_TO_PROCEED"
2238#endif
e02bc4cc
DS
2239#if GDB_MULTI_ARCH
2240#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED)
2241#define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it))
2242#endif
2243#endif
2244
104c1213
JM
2245extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
2246extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
83905903
AC
2247#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
2248#error "Non multi-arch definition of FUNCTION_START_OFFSET"
2249#endif
0f71a2f6 2250#if GDB_MULTI_ARCH
6166d547 2251#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET)
0f71a2f6
JM
2252#define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
2253#endif
2254#endif
2255
f6684c31
AC
2256typedef 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);
2257extern 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 2258extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
0f71a2f6 2259
104c1213
JM
2260extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
2261extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
83905903
AC
2262#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP)
2263#error "Non multi-arch definition of FRAME_ARGS_SKIP"
2264#endif
0f71a2f6 2265#if GDB_MULTI_ARCH
6166d547 2266#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP)
0f71a2f6
JM
2267#define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
2268#endif
2269#endif
2270
33489c5b 2271/* Default (function) for non- multi-arch platforms. */
6166d547 2272#if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION)
33489c5b
AC
2273#define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi))
2274#endif
2275
104c1213
JM
2276typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi);
2277extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi);
2278extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation);
83905903
AC
2279#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION)
2280#error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION"
2281#endif
33489c5b 2282#if GDB_MULTI_ARCH
6166d547 2283#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION)
0f71a2f6
JM
2284#define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi))
2285#endif
33489c5b 2286#endif
0f71a2f6 2287
618ce49f
AC
2288#if defined (DEPRECATED_FRAME_CHAIN)
2289/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN */
2290#if !defined (DEPRECATED_FRAME_CHAIN_P)
2291#define DEPRECATED_FRAME_CHAIN_P() (1)
d62d1979
AC
2292#endif
2293#endif
2294
2295/* Default predicate for non- multi-arch targets. */
618ce49f
AC
2296#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_P)
2297#define DEPRECATED_FRAME_CHAIN_P() (0)
d62d1979
AC
2298#endif
2299
618ce49f
AC
2300extern int gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch);
2301#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_P)
2302#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN"
d62d1979 2303#endif
618ce49f
AC
2304#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_P)
2305#define DEPRECATED_FRAME_CHAIN_P() (gdbarch_deprecated_frame_chain_p (current_gdbarch))
d62d1979
AC
2306#endif
2307
2308/* Default (function) for non- multi-arch platforms. */
618ce49f
AC
2309#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN)
2310#define DEPRECATED_FRAME_CHAIN(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN"), 0)
d62d1979
AC
2311#endif
2312
618ce49f
AC
2313typedef CORE_ADDR (gdbarch_deprecated_frame_chain_ftype) (struct frame_info *frame);
2314extern CORE_ADDR gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame);
2315extern void set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain);
2316#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN)
2317#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN"
83905903 2318#endif
0f71a2f6 2319#if GDB_MULTI_ARCH
618ce49f
AC
2320#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN)
2321#define DEPRECATED_FRAME_CHAIN(frame) (gdbarch_deprecated_frame_chain (current_gdbarch, frame))
0f71a2f6
JM
2322#endif
2323#endif
2324
618ce49f
AC
2325#if defined (DEPRECATED_FRAME_CHAIN_VALID)
2326/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_CHAIN_VALID */
2327#if !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
2328#define DEPRECATED_FRAME_CHAIN_VALID_P() (1)
51603483
DJ
2329#endif
2330#endif
2331
2332/* Default predicate for non- multi-arch targets. */
618ce49f
AC
2333#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
2334#define DEPRECATED_FRAME_CHAIN_VALID_P() (0)
51603483
DJ
2335#endif
2336
618ce49f
AC
2337extern int gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch);
2338#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID_P)
2339#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID"
51603483 2340#endif
618ce49f
AC
2341#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
2342#define DEPRECATED_FRAME_CHAIN_VALID_P() (gdbarch_deprecated_frame_chain_valid_p (current_gdbarch))
51603483 2343#endif
7f55af32
AC
2344
2345/* Default (function) for non- multi-arch platforms. */
618ce49f
AC
2346#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID)
2347#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN_VALID"), 0)
7f55af32 2348#endif
028c194b 2349
618ce49f
AC
2350typedef int (gdbarch_deprecated_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
2351extern int gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe);
2352extern void set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid);
2353#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID)
2354#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID"
83905903 2355#endif
0f71a2f6 2356#if GDB_MULTI_ARCH
618ce49f
AC
2357#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID)
2358#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_deprecated_frame_chain_valid (current_gdbarch, chain, thisframe))
0f71a2f6
JM
2359#endif
2360#endif
2361
8bedc050
AC
2362/* DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC. Please
2363 note, per UNWIND_PC's doco, that while the two have similar
2364 interfaces they have very different underlying implementations. */
12cc2063 2365
8bedc050
AC
2366#if defined (DEPRECATED_FRAME_SAVED_PC)
2367/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_SAVED_PC */
2368#if !defined (DEPRECATED_FRAME_SAVED_PC_P)
2369#define DEPRECATED_FRAME_SAVED_PC_P() (1)
d62d1979
AC
2370#endif
2371#endif
2372
2373/* Default predicate for non- multi-arch targets. */
8bedc050
AC
2374#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC_P)
2375#define DEPRECATED_FRAME_SAVED_PC_P() (0)
d62d1979
AC
2376#endif
2377
8bedc050
AC
2378extern int gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch);
2379#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC_P)
2380#error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
d62d1979 2381#endif
8bedc050
AC
2382#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC_P)
2383#define DEPRECATED_FRAME_SAVED_PC_P() (gdbarch_deprecated_frame_saved_pc_p (current_gdbarch))
d62d1979
AC
2384#endif
2385
2386/* Default (function) for non- multi-arch platforms. */
8bedc050
AC
2387#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC)
2388#define DEPRECATED_FRAME_SAVED_PC(fi) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_SAVED_PC"), 0)
d62d1979
AC
2389#endif
2390
8bedc050
AC
2391typedef CORE_ADDR (gdbarch_deprecated_frame_saved_pc_ftype) (struct frame_info *fi);
2392extern CORE_ADDR gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
2393extern void set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc);
2394#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC)
2395#error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
83905903 2396#endif
0f71a2f6 2397#if GDB_MULTI_ARCH
8bedc050
AC
2398#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC)
2399#define DEPRECATED_FRAME_SAVED_PC(fi) (gdbarch_deprecated_frame_saved_pc (current_gdbarch, fi))
0f71a2f6
JM
2400#endif
2401#endif
2402
12cc2063
AC
2403extern int gdbarch_unwind_pc_p (struct gdbarch *gdbarch);
2404
2405typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
2406extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame);
2407extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc);
2408
f4ded5b1
AC
2409/* Default (function) for non- multi-arch platforms. */
2410#if (!GDB_MULTI_ARCH) && !defined (FRAME_ARGS_ADDRESS)
7d6a26a7 2411#define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi))
f4ded5b1
AC
2412#endif
2413
104c1213
JM
2414typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi);
2415extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi);
2416extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address);
83905903
AC
2417#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS)
2418#error "Non multi-arch definition of FRAME_ARGS_ADDRESS"
2419#endif
0f71a2f6 2420#if GDB_MULTI_ARCH
6166d547 2421#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS)
0f71a2f6
JM
2422#define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi))
2423#endif
2424#endif
2425
f4ded5b1
AC
2426/* Default (function) for non- multi-arch platforms. */
2427#if (!GDB_MULTI_ARCH) && !defined (FRAME_LOCALS_ADDRESS)
7d6a26a7 2428#define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
f4ded5b1
AC
2429#endif
2430
104c1213
JM
2431typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi);
2432extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi);
2433extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address);
83905903
AC
2434#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS)
2435#error "Non multi-arch definition of FRAME_LOCALS_ADDRESS"
2436#endif
0f71a2f6 2437#if GDB_MULTI_ARCH
6166d547 2438#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS)
0f71a2f6
JM
2439#define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi))
2440#endif
2441#endif
2442
6913c89a
AC
2443#if defined (DEPRECATED_SAVED_PC_AFTER_CALL)
2444/* Legacy for systems yet to multi-arch DEPRECATED_SAVED_PC_AFTER_CALL */
2445#if !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
2446#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (1)
4443bd83
AC
2447#endif
2448#endif
2449
2450/* Default predicate for non- multi-arch targets. */
6913c89a
AC
2451#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
2452#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (0)
4443bd83
AC
2453#endif
2454
6913c89a
AC
2455extern int gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch);
2456#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
2457#error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
4443bd83 2458#endif
6913c89a
AC
2459#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
2460#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch))
4443bd83
AC
2461#endif
2462
2463/* Default (function) for non- multi-arch platforms. */
6913c89a
AC
2464#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVED_PC_AFTER_CALL)
2465#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_SAVED_PC_AFTER_CALL"), 0)
4443bd83
AC
2466#endif
2467
6913c89a
AC
2468typedef CORE_ADDR (gdbarch_deprecated_saved_pc_after_call_ftype) (struct frame_info *frame);
2469extern CORE_ADDR gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame);
2470extern void set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call);
2471#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL)
2472#error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
83905903 2473#endif
0f71a2f6 2474#if GDB_MULTI_ARCH
6913c89a
AC
2475#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL)
2476#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (gdbarch_deprecated_saved_pc_after_call (current_gdbarch, frame))
0f71a2f6
JM
2477#endif
2478#endif
2479
104c1213
JM
2480typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
2481extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
2482extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
83905903
AC
2483#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS)
2484#error "Non multi-arch definition of FRAME_NUM_ARGS"
2485#endif
0f71a2f6 2486#if GDB_MULTI_ARCH
6166d547 2487#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS)
0f71a2f6
JM
2488#define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
2489#endif
2490#endif
2491
2ada493a
AC
2492#if defined (STACK_ALIGN)
2493/* Legacy for systems yet to multi-arch STACK_ALIGN */
eee30e78 2494#if !defined (STACK_ALIGN_P)
2ada493a
AC
2495#define STACK_ALIGN_P() (1)
2496#endif
eee30e78 2497#endif
2ada493a 2498
33489c5b 2499/* Default predicate for non- multi-arch targets. */
6166d547 2500#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P)
33489c5b
AC
2501#define STACK_ALIGN_P() (0)
2502#endif
2503
2ada493a 2504extern int gdbarch_stack_align_p (struct gdbarch *gdbarch);
83905903
AC
2505#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P)
2506#error "Non multi-arch definition of STACK_ALIGN"
2507#endif
6166d547 2508#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P)
2ada493a
AC
2509#define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch))
2510#endif
2511
33489c5b 2512/* Default (function) for non- multi-arch platforms. */
6166d547 2513#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN)
8e65ff28 2514#define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0)
33489c5b
AC
2515#endif
2516
2ada493a
AC
2517typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp);
2518extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp);
2519extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align);
83905903
AC
2520#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN)
2521#error "Non multi-arch definition of STACK_ALIGN"
2522#endif
33489c5b 2523#if GDB_MULTI_ARCH
6166d547 2524#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN)
2ada493a
AC
2525#define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp))
2526#endif
33489c5b 2527#endif
2ada493a 2528
dc604539
AC
2529extern int gdbarch_frame_align_p (struct gdbarch *gdbarch);
2530
2531typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADDR address);
2532extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
2533extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
2534
f933a9c5
AC
2535/* NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS. */
2536
0a49d05e 2537/* Default (value) for non- multi-arch platforms. */
f933a9c5
AC
2538#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
2539#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (0)
0a49d05e
AC
2540#endif
2541
f933a9c5
AC
2542extern int gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch);
2543extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, int deprecated_extra_stack_alignment_needed);
2544#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
2545#error "Non multi-arch definition of DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED"
83905903 2546#endif
0a49d05e 2547#if GDB_MULTI_ARCH
f933a9c5
AC
2548#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
2549#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_deprecated_extra_stack_alignment_needed (current_gdbarch))
0a49d05e
AC
2550#endif
2551#endif
2552
d03e67c9
AC
2553#if defined (REG_STRUCT_HAS_ADDR)
2554/* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
eee30e78 2555#if !defined (REG_STRUCT_HAS_ADDR_P)
d03e67c9
AC
2556#define REG_STRUCT_HAS_ADDR_P() (1)
2557#endif
eee30e78 2558#endif
d03e67c9 2559
33489c5b 2560/* Default predicate for non- multi-arch targets. */
6166d547 2561#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P)
33489c5b
AC
2562#define REG_STRUCT_HAS_ADDR_P() (0)
2563#endif
2564
d03e67c9 2565extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch);
83905903
AC
2566#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P)
2567#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
2568#endif
6166d547 2569#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P)
d03e67c9
AC
2570#define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch))
2571#endif
2572
33489c5b 2573/* Default (function) for non- multi-arch platforms. */
6166d547 2574#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR)
8e65ff28 2575#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0)
33489c5b
AC
2576#endif
2577
d03e67c9
AC
2578typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
2579extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
2580extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr);
83905903
AC
2581#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR)
2582#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
2583#endif
33489c5b 2584#if GDB_MULTI_ARCH
6166d547 2585#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR)
d03e67c9
AC
2586#define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type))
2587#endif
33489c5b 2588#endif
d03e67c9 2589
a2ce2e56
AC
2590/* FIXME: kettenis/2003-03-08: This should be replaced by a function
2591 parametrized with (at least) the regcache. */
2592
d1e3cf49
AC
2593#if defined (SAVE_DUMMY_FRAME_TOS)
2594/* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
eee30e78 2595#if !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
2596#define SAVE_DUMMY_FRAME_TOS_P() (1)
2597#endif
eee30e78 2598#endif
d1e3cf49
AC
2599
2600/* Default predicate for non- multi-arch targets. */
6166d547 2601#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
2602#define SAVE_DUMMY_FRAME_TOS_P() (0)
2603#endif
2604
2605extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
83905903
AC
2606#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P)
2607#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
2608#endif
6166d547 2609#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
2610#define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch))
2611#endif
2612
2613/* Default (function) for non- multi-arch platforms. */
6166d547 2614#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS)
8e65ff28 2615#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0)
d1e3cf49
AC
2616#endif
2617
2618typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
2619extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp);
2620extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos);
83905903
AC
2621#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS)
2622#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
2623#endif
d1e3cf49 2624#if GDB_MULTI_ARCH
6166d547 2625#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS)
d1e3cf49
AC
2626#define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp))
2627#endif
2628#endif
2629
6314f104
AC
2630extern int gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch);
2631
2632typedef struct frame_id (gdbarch_unwind_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *info);
2633extern struct frame_id gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info);
2634extern void set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, gdbarch_unwind_dummy_id_ftype *unwind_dummy_id);
2635
58d5518e
ND
2636extern int gdbarch_parm_boundary (struct gdbarch *gdbarch);
2637extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary);
83905903
AC
2638#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY)
2639#error "Non multi-arch definition of PARM_BOUNDARY"
2640#endif
58d5518e
ND
2641#if GDB_MULTI_ARCH
2642#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY)
2643#define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
2644#endif
2645#endif
2646
f0d4cc9e 2647/* Default (value) for non- multi-arch platforms. */
6166d547 2648#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT)
f0d4cc9e
AC
2649#define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch))
2650#endif
2651
2652extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
2653extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
83905903
AC
2654#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
2655#error "Non multi-arch definition of TARGET_FLOAT_FORMAT"
2656#endif
f0d4cc9e 2657#if GDB_MULTI_ARCH
6166d547 2658#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT)
f0d4cc9e
AC
2659#define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch))
2660#endif
2661#endif
2662
2663/* Default (value) for non- multi-arch platforms. */
6166d547 2664#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT)
f0d4cc9e
AC
2665#define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch))
2666#endif
2667
2668extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch);
2669extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format);
83905903
AC
2670#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT)
2671#error "Non multi-arch definition of TARGET_DOUBLE_FORMAT"
2672#endif
f0d4cc9e 2673#if GDB_MULTI_ARCH
6166d547 2674#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT)
f0d4cc9e
AC
2675#define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch))
2676#endif
2677#endif
2678
2679/* Default (value) for non- multi-arch platforms. */
6166d547 2680#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT)
2fa5c1e0 2681#define TARGET_LONG_DOUBLE_FORMAT (default_double_format (current_gdbarch))
f0d4cc9e
AC
2682#endif
2683
2684extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch);
2685extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format);
83905903
AC
2686#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT)
2687#error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT"
2688#endif
f0d4cc9e 2689#if GDB_MULTI_ARCH
6166d547 2690#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT)
f0d4cc9e
AC
2691#define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch))
2692#endif
2693#endif
2694
f517ea4e
PS
2695/* Default (function) for non- multi-arch platforms. */
2696#if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR)
875e1767 2697#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr))
f517ea4e
PS
2698#endif
2699
2700typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr);
2701extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr);
2702extern 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
2703#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR)
2704#error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR"
2705#endif
f517ea4e
PS
2706#if GDB_MULTI_ARCH
2707#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR)
2708#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr))
2709#endif
2710#endif
2711
875e1767
AC
2712/* On some machines there are bits in addresses which are not really
2713 part of the address, but are used by the kernel, the hardware, etc.
2714 for special purposes. ADDR_BITS_REMOVE takes out any such bits so
2715 we get a "real" address such as one would find in a symbol table.
2716 This is used only for addresses of instructions, and even then I'm
2717 not sure it's used in all contexts. It exists to deal with there
2718 being a few stray bits in the PC which would mislead us, not as some
2719 sort of generic thing to handle alignment or segmentation (it's
2720 possible it should be in TARGET_READ_PC instead). */
2721
2722/* Default (function) for non- multi-arch platforms. */
2723#if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE)
2724#define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr))
2725#endif
2726
2727typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
2728extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
2729extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
83905903
AC
2730#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE)
2731#error "Non multi-arch definition of ADDR_BITS_REMOVE"
2732#endif
875e1767
AC
2733#if GDB_MULTI_ARCH
2734#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE)
2735#define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
2736#endif
2737#endif
2738
5720643c 2739/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
181c1381
RE
2740 ADDR_BITS_REMOVE. */
2741
2742/* Default (function) for non- multi-arch platforms. */
2743#if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS)
2744#define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr))
2745#endif
2746
2747typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
2748extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
2749extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address);
2750#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS)
2751#error "Non multi-arch definition of SMASH_TEXT_ADDRESS"
2752#endif
2753#if GDB_MULTI_ARCH
2754#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS)
2755#define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr))
2756#endif
2757#endif
2758
64c4637f
AC
2759/* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
2760 the target needs software single step. An ISA method to implement it.
2761
2762 FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
2763 using the breakpoint system instead of blatting memory directly (as with rs6000).
2764
2765 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
2766 single step. If not, then implement single step using breakpoints. */
2767
2768#if defined (SOFTWARE_SINGLE_STEP)
2769/* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
2770#if !defined (SOFTWARE_SINGLE_STEP_P)
2771#define SOFTWARE_SINGLE_STEP_P() (1)
2772#endif
2773#endif
2774
2775/* Default predicate for non- multi-arch targets. */
2776#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
2777#define SOFTWARE_SINGLE_STEP_P() (0)
2778#endif
2779
2780extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
83905903
AC
2781#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
2782#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2783#endif
64c4637f
AC
2784#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
2785#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
2786#endif
2787
2788/* Default (function) for non- multi-arch platforms. */
2789#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
2790#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
2791#endif
2792
2793typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
2794extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
2795extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
83905903
AC
2796#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP)
2797#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2798#endif
64c4637f
AC
2799#if GDB_MULTI_ARCH
2800#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
2801#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
2802#endif
2803#endif
2804
2bf0cb65
EZ
2805/* Default (function) for non- multi-arch platforms. */
2806#if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN)
2807#define TARGET_PRINT_INSN(vma, info) (legacy_print_insn (vma, info))
2808#endif
2809
2810typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, disassemble_info *info);
2811extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info);
2812extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
2813#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN)
2814#error "Non multi-arch definition of TARGET_PRINT_INSN"
2815#endif
2816#if GDB_MULTI_ARCH
2817#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PRINT_INSN)
2818#define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info))
2819#endif
2820#endif
2821
bdcd319a
CV
2822/* Default (function) for non- multi-arch platforms. */
2823#if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE)
2824#define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc))
2825#endif
2826
2827typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc);
2828extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc);
2829extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
2830#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_TRAMPOLINE_CODE)
2831#error "Non multi-arch definition of SKIP_TRAMPOLINE_CODE"
2832#endif
2833#if GDB_MULTI_ARCH
2834#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_TRAMPOLINE_CODE)
2835#define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
2836#endif
2837#endif
2838
68e9cc94
CV
2839/* For SVR4 shared libraries, each call goes through a small piece of
2840 trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
d50355b6 2841 to nonzero if we are currently stopped in one of these. */
68e9cc94
CV
2842
2843/* Default (function) for non- multi-arch platforms. */
2844#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
2845#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name))
2846#endif
2847
2848typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name);
2849extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2850extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline);
2851#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE)
2852#error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE"
2853#endif
2854#if GDB_MULTI_ARCH
2855#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE)
2856#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name))
2857#endif
2858#endif
2859
d50355b6
MS
2860/* Some systems also have trampoline code for returning from shared libs. */
2861
2862/* Default (function) for non- multi-arch platforms. */
2863#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_RETURN_TRAMPOLINE)
2864#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (generic_in_solib_return_trampoline (pc, name))
2865#endif
2866
2867typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name);
2868extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2869extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
2870#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE)
2871#error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE"
2872#endif
2873#if GDB_MULTI_ARCH
2874#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_RETURN_TRAMPOLINE)
2875#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name))
2876#endif
2877#endif
2878
d7bd68ca
AC
2879/* Sigtramp is a routine that the kernel calls (which then calls the
2880 signal handler). On most machines it is a library routine that is
2881 linked into the executable.
2882
2883 This macro, given a program counter value and the name of the
2884 function in which that PC resides (which can be null if the name is
2885 not known), returns nonzero if the PC and name show that we are in
2886 sigtramp.
2887
2888 On most machines just see if the name is sigtramp (and if we have
2889 no name, assume we are not in sigtramp).
2890
2891 FIXME: cagney/2002-04-21: The function find_pc_partial_function
2892 calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP.
2893 This means PC_IN_SIGTRAMP function can't be implemented by doing its
2894 own local NAME lookup.
2895
2896 FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess.
2897 Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other
2898 does not. */
2899
2900/* Default (function) for non- multi-arch platforms. */
2901#if (!GDB_MULTI_ARCH) && !defined (PC_IN_SIGTRAMP)
2902#define PC_IN_SIGTRAMP(pc, name) (legacy_pc_in_sigtramp (pc, name))
2903#endif
2904
2905typedef int (gdbarch_pc_in_sigtramp_ftype) (CORE_ADDR pc, char *name);
2906extern int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
2907extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp);
2908#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_SIGTRAMP)
2909#error "Non multi-arch definition of PC_IN_SIGTRAMP"
2910#endif
2911#if GDB_MULTI_ARCH
2912#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_SIGTRAMP)
2913#define PC_IN_SIGTRAMP(pc, name) (gdbarch_pc_in_sigtramp (current_gdbarch, pc, name))
2914#endif
2915#endif
2916
43156d82
MK
2917#if defined (SIGTRAMP_START)
2918/* Legacy for systems yet to multi-arch SIGTRAMP_START */
2919#if !defined (SIGTRAMP_START_P)
2920#define SIGTRAMP_START_P() (1)
2921#endif
2922#endif
2923
2924/* Default predicate for non- multi-arch targets. */
2925#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START_P)
2926#define SIGTRAMP_START_P() (0)
2927#endif
2928
2929extern int gdbarch_sigtramp_start_p (struct gdbarch *gdbarch);
2930#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START_P)
2931#error "Non multi-arch definition of SIGTRAMP_START"
2932#endif
2933#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START_P)
2934#define SIGTRAMP_START_P() (gdbarch_sigtramp_start_p (current_gdbarch))
2935#endif
2936
2937/* Default (function) for non- multi-arch platforms. */
2938#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START)
2939#define SIGTRAMP_START(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_START"), 0)
2940#endif
2941
2942typedef CORE_ADDR (gdbarch_sigtramp_start_ftype) (CORE_ADDR pc);
2943extern CORE_ADDR gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc);
2944extern void set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, gdbarch_sigtramp_start_ftype *sigtramp_start);
2945#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START)
2946#error "Non multi-arch definition of SIGTRAMP_START"
2947#endif
2948#if GDB_MULTI_ARCH
2949#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_START)
2950#define SIGTRAMP_START(pc) (gdbarch_sigtramp_start (current_gdbarch, pc))
2951#endif
2952#endif
2953
e76cff22
AC
2954#if defined (SIGTRAMP_END)
2955/* Legacy for systems yet to multi-arch SIGTRAMP_END */
2956#if !defined (SIGTRAMP_END_P)
2957#define SIGTRAMP_END_P() (1)
2958#endif
2959#endif
2960
2961/* Default predicate for non- multi-arch targets. */
2962#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_END_P)
2963#define SIGTRAMP_END_P() (0)
2964#endif
2965
2966extern int gdbarch_sigtramp_end_p (struct gdbarch *gdbarch);
2967#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END_P)
2968#error "Non multi-arch definition of SIGTRAMP_END"
2969#endif
2970#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_END_P)
2971#define SIGTRAMP_END_P() (gdbarch_sigtramp_end_p (current_gdbarch))
2972#endif
2973
2974/* Default (function) for non- multi-arch platforms. */
2975#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_END)
2976#define SIGTRAMP_END(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_END"), 0)
2977#endif
2978
43156d82
MK
2979typedef CORE_ADDR (gdbarch_sigtramp_end_ftype) (CORE_ADDR pc);
2980extern CORE_ADDR gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc);
2981extern void set_gdbarch_sigtramp_end (struct gdbarch *gdbarch, gdbarch_sigtramp_end_ftype *sigtramp_end);
2982#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END)
2983#error "Non multi-arch definition of SIGTRAMP_END"
2984#endif
2985#if GDB_MULTI_ARCH
2986#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIGTRAMP_END)
2987#define SIGTRAMP_END(pc) (gdbarch_sigtramp_end (current_gdbarch, pc))
2988#endif
2989#endif
2990
c12260ac
CV
2991/* A target might have problems with watchpoints as soon as the stack
2992 frame of the current function has been destroyed. This mostly happens
2993 as the first action in a funtion's epilogue. in_function_epilogue_p()
2994 is defined to return a non-zero value if either the given addr is one
2995 instruction after the stack destroying instruction up to the trailing
2996 return instruction or if we can figure out that the stack frame has
2997 already been invalidated regardless of the value of addr. Targets
2998 which don't suffer from that problem could just let this functionality
2999 untouched. */
3000
3001typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
3002extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr);
3003extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p);
3004
552c04a7
TT
3005/* Given a vector of command-line arguments, return a newly allocated
3006 string which, when passed to the create_inferior function, will be
3007 parsed (on Unix systems, by the shell) to yield the same vector.
3008 This function should call error() if the argument vector is not
3009 representable for this target or if this target does not support
3010 command-line arguments.
3011 ARGC is the number of elements in the vector.
3012 ARGV is an array of strings, one per argument. */
3013
3014typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdbarch, int argc, char **argv);
3015extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv);
3016extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments);
3017
b6af0555
JS
3018#if defined (DWARF2_BUILD_FRAME_INFO)
3019/* Legacy for systems yet to multi-arch DWARF2_BUILD_FRAME_INFO */
3020#if !defined (DWARF2_BUILD_FRAME_INFO_P)
3021#define DWARF2_BUILD_FRAME_INFO_P() (1)
3022#endif
3023#endif
3024
3025/* Default predicate for non- multi-arch targets. */
3026#if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO_P)
3027#define DWARF2_BUILD_FRAME_INFO_P() (0)
3028#endif
3029
3030extern int gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch);
3031#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO_P)
3032#error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
3033#endif
3034#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO_P)
3035#define DWARF2_BUILD_FRAME_INFO_P() (gdbarch_dwarf2_build_frame_info_p (current_gdbarch))
3036#endif
3037
3038/* Default (function) for non- multi-arch platforms. */
3039#if (!GDB_MULTI_ARCH) && !defined (DWARF2_BUILD_FRAME_INFO)
3040#define DWARF2_BUILD_FRAME_INFO(objfile) (internal_error (__FILE__, __LINE__, "DWARF2_BUILD_FRAME_INFO"), 0)
3041#endif
3042
3043typedef void (gdbarch_dwarf2_build_frame_info_ftype) (struct objfile *objfile);
3044extern void gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile);
3045extern void set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info);
3046#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_BUILD_FRAME_INFO)
3047#error "Non multi-arch definition of DWARF2_BUILD_FRAME_INFO"
3048#endif
3049#if GDB_MULTI_ARCH
3050#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_BUILD_FRAME_INFO)
3051#define DWARF2_BUILD_FRAME_INFO(objfile) (gdbarch_dwarf2_build_frame_info (current_gdbarch, objfile))
3052#endif
3053#endif
3054
a2cf933a
EZ
3055/* Default (function) for non- multi-arch platforms. */
3056#if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL)
3057#define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (default_elf_make_msymbol_special (sym, msym))
3058#endif
3059
3060typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
3061extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
3062extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
3063#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ELF_MAKE_MSYMBOL_SPECIAL)
3064#error "Non multi-arch definition of ELF_MAKE_MSYMBOL_SPECIAL"
3065#endif
3066#if GDB_MULTI_ARCH
3067#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ELF_MAKE_MSYMBOL_SPECIAL)
3068#define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym))
3069#endif
3070#endif
3071
3072/* Default (function) for non- multi-arch platforms. */
3073#if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL)
3074#define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (default_coff_make_msymbol_special (val, msym))
3075#endif
3076
3077typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
3078extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
3079extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
3080#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COFF_MAKE_MSYMBOL_SPECIAL)
3081#error "Non multi-arch definition of COFF_MAKE_MSYMBOL_SPECIAL"
3082#endif
3083#if GDB_MULTI_ARCH
3084#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COFF_MAKE_MSYMBOL_SPECIAL)
3085#define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym))
3086#endif
3087#endif
3088
5720643c
JB
3089/* Default (value) for non- multi-arch platforms. */
3090#if (!GDB_MULTI_ARCH) && !defined (NAME_OF_MALLOC)
3091#define NAME_OF_MALLOC ("malloc")
3092#endif
3093
3094extern const char * gdbarch_name_of_malloc (struct gdbarch *gdbarch);
3095extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * name_of_malloc);
3096#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NAME_OF_MALLOC)
3097#error "Non multi-arch definition of NAME_OF_MALLOC"
3098#endif
3099#if GDB_MULTI_ARCH
3100#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NAME_OF_MALLOC)
3101#define NAME_OF_MALLOC (gdbarch_name_of_malloc (current_gdbarch))
3102#endif
3103#endif
3104
c4ed33b9
AC
3105/* Default (value) for non- multi-arch platforms. */
3106#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STEP_BREAKPOINT)
3107#define CANNOT_STEP_BREAKPOINT (0)
3108#endif
3109
3110extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
3111extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
3112#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT)
3113#error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT"
3114#endif
3115#if GDB_MULTI_ARCH
3116#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STEP_BREAKPOINT)
3117#define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch))
3118#endif
3119#endif
3120
f74fa174
MM
3121/* Default (value) for non- multi-arch platforms. */
3122#if (!GDB_MULTI_ARCH) && !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
3123#define HAVE_NONSTEPPABLE_WATCHPOINT (0)
3124#endif
3125
3126extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
3127extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
3128#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT)
3129#error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT"
3130#endif
3131#if GDB_MULTI_ARCH
3132#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
3133#define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
3134#endif
3135#endif
3136
8b2dbe47
KB
3137#if defined (ADDRESS_CLASS_TYPE_FLAGS)
3138/* Legacy for systems yet to multi-arch ADDRESS_CLASS_TYPE_FLAGS */
3139#if !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
3140#define ADDRESS_CLASS_TYPE_FLAGS_P() (1)
3141#endif
3142#endif
3143
3144/* Default predicate for non- multi-arch targets. */
3145#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
3146#define ADDRESS_CLASS_TYPE_FLAGS_P() (0)
3147#endif
3148
3149extern int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
3150#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_P)
3151#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
3152#endif
3153#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
3154#define ADDRESS_CLASS_TYPE_FLAGS_P() (gdbarch_address_class_type_flags_p (current_gdbarch))
3155#endif
3156
3157/* Default (function) for non- multi-arch platforms. */
3158#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS)
3159#define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (internal_error (__FILE__, __LINE__, "ADDRESS_CLASS_TYPE_FLAGS"), 0)
3160#endif
3161
3162typedef int (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class);
3163extern int gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class);
3164extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags);
3165#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS)
3166#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
3167#endif
3168#if GDB_MULTI_ARCH
3169#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS)
3170#define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (gdbarch_address_class_type_flags (current_gdbarch, byte_size, dwarf2_addr_class))
3171#endif
3172#endif
3173
8b2dbe47 3174extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch);
8b2dbe47 3175
321432c0
KB
3176typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags);
3177extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags);
8b2dbe47 3178extern 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
3179
3180extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch);
8b2dbe47 3181
321432c0
KB
3182typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr);
3183extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr);
8b2dbe47 3184extern 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 3185
b59ff9d5
AC
3186/* Is a register in a group */
3187
3188typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
3189extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
3190extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p);
3191
104c1213 3192extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
0f71a2f6
JM
3193
3194
3195/* Mechanism for co-ordinating the selection of a specific
3196 architecture.
3197
3198 GDB targets (*-tdep.c) can register an interest in a specific
3199 architecture. Other GDB components can register a need to maintain
3200 per-architecture data.
3201
3202 The mechanisms below ensures that there is only a loose connection
3203 between the set-architecture command and the various GDB
99e7bb18 3204 components. Each component can independently register their need
0f71a2f6
JM
3205 to maintain architecture specific data with gdbarch.
3206
3207 Pragmatics:
3208
3209 Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
3210 didn't scale.
3211
3212 The more traditional mega-struct containing architecture specific
3213 data for all the various GDB components was also considered. Since
99e7bb18 3214 GDB is built from a variable number of (fairly independent)
0f71a2f6
JM
3215 components it was determined that the global aproach was not
3216 applicable. */
3217
3218
3219/* Register a new architectural family with GDB.
3220
3221 Register support for the specified ARCHITECTURE with GDB. When
3222 gdbarch determines that the specified architecture has been
3223 selected, the corresponding INIT function is called.
3224
3225 --
3226
3227 The INIT function takes two parameters: INFO which contains the
3228 information available to gdbarch about the (possibly new)
3229 architecture; ARCHES which is a list of the previously created
3230 ``struct gdbarch'' for this architecture.
3231
0f79675b
AC
3232 The INFO parameter is, as far as possible, be pre-initialized with
3233 information obtained from INFO.ABFD or the previously selected
3234 architecture.
3235
3236 The ARCHES parameter is a linked list (sorted most recently used)
3237 of all the previously created architures for this architecture
3238 family. The (possibly NULL) ARCHES->gdbarch can used to access
3239 values from the previously selected architecture for this
3240 architecture family. The global ``current_gdbarch'' shall not be
3241 used.
0f71a2f6
JM
3242
3243 The INIT function shall return any of: NULL - indicating that it
ec3d358c 3244 doesn't recognize the selected architecture; an existing ``struct
0f71a2f6
JM
3245 gdbarch'' from the ARCHES list - indicating that the new
3246 architecture is just a synonym for an earlier architecture (see
3247 gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
4b9b3959
AC
3248 - that describes the selected architecture (see gdbarch_alloc()).
3249
3250 The DUMP_TDEP function shall print out all target specific values.
3251 Care should be taken to ensure that the function works in both the
3252 multi-arch and non- multi-arch cases. */
0f71a2f6 3253
adf40b2e
JM
3254struct gdbarch_list
3255{
3256 struct gdbarch *gdbarch;
3257 struct gdbarch_list *next;
3258};
0f71a2f6 3259
adf40b2e
JM
3260struct gdbarch_info
3261{
adf40b2e
JM
3262 /* Use default: NULL (ZERO). */
3263 const struct bfd_arch_info *bfd_arch_info;
0f71a2f6 3264
428721aa 3265 /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
adf40b2e 3266 int byte_order;
0f71a2f6 3267
adf40b2e
JM
3268 /* Use default: NULL (ZERO). */
3269 bfd *abfd;
0f71a2f6 3270
adf40b2e
JM
3271 /* Use default: NULL (ZERO). */
3272 struct gdbarch_tdep_info *tdep_info;
4be87837
DJ
3273
3274 /* Use default: GDB_OSABI_UNINITIALIZED (-1). */
3275 enum gdb_osabi osabi;
adf40b2e 3276};
0f71a2f6 3277
104c1213 3278typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
4b9b3959 3279typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
0f71a2f6 3280
4b9b3959 3281/* DEPRECATED - use gdbarch_register() */
104c1213 3282extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
0f71a2f6 3283
4b9b3959
AC
3284extern void gdbarch_register (enum bfd_architecture architecture,
3285 gdbarch_init_ftype *,
3286 gdbarch_dump_tdep_ftype *);
3287
0f71a2f6 3288
b4a20239
AC
3289/* Return a freshly allocated, NULL terminated, array of the valid
3290 architecture names. Since architectures are registered during the
3291 _initialize phase this function only returns useful information
3292 once initialization has been completed. */
3293
3294extern const char **gdbarch_printable_names (void);
3295
3296
0f71a2f6
JM
3297/* Helper function. Search the list of ARCHES for a GDBARCH that
3298 matches the information provided by INFO. */
3299
104c1213 3300extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
0f71a2f6
JM
3301
3302
3303/* Helper function. Create a preliminary ``struct gdbarch''. Perform
3304 basic initialization using values obtained from the INFO andTDEP
3305 parameters. set_gdbarch_*() functions are called to complete the
3306 initialization of the object. */
3307
104c1213 3308extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
0f71a2f6
JM
3309
3310
4b9b3959
AC
3311/* Helper function. Free a partially-constructed ``struct gdbarch''.
3312 It is assumed that the caller freeds the ``struct
3313 gdbarch_tdep''. */
3314
058f20d5
JB
3315extern void gdbarch_free (struct gdbarch *);
3316
3317
b732d07d 3318/* Helper function. Force an update of the current architecture.
0f71a2f6 3319
b732d07d
AC
3320 The actual architecture selected is determined by INFO, ``(gdb) set
3321 architecture'' et.al., the existing architecture and BFD's default
3322 architecture. INFO should be initialized to zero and then selected
3323 fields should be updated.
0f71a2f6 3324
16f33e29
AC
3325 Returns non-zero if the update succeeds */
3326
3327extern int gdbarch_update_p (struct gdbarch_info info);
0f71a2f6
JM
3328
3329
3330
3331/* Register per-architecture data-pointer.
3332
3333 Reserve space for a per-architecture data-pointer. An identifier
3334 for the reserved data-pointer is returned. That identifer should
95160752 3335 be saved in a local static variable.
0f71a2f6 3336
76860b5f
AC
3337 The per-architecture data-pointer is either initialized explicitly
3338 (set_gdbarch_data()) or implicitly (by INIT() via a call to
3339 gdbarch_data()). FREE() is called to delete either an existing
2af496cb 3340 data-pointer overridden by set_gdbarch_data() or when the
76860b5f 3341 architecture object is being deleted.
0f71a2f6 3342
95160752
AC
3343 When a previously created architecture is re-selected, the
3344 per-architecture data-pointer for that previous architecture is
76860b5f 3345 restored. INIT() is not re-called.
0f71a2f6
JM
3346
3347 Multiple registrarants for any architecture are allowed (and
3348 strongly encouraged). */
3349
95160752 3350struct gdbarch_data;
0f71a2f6 3351
95160752
AC
3352typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
3353typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
3354 void *pointer);
3355extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
3356 gdbarch_data_free_ftype *free);
3357extern void set_gdbarch_data (struct gdbarch *gdbarch,
3358 struct gdbarch_data *data,
3359 void *pointer);
0f71a2f6 3360
451fbdda 3361extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
0f71a2f6
JM
3362
3363
0f71a2f6
JM
3364/* Register per-architecture memory region.
3365
3366 Provide a memory-region swap mechanism. Per-architecture memory
3367 region are created. These memory regions are swapped whenever the
3368 architecture is changed. For a new architecture, the memory region
3369 is initialized with zero (0) and the INIT function is called.
3370
3371 Memory regions are swapped / initialized in the order that they are
3372 registered. NULL DATA and/or INIT values can be specified.
3373
3374 New code should use register_gdbarch_data(). */
3375
104c1213
JM
3376typedef void (gdbarch_swap_ftype) (void);
3377extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init);
e514a9d6 3378#define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL)
0f71a2f6
JM
3379
3380
3381
99e7bb18 3382/* The target-system-dependent byte order is dynamic */
c906108c 3383
adf40b2e 3384extern int target_byte_order;
c906108c
SS
3385#ifndef TARGET_BYTE_ORDER
3386#define TARGET_BYTE_ORDER (target_byte_order + 0)
3387#endif
3388
adf40b2e 3389extern int target_byte_order_auto;
c906108c
SS
3390#ifndef TARGET_BYTE_ORDER_AUTO
3391#define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
3392#endif
3393
3394
3395
99e7bb18 3396/* The target-system-dependent BFD architecture is dynamic */
c906108c 3397
adf40b2e 3398extern int target_architecture_auto;
c906108c
SS
3399#ifndef TARGET_ARCHITECTURE_AUTO
3400#define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
3401#endif
3402
adf40b2e 3403extern const struct bfd_arch_info *target_architecture;
c906108c
SS
3404#ifndef TARGET_ARCHITECTURE
3405#define TARGET_ARCHITECTURE (target_architecture + 0)
3406#endif
3407
c906108c 3408
99e7bb18 3409/* The target-system-dependent disassembler is semi-dynamic */
c906108c 3410
810ecf9f 3411/* Use gdb_disassemble, and gdbarch_print_insn instead. */
d7a27068 3412extern int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info*);
c906108c 3413
810ecf9f
AC
3414/* Use set_gdbarch_print_insn instead. */
3415extern disassemble_info deprecated_tm_print_insn_info;
c906108c 3416
99e7bb18 3417/* Set the dynamic target-system-dependent parameters (architecture,
c906108c
SS
3418 byte-order, ...) using information found in the BFD */
3419
104c1213 3420extern void set_gdbarch_from_file (bfd *);
c906108c
SS
3421
3422
e514a9d6
JM
3423/* Initialize the current architecture to the "first" one we find on
3424 our list. */
3425
3426extern void initialize_current_architecture (void);
3427
ceaa8edf
JB
3428/* For non-multiarched targets, do any initialization of the default
3429 gdbarch object necessary after the _initialize_MODULE functions
3430 have run. */
5ae5f592 3431extern void initialize_non_multiarch (void);
cce74817 3432
c906108c 3433/* gdbarch trace variable */
adf40b2e 3434extern int gdbarch_debug;
c906108c 3435
4b9b3959 3436extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
0f71a2f6 3437
c906108c 3438#endif
This page took 0.460853 seconds and 4 git commands to generate.