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