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