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