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