Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
79d45cd4 AC |
4 | |
5 | Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free | |
6 | Software Foundation, Inc. | |
c906108c | 7 | |
96baa820 JM |
8 | This file is part of GDB. |
9 | ||
10 | This program is free software; you can redistribute it and/or modify | |
11 | it under the terms of the GNU General Public License as published by | |
12 | the Free Software Foundation; either version 2 of the License, or | |
13 | (at your option) any later version. | |
c906108c | 14 | |
96baa820 JM |
15 | This program is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | GNU General Public License for more details. | |
c906108c | 19 | |
96baa820 JM |
20 | You should have received a copy of the GNU General Public License |
21 | along with this program; if not, write to the Free Software | |
22 | Foundation, Inc., 59 Temple Place - Suite 330, | |
23 | Boston, MA 02111-1307, USA. */ | |
adf40b2e | 24 | |
104c1213 JM |
25 | /* This file was created with the aid of ``gdbarch.sh''. |
26 | ||
52204a0b | 27 | The Bourne shell script ``gdbarch.sh'' creates the files |
104c1213 JM |
28 | ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them |
29 | against the existing ``gdbarch.[hc]''. Any differences found | |
30 | being reported. | |
31 | ||
32 | If editing this file, please also run gdbarch.sh and merge any | |
52204a0b | 33 | changes into that script. Conversely, when making sweeping changes |
104c1213 JM |
34 | to this file, modifying gdbarch.sh and using its output may prove |
35 | easier. */ | |
c906108c | 36 | |
c906108c SS |
37 | |
38 | #include "defs.h" | |
1ad03bde | 39 | #include "arch-utils.h" |
c906108c | 40 | |
0f71a2f6 | 41 | #include "gdbcmd.h" |
adf40b2e | 42 | #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */ |
7a292a7a | 43 | #include "symcat.h" |
c906108c | 44 | |
f0d4cc9e | 45 | #include "floatformat.h" |
c906108c | 46 | |
95160752 | 47 | #include "gdb_assert.h" |
b66d6d2e | 48 | #include "gdb_string.h" |
67c2c32c | 49 | #include "gdb-events.h" |
b59ff9d5 | 50 | #include "reggroups.h" |
4be87837 | 51 | #include "osabi.h" |
aebd7893 | 52 | #include "gdb_obstack.h" |
95160752 | 53 | |
104c1213 JM |
54 | /* Static function declarations */ |
55 | ||
b3cc3077 | 56 | static void alloc_gdbarch_data (struct gdbarch *); |
104c1213 | 57 | |
0f71a2f6 JM |
58 | /* Non-zero if we want to trace architecture code. */ |
59 | ||
60 | #ifndef GDBARCH_DEBUG | |
61 | #define GDBARCH_DEBUG 0 | |
62 | #endif | |
63 | int gdbarch_debug = GDBARCH_DEBUG; | |
64 | ||
456fcf94 AC |
65 | static const char * |
66 | pformat (const struct floatformat *format) | |
67 | { | |
68 | if (format == NULL) | |
69 | return "(null)"; | |
70 | else | |
71 | return format->name; | |
72 | } | |
73 | ||
0f71a2f6 JM |
74 | |
75 | /* Maintain the struct gdbarch object */ | |
76 | ||
77 | struct gdbarch | |
adf40b2e | 78 | { |
76860b5f AC |
79 | /* Has this architecture been fully initialized? */ |
80 | int initialized_p; | |
aebd7893 AC |
81 | |
82 | /* An obstack bound to the lifetime of the architecture. */ | |
83 | struct obstack *obstack; | |
84 | ||
adf40b2e JM |
85 | /* basic architectural information */ |
86 | const struct bfd_arch_info * bfd_arch_info; | |
87 | int byte_order; | |
4be87837 | 88 | enum gdb_osabi osabi; |
0f71a2f6 | 89 | |
adf40b2e JM |
90 | /* target specific vector. */ |
91 | struct gdbarch_tdep *tdep; | |
4b9b3959 | 92 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 93 | |
adf40b2e | 94 | /* per-architecture data-pointers */ |
95160752 | 95 | unsigned nr_data; |
adf40b2e | 96 | void **data; |
0f71a2f6 | 97 | |
adf40b2e JM |
98 | /* per-architecture swap-regions */ |
99 | struct gdbarch_swap *swap; | |
0f71a2f6 | 100 | |
adf40b2e | 101 | /* Multi-arch values. |
0f71a2f6 | 102 | |
adf40b2e | 103 | When extending this structure you must: |
0f71a2f6 | 104 | |
adf40b2e | 105 | Add the field below. |
0f71a2f6 | 106 | |
adf40b2e JM |
107 | Declare set/get functions and define the corresponding |
108 | macro in gdbarch.h. | |
0f71a2f6 | 109 | |
adf40b2e JM |
110 | gdbarch_alloc(): If zero/NULL is not a suitable default, |
111 | initialize the new field. | |
0f71a2f6 | 112 | |
adf40b2e JM |
113 | verify_gdbarch(): Confirm that the target updated the field |
114 | correctly. | |
0f71a2f6 | 115 | |
7e73cedf | 116 | gdbarch_dump(): Add a fprintf_unfiltered call so that the new |
adf40b2e | 117 | field is dumped out |
0f71a2f6 | 118 | |
c0e8c252 | 119 | ``startup_gdbarch()'': Append an initial value to the static |
adf40b2e | 120 | variable (base values on the host's c-type system). |
0f71a2f6 | 121 | |
adf40b2e JM |
122 | get_gdbarch(): Implement the set/get functions (probably using |
123 | the macro's as shortcuts). | |
0f71a2f6 JM |
124 | |
125 | */ | |
126 | ||
adf40b2e JM |
127 | int short_bit; |
128 | int int_bit; | |
129 | int long_bit; | |
130 | int long_long_bit; | |
131 | int float_bit; | |
456fcf94 | 132 | const struct floatformat * float_format; |
adf40b2e | 133 | int double_bit; |
456fcf94 | 134 | const struct floatformat * double_format; |
adf40b2e | 135 | int long_double_bit; |
456fcf94 | 136 | const struct floatformat * long_double_format; |
66b43ecb | 137 | int ptr_bit; |
52204a0b | 138 | int addr_bit; |
66b43ecb | 139 | int bfd_vma_bit; |
4e409299 | 140 | int char_signed; |
adf40b2e JM |
141 | gdbarch_read_pc_ftype *read_pc; |
142 | gdbarch_write_pc_ftype *write_pc; | |
adf40b2e | 143 | gdbarch_read_sp_ftype *read_sp; |
39d4ef09 | 144 | gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; |
d8124050 AC |
145 | gdbarch_pseudo_register_read_ftype *pseudo_register_read; |
146 | gdbarch_pseudo_register_write_ftype *pseudo_register_write; | |
adf40b2e | 147 | int num_regs; |
0aba1244 | 148 | int num_pseudo_regs; |
adf40b2e | 149 | int sp_regnum; |
adf40b2e | 150 | int pc_regnum; |
c2169756 | 151 | int ps_regnum; |
60054393 | 152 | int fp0_regnum; |
88c72b7d AC |
153 | gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum; |
154 | gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum; | |
155 | gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum; | |
156 | gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum; | |
157 | gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum; | |
adf40b2e | 158 | gdbarch_register_name_ftype *register_name; |
9c04cab7 | 159 | gdbarch_register_type_ftype *register_type; |
9c04cab7 | 160 | gdbarch_deprecated_register_byte_ftype *deprecated_register_byte; |
f3be58bc | 161 | gdbarch_unwind_dummy_id_ftype *unwind_dummy_id; |
f3be58bc | 162 | int deprecated_fp_regnum; |
b8de8283 AC |
163 | gdbarch_push_dummy_call_ftype *push_dummy_call; |
164 | gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments; | |
b8de8283 | 165 | int deprecated_register_size; |
adf40b2e | 166 | int call_dummy_location; |
7043d8dc | 167 | gdbarch_push_dummy_code_ftype *push_dummy_code; |
b8de8283 AC |
168 | gdbarch_print_registers_info_ftype *print_registers_info; |
169 | gdbarch_print_float_info_ftype *print_float_info; | |
170 | gdbarch_print_vector_info_ftype *print_vector_info; | |
171 | gdbarch_register_sim_regno_ftype *register_sim_regno; | |
172 | gdbarch_register_bytes_ok_ftype *register_bytes_ok; | |
173 | gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; | |
174 | gdbarch_cannot_store_register_ftype *cannot_store_register; | |
175 | gdbarch_get_longjmp_target_ftype *get_longjmp_target; | |
adf40b2e | 176 | int believe_pcc_promotion; |
13d01224 AC |
177 | gdbarch_convert_register_p_ftype *convert_register_p; |
178 | gdbarch_register_to_value_ftype *register_to_value; | |
179 | gdbarch_value_to_register_ftype *value_to_register; | |
4478b372 JB |
180 | gdbarch_pointer_to_address_ftype *pointer_to_address; |
181 | gdbarch_address_to_pointer_ftype *address_to_pointer; | |
fc0c74b1 | 182 | gdbarch_integer_to_address_ftype *integer_to_address; |
4183d812 | 183 | gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return; |
92ad9cd9 | 184 | gdbarch_return_value_ftype *return_value; |
ebba8386 | 185 | gdbarch_extract_return_value_ftype *extract_return_value; |
adf40b2e | 186 | gdbarch_store_return_value_ftype *store_return_value; |
ebba8386 AC |
187 | gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value; |
188 | gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value; | |
b5622e8d | 189 | gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention; |
74055713 | 190 | gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address; |
adf40b2e JM |
191 | gdbarch_skip_prologue_ftype *skip_prologue; |
192 | gdbarch_inner_than_ftype *inner_than; | |
193 | gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; | |
a1131521 | 194 | gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address; |
917317f4 JM |
195 | gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; |
196 | gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint; | |
adf40b2e | 197 | CORE_ADDR decr_pc_after_break; |
782263ab | 198 | CORE_ADDR deprecated_function_start_offset; |
adf40b2e JM |
199 | gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address; |
200 | CORE_ADDR frame_args_skip; | |
12cc2063 | 201 | gdbarch_unwind_pc_ftype *unwind_pc; |
a9e5fdc2 | 202 | gdbarch_unwind_sp_ftype *unwind_sp; |
6913c89a | 203 | gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call; |
adf40b2e | 204 | gdbarch_frame_num_args_ftype *frame_num_args; |
f27dd7fd | 205 | gdbarch_deprecated_stack_align_ftype *deprecated_stack_align; |
dc604539 | 206 | gdbarch_frame_align_ftype *frame_align; |
88d89dbb | 207 | gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr; |
192cb3d4 | 208 | gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr; |
8b148df9 | 209 | int frame_red_zone_size; |
f517ea4e | 210 | gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr; |
875e1767 | 211 | gdbarch_addr_bits_remove_ftype *addr_bits_remove; |
181c1381 | 212 | gdbarch_smash_text_address_ftype *smash_text_address; |
64c4637f | 213 | gdbarch_software_single_step_ftype *software_single_step; |
2bf0cb65 | 214 | gdbarch_print_insn_ftype *print_insn; |
bdcd319a | 215 | gdbarch_skip_trampoline_code_ftype *skip_trampoline_code; |
dea0c52f | 216 | gdbarch_skip_solib_resolver_ftype *skip_solib_resolver; |
68e9cc94 | 217 | gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline; |
d50355b6 | 218 | gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline; |
c12260ac | 219 | gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p; |
552c04a7 | 220 | gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments; |
a2cf933a EZ |
221 | gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special; |
222 | gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special; | |
5720643c | 223 | const char * name_of_malloc; |
c4ed33b9 | 224 | int cannot_step_breakpoint; |
f74fa174 | 225 | int have_nonsteppable_watchpoint; |
8b2dbe47 KB |
226 | gdbarch_address_class_type_flags_ftype *address_class_type_flags; |
227 | gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name; | |
228 | gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags; | |
b59ff9d5 | 229 | gdbarch_register_reggroup_p_ftype *register_reggroup_p; |
143985b7 | 230 | gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument; |
6ce6d90f | 231 | gdbarch_regset_from_core_section_ftype *regset_from_core_section; |
adf40b2e | 232 | }; |
0f71a2f6 JM |
233 | |
234 | ||
235 | /* The default architecture uses host values (for want of a better | |
236 | choice). */ | |
237 | ||
238 | extern const struct bfd_arch_info bfd_default_arch_struct; | |
239 | ||
4b9b3959 AC |
240 | struct gdbarch startup_gdbarch = |
241 | { | |
76860b5f | 242 | 1, /* Always initialized. */ |
aebd7893 | 243 | NULL, /* The obstack. */ |
0f71a2f6 | 244 | /* basic architecture information */ |
ec5cbaec AC |
245 | &bfd_default_arch_struct, /* bfd_arch_info */ |
246 | BFD_ENDIAN_BIG, /* byte_order */ | |
247 | GDB_OSABI_UNKNOWN, /* osabi */ | |
4b9b3959 AC |
248 | /* target specific vector and its dump routine */ |
249 | NULL, NULL, | |
0f71a2f6 JM |
250 | /*per-architecture data-pointers and swap regions */ |
251 | 0, NULL, NULL, | |
252 | /* Multi-arch values */ | |
ec5cbaec AC |
253 | 8 * sizeof (short), /* short_bit */ |
254 | 8 * sizeof (int), /* int_bit */ | |
255 | 8 * sizeof (long), /* long_bit */ | |
256 | 8 * sizeof (LONGEST), /* long_long_bit */ | |
257 | 8 * sizeof (float), /* float_bit */ | |
456fcf94 | 258 | 0, /* float_format */ |
ec5cbaec | 259 | 8 * sizeof (double), /* double_bit */ |
456fcf94 | 260 | 0, /* double_format */ |
ec5cbaec | 261 | 8 * sizeof (long double), /* long_double_bit */ |
456fcf94 | 262 | 0, /* long_double_format */ |
ec5cbaec AC |
263 | 8 * sizeof (void*), /* ptr_bit */ |
264 | 8 * sizeof (void*), /* addr_bit */ | |
265 | 8 * sizeof (void*), /* bfd_vma_bit */ | |
266 | 1, /* char_signed */ | |
267 | 0, /* read_pc */ | |
268 | 0, /* write_pc */ | |
ec5cbaec | 269 | 0, /* read_sp */ |
ec5cbaec AC |
270 | 0, /* virtual_frame_pointer */ |
271 | 0, /* pseudo_register_read */ | |
272 | 0, /* pseudo_register_write */ | |
273 | 0, /* num_regs */ | |
274 | 0, /* num_pseudo_regs */ | |
275 | -1, /* sp_regnum */ | |
ec5cbaec AC |
276 | -1, /* pc_regnum */ |
277 | -1, /* ps_regnum */ | |
278 | 0, /* fp0_regnum */ | |
ec5cbaec AC |
279 | 0, /* stab_reg_to_regnum */ |
280 | 0, /* ecoff_reg_to_regnum */ | |
281 | 0, /* dwarf_reg_to_regnum */ | |
282 | 0, /* sdb_reg_to_regnum */ | |
283 | 0, /* dwarf2_reg_to_regnum */ | |
284 | 0, /* register_name */ | |
9c04cab7 | 285 | 0, /* register_type */ |
9c04cab7 | 286 | generic_register_byte, /* deprecated_register_byte */ |
f3be58bc | 287 | 0, /* unwind_dummy_id */ |
f3be58bc | 288 | -1, /* deprecated_fp_regnum */ |
b8de8283 AC |
289 | 0, /* push_dummy_call */ |
290 | 0, /* deprecated_push_arguments */ | |
b8de8283 | 291 | 0, /* deprecated_register_size */ |
ec5cbaec | 292 | 0, /* call_dummy_location */ |
ec5cbaec | 293 | 0, /* push_dummy_code */ |
b8de8283 AC |
294 | default_print_registers_info, /* print_registers_info */ |
295 | 0, /* print_float_info */ | |
296 | 0, /* print_vector_info */ | |
297 | 0, /* register_sim_regno */ | |
298 | 0, /* register_bytes_ok */ | |
299 | 0, /* cannot_fetch_register */ | |
300 | 0, /* cannot_store_register */ | |
301 | 0, /* get_longjmp_target */ | |
ec5cbaec | 302 | 0, /* believe_pcc_promotion */ |
ec5cbaec AC |
303 | 0, /* convert_register_p */ |
304 | 0, /* register_to_value */ | |
305 | 0, /* value_to_register */ | |
306 | 0, /* pointer_to_address */ | |
307 | 0, /* address_to_pointer */ | |
308 | 0, /* integer_to_address */ | |
ec5cbaec | 309 | 0, /* deprecated_store_struct_return */ |
92ad9cd9 | 310 | 0, /* return_value */ |
ec5cbaec AC |
311 | 0, /* extract_return_value */ |
312 | 0, /* store_return_value */ | |
313 | 0, /* deprecated_extract_return_value */ | |
314 | 0, /* deprecated_store_return_value */ | |
b5622e8d | 315 | 0, /* deprecated_use_struct_convention */ |
74055713 | 316 | 0, /* deprecated_extract_struct_value_address */ |
ec5cbaec | 317 | 0, /* skip_prologue */ |
ec5cbaec AC |
318 | 0, /* inner_than */ |
319 | 0, /* breakpoint_from_pc */ | |
a1131521 | 320 | 0, /* adjust_breakpoint_address */ |
ec5cbaec AC |
321 | 0, /* memory_insert_breakpoint */ |
322 | 0, /* memory_remove_breakpoint */ | |
323 | 0, /* decr_pc_after_break */ | |
782263ab | 324 | 0, /* deprecated_function_start_offset */ |
ec5cbaec AC |
325 | generic_remote_translate_xfer_address, /* remote_translate_xfer_address */ |
326 | 0, /* frame_args_skip */ | |
ec5cbaec | 327 | 0, /* unwind_pc */ |
a9e5fdc2 | 328 | 0, /* unwind_sp */ |
ec5cbaec AC |
329 | 0, /* deprecated_saved_pc_after_call */ |
330 | 0, /* frame_num_args */ | |
f27dd7fd | 331 | 0, /* deprecated_stack_align */ |
ec5cbaec | 332 | 0, /* frame_align */ |
88d89dbb | 333 | 0, /* deprecated_reg_struct_has_addr */ |
192cb3d4 | 334 | default_stabs_argument_has_addr, /* stabs_argument_has_addr */ |
8b148df9 | 335 | 0, /* frame_red_zone_size */ |
e2d0e7eb | 336 | convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */ |
ec5cbaec AC |
337 | 0, /* addr_bits_remove */ |
338 | 0, /* smash_text_address */ | |
339 | 0, /* software_single_step */ | |
340 | 0, /* print_insn */ | |
341 | 0, /* skip_trampoline_code */ | |
4c8c40e6 | 342 | generic_skip_solib_resolver, /* skip_solib_resolver */ |
ec5cbaec AC |
343 | 0, /* in_solib_call_trampoline */ |
344 | 0, /* in_solib_return_trampoline */ | |
ec5cbaec AC |
345 | generic_in_function_epilogue_p, /* in_function_epilogue_p */ |
346 | construct_inferior_arguments, /* construct_inferior_arguments */ | |
ec5cbaec AC |
347 | 0, /* elf_make_msymbol_special */ |
348 | 0, /* coff_make_msymbol_special */ | |
349 | "malloc", /* name_of_malloc */ | |
350 | 0, /* cannot_step_breakpoint */ | |
351 | 0, /* have_nonsteppable_watchpoint */ | |
352 | 0, /* address_class_type_flags */ | |
353 | 0, /* address_class_type_flags_to_name */ | |
354 | 0, /* address_class_name_to_type_flags */ | |
355 | default_register_reggroup_p, /* register_reggroup_p */ | |
356 | 0, /* fetch_pointer_argument */ | |
6ce6d90f | 357 | 0, /* regset_from_core_section */ |
c0e8c252 | 358 | /* startup_gdbarch() */ |
0f71a2f6 | 359 | }; |
4b9b3959 | 360 | |
c0e8c252 | 361 | struct gdbarch *current_gdbarch = &startup_gdbarch; |
0f71a2f6 | 362 | |
66b43ecb | 363 | /* Create a new ``struct gdbarch'' based on information provided by |
0f71a2f6 JM |
364 | ``struct gdbarch_info''. */ |
365 | ||
366 | struct gdbarch * | |
104c1213 JM |
367 | gdbarch_alloc (const struct gdbarch_info *info, |
368 | struct gdbarch_tdep *tdep) | |
0f71a2f6 | 369 | { |
85de9627 AC |
370 | /* NOTE: The new architecture variable is named ``current_gdbarch'' |
371 | so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to | |
372 | the current local architecture and not the previous global | |
373 | architecture. This ensures that the new architectures initial | |
374 | values are not influenced by the previous architecture. Once | |
375 | everything is parameterised with gdbarch, this will go away. */ | |
aebd7893 AC |
376 | struct gdbarch *current_gdbarch; |
377 | ||
378 | /* Create an obstack for allocating all the per-architecture memory, | |
379 | then use that to allocate the architecture vector. */ | |
380 | struct obstack *obstack = XMALLOC (struct obstack); | |
381 | obstack_init (obstack); | |
382 | current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch)); | |
85de9627 | 383 | memset (current_gdbarch, 0, sizeof (*current_gdbarch)); |
aebd7893 | 384 | current_gdbarch->obstack = obstack; |
0f71a2f6 | 385 | |
85de9627 | 386 | alloc_gdbarch_data (current_gdbarch); |
b3cc3077 | 387 | |
85de9627 | 388 | current_gdbarch->tdep = tdep; |
0f71a2f6 | 389 | |
85de9627 AC |
390 | current_gdbarch->bfd_arch_info = info->bfd_arch_info; |
391 | current_gdbarch->byte_order = info->byte_order; | |
4be87837 | 392 | current_gdbarch->osabi = info->osabi; |
0f71a2f6 JM |
393 | |
394 | /* Force the explicit initialization of these. */ | |
85de9627 AC |
395 | current_gdbarch->short_bit = 2*TARGET_CHAR_BIT; |
396 | current_gdbarch->int_bit = 4*TARGET_CHAR_BIT; | |
397 | current_gdbarch->long_bit = 4*TARGET_CHAR_BIT; | |
398 | current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT; | |
399 | current_gdbarch->float_bit = 4*TARGET_CHAR_BIT; | |
400 | current_gdbarch->double_bit = 8*TARGET_CHAR_BIT; | |
17ef5d92 | 401 | current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT; |
85de9627 AC |
402 | current_gdbarch->ptr_bit = TARGET_INT_BIT; |
403 | current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; | |
4e409299 | 404 | current_gdbarch->char_signed = -1; |
85de9627 | 405 | current_gdbarch->write_pc = generic_target_write_pc; |
85de9627 AC |
406 | current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; |
407 | current_gdbarch->num_regs = -1; | |
408 | current_gdbarch->sp_regnum = -1; | |
85de9627 | 409 | current_gdbarch->pc_regnum = -1; |
c2169756 | 410 | current_gdbarch->ps_regnum = -1; |
85de9627 | 411 | current_gdbarch->fp0_regnum = -1; |
85de9627 AC |
412 | current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum; |
413 | current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum; | |
414 | current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum; | |
415 | current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum; | |
416 | current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum; | |
9c04cab7 | 417 | current_gdbarch->deprecated_register_byte = generic_register_byte; |
f3be58bc | 418 | current_gdbarch->deprecated_fp_regnum = -1; |
b99fa2d2 | 419 | current_gdbarch->call_dummy_location = AT_ENTRY_POINT; |
b8de8283 AC |
420 | current_gdbarch->print_registers_info = default_print_registers_info; |
421 | current_gdbarch->register_sim_regno = legacy_register_sim_regno; | |
422 | current_gdbarch->cannot_fetch_register = cannot_register_not; | |
423 | current_gdbarch->cannot_store_register = cannot_register_not; | |
a1f4a1b6 | 424 | current_gdbarch->convert_register_p = generic_convert_register_p; |
85de9627 AC |
425 | current_gdbarch->pointer_to_address = unsigned_pointer_to_address; |
426 | current_gdbarch->address_to_pointer = unsigned_address_to_pointer; | |
750eb019 | 427 | current_gdbarch->return_value = legacy_return_value; |
ebba8386 AC |
428 | current_gdbarch->extract_return_value = legacy_extract_return_value; |
429 | current_gdbarch->store_return_value = legacy_store_return_value; | |
b5622e8d | 430 | current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention; |
85de9627 AC |
431 | current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; |
432 | current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; | |
85de9627 | 433 | current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address; |
192cb3d4 | 434 | current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr; |
e2d0e7eb | 435 | current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity; |
85de9627 | 436 | current_gdbarch->addr_bits_remove = core_addr_identity; |
181c1381 | 437 | current_gdbarch->smash_text_address = core_addr_identity; |
85de9627 | 438 | current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code; |
dea0c52f | 439 | current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver; |
68e9cc94 | 440 | current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline; |
d50355b6 | 441 | current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline; |
c12260ac | 442 | current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p; |
552c04a7 | 443 | current_gdbarch->construct_inferior_arguments = construct_inferior_arguments; |
a2cf933a EZ |
444 | current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special; |
445 | current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special; | |
5720643c | 446 | current_gdbarch->name_of_malloc = "malloc"; |
b59ff9d5 | 447 | current_gdbarch->register_reggroup_p = default_register_reggroup_p; |
0f71a2f6 JM |
448 | /* gdbarch_alloc() */ |
449 | ||
85de9627 | 450 | return current_gdbarch; |
0f71a2f6 JM |
451 | } |
452 | ||
453 | ||
aebd7893 AC |
454 | /* Allocate extra space using the per-architecture obstack. */ |
455 | ||
456 | void * | |
457 | gdbarch_obstack_zalloc (struct gdbarch *arch, long size) | |
458 | { | |
459 | void *data = obstack_alloc (arch->obstack, size); | |
460 | memset (data, 0, size); | |
461 | return data; | |
462 | } | |
463 | ||
464 | ||
058f20d5 JB |
465 | /* Free a gdbarch struct. This should never happen in normal |
466 | operation --- once you've created a gdbarch, you keep it around. | |
467 | However, if an architecture's init function encounters an error | |
468 | building the structure, it may need to clean up a partially | |
469 | constructed gdbarch. */ | |
4b9b3959 | 470 | |
058f20d5 JB |
471 | void |
472 | gdbarch_free (struct gdbarch *arch) | |
473 | { | |
aebd7893 | 474 | struct obstack *obstack; |
95160752 | 475 | gdb_assert (arch != NULL); |
aebd7893 AC |
476 | gdb_assert (!arch->initialized_p); |
477 | obstack = arch->obstack; | |
478 | obstack_free (obstack, 0); /* Includes the ARCH. */ | |
479 | xfree (obstack); | |
058f20d5 JB |
480 | } |
481 | ||
482 | ||
db446970 AC |
483 | /* Ensure that all values in a GDBARCH are reasonable. */ |
484 | ||
485 | /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it | |
486 | just happens to match the global variable ``current_gdbarch''. That | |
487 | way macros refering to that variable get the local and not the global | |
488 | version - ulgh. Once everything is parameterised with gdbarch, this | |
489 | will go away. */ | |
0f71a2f6 | 490 | |
0f71a2f6 | 491 | static void |
db446970 | 492 | verify_gdbarch (struct gdbarch *current_gdbarch) |
0f71a2f6 | 493 | { |
f16a1923 AC |
494 | struct ui_file *log; |
495 | struct cleanup *cleanups; | |
496 | long dummy; | |
497 | char *buf; | |
f16a1923 AC |
498 | log = mem_fileopen (); |
499 | cleanups = make_cleanup_ui_file_delete (log); | |
0f71a2f6 | 500 | /* fundamental */ |
db446970 | 501 | if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN) |
f16a1923 | 502 | fprintf_unfiltered (log, "\n\tbyte-order"); |
db446970 | 503 | if (current_gdbarch->bfd_arch_info == NULL) |
f16a1923 | 504 | fprintf_unfiltered (log, "\n\tbfd_arch_info"); |
0f71a2f6 | 505 | /* Check those that need to be defined for the given multi-arch level. */ |
66b43ecb AC |
506 | /* Skip verify of short_bit, invalid_p == 0 */ |
507 | /* Skip verify of int_bit, invalid_p == 0 */ | |
508 | /* Skip verify of long_bit, invalid_p == 0 */ | |
509 | /* Skip verify of long_long_bit, invalid_p == 0 */ | |
510 | /* Skip verify of float_bit, invalid_p == 0 */ | |
456fcf94 AC |
511 | if (current_gdbarch->float_format == 0) |
512 | current_gdbarch->float_format = default_float_format (current_gdbarch); | |
66b43ecb | 513 | /* Skip verify of double_bit, invalid_p == 0 */ |
456fcf94 AC |
514 | if (current_gdbarch->double_format == 0) |
515 | current_gdbarch->double_format = default_double_format (current_gdbarch); | |
66b43ecb | 516 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
456fcf94 AC |
517 | if (current_gdbarch->long_double_format == 0) |
518 | current_gdbarch->long_double_format = default_double_format (current_gdbarch); | |
66b43ecb | 519 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
db446970 AC |
520 | if (current_gdbarch->addr_bit == 0) |
521 | current_gdbarch->addr_bit = TARGET_PTR_BIT; | |
c0e8c252 | 522 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
db446970 AC |
523 | if (current_gdbarch->char_signed == -1) |
524 | current_gdbarch->char_signed = 1; | |
cde9ea48 | 525 | /* Skip verify of read_pc, has predicate */ |
be8dfb87 | 526 | /* Skip verify of write_pc, invalid_p == 0 */ |
bd1ce8ba | 527 | /* Skip verify of read_sp, has predicate */ |
39d4ef09 | 528 | /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ |
d8124050 AC |
529 | /* Skip verify of pseudo_register_read, has predicate */ |
530 | /* Skip verify of pseudo_register_write, has predicate */ | |
4d60522e | 531 | if (current_gdbarch->num_regs == -1) |
f16a1923 | 532 | fprintf_unfiltered (log, "\n\tnum_regs"); |
0aba1244 | 533 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
1200cd6e | 534 | /* Skip verify of sp_regnum, invalid_p == 0 */ |
1200cd6e | 535 | /* Skip verify of pc_regnum, invalid_p == 0 */ |
c2169756 | 536 | /* Skip verify of ps_regnum, invalid_p == 0 */ |
60054393 | 537 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
88c72b7d AC |
538 | /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */ |
539 | /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */ | |
540 | /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */ | |
541 | /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */ | |
542 | /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */ | |
9c04cab7 | 543 | /* Skip verify of register_type, has predicate */ |
9c04cab7 | 544 | /* Skip verify of deprecated_register_byte, has predicate */ |
f3be58bc | 545 | /* Skip verify of unwind_dummy_id, has predicate */ |
f3be58bc | 546 | /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ |
b8de8283 AC |
547 | /* Skip verify of push_dummy_call, has predicate */ |
548 | /* Skip verify of deprecated_push_arguments, has predicate */ | |
b8de8283 | 549 | /* Skip verify of call_dummy_location, invalid_p == 0 */ |
b8de8283 | 550 | /* Skip verify of push_dummy_code, has predicate */ |
0ab7a791 | 551 | /* Skip verify of print_registers_info, invalid_p == 0 */ |
23e3a7ac | 552 | /* Skip verify of print_float_info, has predicate */ |
e76f1f2e | 553 | /* Skip verify of print_vector_info, has predicate */ |
7c7651b2 | 554 | /* Skip verify of register_sim_regno, invalid_p == 0 */ |
2649061d | 555 | /* Skip verify of register_bytes_ok, has predicate */ |
01fb7433 AC |
556 | /* Skip verify of cannot_fetch_register, invalid_p == 0 */ |
557 | /* Skip verify of cannot_store_register, invalid_p == 0 */ | |
9df628e0 | 558 | /* Skip verify of get_longjmp_target, has predicate */ |
13d01224 | 559 | /* Skip verify of convert_register_p, invalid_p == 0 */ |
4478b372 JB |
560 | /* Skip verify of pointer_to_address, invalid_p == 0 */ |
561 | /* Skip verify of address_to_pointer, invalid_p == 0 */ | |
fc0c74b1 | 562 | /* Skip verify of integer_to_address, has predicate */ |
4183d812 | 563 | /* Skip verify of deprecated_store_struct_return, has predicate */ |
92ad9cd9 | 564 | /* Skip verify of return_value, has predicate */ |
ebba8386 AC |
565 | /* Skip verify of extract_return_value, invalid_p == 0 */ |
566 | /* Skip verify of store_return_value, invalid_p == 0 */ | |
b5622e8d | 567 | /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */ |
74055713 | 568 | /* Skip verify of deprecated_extract_struct_value_address, has predicate */ |
4d60522e | 569 | if (current_gdbarch->skip_prologue == 0) |
f16a1923 | 570 | fprintf_unfiltered (log, "\n\tskip_prologue"); |
4d60522e | 571 | if (current_gdbarch->inner_than == 0) |
f16a1923 | 572 | fprintf_unfiltered (log, "\n\tinner_than"); |
4d60522e | 573 | if (current_gdbarch->breakpoint_from_pc == 0) |
aaab4dba | 574 | fprintf_unfiltered (log, "\n\tbreakpoint_from_pc"); |
a1131521 | 575 | /* Skip verify of adjust_breakpoint_address, has predicate */ |
c0e8c252 AC |
576 | /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ |
577 | /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ | |
71bd6bd4 | 578 | /* Skip verify of decr_pc_after_break, invalid_p == 0 */ |
782263ab | 579 | /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */ |
c0e8c252 | 580 | /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */ |
5867a2fb | 581 | /* Skip verify of frame_args_skip, invalid_p == 0 */ |
12cc2063 | 582 | /* Skip verify of unwind_pc, has predicate */ |
a9e5fdc2 | 583 | /* Skip verify of unwind_sp, has predicate */ |
6913c89a | 584 | /* Skip verify of deprecated_saved_pc_after_call, has predicate */ |
983a287a | 585 | /* Skip verify of frame_num_args, has predicate */ |
f27dd7fd | 586 | /* Skip verify of deprecated_stack_align, has predicate */ |
dc604539 | 587 | /* Skip verify of frame_align, has predicate */ |
88d89dbb | 588 | /* Skip verify of deprecated_reg_struct_has_addr, has predicate */ |
192cb3d4 | 589 | /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */ |
f517ea4e | 590 | /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ |
875e1767 | 591 | /* Skip verify of addr_bits_remove, invalid_p == 0 */ |
181c1381 | 592 | /* Skip verify of smash_text_address, invalid_p == 0 */ |
64c4637f | 593 | /* Skip verify of software_single_step, has predicate */ |
4d60522e | 594 | if (current_gdbarch->print_insn == 0) |
f6c40618 | 595 | fprintf_unfiltered (log, "\n\tprint_insn"); |
bdcd319a | 596 | /* Skip verify of skip_trampoline_code, invalid_p == 0 */ |
dea0c52f | 597 | /* Skip verify of skip_solib_resolver, invalid_p == 0 */ |
68e9cc94 | 598 | /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */ |
d50355b6 | 599 | /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */ |
c12260ac | 600 | /* Skip verify of in_function_epilogue_p, invalid_p == 0 */ |
552c04a7 | 601 | /* Skip verify of construct_inferior_arguments, invalid_p == 0 */ |
a2cf933a EZ |
602 | /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */ |
603 | /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */ | |
5720643c | 604 | /* Skip verify of name_of_malloc, invalid_p == 0 */ |
c4ed33b9 | 605 | /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ |
f74fa174 | 606 | /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ |
8b2dbe47 KB |
607 | /* Skip verify of address_class_type_flags, has predicate */ |
608 | /* Skip verify of address_class_type_flags_to_name, has predicate */ | |
609 | /* Skip verify of address_class_name_to_type_flags, has predicate */ | |
7e20f3fb | 610 | /* Skip verify of register_reggroup_p, invalid_p == 0 */ |
143985b7 | 611 | /* Skip verify of fetch_pointer_argument, has predicate */ |
6ce6d90f | 612 | /* Skip verify of regset_from_core_section, has predicate */ |
f16a1923 AC |
613 | buf = ui_file_xstrdup (log, &dummy); |
614 | make_cleanup (xfree, buf); | |
615 | if (strlen (buf) > 0) | |
616 | internal_error (__FILE__, __LINE__, | |
617 | "verify_gdbarch: the following are invalid ...%s", | |
618 | buf); | |
619 | do_cleanups (cleanups); | |
0f71a2f6 JM |
620 | } |
621 | ||
622 | ||
623 | /* Print out the details of the current architecture. */ | |
624 | ||
4b9b3959 AC |
625 | /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it |
626 | just happens to match the global variable ``current_gdbarch''. That | |
627 | way macros refering to that variable get the local and not the global | |
628 | version - ulgh. Once everything is parameterised with gdbarch, this | |
629 | will go away. */ | |
630 | ||
0f71a2f6 | 631 | void |
db446970 | 632 | gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) |
0f71a2f6 | 633 | { |
b78960be AC |
634 | const char *gdb_xm_file = "<not-defined>"; |
635 | const char *gdb_nm_file = "<not-defined>"; | |
636 | const char *gdb_tm_file = "<not-defined>"; | |
637 | #if defined (GDB_XM_FILE) | |
638 | gdb_xm_file = GDB_XM_FILE; | |
639 | #endif | |
640 | fprintf_unfiltered (file, | |
641 | "gdbarch_dump: GDB_XM_FILE = %s\n", | |
642 | gdb_xm_file); | |
643 | #if defined (GDB_NM_FILE) | |
644 | gdb_nm_file = GDB_NM_FILE; | |
645 | #endif | |
646 | fprintf_unfiltered (file, | |
647 | "gdbarch_dump: GDB_NM_FILE = %s\n", | |
648 | gdb_nm_file); | |
649 | #if defined (GDB_TM_FILE) | |
650 | gdb_tm_file = GDB_TM_FILE; | |
651 | #endif | |
4b9b3959 | 652 | fprintf_unfiltered (file, |
b78960be AC |
653 | "gdbarch_dump: GDB_TM_FILE = %s\n", |
654 | gdb_tm_file); | |
a2428dbe | 655 | #ifdef TARGET_ADDR_BIT |
e2d0e7eb | 656 | fprintf_unfiltered (file, |
a2428dbe AC |
657 | "gdbarch_dump: TARGET_ADDR_BIT # %s\n", |
658 | XSTRING (TARGET_ADDR_BIT)); | |
a2428dbe | 659 | #endif |
48f7351b AC |
660 | fprintf_unfiltered (file, |
661 | "gdbarch_dump: addr_bit = %s\n", | |
662 | paddr_d (current_gdbarch->addr_bit)); | |
a2428dbe | 663 | #ifdef ADDR_BITS_REMOVE |
7996bcec | 664 | fprintf_unfiltered (file, |
a2428dbe AC |
665 | "gdbarch_dump: %s # %s\n", |
666 | "ADDR_BITS_REMOVE(addr)", | |
667 | XSTRING (ADDR_BITS_REMOVE (addr))); | |
a2428dbe | 668 | #endif |
48f7351b AC |
669 | fprintf_unfiltered (file, |
670 | "gdbarch_dump: addr_bits_remove = <0x%lx>\n", | |
671 | (long) current_gdbarch->addr_bits_remove); | |
7996bcec AC |
672 | fprintf_unfiltered (file, |
673 | "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n", | |
674 | gdbarch_address_class_name_to_type_flags_p (current_gdbarch)); | |
675 | fprintf_unfiltered (file, | |
48f7351b | 676 | "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n", |
7996bcec | 677 | (long) current_gdbarch->address_class_name_to_type_flags); |
1e9f55d0 AC |
678 | #ifdef ADDRESS_CLASS_TYPE_FLAGS_P |
679 | fprintf_unfiltered (file, | |
680 | "gdbarch_dump: %s # %s\n", | |
681 | "ADDRESS_CLASS_TYPE_FLAGS_P()", | |
682 | XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ())); | |
1e9f55d0 | 683 | #endif |
48f7351b AC |
684 | fprintf_unfiltered (file, |
685 | "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n", | |
686 | gdbarch_address_class_type_flags_p (current_gdbarch)); | |
8b2dbe47 KB |
687 | #ifdef ADDRESS_CLASS_TYPE_FLAGS |
688 | fprintf_unfiltered (file, | |
689 | "gdbarch_dump: %s # %s\n", | |
690 | "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)", | |
691 | XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class))); | |
8b2dbe47 | 692 | #endif |
48f7351b AC |
693 | fprintf_unfiltered (file, |
694 | "gdbarch_dump: address_class_type_flags = <0x%lx>\n", | |
695 | (long) current_gdbarch->address_class_type_flags); | |
7996bcec AC |
696 | fprintf_unfiltered (file, |
697 | "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n", | |
698 | gdbarch_address_class_type_flags_to_name_p (current_gdbarch)); | |
699 | fprintf_unfiltered (file, | |
48f7351b | 700 | "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n", |
7996bcec | 701 | (long) current_gdbarch->address_class_type_flags_to_name); |
08e45a40 | 702 | #ifdef ADDRESS_TO_POINTER |
4b9b3959 | 703 | fprintf_unfiltered (file, |
08e45a40 AC |
704 | "gdbarch_dump: %s # %s\n", |
705 | "ADDRESS_TO_POINTER(type, buf, addr)", | |
706 | XSTRING (ADDRESS_TO_POINTER (type, buf, addr))); | |
5e74b15c | 707 | #endif |
48f7351b AC |
708 | fprintf_unfiltered (file, |
709 | "gdbarch_dump: address_to_pointer = <0x%lx>\n", | |
710 | (long) current_gdbarch->address_to_pointer); | |
a1131521 KB |
711 | fprintf_unfiltered (file, |
712 | "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n", | |
713 | gdbarch_adjust_breakpoint_address_p (current_gdbarch)); | |
714 | fprintf_unfiltered (file, | |
48f7351b | 715 | "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n", |
a1131521 | 716 | (long) current_gdbarch->adjust_breakpoint_address); |
08e45a40 | 717 | #ifdef BELIEVE_PCC_PROMOTION |
4b9b3959 | 718 | fprintf_unfiltered (file, |
08e45a40 AC |
719 | "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n", |
720 | XSTRING (BELIEVE_PCC_PROMOTION)); | |
4b9b3959 | 721 | #endif |
48f7351b AC |
722 | fprintf_unfiltered (file, |
723 | "gdbarch_dump: believe_pcc_promotion = %s\n", | |
724 | paddr_d (current_gdbarch->believe_pcc_promotion)); | |
a2428dbe AC |
725 | #ifdef TARGET_ARCHITECTURE |
726 | fprintf_unfiltered (file, | |
727 | "gdbarch_dump: TARGET_ARCHITECTURE # %s\n", | |
728 | XSTRING (TARGET_ARCHITECTURE)); | |
48f7351b | 729 | #endif |
283354d8 | 730 | fprintf_unfiltered (file, |
48f7351b | 731 | "gdbarch_dump: bfd_arch_info = %s\n", |
283354d8 | 732 | TARGET_ARCHITECTURE->printable_name); |
a2428dbe AC |
733 | #ifdef TARGET_BFD_VMA_BIT |
734 | fprintf_unfiltered (file, | |
735 | "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n", | |
736 | XSTRING (TARGET_BFD_VMA_BIT)); | |
a2428dbe | 737 | #endif |
48f7351b AC |
738 | fprintf_unfiltered (file, |
739 | "gdbarch_dump: bfd_vma_bit = %s\n", | |
740 | paddr_d (current_gdbarch->bfd_vma_bit)); | |
08e45a40 | 741 | #ifdef BREAKPOINT_FROM_PC |
4b9b3959 | 742 | fprintf_unfiltered (file, |
08e45a40 AC |
743 | "gdbarch_dump: %s # %s\n", |
744 | "BREAKPOINT_FROM_PC(pcptr, lenptr)", | |
745 | XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr))); | |
4b9b3959 | 746 | #endif |
48f7351b AC |
747 | fprintf_unfiltered (file, |
748 | "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n", | |
749 | (long) current_gdbarch->breakpoint_from_pc); | |
a2428dbe AC |
750 | #ifdef TARGET_BYTE_ORDER |
751 | fprintf_unfiltered (file, | |
752 | "gdbarch_dump: TARGET_BYTE_ORDER # %s\n", | |
753 | XSTRING (TARGET_BYTE_ORDER)); | |
a2428dbe | 754 | #endif |
48f7351b AC |
755 | fprintf_unfiltered (file, |
756 | "gdbarch_dump: byte_order = %s\n", | |
757 | paddr_d (current_gdbarch->byte_order)); | |
08e45a40 | 758 | #ifdef CALL_DUMMY_LOCATION |
52204a0b | 759 | fprintf_unfiltered (file, |
08e45a40 AC |
760 | "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n", |
761 | XSTRING (CALL_DUMMY_LOCATION)); | |
52204a0b | 762 | #endif |
48f7351b AC |
763 | fprintf_unfiltered (file, |
764 | "gdbarch_dump: call_dummy_location = %s\n", | |
765 | paddr_d (current_gdbarch->call_dummy_location)); | |
08e45a40 | 766 | #ifdef CANNOT_FETCH_REGISTER |
4b9b3959 AC |
767 | fprintf_unfiltered (file, |
768 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
769 | "CANNOT_FETCH_REGISTER(regnum)", |
770 | XSTRING (CANNOT_FETCH_REGISTER (regnum))); | |
4b9b3959 | 771 | #endif |
48f7351b AC |
772 | fprintf_unfiltered (file, |
773 | "gdbarch_dump: cannot_fetch_register = <0x%lx>\n", | |
774 | (long) current_gdbarch->cannot_fetch_register); | |
c4ed33b9 AC |
775 | #ifdef CANNOT_STEP_BREAKPOINT |
776 | fprintf_unfiltered (file, | |
777 | "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n", | |
778 | XSTRING (CANNOT_STEP_BREAKPOINT)); | |
c4ed33b9 | 779 | #endif |
48f7351b AC |
780 | fprintf_unfiltered (file, |
781 | "gdbarch_dump: cannot_step_breakpoint = %s\n", | |
782 | paddr_d (current_gdbarch->cannot_step_breakpoint)); | |
08e45a40 | 783 | #ifdef CANNOT_STORE_REGISTER |
4b9b3959 AC |
784 | fprintf_unfiltered (file, |
785 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
786 | "CANNOT_STORE_REGISTER(regnum)", |
787 | XSTRING (CANNOT_STORE_REGISTER (regnum))); | |
4b9b3959 | 788 | #endif |
48f7351b AC |
789 | fprintf_unfiltered (file, |
790 | "gdbarch_dump: cannot_store_register = <0x%lx>\n", | |
791 | (long) current_gdbarch->cannot_store_register); | |
a2428dbe AC |
792 | #ifdef TARGET_CHAR_SIGNED |
793 | fprintf_unfiltered (file, | |
794 | "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n", | |
795 | XSTRING (TARGET_CHAR_SIGNED)); | |
a2428dbe | 796 | #endif |
48f7351b AC |
797 | fprintf_unfiltered (file, |
798 | "gdbarch_dump: char_signed = %s\n", | |
799 | paddr_d (current_gdbarch->char_signed)); | |
a2cf933a | 800 | #ifdef COFF_MAKE_MSYMBOL_SPECIAL |
a2cf933a EZ |
801 | fprintf_unfiltered (file, |
802 | "gdbarch_dump: %s # %s\n", | |
803 | "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)", | |
804 | XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym))); | |
805 | #endif | |
7996bcec | 806 | fprintf_unfiltered (file, |
48f7351b AC |
807 | "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n", |
808 | (long) current_gdbarch->coff_make_msymbol_special); | |
809 | fprintf_unfiltered (file, | |
810 | "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n", | |
7996bcec | 811 | (long) current_gdbarch->construct_inferior_arguments); |
a2428dbe | 812 | fprintf_unfiltered (file, |
48f7351b | 813 | "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n", |
a2428dbe | 814 | (long) current_gdbarch->convert_from_func_ptr_addr); |
13d01224 AC |
815 | #ifdef CONVERT_REGISTER_P |
816 | fprintf_unfiltered (file, | |
817 | "gdbarch_dump: %s # %s\n", | |
ff2e87ac AC |
818 | "CONVERT_REGISTER_P(regnum, type)", |
819 | XSTRING (CONVERT_REGISTER_P (regnum, type))); | |
13d01224 | 820 | #endif |
48f7351b AC |
821 | fprintf_unfiltered (file, |
822 | "gdbarch_dump: convert_register_p = <0x%lx>\n", | |
823 | (long) current_gdbarch->convert_register_p); | |
08e45a40 | 824 | #ifdef DECR_PC_AFTER_BREAK |
4b9b3959 | 825 | fprintf_unfiltered (file, |
08e45a40 AC |
826 | "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n", |
827 | XSTRING (DECR_PC_AFTER_BREAK)); | |
0aba1244 | 828 | #endif |
48f7351b AC |
829 | fprintf_unfiltered (file, |
830 | "gdbarch_dump: decr_pc_after_break = 0x%s\n", | |
831 | paddr_nz (current_gdbarch->decr_pc_after_break)); | |
26e9b323 | 832 | #ifdef DEPRECATED_EXTRACT_RETURN_VALUE |
26e9b323 AC |
833 | fprintf_unfiltered (file, |
834 | "gdbarch_dump: %s # %s\n", | |
835 | "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)", | |
836 | XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf))); | |
26e9b323 | 837 | #endif |
48f7351b AC |
838 | fprintf_unfiltered (file, |
839 | "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n", | |
840 | (long) current_gdbarch->deprecated_extract_return_value); | |
74055713 AC |
841 | #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P |
842 | fprintf_unfiltered (file, | |
843 | "gdbarch_dump: %s # %s\n", | |
844 | "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()", | |
845 | XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())); | |
74055713 | 846 | #endif |
48f7351b AC |
847 | fprintf_unfiltered (file, |
848 | "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n", | |
849 | gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch)); | |
74055713 AC |
850 | #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS |
851 | fprintf_unfiltered (file, | |
852 | "gdbarch_dump: %s # %s\n", | |
853 | "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)", | |
854 | XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache))); | |
74055713 | 855 | #endif |
48f7351b AC |
856 | fprintf_unfiltered (file, |
857 | "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n", | |
858 | (long) current_gdbarch->deprecated_extract_struct_value_address); | |
0ba6dca9 AC |
859 | #ifdef DEPRECATED_FP_REGNUM |
860 | fprintf_unfiltered (file, | |
861 | "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n", | |
862 | XSTRING (DEPRECATED_FP_REGNUM)); | |
0ba6dca9 | 863 | #endif |
48f7351b AC |
864 | fprintf_unfiltered (file, |
865 | "gdbarch_dump: deprecated_fp_regnum = %s\n", | |
866 | paddr_d (current_gdbarch->deprecated_fp_regnum)); | |
782263ab AC |
867 | #ifdef DEPRECATED_FUNCTION_START_OFFSET |
868 | fprintf_unfiltered (file, | |
869 | "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n", | |
870 | XSTRING (DEPRECATED_FUNCTION_START_OFFSET)); | |
782263ab | 871 | #endif |
48f7351b AC |
872 | fprintf_unfiltered (file, |
873 | "gdbarch_dump: deprecated_function_start_offset = 0x%s\n", | |
874 | paddr_nz (current_gdbarch->deprecated_function_start_offset)); | |
b81774d8 AC |
875 | #ifdef DEPRECATED_PUSH_ARGUMENTS_P |
876 | fprintf_unfiltered (file, | |
877 | "gdbarch_dump: %s # %s\n", | |
878 | "DEPRECATED_PUSH_ARGUMENTS_P()", | |
879 | XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ())); | |
b81774d8 | 880 | #endif |
48f7351b AC |
881 | fprintf_unfiltered (file, |
882 | "gdbarch_dump: gdbarch_deprecated_push_arguments_p() = %d\n", | |
883 | gdbarch_deprecated_push_arguments_p (current_gdbarch)); | |
b81774d8 AC |
884 | #ifdef DEPRECATED_PUSH_ARGUMENTS |
885 | fprintf_unfiltered (file, | |
886 | "gdbarch_dump: %s # %s\n", | |
887 | "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)", | |
888 | XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr))); | |
b81774d8 | 889 | #endif |
48f7351b AC |
890 | fprintf_unfiltered (file, |
891 | "gdbarch_dump: deprecated_push_arguments = <0x%lx>\n", | |
892 | (long) current_gdbarch->deprecated_push_arguments); | |
a2428dbe AC |
893 | #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P |
894 | fprintf_unfiltered (file, | |
895 | "gdbarch_dump: %s # %s\n", | |
896 | "DEPRECATED_REG_STRUCT_HAS_ADDR_P()", | |
897 | XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ())); | |
a2428dbe | 898 | #endif |
48f7351b AC |
899 | fprintf_unfiltered (file, |
900 | "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n", | |
901 | gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch)); | |
a2428dbe AC |
902 | #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR |
903 | fprintf_unfiltered (file, | |
904 | "gdbarch_dump: %s # %s\n", | |
905 | "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)", | |
906 | XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type))); | |
a2428dbe | 907 | #endif |
48f7351b AC |
908 | fprintf_unfiltered (file, |
909 | "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n", | |
910 | (long) current_gdbarch->deprecated_reg_struct_has_addr); | |
62700349 AC |
911 | #ifdef DEPRECATED_REGISTER_BYTE_P |
912 | fprintf_unfiltered (file, | |
913 | "gdbarch_dump: %s # %s\n", | |
914 | "DEPRECATED_REGISTER_BYTE_P()", | |
915 | XSTRING (DEPRECATED_REGISTER_BYTE_P ())); | |
62700349 | 916 | #endif |
48f7351b AC |
917 | fprintf_unfiltered (file, |
918 | "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n", | |
919 | gdbarch_deprecated_register_byte_p (current_gdbarch)); | |
62700349 AC |
920 | #ifdef DEPRECATED_REGISTER_BYTE |
921 | fprintf_unfiltered (file, | |
922 | "gdbarch_dump: %s # %s\n", | |
923 | "DEPRECATED_REGISTER_BYTE(reg_nr)", | |
924 | XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr))); | |
62700349 | 925 | #endif |
48f7351b AC |
926 | fprintf_unfiltered (file, |
927 | "gdbarch_dump: deprecated_register_byte = <0x%lx>\n", | |
928 | (long) current_gdbarch->deprecated_register_byte); | |
b1e29e33 AC |
929 | #ifdef DEPRECATED_REGISTER_SIZE |
930 | fprintf_unfiltered (file, | |
931 | "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n", | |
932 | XSTRING (DEPRECATED_REGISTER_SIZE)); | |
b1e29e33 | 933 | #endif |
48f7351b AC |
934 | fprintf_unfiltered (file, |
935 | "gdbarch_dump: deprecated_register_size = %s\n", | |
936 | paddr_d (current_gdbarch->deprecated_register_size)); | |
6913c89a AC |
937 | #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P |
938 | fprintf_unfiltered (file, | |
939 | "gdbarch_dump: %s # %s\n", | |
940 | "DEPRECATED_SAVED_PC_AFTER_CALL_P()", | |
941 | XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ())); | |
6913c89a | 942 | #endif |
48f7351b AC |
943 | fprintf_unfiltered (file, |
944 | "gdbarch_dump: gdbarch_deprecated_saved_pc_after_call_p() = %d\n", | |
945 | gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch)); | |
6913c89a AC |
946 | #ifdef DEPRECATED_SAVED_PC_AFTER_CALL |
947 | fprintf_unfiltered (file, | |
948 | "gdbarch_dump: %s # %s\n", | |
949 | "DEPRECATED_SAVED_PC_AFTER_CALL(frame)", | |
950 | XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame))); | |
6913c89a | 951 | #endif |
48f7351b AC |
952 | fprintf_unfiltered (file, |
953 | "gdbarch_dump: deprecated_saved_pc_after_call = <0x%lx>\n", | |
954 | (long) current_gdbarch->deprecated_saved_pc_after_call); | |
f27dd7fd AC |
955 | #ifdef DEPRECATED_STACK_ALIGN_P |
956 | fprintf_unfiltered (file, | |
957 | "gdbarch_dump: %s # %s\n", | |
958 | "DEPRECATED_STACK_ALIGN_P()", | |
959 | XSTRING (DEPRECATED_STACK_ALIGN_P ())); | |
f27dd7fd | 960 | #endif |
48f7351b AC |
961 | fprintf_unfiltered (file, |
962 | "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n", | |
963 | gdbarch_deprecated_stack_align_p (current_gdbarch)); | |
f27dd7fd AC |
964 | #ifdef DEPRECATED_STACK_ALIGN |
965 | fprintf_unfiltered (file, | |
966 | "gdbarch_dump: %s # %s\n", | |
967 | "DEPRECATED_STACK_ALIGN(sp)", | |
968 | XSTRING (DEPRECATED_STACK_ALIGN (sp))); | |
f27dd7fd | 969 | #endif |
48f7351b AC |
970 | fprintf_unfiltered (file, |
971 | "gdbarch_dump: deprecated_stack_align = <0x%lx>\n", | |
972 | (long) current_gdbarch->deprecated_stack_align); | |
ebba8386 | 973 | #ifdef DEPRECATED_STORE_RETURN_VALUE |
ebba8386 AC |
974 | fprintf_unfiltered (file, |
975 | "gdbarch_dump: %s # %s\n", | |
976 | "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)", | |
977 | XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf))); | |
ebba8386 | 978 | #endif |
48f7351b AC |
979 | fprintf_unfiltered (file, |
980 | "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n", | |
981 | (long) current_gdbarch->deprecated_store_return_value); | |
4183d812 AC |
982 | #ifdef DEPRECATED_STORE_STRUCT_RETURN_P |
983 | fprintf_unfiltered (file, | |
984 | "gdbarch_dump: %s # %s\n", | |
985 | "DEPRECATED_STORE_STRUCT_RETURN_P()", | |
986 | XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ())); | |
4183d812 | 987 | #endif |
48f7351b AC |
988 | fprintf_unfiltered (file, |
989 | "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n", | |
990 | gdbarch_deprecated_store_struct_return_p (current_gdbarch)); | |
4183d812 | 991 | #ifdef DEPRECATED_STORE_STRUCT_RETURN |
4183d812 AC |
992 | fprintf_unfiltered (file, |
993 | "gdbarch_dump: %s # %s\n", | |
994 | "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)", | |
995 | XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp))); | |
4183d812 | 996 | #endif |
48f7351b AC |
997 | fprintf_unfiltered (file, |
998 | "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n", | |
999 | (long) current_gdbarch->deprecated_store_struct_return); | |
b5622e8d AC |
1000 | #ifdef DEPRECATED_USE_STRUCT_CONVENTION |
1001 | fprintf_unfiltered (file, | |
1002 | "gdbarch_dump: %s # %s\n", | |
1003 | "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)", | |
1004 | XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type))); | |
b5622e8d | 1005 | #endif |
48f7351b AC |
1006 | fprintf_unfiltered (file, |
1007 | "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n", | |
1008 | (long) current_gdbarch->deprecated_use_struct_convention); | |
a2428dbe AC |
1009 | #ifdef TARGET_DOUBLE_BIT |
1010 | fprintf_unfiltered (file, | |
1011 | "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n", | |
1012 | XSTRING (TARGET_DOUBLE_BIT)); | |
a2428dbe | 1013 | #endif |
48f7351b AC |
1014 | fprintf_unfiltered (file, |
1015 | "gdbarch_dump: double_bit = %s\n", | |
1016 | paddr_d (current_gdbarch->double_bit)); | |
a2428dbe AC |
1017 | #ifdef TARGET_DOUBLE_FORMAT |
1018 | fprintf_unfiltered (file, | |
1019 | "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n", | |
1020 | XSTRING (TARGET_DOUBLE_FORMAT)); | |
48f7351b | 1021 | #endif |
a2428dbe | 1022 | fprintf_unfiltered (file, |
48f7351b | 1023 | "gdbarch_dump: double_format = %s\n", |
456fcf94 | 1024 | pformat (current_gdbarch->double_format)); |
08e45a40 | 1025 | #ifdef DWARF2_REG_TO_REGNUM |
4b9b3959 | 1026 | fprintf_unfiltered (file, |
08e45a40 AC |
1027 | "gdbarch_dump: %s # %s\n", |
1028 | "DWARF2_REG_TO_REGNUM(dwarf2_regnr)", | |
1029 | XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr))); | |
4b9b3959 | 1030 | #endif |
48f7351b AC |
1031 | fprintf_unfiltered (file, |
1032 | "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n", | |
1033 | (long) current_gdbarch->dwarf2_reg_to_regnum); | |
08e45a40 | 1034 | #ifdef DWARF_REG_TO_REGNUM |
88c72b7d AC |
1035 | fprintf_unfiltered (file, |
1036 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1037 | "DWARF_REG_TO_REGNUM(dwarf_regnr)", |
1038 | XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr))); | |
88c72b7d | 1039 | #endif |
48f7351b AC |
1040 | fprintf_unfiltered (file, |
1041 | "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n", | |
1042 | (long) current_gdbarch->dwarf_reg_to_regnum); | |
88c72b7d AC |
1043 | #ifdef ECOFF_REG_TO_REGNUM |
1044 | fprintf_unfiltered (file, | |
1045 | "gdbarch_dump: %s # %s\n", | |
1046 | "ECOFF_REG_TO_REGNUM(ecoff_regnr)", | |
1047 | XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr))); | |
1048 | #endif | |
48f7351b AC |
1049 | fprintf_unfiltered (file, |
1050 | "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n", | |
1051 | (long) current_gdbarch->ecoff_reg_to_regnum); | |
a2cf933a | 1052 | #ifdef ELF_MAKE_MSYMBOL_SPECIAL |
a2cf933a EZ |
1053 | fprintf_unfiltered (file, |
1054 | "gdbarch_dump: %s # %s\n", | |
1055 | "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)", | |
1056 | XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym))); | |
a2cf933a | 1057 | #endif |
48f7351b AC |
1058 | fprintf_unfiltered (file, |
1059 | "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n", | |
1060 | (long) current_gdbarch->elf_make_msymbol_special); | |
049ee0e4 | 1061 | #ifdef EXTRACT_RETURN_VALUE |
049ee0e4 AC |
1062 | fprintf_unfiltered (file, |
1063 | "gdbarch_dump: %s # %s\n", | |
1064 | "EXTRACT_RETURN_VALUE(type, regcache, valbuf)", | |
1065 | XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf))); | |
049ee0e4 | 1066 | #endif |
48f7351b AC |
1067 | fprintf_unfiltered (file, |
1068 | "gdbarch_dump: extract_return_value = <0x%lx>\n", | |
1069 | (long) current_gdbarch->extract_return_value); | |
143985b7 AF |
1070 | #ifdef FETCH_POINTER_ARGUMENT_P |
1071 | fprintf_unfiltered (file, | |
1072 | "gdbarch_dump: %s # %s\n", | |
1073 | "FETCH_POINTER_ARGUMENT_P()", | |
1074 | XSTRING (FETCH_POINTER_ARGUMENT_P ())); | |
143985b7 | 1075 | #endif |
48f7351b AC |
1076 | fprintf_unfiltered (file, |
1077 | "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n", | |
1078 | gdbarch_fetch_pointer_argument_p (current_gdbarch)); | |
143985b7 AF |
1079 | #ifdef FETCH_POINTER_ARGUMENT |
1080 | fprintf_unfiltered (file, | |
1081 | "gdbarch_dump: %s # %s\n", | |
1082 | "FETCH_POINTER_ARGUMENT(frame, argi, type)", | |
1083 | XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type))); | |
143985b7 | 1084 | #endif |
48f7351b AC |
1085 | fprintf_unfiltered (file, |
1086 | "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n", | |
1087 | (long) current_gdbarch->fetch_pointer_argument); | |
a2428dbe AC |
1088 | #ifdef TARGET_FLOAT_BIT |
1089 | fprintf_unfiltered (file, | |
1090 | "gdbarch_dump: TARGET_FLOAT_BIT # %s\n", | |
1091 | XSTRING (TARGET_FLOAT_BIT)); | |
a2428dbe | 1092 | #endif |
48f7351b AC |
1093 | fprintf_unfiltered (file, |
1094 | "gdbarch_dump: float_bit = %s\n", | |
1095 | paddr_d (current_gdbarch->float_bit)); | |
a2428dbe AC |
1096 | #ifdef TARGET_FLOAT_FORMAT |
1097 | fprintf_unfiltered (file, | |
1098 | "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n", | |
1099 | XSTRING (TARGET_FLOAT_FORMAT)); | |
48f7351b | 1100 | #endif |
a2428dbe | 1101 | fprintf_unfiltered (file, |
48f7351b | 1102 | "gdbarch_dump: float_format = %s\n", |
456fcf94 | 1103 | pformat (current_gdbarch->float_format)); |
08e45a40 | 1104 | #ifdef FP0_REGNUM |
4b9b3959 | 1105 | fprintf_unfiltered (file, |
08e45a40 AC |
1106 | "gdbarch_dump: FP0_REGNUM # %s\n", |
1107 | XSTRING (FP0_REGNUM)); | |
4b9b3959 | 1108 | #endif |
48f7351b AC |
1109 | fprintf_unfiltered (file, |
1110 | "gdbarch_dump: fp0_regnum = %s\n", | |
1111 | paddr_d (current_gdbarch->fp0_regnum)); | |
a2428dbe AC |
1112 | fprintf_unfiltered (file, |
1113 | "gdbarch_dump: gdbarch_frame_align_p() = %d\n", | |
1114 | gdbarch_frame_align_p (current_gdbarch)); | |
1115 | fprintf_unfiltered (file, | |
48f7351b | 1116 | "gdbarch_dump: frame_align = <0x%lx>\n", |
a2428dbe | 1117 | (long) current_gdbarch->frame_align); |
08e45a40 | 1118 | #ifdef FRAME_ARGS_SKIP |
4b9b3959 | 1119 | fprintf_unfiltered (file, |
08e45a40 AC |
1120 | "gdbarch_dump: FRAME_ARGS_SKIP # %s\n", |
1121 | XSTRING (FRAME_ARGS_SKIP)); | |
4b9b3959 | 1122 | #endif |
48f7351b AC |
1123 | fprintf_unfiltered (file, |
1124 | "gdbarch_dump: frame_args_skip = 0x%s\n", | |
1125 | paddr_nz (current_gdbarch->frame_args_skip)); | |
983a287a AC |
1126 | #ifdef FRAME_NUM_ARGS_P |
1127 | fprintf_unfiltered (file, | |
1128 | "gdbarch_dump: %s # %s\n", | |
1129 | "FRAME_NUM_ARGS_P()", | |
1130 | XSTRING (FRAME_NUM_ARGS_P ())); | |
983a287a | 1131 | #endif |
48f7351b AC |
1132 | fprintf_unfiltered (file, |
1133 | "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n", | |
1134 | gdbarch_frame_num_args_p (current_gdbarch)); | |
08e45a40 | 1135 | #ifdef FRAME_NUM_ARGS |
01fb7433 AC |
1136 | fprintf_unfiltered (file, |
1137 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1138 | "FRAME_NUM_ARGS(frame)", |
1139 | XSTRING (FRAME_NUM_ARGS (frame))); | |
01fb7433 | 1140 | #endif |
48f7351b AC |
1141 | fprintf_unfiltered (file, |
1142 | "gdbarch_dump: frame_num_args = <0x%lx>\n", | |
1143 | (long) current_gdbarch->frame_num_args); | |
8b148df9 AC |
1144 | #ifdef FRAME_RED_ZONE_SIZE |
1145 | fprintf_unfiltered (file, | |
1146 | "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n", | |
1147 | XSTRING (FRAME_RED_ZONE_SIZE)); | |
8b148df9 | 1148 | #endif |
48f7351b AC |
1149 | fprintf_unfiltered (file, |
1150 | "gdbarch_dump: frame_red_zone_size = %s\n", | |
1151 | paddr_d (current_gdbarch->frame_red_zone_size)); | |
1e9f55d0 AC |
1152 | #ifdef GET_LONGJMP_TARGET_P |
1153 | fprintf_unfiltered (file, | |
1154 | "gdbarch_dump: %s # %s\n", | |
1155 | "GET_LONGJMP_TARGET_P()", | |
1156 | XSTRING (GET_LONGJMP_TARGET_P ())); | |
1e9f55d0 | 1157 | #endif |
48f7351b AC |
1158 | fprintf_unfiltered (file, |
1159 | "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n", | |
1160 | gdbarch_get_longjmp_target_p (current_gdbarch)); | |
9df628e0 RE |
1161 | #ifdef GET_LONGJMP_TARGET |
1162 | fprintf_unfiltered (file, | |
1163 | "gdbarch_dump: %s # %s\n", | |
1164 | "GET_LONGJMP_TARGET(pc)", | |
1165 | XSTRING (GET_LONGJMP_TARGET (pc))); | |
9df628e0 | 1166 | #endif |
48f7351b AC |
1167 | fprintf_unfiltered (file, |
1168 | "gdbarch_dump: get_longjmp_target = <0x%lx>\n", | |
1169 | (long) current_gdbarch->get_longjmp_target); | |
967c0d83 | 1170 | #ifdef HAVE_NONSTEPPABLE_WATCHPOINT |
f74fa174 | 1171 | fprintf_unfiltered (file, |
967c0d83 MM |
1172 | "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n", |
1173 | XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT)); | |
f74fa174 | 1174 | #endif |
a2428dbe | 1175 | fprintf_unfiltered (file, |
48f7351b AC |
1176 | "gdbarch_dump: have_nonsteppable_watchpoint = %s\n", |
1177 | paddr_d (current_gdbarch->have_nonsteppable_watchpoint)); | |
1178 | fprintf_unfiltered (file, | |
1179 | "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n", | |
a2428dbe AC |
1180 | (long) current_gdbarch->in_function_epilogue_p); |
1181 | #ifdef IN_SOLIB_CALL_TRAMPOLINE | |
10312cc4 AC |
1182 | fprintf_unfiltered (file, |
1183 | "gdbarch_dump: %s # %s\n", | |
a2428dbe AC |
1184 | "IN_SOLIB_CALL_TRAMPOLINE(pc, name)", |
1185 | XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name))); | |
10312cc4 | 1186 | #endif |
48f7351b AC |
1187 | fprintf_unfiltered (file, |
1188 | "gdbarch_dump: in_solib_call_trampoline = <0x%lx>\n", | |
1189 | (long) current_gdbarch->in_solib_call_trampoline); | |
a2428dbe | 1190 | #ifdef IN_SOLIB_RETURN_TRAMPOLINE |
1e9f55d0 AC |
1191 | fprintf_unfiltered (file, |
1192 | "gdbarch_dump: %s # %s\n", | |
a2428dbe AC |
1193 | "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)", |
1194 | XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name))); | |
a2428dbe | 1195 | #endif |
48f7351b AC |
1196 | fprintf_unfiltered (file, |
1197 | "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n", | |
1198 | (long) current_gdbarch->in_solib_return_trampoline); | |
a2428dbe AC |
1199 | #ifdef INNER_THAN |
1200 | fprintf_unfiltered (file, | |
1201 | "gdbarch_dump: %s # %s\n", | |
1202 | "INNER_THAN(lhs, rhs)", | |
1203 | XSTRING (INNER_THAN (lhs, rhs))); | |
a2428dbe | 1204 | #endif |
48f7351b AC |
1205 | fprintf_unfiltered (file, |
1206 | "gdbarch_dump: inner_than = <0x%lx>\n", | |
1207 | (long) current_gdbarch->inner_than); | |
a2428dbe AC |
1208 | #ifdef TARGET_INT_BIT |
1209 | fprintf_unfiltered (file, | |
1210 | "gdbarch_dump: TARGET_INT_BIT # %s\n", | |
1211 | XSTRING (TARGET_INT_BIT)); | |
a2428dbe | 1212 | #endif |
48f7351b AC |
1213 | fprintf_unfiltered (file, |
1214 | "gdbarch_dump: int_bit = %s\n", | |
1215 | paddr_d (current_gdbarch->int_bit)); | |
a2428dbe AC |
1216 | #ifdef INTEGER_TO_ADDRESS_P |
1217 | fprintf_unfiltered (file, | |
1218 | "gdbarch_dump: %s # %s\n", | |
1219 | "INTEGER_TO_ADDRESS_P()", | |
1220 | XSTRING (INTEGER_TO_ADDRESS_P ())); | |
1e9f55d0 | 1221 | #endif |
48f7351b AC |
1222 | fprintf_unfiltered (file, |
1223 | "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n", | |
1224 | gdbarch_integer_to_address_p (current_gdbarch)); | |
fc0c74b1 AC |
1225 | #ifdef INTEGER_TO_ADDRESS |
1226 | fprintf_unfiltered (file, | |
1227 | "gdbarch_dump: %s # %s\n", | |
1228 | "INTEGER_TO_ADDRESS(type, buf)", | |
1229 | XSTRING (INTEGER_TO_ADDRESS (type, buf))); | |
fc0c74b1 | 1230 | #endif |
48f7351b AC |
1231 | fprintf_unfiltered (file, |
1232 | "gdbarch_dump: integer_to_address = <0x%lx>\n", | |
1233 | (long) current_gdbarch->integer_to_address); | |
a2428dbe | 1234 | #ifdef TARGET_LONG_BIT |
5e74b15c | 1235 | fprintf_unfiltered (file, |
a2428dbe AC |
1236 | "gdbarch_dump: TARGET_LONG_BIT # %s\n", |
1237 | XSTRING (TARGET_LONG_BIT)); | |
5e74b15c | 1238 | #endif |
48f7351b AC |
1239 | fprintf_unfiltered (file, |
1240 | "gdbarch_dump: long_bit = %s\n", | |
1241 | paddr_d (current_gdbarch->long_bit)); | |
a2428dbe | 1242 | #ifdef TARGET_LONG_DOUBLE_BIT |
d50355b6 | 1243 | fprintf_unfiltered (file, |
a2428dbe AC |
1244 | "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n", |
1245 | XSTRING (TARGET_LONG_DOUBLE_BIT)); | |
a2428dbe | 1246 | #endif |
48f7351b AC |
1247 | fprintf_unfiltered (file, |
1248 | "gdbarch_dump: long_double_bit = %s\n", | |
1249 | paddr_d (current_gdbarch->long_double_bit)); | |
a2428dbe AC |
1250 | #ifdef TARGET_LONG_DOUBLE_FORMAT |
1251 | fprintf_unfiltered (file, | |
1252 | "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n", | |
1253 | XSTRING (TARGET_LONG_DOUBLE_FORMAT)); | |
48f7351b | 1254 | #endif |
a2428dbe | 1255 | fprintf_unfiltered (file, |
48f7351b | 1256 | "gdbarch_dump: long_double_format = %s\n", |
456fcf94 | 1257 | pformat (current_gdbarch->long_double_format)); |
a2428dbe AC |
1258 | #ifdef TARGET_LONG_LONG_BIT |
1259 | fprintf_unfiltered (file, | |
1260 | "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n", | |
1261 | XSTRING (TARGET_LONG_LONG_BIT)); | |
d50355b6 | 1262 | #endif |
48f7351b AC |
1263 | fprintf_unfiltered (file, |
1264 | "gdbarch_dump: long_long_bit = %s\n", | |
1265 | paddr_d (current_gdbarch->long_long_bit)); | |
08e45a40 | 1266 | #ifdef MEMORY_INSERT_BREAKPOINT |
4b9b3959 AC |
1267 | fprintf_unfiltered (file, |
1268 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1269 | "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)", |
1270 | XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache))); | |
4b9b3959 | 1271 | #endif |
48f7351b AC |
1272 | fprintf_unfiltered (file, |
1273 | "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n", | |
1274 | (long) current_gdbarch->memory_insert_breakpoint); | |
08e45a40 | 1275 | #ifdef MEMORY_REMOVE_BREAKPOINT |
4b9b3959 AC |
1276 | fprintf_unfiltered (file, |
1277 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1278 | "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)", |
1279 | XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache))); | |
4b9b3959 | 1280 | #endif |
48f7351b AC |
1281 | fprintf_unfiltered (file, |
1282 | "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n", | |
1283 | (long) current_gdbarch->memory_remove_breakpoint); | |
5720643c JB |
1284 | #ifdef NAME_OF_MALLOC |
1285 | fprintf_unfiltered (file, | |
1286 | "gdbarch_dump: NAME_OF_MALLOC # %s\n", | |
1287 | XSTRING (NAME_OF_MALLOC)); | |
48f7351b | 1288 | #endif |
5720643c | 1289 | fprintf_unfiltered (file, |
48f7351b | 1290 | "gdbarch_dump: name_of_malloc = %s\n", |
31deffe5 | 1291 | NAME_OF_MALLOC); |
08e45a40 | 1292 | #ifdef NUM_PSEUDO_REGS |
4b9b3959 | 1293 | fprintf_unfiltered (file, |
08e45a40 AC |
1294 | "gdbarch_dump: NUM_PSEUDO_REGS # %s\n", |
1295 | XSTRING (NUM_PSEUDO_REGS)); | |
4b9b3959 | 1296 | #endif |
48f7351b AC |
1297 | fprintf_unfiltered (file, |
1298 | "gdbarch_dump: num_pseudo_regs = %s\n", | |
1299 | paddr_d (current_gdbarch->num_pseudo_regs)); | |
08e45a40 | 1300 | #ifdef NUM_REGS |
7f1b2585 | 1301 | fprintf_unfiltered (file, |
08e45a40 AC |
1302 | "gdbarch_dump: NUM_REGS # %s\n", |
1303 | XSTRING (NUM_REGS)); | |
7f1b2585 | 1304 | #endif |
48f7351b AC |
1305 | fprintf_unfiltered (file, |
1306 | "gdbarch_dump: num_regs = %s\n", | |
1307 | paddr_d (current_gdbarch->num_regs)); | |
a2428dbe AC |
1308 | #ifdef TARGET_OSABI |
1309 | fprintf_unfiltered (file, | |
1310 | "gdbarch_dump: TARGET_OSABI # %s\n", | |
1311 | XSTRING (TARGET_OSABI)); | |
a2428dbe | 1312 | #endif |
48f7351b AC |
1313 | fprintf_unfiltered (file, |
1314 | "gdbarch_dump: osabi = %s\n", | |
1315 | paddr_d (current_gdbarch->osabi)); | |
08e45a40 AC |
1316 | #ifdef PC_REGNUM |
1317 | fprintf_unfiltered (file, | |
1318 | "gdbarch_dump: PC_REGNUM # %s\n", | |
1319 | XSTRING (PC_REGNUM)); | |
7f1b2585 | 1320 | #endif |
48f7351b AC |
1321 | fprintf_unfiltered (file, |
1322 | "gdbarch_dump: pc_regnum = %s\n", | |
1323 | paddr_d (current_gdbarch->pc_regnum)); | |
4b9b3959 AC |
1324 | #ifdef POINTER_TO_ADDRESS |
1325 | fprintf_unfiltered (file, | |
1326 | "gdbarch_dump: %s # %s\n", | |
1327 | "POINTER_TO_ADDRESS(type, buf)", | |
1328 | XSTRING (POINTER_TO_ADDRESS (type, buf))); | |
5e74b15c | 1329 | #endif |
48f7351b AC |
1330 | fprintf_unfiltered (file, |
1331 | "gdbarch_dump: pointer_to_address = <0x%lx>\n", | |
1332 | (long) current_gdbarch->pointer_to_address); | |
7996bcec AC |
1333 | fprintf_unfiltered (file, |
1334 | "gdbarch_dump: gdbarch_print_float_info_p() = %d\n", | |
1335 | gdbarch_print_float_info_p (current_gdbarch)); | |
1336 | fprintf_unfiltered (file, | |
48f7351b | 1337 | "gdbarch_dump: print_float_info = <0x%lx>\n", |
7996bcec | 1338 | (long) current_gdbarch->print_float_info); |
a2428dbe AC |
1339 | #ifdef TARGET_PRINT_INSN |
1340 | fprintf_unfiltered (file, | |
1341 | "gdbarch_dump: %s # %s\n", | |
1342 | "TARGET_PRINT_INSN(vma, info)", | |
1343 | XSTRING (TARGET_PRINT_INSN (vma, info))); | |
a2428dbe | 1344 | #endif |
7996bcec | 1345 | fprintf_unfiltered (file, |
48f7351b AC |
1346 | "gdbarch_dump: print_insn = <0x%lx>\n", |
1347 | (long) current_gdbarch->print_insn); | |
1348 | fprintf_unfiltered (file, | |
1349 | "gdbarch_dump: print_registers_info = <0x%lx>\n", | |
7996bcec AC |
1350 | (long) current_gdbarch->print_registers_info); |
1351 | fprintf_unfiltered (file, | |
1352 | "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n", | |
1353 | gdbarch_print_vector_info_p (current_gdbarch)); | |
1354 | fprintf_unfiltered (file, | |
48f7351b | 1355 | "gdbarch_dump: print_vector_info = <0x%lx>\n", |
7996bcec | 1356 | (long) current_gdbarch->print_vector_info); |
c2169756 AC |
1357 | #ifdef PS_REGNUM |
1358 | fprintf_unfiltered (file, | |
1359 | "gdbarch_dump: PS_REGNUM # %s\n", | |
1360 | XSTRING (PS_REGNUM)); | |
a2428dbe | 1361 | #endif |
48f7351b AC |
1362 | fprintf_unfiltered (file, |
1363 | "gdbarch_dump: ps_regnum = %s\n", | |
1364 | paddr_d (current_gdbarch->ps_regnum)); | |
a2428dbe AC |
1365 | fprintf_unfiltered (file, |
1366 | "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n", | |
1367 | gdbarch_pseudo_register_read_p (current_gdbarch)); | |
1368 | fprintf_unfiltered (file, | |
48f7351b | 1369 | "gdbarch_dump: pseudo_register_read = <0x%lx>\n", |
a2428dbe AC |
1370 | (long) current_gdbarch->pseudo_register_read); |
1371 | fprintf_unfiltered (file, | |
1372 | "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n", | |
1373 | gdbarch_pseudo_register_write_p (current_gdbarch)); | |
1374 | fprintf_unfiltered (file, | |
48f7351b | 1375 | "gdbarch_dump: pseudo_register_write = <0x%lx>\n", |
a2428dbe AC |
1376 | (long) current_gdbarch->pseudo_register_write); |
1377 | #ifdef TARGET_PTR_BIT | |
1378 | fprintf_unfiltered (file, | |
1379 | "gdbarch_dump: TARGET_PTR_BIT # %s\n", | |
1380 | XSTRING (TARGET_PTR_BIT)); | |
c2169756 | 1381 | #endif |
48f7351b AC |
1382 | fprintf_unfiltered (file, |
1383 | "gdbarch_dump: ptr_bit = %s\n", | |
1384 | paddr_d (current_gdbarch->ptr_bit)); | |
7996bcec AC |
1385 | fprintf_unfiltered (file, |
1386 | "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n", | |
1387 | gdbarch_push_dummy_call_p (current_gdbarch)); | |
1388 | fprintf_unfiltered (file, | |
48f7351b | 1389 | "gdbarch_dump: push_dummy_call = <0x%lx>\n", |
7996bcec AC |
1390 | (long) current_gdbarch->push_dummy_call); |
1391 | fprintf_unfiltered (file, | |
1392 | "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n", | |
1393 | gdbarch_push_dummy_code_p (current_gdbarch)); | |
1394 | fprintf_unfiltered (file, | |
48f7351b | 1395 | "gdbarch_dump: push_dummy_code = <0x%lx>\n", |
7996bcec | 1396 | (long) current_gdbarch->push_dummy_code); |
a2428dbe AC |
1397 | #ifdef TARGET_READ_PC_P |
1398 | fprintf_unfiltered (file, | |
1399 | "gdbarch_dump: %s # %s\n", | |
1400 | "TARGET_READ_PC_P()", | |
1401 | XSTRING (TARGET_READ_PC_P ())); | |
a2428dbe | 1402 | #endif |
48f7351b AC |
1403 | fprintf_unfiltered (file, |
1404 | "gdbarch_dump: gdbarch_read_pc_p() = %d\n", | |
1405 | gdbarch_read_pc_p (current_gdbarch)); | |
a2428dbe AC |
1406 | #ifdef TARGET_READ_PC |
1407 | fprintf_unfiltered (file, | |
1408 | "gdbarch_dump: %s # %s\n", | |
1409 | "TARGET_READ_PC(ptid)", | |
1410 | XSTRING (TARGET_READ_PC (ptid))); | |
a2428dbe | 1411 | #endif |
48f7351b AC |
1412 | fprintf_unfiltered (file, |
1413 | "gdbarch_dump: read_pc = <0x%lx>\n", | |
1414 | (long) current_gdbarch->read_pc); | |
a2428dbe AC |
1415 | #ifdef TARGET_READ_SP_P |
1416 | fprintf_unfiltered (file, | |
1417 | "gdbarch_dump: %s # %s\n", | |
1418 | "TARGET_READ_SP_P()", | |
1419 | XSTRING (TARGET_READ_SP_P ())); | |
a2428dbe | 1420 | #endif |
48f7351b AC |
1421 | fprintf_unfiltered (file, |
1422 | "gdbarch_dump: gdbarch_read_sp_p() = %d\n", | |
1423 | gdbarch_read_sp_p (current_gdbarch)); | |
a2428dbe AC |
1424 | #ifdef TARGET_READ_SP |
1425 | fprintf_unfiltered (file, | |
1426 | "gdbarch_dump: %s # %s\n", | |
1427 | "TARGET_READ_SP()", | |
1428 | XSTRING (TARGET_READ_SP ())); | |
a2428dbe | 1429 | #endif |
48f7351b AC |
1430 | fprintf_unfiltered (file, |
1431 | "gdbarch_dump: read_sp = <0x%lx>\n", | |
1432 | (long) current_gdbarch->read_sp); | |
1e9f55d0 AC |
1433 | #ifdef REGISTER_BYTES_OK_P |
1434 | fprintf_unfiltered (file, | |
1435 | "gdbarch_dump: %s # %s\n", | |
1436 | "REGISTER_BYTES_OK_P()", | |
1437 | XSTRING (REGISTER_BYTES_OK_P ())); | |
1e9f55d0 | 1438 | #endif |
48f7351b AC |
1439 | fprintf_unfiltered (file, |
1440 | "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n", | |
1441 | gdbarch_register_bytes_ok_p (current_gdbarch)); | |
08e45a40 | 1442 | #ifdef REGISTER_BYTES_OK |
4b9b3959 AC |
1443 | fprintf_unfiltered (file, |
1444 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1445 | "REGISTER_BYTES_OK(nr_bytes)", |
1446 | XSTRING (REGISTER_BYTES_OK (nr_bytes))); | |
4b9b3959 | 1447 | #endif |
48f7351b AC |
1448 | fprintf_unfiltered (file, |
1449 | "gdbarch_dump: register_bytes_ok = <0x%lx>\n", | |
1450 | (long) current_gdbarch->register_bytes_ok); | |
08e45a40 | 1451 | #ifdef REGISTER_NAME |
4b9b3959 AC |
1452 | fprintf_unfiltered (file, |
1453 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1454 | "REGISTER_NAME(regnr)", |
1455 | XSTRING (REGISTER_NAME (regnr))); | |
4b9b3959 | 1456 | #endif |
a2428dbe | 1457 | fprintf_unfiltered (file, |
48f7351b AC |
1458 | "gdbarch_dump: register_name = <0x%lx>\n", |
1459 | (long) current_gdbarch->register_name); | |
1460 | fprintf_unfiltered (file, | |
1461 | "gdbarch_dump: register_reggroup_p = <0x%lx>\n", | |
a2428dbe | 1462 | (long) current_gdbarch->register_reggroup_p); |
08e45a40 | 1463 | #ifdef REGISTER_SIM_REGNO |
4b9b3959 AC |
1464 | fprintf_unfiltered (file, |
1465 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1466 | "REGISTER_SIM_REGNO(reg_nr)", |
1467 | XSTRING (REGISTER_SIM_REGNO (reg_nr))); | |
4b9b3959 | 1468 | #endif |
48f7351b AC |
1469 | fprintf_unfiltered (file, |
1470 | "gdbarch_dump: register_sim_regno = <0x%lx>\n", | |
1471 | (long) current_gdbarch->register_sim_regno); | |
13d01224 | 1472 | #ifdef REGISTER_TO_VALUE |
13d01224 AC |
1473 | fprintf_unfiltered (file, |
1474 | "gdbarch_dump: %s # %s\n", | |
ff2e87ac AC |
1475 | "REGISTER_TO_VALUE(frame, regnum, type, buf)", |
1476 | XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf))); | |
13d01224 | 1477 | #endif |
48f7351b AC |
1478 | fprintf_unfiltered (file, |
1479 | "gdbarch_dump: register_to_value = <0x%lx>\n", | |
1480 | (long) current_gdbarch->register_to_value); | |
7996bcec AC |
1481 | fprintf_unfiltered (file, |
1482 | "gdbarch_dump: gdbarch_register_type_p() = %d\n", | |
1483 | gdbarch_register_type_p (current_gdbarch)); | |
1484 | fprintf_unfiltered (file, | |
48f7351b | 1485 | "gdbarch_dump: register_type = <0x%lx>\n", |
7996bcec | 1486 | (long) current_gdbarch->register_type); |
a2428dbe AC |
1487 | fprintf_unfiltered (file, |
1488 | "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n", | |
1489 | gdbarch_regset_from_core_section_p (current_gdbarch)); | |
1490 | fprintf_unfiltered (file, | |
48f7351b | 1491 | "gdbarch_dump: regset_from_core_section = <0x%lx>\n", |
a2428dbe | 1492 | (long) current_gdbarch->regset_from_core_section); |
7996bcec | 1493 | fprintf_unfiltered (file, |
48f7351b | 1494 | "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n", |
7996bcec | 1495 | (long) current_gdbarch->remote_translate_xfer_address); |
a2428dbe AC |
1496 | fprintf_unfiltered (file, |
1497 | "gdbarch_dump: gdbarch_return_value_p() = %d\n", | |
1498 | gdbarch_return_value_p (current_gdbarch)); | |
1499 | fprintf_unfiltered (file, | |
48f7351b | 1500 | "gdbarch_dump: return_value = <0x%lx>\n", |
a2428dbe | 1501 | (long) current_gdbarch->return_value); |
08e45a40 | 1502 | #ifdef SDB_REG_TO_REGNUM |
4b9b3959 AC |
1503 | fprintf_unfiltered (file, |
1504 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1505 | "SDB_REG_TO_REGNUM(sdb_regnr)", |
1506 | XSTRING (SDB_REG_TO_REGNUM (sdb_regnr))); | |
4b9b3959 | 1507 | #endif |
48f7351b AC |
1508 | fprintf_unfiltered (file, |
1509 | "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n", | |
1510 | (long) current_gdbarch->sdb_reg_to_regnum); | |
a2428dbe AC |
1511 | #ifdef TARGET_SHORT_BIT |
1512 | fprintf_unfiltered (file, | |
1513 | "gdbarch_dump: TARGET_SHORT_BIT # %s\n", | |
1514 | XSTRING (TARGET_SHORT_BIT)); | |
a2428dbe | 1515 | #endif |
48f7351b AC |
1516 | fprintf_unfiltered (file, |
1517 | "gdbarch_dump: short_bit = %s\n", | |
1518 | paddr_d (current_gdbarch->short_bit)); | |
08e45a40 | 1519 | #ifdef SKIP_PROLOGUE |
4b9b3959 AC |
1520 | fprintf_unfiltered (file, |
1521 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1522 | "SKIP_PROLOGUE(ip)", |
1523 | XSTRING (SKIP_PROLOGUE (ip))); | |
4b9b3959 | 1524 | #endif |
dea0c52f | 1525 | fprintf_unfiltered (file, |
48f7351b AC |
1526 | "gdbarch_dump: skip_prologue = <0x%lx>\n", |
1527 | (long) current_gdbarch->skip_prologue); | |
1528 | fprintf_unfiltered (file, | |
1529 | "gdbarch_dump: skip_solib_resolver = <0x%lx>\n", | |
4c8c40e6 | 1530 | (long) current_gdbarch->skip_solib_resolver); |
08e45a40 | 1531 | #ifdef SKIP_TRAMPOLINE_CODE |
4b9b3959 AC |
1532 | fprintf_unfiltered (file, |
1533 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1534 | "SKIP_TRAMPOLINE_CODE(pc)", |
1535 | XSTRING (SKIP_TRAMPOLINE_CODE (pc))); | |
4b9b3959 | 1536 | #endif |
48f7351b AC |
1537 | fprintf_unfiltered (file, |
1538 | "gdbarch_dump: skip_trampoline_code = <0x%lx>\n", | |
1539 | (long) current_gdbarch->skip_trampoline_code); | |
181c1381 RE |
1540 | #ifdef SMASH_TEXT_ADDRESS |
1541 | fprintf_unfiltered (file, | |
1542 | "gdbarch_dump: %s # %s\n", | |
1543 | "SMASH_TEXT_ADDRESS(addr)", | |
1544 | XSTRING (SMASH_TEXT_ADDRESS (addr))); | |
181c1381 | 1545 | #endif |
48f7351b AC |
1546 | fprintf_unfiltered (file, |
1547 | "gdbarch_dump: smash_text_address = <0x%lx>\n", | |
1548 | (long) current_gdbarch->smash_text_address); | |
1e9f55d0 AC |
1549 | #ifdef SOFTWARE_SINGLE_STEP_P |
1550 | fprintf_unfiltered (file, | |
1551 | "gdbarch_dump: %s # %s\n", | |
1552 | "SOFTWARE_SINGLE_STEP_P()", | |
1553 | XSTRING (SOFTWARE_SINGLE_STEP_P ())); | |
1e9f55d0 | 1554 | #endif |
48f7351b AC |
1555 | fprintf_unfiltered (file, |
1556 | "gdbarch_dump: gdbarch_software_single_step_p() = %d\n", | |
1557 | gdbarch_software_single_step_p (current_gdbarch)); | |
08e45a40 | 1558 | #ifdef SOFTWARE_SINGLE_STEP |
4b9b3959 AC |
1559 | fprintf_unfiltered (file, |
1560 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1561 | "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)", |
1562 | XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p))); | |
08e45a40 | 1563 | #endif |
48f7351b AC |
1564 | fprintf_unfiltered (file, |
1565 | "gdbarch_dump: software_single_step = <0x%lx>\n", | |
1566 | (long) current_gdbarch->software_single_step); | |
08e45a40 | 1567 | #ifdef SP_REGNUM |
1dd4193b | 1568 | fprintf_unfiltered (file, |
08e45a40 AC |
1569 | "gdbarch_dump: SP_REGNUM # %s\n", |
1570 | XSTRING (SP_REGNUM)); | |
1dd4193b | 1571 | #endif |
48f7351b AC |
1572 | fprintf_unfiltered (file, |
1573 | "gdbarch_dump: sp_regnum = %s\n", | |
1574 | paddr_d (current_gdbarch->sp_regnum)); | |
08e45a40 | 1575 | #ifdef STAB_REG_TO_REGNUM |
4b9b3959 AC |
1576 | fprintf_unfiltered (file, |
1577 | "gdbarch_dump: %s # %s\n", | |
08e45a40 AC |
1578 | "STAB_REG_TO_REGNUM(stab_regnr)", |
1579 | XSTRING (STAB_REG_TO_REGNUM (stab_regnr))); | |
4b9b3959 | 1580 | #endif |
a2428dbe | 1581 | fprintf_unfiltered (file, |
48f7351b AC |
1582 | "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n", |
1583 | (long) current_gdbarch->stab_reg_to_regnum); | |
1584 | fprintf_unfiltered (file, | |
1585 | "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n", | |
a2428dbe | 1586 | (long) current_gdbarch->stabs_argument_has_addr); |
08e45a40 | 1587 | #ifdef STORE_RETURN_VALUE |
f517ea4e PS |
1588 | fprintf_unfiltered (file, |
1589 | "gdbarch_dump: %s # %s\n", | |
ebba8386 AC |
1590 | "STORE_RETURN_VALUE(type, regcache, valbuf)", |
1591 | XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf))); | |
875e1767 | 1592 | #endif |
48f7351b AC |
1593 | fprintf_unfiltered (file, |
1594 | "gdbarch_dump: store_return_value = <0x%lx>\n", | |
1595 | (long) current_gdbarch->store_return_value); | |
7996bcec | 1596 | fprintf_unfiltered (file, |
a2428dbe AC |
1597 | "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n", |
1598 | gdbarch_unwind_dummy_id_p (current_gdbarch)); | |
cde9ea48 | 1599 | fprintf_unfiltered (file, |
48f7351b | 1600 | "gdbarch_dump: unwind_dummy_id = <0x%lx>\n", |
a2428dbe | 1601 | (long) current_gdbarch->unwind_dummy_id); |
08e45a40 | 1602 | fprintf_unfiltered (file, |
a2428dbe AC |
1603 | "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n", |
1604 | gdbarch_unwind_pc_p (current_gdbarch)); | |
7996bcec | 1605 | fprintf_unfiltered (file, |
48f7351b | 1606 | "gdbarch_dump: unwind_pc = <0x%lx>\n", |
a2428dbe | 1607 | (long) current_gdbarch->unwind_pc); |
bd1ce8ba | 1608 | fprintf_unfiltered (file, |
a2428dbe AC |
1609 | "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n", |
1610 | gdbarch_unwind_sp_p (current_gdbarch)); | |
bd1ce8ba | 1611 | fprintf_unfiltered (file, |
48f7351b | 1612 | "gdbarch_dump: unwind_sp = <0x%lx>\n", |
a2428dbe AC |
1613 | (long) current_gdbarch->unwind_sp); |
1614 | #ifdef VALUE_TO_REGISTER | |
08e45a40 AC |
1615 | fprintf_unfiltered (file, |
1616 | "gdbarch_dump: %s # %s\n", | |
a2428dbe AC |
1617 | "VALUE_TO_REGISTER(frame, regnum, type, buf)", |
1618 | XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf))); | |
39d4ef09 | 1619 | #endif |
48f7351b AC |
1620 | fprintf_unfiltered (file, |
1621 | "gdbarch_dump: value_to_register = <0x%lx>\n", | |
1622 | (long) current_gdbarch->value_to_register); | |
39d4ef09 | 1623 | #ifdef TARGET_VIRTUAL_FRAME_POINTER |
08e45a40 AC |
1624 | fprintf_unfiltered (file, |
1625 | "gdbarch_dump: %s # %s\n", | |
1626 | "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)", | |
1627 | XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset))); | |
381323f4 | 1628 | #endif |
48f7351b AC |
1629 | fprintf_unfiltered (file, |
1630 | "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n", | |
1631 | (long) current_gdbarch->virtual_frame_pointer); | |
08e45a40 | 1632 | #ifdef TARGET_WRITE_PC |
4b9b3959 | 1633 | fprintf_unfiltered (file, |
08e45a40 AC |
1634 | "gdbarch_dump: %s # %s\n", |
1635 | "TARGET_WRITE_PC(val, ptid)", | |
1636 | XSTRING (TARGET_WRITE_PC (val, ptid))); | |
381323f4 | 1637 | #endif |
48f7351b AC |
1638 | fprintf_unfiltered (file, |
1639 | "gdbarch_dump: write_pc = <0x%lx>\n", | |
1640 | (long) current_gdbarch->write_pc); | |
4b9b3959 AC |
1641 | if (current_gdbarch->dump_tdep != NULL) |
1642 | current_gdbarch->dump_tdep (current_gdbarch, file); | |
0f71a2f6 JM |
1643 | } |
1644 | ||
1645 | struct gdbarch_tdep * | |
104c1213 | 1646 | gdbarch_tdep (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1647 | { |
1648 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
1649 | fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); |
1650 | return gdbarch->tdep; | |
1651 | } | |
1652 | ||
1653 | ||
1654 | const struct bfd_arch_info * | |
104c1213 | 1655 | gdbarch_bfd_arch_info (struct gdbarch *gdbarch) |
0f71a2f6 | 1656 | { |
8de9bdc4 | 1657 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 1658 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1659 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n"); |
1660 | return gdbarch->bfd_arch_info; | |
1661 | } | |
1662 | ||
1663 | int | |
104c1213 | 1664 | gdbarch_byte_order (struct gdbarch *gdbarch) |
0f71a2f6 | 1665 | { |
8de9bdc4 | 1666 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 1667 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1668 | fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n"); |
1669 | return gdbarch->byte_order; | |
1670 | } | |
1671 | ||
4be87837 DJ |
1672 | enum gdb_osabi |
1673 | gdbarch_osabi (struct gdbarch *gdbarch) | |
1674 | { | |
1675 | gdb_assert (gdbarch != NULL); | |
1676 | if (gdbarch_debug >= 2) | |
1677 | fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n"); | |
1678 | return gdbarch->osabi; | |
1679 | } | |
1680 | ||
0f71a2f6 | 1681 | int |
104c1213 | 1682 | gdbarch_short_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1683 | { |
8de9bdc4 | 1684 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1685 | /* Skip verify of short_bit, invalid_p == 0 */ |
0f71a2f6 | 1686 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1687 | fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n"); |
1688 | return gdbarch->short_bit; | |
1689 | } | |
1690 | ||
1691 | void | |
104c1213 JM |
1692 | set_gdbarch_short_bit (struct gdbarch *gdbarch, |
1693 | int short_bit) | |
0f71a2f6 JM |
1694 | { |
1695 | gdbarch->short_bit = short_bit; | |
1696 | } | |
1697 | ||
1698 | int | |
104c1213 | 1699 | gdbarch_int_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1700 | { |
8de9bdc4 | 1701 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1702 | /* Skip verify of int_bit, invalid_p == 0 */ |
0f71a2f6 | 1703 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1704 | fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n"); |
1705 | return gdbarch->int_bit; | |
1706 | } | |
1707 | ||
1708 | void | |
104c1213 JM |
1709 | set_gdbarch_int_bit (struct gdbarch *gdbarch, |
1710 | int int_bit) | |
0f71a2f6 JM |
1711 | { |
1712 | gdbarch->int_bit = int_bit; | |
1713 | } | |
1714 | ||
1715 | int | |
104c1213 | 1716 | gdbarch_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1717 | { |
8de9bdc4 | 1718 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1719 | /* Skip verify of long_bit, invalid_p == 0 */ |
0f71a2f6 | 1720 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1721 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n"); |
1722 | return gdbarch->long_bit; | |
1723 | } | |
1724 | ||
1725 | void | |
104c1213 JM |
1726 | set_gdbarch_long_bit (struct gdbarch *gdbarch, |
1727 | int long_bit) | |
0f71a2f6 JM |
1728 | { |
1729 | gdbarch->long_bit = long_bit; | |
1730 | } | |
1731 | ||
1732 | int | |
104c1213 | 1733 | gdbarch_long_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1734 | { |
8de9bdc4 | 1735 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1736 | /* Skip verify of long_long_bit, invalid_p == 0 */ |
0f71a2f6 | 1737 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1738 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n"); |
1739 | return gdbarch->long_long_bit; | |
1740 | } | |
1741 | ||
1742 | void | |
104c1213 JM |
1743 | set_gdbarch_long_long_bit (struct gdbarch *gdbarch, |
1744 | int long_long_bit) | |
0f71a2f6 JM |
1745 | { |
1746 | gdbarch->long_long_bit = long_long_bit; | |
1747 | } | |
1748 | ||
1749 | int | |
104c1213 | 1750 | gdbarch_float_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1751 | { |
8de9bdc4 | 1752 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1753 | /* Skip verify of float_bit, invalid_p == 0 */ |
0f71a2f6 | 1754 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1755 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n"); |
1756 | return gdbarch->float_bit; | |
1757 | } | |
1758 | ||
1759 | void | |
104c1213 JM |
1760 | set_gdbarch_float_bit (struct gdbarch *gdbarch, |
1761 | int float_bit) | |
0f71a2f6 JM |
1762 | { |
1763 | gdbarch->float_bit = float_bit; | |
1764 | } | |
1765 | ||
456fcf94 AC |
1766 | const struct floatformat * |
1767 | gdbarch_float_format (struct gdbarch *gdbarch) | |
1768 | { | |
1769 | gdb_assert (gdbarch != NULL); | |
1770 | if (gdbarch_debug >= 2) | |
1771 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n"); | |
1772 | return gdbarch->float_format; | |
1773 | } | |
1774 | ||
1775 | void | |
1776 | set_gdbarch_float_format (struct gdbarch *gdbarch, | |
1777 | const struct floatformat * float_format) | |
1778 | { | |
1779 | gdbarch->float_format = float_format; | |
1780 | } | |
1781 | ||
0f71a2f6 | 1782 | int |
104c1213 | 1783 | gdbarch_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1784 | { |
8de9bdc4 | 1785 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1786 | /* Skip verify of double_bit, invalid_p == 0 */ |
0f71a2f6 | 1787 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1788 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n"); |
1789 | return gdbarch->double_bit; | |
1790 | } | |
1791 | ||
1792 | void | |
104c1213 JM |
1793 | set_gdbarch_double_bit (struct gdbarch *gdbarch, |
1794 | int double_bit) | |
0f71a2f6 JM |
1795 | { |
1796 | gdbarch->double_bit = double_bit; | |
1797 | } | |
1798 | ||
456fcf94 AC |
1799 | const struct floatformat * |
1800 | gdbarch_double_format (struct gdbarch *gdbarch) | |
1801 | { | |
1802 | gdb_assert (gdbarch != NULL); | |
1803 | if (gdbarch_debug >= 2) | |
1804 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n"); | |
1805 | return gdbarch->double_format; | |
1806 | } | |
1807 | ||
1808 | void | |
1809 | set_gdbarch_double_format (struct gdbarch *gdbarch, | |
1810 | const struct floatformat * double_format) | |
1811 | { | |
1812 | gdbarch->double_format = double_format; | |
1813 | } | |
1814 | ||
0f71a2f6 | 1815 | int |
104c1213 | 1816 | gdbarch_long_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1817 | { |
8de9bdc4 | 1818 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1819 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
0f71a2f6 | 1820 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1821 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n"); |
1822 | return gdbarch->long_double_bit; | |
1823 | } | |
1824 | ||
1825 | void | |
104c1213 JM |
1826 | set_gdbarch_long_double_bit (struct gdbarch *gdbarch, |
1827 | int long_double_bit) | |
0f71a2f6 JM |
1828 | { |
1829 | gdbarch->long_double_bit = long_double_bit; | |
1830 | } | |
1831 | ||
456fcf94 AC |
1832 | const struct floatformat * |
1833 | gdbarch_long_double_format (struct gdbarch *gdbarch) | |
1834 | { | |
1835 | gdb_assert (gdbarch != NULL); | |
1836 | if (gdbarch_debug >= 2) | |
1837 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n"); | |
1838 | return gdbarch->long_double_format; | |
1839 | } | |
1840 | ||
1841 | void | |
1842 | set_gdbarch_long_double_format (struct gdbarch *gdbarch, | |
1843 | const struct floatformat * long_double_format) | |
1844 | { | |
1845 | gdbarch->long_double_format = long_double_format; | |
1846 | } | |
1847 | ||
66b43ecb AC |
1848 | int |
1849 | gdbarch_ptr_bit (struct gdbarch *gdbarch) | |
1850 | { | |
8de9bdc4 | 1851 | gdb_assert (gdbarch != NULL); |
66b43ecb AC |
1852 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
1853 | if (gdbarch_debug >= 2) | |
1854 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n"); | |
1855 | return gdbarch->ptr_bit; | |
1856 | } | |
1857 | ||
1858 | void | |
1859 | set_gdbarch_ptr_bit (struct gdbarch *gdbarch, | |
1860 | int ptr_bit) | |
1861 | { | |
1862 | gdbarch->ptr_bit = ptr_bit; | |
1863 | } | |
1864 | ||
52204a0b DT |
1865 | int |
1866 | gdbarch_addr_bit (struct gdbarch *gdbarch) | |
1867 | { | |
8de9bdc4 | 1868 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
1869 | /* Check variable changed from pre-default. */ |
1870 | gdb_assert (gdbarch->addr_bit != 0); | |
52204a0b DT |
1871 | if (gdbarch_debug >= 2) |
1872 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n"); | |
1873 | return gdbarch->addr_bit; | |
1874 | } | |
1875 | ||
1876 | void | |
1877 | set_gdbarch_addr_bit (struct gdbarch *gdbarch, | |
1878 | int addr_bit) | |
1879 | { | |
1880 | gdbarch->addr_bit = addr_bit; | |
1881 | } | |
1882 | ||
66b43ecb AC |
1883 | int |
1884 | gdbarch_bfd_vma_bit (struct gdbarch *gdbarch) | |
1885 | { | |
8de9bdc4 | 1886 | gdb_assert (gdbarch != NULL); |
66b43ecb AC |
1887 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
1888 | if (gdbarch_debug >= 2) | |
1889 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n"); | |
1890 | return gdbarch->bfd_vma_bit; | |
1891 | } | |
1892 | ||
1893 | void | |
1894 | set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, | |
1895 | int bfd_vma_bit) | |
1896 | { | |
1897 | gdbarch->bfd_vma_bit = bfd_vma_bit; | |
1898 | } | |
1899 | ||
4e409299 JB |
1900 | int |
1901 | gdbarch_char_signed (struct gdbarch *gdbarch) | |
1902 | { | |
8de9bdc4 | 1903 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
1904 | /* Check variable changed from pre-default. */ |
1905 | gdb_assert (gdbarch->char_signed != -1); | |
4e409299 JB |
1906 | if (gdbarch_debug >= 2) |
1907 | fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n"); | |
1908 | return gdbarch->char_signed; | |
1909 | } | |
1910 | ||
1911 | void | |
1912 | set_gdbarch_char_signed (struct gdbarch *gdbarch, | |
1913 | int char_signed) | |
1914 | { | |
1915 | gdbarch->char_signed = char_signed; | |
1916 | } | |
1917 | ||
cde9ea48 AC |
1918 | int |
1919 | gdbarch_read_pc_p (struct gdbarch *gdbarch) | |
1920 | { | |
1921 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1922 | return gdbarch->read_pc != NULL; |
cde9ea48 AC |
1923 | } |
1924 | ||
0f71a2f6 | 1925 | CORE_ADDR |
39f77062 | 1926 | gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid) |
0f71a2f6 | 1927 | { |
8de9bdc4 | 1928 | gdb_assert (gdbarch != NULL); |
956ac328 | 1929 | gdb_assert (gdbarch->read_pc != NULL); |
0f71a2f6 | 1930 | if (gdbarch_debug >= 2) |
0f71a2f6 | 1931 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); |
39f77062 | 1932 | return gdbarch->read_pc (ptid); |
0f71a2f6 JM |
1933 | } |
1934 | ||
1935 | void | |
104c1213 JM |
1936 | set_gdbarch_read_pc (struct gdbarch *gdbarch, |
1937 | gdbarch_read_pc_ftype read_pc) | |
0f71a2f6 JM |
1938 | { |
1939 | gdbarch->read_pc = read_pc; | |
1940 | } | |
1941 | ||
1942 | void | |
39f77062 | 1943 | gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid) |
0f71a2f6 | 1944 | { |
8de9bdc4 | 1945 | gdb_assert (gdbarch != NULL); |
956ac328 | 1946 | gdb_assert (gdbarch->write_pc != NULL); |
0f71a2f6 | 1947 | if (gdbarch_debug >= 2) |
0f71a2f6 | 1948 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); |
39f77062 | 1949 | gdbarch->write_pc (val, ptid); |
0f71a2f6 JM |
1950 | } |
1951 | ||
1952 | void | |
104c1213 JM |
1953 | set_gdbarch_write_pc (struct gdbarch *gdbarch, |
1954 | gdbarch_write_pc_ftype write_pc) | |
0f71a2f6 JM |
1955 | { |
1956 | gdbarch->write_pc = write_pc; | |
1957 | } | |
1958 | ||
bd1ce8ba AC |
1959 | int |
1960 | gdbarch_read_sp_p (struct gdbarch *gdbarch) | |
1961 | { | |
1962 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1963 | return gdbarch->read_sp != NULL; |
bd1ce8ba AC |
1964 | } |
1965 | ||
0f71a2f6 JM |
1966 | CORE_ADDR |
1967 | gdbarch_read_sp (struct gdbarch *gdbarch) | |
1968 | { | |
8de9bdc4 | 1969 | gdb_assert (gdbarch != NULL); |
956ac328 | 1970 | gdb_assert (gdbarch->read_sp != NULL); |
0f71a2f6 | 1971 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1972 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); |
1973 | return gdbarch->read_sp (); | |
1974 | } | |
1975 | ||
1976 | void | |
104c1213 JM |
1977 | set_gdbarch_read_sp (struct gdbarch *gdbarch, |
1978 | gdbarch_read_sp_ftype read_sp) | |
0f71a2f6 JM |
1979 | { |
1980 | gdbarch->read_sp = read_sp; | |
1981 | } | |
1982 | ||
39d4ef09 AC |
1983 | void |
1984 | gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) | |
1985 | { | |
8de9bdc4 | 1986 | gdb_assert (gdbarch != NULL); |
956ac328 | 1987 | gdb_assert (gdbarch->virtual_frame_pointer != NULL); |
39d4ef09 AC |
1988 | if (gdbarch_debug >= 2) |
1989 | fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); | |
1990 | gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset); | |
1991 | } | |
1992 | ||
1993 | void | |
1994 | set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, | |
1995 | gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer) | |
1996 | { | |
1997 | gdbarch->virtual_frame_pointer = virtual_frame_pointer; | |
1998 | } | |
1999 | ||
61a0eb5b | 2000 | int |
d8124050 | 2001 | gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch) |
61a0eb5b | 2002 | { |
8de9bdc4 | 2003 | gdb_assert (gdbarch != NULL); |
956ac328 | 2004 | return gdbarch->pseudo_register_read != NULL; |
61a0eb5b AC |
2005 | } |
2006 | ||
2007 | void | |
d8124050 | 2008 | gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf) |
61a0eb5b | 2009 | { |
8de9bdc4 | 2010 | gdb_assert (gdbarch != NULL); |
956ac328 | 2011 | gdb_assert (gdbarch->pseudo_register_read != NULL); |
61a0eb5b | 2012 | if (gdbarch_debug >= 2) |
d8124050 AC |
2013 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n"); |
2014 | gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf); | |
61a0eb5b AC |
2015 | } |
2016 | ||
2017 | void | |
d8124050 AC |
2018 | set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, |
2019 | gdbarch_pseudo_register_read_ftype pseudo_register_read) | |
61a0eb5b | 2020 | { |
d8124050 | 2021 | gdbarch->pseudo_register_read = pseudo_register_read; |
61a0eb5b AC |
2022 | } |
2023 | ||
2024 | int | |
d8124050 | 2025 | gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch) |
61a0eb5b | 2026 | { |
8de9bdc4 | 2027 | gdb_assert (gdbarch != NULL); |
956ac328 | 2028 | return gdbarch->pseudo_register_write != NULL; |
61a0eb5b AC |
2029 | } |
2030 | ||
2031 | void | |
d8124050 | 2032 | gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf) |
61a0eb5b | 2033 | { |
8de9bdc4 | 2034 | gdb_assert (gdbarch != NULL); |
956ac328 | 2035 | gdb_assert (gdbarch->pseudo_register_write != NULL); |
61a0eb5b | 2036 | if (gdbarch_debug >= 2) |
d8124050 AC |
2037 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n"); |
2038 | gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf); | |
61a0eb5b AC |
2039 | } |
2040 | ||
2041 | void | |
d8124050 AC |
2042 | set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, |
2043 | gdbarch_pseudo_register_write_ftype pseudo_register_write) | |
61a0eb5b | 2044 | { |
d8124050 | 2045 | gdbarch->pseudo_register_write = pseudo_register_write; |
61a0eb5b AC |
2046 | } |
2047 | ||
0f71a2f6 | 2048 | int |
104c1213 | 2049 | gdbarch_num_regs (struct gdbarch *gdbarch) |
0f71a2f6 | 2050 | { |
8de9bdc4 | 2051 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
2052 | /* Check variable changed from pre-default. */ |
2053 | gdb_assert (gdbarch->num_regs != -1); | |
0f71a2f6 | 2054 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2055 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); |
2056 | return gdbarch->num_regs; | |
2057 | } | |
2058 | ||
2059 | void | |
104c1213 JM |
2060 | set_gdbarch_num_regs (struct gdbarch *gdbarch, |
2061 | int num_regs) | |
0f71a2f6 JM |
2062 | { |
2063 | gdbarch->num_regs = num_regs; | |
2064 | } | |
2065 | ||
0aba1244 EZ |
2066 | int |
2067 | gdbarch_num_pseudo_regs (struct gdbarch *gdbarch) | |
2068 | { | |
8de9bdc4 | 2069 | gdb_assert (gdbarch != NULL); |
0aba1244 EZ |
2070 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
2071 | if (gdbarch_debug >= 2) | |
2072 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n"); | |
2073 | return gdbarch->num_pseudo_regs; | |
2074 | } | |
2075 | ||
2076 | void | |
2077 | set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, | |
2078 | int num_pseudo_regs) | |
2079 | { | |
2080 | gdbarch->num_pseudo_regs = num_pseudo_regs; | |
2081 | } | |
2082 | ||
0f71a2f6 | 2083 | int |
104c1213 | 2084 | gdbarch_sp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 2085 | { |
8de9bdc4 | 2086 | gdb_assert (gdbarch != NULL); |
1200cd6e | 2087 | /* Skip verify of sp_regnum, invalid_p == 0 */ |
0f71a2f6 | 2088 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2089 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); |
2090 | return gdbarch->sp_regnum; | |
2091 | } | |
2092 | ||
2093 | void | |
104c1213 JM |
2094 | set_gdbarch_sp_regnum (struct gdbarch *gdbarch, |
2095 | int sp_regnum) | |
0f71a2f6 JM |
2096 | { |
2097 | gdbarch->sp_regnum = sp_regnum; | |
2098 | } | |
2099 | ||
0f71a2f6 | 2100 | int |
104c1213 | 2101 | gdbarch_pc_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 2102 | { |
8de9bdc4 | 2103 | gdb_assert (gdbarch != NULL); |
1200cd6e | 2104 | /* Skip verify of pc_regnum, invalid_p == 0 */ |
0f71a2f6 | 2105 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2106 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); |
2107 | return gdbarch->pc_regnum; | |
2108 | } | |
2109 | ||
2110 | void | |
104c1213 JM |
2111 | set_gdbarch_pc_regnum (struct gdbarch *gdbarch, |
2112 | int pc_regnum) | |
0f71a2f6 JM |
2113 | { |
2114 | gdbarch->pc_regnum = pc_regnum; | |
2115 | } | |
2116 | ||
c2169756 AC |
2117 | int |
2118 | gdbarch_ps_regnum (struct gdbarch *gdbarch) | |
2119 | { | |
8de9bdc4 | 2120 | gdb_assert (gdbarch != NULL); |
c2169756 AC |
2121 | /* Skip verify of ps_regnum, invalid_p == 0 */ |
2122 | if (gdbarch_debug >= 2) | |
2123 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n"); | |
2124 | return gdbarch->ps_regnum; | |
2125 | } | |
2126 | ||
2127 | void | |
2128 | set_gdbarch_ps_regnum (struct gdbarch *gdbarch, | |
2129 | int ps_regnum) | |
2130 | { | |
2131 | gdbarch->ps_regnum = ps_regnum; | |
2132 | } | |
2133 | ||
60054393 MS |
2134 | int |
2135 | gdbarch_fp0_regnum (struct gdbarch *gdbarch) | |
2136 | { | |
8de9bdc4 | 2137 | gdb_assert (gdbarch != NULL); |
60054393 MS |
2138 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
2139 | if (gdbarch_debug >= 2) | |
2140 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n"); | |
2141 | return gdbarch->fp0_regnum; | |
2142 | } | |
2143 | ||
2144 | void | |
2145 | set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, | |
2146 | int fp0_regnum) | |
2147 | { | |
2148 | gdbarch->fp0_regnum = fp0_regnum; | |
2149 | } | |
2150 | ||
88c72b7d AC |
2151 | int |
2152 | gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr) | |
2153 | { | |
8de9bdc4 | 2154 | gdb_assert (gdbarch != NULL); |
956ac328 | 2155 | gdb_assert (gdbarch->stab_reg_to_regnum != NULL); |
88c72b7d AC |
2156 | if (gdbarch_debug >= 2) |
2157 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n"); | |
2158 | return gdbarch->stab_reg_to_regnum (stab_regnr); | |
2159 | } | |
2160 | ||
2161 | void | |
2162 | set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, | |
2163 | gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum) | |
2164 | { | |
2165 | gdbarch->stab_reg_to_regnum = stab_reg_to_regnum; | |
2166 | } | |
2167 | ||
2168 | int | |
2169 | gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr) | |
2170 | { | |
8de9bdc4 | 2171 | gdb_assert (gdbarch != NULL); |
956ac328 | 2172 | gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL); |
88c72b7d AC |
2173 | if (gdbarch_debug >= 2) |
2174 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n"); | |
2175 | return gdbarch->ecoff_reg_to_regnum (ecoff_regnr); | |
2176 | } | |
2177 | ||
2178 | void | |
2179 | set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, | |
2180 | gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum) | |
2181 | { | |
2182 | gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum; | |
2183 | } | |
2184 | ||
2185 | int | |
2186 | gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr) | |
2187 | { | |
8de9bdc4 | 2188 | gdb_assert (gdbarch != NULL); |
956ac328 | 2189 | gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL); |
88c72b7d AC |
2190 | if (gdbarch_debug >= 2) |
2191 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n"); | |
2192 | return gdbarch->dwarf_reg_to_regnum (dwarf_regnr); | |
2193 | } | |
2194 | ||
2195 | void | |
2196 | set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, | |
2197 | gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum) | |
2198 | { | |
2199 | gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum; | |
2200 | } | |
2201 | ||
2202 | int | |
2203 | gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr) | |
2204 | { | |
8de9bdc4 | 2205 | gdb_assert (gdbarch != NULL); |
956ac328 | 2206 | gdb_assert (gdbarch->sdb_reg_to_regnum != NULL); |
88c72b7d AC |
2207 | if (gdbarch_debug >= 2) |
2208 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n"); | |
2209 | return gdbarch->sdb_reg_to_regnum (sdb_regnr); | |
2210 | } | |
2211 | ||
2212 | void | |
2213 | set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, | |
2214 | gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum) | |
2215 | { | |
2216 | gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum; | |
2217 | } | |
2218 | ||
2219 | int | |
2220 | gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr) | |
2221 | { | |
8de9bdc4 | 2222 | gdb_assert (gdbarch != NULL); |
956ac328 | 2223 | gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL); |
88c72b7d AC |
2224 | if (gdbarch_debug >= 2) |
2225 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n"); | |
2226 | return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr); | |
2227 | } | |
2228 | ||
2229 | void | |
2230 | set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, | |
2231 | gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum) | |
2232 | { | |
2233 | gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum; | |
2234 | } | |
2235 | ||
fa88f677 | 2236 | const char * |
0f71a2f6 JM |
2237 | gdbarch_register_name (struct gdbarch *gdbarch, int regnr) |
2238 | { | |
8de9bdc4 | 2239 | gdb_assert (gdbarch != NULL); |
956ac328 | 2240 | gdb_assert (gdbarch->register_name != NULL); |
0f71a2f6 | 2241 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2242 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); |
2243 | return gdbarch->register_name (regnr); | |
2244 | } | |
2245 | ||
2246 | void | |
104c1213 JM |
2247 | set_gdbarch_register_name (struct gdbarch *gdbarch, |
2248 | gdbarch_register_name_ftype register_name) | |
0f71a2f6 JM |
2249 | { |
2250 | gdbarch->register_name = register_name; | |
2251 | } | |
2252 | ||
0f71a2f6 | 2253 | int |
9c04cab7 | 2254 | gdbarch_register_type_p (struct gdbarch *gdbarch) |
0f71a2f6 | 2255 | { |
8de9bdc4 | 2256 | gdb_assert (gdbarch != NULL); |
956ac328 | 2257 | return gdbarch->register_type != NULL; |
9c04cab7 AC |
2258 | } |
2259 | ||
2260 | struct type * | |
2261 | gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr) | |
2262 | { | |
2263 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2264 | gdb_assert (gdbarch->register_type != NULL); |
0f71a2f6 | 2265 | if (gdbarch_debug >= 2) |
9c04cab7 AC |
2266 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n"); |
2267 | return gdbarch->register_type (gdbarch, reg_nr); | |
0f71a2f6 JM |
2268 | } |
2269 | ||
2270 | void | |
9c04cab7 AC |
2271 | set_gdbarch_register_type (struct gdbarch *gdbarch, |
2272 | gdbarch_register_type_ftype register_type) | |
0f71a2f6 | 2273 | { |
9c04cab7 | 2274 | gdbarch->register_type = register_type; |
0f71a2f6 JM |
2275 | } |
2276 | ||
0f71a2f6 | 2277 | int |
9c04cab7 | 2278 | gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch) |
a0ed5532 AC |
2279 | { |
2280 | gdb_assert (gdbarch != NULL); | |
9c04cab7 | 2281 | return gdbarch->deprecated_register_byte != generic_register_byte; |
a0ed5532 AC |
2282 | } |
2283 | ||
2284 | int | |
9c04cab7 | 2285 | gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr) |
0f71a2f6 | 2286 | { |
8de9bdc4 | 2287 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
2288 | gdb_assert (gdbarch->deprecated_register_byte != NULL); |
2289 | /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */ | |
0f71a2f6 | 2290 | if (gdbarch_debug >= 2) |
9c04cab7 AC |
2291 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n"); |
2292 | return gdbarch->deprecated_register_byte (reg_nr); | |
0f71a2f6 JM |
2293 | } |
2294 | ||
2295 | void | |
9c04cab7 AC |
2296 | set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, |
2297 | gdbarch_deprecated_register_byte_ftype deprecated_register_byte) | |
0f71a2f6 | 2298 | { |
9c04cab7 | 2299 | gdbarch->deprecated_register_byte = deprecated_register_byte; |
0f71a2f6 JM |
2300 | } |
2301 | ||
f3be58bc AC |
2302 | int |
2303 | gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch) | |
2304 | { | |
2305 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2306 | return gdbarch->unwind_dummy_id != NULL; |
f3be58bc AC |
2307 | } |
2308 | ||
2309 | struct frame_id | |
2310 | gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info) | |
2311 | { | |
2312 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2313 | gdb_assert (gdbarch->unwind_dummy_id != NULL); |
f3be58bc AC |
2314 | if (gdbarch_debug >= 2) |
2315 | fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n"); | |
2316 | return gdbarch->unwind_dummy_id (gdbarch, info); | |
2317 | } | |
2318 | ||
2319 | void | |
2320 | set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, | |
2321 | gdbarch_unwind_dummy_id_ftype unwind_dummy_id) | |
2322 | { | |
2323 | gdbarch->unwind_dummy_id = unwind_dummy_id; | |
2324 | } | |
2325 | ||
f3be58bc AC |
2326 | int |
2327 | gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch) | |
2328 | { | |
2329 | gdb_assert (gdbarch != NULL); | |
2330 | /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ | |
2331 | if (gdbarch_debug >= 2) | |
2332 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n"); | |
2333 | return gdbarch->deprecated_fp_regnum; | |
2334 | } | |
2335 | ||
2336 | void | |
2337 | set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, | |
2338 | int deprecated_fp_regnum) | |
2339 | { | |
2340 | gdbarch->deprecated_fp_regnum = deprecated_fp_regnum; | |
2341 | } | |
2342 | ||
0ab7a791 | 2343 | int |
b8de8283 | 2344 | gdbarch_push_dummy_call_p (struct gdbarch *gdbarch) |
0ab7a791 AC |
2345 | { |
2346 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2347 | return gdbarch->push_dummy_call != NULL; |
0ab7a791 AC |
2348 | } |
2349 | ||
b8de8283 | 2350 | CORE_ADDR |
7d9b040b | 2351 | gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) |
666e11c5 | 2352 | { |
8de9bdc4 | 2353 | gdb_assert (gdbarch != NULL); |
956ac328 | 2354 | gdb_assert (gdbarch->push_dummy_call != NULL); |
666e11c5 | 2355 | if (gdbarch_debug >= 2) |
b8de8283 | 2356 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n"); |
7d9b040b | 2357 | return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr); |
666e11c5 EZ |
2358 | } |
2359 | ||
2360 | void | |
b8de8283 AC |
2361 | set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, |
2362 | gdbarch_push_dummy_call_ftype push_dummy_call) | |
666e11c5 | 2363 | { |
b8de8283 | 2364 | gdbarch->push_dummy_call = push_dummy_call; |
666e11c5 EZ |
2365 | } |
2366 | ||
b8de8283 AC |
2367 | int |
2368 | gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch) | |
0ab7a791 AC |
2369 | { |
2370 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2371 | return gdbarch->deprecated_push_arguments != NULL; |
b8de8283 AC |
2372 | } |
2373 | ||
2374 | CORE_ADDR | |
2375 | gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) | |
2376 | { | |
2377 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2378 | gdb_assert (gdbarch->deprecated_push_arguments != NULL); |
0ab7a791 | 2379 | if (gdbarch_debug >= 2) |
b8de8283 AC |
2380 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n"); |
2381 | return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr); | |
0ab7a791 AC |
2382 | } |
2383 | ||
2384 | void | |
b8de8283 AC |
2385 | set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, |
2386 | gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments) | |
0ab7a791 | 2387 | { |
b8de8283 | 2388 | gdbarch->deprecated_push_arguments = deprecated_push_arguments; |
0ab7a791 AC |
2389 | } |
2390 | ||
7c7651b2 | 2391 | int |
b8de8283 | 2392 | gdbarch_deprecated_register_size (struct gdbarch *gdbarch) |
7c7651b2 | 2393 | { |
8de9bdc4 | 2394 | gdb_assert (gdbarch != NULL); |
7c7651b2 | 2395 | if (gdbarch_debug >= 2) |
b8de8283 AC |
2396 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n"); |
2397 | return gdbarch->deprecated_register_size; | |
7c7651b2 AC |
2398 | } |
2399 | ||
2400 | void | |
b8de8283 AC |
2401 | set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, |
2402 | int deprecated_register_size) | |
7c7651b2 | 2403 | { |
b8de8283 | 2404 | gdbarch->deprecated_register_size = deprecated_register_size; |
7c7651b2 AC |
2405 | } |
2406 | ||
2649061d | 2407 | int |
b8de8283 | 2408 | gdbarch_call_dummy_location (struct gdbarch *gdbarch) |
2649061d | 2409 | { |
8de9bdc4 | 2410 | gdb_assert (gdbarch != NULL); |
b8de8283 AC |
2411 | /* Skip verify of call_dummy_location, invalid_p == 0 */ |
2412 | if (gdbarch_debug >= 2) | |
2413 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); | |
2414 | return gdbarch->call_dummy_location; | |
2649061d AC |
2415 | } |
2416 | ||
b8de8283 AC |
2417 | void |
2418 | set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, | |
2419 | int call_dummy_location) | |
2420 | { | |
2421 | gdbarch->call_dummy_location = call_dummy_location; | |
2422 | } | |
2423 | ||
0f71a2f6 | 2424 | int |
b8de8283 | 2425 | gdbarch_push_dummy_code_p (struct gdbarch *gdbarch) |
0f71a2f6 | 2426 | { |
8de9bdc4 | 2427 | gdb_assert (gdbarch != NULL); |
956ac328 | 2428 | return gdbarch->push_dummy_code != NULL; |
b8de8283 AC |
2429 | } |
2430 | ||
2431 | CORE_ADDR | |
2432 | gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr) | |
2433 | { | |
2434 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2435 | gdb_assert (gdbarch->push_dummy_code != NULL); |
0f71a2f6 | 2436 | if (gdbarch_debug >= 2) |
b8de8283 AC |
2437 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n"); |
2438 | return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr); | |
0f71a2f6 JM |
2439 | } |
2440 | ||
2441 | void | |
b8de8283 AC |
2442 | set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, |
2443 | gdbarch_push_dummy_code_ftype push_dummy_code) | |
0f71a2f6 | 2444 | { |
b8de8283 | 2445 | gdbarch->push_dummy_code = push_dummy_code; |
0f71a2f6 JM |
2446 | } |
2447 | ||
b8de8283 AC |
2448 | void |
2449 | gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) | |
2450 | { | |
2451 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2452 | gdb_assert (gdbarch->print_registers_info != NULL); |
b8de8283 AC |
2453 | if (gdbarch_debug >= 2) |
2454 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n"); | |
2455 | gdbarch->print_registers_info (gdbarch, file, frame, regnum, all); | |
2456 | } | |
2457 | ||
2458 | void | |
2459 | set_gdbarch_print_registers_info (struct gdbarch *gdbarch, | |
2460 | gdbarch_print_registers_info_ftype print_registers_info) | |
2461 | { | |
2462 | gdbarch->print_registers_info = print_registers_info; | |
0f71a2f6 JM |
2463 | } |
2464 | ||
0f71a2f6 | 2465 | int |
b8de8283 AC |
2466 | gdbarch_print_float_info_p (struct gdbarch *gdbarch) |
2467 | { | |
2468 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2469 | return gdbarch->print_float_info != NULL; |
b8de8283 AC |
2470 | } |
2471 | ||
2472 | void | |
2473 | gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) | |
0f71a2f6 | 2474 | { |
8de9bdc4 | 2475 | gdb_assert (gdbarch != NULL); |
956ac328 | 2476 | gdb_assert (gdbarch->print_float_info != NULL); |
0f71a2f6 | 2477 | if (gdbarch_debug >= 2) |
b8de8283 AC |
2478 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); |
2479 | gdbarch->print_float_info (gdbarch, file, frame, args); | |
0f71a2f6 JM |
2480 | } |
2481 | ||
2482 | void | |
b8de8283 AC |
2483 | set_gdbarch_print_float_info (struct gdbarch *gdbarch, |
2484 | gdbarch_print_float_info_ftype print_float_info) | |
0f71a2f6 | 2485 | { |
b8de8283 AC |
2486 | gdbarch->print_float_info = print_float_info; |
2487 | } | |
2488 | ||
2489 | int | |
2490 | gdbarch_print_vector_info_p (struct gdbarch *gdbarch) | |
2491 | { | |
2492 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2493 | return gdbarch->print_vector_info != NULL; |
b8de8283 AC |
2494 | } |
2495 | ||
2496 | void | |
2497 | gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) | |
2498 | { | |
2499 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2500 | gdb_assert (gdbarch->print_vector_info != NULL); |
b8de8283 AC |
2501 | if (gdbarch_debug >= 2) |
2502 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n"); | |
2503 | gdbarch->print_vector_info (gdbarch, file, frame, args); | |
0f71a2f6 JM |
2504 | } |
2505 | ||
b8de8283 AC |
2506 | void |
2507 | set_gdbarch_print_vector_info (struct gdbarch *gdbarch, | |
2508 | gdbarch_print_vector_info_ftype print_vector_info) | |
ae45cd16 | 2509 | { |
b8de8283 | 2510 | gdbarch->print_vector_info = print_vector_info; |
ae45cd16 AC |
2511 | } |
2512 | ||
2513 | int | |
b8de8283 | 2514 | gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) |
0f71a2f6 | 2515 | { |
8de9bdc4 | 2516 | gdb_assert (gdbarch != NULL); |
956ac328 | 2517 | gdb_assert (gdbarch->register_sim_regno != NULL); |
0f71a2f6 | 2518 | if (gdbarch_debug >= 2) |
b8de8283 AC |
2519 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); |
2520 | return gdbarch->register_sim_regno (reg_nr); | |
0f71a2f6 JM |
2521 | } |
2522 | ||
2523 | void | |
b8de8283 AC |
2524 | set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, |
2525 | gdbarch_register_sim_regno_ftype register_sim_regno) | |
0f71a2f6 | 2526 | { |
b8de8283 | 2527 | gdbarch->register_sim_regno = register_sim_regno; |
0f71a2f6 JM |
2528 | } |
2529 | ||
b8de8283 AC |
2530 | int |
2531 | gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch) | |
0f71a2f6 | 2532 | { |
8de9bdc4 | 2533 | gdb_assert (gdbarch != NULL); |
956ac328 | 2534 | return gdbarch->register_bytes_ok != NULL; |
0f71a2f6 JM |
2535 | } |
2536 | ||
2537 | int | |
b8de8283 | 2538 | gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes) |
0f71a2f6 | 2539 | { |
8de9bdc4 | 2540 | gdb_assert (gdbarch != NULL); |
956ac328 | 2541 | gdb_assert (gdbarch->register_bytes_ok != NULL); |
0f71a2f6 | 2542 | if (gdbarch_debug >= 2) |
b8de8283 AC |
2543 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n"); |
2544 | return gdbarch->register_bytes_ok (nr_bytes); | |
0f71a2f6 JM |
2545 | } |
2546 | ||
2547 | void | |
b8de8283 AC |
2548 | set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, |
2549 | gdbarch_register_bytes_ok_ftype register_bytes_ok) | |
0f71a2f6 | 2550 | { |
b8de8283 | 2551 | gdbarch->register_bytes_ok = register_bytes_ok; |
0f71a2f6 JM |
2552 | } |
2553 | ||
2554 | int | |
b8de8283 | 2555 | gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) |
0f71a2f6 | 2556 | { |
8de9bdc4 | 2557 | gdb_assert (gdbarch != NULL); |
956ac328 | 2558 | gdb_assert (gdbarch->cannot_fetch_register != NULL); |
b8de8283 AC |
2559 | if (gdbarch_debug >= 2) |
2560 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); | |
2561 | return gdbarch->cannot_fetch_register (regnum); | |
2562 | } | |
2563 | ||
2564 | void | |
2565 | set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, | |
2566 | gdbarch_cannot_fetch_register_ftype cannot_fetch_register) | |
2567 | { | |
2568 | gdbarch->cannot_fetch_register = cannot_fetch_register; | |
0f71a2f6 JM |
2569 | } |
2570 | ||
2571 | int | |
b8de8283 | 2572 | gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) |
0f71a2f6 | 2573 | { |
8de9bdc4 | 2574 | gdb_assert (gdbarch != NULL); |
956ac328 | 2575 | gdb_assert (gdbarch->cannot_store_register != NULL); |
0f71a2f6 | 2576 | if (gdbarch_debug >= 2) |
b8de8283 AC |
2577 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); |
2578 | return gdbarch->cannot_store_register (regnum); | |
0f71a2f6 JM |
2579 | } |
2580 | ||
2581 | void | |
b8de8283 AC |
2582 | set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, |
2583 | gdbarch_cannot_store_register_ftype cannot_store_register) | |
0f71a2f6 | 2584 | { |
b8de8283 | 2585 | gdbarch->cannot_store_register = cannot_store_register; |
0f71a2f6 JM |
2586 | } |
2587 | ||
e8ab51f7 | 2588 | int |
b8de8283 | 2589 | gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) |
e8ab51f7 AC |
2590 | { |
2591 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2592 | return gdbarch->get_longjmp_target != NULL; |
e8ab51f7 AC |
2593 | } |
2594 | ||
b8de8283 AC |
2595 | int |
2596 | gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc) | |
0f71a2f6 | 2597 | { |
8de9bdc4 | 2598 | gdb_assert (gdbarch != NULL); |
956ac328 | 2599 | gdb_assert (gdbarch->get_longjmp_target != NULL); |
0f71a2f6 | 2600 | if (gdbarch_debug >= 2) |
b8de8283 AC |
2601 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n"); |
2602 | return gdbarch->get_longjmp_target (pc); | |
0f71a2f6 JM |
2603 | } |
2604 | ||
2605 | void | |
b8de8283 AC |
2606 | set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, |
2607 | gdbarch_get_longjmp_target_ftype get_longjmp_target) | |
0f71a2f6 | 2608 | { |
b8de8283 | 2609 | gdbarch->get_longjmp_target = get_longjmp_target; |
0f71a2f6 JM |
2610 | } |
2611 | ||
2612 | int | |
104c1213 | 2613 | gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) |
0f71a2f6 | 2614 | { |
8de9bdc4 | 2615 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 2616 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2617 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n"); |
2618 | return gdbarch->believe_pcc_promotion; | |
2619 | } | |
2620 | ||
2621 | void | |
104c1213 JM |
2622 | set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, |
2623 | int believe_pcc_promotion) | |
0f71a2f6 JM |
2624 | { |
2625 | gdbarch->believe_pcc_promotion = believe_pcc_promotion; | |
2626 | } | |
2627 | ||
13d01224 | 2628 | int |
ff2e87ac | 2629 | gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) |
13d01224 AC |
2630 | { |
2631 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2632 | gdb_assert (gdbarch->convert_register_p != NULL); |
13d01224 AC |
2633 | if (gdbarch_debug >= 2) |
2634 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n"); | |
ff2e87ac | 2635 | return gdbarch->convert_register_p (regnum, type); |
13d01224 AC |
2636 | } |
2637 | ||
2638 | void | |
2639 | set_gdbarch_convert_register_p (struct gdbarch *gdbarch, | |
2640 | gdbarch_convert_register_p_ftype convert_register_p) | |
2641 | { | |
2642 | gdbarch->convert_register_p = convert_register_p; | |
2643 | } | |
2644 | ||
2645 | void | |
ff2e87ac | 2646 | gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf) |
13d01224 AC |
2647 | { |
2648 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2649 | gdb_assert (gdbarch->register_to_value != NULL); |
13d01224 AC |
2650 | if (gdbarch_debug >= 2) |
2651 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n"); | |
ff2e87ac | 2652 | gdbarch->register_to_value (frame, regnum, type, buf); |
13d01224 AC |
2653 | } |
2654 | ||
2655 | void | |
2656 | set_gdbarch_register_to_value (struct gdbarch *gdbarch, | |
2657 | gdbarch_register_to_value_ftype register_to_value) | |
2658 | { | |
2659 | gdbarch->register_to_value = register_to_value; | |
2660 | } | |
2661 | ||
2662 | void | |
ff2e87ac | 2663 | gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf) |
13d01224 AC |
2664 | { |
2665 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2666 | gdb_assert (gdbarch->value_to_register != NULL); |
13d01224 AC |
2667 | if (gdbarch_debug >= 2) |
2668 | fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n"); | |
ff2e87ac | 2669 | gdbarch->value_to_register (frame, regnum, type, buf); |
13d01224 AC |
2670 | } |
2671 | ||
2672 | void | |
2673 | set_gdbarch_value_to_register (struct gdbarch *gdbarch, | |
2674 | gdbarch_value_to_register_ftype value_to_register) | |
2675 | { | |
2676 | gdbarch->value_to_register = value_to_register; | |
2677 | } | |
2678 | ||
4478b372 | 2679 | CORE_ADDR |
66140c26 | 2680 | gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf) |
4478b372 | 2681 | { |
8de9bdc4 | 2682 | gdb_assert (gdbarch != NULL); |
956ac328 | 2683 | gdb_assert (gdbarch->pointer_to_address != NULL); |
4478b372 JB |
2684 | if (gdbarch_debug >= 2) |
2685 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); | |
2686 | return gdbarch->pointer_to_address (type, buf); | |
2687 | } | |
2688 | ||
2689 | void | |
2690 | set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, | |
2691 | gdbarch_pointer_to_address_ftype pointer_to_address) | |
2692 | { | |
2693 | gdbarch->pointer_to_address = pointer_to_address; | |
2694 | } | |
2695 | ||
2696 | void | |
ac2e2ef7 | 2697 | gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr) |
4478b372 | 2698 | { |
8de9bdc4 | 2699 | gdb_assert (gdbarch != NULL); |
956ac328 | 2700 | gdb_assert (gdbarch->address_to_pointer != NULL); |
4478b372 JB |
2701 | if (gdbarch_debug >= 2) |
2702 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); | |
2703 | gdbarch->address_to_pointer (type, buf, addr); | |
2704 | } | |
2705 | ||
2706 | void | |
2707 | set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, | |
2708 | gdbarch_address_to_pointer_ftype address_to_pointer) | |
2709 | { | |
2710 | gdbarch->address_to_pointer = address_to_pointer; | |
2711 | } | |
2712 | ||
fc0c74b1 AC |
2713 | int |
2714 | gdbarch_integer_to_address_p (struct gdbarch *gdbarch) | |
2715 | { | |
8de9bdc4 | 2716 | gdb_assert (gdbarch != NULL); |
956ac328 | 2717 | return gdbarch->integer_to_address != NULL; |
fc0c74b1 AC |
2718 | } |
2719 | ||
2720 | CORE_ADDR | |
2721 | gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) | |
2722 | { | |
8de9bdc4 | 2723 | gdb_assert (gdbarch != NULL); |
956ac328 | 2724 | gdb_assert (gdbarch->integer_to_address != NULL); |
fc0c74b1 AC |
2725 | if (gdbarch_debug >= 2) |
2726 | fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n"); | |
2727 | return gdbarch->integer_to_address (type, buf); | |
2728 | } | |
2729 | ||
2730 | void | |
2731 | set_gdbarch_integer_to_address (struct gdbarch *gdbarch, | |
2732 | gdbarch_integer_to_address_ftype integer_to_address) | |
2733 | { | |
2734 | gdbarch->integer_to_address = integer_to_address; | |
2735 | } | |
2736 | ||
4183d812 AC |
2737 | int |
2738 | gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch) | |
2739 | { | |
2740 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2741 | return gdbarch->deprecated_store_struct_return != NULL; |
4183d812 AC |
2742 | } |
2743 | ||
0f71a2f6 | 2744 | void |
4183d812 | 2745 | gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) |
0f71a2f6 | 2746 | { |
8de9bdc4 | 2747 | gdb_assert (gdbarch != NULL); |
956ac328 | 2748 | gdb_assert (gdbarch->deprecated_store_struct_return != NULL); |
0f71a2f6 | 2749 | if (gdbarch_debug >= 2) |
4183d812 AC |
2750 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n"); |
2751 | gdbarch->deprecated_store_struct_return (addr, sp); | |
0f71a2f6 JM |
2752 | } |
2753 | ||
2754 | void | |
4183d812 AC |
2755 | set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, |
2756 | gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return) | |
0f71a2f6 | 2757 | { |
4183d812 | 2758 | gdbarch->deprecated_store_struct_return = deprecated_store_struct_return; |
0f71a2f6 JM |
2759 | } |
2760 | ||
92ad9cd9 AC |
2761 | int |
2762 | gdbarch_return_value_p (struct gdbarch *gdbarch) | |
2763 | { | |
2764 | gdb_assert (gdbarch != NULL); | |
750eb019 | 2765 | return gdbarch->return_value != legacy_return_value; |
92ad9cd9 AC |
2766 | } |
2767 | ||
2768 | enum return_value_convention | |
963e2bb7 | 2769 | gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf) |
92ad9cd9 AC |
2770 | { |
2771 | gdb_assert (gdbarch != NULL); | |
2772 | gdb_assert (gdbarch->return_value != NULL); | |
750eb019 | 2773 | /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */ |
92ad9cd9 AC |
2774 | if (gdbarch_debug >= 2) |
2775 | fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n"); | |
963e2bb7 | 2776 | return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf); |
92ad9cd9 AC |
2777 | } |
2778 | ||
2779 | void | |
2780 | set_gdbarch_return_value (struct gdbarch *gdbarch, | |
2781 | gdbarch_return_value_ftype return_value) | |
2782 | { | |
2783 | gdbarch->return_value = return_value; | |
2784 | } | |
2785 | ||
0f71a2f6 | 2786 | void |
ebba8386 AC |
2787 | gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf) |
2788 | { | |
2789 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2790 | gdb_assert (gdbarch->extract_return_value != NULL); |
ebba8386 AC |
2791 | if (gdbarch_debug >= 2) |
2792 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); | |
2793 | gdbarch->extract_return_value (type, regcache, valbuf); | |
2794 | } | |
2795 | ||
2796 | void | |
2797 | set_gdbarch_extract_return_value (struct gdbarch *gdbarch, | |
2798 | gdbarch_extract_return_value_ftype extract_return_value) | |
2799 | { | |
2800 | gdbarch->extract_return_value = extract_return_value; | |
2801 | } | |
2802 | ||
2803 | void | |
2804 | gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf) | |
0f71a2f6 | 2805 | { |
8de9bdc4 | 2806 | gdb_assert (gdbarch != NULL); |
956ac328 | 2807 | gdb_assert (gdbarch->store_return_value != NULL); |
0f71a2f6 | 2808 | if (gdbarch_debug >= 2) |
0f71a2f6 | 2809 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); |
ebba8386 | 2810 | gdbarch->store_return_value (type, regcache, valbuf); |
0f71a2f6 JM |
2811 | } |
2812 | ||
2813 | void | |
104c1213 JM |
2814 | set_gdbarch_store_return_value (struct gdbarch *gdbarch, |
2815 | gdbarch_store_return_value_ftype store_return_value) | |
0f71a2f6 JM |
2816 | { |
2817 | gdbarch->store_return_value = store_return_value; | |
2818 | } | |
2819 | ||
ebba8386 AC |
2820 | void |
2821 | gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) | |
2822 | { | |
2823 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2824 | gdb_assert (gdbarch->deprecated_extract_return_value != NULL); |
ebba8386 AC |
2825 | if (gdbarch_debug >= 2) |
2826 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n"); | |
2827 | gdbarch->deprecated_extract_return_value (type, regbuf, valbuf); | |
2828 | } | |
2829 | ||
2830 | void | |
2831 | set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, | |
2832 | gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value) | |
2833 | { | |
2834 | gdbarch->deprecated_extract_return_value = deprecated_extract_return_value; | |
2835 | } | |
2836 | ||
2837 | void | |
2838 | gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) | |
2839 | { | |
2840 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2841 | gdb_assert (gdbarch->deprecated_store_return_value != NULL); |
ebba8386 AC |
2842 | if (gdbarch_debug >= 2) |
2843 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n"); | |
2844 | gdbarch->deprecated_store_return_value (type, valbuf); | |
2845 | } | |
2846 | ||
2847 | void | |
2848 | set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, | |
2849 | gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value) | |
2850 | { | |
2851 | gdbarch->deprecated_store_return_value = deprecated_store_return_value; | |
2852 | } | |
2853 | ||
92ad9cd9 | 2854 | int |
b5622e8d | 2855 | gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type) |
92ad9cd9 AC |
2856 | { |
2857 | gdb_assert (gdbarch != NULL); | |
b5622e8d | 2858 | gdb_assert (gdbarch->deprecated_use_struct_convention != NULL); |
92ad9cd9 | 2859 | if (gdbarch_debug >= 2) |
b5622e8d AC |
2860 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n"); |
2861 | return gdbarch->deprecated_use_struct_convention (gcc_p, value_type); | |
92ad9cd9 AC |
2862 | } |
2863 | ||
2864 | void | |
b5622e8d AC |
2865 | set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, |
2866 | gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention) | |
92ad9cd9 | 2867 | { |
b5622e8d | 2868 | gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention; |
92ad9cd9 AC |
2869 | } |
2870 | ||
049ee0e4 | 2871 | int |
74055713 | 2872 | gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch) |
049ee0e4 AC |
2873 | { |
2874 | gdb_assert (gdbarch != NULL); | |
74055713 | 2875 | return gdbarch->deprecated_extract_struct_value_address != NULL; |
049ee0e4 AC |
2876 | } |
2877 | ||
2878 | CORE_ADDR | |
74055713 | 2879 | gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache) |
049ee0e4 AC |
2880 | { |
2881 | gdb_assert (gdbarch != NULL); | |
74055713 | 2882 | gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL); |
049ee0e4 | 2883 | if (gdbarch_debug >= 2) |
74055713 AC |
2884 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n"); |
2885 | return gdbarch->deprecated_extract_struct_value_address (regcache); | |
049ee0e4 AC |
2886 | } |
2887 | ||
2888 | void | |
74055713 AC |
2889 | set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, |
2890 | gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address) | |
049ee0e4 | 2891 | { |
74055713 | 2892 | gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address; |
049ee0e4 AC |
2893 | } |
2894 | ||
0f71a2f6 JM |
2895 | CORE_ADDR |
2896 | gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) | |
2897 | { | |
8de9bdc4 | 2898 | gdb_assert (gdbarch != NULL); |
956ac328 | 2899 | gdb_assert (gdbarch->skip_prologue != NULL); |
0f71a2f6 | 2900 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2901 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); |
2902 | return gdbarch->skip_prologue (ip); | |
2903 | } | |
2904 | ||
2905 | void | |
104c1213 JM |
2906 | set_gdbarch_skip_prologue (struct gdbarch *gdbarch, |
2907 | gdbarch_skip_prologue_ftype skip_prologue) | |
0f71a2f6 JM |
2908 | { |
2909 | gdbarch->skip_prologue = skip_prologue; | |
2910 | } | |
2911 | ||
2912 | int | |
2913 | gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) | |
2914 | { | |
8de9bdc4 | 2915 | gdb_assert (gdbarch != NULL); |
956ac328 | 2916 | gdb_assert (gdbarch->inner_than != NULL); |
0f71a2f6 | 2917 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2918 | fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); |
2919 | return gdbarch->inner_than (lhs, rhs); | |
2920 | } | |
2921 | ||
2922 | void | |
104c1213 JM |
2923 | set_gdbarch_inner_than (struct gdbarch *gdbarch, |
2924 | gdbarch_inner_than_ftype inner_than) | |
0f71a2f6 JM |
2925 | { |
2926 | gdbarch->inner_than = inner_than; | |
2927 | } | |
2928 | ||
f4f9705a | 2929 | const unsigned char * |
adf40b2e | 2930 | gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) |
0f71a2f6 | 2931 | { |
8de9bdc4 | 2932 | gdb_assert (gdbarch != NULL); |
956ac328 | 2933 | gdb_assert (gdbarch->breakpoint_from_pc != NULL); |
0f71a2f6 | 2934 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2935 | fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); |
2936 | return gdbarch->breakpoint_from_pc (pcptr, lenptr); | |
2937 | } | |
2938 | ||
2939 | void | |
104c1213 JM |
2940 | set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, |
2941 | gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc) | |
0f71a2f6 JM |
2942 | { |
2943 | gdbarch->breakpoint_from_pc = breakpoint_from_pc; | |
2944 | } | |
2945 | ||
a1131521 KB |
2946 | int |
2947 | gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch) | |
2948 | { | |
2949 | gdb_assert (gdbarch != NULL); | |
2950 | return gdbarch->adjust_breakpoint_address != NULL; | |
2951 | } | |
2952 | ||
2953 | CORE_ADDR | |
2954 | gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) | |
2955 | { | |
2956 | gdb_assert (gdbarch != NULL); | |
2957 | gdb_assert (gdbarch->adjust_breakpoint_address != NULL); | |
2958 | if (gdbarch_debug >= 2) | |
2959 | fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n"); | |
2960 | return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr); | |
2961 | } | |
2962 | ||
2963 | void | |
2964 | set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, | |
2965 | gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address) | |
2966 | { | |
2967 | gdbarch->adjust_breakpoint_address = adjust_breakpoint_address; | |
2968 | } | |
2969 | ||
917317f4 JM |
2970 | int |
2971 | gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) | |
2972 | { | |
8de9bdc4 | 2973 | gdb_assert (gdbarch != NULL); |
956ac328 | 2974 | gdb_assert (gdbarch->memory_insert_breakpoint != NULL); |
917317f4 | 2975 | if (gdbarch_debug >= 2) |
917317f4 JM |
2976 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); |
2977 | return gdbarch->memory_insert_breakpoint (addr, contents_cache); | |
2978 | } | |
2979 | ||
2980 | void | |
2981 | set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, | |
2982 | gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint) | |
2983 | { | |
2984 | gdbarch->memory_insert_breakpoint = memory_insert_breakpoint; | |
2985 | } | |
2986 | ||
2987 | int | |
2988 | gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) | |
2989 | { | |
8de9bdc4 | 2990 | gdb_assert (gdbarch != NULL); |
956ac328 | 2991 | gdb_assert (gdbarch->memory_remove_breakpoint != NULL); |
917317f4 | 2992 | if (gdbarch_debug >= 2) |
917317f4 JM |
2993 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); |
2994 | return gdbarch->memory_remove_breakpoint (addr, contents_cache); | |
2995 | } | |
2996 | ||
2997 | void | |
2998 | set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, | |
2999 | gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint) | |
3000 | { | |
3001 | gdbarch->memory_remove_breakpoint = memory_remove_breakpoint; | |
3002 | } | |
3003 | ||
0f71a2f6 | 3004 | CORE_ADDR |
104c1213 | 3005 | gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) |
0f71a2f6 | 3006 | { |
8de9bdc4 | 3007 | gdb_assert (gdbarch != NULL); |
71bd6bd4 | 3008 | /* Skip verify of decr_pc_after_break, invalid_p == 0 */ |
0f71a2f6 | 3009 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3010 | fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); |
3011 | return gdbarch->decr_pc_after_break; | |
3012 | } | |
3013 | ||
3014 | void | |
104c1213 JM |
3015 | set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, |
3016 | CORE_ADDR decr_pc_after_break) | |
0f71a2f6 JM |
3017 | { |
3018 | gdbarch->decr_pc_after_break = decr_pc_after_break; | |
3019 | } | |
3020 | ||
3021 | CORE_ADDR | |
782263ab | 3022 | gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 | 3023 | { |
8de9bdc4 | 3024 | gdb_assert (gdbarch != NULL); |
782263ab | 3025 | /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */ |
0f71a2f6 | 3026 | if (gdbarch_debug >= 2) |
782263ab AC |
3027 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n"); |
3028 | return gdbarch->deprecated_function_start_offset; | |
0f71a2f6 JM |
3029 | } |
3030 | ||
3031 | void | |
782263ab AC |
3032 | set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, |
3033 | CORE_ADDR deprecated_function_start_offset) | |
0f71a2f6 | 3034 | { |
782263ab | 3035 | gdbarch->deprecated_function_start_offset = deprecated_function_start_offset; |
0f71a2f6 JM |
3036 | } |
3037 | ||
3038 | void | |
f6684c31 | 3039 | gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len) |
0f71a2f6 | 3040 | { |
8de9bdc4 | 3041 | gdb_assert (gdbarch != NULL); |
956ac328 | 3042 | gdb_assert (gdbarch->remote_translate_xfer_address != NULL); |
0f71a2f6 | 3043 | if (gdbarch_debug >= 2) |
0f71a2f6 | 3044 | fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n"); |
f6684c31 | 3045 | gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len); |
0f71a2f6 JM |
3046 | } |
3047 | ||
3048 | void | |
104c1213 JM |
3049 | set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, |
3050 | gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address) | |
0f71a2f6 JM |
3051 | { |
3052 | gdbarch->remote_translate_xfer_address = remote_translate_xfer_address; | |
3053 | } | |
3054 | ||
3055 | CORE_ADDR | |
104c1213 | 3056 | gdbarch_frame_args_skip (struct gdbarch *gdbarch) |
0f71a2f6 | 3057 | { |
8de9bdc4 | 3058 | gdb_assert (gdbarch != NULL); |
5867a2fb | 3059 | /* Skip verify of frame_args_skip, invalid_p == 0 */ |
0f71a2f6 | 3060 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3061 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); |
3062 | return gdbarch->frame_args_skip; | |
3063 | } | |
3064 | ||
3065 | void | |
104c1213 JM |
3066 | set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, |
3067 | CORE_ADDR frame_args_skip) | |
0f71a2f6 JM |
3068 | { |
3069 | gdbarch->frame_args_skip = frame_args_skip; | |
3070 | } | |
3071 | ||
12cc2063 AC |
3072 | int |
3073 | gdbarch_unwind_pc_p (struct gdbarch *gdbarch) | |
3074 | { | |
3075 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3076 | return gdbarch->unwind_pc != NULL; |
12cc2063 AC |
3077 | } |
3078 | ||
3079 | CORE_ADDR | |
3080 | gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) | |
3081 | { | |
3082 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3083 | gdb_assert (gdbarch->unwind_pc != NULL); |
12cc2063 AC |
3084 | if (gdbarch_debug >= 2) |
3085 | fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n"); | |
3086 | return gdbarch->unwind_pc (gdbarch, next_frame); | |
3087 | } | |
3088 | ||
3089 | void | |
3090 | set_gdbarch_unwind_pc (struct gdbarch *gdbarch, | |
3091 | gdbarch_unwind_pc_ftype unwind_pc) | |
3092 | { | |
3093 | gdbarch->unwind_pc = unwind_pc; | |
3094 | } | |
3095 | ||
a9e5fdc2 AC |
3096 | int |
3097 | gdbarch_unwind_sp_p (struct gdbarch *gdbarch) | |
3098 | { | |
3099 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3100 | return gdbarch->unwind_sp != NULL; |
a9e5fdc2 AC |
3101 | } |
3102 | ||
3103 | CORE_ADDR | |
3104 | gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) | |
3105 | { | |
3106 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3107 | gdb_assert (gdbarch->unwind_sp != NULL); |
a9e5fdc2 AC |
3108 | if (gdbarch_debug >= 2) |
3109 | fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n"); | |
3110 | return gdbarch->unwind_sp (gdbarch, next_frame); | |
3111 | } | |
3112 | ||
3113 | void | |
3114 | set_gdbarch_unwind_sp (struct gdbarch *gdbarch, | |
3115 | gdbarch_unwind_sp_ftype unwind_sp) | |
3116 | { | |
3117 | gdbarch->unwind_sp = unwind_sp; | |
3118 | } | |
3119 | ||
4443bd83 | 3120 | int |
6913c89a | 3121 | gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch) |
4443bd83 AC |
3122 | { |
3123 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3124 | return gdbarch->deprecated_saved_pc_after_call != NULL; |
4443bd83 AC |
3125 | } |
3126 | ||
0f71a2f6 | 3127 | CORE_ADDR |
6913c89a | 3128 | gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame) |
0f71a2f6 | 3129 | { |
8de9bdc4 | 3130 | gdb_assert (gdbarch != NULL); |
956ac328 | 3131 | gdb_assert (gdbarch->deprecated_saved_pc_after_call != NULL); |
0f71a2f6 | 3132 | if (gdbarch_debug >= 2) |
6913c89a AC |
3133 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_saved_pc_after_call called\n"); |
3134 | return gdbarch->deprecated_saved_pc_after_call (frame); | |
0f71a2f6 JM |
3135 | } |
3136 | ||
3137 | void | |
6913c89a AC |
3138 | set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, |
3139 | gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call) | |
0f71a2f6 | 3140 | { |
6913c89a | 3141 | gdbarch->deprecated_saved_pc_after_call = deprecated_saved_pc_after_call; |
0f71a2f6 JM |
3142 | } |
3143 | ||
983a287a AC |
3144 | int |
3145 | gdbarch_frame_num_args_p (struct gdbarch *gdbarch) | |
3146 | { | |
3147 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3148 | return gdbarch->frame_num_args != NULL; |
983a287a AC |
3149 | } |
3150 | ||
0f71a2f6 JM |
3151 | int |
3152 | gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) | |
3153 | { | |
8de9bdc4 | 3154 | gdb_assert (gdbarch != NULL); |
956ac328 | 3155 | gdb_assert (gdbarch->frame_num_args != NULL); |
0f71a2f6 | 3156 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
3157 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); |
3158 | return gdbarch->frame_num_args (frame); | |
3159 | } | |
3160 | ||
3161 | void | |
104c1213 JM |
3162 | set_gdbarch_frame_num_args (struct gdbarch *gdbarch, |
3163 | gdbarch_frame_num_args_ftype frame_num_args) | |
0f71a2f6 JM |
3164 | { |
3165 | gdbarch->frame_num_args = frame_num_args; | |
3166 | } | |
3167 | ||
2ada493a | 3168 | int |
f27dd7fd | 3169 | gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch) |
2ada493a | 3170 | { |
8de9bdc4 | 3171 | gdb_assert (gdbarch != NULL); |
f27dd7fd | 3172 | return gdbarch->deprecated_stack_align != NULL; |
2ada493a AC |
3173 | } |
3174 | ||
3175 | CORE_ADDR | |
f27dd7fd | 3176 | gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp) |
2ada493a | 3177 | { |
8de9bdc4 | 3178 | gdb_assert (gdbarch != NULL); |
f27dd7fd | 3179 | gdb_assert (gdbarch->deprecated_stack_align != NULL); |
2ada493a | 3180 | if (gdbarch_debug >= 2) |
f27dd7fd AC |
3181 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n"); |
3182 | return gdbarch->deprecated_stack_align (sp); | |
2ada493a AC |
3183 | } |
3184 | ||
3185 | void | |
f27dd7fd AC |
3186 | set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, |
3187 | gdbarch_deprecated_stack_align_ftype deprecated_stack_align) | |
2ada493a | 3188 | { |
f27dd7fd | 3189 | gdbarch->deprecated_stack_align = deprecated_stack_align; |
2ada493a AC |
3190 | } |
3191 | ||
dc604539 AC |
3192 | int |
3193 | gdbarch_frame_align_p (struct gdbarch *gdbarch) | |
3194 | { | |
3195 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3196 | return gdbarch->frame_align != NULL; |
dc604539 AC |
3197 | } |
3198 | ||
3199 | CORE_ADDR | |
3200 | gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address) | |
3201 | { | |
3202 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3203 | gdb_assert (gdbarch->frame_align != NULL); |
dc604539 AC |
3204 | if (gdbarch_debug >= 2) |
3205 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n"); | |
3206 | return gdbarch->frame_align (gdbarch, address); | |
3207 | } | |
3208 | ||
3209 | void | |
3210 | set_gdbarch_frame_align (struct gdbarch *gdbarch, | |
3211 | gdbarch_frame_align_ftype frame_align) | |
3212 | { | |
3213 | gdbarch->frame_align = frame_align; | |
3214 | } | |
3215 | ||
d03e67c9 | 3216 | int |
88d89dbb | 3217 | gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch) |
d03e67c9 | 3218 | { |
8de9bdc4 | 3219 | gdb_assert (gdbarch != NULL); |
88d89dbb | 3220 | return gdbarch->deprecated_reg_struct_has_addr != NULL; |
d03e67c9 AC |
3221 | } |
3222 | ||
3223 | int | |
88d89dbb | 3224 | gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) |
d03e67c9 | 3225 | { |
8de9bdc4 | 3226 | gdb_assert (gdbarch != NULL); |
88d89dbb | 3227 | gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL); |
d03e67c9 | 3228 | if (gdbarch_debug >= 2) |
88d89dbb MK |
3229 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n"); |
3230 | return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type); | |
d03e67c9 AC |
3231 | } |
3232 | ||
3233 | void | |
88d89dbb MK |
3234 | set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, |
3235 | gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr) | |
d03e67c9 | 3236 | { |
88d89dbb | 3237 | gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr; |
d03e67c9 AC |
3238 | } |
3239 | ||
192cb3d4 MK |
3240 | int |
3241 | gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) | |
3242 | { | |
3243 | gdb_assert (gdbarch != NULL); | |
3244 | gdb_assert (gdbarch->stabs_argument_has_addr != NULL); | |
3245 | if (gdbarch_debug >= 2) | |
3246 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n"); | |
3247 | return gdbarch->stabs_argument_has_addr (gdbarch, type); | |
3248 | } | |
3249 | ||
3250 | void | |
3251 | set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, | |
3252 | gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr) | |
3253 | { | |
3254 | gdbarch->stabs_argument_has_addr = stabs_argument_has_addr; | |
3255 | } | |
3256 | ||
8b148df9 AC |
3257 | int |
3258 | gdbarch_frame_red_zone_size (struct gdbarch *gdbarch) | |
3259 | { | |
3260 | gdb_assert (gdbarch != NULL); | |
3261 | if (gdbarch_debug >= 2) | |
3262 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n"); | |
3263 | return gdbarch->frame_red_zone_size; | |
3264 | } | |
3265 | ||
3266 | void | |
3267 | set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch, | |
3268 | int frame_red_zone_size) | |
3269 | { | |
3270 | gdbarch->frame_red_zone_size = frame_red_zone_size; | |
3271 | } | |
3272 | ||
f517ea4e | 3273 | CORE_ADDR |
e2d0e7eb | 3274 | gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ) |
f517ea4e | 3275 | { |
8de9bdc4 | 3276 | gdb_assert (gdbarch != NULL); |
956ac328 | 3277 | gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL); |
f517ea4e PS |
3278 | if (gdbarch_debug >= 2) |
3279 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n"); | |
e2d0e7eb | 3280 | return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ); |
f517ea4e PS |
3281 | } |
3282 | ||
3283 | void | |
3284 | set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, | |
3285 | gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr) | |
3286 | { | |
3287 | gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr; | |
3288 | } | |
3289 | ||
875e1767 AC |
3290 | CORE_ADDR |
3291 | gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) | |
3292 | { | |
8de9bdc4 | 3293 | gdb_assert (gdbarch != NULL); |
956ac328 | 3294 | gdb_assert (gdbarch->addr_bits_remove != NULL); |
875e1767 AC |
3295 | if (gdbarch_debug >= 2) |
3296 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n"); | |
3297 | return gdbarch->addr_bits_remove (addr); | |
3298 | } | |
3299 | ||
3300 | void | |
3301 | set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, | |
3302 | gdbarch_addr_bits_remove_ftype addr_bits_remove) | |
3303 | { | |
3304 | gdbarch->addr_bits_remove = addr_bits_remove; | |
3305 | } | |
3306 | ||
181c1381 RE |
3307 | CORE_ADDR |
3308 | gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr) | |
3309 | { | |
8de9bdc4 | 3310 | gdb_assert (gdbarch != NULL); |
956ac328 | 3311 | gdb_assert (gdbarch->smash_text_address != NULL); |
181c1381 RE |
3312 | if (gdbarch_debug >= 2) |
3313 | fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n"); | |
3314 | return gdbarch->smash_text_address (addr); | |
3315 | } | |
3316 | ||
3317 | void | |
3318 | set_gdbarch_smash_text_address (struct gdbarch *gdbarch, | |
3319 | gdbarch_smash_text_address_ftype smash_text_address) | |
3320 | { | |
3321 | gdbarch->smash_text_address = smash_text_address; | |
3322 | } | |
3323 | ||
64c4637f AC |
3324 | int |
3325 | gdbarch_software_single_step_p (struct gdbarch *gdbarch) | |
3326 | { | |
8de9bdc4 | 3327 | gdb_assert (gdbarch != NULL); |
956ac328 | 3328 | return gdbarch->software_single_step != NULL; |
64c4637f AC |
3329 | } |
3330 | ||
3331 | void | |
3332 | gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p) | |
3333 | { | |
8de9bdc4 | 3334 | gdb_assert (gdbarch != NULL); |
956ac328 | 3335 | gdb_assert (gdbarch->software_single_step != NULL); |
64c4637f AC |
3336 | if (gdbarch_debug >= 2) |
3337 | fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n"); | |
3338 | gdbarch->software_single_step (sig, insert_breakpoints_p); | |
3339 | } | |
3340 | ||
3341 | void | |
3342 | set_gdbarch_software_single_step (struct gdbarch *gdbarch, | |
3343 | gdbarch_software_single_step_ftype software_single_step) | |
3344 | { | |
3345 | gdbarch->software_single_step = software_single_step; | |
3346 | } | |
3347 | ||
2bf0cb65 | 3348 | int |
a89aa300 | 3349 | gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info) |
2bf0cb65 | 3350 | { |
8de9bdc4 | 3351 | gdb_assert (gdbarch != NULL); |
956ac328 | 3352 | gdb_assert (gdbarch->print_insn != NULL); |
2bf0cb65 EZ |
3353 | if (gdbarch_debug >= 2) |
3354 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n"); | |
3355 | return gdbarch->print_insn (vma, info); | |
3356 | } | |
3357 | ||
3358 | void | |
3359 | set_gdbarch_print_insn (struct gdbarch *gdbarch, | |
3360 | gdbarch_print_insn_ftype print_insn) | |
3361 | { | |
3362 | gdbarch->print_insn = print_insn; | |
3363 | } | |
3364 | ||
bdcd319a CV |
3365 | CORE_ADDR |
3366 | gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc) | |
3367 | { | |
8de9bdc4 | 3368 | gdb_assert (gdbarch != NULL); |
956ac328 | 3369 | gdb_assert (gdbarch->skip_trampoline_code != NULL); |
bdcd319a CV |
3370 | if (gdbarch_debug >= 2) |
3371 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n"); | |
3372 | return gdbarch->skip_trampoline_code (pc); | |
3373 | } | |
3374 | ||
3375 | void | |
3376 | set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, | |
3377 | gdbarch_skip_trampoline_code_ftype skip_trampoline_code) | |
3378 | { | |
3379 | gdbarch->skip_trampoline_code = skip_trampoline_code; | |
3380 | } | |
3381 | ||
dea0c52f MK |
3382 | CORE_ADDR |
3383 | gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) | |
3384 | { | |
3385 | gdb_assert (gdbarch != NULL); | |
3386 | gdb_assert (gdbarch->skip_solib_resolver != NULL); | |
3387 | if (gdbarch_debug >= 2) | |
3388 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n"); | |
4c8c40e6 | 3389 | return gdbarch->skip_solib_resolver (gdbarch, pc); |
dea0c52f MK |
3390 | } |
3391 | ||
3392 | void | |
3393 | set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, | |
3394 | gdbarch_skip_solib_resolver_ftype skip_solib_resolver) | |
3395 | { | |
3396 | gdbarch->skip_solib_resolver = skip_solib_resolver; | |
3397 | } | |
3398 | ||
68e9cc94 CV |
3399 | int |
3400 | gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) | |
3401 | { | |
8de9bdc4 | 3402 | gdb_assert (gdbarch != NULL); |
956ac328 | 3403 | gdb_assert (gdbarch->in_solib_call_trampoline != NULL); |
68e9cc94 CV |
3404 | if (gdbarch_debug >= 2) |
3405 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n"); | |
3406 | return gdbarch->in_solib_call_trampoline (pc, name); | |
3407 | } | |
3408 | ||
3409 | void | |
3410 | set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, | |
3411 | gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline) | |
3412 | { | |
3413 | gdbarch->in_solib_call_trampoline = in_solib_call_trampoline; | |
3414 | } | |
3415 | ||
d50355b6 MS |
3416 | int |
3417 | gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) | |
3418 | { | |
3419 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3420 | gdb_assert (gdbarch->in_solib_return_trampoline != NULL); |
d50355b6 MS |
3421 | if (gdbarch_debug >= 2) |
3422 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n"); | |
3423 | return gdbarch->in_solib_return_trampoline (pc, name); | |
3424 | } | |
3425 | ||
3426 | void | |
3427 | set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, | |
3428 | gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline) | |
3429 | { | |
3430 | gdbarch->in_solib_return_trampoline = in_solib_return_trampoline; | |
3431 | } | |
3432 | ||
c12260ac CV |
3433 | int |
3434 | gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr) | |
3435 | { | |
8de9bdc4 | 3436 | gdb_assert (gdbarch != NULL); |
956ac328 | 3437 | gdb_assert (gdbarch->in_function_epilogue_p != NULL); |
c12260ac CV |
3438 | if (gdbarch_debug >= 2) |
3439 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n"); | |
3440 | return gdbarch->in_function_epilogue_p (gdbarch, addr); | |
3441 | } | |
3442 | ||
3443 | void | |
3444 | set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, | |
3445 | gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p) | |
3446 | { | |
3447 | gdbarch->in_function_epilogue_p = in_function_epilogue_p; | |
3448 | } | |
3449 | ||
552c04a7 TT |
3450 | char * |
3451 | gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv) | |
3452 | { | |
8de9bdc4 | 3453 | gdb_assert (gdbarch != NULL); |
956ac328 | 3454 | gdb_assert (gdbarch->construct_inferior_arguments != NULL); |
552c04a7 TT |
3455 | if (gdbarch_debug >= 2) |
3456 | fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n"); | |
3457 | return gdbarch->construct_inferior_arguments (gdbarch, argc, argv); | |
3458 | } | |
3459 | ||
3460 | void | |
3461 | set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, | |
3462 | gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments) | |
3463 | { | |
3464 | gdbarch->construct_inferior_arguments = construct_inferior_arguments; | |
3465 | } | |
3466 | ||
a2cf933a EZ |
3467 | void |
3468 | gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym) | |
3469 | { | |
8de9bdc4 | 3470 | gdb_assert (gdbarch != NULL); |
956ac328 | 3471 | gdb_assert (gdbarch->elf_make_msymbol_special != NULL); |
a2cf933a EZ |
3472 | if (gdbarch_debug >= 2) |
3473 | fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n"); | |
3474 | gdbarch->elf_make_msymbol_special (sym, msym); | |
3475 | } | |
3476 | ||
3477 | void | |
3478 | set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, | |
3479 | gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special) | |
3480 | { | |
3481 | gdbarch->elf_make_msymbol_special = elf_make_msymbol_special; | |
3482 | } | |
3483 | ||
3484 | void | |
3485 | gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym) | |
3486 | { | |
8de9bdc4 | 3487 | gdb_assert (gdbarch != NULL); |
956ac328 | 3488 | gdb_assert (gdbarch->coff_make_msymbol_special != NULL); |
a2cf933a EZ |
3489 | if (gdbarch_debug >= 2) |
3490 | fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n"); | |
3491 | gdbarch->coff_make_msymbol_special (val, msym); | |
3492 | } | |
3493 | ||
3494 | void | |
3495 | set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, | |
3496 | gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special) | |
3497 | { | |
3498 | gdbarch->coff_make_msymbol_special = coff_make_msymbol_special; | |
3499 | } | |
3500 | ||
5720643c JB |
3501 | const char * |
3502 | gdbarch_name_of_malloc (struct gdbarch *gdbarch) | |
3503 | { | |
3504 | gdb_assert (gdbarch != NULL); | |
3505 | /* Skip verify of name_of_malloc, invalid_p == 0 */ | |
3506 | if (gdbarch_debug >= 2) | |
3507 | fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n"); | |
3508 | return gdbarch->name_of_malloc; | |
3509 | } | |
3510 | ||
3511 | void | |
3512 | set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, | |
3513 | const char * name_of_malloc) | |
3514 | { | |
3515 | gdbarch->name_of_malloc = name_of_malloc; | |
3516 | } | |
3517 | ||
c4ed33b9 AC |
3518 | int |
3519 | gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch) | |
3520 | { | |
3521 | gdb_assert (gdbarch != NULL); | |
3522 | /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ | |
3523 | if (gdbarch_debug >= 2) | |
3524 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n"); | |
3525 | return gdbarch->cannot_step_breakpoint; | |
3526 | } | |
3527 | ||
3528 | void | |
3529 | set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, | |
3530 | int cannot_step_breakpoint) | |
3531 | { | |
3532 | gdbarch->cannot_step_breakpoint = cannot_step_breakpoint; | |
3533 | } | |
3534 | ||
f74fa174 MM |
3535 | int |
3536 | gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch) | |
3537 | { | |
3538 | gdb_assert (gdbarch != NULL); | |
3539 | /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ | |
3540 | if (gdbarch_debug >= 2) | |
3541 | fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n"); | |
3542 | return gdbarch->have_nonsteppable_watchpoint; | |
3543 | } | |
3544 | ||
3545 | void | |
3546 | set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, | |
967c0d83 | 3547 | int have_nonsteppable_watchpoint) |
f74fa174 MM |
3548 | { |
3549 | gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint; | |
3550 | } | |
3551 | ||
8b2dbe47 KB |
3552 | int |
3553 | gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch) | |
3554 | { | |
3555 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3556 | return gdbarch->address_class_type_flags != NULL; |
8b2dbe47 KB |
3557 | } |
3558 | ||
3559 | int | |
3560 | gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class) | |
3561 | { | |
3562 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3563 | gdb_assert (gdbarch->address_class_type_flags != NULL); |
8b2dbe47 KB |
3564 | if (gdbarch_debug >= 2) |
3565 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n"); | |
3566 | return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class); | |
3567 | } | |
3568 | ||
3569 | void | |
3570 | set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, | |
3571 | gdbarch_address_class_type_flags_ftype address_class_type_flags) | |
3572 | { | |
3573 | gdbarch->address_class_type_flags = address_class_type_flags; | |
3574 | } | |
3575 | ||
3576 | int | |
3577 | gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch) | |
3578 | { | |
3579 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3580 | return gdbarch->address_class_type_flags_to_name != NULL; |
8b2dbe47 KB |
3581 | } |
3582 | ||
321432c0 | 3583 | const char * |
8b2dbe47 KB |
3584 | gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) |
3585 | { | |
3586 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3587 | gdb_assert (gdbarch->address_class_type_flags_to_name != NULL); |
8b2dbe47 KB |
3588 | if (gdbarch_debug >= 2) |
3589 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n"); | |
5f11f355 | 3590 | return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags); |
8b2dbe47 KB |
3591 | } |
3592 | ||
3593 | void | |
3594 | set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, | |
3595 | gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name) | |
3596 | { | |
3597 | gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name; | |
3598 | } | |
3599 | ||
3600 | int | |
3601 | gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch) | |
3602 | { | |
3603 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3604 | return gdbarch->address_class_name_to_type_flags != NULL; |
8b2dbe47 KB |
3605 | } |
3606 | ||
3607 | int | |
321432c0 | 3608 | gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr) |
8b2dbe47 KB |
3609 | { |
3610 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3611 | gdb_assert (gdbarch->address_class_name_to_type_flags != NULL); |
8b2dbe47 KB |
3612 | if (gdbarch_debug >= 2) |
3613 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n"); | |
5f11f355 | 3614 | return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr); |
8b2dbe47 KB |
3615 | } |
3616 | ||
3617 | void | |
3618 | set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, | |
3619 | gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags) | |
3620 | { | |
3621 | gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags; | |
3622 | } | |
3623 | ||
b59ff9d5 AC |
3624 | int |
3625 | gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup) | |
3626 | { | |
3627 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3628 | gdb_assert (gdbarch->register_reggroup_p != NULL); |
b59ff9d5 AC |
3629 | if (gdbarch_debug >= 2) |
3630 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n"); | |
3631 | return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup); | |
3632 | } | |
3633 | ||
3634 | void | |
3635 | set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, | |
3636 | gdbarch_register_reggroup_p_ftype register_reggroup_p) | |
3637 | { | |
3638 | gdbarch->register_reggroup_p = register_reggroup_p; | |
3639 | } | |
3640 | ||
143985b7 AF |
3641 | int |
3642 | gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch) | |
3643 | { | |
3644 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3645 | return gdbarch->fetch_pointer_argument != NULL; |
143985b7 AF |
3646 | } |
3647 | ||
3648 | CORE_ADDR | |
3649 | gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type) | |
3650 | { | |
3651 | gdb_assert (gdbarch != NULL); | |
956ac328 | 3652 | gdb_assert (gdbarch->fetch_pointer_argument != NULL); |
143985b7 AF |
3653 | if (gdbarch_debug >= 2) |
3654 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n"); | |
3655 | return gdbarch->fetch_pointer_argument (frame, argi, type); | |
3656 | } | |
3657 | ||
3658 | void | |
3659 | set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, | |
3660 | gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument) | |
3661 | { | |
3662 | gdbarch->fetch_pointer_argument = fetch_pointer_argument; | |
3663 | } | |
3664 | ||
6ce6d90f MK |
3665 | int |
3666 | gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch) | |
3667 | { | |
3668 | gdb_assert (gdbarch != NULL); | |
3669 | return gdbarch->regset_from_core_section != NULL; | |
3670 | } | |
3671 | ||
3672 | const struct regset * | |
3673 | gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size) | |
3674 | { | |
3675 | gdb_assert (gdbarch != NULL); | |
3676 | gdb_assert (gdbarch->regset_from_core_section != NULL); | |
3677 | if (gdbarch_debug >= 2) | |
3678 | fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n"); | |
3679 | return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size); | |
3680 | } | |
3681 | ||
3682 | void | |
3683 | set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, | |
3684 | gdbarch_regset_from_core_section_ftype regset_from_core_section) | |
3685 | { | |
3686 | gdbarch->regset_from_core_section = regset_from_core_section; | |
3687 | } | |
3688 | ||
0f71a2f6 | 3689 | |
be5a57e1 | 3690 | /* Keep a registry of per-architecture data-pointers required by GDB |
0f71a2f6 JM |
3691 | modules. */ |
3692 | ||
3693 | struct gdbarch_data | |
3694 | { | |
95160752 | 3695 | unsigned index; |
76860b5f | 3696 | int init_p; |
030f20e1 AC |
3697 | gdbarch_data_pre_init_ftype *pre_init; |
3698 | gdbarch_data_post_init_ftype *post_init; | |
0f71a2f6 JM |
3699 | }; |
3700 | ||
3701 | struct gdbarch_data_registration | |
adf40b2e | 3702 | { |
adf40b2e JM |
3703 | struct gdbarch_data *data; |
3704 | struct gdbarch_data_registration *next; | |
3705 | }; | |
0f71a2f6 | 3706 | |
be5a57e1 | 3707 | struct gdbarch_data_registry |
adf40b2e | 3708 | { |
95160752 | 3709 | unsigned nr; |
adf40b2e JM |
3710 | struct gdbarch_data_registration *registrations; |
3711 | }; | |
0f71a2f6 | 3712 | |
be5a57e1 | 3713 | struct gdbarch_data_registry gdbarch_data_registry = |
0f71a2f6 JM |
3714 | { |
3715 | 0, NULL, | |
3716 | }; | |
3717 | ||
030f20e1 AC |
3718 | static struct gdbarch_data * |
3719 | gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init, | |
3720 | gdbarch_data_post_init_ftype *post_init) | |
0f71a2f6 JM |
3721 | { |
3722 | struct gdbarch_data_registration **curr; | |
76860b5f | 3723 | /* Append the new registraration. */ |
be5a57e1 | 3724 | for (curr = &gdbarch_data_registry.registrations; |
0f71a2f6 JM |
3725 | (*curr) != NULL; |
3726 | curr = &(*curr)->next); | |
3727 | (*curr) = XMALLOC (struct gdbarch_data_registration); | |
3728 | (*curr)->next = NULL; | |
0f71a2f6 | 3729 | (*curr)->data = XMALLOC (struct gdbarch_data); |
be5a57e1 | 3730 | (*curr)->data->index = gdbarch_data_registry.nr++; |
030f20e1 AC |
3731 | (*curr)->data->pre_init = pre_init; |
3732 | (*curr)->data->post_init = post_init; | |
76860b5f | 3733 | (*curr)->data->init_p = 1; |
0f71a2f6 JM |
3734 | return (*curr)->data; |
3735 | } | |
3736 | ||
030f20e1 AC |
3737 | struct gdbarch_data * |
3738 | gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init) | |
3739 | { | |
3740 | return gdbarch_data_register (pre_init, NULL); | |
3741 | } | |
3742 | ||
3743 | struct gdbarch_data * | |
3744 | gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init) | |
3745 | { | |
3746 | return gdbarch_data_register (NULL, post_init); | |
3747 | } | |
0f71a2f6 | 3748 | |
b3cc3077 | 3749 | /* Create/delete the gdbarch data vector. */ |
95160752 AC |
3750 | |
3751 | static void | |
b3cc3077 | 3752 | alloc_gdbarch_data (struct gdbarch *gdbarch) |
95160752 | 3753 | { |
b3cc3077 JB |
3754 | gdb_assert (gdbarch->data == NULL); |
3755 | gdbarch->nr_data = gdbarch_data_registry.nr; | |
aebd7893 | 3756 | gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *); |
0f71a2f6 JM |
3757 | } |
3758 | ||
76860b5f | 3759 | /* Initialize the current value of the specified per-architecture |
b3cc3077 JB |
3760 | data-pointer. */ |
3761 | ||
95160752 | 3762 | void |
030f20e1 AC |
3763 | deprecated_set_gdbarch_data (struct gdbarch *gdbarch, |
3764 | struct gdbarch_data *data, | |
3765 | void *pointer) | |
95160752 AC |
3766 | { |
3767 | gdb_assert (data->index < gdbarch->nr_data); | |
aebd7893 | 3768 | gdb_assert (gdbarch->data[data->index] == NULL); |
030f20e1 | 3769 | gdb_assert (data->pre_init == NULL); |
95160752 AC |
3770 | gdbarch->data[data->index] = pointer; |
3771 | } | |
3772 | ||
0f71a2f6 JM |
3773 | /* Return the current value of the specified per-architecture |
3774 | data-pointer. */ | |
3775 | ||
3776 | void * | |
451fbdda | 3777 | gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data) |
0f71a2f6 | 3778 | { |
451fbdda | 3779 | gdb_assert (data->index < gdbarch->nr_data); |
030f20e1 | 3780 | if (gdbarch->data[data->index] == NULL) |
76860b5f | 3781 | { |
030f20e1 AC |
3782 | /* The data-pointer isn't initialized, call init() to get a |
3783 | value. */ | |
3784 | if (data->pre_init != NULL) | |
3785 | /* Mid architecture creation: pass just the obstack, and not | |
3786 | the entire architecture, as that way it isn't possible for | |
3787 | pre-init code to refer to undefined architecture | |
3788 | fields. */ | |
3789 | gdbarch->data[data->index] = data->pre_init (gdbarch->obstack); | |
3790 | else if (gdbarch->initialized_p | |
3791 | && data->post_init != NULL) | |
3792 | /* Post architecture creation: pass the entire architecture | |
3793 | (as all fields are valid), but be careful to also detect | |
3794 | recursive references. */ | |
3795 | { | |
3796 | gdb_assert (data->init_p); | |
3797 | data->init_p = 0; | |
3798 | gdbarch->data[data->index] = data->post_init (gdbarch); | |
3799 | data->init_p = 1; | |
3800 | } | |
3801 | else | |
3802 | /* The architecture initialization hasn't completed - punt - | |
3803 | hope that the caller knows what they are doing. Once | |
3804 | deprecated_set_gdbarch_data has been initialized, this can be | |
3805 | changed to an internal error. */ | |
3806 | return NULL; | |
76860b5f AC |
3807 | gdb_assert (gdbarch->data[data->index] != NULL); |
3808 | } | |
451fbdda | 3809 | return gdbarch->data[data->index]; |
0f71a2f6 JM |
3810 | } |
3811 | ||
3812 | ||
3813 | ||
be5a57e1 | 3814 | /* Keep a registry of swapped data required by GDB modules. */ |
0f71a2f6 JM |
3815 | |
3816 | struct gdbarch_swap | |
3817 | { | |
3818 | void *swap; | |
3819 | struct gdbarch_swap_registration *source; | |
3820 | struct gdbarch_swap *next; | |
3821 | }; | |
3822 | ||
3823 | struct gdbarch_swap_registration | |
adf40b2e JM |
3824 | { |
3825 | void *data; | |
3826 | unsigned long sizeof_data; | |
3827 | gdbarch_swap_ftype *init; | |
3828 | struct gdbarch_swap_registration *next; | |
3829 | }; | |
0f71a2f6 | 3830 | |
be5a57e1 | 3831 | struct gdbarch_swap_registry |
adf40b2e JM |
3832 | { |
3833 | int nr; | |
3834 | struct gdbarch_swap_registration *registrations; | |
3835 | }; | |
0f71a2f6 | 3836 | |
be5a57e1 | 3837 | struct gdbarch_swap_registry gdbarch_swap_registry = |
0f71a2f6 JM |
3838 | { |
3839 | 0, NULL, | |
3840 | }; | |
3841 | ||
3842 | void | |
046a4708 AC |
3843 | deprecated_register_gdbarch_swap (void *data, |
3844 | unsigned long sizeof_data, | |
3845 | gdbarch_swap_ftype *init) | |
0f71a2f6 JM |
3846 | { |
3847 | struct gdbarch_swap_registration **rego; | |
be5a57e1 | 3848 | for (rego = &gdbarch_swap_registry.registrations; |
0f71a2f6 JM |
3849 | (*rego) != NULL; |
3850 | rego = &(*rego)->next); | |
3851 | (*rego) = XMALLOC (struct gdbarch_swap_registration); | |
3852 | (*rego)->next = NULL; | |
3853 | (*rego)->init = init; | |
3854 | (*rego)->data = data; | |
3855 | (*rego)->sizeof_data = sizeof_data; | |
3856 | } | |
3857 | ||
40af4b0c | 3858 | static void |
7de2341d | 3859 | current_gdbarch_swap_init_hack (void) |
0f71a2f6 JM |
3860 | { |
3861 | struct gdbarch_swap_registration *rego; | |
7de2341d | 3862 | struct gdbarch_swap **curr = ¤t_gdbarch->swap; |
be5a57e1 | 3863 | for (rego = gdbarch_swap_registry.registrations; |
0f71a2f6 JM |
3864 | rego != NULL; |
3865 | rego = rego->next) | |
3866 | { | |
3867 | if (rego->data != NULL) | |
3868 | { | |
7de2341d AC |
3869 | (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch, |
3870 | struct gdbarch_swap); | |
0f71a2f6 | 3871 | (*curr)->source = rego; |
7de2341d AC |
3872 | (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch, |
3873 | rego->sizeof_data); | |
0f71a2f6 | 3874 | (*curr)->next = NULL; |
0f71a2f6 JM |
3875 | curr = &(*curr)->next; |
3876 | } | |
3877 | if (rego->init != NULL) | |
3878 | rego->init (); | |
3879 | } | |
3880 | } | |
3881 | ||
7de2341d AC |
3882 | static struct gdbarch * |
3883 | current_gdbarch_swap_out_hack (void) | |
0f71a2f6 | 3884 | { |
7de2341d | 3885 | struct gdbarch *old_gdbarch = current_gdbarch; |
0f71a2f6 | 3886 | struct gdbarch_swap *curr; |
7de2341d AC |
3887 | |
3888 | gdb_assert (old_gdbarch != NULL); | |
3889 | for (curr = old_gdbarch->swap; | |
0f71a2f6 JM |
3890 | curr != NULL; |
3891 | curr = curr->next) | |
7de2341d AC |
3892 | { |
3893 | memcpy (curr->swap, curr->source->data, curr->source->sizeof_data); | |
3894 | memset (curr->source->data, 0, curr->source->sizeof_data); | |
3895 | } | |
3896 | current_gdbarch = NULL; | |
3897 | return old_gdbarch; | |
0f71a2f6 JM |
3898 | } |
3899 | ||
0f71a2f6 | 3900 | static void |
7de2341d | 3901 | current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch) |
0f71a2f6 JM |
3902 | { |
3903 | struct gdbarch_swap *curr; | |
7de2341d AC |
3904 | |
3905 | gdb_assert (current_gdbarch == NULL); | |
3906 | for (curr = new_gdbarch->swap; | |
0f71a2f6 JM |
3907 | curr != NULL; |
3908 | curr = curr->next) | |
3909 | memcpy (curr->source->data, curr->swap, curr->source->sizeof_data); | |
7de2341d | 3910 | current_gdbarch = new_gdbarch; |
0f71a2f6 JM |
3911 | } |
3912 | ||
3913 | ||
be5a57e1 | 3914 | /* Keep a registry of the architectures known by GDB. */ |
0f71a2f6 | 3915 | |
4b9b3959 | 3916 | struct gdbarch_registration |
0f71a2f6 JM |
3917 | { |
3918 | enum bfd_architecture bfd_architecture; | |
3919 | gdbarch_init_ftype *init; | |
4b9b3959 | 3920 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 3921 | struct gdbarch_list *arches; |
4b9b3959 | 3922 | struct gdbarch_registration *next; |
0f71a2f6 JM |
3923 | }; |
3924 | ||
be5a57e1 | 3925 | static struct gdbarch_registration *gdbarch_registry = NULL; |
0f71a2f6 | 3926 | |
b4a20239 AC |
3927 | static void |
3928 | append_name (const char ***buf, int *nr, const char *name) | |
3929 | { | |
3930 | *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1)); | |
3931 | (*buf)[*nr] = name; | |
3932 | *nr += 1; | |
3933 | } | |
3934 | ||
3935 | const char ** | |
3936 | gdbarch_printable_names (void) | |
3937 | { | |
7996bcec AC |
3938 | /* Accumulate a list of names based on the registed list of |
3939 | architectures. */ | |
3940 | enum bfd_architecture a; | |
3941 | int nr_arches = 0; | |
3942 | const char **arches = NULL; | |
3943 | struct gdbarch_registration *rego; | |
3944 | for (rego = gdbarch_registry; | |
3945 | rego != NULL; | |
3946 | rego = rego->next) | |
b4a20239 | 3947 | { |
7996bcec AC |
3948 | const struct bfd_arch_info *ap; |
3949 | ap = bfd_lookup_arch (rego->bfd_architecture, 0); | |
3950 | if (ap == NULL) | |
3951 | internal_error (__FILE__, __LINE__, | |
3952 | "gdbarch_architecture_names: multi-arch unknown"); | |
3953 | do | |
3954 | { | |
3955 | append_name (&arches, &nr_arches, ap->printable_name); | |
3956 | ap = ap->next; | |
3957 | } | |
3958 | while (ap != NULL); | |
b4a20239 | 3959 | } |
7996bcec AC |
3960 | append_name (&arches, &nr_arches, NULL); |
3961 | return arches; | |
b4a20239 AC |
3962 | } |
3963 | ||
3964 | ||
0f71a2f6 | 3965 | void |
4b9b3959 AC |
3966 | gdbarch_register (enum bfd_architecture bfd_architecture, |
3967 | gdbarch_init_ftype *init, | |
3968 | gdbarch_dump_tdep_ftype *dump_tdep) | |
0f71a2f6 | 3969 | { |
4b9b3959 | 3970 | struct gdbarch_registration **curr; |
0f71a2f6 | 3971 | const struct bfd_arch_info *bfd_arch_info; |
ec3d358c | 3972 | /* Check that BFD recognizes this architecture */ |
0f71a2f6 JM |
3973 | bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); |
3974 | if (bfd_arch_info == NULL) | |
3975 | { | |
8e65ff28 AC |
3976 | internal_error (__FILE__, __LINE__, |
3977 | "gdbarch: Attempt to register unknown architecture (%d)", | |
3978 | bfd_architecture); | |
0f71a2f6 JM |
3979 | } |
3980 | /* Check that we haven't seen this architecture before */ | |
be5a57e1 | 3981 | for (curr = &gdbarch_registry; |
0f71a2f6 JM |
3982 | (*curr) != NULL; |
3983 | curr = &(*curr)->next) | |
3984 | { | |
3985 | if (bfd_architecture == (*curr)->bfd_architecture) | |
8e65ff28 AC |
3986 | internal_error (__FILE__, __LINE__, |
3987 | "gdbarch: Duplicate registraration of architecture (%s)", | |
3988 | bfd_arch_info->printable_name); | |
0f71a2f6 JM |
3989 | } |
3990 | /* log it */ | |
3991 | if (gdbarch_debug) | |
3992 | fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n", | |
3993 | bfd_arch_info->printable_name, | |
3994 | (long) init); | |
3995 | /* Append it */ | |
4b9b3959 | 3996 | (*curr) = XMALLOC (struct gdbarch_registration); |
0f71a2f6 JM |
3997 | (*curr)->bfd_architecture = bfd_architecture; |
3998 | (*curr)->init = init; | |
4b9b3959 | 3999 | (*curr)->dump_tdep = dump_tdep; |
0f71a2f6 JM |
4000 | (*curr)->arches = NULL; |
4001 | (*curr)->next = NULL; | |
4b9b3959 AC |
4002 | } |
4003 | ||
4004 | void | |
4005 | register_gdbarch_init (enum bfd_architecture bfd_architecture, | |
4006 | gdbarch_init_ftype *init) | |
4007 | { | |
4008 | gdbarch_register (bfd_architecture, init, NULL); | |
0f71a2f6 | 4009 | } |
0f71a2f6 JM |
4010 | |
4011 | ||
4012 | /* Look for an architecture using gdbarch_info. Base search on only | |
4013 | BFD_ARCH_INFO and BYTE_ORDER. */ | |
4014 | ||
4015 | struct gdbarch_list * | |
104c1213 JM |
4016 | gdbarch_list_lookup_by_info (struct gdbarch_list *arches, |
4017 | const struct gdbarch_info *info) | |
0f71a2f6 JM |
4018 | { |
4019 | for (; arches != NULL; arches = arches->next) | |
4020 | { | |
4021 | if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info) | |
4022 | continue; | |
4023 | if (info->byte_order != arches->gdbarch->byte_order) | |
4024 | continue; | |
4be87837 DJ |
4025 | if (info->osabi != arches->gdbarch->osabi) |
4026 | continue; | |
0f71a2f6 JM |
4027 | return arches; |
4028 | } | |
4029 | return NULL; | |
4030 | } | |
4031 | ||
4032 | ||
ebdba546 AC |
4033 | /* Find an architecture that matches the specified INFO. Create a new |
4034 | architecture if needed. Return that new architecture. Assumes | |
4035 | that there is no current architecture. */ | |
0f71a2f6 | 4036 | |
ebdba546 AC |
4037 | static struct gdbarch * |
4038 | find_arch_by_info (struct gdbarch *old_gdbarch, struct gdbarch_info info) | |
0f71a2f6 JM |
4039 | { |
4040 | struct gdbarch *new_gdbarch; | |
4b9b3959 | 4041 | struct gdbarch_registration *rego; |
0f71a2f6 | 4042 | |
ebdba546 AC |
4043 | /* The existing architecture has been swapped out - all this code |
4044 | works from a clean slate. */ | |
4045 | gdb_assert (current_gdbarch == NULL); | |
4046 | ||
b732d07d | 4047 | /* Fill in missing parts of the INFO struct using a number of |
ebdba546 AC |
4048 | sources: "set ..."; INFOabfd supplied; and the existing |
4049 | architecture. */ | |
4050 | gdbarch_info_fill (old_gdbarch, &info); | |
4be87837 | 4051 | |
b732d07d AC |
4052 | /* Must have found some sort of architecture. */ |
4053 | gdb_assert (info.bfd_arch_info != NULL); | |
0f71a2f6 JM |
4054 | |
4055 | if (gdbarch_debug) | |
4056 | { | |
0f71a2f6 | 4057 | fprintf_unfiltered (gdb_stdlog, |
ebdba546 | 4058 | "find_arch_by_info: info.bfd_arch_info %s\n", |
0f71a2f6 JM |
4059 | (info.bfd_arch_info != NULL |
4060 | ? info.bfd_arch_info->printable_name | |
4061 | : "(null)")); | |
4062 | fprintf_unfiltered (gdb_stdlog, | |
ebdba546 | 4063 | "find_arch_by_info: info.byte_order %d (%s)\n", |
0f71a2f6 | 4064 | info.byte_order, |
d7449b42 | 4065 | (info.byte_order == BFD_ENDIAN_BIG ? "big" |
778eb05e | 4066 | : info.byte_order == BFD_ENDIAN_LITTLE ? "little" |
0f71a2f6 | 4067 | : "default")); |
4be87837 | 4068 | fprintf_unfiltered (gdb_stdlog, |
ebdba546 | 4069 | "find_arch_by_info: info.osabi %d (%s)\n", |
4be87837 | 4070 | info.osabi, gdbarch_osabi_name (info.osabi)); |
0f71a2f6 | 4071 | fprintf_unfiltered (gdb_stdlog, |
ebdba546 | 4072 | "find_arch_by_info: info.abfd 0x%lx\n", |
0f71a2f6 JM |
4073 | (long) info.abfd); |
4074 | fprintf_unfiltered (gdb_stdlog, | |
ebdba546 | 4075 | "find_arch_by_info: info.tdep_info 0x%lx\n", |
0f71a2f6 JM |
4076 | (long) info.tdep_info); |
4077 | } | |
4078 | ||
ebdba546 | 4079 | /* Find the tdep code that knows about this architecture. */ |
b732d07d AC |
4080 | for (rego = gdbarch_registry; |
4081 | rego != NULL; | |
4082 | rego = rego->next) | |
4083 | if (rego->bfd_architecture == info.bfd_arch_info->arch) | |
4084 | break; | |
4085 | if (rego == NULL) | |
4086 | { | |
4087 | if (gdbarch_debug) | |
ebdba546 AC |
4088 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
4089 | "No matching architecture\n"); | |
b732d07d AC |
4090 | return 0; |
4091 | } | |
4092 | ||
ebdba546 | 4093 | /* Ask the tdep code for an architecture that matches "info". */ |
0f71a2f6 JM |
4094 | new_gdbarch = rego->init (info, rego->arches); |
4095 | ||
ebdba546 AC |
4096 | /* Did the tdep code like it? No. Reject the change and revert to |
4097 | the old architecture. */ | |
0f71a2f6 JM |
4098 | if (new_gdbarch == NULL) |
4099 | { | |
4100 | if (gdbarch_debug) | |
ebdba546 AC |
4101 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
4102 | "Target rejected architecture\n"); | |
4103 | return NULL; | |
0f71a2f6 JM |
4104 | } |
4105 | ||
ebdba546 AC |
4106 | /* Is this a pre-existing architecture (as determined by already |
4107 | being initialized)? Move it to the front of the architecture | |
4108 | list (keeping the list sorted Most Recently Used). */ | |
4109 | if (new_gdbarch->initialized_p) | |
0f71a2f6 | 4110 | { |
ebdba546 AC |
4111 | struct gdbarch_list **list; |
4112 | struct gdbarch_list *this; | |
0f71a2f6 | 4113 | if (gdbarch_debug) |
ebdba546 AC |
4114 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
4115 | "Previous architecture 0x%08lx (%s) selected\n", | |
0f71a2f6 JM |
4116 | (long) new_gdbarch, |
4117 | new_gdbarch->bfd_arch_info->printable_name); | |
ebdba546 AC |
4118 | /* Find the existing arch in the list. */ |
4119 | for (list = ®o->arches; | |
4120 | (*list) != NULL && (*list)->gdbarch != new_gdbarch; | |
4121 | list = &(*list)->next); | |
4122 | /* It had better be in the list of architectures. */ | |
4123 | gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch); | |
4124 | /* Unlink THIS. */ | |
4125 | this = (*list); | |
4126 | (*list) = this->next; | |
4127 | /* Insert THIS at the front. */ | |
4128 | this->next = rego->arches; | |
4129 | rego->arches = this; | |
4130 | /* Return it. */ | |
4131 | return new_gdbarch; | |
0f71a2f6 JM |
4132 | } |
4133 | ||
ebdba546 AC |
4134 | /* It's a new architecture. */ |
4135 | if (gdbarch_debug) | |
4136 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " | |
4137 | "New architecture 0x%08lx (%s) selected\n", | |
4138 | (long) new_gdbarch, | |
4139 | new_gdbarch->bfd_arch_info->printable_name); | |
4140 | ||
4141 | /* Insert the new architecture into the front of the architecture | |
4142 | list (keep the list sorted Most Recently Used). */ | |
0f79675b AC |
4143 | { |
4144 | struct gdbarch_list *this = XMALLOC (struct gdbarch_list); | |
4145 | this->next = rego->arches; | |
4146 | this->gdbarch = new_gdbarch; | |
4147 | rego->arches = this; | |
4148 | } | |
0f71a2f6 | 4149 | |
4b9b3959 AC |
4150 | /* Check that the newly installed architecture is valid. Plug in |
4151 | any post init values. */ | |
4152 | new_gdbarch->dump_tdep = rego->dump_tdep; | |
0f71a2f6 | 4153 | verify_gdbarch (new_gdbarch); |
ebdba546 | 4154 | new_gdbarch->initialized_p = 1; |
0f71a2f6 | 4155 | |
ebdba546 AC |
4156 | /* Initialize any per-architecture swap areas. This phase requires |
4157 | a valid global CURRENT_GDBARCH. Set it momentarially, and then | |
4158 | swap the entire architecture out. */ | |
4159 | current_gdbarch = new_gdbarch; | |
7de2341d | 4160 | current_gdbarch_swap_init_hack (); |
ebdba546 | 4161 | current_gdbarch_swap_out_hack (); |
67c2c32c | 4162 | |
4b9b3959 | 4163 | if (gdbarch_debug) |
ebdba546 | 4164 | gdbarch_dump (new_gdbarch, gdb_stdlog); |
4b9b3959 | 4165 | |
ebdba546 | 4166 | return new_gdbarch; |
0f71a2f6 | 4167 | } |
c906108c | 4168 | |
ebdba546 AC |
4169 | struct gdbarch * |
4170 | gdbarch_find_by_info (struct gdbarch_info info) | |
4171 | { | |
4172 | /* Save the previously selected architecture, setting the global to | |
4173 | NULL. This stops things like gdbarch->init() trying to use the | |
4174 | previous architecture's configuration. The previous architecture | |
4175 | may not even be of the same architecture family. The most recent | |
4176 | architecture of the same family is found at the head of the | |
4177 | rego->arches list. */ | |
4178 | struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack (); | |
4179 | ||
4180 | /* Find the specified architecture. */ | |
4181 | struct gdbarch *new_gdbarch = find_arch_by_info (old_gdbarch, info); | |
4182 | ||
4183 | /* Restore the existing architecture. */ | |
4184 | gdb_assert (current_gdbarch == NULL); | |
4185 | current_gdbarch_swap_in_hack (old_gdbarch); | |
4186 | ||
4187 | return new_gdbarch; | |
4188 | } | |
4189 | ||
4190 | /* Make the specified architecture current, swapping the existing one | |
4191 | out. */ | |
4192 | ||
4193 | void | |
4194 | deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch) | |
4195 | { | |
4196 | gdb_assert (new_gdbarch != NULL); | |
4197 | gdb_assert (current_gdbarch != NULL); | |
4198 | gdb_assert (new_gdbarch->initialized_p); | |
4199 | current_gdbarch_swap_out_hack (); | |
4200 | current_gdbarch_swap_in_hack (new_gdbarch); | |
4201 | architecture_changed_event (); | |
4202 | } | |
c906108c | 4203 | |
104c1213 | 4204 | extern void _initialize_gdbarch (void); |
b4a20239 | 4205 | |
c906108c | 4206 | void |
7c7651b2 | 4207 | _initialize_gdbarch (void) |
c906108c | 4208 | { |
5d161b24 DB |
4209 | struct cmd_list_element *c; |
4210 | ||
cb1a6d5f AC |
4211 | deprecated_add_show_from_set |
4212 | (add_set_cmd ("arch", | |
4213 | class_maintenance, | |
4214 | var_zinteger, | |
4215 | (char *)&gdbarch_debug, | |
4216 | "Set architecture debugging.\n\ | |
5d161b24 | 4217 | When non-zero, architecture debugging is enabled.", &setdebuglist), |
cb1a6d5f | 4218 | &showdebuglist); |
59233f88 AC |
4219 | c = add_set_cmd ("archdebug", |
4220 | class_maintenance, | |
4221 | var_zinteger, | |
4222 | (char *)&gdbarch_debug, | |
4223 | "Set architecture debugging.\n\ | |
5d161b24 DB |
4224 | When non-zero, architecture debugging is enabled.", &setlist); |
4225 | ||
59233f88 | 4226 | deprecate_cmd (c, "set debug arch"); |
cb1a6d5f | 4227 | deprecate_cmd (deprecated_add_show_from_set (c, &showlist), "show debug arch"); |
c906108c | 4228 | } |