*** empty log message ***
[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.
338d7c5c 4 Copyright 1998, 1999, 2000, 2001 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
cce74817
JM
38struct frame_info;
39struct value;
cce74817 40
0f71a2f6 41
0f71a2f6
JM
42extern struct gdbarch *current_gdbarch;
43
44
0f71a2f6
JM
45/* If any of the following are defined, the target wasn't correctly
46 converted. */
47
0f71a2f6
JM
48#if GDB_MULTI_ARCH
49#if defined (EXTRA_FRAME_INFO)
50#error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info"
51#endif
52#endif
53
54#if GDB_MULTI_ARCH
55#if defined (FRAME_FIND_SAVED_REGS)
56#error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS"
57#endif
58#endif
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
89
99e7bb18 90/* The following are initialized by the target dependent code. */
0f71a2f6 91
66b43ecb
AC
92/* Number of bits in a char or unsigned char for the target machine.
93 Just like CHAR_BIT in <limits.h> but describes the target machine.
94 v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
95
96 Number of bits in a short or unsigned short for the target machine. */
c4093a6a 97
66b43ecb
AC
98/* Default (value) for non- multi-arch platforms. */
99#if (!GDB_MULTI_ARCH) && !defined (TARGET_SHORT_BIT)
100#define TARGET_SHORT_BIT (2*TARGET_CHAR_BIT)
0f71a2f6
JM
101#endif
102
104c1213
JM
103extern int gdbarch_short_bit (struct gdbarch *gdbarch);
104extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
83905903
AC
105#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT)
106#error "Non multi-arch definition of TARGET_SHORT_BIT"
107#endif
0f71a2f6 108#if GDB_MULTI_ARCH
6166d547 109#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT)
0f71a2f6
JM
110#define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
111#endif
112#endif
113
66b43ecb
AC
114/* Number of bits in an int or unsigned int for the target machine. */
115
116/* Default (value) for non- multi-arch platforms. */
117#if (!GDB_MULTI_ARCH) && !defined (TARGET_INT_BIT)
118#define TARGET_INT_BIT (4*TARGET_CHAR_BIT)
119#endif
120
104c1213
JM
121extern int gdbarch_int_bit (struct gdbarch *gdbarch);
122extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
83905903
AC
123#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT)
124#error "Non multi-arch definition of TARGET_INT_BIT"
125#endif
0f71a2f6 126#if GDB_MULTI_ARCH
6166d547 127#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT)
0f71a2f6
JM
128#define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
129#endif
130#endif
131
66b43ecb
AC
132/* Number of bits in a long or unsigned long for the target machine. */
133
134/* Default (value) for non- multi-arch platforms. */
135#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_BIT)
136#define TARGET_LONG_BIT (4*TARGET_CHAR_BIT)
137#endif
138
104c1213
JM
139extern int gdbarch_long_bit (struct gdbarch *gdbarch);
140extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
83905903
AC
141#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT)
142#error "Non multi-arch definition of TARGET_LONG_BIT"
143#endif
0f71a2f6 144#if GDB_MULTI_ARCH
6166d547 145#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT)
0f71a2f6
JM
146#define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
147#endif
148#endif
149
66b43ecb
AC
150/* Number of bits in a long long or unsigned long long for the target
151 machine. */
152
153/* Default (value) for non- multi-arch platforms. */
154#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_LONG_BIT)
155#define TARGET_LONG_LONG_BIT (2*TARGET_LONG_BIT)
156#endif
157
104c1213
JM
158extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
159extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
83905903
AC
160#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT)
161#error "Non multi-arch definition of TARGET_LONG_LONG_BIT"
162#endif
0f71a2f6 163#if GDB_MULTI_ARCH
6166d547 164#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT)
0f71a2f6
JM
165#define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
166#endif
167#endif
168
66b43ecb
AC
169/* Number of bits in a float for the target machine. */
170
171/* Default (value) for non- multi-arch platforms. */
172#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_BIT)
173#define TARGET_FLOAT_BIT (4*TARGET_CHAR_BIT)
174#endif
175
104c1213
JM
176extern int gdbarch_float_bit (struct gdbarch *gdbarch);
177extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
83905903
AC
178#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT)
179#error "Non multi-arch definition of TARGET_FLOAT_BIT"
180#endif
0f71a2f6 181#if GDB_MULTI_ARCH
6166d547 182#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT)
0f71a2f6
JM
183#define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
184#endif
185#endif
186
66b43ecb
AC
187/* Number of bits in a double for the target machine. */
188
189/* Default (value) for non- multi-arch platforms. */
190#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_BIT)
191#define TARGET_DOUBLE_BIT (8*TARGET_CHAR_BIT)
192#endif
193
104c1213
JM
194extern int gdbarch_double_bit (struct gdbarch *gdbarch);
195extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
83905903
AC
196#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT)
197#error "Non multi-arch definition of TARGET_DOUBLE_BIT"
198#endif
0f71a2f6 199#if GDB_MULTI_ARCH
6166d547 200#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT)
0f71a2f6
JM
201#define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
202#endif
203#endif
204
66b43ecb
AC
205/* Number of bits in a long double for the target machine. */
206
207/* Default (value) for non- multi-arch platforms. */
208#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_BIT)
209#define TARGET_LONG_DOUBLE_BIT (2*TARGET_DOUBLE_BIT)
210#endif
211
104c1213
JM
212extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
213extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
83905903
AC
214#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT)
215#error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT"
216#endif
0f71a2f6 217#if GDB_MULTI_ARCH
6166d547 218#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT)
0f71a2f6
JM
219#define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
220#endif
221#endif
222
52204a0b
DT
223/* For most targets, a pointer on the target and its representation as an
224 address in GDB have the same size and "look the same". For such a
225 target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
226 / addr_bit will be set from it.
227
228 If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
229 also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
230
231 ptr_bit is the size of a pointer on the target */
66b43ecb
AC
232
233/* Default (value) for non- multi-arch platforms. */
234#if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT)
235#define TARGET_PTR_BIT (TARGET_INT_BIT)
236#endif
237
238extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
239extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
83905903
AC
240#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT)
241#error "Non multi-arch definition of TARGET_PTR_BIT"
242#endif
66b43ecb
AC
243#if GDB_MULTI_ARCH
244#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT)
245#define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
246#endif
247#endif
248
52204a0b
DT
249/* addr_bit is the size of a target address as represented in gdb */
250
251/* Default (value) for non- multi-arch platforms. */
252#if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT)
253#define TARGET_ADDR_BIT (TARGET_PTR_BIT)
254#endif
255
256extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
257extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
83905903
AC
258#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT)
259#error "Non multi-arch definition of TARGET_ADDR_BIT"
260#endif
52204a0b
DT
261#if GDB_MULTI_ARCH
262#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT)
263#define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
264#endif
265#endif
266
66b43ecb
AC
267/* Number of bits in a BFD_VMA for the target object file format. */
268
269/* Default (value) for non- multi-arch platforms. */
270#if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT)
271#define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address)
272#endif
273
274extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch);
275extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
83905903
AC
276#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT)
277#error "Non multi-arch definition of TARGET_BFD_VMA_BIT"
278#endif
66b43ecb
AC
279#if GDB_MULTI_ARCH
280#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT)
281#define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch))
282#endif
283#endif
284
33489c5b 285/* Default (value) for non- multi-arch platforms. */
6166d547 286#if (!GDB_MULTI_ARCH) && !defined (IEEE_FLOAT)
33489c5b
AC
287#define IEEE_FLOAT (0)
288#endif
289
7355ddba
JB
290extern int gdbarch_ieee_float (struct gdbarch *gdbarch);
291extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float);
83905903
AC
292#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IEEE_FLOAT)
293#error "Non multi-arch definition of IEEE_FLOAT"
294#endif
33489c5b 295#if GDB_MULTI_ARCH
6166d547 296#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IEEE_FLOAT)
7355ddba
JB
297#define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch))
298#endif
33489c5b 299#endif
7355ddba 300
be8dfb87
AC
301/* Default (function) for non- multi-arch platforms. */
302#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
39f77062 303#define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid))
be8dfb87
AC
304#endif
305
39f77062
KB
306typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid);
307extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid);
104c1213 308extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
83905903
AC
309#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC)
310#error "Non multi-arch definition of TARGET_READ_PC"
311#endif
0f71a2f6 312#if GDB_MULTI_ARCH
6166d547 313#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC)
39f77062 314#define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid))
0f71a2f6
JM
315#endif
316#endif
317
be8dfb87
AC
318/* Default (function) for non- multi-arch platforms. */
319#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC)
39f77062 320#define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid))
be8dfb87
AC
321#endif
322
39f77062
KB
323typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid);
324extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid);
104c1213 325extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
83905903
AC
326#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC)
327#error "Non multi-arch definition of TARGET_WRITE_PC"
328#endif
0f71a2f6 329#if GDB_MULTI_ARCH
6166d547 330#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC)
39f77062 331#define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid))
0f71a2f6
JM
332#endif
333#endif
334
be8dfb87
AC
335/* Default (function) for non- multi-arch platforms. */
336#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_FP)
337#define TARGET_READ_FP() (generic_target_read_fp ())
338#endif
339
104c1213
JM
340typedef CORE_ADDR (gdbarch_read_fp_ftype) (void);
341extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch);
342extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp);
83905903
AC
343#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_FP)
344#error "Non multi-arch definition of TARGET_READ_FP"
345#endif
0f71a2f6 346#if GDB_MULTI_ARCH
6166d547 347#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP)
0f71a2f6
JM
348#define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch))
349#endif
350#endif
351
be8dfb87
AC
352/* Default (function) for non- multi-arch platforms. */
353#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_FP)
354#define TARGET_WRITE_FP(val) (generic_target_write_fp (val))
355#endif
356
104c1213
JM
357typedef void (gdbarch_write_fp_ftype) (CORE_ADDR val);
358extern void gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val);
359extern void set_gdbarch_write_fp (struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp);
83905903
AC
360#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_FP)
361#error "Non multi-arch definition of TARGET_WRITE_FP"
362#endif
0f71a2f6 363#if GDB_MULTI_ARCH
6166d547 364#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_FP)
0f71a2f6
JM
365#define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val))
366#endif
367#endif
368
be8dfb87
AC
369/* Default (function) for non- multi-arch platforms. */
370#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
371#define TARGET_READ_SP() (generic_target_read_sp ())
372#endif
373
104c1213
JM
374typedef CORE_ADDR (gdbarch_read_sp_ftype) (void);
375extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch);
376extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp);
83905903
AC
377#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP)
378#error "Non multi-arch definition of TARGET_READ_SP"
379#endif
0f71a2f6 380#if GDB_MULTI_ARCH
6166d547 381#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP)
0f71a2f6
JM
382#define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch))
383#endif
384#endif
385
be8dfb87
AC
386/* Default (function) for non- multi-arch platforms. */
387#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_SP)
388#define TARGET_WRITE_SP(val) (generic_target_write_sp (val))
389#endif
390
104c1213
JM
391typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val);
392extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val);
393extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp);
83905903
AC
394#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_SP)
395#error "Non multi-arch definition of TARGET_WRITE_SP"
396#endif
0f71a2f6 397#if GDB_MULTI_ARCH
6166d547 398#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_SP)
0f71a2f6
JM
399#define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val))
400#endif
401#endif
402
61a0eb5b
AC
403extern int gdbarch_register_read_p (struct gdbarch *gdbarch);
404
405typedef void (gdbarch_register_read_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
406extern void gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf);
407extern void set_gdbarch_register_read (struct gdbarch *gdbarch, gdbarch_register_read_ftype *register_read);
408
409extern int gdbarch_register_write_p (struct gdbarch *gdbarch);
410
411typedef void (gdbarch_register_write_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
412extern void gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf);
413extern void set_gdbarch_register_write (struct gdbarch *gdbarch, gdbarch_register_write_ftype *register_write);
414
104c1213
JM
415extern int gdbarch_num_regs (struct gdbarch *gdbarch);
416extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
83905903
AC
417#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS)
418#error "Non multi-arch definition of NUM_REGS"
419#endif
0f71a2f6 420#if GDB_MULTI_ARCH
6166d547 421#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS)
0f71a2f6
JM
422#define NUM_REGS (gdbarch_num_regs (current_gdbarch))
423#endif
424#endif
425
34620563
AC
426/* This macro gives the number of pseudo-registers that live in the
427 register namespace but do not get fetched or stored on the target.
428 These pseudo-registers may be aliases for other registers,
429 combinations of other registers, or they may be computed by GDB. */
430
0aba1244 431/* Default (value) for non- multi-arch platforms. */
6166d547 432#if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS)
0aba1244
EZ
433#define NUM_PSEUDO_REGS (0)
434#endif
435
436extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
437extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
83905903
AC
438#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS)
439#error "Non multi-arch definition of NUM_PSEUDO_REGS"
440#endif
0aba1244 441#if GDB_MULTI_ARCH
6166d547 442#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS)
0aba1244
EZ
443#define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch))
444#endif
445#endif
446
104c1213
JM
447extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
448extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
83905903
AC
449#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
450#error "Non multi-arch definition of SP_REGNUM"
451#endif
0f71a2f6 452#if GDB_MULTI_ARCH
6166d547 453#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM)
0f71a2f6
JM
454#define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
455#endif
456#endif
457
104c1213
JM
458extern int gdbarch_fp_regnum (struct gdbarch *gdbarch);
459extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum);
83905903
AC
460#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM)
461#error "Non multi-arch definition of FP_REGNUM"
462#endif
0f71a2f6 463#if GDB_MULTI_ARCH
6166d547 464#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM)
0f71a2f6
JM
465#define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch))
466#endif
467#endif
468
104c1213
JM
469extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
470extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
83905903
AC
471#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM)
472#error "Non multi-arch definition of PC_REGNUM"
473#endif
0f71a2f6 474#if GDB_MULTI_ARCH
6166d547 475#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM)
0f71a2f6
JM
476#define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
477#endif
478#endif
479
60054393 480/* Default (value) for non- multi-arch platforms. */
6166d547 481#if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM)
60054393
MS
482#define FP0_REGNUM (-1)
483#endif
484
485extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
486extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
83905903
AC
487#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM)
488#error "Non multi-arch definition of FP0_REGNUM"
489#endif
60054393 490#if GDB_MULTI_ARCH
6166d547 491#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM)
60054393
MS
492#define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
493#endif
494#endif
495
03863182 496/* Default (value) for non- multi-arch platforms. */
6166d547 497#if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM)
03863182
AC
498#define NPC_REGNUM (-1)
499#endif
500
501extern int gdbarch_npc_regnum (struct gdbarch *gdbarch);
502extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum);
83905903
AC
503#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM)
504#error "Non multi-arch definition of NPC_REGNUM"
505#endif
03863182 506#if GDB_MULTI_ARCH
6166d547 507#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM)
03863182
AC
508#define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch))
509#endif
510#endif
511
512/* Default (value) for non- multi-arch platforms. */
6166d547 513#if (!GDB_MULTI_ARCH) && !defined (NNPC_REGNUM)
03863182
AC
514#define NNPC_REGNUM (-1)
515#endif
516
517extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch);
518extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum);
83905903
AC
519#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NNPC_REGNUM)
520#error "Non multi-arch definition of NNPC_REGNUM"
521#endif
03863182 522#if GDB_MULTI_ARCH
6166d547 523#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NNPC_REGNUM)
03863182
AC
524#define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch))
525#endif
526#endif
527
88c72b7d
AC
528/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
529
530/* Default (function) for non- multi-arch platforms. */
531#if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM)
532#define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr))
533#endif
534
535typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
536extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
537extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
83905903
AC
538#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM)
539#error "Non multi-arch definition of STAB_REG_TO_REGNUM"
540#endif
88c72b7d
AC
541#if GDB_MULTI_ARCH
542#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM)
543#define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr))
544#endif
545#endif
546
547/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
548
549/* Default (function) for non- multi-arch platforms. */
550#if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM)
551#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr))
552#endif
553
554typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr);
555extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
556extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
83905903
AC
557#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM)
558#error "Non multi-arch definition of ECOFF_REG_TO_REGNUM"
559#endif
88c72b7d
AC
560#if GDB_MULTI_ARCH
561#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM)
562#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr))
563#endif
564#endif
565
566/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
567
568/* Default (function) for non- multi-arch platforms. */
569#if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM)
570#define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr))
571#endif
572
573typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr);
574extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
575extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
83905903
AC
576#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM)
577#error "Non multi-arch definition of DWARF_REG_TO_REGNUM"
578#endif
88c72b7d
AC
579#if GDB_MULTI_ARCH
580#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM)
581#define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr))
582#endif
583#endif
584
585/* Convert from an sdb register number to an internal gdb register number.
586 This should be defined in tm.h, if REGISTER_NAMES is not set up
587 to map one to one onto the sdb register numbers. */
588
589/* Default (function) for non- multi-arch platforms. */
590#if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM)
591#define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr))
592#endif
593
594typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr);
595extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
596extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
83905903
AC
597#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM)
598#error "Non multi-arch definition of SDB_REG_TO_REGNUM"
599#endif
88c72b7d
AC
600#if GDB_MULTI_ARCH
601#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM)
602#define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
603#endif
604#endif
605
606/* Default (function) for non- multi-arch platforms. */
607#if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM)
608#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr))
609#endif
610
611typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr);
612extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
613extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
83905903
AC
614#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM)
615#error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
616#endif
88c72b7d
AC
617#if GDB_MULTI_ARCH
618#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM)
619#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
620#endif
621#endif
622
33489c5b 623/* Default (function) for non- multi-arch platforms. */
6166d547 624#if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME)
33489c5b
AC
625#define REGISTER_NAME(regnr) (legacy_register_name (regnr))
626#endif
627
104c1213
JM
628typedef char * (gdbarch_register_name_ftype) (int regnr);
629extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
630extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
83905903
AC
631#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME)
632#error "Non multi-arch definition of REGISTER_NAME"
633#endif
33489c5b 634#if GDB_MULTI_ARCH
6166d547 635#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME)
0f71a2f6
JM
636#define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
637#endif
33489c5b 638#endif
0f71a2f6 639
104c1213
JM
640extern int gdbarch_register_size (struct gdbarch *gdbarch);
641extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size);
83905903
AC
642#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE)
643#error "Non multi-arch definition of REGISTER_SIZE"
644#endif
0f71a2f6 645#if GDB_MULTI_ARCH
6166d547 646#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE)
0f71a2f6
JM
647#define REGISTER_SIZE (gdbarch_register_size (current_gdbarch))
648#endif
649#endif
650
104c1213
JM
651extern int gdbarch_register_bytes (struct gdbarch *gdbarch);
652extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes);
83905903
AC
653#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES)
654#error "Non multi-arch definition of REGISTER_BYTES"
655#endif
0f71a2f6 656#if GDB_MULTI_ARCH
6166d547 657#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES)
0f71a2f6
JM
658#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
659#endif
660#endif
661
104c1213
JM
662typedef int (gdbarch_register_byte_ftype) (int reg_nr);
663extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr);
664extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte);
83905903
AC
665#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE)
666#error "Non multi-arch definition of REGISTER_BYTE"
667#endif
0f71a2f6 668#if GDB_MULTI_ARCH
6166d547 669#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE)
0f71a2f6
JM
670#define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr))
671#endif
672#endif
673
104c1213
JM
674typedef int (gdbarch_register_raw_size_ftype) (int reg_nr);
675extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr);
676extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size);
83905903
AC
677#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE)
678#error "Non multi-arch definition of REGISTER_RAW_SIZE"
679#endif
0f71a2f6 680#if GDB_MULTI_ARCH
6166d547 681#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE)
0f71a2f6
JM
682#define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr))
683#endif
684#endif
685
104c1213
JM
686extern int gdbarch_max_register_raw_size (struct gdbarch *gdbarch);
687extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size);
83905903
AC
688#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_RAW_SIZE)
689#error "Non multi-arch definition of MAX_REGISTER_RAW_SIZE"
690#endif
0f71a2f6 691#if GDB_MULTI_ARCH
6166d547 692#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_RAW_SIZE)
0f71a2f6
JM
693#define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch))
694#endif
695#endif
696
104c1213
JM
697typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr);
698extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr);
699extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size);
83905903
AC
700#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE)
701#error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE"
702#endif
0f71a2f6 703#if GDB_MULTI_ARCH
6166d547 704#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE)
0f71a2f6
JM
705#define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr))
706#endif
707#endif
708
104c1213
JM
709extern int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch);
710extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size);
83905903
AC
711#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_VIRTUAL_SIZE)
712#error "Non multi-arch definition of MAX_REGISTER_VIRTUAL_SIZE"
713#endif
0f71a2f6 714#if GDB_MULTI_ARCH
6166d547 715#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_VIRTUAL_SIZE)
0f71a2f6
JM
716#define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch))
717#endif
718#endif
719
104c1213
JM
720typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr);
721extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr);
722extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type);
83905903
AC
723#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE)
724#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE"
725#endif
0f71a2f6 726#if GDB_MULTI_ARCH
6166d547 727#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE)
0f71a2f6
JM
728#define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr))
729#endif
730#endif
731
666e11c5
EZ
732/* Default (function) for non- multi-arch platforms. */
733#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO)
734#define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs))
735#endif
736
737typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs);
738extern void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
739extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_registers_info_ftype *do_registers_info);
83905903
AC
740#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO)
741#error "Non multi-arch definition of DO_REGISTERS_INFO"
742#endif
666e11c5
EZ
743#if GDB_MULTI_ARCH
744#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO)
745#define DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_do_registers_info (current_gdbarch, reg_nr, fpregs))
746#endif
747#endif
748
7c7651b2
AC
749/* MAP a GDB RAW register number onto a simulator register number. See
750 also include/...-sim.h. */
751
752/* Default (function) for non- multi-arch platforms. */
753#if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO)
754#define REGISTER_SIM_REGNO(reg_nr) (default_register_sim_regno (reg_nr))
755#endif
756
757typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
758extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
759extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
83905903
AC
760#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO)
761#error "Non multi-arch definition of REGISTER_SIM_REGNO"
762#endif
7c7651b2
AC
763#if GDB_MULTI_ARCH
764#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO)
765#define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr))
766#endif
767#endif
768
2649061d
AC
769#if defined (REGISTER_BYTES_OK)
770/* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */
eee30e78 771#if !defined (REGISTER_BYTES_OK_P)
2649061d
AC
772#define REGISTER_BYTES_OK_P() (1)
773#endif
eee30e78 774#endif
2649061d
AC
775
776/* Default predicate for non- multi-arch targets. */
777#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P)
778#define REGISTER_BYTES_OK_P() (0)
779#endif
780
781extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
83905903
AC
782#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P)
783#error "Non multi-arch definition of REGISTER_BYTES_OK"
784#endif
2649061d
AC
785#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
786#define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
787#endif
788
789/* Default (function) for non- multi-arch platforms. */
790#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
8e65ff28 791#define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0)
2649061d
AC
792#endif
793
794typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes);
795extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes);
796extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok);
83905903
AC
797#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK)
798#error "Non multi-arch definition of REGISTER_BYTES_OK"
799#endif
2649061d
AC
800#if GDB_MULTI_ARCH
801#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK)
802#define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
803#endif
804#endif
805
01fb7433
AC
806/* Default (function) for non- multi-arch platforms. */
807#if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER)
808#define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum))
809#endif
810
811typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
812extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
813extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
83905903
AC
814#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER)
815#error "Non multi-arch definition of CANNOT_FETCH_REGISTER"
816#endif
01fb7433
AC
817#if GDB_MULTI_ARCH
818#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER)
819#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
820#endif
821#endif
822
823/* Default (function) for non- multi-arch platforms. */
824#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER)
825#define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum))
826#endif
827
828typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
829extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
830extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
83905903
AC
831#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER)
832#error "Non multi-arch definition of CANNOT_STORE_REGISTER"
833#endif
01fb7433
AC
834#if GDB_MULTI_ARCH
835#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER)
836#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum))
837#endif
838#endif
839
104c1213
JM
840extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch);
841extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames);
83905903
AC
842#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_GENERIC_DUMMY_FRAMES)
843#error "Non multi-arch definition of USE_GENERIC_DUMMY_FRAMES"
844#endif
0f71a2f6 845#if GDB_MULTI_ARCH
6166d547 846#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_GENERIC_DUMMY_FRAMES)
0f71a2f6
JM
847#define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch))
848#endif
849#endif
850
104c1213
JM
851extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
852extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
83905903
AC
853#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION)
854#error "Non multi-arch definition of CALL_DUMMY_LOCATION"
855#endif
0f71a2f6 856#if GDB_MULTI_ARCH
6166d547 857#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LOCATION)
0f71a2f6
JM
858#define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
859#endif
860#endif
861
104c1213
JM
862typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void);
863extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch);
864extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address);
83905903
AC
865#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS)
866#error "Non multi-arch definition of CALL_DUMMY_ADDRESS"
867#endif
0f71a2f6 868#if GDB_MULTI_ARCH
6166d547 869#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS)
0f71a2f6
JM
870#define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
871#endif
872#endif
873
104c1213
JM
874extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch);
875extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset);
83905903
AC
876#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET)
877#error "Non multi-arch definition of CALL_DUMMY_START_OFFSET"
878#endif
0f71a2f6 879#if GDB_MULTI_ARCH
6166d547 880#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_START_OFFSET)
0f71a2f6
JM
881#define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch))
882#endif
883#endif
884
104c1213
JM
885extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
886extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset);
83905903
AC
887#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET)
888#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET"
889#endif
0f71a2f6 890#if GDB_MULTI_ARCH
6166d547 891#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
0f71a2f6
JM
892#define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch))
893#endif
894#endif
895
104c1213
JM
896extern int gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch);
897extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p);
83905903
AC
898#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
899#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET_P"
900#endif
0f71a2f6 901#if GDB_MULTI_ARCH
6166d547 902#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
0f71a2f6
JM
903#define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch))
904#endif
905#endif
906
104c1213
JM
907extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch);
908extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length);
83905903
AC
909#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH)
910#error "Non multi-arch definition of CALL_DUMMY_LENGTH"
911#endif
0f71a2f6 912#if GDB_MULTI_ARCH
6166d547 913#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LENGTH)
0f71a2f6
JM
914#define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch))
915#endif
916#endif
917
104c1213
JM
918typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
919extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
920extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy);
83905903
AC
921#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_CALL_DUMMY)
922#error "Non multi-arch definition of PC_IN_CALL_DUMMY"
923#endif
0f71a2f6 924#if GDB_MULTI_ARCH
6166d547 925#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY)
0f71a2f6
JM
926#define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
927#endif
928#endif
929
104c1213
JM
930extern int gdbarch_call_dummy_p (struct gdbarch *gdbarch);
931extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p);
83905903
AC
932#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_P)
933#error "Non multi-arch definition of CALL_DUMMY_P"
934#endif
0f71a2f6 935#if GDB_MULTI_ARCH
6166d547 936#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_P)
0f71a2f6
JM
937#define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch))
938#endif
939#endif
940
33489c5b 941/* Default (value) for non- multi-arch platforms. */
6166d547 942#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS)
33489c5b
AC
943#define CALL_DUMMY_WORDS (legacy_call_dummy_words)
944#endif
945
104c1213
JM
946extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch);
947extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words);
83905903
AC
948#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS)
949#error "Non multi-arch definition of CALL_DUMMY_WORDS"
950#endif
33489c5b 951#if GDB_MULTI_ARCH
6166d547 952#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_WORDS)
0f71a2f6
JM
953#define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
954#endif
33489c5b
AC
955#endif
956
957/* Default (value) for non- multi-arch platforms. */
6166d547 958#if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS)
33489c5b
AC
959#define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
960#endif
0f71a2f6 961
104c1213
JM
962extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch);
963extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words);
83905903
AC
964#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS)
965#error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS"
966#endif
33489c5b 967#if GDB_MULTI_ARCH
6166d547 968#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIZEOF_CALL_DUMMY_WORDS)
0f71a2f6
JM
969#define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
970#endif
33489c5b 971#endif
0f71a2f6 972
104c1213
JM
973extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch);
974extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p);
83905903
AC
975#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST_P)
976#error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST_P"
977#endif
0f71a2f6 978#if GDB_MULTI_ARCH
6166d547 979#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST_P)
0f71a2f6
JM
980#define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch))
981#endif
982#endif
983
104c1213
JM
984extern int gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch);
985extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int call_dummy_stack_adjust);
83905903
AC
986#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST)
987#error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST"
988#endif
0f71a2f6 989#if GDB_MULTI_ARCH
6166d547 990#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST)
0f71a2f6
JM
991#define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch))
992#endif
993#endif
994
104c1213
JM
995typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
996extern void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
997extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy);
83905903
AC
998#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY)
999#error "Non multi-arch definition of FIX_CALL_DUMMY"
1000#endif
0f71a2f6 1001#if GDB_MULTI_ARCH
6166d547 1002#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY)
0f71a2f6
JM
1003#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
1004#endif
1005#endif
1006
10312cc4
AC
1007/* Default (function) for non- multi-arch platforms. */
1008#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST)
1009#define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
1010#endif
1011
1012typedef void (gdbarch_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
1013extern void gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
1014extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_init_frame_pc_first_ftype *init_frame_pc_first);
83905903
AC
1015#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST)
1016#error "Non multi-arch definition of INIT_FRAME_PC_FIRST"
1017#endif
10312cc4
AC
1018#if GDB_MULTI_ARCH
1019#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST)
1020#define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev))
1021#endif
1022#endif
1023
1024/* Default (function) for non- multi-arch platforms. */
1025#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC)
7824d2f2 1026#define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev))
10312cc4
AC
1027#endif
1028
1029typedef void (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev);
1030extern void gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
1031extern void set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, gdbarch_init_frame_pc_ftype *init_frame_pc);
83905903
AC
1032#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC)
1033#error "Non multi-arch definition of INIT_FRAME_PC"
1034#endif
10312cc4
AC
1035#if GDB_MULTI_ARCH
1036#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC)
1037#define INIT_FRAME_PC(fromleaf, prev) (gdbarch_init_frame_pc (current_gdbarch, fromleaf, prev))
1038#endif
1039#endif
1040
104c1213
JM
1041extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
1042extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion);
83905903
AC
1043#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION)
1044#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION"
1045#endif
0f71a2f6 1046#if GDB_MULTI_ARCH
6166d547 1047#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION)
0f71a2f6
JM
1048#define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
1049#endif
1050#endif
1051
104c1213
JM
1052extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch);
1053extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type);
83905903
AC
1054#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE)
1055#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE"
1056#endif
0f71a2f6 1057#if GDB_MULTI_ARCH
6166d547 1058#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION_TYPE)
0f71a2f6
JM
1059#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
1060#endif
1061#endif
1062
33489c5b 1063/* Default (function) for non- multi-arch platforms. */
6166d547 1064#if (!GDB_MULTI_ARCH) && !defined (COERCE_FLOAT_TO_DOUBLE)
33489c5b
AC
1065#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (default_coerce_float_to_double (formal, actual))
1066#endif
1067
b9a8e3bf
JB
1068typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual);
1069extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual);
1070extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double);
83905903
AC
1071#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COERCE_FLOAT_TO_DOUBLE)
1072#error "Non multi-arch definition of COERCE_FLOAT_TO_DOUBLE"
1073#endif
33489c5b 1074#if GDB_MULTI_ARCH
6166d547 1075#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COERCE_FLOAT_TO_DOUBLE)
b9a8e3bf
JB
1076#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual))
1077#endif
33489c5b 1078#endif
b9a8e3bf 1079
104c1213
JM
1080typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
1081extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
1082extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register);
83905903
AC
1083#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER)
1084#error "Non multi-arch definition of GET_SAVED_REGISTER"
1085#endif
0f71a2f6 1086#if GDB_MULTI_ARCH
6166d547 1087#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER)
0f71a2f6
JM
1088#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
1089#endif
1090#endif
1091
33489c5b 1092/* Default (function) for non- multi-arch platforms. */
6166d547 1093#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERTIBLE)
33489c5b
AC
1094#define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr))
1095#endif
1096
104c1213
JM
1097typedef int (gdbarch_register_convertible_ftype) (int nr);
1098extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr);
1099extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible);
83905903
AC
1100#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE)
1101#error "Non multi-arch definition of REGISTER_CONVERTIBLE"
1102#endif
33489c5b 1103#if GDB_MULTI_ARCH
6166d547 1104#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE)
0f71a2f6
JM
1105#define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr))
1106#endif
33489c5b
AC
1107#endif
1108
1109/* Default (function) for non- multi-arch platforms. */
6166d547 1110#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL)
8e65ff28 1111#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0)
33489c5b 1112#endif
0f71a2f6 1113
104c1213
JM
1114typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
1115extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
1116extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual);
83905903
AC
1117#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL)
1118#error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL"
1119#endif
33489c5b 1120#if GDB_MULTI_ARCH
6166d547 1121#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL)
0f71a2f6
JM
1122#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
1123#endif
33489c5b
AC
1124#endif
1125
1126/* Default (function) for non- multi-arch platforms. */
6166d547 1127#if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW)
8e65ff28 1128#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0)
33489c5b 1129#endif
0f71a2f6 1130
104c1213
JM
1131typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to);
1132extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to);
1133extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw);
83905903
AC
1134#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW)
1135#error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW"
1136#endif
33489c5b 1137#if GDB_MULTI_ARCH
6166d547 1138#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW)
0f71a2f6
JM
1139#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
1140#endif
33489c5b
AC
1141#endif
1142
34620563
AC
1143/* This function is called when the value of a pseudo-register needs to
1144 be updated. Typically it will be defined on a per-architecture
1145 basis. */
1146
7f1b2585 1147/* Default (function) for non- multi-arch platforms. */
6166d547 1148#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER)
8e65ff28 1149#define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0)
7f1b2585
EZ
1150#endif
1151
1152typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum);
1153extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum);
1154extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register);
83905903
AC
1155#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER)
1156#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
1157#endif
7f1b2585 1158#if GDB_MULTI_ARCH
6166d547 1159#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER)
7f1b2585
EZ
1160#define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum))
1161#endif
1162#endif
1163
34620563
AC
1164/* This function is called when the value of a pseudo-register needs to
1165 be set or stored. Typically it will be defined on a
1166 per-architecture basis. */
1167
7f1b2585 1168/* Default (function) for non- multi-arch platforms. */
6166d547 1169#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER)
8e65ff28 1170#define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0)
7f1b2585
EZ
1171#endif
1172
1173typedef void (gdbarch_store_pseudo_register_ftype) (int regnum);
1174extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum);
1175extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register);
83905903
AC
1176#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER)
1177#error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
1178#endif
7f1b2585 1179#if GDB_MULTI_ARCH
6166d547 1180#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER)
7f1b2585
EZ
1181#define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum))
1182#endif
1183#endif
1184
33489c5b 1185/* Default (function) for non- multi-arch platforms. */
6166d547 1186#if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS)
ac2e2ef7 1187#define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf))
33489c5b 1188#endif
4478b372 1189
ac2e2ef7
AC
1190typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, void *buf);
1191extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf);
4478b372 1192extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
83905903
AC
1193#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS)
1194#error "Non multi-arch definition of POINTER_TO_ADDRESS"
1195#endif
33489c5b 1196#if GDB_MULTI_ARCH
6166d547 1197#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS)
4478b372
JB
1198#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
1199#endif
33489c5b
AC
1200#endif
1201
1202/* Default (function) for non- multi-arch platforms. */
6166d547 1203#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER)
ac2e2ef7 1204#define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr))
33489c5b 1205#endif
4478b372 1206
ac2e2ef7
AC
1207typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr);
1208extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr);
4478b372 1209extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
83905903
AC
1210#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER)
1211#error "Non multi-arch definition of ADDRESS_TO_POINTER"
1212#endif
33489c5b 1213#if GDB_MULTI_ARCH
6166d547 1214#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER)
4478b372
JB
1215#define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr))
1216#endif
33489c5b
AC
1217#endif
1218
1219/* Default (function) for non- multi-arch platforms. */
6166d547 1220#if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK)
33489c5b
AC
1221#define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type))
1222#endif
0f71a2f6 1223
71a9f22e
JB
1224typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
1225extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
1226extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack);
83905903
AC
1227#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK)
1228#error "Non multi-arch definition of RETURN_VALUE_ON_STACK"
1229#endif
33489c5b 1230#if GDB_MULTI_ARCH
6166d547 1231#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK)
71a9f22e
JB
1232#define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type))
1233#endif
33489c5b 1234#endif
71a9f22e 1235
104c1213
JM
1236typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf);
1237extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf);
1238extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
83905903
AC
1239#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
1240#error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
1241#endif
0f71a2f6 1242#if GDB_MULTI_ARCH
6166d547 1243#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
0f71a2f6
JM
1244#define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf))
1245#endif
1246#endif
1247
104c1213
JM
1248typedef CORE_ADDR (gdbarch_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
1249extern CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
1250extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments);
83905903
AC
1251#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_ARGUMENTS)
1252#error "Non multi-arch definition of PUSH_ARGUMENTS"
1253#endif
0f71a2f6 1254#if GDB_MULTI_ARCH
6166d547 1255#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_ARGUMENTS)
0f71a2f6
JM
1256#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
1257#endif
1258#endif
1259
104c1213
JM
1260typedef void (gdbarch_push_dummy_frame_ftype) (void);
1261extern void gdbarch_push_dummy_frame (struct gdbarch *gdbarch);
1262extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame);
83905903
AC
1263#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_DUMMY_FRAME)
1264#error "Non multi-arch definition of PUSH_DUMMY_FRAME"
1265#endif
0f71a2f6 1266#if GDB_MULTI_ARCH
6166d547 1267#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_DUMMY_FRAME)
0f71a2f6
JM
1268#define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch))
1269#endif
1270#endif
1271
104c1213
JM
1272typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp);
1273extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp);
1274extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address);
83905903
AC
1275#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS)
1276#error "Non multi-arch definition of PUSH_RETURN_ADDRESS"
1277#endif
0f71a2f6 1278#if GDB_MULTI_ARCH
6166d547 1279#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS)
0f71a2f6
JM
1280#define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp))
1281#endif
1282#endif
1283
104c1213
JM
1284typedef void (gdbarch_pop_frame_ftype) (void);
1285extern void gdbarch_pop_frame (struct gdbarch *gdbarch);
1286extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame);
83905903
AC
1287#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME)
1288#error "Non multi-arch definition of POP_FRAME"
1289#endif
0f71a2f6 1290#if GDB_MULTI_ARCH
6166d547 1291#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME)
0f71a2f6
JM
1292#define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
1293#endif
1294#endif
1295
34620563
AC
1296/* I wish that these would just go away.... */
1297
33489c5b 1298/* Default (function) for non- multi-arch platforms. */
6166d547 1299#if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_DADDR)
8e65ff28 1300#define D10V_MAKE_DADDR(x) (internal_error (__FILE__, __LINE__, "D10V_MAKE_DADDR"), 0)
33489c5b
AC
1301#endif
1302
104c1213
JM
1303typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) (CORE_ADDR x);
1304extern CORE_ADDR gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x);
1305extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_make_daddr_ftype *d10v_make_daddr);
83905903
AC
1306#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_MAKE_DADDR)
1307#error "Non multi-arch definition of D10V_MAKE_DADDR"
1308#endif
33489c5b 1309#if GDB_MULTI_ARCH
6166d547 1310#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_MAKE_DADDR)
0f71a2f6
JM
1311#define D10V_MAKE_DADDR(x) (gdbarch_d10v_make_daddr (current_gdbarch, x))
1312#endif
33489c5b
AC
1313#endif
1314
1315/* Default (function) for non- multi-arch platforms. */
6166d547 1316#if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_IADDR)
8e65ff28 1317#define D10V_MAKE_IADDR(x) (internal_error (__FILE__, __LINE__, "D10V_MAKE_IADDR"), 0)
33489c5b 1318#endif
0f71a2f6 1319
104c1213
JM
1320typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) (CORE_ADDR x);
1321extern CORE_ADDR gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x);
1322extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr);
83905903
AC
1323#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_MAKE_IADDR)
1324#error "Non multi-arch definition of D10V_MAKE_IADDR"
1325#endif
33489c5b 1326#if GDB_MULTI_ARCH
6166d547 1327#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_MAKE_IADDR)
0f71a2f6
JM
1328#define D10V_MAKE_IADDR(x) (gdbarch_d10v_make_iaddr (current_gdbarch, x))
1329#endif
33489c5b
AC
1330#endif
1331
1332/* Default (function) for non- multi-arch platforms. */
6166d547 1333#if (!GDB_MULTI_ARCH) && !defined (D10V_DADDR_P)
8e65ff28 1334#define D10V_DADDR_P(x) (internal_error (__FILE__, __LINE__, "D10V_DADDR_P"), 0)
33489c5b 1335#endif
0f71a2f6 1336
104c1213
JM
1337typedef int (gdbarch_d10v_daddr_p_ftype) (CORE_ADDR x);
1338extern int gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x);
1339extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_daddr_p_ftype *d10v_daddr_p);
83905903
AC
1340#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_DADDR_P)
1341#error "Non multi-arch definition of D10V_DADDR_P"
1342#endif
33489c5b 1343#if GDB_MULTI_ARCH
6166d547 1344#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_DADDR_P)
0f71a2f6
JM
1345#define D10V_DADDR_P(x) (gdbarch_d10v_daddr_p (current_gdbarch, x))
1346#endif
33489c5b
AC
1347#endif
1348
1349/* Default (function) for non- multi-arch platforms. */
6166d547 1350#if (!GDB_MULTI_ARCH) && !defined (D10V_IADDR_P)
8e65ff28 1351#define D10V_IADDR_P(x) (internal_error (__FILE__, __LINE__, "D10V_IADDR_P"), 0)
33489c5b 1352#endif
0f71a2f6 1353
104c1213
JM
1354typedef int (gdbarch_d10v_iaddr_p_ftype) (CORE_ADDR x);
1355extern int gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x);
1356extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p);
83905903
AC
1357#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_IADDR_P)
1358#error "Non multi-arch definition of D10V_IADDR_P"
1359#endif
33489c5b 1360#if GDB_MULTI_ARCH
6166d547 1361#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_IADDR_P)
0f71a2f6
JM
1362#define D10V_IADDR_P(x) (gdbarch_d10v_iaddr_p (current_gdbarch, x))
1363#endif
33489c5b
AC
1364#endif
1365
1366/* Default (function) for non- multi-arch platforms. */
6166d547 1367#if (!GDB_MULTI_ARCH) && !defined (D10V_CONVERT_DADDR_TO_RAW)
8e65ff28 1368#define D10V_CONVERT_DADDR_TO_RAW(x) (internal_error (__FILE__, __LINE__, "D10V_CONVERT_DADDR_TO_RAW"), 0)
33489c5b 1369#endif
0f71a2f6 1370
104c1213
JM
1371typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) (CORE_ADDR x);
1372extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x);
1373extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw);
83905903
AC
1374#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_CONVERT_DADDR_TO_RAW)
1375#error "Non multi-arch definition of D10V_CONVERT_DADDR_TO_RAW"
1376#endif
33489c5b 1377#if GDB_MULTI_ARCH
6166d547 1378#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_CONVERT_DADDR_TO_RAW)
0f71a2f6
JM
1379#define D10V_CONVERT_DADDR_TO_RAW(x) (gdbarch_d10v_convert_daddr_to_raw (current_gdbarch, x))
1380#endif
33489c5b
AC
1381#endif
1382
1383/* Default (function) for non- multi-arch platforms. */
6166d547 1384#if (!GDB_MULTI_ARCH) && !defined (D10V_CONVERT_IADDR_TO_RAW)
8e65ff28 1385#define D10V_CONVERT_IADDR_TO_RAW(x) (internal_error (__FILE__, __LINE__, "D10V_CONVERT_IADDR_TO_RAW"), 0)
33489c5b 1386#endif
0f71a2f6 1387
104c1213
JM
1388typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) (CORE_ADDR x);
1389extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x);
1390extern void set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw);
83905903
AC
1391#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_CONVERT_IADDR_TO_RAW)
1392#error "Non multi-arch definition of D10V_CONVERT_IADDR_TO_RAW"
1393#endif
33489c5b 1394#if GDB_MULTI_ARCH
6166d547 1395#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_CONVERT_IADDR_TO_RAW)
0f71a2f6
JM
1396#define D10V_CONVERT_IADDR_TO_RAW(x) (gdbarch_d10v_convert_iaddr_to_raw (current_gdbarch, x))
1397#endif
33489c5b 1398#endif
0f71a2f6 1399
104c1213
JM
1400typedef void (gdbarch_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp);
1401extern void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp);
1402extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return);
83905903
AC
1403#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_STRUCT_RETURN)
1404#error "Non multi-arch definition of STORE_STRUCT_RETURN"
1405#endif
0f71a2f6 1406#if GDB_MULTI_ARCH
6166d547 1407#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_STRUCT_RETURN)
0f71a2f6
JM
1408#define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp))
1409#endif
1410#endif
1411
104c1213
JM
1412typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf);
1413extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf);
1414extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value);
83905903
AC
1415#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE)
1416#error "Non multi-arch definition of STORE_RETURN_VALUE"
1417#endif
0f71a2f6 1418#if GDB_MULTI_ARCH
6166d547 1419#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE)
0f71a2f6
JM
1420#define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf))
1421#endif
1422#endif
1423
d6dd581e
AC
1424#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1425/* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
1426#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1427#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
1428#endif
1429#endif
1430
1431/* Default predicate for non- multi-arch targets. */
1432#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1433#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
1434#endif
1435
1436extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
83905903
AC
1437#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1438#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
1439#endif
d6dd581e
AC
1440#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
1441#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
1442#endif
1443
1444/* Default (function) for non- multi-arch platforms. */
1445#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1446#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
1447#endif
1448
104c1213
JM
1449typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf);
1450extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
1451extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
83905903
AC
1452#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
1453#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
1454#endif
0f71a2f6 1455#if GDB_MULTI_ARCH
6166d547 1456#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
0f71a2f6
JM
1457#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf))
1458#endif
1459#endif
1460
104c1213
JM
1461typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
1462extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
1463extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention);
83905903
AC
1464#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION)
1465#error "Non multi-arch definition of USE_STRUCT_CONVENTION"
1466#endif
0f71a2f6 1467#if GDB_MULTI_ARCH
6166d547 1468#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION)
0f71a2f6
JM
1469#define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
1470#endif
1471#endif
1472
104c1213
JM
1473typedef void (gdbarch_frame_init_saved_regs_ftype) (struct frame_info *frame);
1474extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame);
1475extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs);
83905903
AC
1476#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS)
1477#error "Non multi-arch definition of FRAME_INIT_SAVED_REGS"
1478#endif
0f71a2f6 1479#if GDB_MULTI_ARCH
6166d547 1480#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS)
0f71a2f6
JM
1481#define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame))
1482#endif
1483#endif
1484
104c1213
JM
1485typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame);
1486extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame);
1487extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info);
83905903
AC
1488#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO)
1489#error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO"
1490#endif
0f71a2f6 1491#if GDB_MULTI_ARCH
6166d547 1492#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO)
0f71a2f6
JM
1493#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame))
1494#endif
1495#endif
1496
104c1213
JM
1497typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip);
1498extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
1499extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
83905903
AC
1500#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE)
1501#error "Non multi-arch definition of SKIP_PROLOGUE"
1502#endif
0f71a2f6 1503#if GDB_MULTI_ARCH
6166d547 1504#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE)
0f71a2f6
JM
1505#define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
1506#endif
1507#endif
1508
33489c5b 1509/* Default (function) for non- multi-arch platforms. */
6166d547 1510#if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P)
33489c5b
AC
1511#define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip))
1512#endif
1513
dad41f9a
AC
1514typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip);
1515extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip);
1516extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p);
83905903
AC
1517#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P)
1518#error "Non multi-arch definition of PROLOGUE_FRAMELESS_P"
1519#endif
33489c5b 1520#if GDB_MULTI_ARCH
6166d547 1521#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P)
dad41f9a
AC
1522#define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip))
1523#endif
33489c5b 1524#endif
dad41f9a 1525
104c1213
JM
1526typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
1527extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
1528extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
83905903
AC
1529#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN)
1530#error "Non multi-arch definition of INNER_THAN"
1531#endif
0f71a2f6 1532#if GDB_MULTI_ARCH
6166d547 1533#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN)
0f71a2f6
JM
1534#define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs))
1535#endif
1536#endif
1537
33489c5b 1538/* Default (function) for non- multi-arch platforms. */
6166d547 1539#if (!GDB_MULTI_ARCH) && !defined (BREAKPOINT_FROM_PC)
33489c5b
AC
1540#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr))
1541#endif
1542
104c1213
JM
1543typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
1544extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
1545extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
83905903
AC
1546#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
1547#error "Non multi-arch definition of BREAKPOINT_FROM_PC"
1548#endif
33489c5b 1549#if GDB_MULTI_ARCH
6166d547 1550#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC)
0f71a2f6
JM
1551#define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
1552#endif
33489c5b
AC
1553#endif
1554
1555/* Default (function) for non- multi-arch platforms. */
6166d547 1556#if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT)
33489c5b
AC
1557#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache))
1558#endif
0f71a2f6 1559
917317f4
JM
1560typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
1561extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
1562extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
83905903
AC
1563#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT)
1564#error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT"
1565#endif
33489c5b 1566#if GDB_MULTI_ARCH
6166d547 1567#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT)
917317f4
JM
1568#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache))
1569#endif
33489c5b
AC
1570#endif
1571
1572/* Default (function) for non- multi-arch platforms. */
6166d547 1573#if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT)
33489c5b
AC
1574#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache))
1575#endif
917317f4
JM
1576
1577typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
1578extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
1579extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
83905903
AC
1580#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT)
1581#error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT"
1582#endif
33489c5b 1583#if GDB_MULTI_ARCH
6166d547 1584#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT)
917317f4
JM
1585#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache))
1586#endif
33489c5b 1587#endif
917317f4 1588
104c1213
JM
1589extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
1590extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
83905903
AC
1591#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK)
1592#error "Non multi-arch definition of DECR_PC_AFTER_BREAK"
1593#endif
0f71a2f6 1594#if GDB_MULTI_ARCH
6166d547 1595#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK)
0f71a2f6
JM
1596#define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
1597#endif
1598#endif
1599
e02bc4cc
DS
1600/* Default (function) for non- multi-arch platforms. */
1601#if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED)
1602#define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it))
1603#endif
1604
1605typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it);
1606extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it);
1607extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed);
83905903
AC
1608#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED)
1609#error "Non multi-arch definition of PREPARE_TO_PROCEED"
1610#endif
e02bc4cc
DS
1611#if GDB_MULTI_ARCH
1612#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED)
1613#define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it))
1614#endif
1615#endif
1616
104c1213
JM
1617extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
1618extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
83905903
AC
1619#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
1620#error "Non multi-arch definition of FUNCTION_START_OFFSET"
1621#endif
0f71a2f6 1622#if GDB_MULTI_ARCH
6166d547 1623#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET)
0f71a2f6
JM
1624#define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
1625#endif
1626#endif
1627
33489c5b 1628/* Default (function) for non- multi-arch platforms. */
6166d547 1629#if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
33489c5b
AC
1630#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (generic_remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len))
1631#endif
1632
104c1213
JM
1633typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
1634extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
1635extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
83905903
AC
1636#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS)
1637#error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS"
1638#endif
33489c5b 1639#if GDB_MULTI_ARCH
6166d547 1640#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
0f71a2f6
JM
1641#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len))
1642#endif
33489c5b 1643#endif
0f71a2f6 1644
104c1213
JM
1645extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
1646extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
83905903
AC
1647#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP)
1648#error "Non multi-arch definition of FRAME_ARGS_SKIP"
1649#endif
0f71a2f6 1650#if GDB_MULTI_ARCH
6166d547 1651#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP)
0f71a2f6
JM
1652#define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
1653#endif
1654#endif
1655
33489c5b 1656/* Default (function) for non- multi-arch platforms. */
6166d547 1657#if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION)
33489c5b
AC
1658#define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi))
1659#endif
1660
104c1213
JM
1661typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi);
1662extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi);
1663extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation);
83905903
AC
1664#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION)
1665#error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION"
1666#endif
33489c5b 1667#if GDB_MULTI_ARCH
6166d547 1668#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION)
0f71a2f6
JM
1669#define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi))
1670#endif
33489c5b 1671#endif
0f71a2f6 1672
104c1213
JM
1673typedef CORE_ADDR (gdbarch_frame_chain_ftype) (struct frame_info *frame);
1674extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame);
1675extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain);
83905903
AC
1676#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN)
1677#error "Non multi-arch definition of FRAME_CHAIN"
1678#endif
0f71a2f6 1679#if GDB_MULTI_ARCH
6166d547 1680#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN)
0f71a2f6
JM
1681#define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame))
1682#endif
1683#endif
1684
104c1213
JM
1685typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
1686extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe);
1687extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid);
83905903
AC
1688#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID)
1689#error "Non multi-arch definition of FRAME_CHAIN_VALID"
1690#endif
0f71a2f6 1691#if GDB_MULTI_ARCH
6166d547 1692#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID)
0f71a2f6
JM
1693#define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe))
1694#endif
1695#endif
1696
104c1213
JM
1697typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) (struct frame_info *fi);
1698extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
1699extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc);
83905903
AC
1700#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC)
1701#error "Non multi-arch definition of FRAME_SAVED_PC"
1702#endif
0f71a2f6 1703#if GDB_MULTI_ARCH
6166d547 1704#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC)
0f71a2f6
JM
1705#define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi))
1706#endif
1707#endif
1708
104c1213
JM
1709typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi);
1710extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi);
1711extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address);
83905903
AC
1712#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS)
1713#error "Non multi-arch definition of FRAME_ARGS_ADDRESS"
1714#endif
0f71a2f6 1715#if GDB_MULTI_ARCH
6166d547 1716#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS)
0f71a2f6
JM
1717#define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi))
1718#endif
1719#endif
1720
104c1213
JM
1721typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi);
1722extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi);
1723extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address);
83905903
AC
1724#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS)
1725#error "Non multi-arch definition of FRAME_LOCALS_ADDRESS"
1726#endif
0f71a2f6 1727#if GDB_MULTI_ARCH
6166d547 1728#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS)
0f71a2f6
JM
1729#define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi))
1730#endif
1731#endif
1732
104c1213
JM
1733typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) (struct frame_info *frame);
1734extern CORE_ADDR gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame);
1735extern void set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call);
83905903
AC
1736#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVED_PC_AFTER_CALL)
1737#error "Non multi-arch definition of SAVED_PC_AFTER_CALL"
1738#endif
0f71a2f6 1739#if GDB_MULTI_ARCH
6166d547 1740#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVED_PC_AFTER_CALL)
0f71a2f6
JM
1741#define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame))
1742#endif
1743#endif
1744
104c1213
JM
1745typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
1746extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
1747extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
83905903
AC
1748#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS)
1749#error "Non multi-arch definition of FRAME_NUM_ARGS"
1750#endif
0f71a2f6 1751#if GDB_MULTI_ARCH
6166d547 1752#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS)
0f71a2f6
JM
1753#define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
1754#endif
1755#endif
1756
2ada493a
AC
1757#if defined (STACK_ALIGN)
1758/* Legacy for systems yet to multi-arch STACK_ALIGN */
eee30e78 1759#if !defined (STACK_ALIGN_P)
2ada493a
AC
1760#define STACK_ALIGN_P() (1)
1761#endif
eee30e78 1762#endif
2ada493a 1763
33489c5b 1764/* Default predicate for non- multi-arch targets. */
6166d547 1765#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P)
33489c5b
AC
1766#define STACK_ALIGN_P() (0)
1767#endif
1768
2ada493a 1769extern int gdbarch_stack_align_p (struct gdbarch *gdbarch);
83905903
AC
1770#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P)
1771#error "Non multi-arch definition of STACK_ALIGN"
1772#endif
6166d547 1773#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P)
2ada493a
AC
1774#define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch))
1775#endif
1776
33489c5b 1777/* Default (function) for non- multi-arch platforms. */
6166d547 1778#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN)
8e65ff28 1779#define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0)
33489c5b
AC
1780#endif
1781
2ada493a
AC
1782typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp);
1783extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp);
1784extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align);
83905903
AC
1785#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN)
1786#error "Non multi-arch definition of STACK_ALIGN"
1787#endif
33489c5b 1788#if GDB_MULTI_ARCH
6166d547 1789#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN)
2ada493a
AC
1790#define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp))
1791#endif
33489c5b 1792#endif
2ada493a 1793
0a49d05e
AC
1794/* Default (value) for non- multi-arch platforms. */
1795#if (!GDB_MULTI_ARCH) && !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
1796#define EXTRA_STACK_ALIGNMENT_NEEDED (1)
1797#endif
1798
1799extern int gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch);
1800extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, int extra_stack_alignment_needed);
83905903
AC
1801#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRA_STACK_ALIGNMENT_NEEDED)
1802#error "Non multi-arch definition of EXTRA_STACK_ALIGNMENT_NEEDED"
1803#endif
0a49d05e
AC
1804#if GDB_MULTI_ARCH
1805#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
1806#define EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_extra_stack_alignment_needed (current_gdbarch))
1807#endif
1808#endif
1809
d03e67c9
AC
1810#if defined (REG_STRUCT_HAS_ADDR)
1811/* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
eee30e78 1812#if !defined (REG_STRUCT_HAS_ADDR_P)
d03e67c9
AC
1813#define REG_STRUCT_HAS_ADDR_P() (1)
1814#endif
eee30e78 1815#endif
d03e67c9 1816
33489c5b 1817/* Default predicate for non- multi-arch targets. */
6166d547 1818#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P)
33489c5b
AC
1819#define REG_STRUCT_HAS_ADDR_P() (0)
1820#endif
1821
d03e67c9 1822extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch);
83905903
AC
1823#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P)
1824#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
1825#endif
6166d547 1826#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P)
d03e67c9
AC
1827#define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch))
1828#endif
1829
33489c5b 1830/* Default (function) for non- multi-arch platforms. */
6166d547 1831#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR)
8e65ff28 1832#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0)
33489c5b
AC
1833#endif
1834
d03e67c9
AC
1835typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
1836extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
1837extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr);
83905903
AC
1838#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR)
1839#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
1840#endif
33489c5b 1841#if GDB_MULTI_ARCH
6166d547 1842#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR)
d03e67c9
AC
1843#define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type))
1844#endif
33489c5b 1845#endif
d03e67c9 1846
d1e3cf49
AC
1847#if defined (SAVE_DUMMY_FRAME_TOS)
1848/* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
eee30e78 1849#if !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
1850#define SAVE_DUMMY_FRAME_TOS_P() (1)
1851#endif
eee30e78 1852#endif
d1e3cf49
AC
1853
1854/* Default predicate for non- multi-arch targets. */
6166d547 1855#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
1856#define SAVE_DUMMY_FRAME_TOS_P() (0)
1857#endif
1858
1859extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
83905903
AC
1860#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P)
1861#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
1862#endif
6166d547 1863#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P)
d1e3cf49
AC
1864#define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch))
1865#endif
1866
1867/* Default (function) for non- multi-arch platforms. */
6166d547 1868#if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS)
8e65ff28 1869#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0)
d1e3cf49
AC
1870#endif
1871
1872typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
1873extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp);
1874extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos);
83905903
AC
1875#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS)
1876#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS"
1877#endif
d1e3cf49 1878#if GDB_MULTI_ARCH
6166d547 1879#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS)
d1e3cf49
AC
1880#define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp))
1881#endif
1882#endif
1883
58d5518e
ND
1884extern int gdbarch_parm_boundary (struct gdbarch *gdbarch);
1885extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary);
83905903
AC
1886#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY)
1887#error "Non multi-arch definition of PARM_BOUNDARY"
1888#endif
58d5518e
ND
1889#if GDB_MULTI_ARCH
1890#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY)
1891#define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
1892#endif
1893#endif
1894
f0d4cc9e 1895/* Default (value) for non- multi-arch platforms. */
6166d547 1896#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT)
f0d4cc9e
AC
1897#define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch))
1898#endif
1899
1900extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
1901extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
83905903
AC
1902#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
1903#error "Non multi-arch definition of TARGET_FLOAT_FORMAT"
1904#endif
f0d4cc9e 1905#if GDB_MULTI_ARCH
6166d547 1906#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT)
f0d4cc9e
AC
1907#define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch))
1908#endif
1909#endif
1910
1911/* Default (value) for non- multi-arch platforms. */
6166d547 1912#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT)
f0d4cc9e
AC
1913#define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch))
1914#endif
1915
1916extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch);
1917extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format);
83905903
AC
1918#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT)
1919#error "Non multi-arch definition of TARGET_DOUBLE_FORMAT"
1920#endif
f0d4cc9e 1921#if GDB_MULTI_ARCH
6166d547 1922#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT)
f0d4cc9e
AC
1923#define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch))
1924#endif
1925#endif
1926
1927/* Default (value) for non- multi-arch platforms. */
6166d547 1928#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT)
f0d4cc9e
AC
1929#define TARGET_LONG_DOUBLE_FORMAT (&floatformat_unknown)
1930#endif
1931
1932extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch);
1933extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format);
83905903
AC
1934#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT)
1935#error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT"
1936#endif
f0d4cc9e 1937#if GDB_MULTI_ARCH
6166d547 1938#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT)
f0d4cc9e
AC
1939#define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch))
1940#endif
1941#endif
1942
f517ea4e
PS
1943/* Default (function) for non- multi-arch platforms. */
1944#if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR)
875e1767 1945#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr))
f517ea4e
PS
1946#endif
1947
1948typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr);
1949extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr);
1950extern 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
1951#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR)
1952#error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR"
1953#endif
f517ea4e
PS
1954#if GDB_MULTI_ARCH
1955#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR)
1956#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr))
1957#endif
1958#endif
1959
875e1767
AC
1960/* On some machines there are bits in addresses which are not really
1961 part of the address, but are used by the kernel, the hardware, etc.
1962 for special purposes. ADDR_BITS_REMOVE takes out any such bits so
1963 we get a "real" address such as one would find in a symbol table.
1964 This is used only for addresses of instructions, and even then I'm
1965 not sure it's used in all contexts. It exists to deal with there
1966 being a few stray bits in the PC which would mislead us, not as some
1967 sort of generic thing to handle alignment or segmentation (it's
1968 possible it should be in TARGET_READ_PC instead). */
1969
1970/* Default (function) for non- multi-arch platforms. */
1971#if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE)
1972#define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr))
1973#endif
1974
1975typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
1976extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
1977extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
83905903
AC
1978#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE)
1979#error "Non multi-arch definition of ADDR_BITS_REMOVE"
1980#endif
875e1767
AC
1981#if GDB_MULTI_ARCH
1982#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE)
1983#define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
1984#endif
1985#endif
1986
64c4637f
AC
1987/* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
1988 the target needs software single step. An ISA method to implement it.
1989
1990 FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
1991 using the breakpoint system instead of blatting memory directly (as with rs6000).
1992
1993 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
1994 single step. If not, then implement single step using breakpoints. */
1995
1996#if defined (SOFTWARE_SINGLE_STEP)
1997/* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
1998#if !defined (SOFTWARE_SINGLE_STEP_P)
1999#define SOFTWARE_SINGLE_STEP_P() (1)
2000#endif
2001#endif
2002
2003/* Default predicate for non- multi-arch targets. */
2004#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
2005#define SOFTWARE_SINGLE_STEP_P() (0)
2006#endif
2007
2008extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
83905903
AC
2009#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
2010#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2011#endif
64c4637f
AC
2012#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
2013#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
2014#endif
2015
2016/* Default (function) for non- multi-arch platforms. */
2017#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
2018#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
2019#endif
2020
2021typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
2022extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
2023extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
83905903
AC
2024#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP)
2025#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
2026#endif
64c4637f
AC
2027#if GDB_MULTI_ARCH
2028#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
2029#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
2030#endif
2031#endif
2032
104c1213 2033extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
0f71a2f6
JM
2034
2035
2036/* Mechanism for co-ordinating the selection of a specific
2037 architecture.
2038
2039 GDB targets (*-tdep.c) can register an interest in a specific
2040 architecture. Other GDB components can register a need to maintain
2041 per-architecture data.
2042
2043 The mechanisms below ensures that there is only a loose connection
2044 between the set-architecture command and the various GDB
99e7bb18 2045 components. Each component can independently register their need
0f71a2f6
JM
2046 to maintain architecture specific data with gdbarch.
2047
2048 Pragmatics:
2049
2050 Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
2051 didn't scale.
2052
2053 The more traditional mega-struct containing architecture specific
2054 data for all the various GDB components was also considered. Since
99e7bb18 2055 GDB is built from a variable number of (fairly independent)
0f71a2f6
JM
2056 components it was determined that the global aproach was not
2057 applicable. */
2058
2059
2060/* Register a new architectural family with GDB.
2061
2062 Register support for the specified ARCHITECTURE with GDB. When
2063 gdbarch determines that the specified architecture has been
2064 selected, the corresponding INIT function is called.
2065
2066 --
2067
2068 The INIT function takes two parameters: INFO which contains the
2069 information available to gdbarch about the (possibly new)
2070 architecture; ARCHES which is a list of the previously created
2071 ``struct gdbarch'' for this architecture.
2072
2073 The INIT function parameter INFO shall, as far as possible, be
2074 pre-initialized with information obtained from INFO.ABFD or
2075 previously selected architecture (if similar). INIT shall ensure
2076 that the INFO.BYTE_ORDER is non-zero.
2077
2078 The INIT function shall return any of: NULL - indicating that it
ec3d358c 2079 doesn't recognize the selected architecture; an existing ``struct
0f71a2f6
JM
2080 gdbarch'' from the ARCHES list - indicating that the new
2081 architecture is just a synonym for an earlier architecture (see
2082 gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
4b9b3959
AC
2083 - that describes the selected architecture (see gdbarch_alloc()).
2084
2085 The DUMP_TDEP function shall print out all target specific values.
2086 Care should be taken to ensure that the function works in both the
2087 multi-arch and non- multi-arch cases. */
0f71a2f6 2088
adf40b2e
JM
2089struct gdbarch_list
2090{
2091 struct gdbarch *gdbarch;
2092 struct gdbarch_list *next;
2093};
0f71a2f6 2094
adf40b2e
JM
2095struct gdbarch_info
2096{
adf40b2e
JM
2097 /* Use default: NULL (ZERO). */
2098 const struct bfd_arch_info *bfd_arch_info;
0f71a2f6 2099
adf40b2e
JM
2100 /* Use default: 0 (ZERO). */
2101 int byte_order;
0f71a2f6 2102
adf40b2e
JM
2103 /* Use default: NULL (ZERO). */
2104 bfd *abfd;
0f71a2f6 2105
adf40b2e
JM
2106 /* Use default: NULL (ZERO). */
2107 struct gdbarch_tdep_info *tdep_info;
2108};
0f71a2f6 2109
104c1213 2110typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
4b9b3959 2111typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
0f71a2f6 2112
4b9b3959 2113/* DEPRECATED - use gdbarch_register() */
104c1213 2114extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
0f71a2f6 2115
4b9b3959
AC
2116extern void gdbarch_register (enum bfd_architecture architecture,
2117 gdbarch_init_ftype *,
2118 gdbarch_dump_tdep_ftype *);
2119
0f71a2f6 2120
b4a20239
AC
2121/* Return a freshly allocated, NULL terminated, array of the valid
2122 architecture names. Since architectures are registered during the
2123 _initialize phase this function only returns useful information
2124 once initialization has been completed. */
2125
2126extern const char **gdbarch_printable_names (void);
2127
2128
0f71a2f6
JM
2129/* Helper function. Search the list of ARCHES for a GDBARCH that
2130 matches the information provided by INFO. */
2131
104c1213 2132extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
0f71a2f6
JM
2133
2134
2135/* Helper function. Create a preliminary ``struct gdbarch''. Perform
2136 basic initialization using values obtained from the INFO andTDEP
2137 parameters. set_gdbarch_*() functions are called to complete the
2138 initialization of the object. */
2139
104c1213 2140extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
0f71a2f6
JM
2141
2142
4b9b3959
AC
2143/* Helper function. Free a partially-constructed ``struct gdbarch''.
2144 It is assumed that the caller freeds the ``struct
2145 gdbarch_tdep''. */
2146
058f20d5
JB
2147extern void gdbarch_free (struct gdbarch *);
2148
2149
b732d07d 2150/* Helper function. Force an update of the current architecture.
0f71a2f6 2151
b732d07d
AC
2152 The actual architecture selected is determined by INFO, ``(gdb) set
2153 architecture'' et.al., the existing architecture and BFD's default
2154 architecture. INFO should be initialized to zero and then selected
2155 fields should be updated.
0f71a2f6 2156
16f33e29
AC
2157 Returns non-zero if the update succeeds */
2158
2159extern int gdbarch_update_p (struct gdbarch_info info);
0f71a2f6
JM
2160
2161
2162
2163/* Register per-architecture data-pointer.
2164
2165 Reserve space for a per-architecture data-pointer. An identifier
2166 for the reserved data-pointer is returned. That identifer should
95160752 2167 be saved in a local static variable.
0f71a2f6 2168
95160752
AC
2169 The per-architecture data-pointer can be initialized in one of two
2170 ways: The value can be set explicitly using a call to
2171 set_gdbarch_data(); the value can be set implicitly using the value
2172 returned by a non-NULL INIT() callback. INIT(), when non-NULL is
2173 called after the basic architecture vector has been created.
0f71a2f6 2174
95160752
AC
2175 When a previously created architecture is re-selected, the
2176 per-architecture data-pointer for that previous architecture is
2177 restored. INIT() is not called.
2178
2179 During initialization, multiple assignments of the data-pointer are
2180 allowed, non-NULL values are deleted by calling FREE(). If the
2181 architecture is deleted using gdbarch_free() all non-NULL data
2182 pointers are also deleted using FREE().
0f71a2f6
JM
2183
2184 Multiple registrarants for any architecture are allowed (and
2185 strongly encouraged). */
2186
95160752 2187struct gdbarch_data;
0f71a2f6 2188
95160752
AC
2189typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
2190typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
2191 void *pointer);
2192extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
2193 gdbarch_data_free_ftype *free);
2194extern void set_gdbarch_data (struct gdbarch *gdbarch,
2195 struct gdbarch_data *data,
2196 void *pointer);
0f71a2f6 2197
104c1213 2198extern void *gdbarch_data (struct gdbarch_data*);
0f71a2f6
JM
2199
2200
0f71a2f6
JM
2201/* Register per-architecture memory region.
2202
2203 Provide a memory-region swap mechanism. Per-architecture memory
2204 region are created. These memory regions are swapped whenever the
2205 architecture is changed. For a new architecture, the memory region
2206 is initialized with zero (0) and the INIT function is called.
2207
2208 Memory regions are swapped / initialized in the order that they are
2209 registered. NULL DATA and/or INIT values can be specified.
2210
2211 New code should use register_gdbarch_data(). */
2212
104c1213
JM
2213typedef void (gdbarch_swap_ftype) (void);
2214extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init);
e514a9d6 2215#define REGISTER_GDBARCH_SWAP(VAR) register_gdbarch_swap (&(VAR), sizeof ((VAR)), NULL)
0f71a2f6
JM
2216
2217
2218
99e7bb18 2219/* The target-system-dependent byte order is dynamic */
c906108c
SS
2220
2221/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
b83266a0 2222 is selectable at runtime. The user can use the ``set endian''
c906108c
SS
2223 command to change it. TARGET_BYTE_ORDER_AUTO is nonzero when
2224 target_byte_order should be auto-detected (from the program image
2225 say). */
2226
0f71a2f6
JM
2227#if GDB_MULTI_ARCH
2228/* Multi-arch GDB is always bi-endian. */
2229#define TARGET_BYTE_ORDER_SELECTABLE_P 1
2230#endif
2231
c906108c
SS
2232#ifndef TARGET_BYTE_ORDER_SELECTABLE_P
2233/* compat - Catch old targets that define TARGET_BYTE_ORDER_SLECTABLE
2234 when they should have defined TARGET_BYTE_ORDER_SELECTABLE_P 1 */
2235#ifdef TARGET_BYTE_ORDER_SELECTABLE
2236#define TARGET_BYTE_ORDER_SELECTABLE_P 1
2237#else
2238#define TARGET_BYTE_ORDER_SELECTABLE_P 0
2239#endif
2240#endif
2241
adf40b2e 2242extern int target_byte_order;
c906108c
SS
2243#ifdef TARGET_BYTE_ORDER_SELECTABLE
2244/* compat - Catch old targets that define TARGET_BYTE_ORDER_SELECTABLE
2245 and expect defs.h to re-define TARGET_BYTE_ORDER. */
2246#undef TARGET_BYTE_ORDER
2247#endif
2248#ifndef TARGET_BYTE_ORDER
2249#define TARGET_BYTE_ORDER (target_byte_order + 0)
2250#endif
2251
adf40b2e 2252extern int target_byte_order_auto;
c906108c
SS
2253#ifndef TARGET_BYTE_ORDER_AUTO
2254#define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
2255#endif
2256
2257
2258
99e7bb18 2259/* The target-system-dependent BFD architecture is dynamic */
c906108c 2260
adf40b2e 2261extern int target_architecture_auto;
c906108c
SS
2262#ifndef TARGET_ARCHITECTURE_AUTO
2263#define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
2264#endif
2265
adf40b2e 2266extern const struct bfd_arch_info *target_architecture;
c906108c
SS
2267#ifndef TARGET_ARCHITECTURE
2268#define TARGET_ARCHITECTURE (target_architecture + 0)
2269#endif
2270
c906108c 2271
99e7bb18 2272/* The target-system-dependent disassembler is semi-dynamic */
c906108c
SS
2273
2274#include "dis-asm.h" /* Get defs for disassemble_info */
2275
104c1213 2276extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
ff844c8d 2277 unsigned int len, disassemble_info *info);
c906108c 2278
104c1213
JM
2279extern void dis_asm_memory_error (int status, bfd_vma memaddr,
2280 disassemble_info *info);
c906108c 2281
104c1213
JM
2282extern void dis_asm_print_address (bfd_vma addr,
2283 disassemble_info *info);
c906108c 2284
104c1213 2285extern int (*tm_print_insn) (bfd_vma, disassemble_info*);
adf40b2e 2286extern disassemble_info tm_print_insn_info;
c906108c
SS
2287#ifndef TARGET_PRINT_INSN
2288#define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info)
2289#endif
2290#ifndef TARGET_PRINT_INSN_INFO
2291#define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
2292#endif
2293
2294
2295
7a292a7a
SS
2296/* Explicit test for D10V architecture.
2297 USE of these macro's is *STRONGLY* discouraged. */
2298
2299#define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v)
7a292a7a
SS
2300
2301
99e7bb18 2302/* Set the dynamic target-system-dependent parameters (architecture,
c906108c
SS
2303 byte-order, ...) using information found in the BFD */
2304
104c1213 2305extern void set_gdbarch_from_file (bfd *);
c906108c
SS
2306
2307
e514a9d6
JM
2308/* Initialize the current architecture to the "first" one we find on
2309 our list. */
2310
2311extern void initialize_current_architecture (void);
2312
ceaa8edf
JB
2313/* For non-multiarched targets, do any initialization of the default
2314 gdbarch object necessary after the _initialize_MODULE functions
2315 have run. */
2316extern void initialize_non_multiarch ();
cce74817 2317
c906108c 2318/* gdbarch trace variable */
adf40b2e 2319extern int gdbarch_debug;
c906108c 2320
4b9b3959 2321extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
0f71a2f6 2322
c906108c 2323#endif
This page took 0.217637 seconds and 4 git commands to generate.