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