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