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