| 1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
| 2 | |
| 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
| 4 | Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
| 5 | |
| 6 | This file is part of GDB. |
| 7 | |
| 8 | This program is free software; you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation; either version 2 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program; if not, write to the Free Software |
| 20 | Foundation, Inc., 59 Temple Place - Suite 330, |
| 21 | Boston, MA 02111-1307, USA. */ |
| 22 | |
| 23 | /* This file was created with the aid of ``gdbarch.sh''. |
| 24 | |
| 25 | The Bourne shell script ``gdbarch.sh'' creates the files |
| 26 | ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them |
| 27 | against the existing ``gdbarch.[hc]''. Any differences found |
| 28 | being reported. |
| 29 | |
| 30 | If editing this file, please also run gdbarch.sh and merge any |
| 31 | changes into that script. Conversely, when making sweeping changes |
| 32 | to this file, modifying gdbarch.sh and using its output may prove |
| 33 | easier. */ |
| 34 | |
| 35 | |
| 36 | #include "defs.h" |
| 37 | #include "arch-utils.h" |
| 38 | |
| 39 | #if GDB_MULTI_ARCH |
| 40 | #include "gdbcmd.h" |
| 41 | #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */ |
| 42 | #else |
| 43 | /* Just include everything in sight so that the every old definition |
| 44 | of macro is visible. */ |
| 45 | #include "gdb_string.h" |
| 46 | #include <ctype.h> |
| 47 | #include "symtab.h" |
| 48 | #include "frame.h" |
| 49 | #include "inferior.h" |
| 50 | #include "breakpoint.h" |
| 51 | #include "gdb_wait.h" |
| 52 | #include "gdbcore.h" |
| 53 | #include "gdbcmd.h" |
| 54 | #include "target.h" |
| 55 | #include "gdbthread.h" |
| 56 | #include "annotate.h" |
| 57 | #include "symfile.h" /* for overlay functions */ |
| 58 | #include "value.h" /* For old tm.h/nm.h macros. */ |
| 59 | #endif |
| 60 | #include "symcat.h" |
| 61 | |
| 62 | #include "floatformat.h" |
| 63 | |
| 64 | #include "gdb_assert.h" |
| 65 | #include "gdb-events.h" |
| 66 | |
| 67 | /* Static function declarations */ |
| 68 | |
| 69 | static void verify_gdbarch (struct gdbarch *gdbarch); |
| 70 | static void alloc_gdbarch_data (struct gdbarch *); |
| 71 | static void init_gdbarch_data (struct gdbarch *); |
| 72 | static void free_gdbarch_data (struct gdbarch *); |
| 73 | static void init_gdbarch_swap (struct gdbarch *); |
| 74 | static void swapout_gdbarch_swap (struct gdbarch *); |
| 75 | static void swapin_gdbarch_swap (struct gdbarch *); |
| 76 | |
| 77 | /* Convenience macro for allocting typesafe memory. */ |
| 78 | |
| 79 | #ifndef XMALLOC |
| 80 | #define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE)) |
| 81 | #endif |
| 82 | |
| 83 | |
| 84 | /* Non-zero if we want to trace architecture code. */ |
| 85 | |
| 86 | #ifndef GDBARCH_DEBUG |
| 87 | #define GDBARCH_DEBUG 0 |
| 88 | #endif |
| 89 | int gdbarch_debug = GDBARCH_DEBUG; |
| 90 | |
| 91 | |
| 92 | /* Maintain the struct gdbarch object */ |
| 93 | |
| 94 | struct gdbarch |
| 95 | { |
| 96 | /* basic architectural information */ |
| 97 | const struct bfd_arch_info * bfd_arch_info; |
| 98 | int byte_order; |
| 99 | |
| 100 | /* target specific vector. */ |
| 101 | struct gdbarch_tdep *tdep; |
| 102 | gdbarch_dump_tdep_ftype *dump_tdep; |
| 103 | |
| 104 | /* per-architecture data-pointers */ |
| 105 | unsigned nr_data; |
| 106 | void **data; |
| 107 | |
| 108 | /* per-architecture swap-regions */ |
| 109 | struct gdbarch_swap *swap; |
| 110 | |
| 111 | /* Multi-arch values. |
| 112 | |
| 113 | When extending this structure you must: |
| 114 | |
| 115 | Add the field below. |
| 116 | |
| 117 | Declare set/get functions and define the corresponding |
| 118 | macro in gdbarch.h. |
| 119 | |
| 120 | gdbarch_alloc(): If zero/NULL is not a suitable default, |
| 121 | initialize the new field. |
| 122 | |
| 123 | verify_gdbarch(): Confirm that the target updated the field |
| 124 | correctly. |
| 125 | |
| 126 | gdbarch_dump(): Add a fprintf_unfiltered call so that the new |
| 127 | field is dumped out |
| 128 | |
| 129 | ``startup_gdbarch()'': Append an initial value to the static |
| 130 | variable (base values on the host's c-type system). |
| 131 | |
| 132 | get_gdbarch(): Implement the set/get functions (probably using |
| 133 | the macro's as shortcuts). |
| 134 | |
| 135 | */ |
| 136 | |
| 137 | int short_bit; |
| 138 | int int_bit; |
| 139 | int long_bit; |
| 140 | int long_long_bit; |
| 141 | int float_bit; |
| 142 | int double_bit; |
| 143 | int long_double_bit; |
| 144 | int ptr_bit; |
| 145 | int addr_bit; |
| 146 | int bfd_vma_bit; |
| 147 | int char_signed; |
| 148 | gdbarch_read_pc_ftype *read_pc; |
| 149 | gdbarch_write_pc_ftype *write_pc; |
| 150 | gdbarch_read_fp_ftype *read_fp; |
| 151 | gdbarch_write_fp_ftype *write_fp; |
| 152 | gdbarch_read_sp_ftype *read_sp; |
| 153 | gdbarch_write_sp_ftype *write_sp; |
| 154 | gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; |
| 155 | gdbarch_register_read_ftype *register_read; |
| 156 | gdbarch_register_write_ftype *register_write; |
| 157 | int num_regs; |
| 158 | int num_pseudo_regs; |
| 159 | int sp_regnum; |
| 160 | int fp_regnum; |
| 161 | int pc_regnum; |
| 162 | int fp0_regnum; |
| 163 | int npc_regnum; |
| 164 | int nnpc_regnum; |
| 165 | gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum; |
| 166 | gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum; |
| 167 | gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum; |
| 168 | gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum; |
| 169 | gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum; |
| 170 | gdbarch_register_name_ftype *register_name; |
| 171 | int register_size; |
| 172 | int register_bytes; |
| 173 | gdbarch_register_byte_ftype *register_byte; |
| 174 | gdbarch_register_raw_size_ftype *register_raw_size; |
| 175 | int max_register_raw_size; |
| 176 | gdbarch_register_virtual_size_ftype *register_virtual_size; |
| 177 | int max_register_virtual_size; |
| 178 | gdbarch_register_virtual_type_ftype *register_virtual_type; |
| 179 | gdbarch_do_registers_info_ftype *do_registers_info; |
| 180 | gdbarch_print_float_info_ftype *print_float_info; |
| 181 | gdbarch_register_sim_regno_ftype *register_sim_regno; |
| 182 | gdbarch_register_bytes_ok_ftype *register_bytes_ok; |
| 183 | gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; |
| 184 | gdbarch_cannot_store_register_ftype *cannot_store_register; |
| 185 | gdbarch_get_longjmp_target_ftype *get_longjmp_target; |
| 186 | int use_generic_dummy_frames; |
| 187 | int call_dummy_location; |
| 188 | gdbarch_call_dummy_address_ftype *call_dummy_address; |
| 189 | CORE_ADDR call_dummy_start_offset; |
| 190 | CORE_ADDR call_dummy_breakpoint_offset; |
| 191 | int call_dummy_breakpoint_offset_p; |
| 192 | int call_dummy_length; |
| 193 | gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy; |
| 194 | int call_dummy_p; |
| 195 | LONGEST * call_dummy_words; |
| 196 | int sizeof_call_dummy_words; |
| 197 | int call_dummy_stack_adjust_p; |
| 198 | int call_dummy_stack_adjust; |
| 199 | gdbarch_fix_call_dummy_ftype *fix_call_dummy; |
| 200 | gdbarch_init_frame_pc_first_ftype *init_frame_pc_first; |
| 201 | gdbarch_init_frame_pc_ftype *init_frame_pc; |
| 202 | int believe_pcc_promotion; |
| 203 | int believe_pcc_promotion_type; |
| 204 | gdbarch_coerce_float_to_double_ftype *coerce_float_to_double; |
| 205 | gdbarch_get_saved_register_ftype *get_saved_register; |
| 206 | gdbarch_register_convertible_ftype *register_convertible; |
| 207 | gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual; |
| 208 | gdbarch_register_convert_to_raw_ftype *register_convert_to_raw; |
| 209 | gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register; |
| 210 | gdbarch_store_pseudo_register_ftype *store_pseudo_register; |
| 211 | gdbarch_pointer_to_address_ftype *pointer_to_address; |
| 212 | gdbarch_address_to_pointer_ftype *address_to_pointer; |
| 213 | gdbarch_integer_to_address_ftype *integer_to_address; |
| 214 | gdbarch_return_value_on_stack_ftype *return_value_on_stack; |
| 215 | gdbarch_extract_return_value_ftype *extract_return_value; |
| 216 | gdbarch_push_arguments_ftype *push_arguments; |
| 217 | gdbarch_push_dummy_frame_ftype *push_dummy_frame; |
| 218 | gdbarch_push_return_address_ftype *push_return_address; |
| 219 | gdbarch_pop_frame_ftype *pop_frame; |
| 220 | gdbarch_store_struct_return_ftype *store_struct_return; |
| 221 | gdbarch_store_return_value_ftype *store_return_value; |
| 222 | gdbarch_extract_struct_value_address_ftype *extract_struct_value_address; |
| 223 | gdbarch_use_struct_convention_ftype *use_struct_convention; |
| 224 | gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs; |
| 225 | gdbarch_init_extra_frame_info_ftype *init_extra_frame_info; |
| 226 | gdbarch_skip_prologue_ftype *skip_prologue; |
| 227 | gdbarch_prologue_frameless_p_ftype *prologue_frameless_p; |
| 228 | gdbarch_inner_than_ftype *inner_than; |
| 229 | gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; |
| 230 | gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; |
| 231 | gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint; |
| 232 | CORE_ADDR decr_pc_after_break; |
| 233 | gdbarch_prepare_to_proceed_ftype *prepare_to_proceed; |
| 234 | CORE_ADDR function_start_offset; |
| 235 | gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address; |
| 236 | CORE_ADDR frame_args_skip; |
| 237 | gdbarch_frameless_function_invocation_ftype *frameless_function_invocation; |
| 238 | gdbarch_frame_chain_ftype *frame_chain; |
| 239 | gdbarch_frame_chain_valid_ftype *frame_chain_valid; |
| 240 | gdbarch_frame_saved_pc_ftype *frame_saved_pc; |
| 241 | gdbarch_frame_args_address_ftype *frame_args_address; |
| 242 | gdbarch_frame_locals_address_ftype *frame_locals_address; |
| 243 | gdbarch_saved_pc_after_call_ftype *saved_pc_after_call; |
| 244 | gdbarch_frame_num_args_ftype *frame_num_args; |
| 245 | gdbarch_stack_align_ftype *stack_align; |
| 246 | int extra_stack_alignment_needed; |
| 247 | gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr; |
| 248 | gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos; |
| 249 | int parm_boundary; |
| 250 | const struct floatformat * float_format; |
| 251 | const struct floatformat * double_format; |
| 252 | const struct floatformat * long_double_format; |
| 253 | gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr; |
| 254 | gdbarch_addr_bits_remove_ftype *addr_bits_remove; |
| 255 | gdbarch_smash_text_address_ftype *smash_text_address; |
| 256 | gdbarch_software_single_step_ftype *software_single_step; |
| 257 | gdbarch_print_insn_ftype *print_insn; |
| 258 | gdbarch_skip_trampoline_code_ftype *skip_trampoline_code; |
| 259 | gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline; |
| 260 | gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p; |
| 261 | gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments; |
| 262 | gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info; |
| 263 | gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special; |
| 264 | gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special; |
| 265 | }; |
| 266 | |
| 267 | |
| 268 | /* The default architecture uses host values (for want of a better |
| 269 | choice). */ |
| 270 | |
| 271 | extern const struct bfd_arch_info bfd_default_arch_struct; |
| 272 | |
| 273 | struct gdbarch startup_gdbarch = |
| 274 | { |
| 275 | /* basic architecture information */ |
| 276 | &bfd_default_arch_struct, |
| 277 | BFD_ENDIAN_BIG, |
| 278 | /* target specific vector and its dump routine */ |
| 279 | NULL, NULL, |
| 280 | /*per-architecture data-pointers and swap regions */ |
| 281 | 0, NULL, NULL, |
| 282 | /* Multi-arch values */ |
| 283 | 8 * sizeof (short), |
| 284 | 8 * sizeof (int), |
| 285 | 8 * sizeof (long), |
| 286 | 8 * sizeof (LONGEST), |
| 287 | 8 * sizeof (float), |
| 288 | 8 * sizeof (double), |
| 289 | 8 * sizeof (long double), |
| 290 | 8 * sizeof (void*), |
| 291 | 8 * sizeof (void*), |
| 292 | 8 * sizeof (void*), |
| 293 | 1, |
| 294 | 0, |
| 295 | 0, |
| 296 | 0, |
| 297 | 0, |
| 298 | 0, |
| 299 | 0, |
| 300 | 0, |
| 301 | 0, |
| 302 | 0, |
| 303 | 0, |
| 304 | 0, |
| 305 | 0, |
| 306 | 0, |
| 307 | 0, |
| 308 | 0, |
| 309 | 0, |
| 310 | 0, |
| 311 | 0, |
| 312 | 0, |
| 313 | 0, |
| 314 | 0, |
| 315 | 0, |
| 316 | 0, |
| 317 | 0, |
| 318 | 0, |
| 319 | 0, |
| 320 | generic_register_raw_size, |
| 321 | 0, |
| 322 | generic_register_virtual_size, |
| 323 | 0, |
| 324 | 0, |
| 325 | 0, |
| 326 | 0, |
| 327 | 0, |
| 328 | 0, |
| 329 | 0, |
| 330 | 0, |
| 331 | 0, |
| 332 | 0, |
| 333 | 0, |
| 334 | 0, |
| 335 | 0, |
| 336 | 0, |
| 337 | 0, |
| 338 | 0, |
| 339 | 0, |
| 340 | 0, |
| 341 | 0, |
| 342 | 0, |
| 343 | 0, |
| 344 | 0, |
| 345 | 0, |
| 346 | 0, |
| 347 | 0, |
| 348 | 0, |
| 349 | 0, |
| 350 | 0, |
| 351 | generic_get_saved_register, |
| 352 | 0, |
| 353 | 0, |
| 354 | 0, |
| 355 | 0, |
| 356 | 0, |
| 357 | 0, |
| 358 | 0, |
| 359 | 0, |
| 360 | 0, |
| 361 | 0, |
| 362 | 0, |
| 363 | 0, |
| 364 | 0, |
| 365 | 0, |
| 366 | 0, |
| 367 | 0, |
| 368 | 0, |
| 369 | 0, |
| 370 | 0, |
| 371 | 0, |
| 372 | 0, |
| 373 | 0, |
| 374 | 0, |
| 375 | 0, |
| 376 | 0, |
| 377 | 0, |
| 378 | 0, |
| 379 | 0, |
| 380 | 0, |
| 381 | 0, |
| 382 | 0, |
| 383 | 0, |
| 384 | 0, |
| 385 | 0, |
| 386 | 0, |
| 387 | 0, |
| 388 | 0, |
| 389 | 0, |
| 390 | 0, |
| 391 | 0, |
| 392 | 0, |
| 393 | 0, |
| 394 | 0, |
| 395 | 0, |
| 396 | 0, |
| 397 | 0, |
| 398 | 0, |
| 399 | 0, |
| 400 | 0, |
| 401 | 0, |
| 402 | 0, |
| 403 | 0, |
| 404 | 0, |
| 405 | 0, |
| 406 | generic_in_function_epilogue_p, |
| 407 | construct_inferior_arguments, |
| 408 | 0, |
| 409 | 0, |
| 410 | 0, |
| 411 | /* startup_gdbarch() */ |
| 412 | }; |
| 413 | |
| 414 | struct gdbarch *current_gdbarch = &startup_gdbarch; |
| 415 | |
| 416 | /* Do any initialization needed for a non-multiarch configuration |
| 417 | after the _initialize_MODULE functions have been run. */ |
| 418 | void |
| 419 | initialize_non_multiarch () |
| 420 | { |
| 421 | alloc_gdbarch_data (&startup_gdbarch); |
| 422 | init_gdbarch_data (&startup_gdbarch); |
| 423 | } |
| 424 | |
| 425 | |
| 426 | /* Create a new ``struct gdbarch'' based on information provided by |
| 427 | ``struct gdbarch_info''. */ |
| 428 | |
| 429 | struct gdbarch * |
| 430 | gdbarch_alloc (const struct gdbarch_info *info, |
| 431 | struct gdbarch_tdep *tdep) |
| 432 | { |
| 433 | /* NOTE: The new architecture variable is named ``current_gdbarch'' |
| 434 | so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to |
| 435 | the current local architecture and not the previous global |
| 436 | architecture. This ensures that the new architectures initial |
| 437 | values are not influenced by the previous architecture. Once |
| 438 | everything is parameterised with gdbarch, this will go away. */ |
| 439 | struct gdbarch *current_gdbarch = XMALLOC (struct gdbarch); |
| 440 | memset (current_gdbarch, 0, sizeof (*current_gdbarch)); |
| 441 | |
| 442 | alloc_gdbarch_data (current_gdbarch); |
| 443 | |
| 444 | current_gdbarch->tdep = tdep; |
| 445 | |
| 446 | current_gdbarch->bfd_arch_info = info->bfd_arch_info; |
| 447 | current_gdbarch->byte_order = info->byte_order; |
| 448 | |
| 449 | /* Force the explicit initialization of these. */ |
| 450 | current_gdbarch->short_bit = 2*TARGET_CHAR_BIT; |
| 451 | current_gdbarch->int_bit = 4*TARGET_CHAR_BIT; |
| 452 | current_gdbarch->long_bit = 4*TARGET_CHAR_BIT; |
| 453 | current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT; |
| 454 | current_gdbarch->float_bit = 4*TARGET_CHAR_BIT; |
| 455 | current_gdbarch->double_bit = 8*TARGET_CHAR_BIT; |
| 456 | current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT; |
| 457 | current_gdbarch->ptr_bit = TARGET_INT_BIT; |
| 458 | current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; |
| 459 | current_gdbarch->char_signed = -1; |
| 460 | current_gdbarch->read_pc = generic_target_read_pc; |
| 461 | current_gdbarch->write_pc = generic_target_write_pc; |
| 462 | current_gdbarch->read_fp = generic_target_read_fp; |
| 463 | current_gdbarch->write_fp = generic_target_write_fp; |
| 464 | current_gdbarch->read_sp = generic_target_read_sp; |
| 465 | current_gdbarch->write_sp = generic_target_write_sp; |
| 466 | current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; |
| 467 | current_gdbarch->num_regs = -1; |
| 468 | current_gdbarch->sp_regnum = -1; |
| 469 | current_gdbarch->fp_regnum = -1; |
| 470 | current_gdbarch->pc_regnum = -1; |
| 471 | current_gdbarch->fp0_regnum = -1; |
| 472 | current_gdbarch->npc_regnum = -1; |
| 473 | current_gdbarch->nnpc_regnum = -1; |
| 474 | current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum; |
| 475 | current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum; |
| 476 | current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum; |
| 477 | current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum; |
| 478 | current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum; |
| 479 | current_gdbarch->register_name = legacy_register_name; |
| 480 | current_gdbarch->register_size = -1; |
| 481 | current_gdbarch->register_bytes = -1; |
| 482 | current_gdbarch->max_register_raw_size = -1; |
| 483 | current_gdbarch->max_register_virtual_size = -1; |
| 484 | current_gdbarch->do_registers_info = do_registers_info; |
| 485 | current_gdbarch->print_float_info = default_print_float_info; |
| 486 | current_gdbarch->register_sim_regno = default_register_sim_regno; |
| 487 | current_gdbarch->cannot_fetch_register = cannot_register_not; |
| 488 | current_gdbarch->cannot_store_register = cannot_register_not; |
| 489 | current_gdbarch->use_generic_dummy_frames = -1; |
| 490 | current_gdbarch->call_dummy_start_offset = -1; |
| 491 | current_gdbarch->call_dummy_breakpoint_offset = -1; |
| 492 | current_gdbarch->call_dummy_breakpoint_offset_p = -1; |
| 493 | current_gdbarch->call_dummy_length = -1; |
| 494 | current_gdbarch->call_dummy_p = -1; |
| 495 | current_gdbarch->call_dummy_words = legacy_call_dummy_words; |
| 496 | current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; |
| 497 | current_gdbarch->call_dummy_stack_adjust_p = -1; |
| 498 | current_gdbarch->init_frame_pc_first = init_frame_pc_noop; |
| 499 | current_gdbarch->init_frame_pc = init_frame_pc_default; |
| 500 | current_gdbarch->coerce_float_to_double = default_coerce_float_to_double; |
| 501 | current_gdbarch->register_convertible = generic_register_convertible_not; |
| 502 | current_gdbarch->pointer_to_address = unsigned_pointer_to_address; |
| 503 | current_gdbarch->address_to_pointer = unsigned_address_to_pointer; |
| 504 | current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not; |
| 505 | current_gdbarch->push_arguments = default_push_arguments; |
| 506 | current_gdbarch->use_struct_convention = generic_use_struct_convention; |
| 507 | current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p; |
| 508 | current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; |
| 509 | current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; |
| 510 | current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; |
| 511 | current_gdbarch->decr_pc_after_break = -1; |
| 512 | current_gdbarch->prepare_to_proceed = default_prepare_to_proceed; |
| 513 | current_gdbarch->function_start_offset = -1; |
| 514 | current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address; |
| 515 | current_gdbarch->frame_args_skip = -1; |
| 516 | current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not; |
| 517 | current_gdbarch->extra_stack_alignment_needed = 1; |
| 518 | current_gdbarch->convert_from_func_ptr_addr = core_addr_identity; |
| 519 | current_gdbarch->addr_bits_remove = core_addr_identity; |
| 520 | current_gdbarch->smash_text_address = core_addr_identity; |
| 521 | current_gdbarch->print_insn = legacy_print_insn; |
| 522 | current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code; |
| 523 | current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline; |
| 524 | current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p; |
| 525 | current_gdbarch->construct_inferior_arguments = construct_inferior_arguments; |
| 526 | current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special; |
| 527 | current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special; |
| 528 | /* gdbarch_alloc() */ |
| 529 | |
| 530 | return current_gdbarch; |
| 531 | } |
| 532 | |
| 533 | |
| 534 | /* Free a gdbarch struct. This should never happen in normal |
| 535 | operation --- once you've created a gdbarch, you keep it around. |
| 536 | However, if an architecture's init function encounters an error |
| 537 | building the structure, it may need to clean up a partially |
| 538 | constructed gdbarch. */ |
| 539 | |
| 540 | void |
| 541 | gdbarch_free (struct gdbarch *arch) |
| 542 | { |
| 543 | gdb_assert (arch != NULL); |
| 544 | free_gdbarch_data (arch); |
| 545 | xfree (arch); |
| 546 | } |
| 547 | |
| 548 | |
| 549 | /* Ensure that all values in a GDBARCH are reasonable. */ |
| 550 | |
| 551 | static void |
| 552 | verify_gdbarch (struct gdbarch *gdbarch) |
| 553 | { |
| 554 | struct ui_file *log; |
| 555 | struct cleanup *cleanups; |
| 556 | long dummy; |
| 557 | char *buf; |
| 558 | /* Only perform sanity checks on a multi-arch target. */ |
| 559 | if (!GDB_MULTI_ARCH) |
| 560 | return; |
| 561 | log = mem_fileopen (); |
| 562 | cleanups = make_cleanup_ui_file_delete (log); |
| 563 | /* fundamental */ |
| 564 | if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN) |
| 565 | fprintf_unfiltered (log, "\n\tbyte-order"); |
| 566 | if (gdbarch->bfd_arch_info == NULL) |
| 567 | fprintf_unfiltered (log, "\n\tbfd_arch_info"); |
| 568 | /* Check those that need to be defined for the given multi-arch level. */ |
| 569 | /* Skip verify of short_bit, invalid_p == 0 */ |
| 570 | /* Skip verify of int_bit, invalid_p == 0 */ |
| 571 | /* Skip verify of long_bit, invalid_p == 0 */ |
| 572 | /* Skip verify of long_long_bit, invalid_p == 0 */ |
| 573 | /* Skip verify of float_bit, invalid_p == 0 */ |
| 574 | /* Skip verify of double_bit, invalid_p == 0 */ |
| 575 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
| 576 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
| 577 | if (gdbarch->addr_bit == 0) |
| 578 | gdbarch->addr_bit = TARGET_PTR_BIT; |
| 579 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
| 580 | if (gdbarch->char_signed == -1) |
| 581 | gdbarch->char_signed = 1; |
| 582 | /* Skip verify of read_pc, invalid_p == 0 */ |
| 583 | /* Skip verify of write_pc, invalid_p == 0 */ |
| 584 | /* Skip verify of read_fp, invalid_p == 0 */ |
| 585 | /* Skip verify of write_fp, invalid_p == 0 */ |
| 586 | /* Skip verify of read_sp, invalid_p == 0 */ |
| 587 | /* Skip verify of write_sp, invalid_p == 0 */ |
| 588 | /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ |
| 589 | /* Skip verify of register_read, has predicate */ |
| 590 | /* Skip verify of register_write, has predicate */ |
| 591 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 592 | && (gdbarch->num_regs == -1)) |
| 593 | fprintf_unfiltered (log, "\n\tnum_regs"); |
| 594 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
| 595 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 596 | && (gdbarch->sp_regnum == -1)) |
| 597 | fprintf_unfiltered (log, "\n\tsp_regnum"); |
| 598 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 599 | && (gdbarch->fp_regnum == -1)) |
| 600 | fprintf_unfiltered (log, "\n\tfp_regnum"); |
| 601 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 602 | && (gdbarch->pc_regnum == -1)) |
| 603 | fprintf_unfiltered (log, "\n\tpc_regnum"); |
| 604 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
| 605 | /* Skip verify of npc_regnum, invalid_p == 0 */ |
| 606 | /* Skip verify of nnpc_regnum, invalid_p == 0 */ |
| 607 | /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */ |
| 608 | /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */ |
| 609 | /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */ |
| 610 | /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */ |
| 611 | /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */ |
| 612 | /* Skip verify of register_name, invalid_p == 0 */ |
| 613 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 614 | && (gdbarch->register_size == -1)) |
| 615 | fprintf_unfiltered (log, "\n\tregister_size"); |
| 616 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 617 | && (gdbarch->register_bytes == -1)) |
| 618 | fprintf_unfiltered (log, "\n\tregister_bytes"); |
| 619 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 620 | && (gdbarch->register_byte == 0)) |
| 621 | fprintf_unfiltered (log, "\n\tregister_byte"); |
| 622 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 623 | && (gdbarch->register_raw_size == 0)) |
| 624 | fprintf_unfiltered (log, "\n\tregister_raw_size"); |
| 625 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 626 | && (gdbarch->max_register_raw_size == -1)) |
| 627 | fprintf_unfiltered (log, "\n\tmax_register_raw_size"); |
| 628 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 629 | && (gdbarch->register_virtual_size == 0)) |
| 630 | fprintf_unfiltered (log, "\n\tregister_virtual_size"); |
| 631 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 632 | && (gdbarch->max_register_virtual_size == -1)) |
| 633 | fprintf_unfiltered (log, "\n\tmax_register_virtual_size"); |
| 634 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 635 | && (gdbarch->register_virtual_type == 0)) |
| 636 | fprintf_unfiltered (log, "\n\tregister_virtual_type"); |
| 637 | /* Skip verify of do_registers_info, invalid_p == 0 */ |
| 638 | /* Skip verify of print_float_info, invalid_p == 0 */ |
| 639 | /* Skip verify of register_sim_regno, invalid_p == 0 */ |
| 640 | /* Skip verify of register_bytes_ok, has predicate */ |
| 641 | /* Skip verify of cannot_fetch_register, invalid_p == 0 */ |
| 642 | /* Skip verify of cannot_store_register, invalid_p == 0 */ |
| 643 | /* Skip verify of get_longjmp_target, has predicate */ |
| 644 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
| 645 | && (gdbarch->use_generic_dummy_frames == -1)) |
| 646 | fprintf_unfiltered (log, "\n\tuse_generic_dummy_frames"); |
| 647 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
| 648 | && (gdbarch->call_dummy_location == 0)) |
| 649 | fprintf_unfiltered (log, "\n\tcall_dummy_location"); |
| 650 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 651 | && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0)) |
| 652 | fprintf_unfiltered (log, "\n\tcall_dummy_address"); |
| 653 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 654 | && (gdbarch->call_dummy_start_offset == -1)) |
| 655 | fprintf_unfiltered (log, "\n\tcall_dummy_start_offset"); |
| 656 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 657 | && (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)) |
| 658 | fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset"); |
| 659 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
| 660 | && (gdbarch->call_dummy_breakpoint_offset_p == -1)) |
| 661 | fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset_p"); |
| 662 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 663 | && (gdbarch->call_dummy_length == -1)) |
| 664 | fprintf_unfiltered (log, "\n\tcall_dummy_length"); |
| 665 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
| 666 | && (gdbarch->pc_in_call_dummy == 0)) |
| 667 | fprintf_unfiltered (log, "\n\tpc_in_call_dummy"); |
| 668 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
| 669 | && (gdbarch->call_dummy_p == -1)) |
| 670 | fprintf_unfiltered (log, "\n\tcall_dummy_p"); |
| 671 | /* Skip verify of call_dummy_words, invalid_p == 0 */ |
| 672 | /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ |
| 673 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
| 674 | && (gdbarch->call_dummy_stack_adjust_p == -1)) |
| 675 | fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p"); |
| 676 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 677 | && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)) |
| 678 | fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust"); |
| 679 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 680 | && (gdbarch->fix_call_dummy == 0)) |
| 681 | fprintf_unfiltered (log, "\n\tfix_call_dummy"); |
| 682 | /* Skip verify of init_frame_pc_first, invalid_p == 0 */ |
| 683 | /* Skip verify of init_frame_pc, invalid_p == 0 */ |
| 684 | /* Skip verify of coerce_float_to_double, invalid_p == 0 */ |
| 685 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
| 686 | && (gdbarch->get_saved_register == 0)) |
| 687 | fprintf_unfiltered (log, "\n\tget_saved_register"); |
| 688 | /* Skip verify of register_convertible, invalid_p == 0 */ |
| 689 | /* Skip verify of register_convert_to_virtual, invalid_p == 0 */ |
| 690 | /* Skip verify of register_convert_to_raw, invalid_p == 0 */ |
| 691 | /* Skip verify of fetch_pseudo_register, has predicate */ |
| 692 | /* Skip verify of store_pseudo_register, has predicate */ |
| 693 | /* Skip verify of pointer_to_address, invalid_p == 0 */ |
| 694 | /* Skip verify of address_to_pointer, invalid_p == 0 */ |
| 695 | /* Skip verify of integer_to_address, has predicate */ |
| 696 | /* Skip verify of return_value_on_stack, invalid_p == 0 */ |
| 697 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 698 | && (gdbarch->extract_return_value == 0)) |
| 699 | fprintf_unfiltered (log, "\n\textract_return_value"); |
| 700 | /* Skip verify of push_arguments, invalid_p == 0 */ |
| 701 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 702 | && (gdbarch->push_dummy_frame == 0)) |
| 703 | fprintf_unfiltered (log, "\n\tpush_dummy_frame"); |
| 704 | /* Skip verify of push_return_address, has predicate */ |
| 705 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 706 | && (gdbarch->pop_frame == 0)) |
| 707 | fprintf_unfiltered (log, "\n\tpop_frame"); |
| 708 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 709 | && (gdbarch->store_struct_return == 0)) |
| 710 | fprintf_unfiltered (log, "\n\tstore_struct_return"); |
| 711 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 712 | && (gdbarch->store_return_value == 0)) |
| 713 | fprintf_unfiltered (log, "\n\tstore_return_value"); |
| 714 | /* Skip verify of extract_struct_value_address, has predicate */ |
| 715 | /* Skip verify of use_struct_convention, invalid_p == 0 */ |
| 716 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 717 | && (gdbarch->frame_init_saved_regs == 0)) |
| 718 | fprintf_unfiltered (log, "\n\tframe_init_saved_regs"); |
| 719 | /* Skip verify of init_extra_frame_info, has predicate */ |
| 720 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 721 | && (gdbarch->skip_prologue == 0)) |
| 722 | fprintf_unfiltered (log, "\n\tskip_prologue"); |
| 723 | /* Skip verify of prologue_frameless_p, invalid_p == 0 */ |
| 724 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 725 | && (gdbarch->inner_than == 0)) |
| 726 | fprintf_unfiltered (log, "\n\tinner_than"); |
| 727 | /* Skip verify of breakpoint_from_pc, invalid_p == 0 */ |
| 728 | /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ |
| 729 | /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ |
| 730 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 731 | && (gdbarch->decr_pc_after_break == -1)) |
| 732 | fprintf_unfiltered (log, "\n\tdecr_pc_after_break"); |
| 733 | /* Skip verify of prepare_to_proceed, invalid_p == 0 */ |
| 734 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 735 | && (gdbarch->function_start_offset == -1)) |
| 736 | fprintf_unfiltered (log, "\n\tfunction_start_offset"); |
| 737 | /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */ |
| 738 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 739 | && (gdbarch->frame_args_skip == -1)) |
| 740 | fprintf_unfiltered (log, "\n\tframe_args_skip"); |
| 741 | /* Skip verify of frameless_function_invocation, invalid_p == 0 */ |
| 742 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 743 | && (gdbarch->frame_chain == 0)) |
| 744 | fprintf_unfiltered (log, "\n\tframe_chain"); |
| 745 | if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) |
| 746 | && (gdbarch->frame_chain_valid == 0)) |
| 747 | fprintf_unfiltered (log, "\n\tframe_chain_valid"); |
| 748 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 749 | && (gdbarch->frame_saved_pc == 0)) |
| 750 | fprintf_unfiltered (log, "\n\tframe_saved_pc"); |
| 751 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 752 | && (gdbarch->frame_args_address == 0)) |
| 753 | fprintf_unfiltered (log, "\n\tframe_args_address"); |
| 754 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 755 | && (gdbarch->frame_locals_address == 0)) |
| 756 | fprintf_unfiltered (log, "\n\tframe_locals_address"); |
| 757 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 758 | && (gdbarch->saved_pc_after_call == 0)) |
| 759 | fprintf_unfiltered (log, "\n\tsaved_pc_after_call"); |
| 760 | if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) |
| 761 | && (gdbarch->frame_num_args == 0)) |
| 762 | fprintf_unfiltered (log, "\n\tframe_num_args"); |
| 763 | /* Skip verify of stack_align, has predicate */ |
| 764 | /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ |
| 765 | /* Skip verify of reg_struct_has_addr, has predicate */ |
| 766 | /* Skip verify of save_dummy_frame_tos, has predicate */ |
| 767 | if (gdbarch->float_format == 0) |
| 768 | gdbarch->float_format = default_float_format (gdbarch); |
| 769 | if (gdbarch->double_format == 0) |
| 770 | gdbarch->double_format = default_double_format (gdbarch); |
| 771 | if (gdbarch->long_double_format == 0) |
| 772 | gdbarch->long_double_format = default_double_format (gdbarch); |
| 773 | /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ |
| 774 | /* Skip verify of addr_bits_remove, invalid_p == 0 */ |
| 775 | /* Skip verify of smash_text_address, invalid_p == 0 */ |
| 776 | /* Skip verify of software_single_step, has predicate */ |
| 777 | /* Skip verify of print_insn, invalid_p == 0 */ |
| 778 | /* Skip verify of skip_trampoline_code, invalid_p == 0 */ |
| 779 | /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */ |
| 780 | /* Skip verify of in_function_epilogue_p, invalid_p == 0 */ |
| 781 | /* Skip verify of construct_inferior_arguments, invalid_p == 0 */ |
| 782 | /* Skip verify of dwarf2_build_frame_info, has predicate */ |
| 783 | /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */ |
| 784 | /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */ |
| 785 | buf = ui_file_xstrdup (log, &dummy); |
| 786 | make_cleanup (xfree, buf); |
| 787 | if (strlen (buf) > 0) |
| 788 | internal_error (__FILE__, __LINE__, |
| 789 | "verify_gdbarch: the following are invalid ...%s", |
| 790 | buf); |
| 791 | do_cleanups (cleanups); |
| 792 | } |
| 793 | |
| 794 | |
| 795 | /* Print out the details of the current architecture. */ |
| 796 | |
| 797 | /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it |
| 798 | just happens to match the global variable ``current_gdbarch''. That |
| 799 | way macros refering to that variable get the local and not the global |
| 800 | version - ulgh. Once everything is parameterised with gdbarch, this |
| 801 | will go away. */ |
| 802 | |
| 803 | void |
| 804 | gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) |
| 805 | { |
| 806 | fprintf_unfiltered (file, |
| 807 | "gdbarch_dump: GDB_MULTI_ARCH = %d\n", |
| 808 | GDB_MULTI_ARCH); |
| 809 | if (GDB_MULTI_ARCH) |
| 810 | fprintf_unfiltered (file, |
| 811 | "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n", |
| 812 | (long) current_gdbarch->in_function_epilogue_p); |
| 813 | if (GDB_MULTI_ARCH) |
| 814 | fprintf_unfiltered (file, |
| 815 | "gdbarch_dump: register_read = 0x%08lx\n", |
| 816 | (long) current_gdbarch->register_read); |
| 817 | if (GDB_MULTI_ARCH) |
| 818 | fprintf_unfiltered (file, |
| 819 | "gdbarch_dump: register_write = 0x%08lx\n", |
| 820 | (long) current_gdbarch->register_write); |
| 821 | #ifdef ADDRESS_TO_POINTER |
| 822 | #if GDB_MULTI_ARCH |
| 823 | /* Macro might contain `[{}]' when not multi-arch */ |
| 824 | fprintf_unfiltered (file, |
| 825 | "gdbarch_dump: %s # %s\n", |
| 826 | "ADDRESS_TO_POINTER(type, buf, addr)", |
| 827 | XSTRING (ADDRESS_TO_POINTER (type, buf, addr))); |
| 828 | #endif |
| 829 | if (GDB_MULTI_ARCH) |
| 830 | fprintf_unfiltered (file, |
| 831 | "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n", |
| 832 | (long) current_gdbarch->address_to_pointer |
| 833 | /*ADDRESS_TO_POINTER ()*/); |
| 834 | #endif |
| 835 | #ifdef ADDR_BITS_REMOVE |
| 836 | fprintf_unfiltered (file, |
| 837 | "gdbarch_dump: %s # %s\n", |
| 838 | "ADDR_BITS_REMOVE(addr)", |
| 839 | XSTRING (ADDR_BITS_REMOVE (addr))); |
| 840 | if (GDB_MULTI_ARCH) |
| 841 | fprintf_unfiltered (file, |
| 842 | "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n", |
| 843 | (long) current_gdbarch->addr_bits_remove |
| 844 | /*ADDR_BITS_REMOVE ()*/); |
| 845 | #endif |
| 846 | #ifdef BELIEVE_PCC_PROMOTION |
| 847 | fprintf_unfiltered (file, |
| 848 | "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n", |
| 849 | XSTRING (BELIEVE_PCC_PROMOTION)); |
| 850 | fprintf_unfiltered (file, |
| 851 | "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n", |
| 852 | BELIEVE_PCC_PROMOTION); |
| 853 | #endif |
| 854 | #ifdef BELIEVE_PCC_PROMOTION_TYPE |
| 855 | fprintf_unfiltered (file, |
| 856 | "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n", |
| 857 | XSTRING (BELIEVE_PCC_PROMOTION_TYPE)); |
| 858 | fprintf_unfiltered (file, |
| 859 | "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %d\n", |
| 860 | BELIEVE_PCC_PROMOTION_TYPE); |
| 861 | #endif |
| 862 | #ifdef BREAKPOINT_FROM_PC |
| 863 | fprintf_unfiltered (file, |
| 864 | "gdbarch_dump: %s # %s\n", |
| 865 | "BREAKPOINT_FROM_PC(pcptr, lenptr)", |
| 866 | XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr))); |
| 867 | if (GDB_MULTI_ARCH) |
| 868 | fprintf_unfiltered (file, |
| 869 | "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n", |
| 870 | (long) current_gdbarch->breakpoint_from_pc |
| 871 | /*BREAKPOINT_FROM_PC ()*/); |
| 872 | #endif |
| 873 | #ifdef CALL_DUMMY_ADDRESS |
| 874 | fprintf_unfiltered (file, |
| 875 | "gdbarch_dump: %s # %s\n", |
| 876 | "CALL_DUMMY_ADDRESS()", |
| 877 | XSTRING (CALL_DUMMY_ADDRESS ())); |
| 878 | if (GDB_MULTI_ARCH) |
| 879 | fprintf_unfiltered (file, |
| 880 | "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n", |
| 881 | (long) current_gdbarch->call_dummy_address |
| 882 | /*CALL_DUMMY_ADDRESS ()*/); |
| 883 | #endif |
| 884 | #ifdef CALL_DUMMY_BREAKPOINT_OFFSET |
| 885 | fprintf_unfiltered (file, |
| 886 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n", |
| 887 | XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET)); |
| 888 | if (CALL_DUMMY_BREAKPOINT_OFFSET_P) |
| 889 | fprintf_unfiltered (file, |
| 890 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n", |
| 891 | (long) CALL_DUMMY_BREAKPOINT_OFFSET); |
| 892 | #endif |
| 893 | #ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P |
| 894 | fprintf_unfiltered (file, |
| 895 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P # %s\n", |
| 896 | XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET_P)); |
| 897 | fprintf_unfiltered (file, |
| 898 | "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET_P = %d\n", |
| 899 | CALL_DUMMY_BREAKPOINT_OFFSET_P); |
| 900 | #endif |
| 901 | #ifdef CALL_DUMMY_LENGTH |
| 902 | fprintf_unfiltered (file, |
| 903 | "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n", |
| 904 | XSTRING (CALL_DUMMY_LENGTH)); |
| 905 | if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END) |
| 906 | fprintf_unfiltered (file, |
| 907 | "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n", |
| 908 | CALL_DUMMY_LENGTH); |
| 909 | #endif |
| 910 | #ifdef CALL_DUMMY_LOCATION |
| 911 | fprintf_unfiltered (file, |
| 912 | "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n", |
| 913 | XSTRING (CALL_DUMMY_LOCATION)); |
| 914 | fprintf_unfiltered (file, |
| 915 | "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n", |
| 916 | CALL_DUMMY_LOCATION); |
| 917 | #endif |
| 918 | #ifdef CALL_DUMMY_P |
| 919 | fprintf_unfiltered (file, |
| 920 | "gdbarch_dump: CALL_DUMMY_P # %s\n", |
| 921 | XSTRING (CALL_DUMMY_P)); |
| 922 | fprintf_unfiltered (file, |
| 923 | "gdbarch_dump: CALL_DUMMY_P = %d\n", |
| 924 | CALL_DUMMY_P); |
| 925 | #endif |
| 926 | #ifdef CALL_DUMMY_STACK_ADJUST |
| 927 | fprintf_unfiltered (file, |
| 928 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST # %s\n", |
| 929 | XSTRING (CALL_DUMMY_STACK_ADJUST)); |
| 930 | if (CALL_DUMMY_STACK_ADJUST_P) |
| 931 | fprintf_unfiltered (file, |
| 932 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n", |
| 933 | (long) CALL_DUMMY_STACK_ADJUST); |
| 934 | #endif |
| 935 | #ifdef CALL_DUMMY_STACK_ADJUST_P |
| 936 | fprintf_unfiltered (file, |
| 937 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P # %s\n", |
| 938 | XSTRING (CALL_DUMMY_STACK_ADJUST_P)); |
| 939 | fprintf_unfiltered (file, |
| 940 | "gdbarch_dump: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n", |
| 941 | (long) CALL_DUMMY_STACK_ADJUST_P); |
| 942 | #endif |
| 943 | #ifdef CALL_DUMMY_START_OFFSET |
| 944 | fprintf_unfiltered (file, |
| 945 | "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n", |
| 946 | XSTRING (CALL_DUMMY_START_OFFSET)); |
| 947 | fprintf_unfiltered (file, |
| 948 | "gdbarch_dump: CALL_DUMMY_START_OFFSET = 0x%08lx\n", |
| 949 | (long) CALL_DUMMY_START_OFFSET); |
| 950 | #endif |
| 951 | #ifdef CALL_DUMMY_WORDS |
| 952 | fprintf_unfiltered (file, |
| 953 | "gdbarch_dump: CALL_DUMMY_WORDS # %s\n", |
| 954 | XSTRING (CALL_DUMMY_WORDS)); |
| 955 | fprintf_unfiltered (file, |
| 956 | "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n", |
| 957 | (long) CALL_DUMMY_WORDS); |
| 958 | #endif |
| 959 | #ifdef CANNOT_FETCH_REGISTER |
| 960 | fprintf_unfiltered (file, |
| 961 | "gdbarch_dump: %s # %s\n", |
| 962 | "CANNOT_FETCH_REGISTER(regnum)", |
| 963 | XSTRING (CANNOT_FETCH_REGISTER (regnum))); |
| 964 | if (GDB_MULTI_ARCH) |
| 965 | fprintf_unfiltered (file, |
| 966 | "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n", |
| 967 | (long) current_gdbarch->cannot_fetch_register |
| 968 | /*CANNOT_FETCH_REGISTER ()*/); |
| 969 | #endif |
| 970 | #ifdef CANNOT_STORE_REGISTER |
| 971 | fprintf_unfiltered (file, |
| 972 | "gdbarch_dump: %s # %s\n", |
| 973 | "CANNOT_STORE_REGISTER(regnum)", |
| 974 | XSTRING (CANNOT_STORE_REGISTER (regnum))); |
| 975 | if (GDB_MULTI_ARCH) |
| 976 | fprintf_unfiltered (file, |
| 977 | "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n", |
| 978 | (long) current_gdbarch->cannot_store_register |
| 979 | /*CANNOT_STORE_REGISTER ()*/); |
| 980 | #endif |
| 981 | #ifdef COERCE_FLOAT_TO_DOUBLE |
| 982 | fprintf_unfiltered (file, |
| 983 | "gdbarch_dump: %s # %s\n", |
| 984 | "COERCE_FLOAT_TO_DOUBLE(formal, actual)", |
| 985 | XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual))); |
| 986 | if (GDB_MULTI_ARCH) |
| 987 | fprintf_unfiltered (file, |
| 988 | "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n", |
| 989 | (long) current_gdbarch->coerce_float_to_double |
| 990 | /*COERCE_FLOAT_TO_DOUBLE ()*/); |
| 991 | #endif |
| 992 | #ifdef COFF_MAKE_MSYMBOL_SPECIAL |
| 993 | #if GDB_MULTI_ARCH |
| 994 | /* Macro might contain `[{}]' when not multi-arch */ |
| 995 | fprintf_unfiltered (file, |
| 996 | "gdbarch_dump: %s # %s\n", |
| 997 | "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)", |
| 998 | XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym))); |
| 999 | #endif |
| 1000 | if (GDB_MULTI_ARCH) |
| 1001 | fprintf_unfiltered (file, |
| 1002 | "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n", |
| 1003 | (long) current_gdbarch->coff_make_msymbol_special |
| 1004 | /*COFF_MAKE_MSYMBOL_SPECIAL ()*/); |
| 1005 | #endif |
| 1006 | if (GDB_MULTI_ARCH) |
| 1007 | fprintf_unfiltered (file, |
| 1008 | "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n", |
| 1009 | (long) current_gdbarch->construct_inferior_arguments); |
| 1010 | #ifdef CONVERT_FROM_FUNC_PTR_ADDR |
| 1011 | fprintf_unfiltered (file, |
| 1012 | "gdbarch_dump: %s # %s\n", |
| 1013 | "CONVERT_FROM_FUNC_PTR_ADDR(addr)", |
| 1014 | XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr))); |
| 1015 | if (GDB_MULTI_ARCH) |
| 1016 | fprintf_unfiltered (file, |
| 1017 | "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n", |
| 1018 | (long) current_gdbarch->convert_from_func_ptr_addr |
| 1019 | /*CONVERT_FROM_FUNC_PTR_ADDR ()*/); |
| 1020 | #endif |
| 1021 | #ifdef DECR_PC_AFTER_BREAK |
| 1022 | fprintf_unfiltered (file, |
| 1023 | "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n", |
| 1024 | XSTRING (DECR_PC_AFTER_BREAK)); |
| 1025 | fprintf_unfiltered (file, |
| 1026 | "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n", |
| 1027 | (long) DECR_PC_AFTER_BREAK); |
| 1028 | #endif |
| 1029 | #ifdef DO_REGISTERS_INFO |
| 1030 | #if GDB_MULTI_ARCH |
| 1031 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1032 | fprintf_unfiltered (file, |
| 1033 | "gdbarch_dump: %s # %s\n", |
| 1034 | "DO_REGISTERS_INFO(reg_nr, fpregs)", |
| 1035 | XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs))); |
| 1036 | #endif |
| 1037 | if (GDB_MULTI_ARCH) |
| 1038 | fprintf_unfiltered (file, |
| 1039 | "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n", |
| 1040 | (long) current_gdbarch->do_registers_info |
| 1041 | /*DO_REGISTERS_INFO ()*/); |
| 1042 | #endif |
| 1043 | #ifdef DWARF2_BUILD_FRAME_INFO |
| 1044 | #if GDB_MULTI_ARCH |
| 1045 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1046 | fprintf_unfiltered (file, |
| 1047 | "gdbarch_dump: %s # %s\n", |
| 1048 | "DWARF2_BUILD_FRAME_INFO(objfile)", |
| 1049 | XSTRING (DWARF2_BUILD_FRAME_INFO (objfile))); |
| 1050 | #endif |
| 1051 | if (GDB_MULTI_ARCH) |
| 1052 | fprintf_unfiltered (file, |
| 1053 | "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = 0x%08lx\n", |
| 1054 | (long) current_gdbarch->dwarf2_build_frame_info |
| 1055 | /*DWARF2_BUILD_FRAME_INFO ()*/); |
| 1056 | #endif |
| 1057 | #ifdef DWARF2_REG_TO_REGNUM |
| 1058 | fprintf_unfiltered (file, |
| 1059 | "gdbarch_dump: %s # %s\n", |
| 1060 | "DWARF2_REG_TO_REGNUM(dwarf2_regnr)", |
| 1061 | XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr))); |
| 1062 | if (GDB_MULTI_ARCH) |
| 1063 | fprintf_unfiltered (file, |
| 1064 | "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n", |
| 1065 | (long) current_gdbarch->dwarf2_reg_to_regnum |
| 1066 | /*DWARF2_REG_TO_REGNUM ()*/); |
| 1067 | #endif |
| 1068 | #ifdef DWARF_REG_TO_REGNUM |
| 1069 | fprintf_unfiltered (file, |
| 1070 | "gdbarch_dump: %s # %s\n", |
| 1071 | "DWARF_REG_TO_REGNUM(dwarf_regnr)", |
| 1072 | XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr))); |
| 1073 | if (GDB_MULTI_ARCH) |
| 1074 | fprintf_unfiltered (file, |
| 1075 | "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n", |
| 1076 | (long) current_gdbarch->dwarf_reg_to_regnum |
| 1077 | /*DWARF_REG_TO_REGNUM ()*/); |
| 1078 | #endif |
| 1079 | #ifdef ECOFF_REG_TO_REGNUM |
| 1080 | fprintf_unfiltered (file, |
| 1081 | "gdbarch_dump: %s # %s\n", |
| 1082 | "ECOFF_REG_TO_REGNUM(ecoff_regnr)", |
| 1083 | XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr))); |
| 1084 | if (GDB_MULTI_ARCH) |
| 1085 | fprintf_unfiltered (file, |
| 1086 | "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n", |
| 1087 | (long) current_gdbarch->ecoff_reg_to_regnum |
| 1088 | /*ECOFF_REG_TO_REGNUM ()*/); |
| 1089 | #endif |
| 1090 | #ifdef ELF_MAKE_MSYMBOL_SPECIAL |
| 1091 | #if GDB_MULTI_ARCH |
| 1092 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1093 | fprintf_unfiltered (file, |
| 1094 | "gdbarch_dump: %s # %s\n", |
| 1095 | "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)", |
| 1096 | XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym))); |
| 1097 | #endif |
| 1098 | if (GDB_MULTI_ARCH) |
| 1099 | fprintf_unfiltered (file, |
| 1100 | "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n", |
| 1101 | (long) current_gdbarch->elf_make_msymbol_special |
| 1102 | /*ELF_MAKE_MSYMBOL_SPECIAL ()*/); |
| 1103 | #endif |
| 1104 | #ifdef EXTRACT_RETURN_VALUE |
| 1105 | #if GDB_MULTI_ARCH |
| 1106 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1107 | fprintf_unfiltered (file, |
| 1108 | "gdbarch_dump: %s # %s\n", |
| 1109 | "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)", |
| 1110 | XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf))); |
| 1111 | #endif |
| 1112 | if (GDB_MULTI_ARCH) |
| 1113 | fprintf_unfiltered (file, |
| 1114 | "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n", |
| 1115 | (long) current_gdbarch->extract_return_value |
| 1116 | /*EXTRACT_RETURN_VALUE ()*/); |
| 1117 | #endif |
| 1118 | #ifdef EXTRACT_STRUCT_VALUE_ADDRESS |
| 1119 | fprintf_unfiltered (file, |
| 1120 | "gdbarch_dump: %s # %s\n", |
| 1121 | "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)", |
| 1122 | XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf))); |
| 1123 | if (GDB_MULTI_ARCH) |
| 1124 | fprintf_unfiltered (file, |
| 1125 | "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n", |
| 1126 | (long) current_gdbarch->extract_struct_value_address |
| 1127 | /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); |
| 1128 | #endif |
| 1129 | #ifdef EXTRA_STACK_ALIGNMENT_NEEDED |
| 1130 | fprintf_unfiltered (file, |
| 1131 | "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n", |
| 1132 | XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED)); |
| 1133 | fprintf_unfiltered (file, |
| 1134 | "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n", |
| 1135 | EXTRA_STACK_ALIGNMENT_NEEDED); |
| 1136 | #endif |
| 1137 | #ifdef FETCH_PSEUDO_REGISTER |
| 1138 | #if GDB_MULTI_ARCH |
| 1139 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1140 | fprintf_unfiltered (file, |
| 1141 | "gdbarch_dump: %s # %s\n", |
| 1142 | "FETCH_PSEUDO_REGISTER(regnum)", |
| 1143 | XSTRING (FETCH_PSEUDO_REGISTER (regnum))); |
| 1144 | #endif |
| 1145 | if (GDB_MULTI_ARCH) |
| 1146 | fprintf_unfiltered (file, |
| 1147 | "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n", |
| 1148 | (long) current_gdbarch->fetch_pseudo_register |
| 1149 | /*FETCH_PSEUDO_REGISTER ()*/); |
| 1150 | #endif |
| 1151 | #ifdef FIX_CALL_DUMMY |
| 1152 | #if GDB_MULTI_ARCH |
| 1153 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1154 | fprintf_unfiltered (file, |
| 1155 | "gdbarch_dump: %s # %s\n", |
| 1156 | "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)", |
| 1157 | XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p))); |
| 1158 | #endif |
| 1159 | if (GDB_MULTI_ARCH) |
| 1160 | fprintf_unfiltered (file, |
| 1161 | "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n", |
| 1162 | (long) current_gdbarch->fix_call_dummy |
| 1163 | /*FIX_CALL_DUMMY ()*/); |
| 1164 | #endif |
| 1165 | #ifdef FP0_REGNUM |
| 1166 | fprintf_unfiltered (file, |
| 1167 | "gdbarch_dump: FP0_REGNUM # %s\n", |
| 1168 | XSTRING (FP0_REGNUM)); |
| 1169 | fprintf_unfiltered (file, |
| 1170 | "gdbarch_dump: FP0_REGNUM = %d\n", |
| 1171 | FP0_REGNUM); |
| 1172 | #endif |
| 1173 | #ifdef FP_REGNUM |
| 1174 | fprintf_unfiltered (file, |
| 1175 | "gdbarch_dump: FP_REGNUM # %s\n", |
| 1176 | XSTRING (FP_REGNUM)); |
| 1177 | fprintf_unfiltered (file, |
| 1178 | "gdbarch_dump: FP_REGNUM = %d\n", |
| 1179 | FP_REGNUM); |
| 1180 | #endif |
| 1181 | #ifdef FRAMELESS_FUNCTION_INVOCATION |
| 1182 | fprintf_unfiltered (file, |
| 1183 | "gdbarch_dump: %s # %s\n", |
| 1184 | "FRAMELESS_FUNCTION_INVOCATION(fi)", |
| 1185 | XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi))); |
| 1186 | if (GDB_MULTI_ARCH) |
| 1187 | fprintf_unfiltered (file, |
| 1188 | "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n", |
| 1189 | (long) current_gdbarch->frameless_function_invocation |
| 1190 | /*FRAMELESS_FUNCTION_INVOCATION ()*/); |
| 1191 | #endif |
| 1192 | #ifdef FRAME_ARGS_ADDRESS |
| 1193 | fprintf_unfiltered (file, |
| 1194 | "gdbarch_dump: %s # %s\n", |
| 1195 | "FRAME_ARGS_ADDRESS(fi)", |
| 1196 | XSTRING (FRAME_ARGS_ADDRESS (fi))); |
| 1197 | if (GDB_MULTI_ARCH) |
| 1198 | fprintf_unfiltered (file, |
| 1199 | "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n", |
| 1200 | (long) current_gdbarch->frame_args_address |
| 1201 | /*FRAME_ARGS_ADDRESS ()*/); |
| 1202 | #endif |
| 1203 | #ifdef FRAME_ARGS_SKIP |
| 1204 | fprintf_unfiltered (file, |
| 1205 | "gdbarch_dump: FRAME_ARGS_SKIP # %s\n", |
| 1206 | XSTRING (FRAME_ARGS_SKIP)); |
| 1207 | fprintf_unfiltered (file, |
| 1208 | "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n", |
| 1209 | (long) FRAME_ARGS_SKIP); |
| 1210 | #endif |
| 1211 | #ifdef FRAME_CHAIN |
| 1212 | fprintf_unfiltered (file, |
| 1213 | "gdbarch_dump: %s # %s\n", |
| 1214 | "FRAME_CHAIN(frame)", |
| 1215 | XSTRING (FRAME_CHAIN (frame))); |
| 1216 | if (GDB_MULTI_ARCH) |
| 1217 | fprintf_unfiltered (file, |
| 1218 | "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n", |
| 1219 | (long) current_gdbarch->frame_chain |
| 1220 | /*FRAME_CHAIN ()*/); |
| 1221 | #endif |
| 1222 | #ifdef FRAME_CHAIN_VALID |
| 1223 | fprintf_unfiltered (file, |
| 1224 | "gdbarch_dump: %s # %s\n", |
| 1225 | "FRAME_CHAIN_VALID(chain, thisframe)", |
| 1226 | XSTRING (FRAME_CHAIN_VALID (chain, thisframe))); |
| 1227 | if (GDB_MULTI_ARCH) |
| 1228 | fprintf_unfiltered (file, |
| 1229 | "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n", |
| 1230 | (long) current_gdbarch->frame_chain_valid |
| 1231 | /*FRAME_CHAIN_VALID ()*/); |
| 1232 | #endif |
| 1233 | #ifdef FRAME_INIT_SAVED_REGS |
| 1234 | #if GDB_MULTI_ARCH |
| 1235 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1236 | fprintf_unfiltered (file, |
| 1237 | "gdbarch_dump: %s # %s\n", |
| 1238 | "FRAME_INIT_SAVED_REGS(frame)", |
| 1239 | XSTRING (FRAME_INIT_SAVED_REGS (frame))); |
| 1240 | #endif |
| 1241 | if (GDB_MULTI_ARCH) |
| 1242 | fprintf_unfiltered (file, |
| 1243 | "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n", |
| 1244 | (long) current_gdbarch->frame_init_saved_regs |
| 1245 | /*FRAME_INIT_SAVED_REGS ()*/); |
| 1246 | #endif |
| 1247 | #ifdef FRAME_LOCALS_ADDRESS |
| 1248 | fprintf_unfiltered (file, |
| 1249 | "gdbarch_dump: %s # %s\n", |
| 1250 | "FRAME_LOCALS_ADDRESS(fi)", |
| 1251 | XSTRING (FRAME_LOCALS_ADDRESS (fi))); |
| 1252 | if (GDB_MULTI_ARCH) |
| 1253 | fprintf_unfiltered (file, |
| 1254 | "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n", |
| 1255 | (long) current_gdbarch->frame_locals_address |
| 1256 | /*FRAME_LOCALS_ADDRESS ()*/); |
| 1257 | #endif |
| 1258 | #ifdef FRAME_NUM_ARGS |
| 1259 | fprintf_unfiltered (file, |
| 1260 | "gdbarch_dump: %s # %s\n", |
| 1261 | "FRAME_NUM_ARGS(frame)", |
| 1262 | XSTRING (FRAME_NUM_ARGS (frame))); |
| 1263 | if (GDB_MULTI_ARCH) |
| 1264 | fprintf_unfiltered (file, |
| 1265 | "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n", |
| 1266 | (long) current_gdbarch->frame_num_args |
| 1267 | /*FRAME_NUM_ARGS ()*/); |
| 1268 | #endif |
| 1269 | #ifdef FRAME_SAVED_PC |
| 1270 | fprintf_unfiltered (file, |
| 1271 | "gdbarch_dump: %s # %s\n", |
| 1272 | "FRAME_SAVED_PC(fi)", |
| 1273 | XSTRING (FRAME_SAVED_PC (fi))); |
| 1274 | if (GDB_MULTI_ARCH) |
| 1275 | fprintf_unfiltered (file, |
| 1276 | "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n", |
| 1277 | (long) current_gdbarch->frame_saved_pc |
| 1278 | /*FRAME_SAVED_PC ()*/); |
| 1279 | #endif |
| 1280 | #ifdef FUNCTION_START_OFFSET |
| 1281 | fprintf_unfiltered (file, |
| 1282 | "gdbarch_dump: FUNCTION_START_OFFSET # %s\n", |
| 1283 | XSTRING (FUNCTION_START_OFFSET)); |
| 1284 | fprintf_unfiltered (file, |
| 1285 | "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n", |
| 1286 | (long) FUNCTION_START_OFFSET); |
| 1287 | #endif |
| 1288 | #ifdef GET_LONGJMP_TARGET |
| 1289 | fprintf_unfiltered (file, |
| 1290 | "gdbarch_dump: %s # %s\n", |
| 1291 | "GET_LONGJMP_TARGET(pc)", |
| 1292 | XSTRING (GET_LONGJMP_TARGET (pc))); |
| 1293 | if (GDB_MULTI_ARCH) |
| 1294 | fprintf_unfiltered (file, |
| 1295 | "gdbarch_dump: GET_LONGJMP_TARGET = 0x%08lx\n", |
| 1296 | (long) current_gdbarch->get_longjmp_target |
| 1297 | /*GET_LONGJMP_TARGET ()*/); |
| 1298 | #endif |
| 1299 | #ifdef GET_SAVED_REGISTER |
| 1300 | #if GDB_MULTI_ARCH |
| 1301 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1302 | fprintf_unfiltered (file, |
| 1303 | "gdbarch_dump: %s # %s\n", |
| 1304 | "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)", |
| 1305 | XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval))); |
| 1306 | #endif |
| 1307 | if (GDB_MULTI_ARCH) |
| 1308 | fprintf_unfiltered (file, |
| 1309 | "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n", |
| 1310 | (long) current_gdbarch->get_saved_register |
| 1311 | /*GET_SAVED_REGISTER ()*/); |
| 1312 | #endif |
| 1313 | #ifdef INIT_EXTRA_FRAME_INFO |
| 1314 | #if GDB_MULTI_ARCH |
| 1315 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1316 | fprintf_unfiltered (file, |
| 1317 | "gdbarch_dump: %s # %s\n", |
| 1318 | "INIT_EXTRA_FRAME_INFO(fromleaf, frame)", |
| 1319 | XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame))); |
| 1320 | #endif |
| 1321 | if (GDB_MULTI_ARCH) |
| 1322 | fprintf_unfiltered (file, |
| 1323 | "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n", |
| 1324 | (long) current_gdbarch->init_extra_frame_info |
| 1325 | /*INIT_EXTRA_FRAME_INFO ()*/); |
| 1326 | #endif |
| 1327 | #ifdef INIT_FRAME_PC |
| 1328 | #if GDB_MULTI_ARCH |
| 1329 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1330 | fprintf_unfiltered (file, |
| 1331 | "gdbarch_dump: %s # %s\n", |
| 1332 | "INIT_FRAME_PC(fromleaf, prev)", |
| 1333 | XSTRING (INIT_FRAME_PC (fromleaf, prev))); |
| 1334 | #endif |
| 1335 | if (GDB_MULTI_ARCH) |
| 1336 | fprintf_unfiltered (file, |
| 1337 | "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n", |
| 1338 | (long) current_gdbarch->init_frame_pc |
| 1339 | /*INIT_FRAME_PC ()*/); |
| 1340 | #endif |
| 1341 | #ifdef INIT_FRAME_PC_FIRST |
| 1342 | #if GDB_MULTI_ARCH |
| 1343 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1344 | fprintf_unfiltered (file, |
| 1345 | "gdbarch_dump: %s # %s\n", |
| 1346 | "INIT_FRAME_PC_FIRST(fromleaf, prev)", |
| 1347 | XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev))); |
| 1348 | #endif |
| 1349 | if (GDB_MULTI_ARCH) |
| 1350 | fprintf_unfiltered (file, |
| 1351 | "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n", |
| 1352 | (long) current_gdbarch->init_frame_pc_first |
| 1353 | /*INIT_FRAME_PC_FIRST ()*/); |
| 1354 | #endif |
| 1355 | #ifdef INNER_THAN |
| 1356 | fprintf_unfiltered (file, |
| 1357 | "gdbarch_dump: %s # %s\n", |
| 1358 | "INNER_THAN(lhs, rhs)", |
| 1359 | XSTRING (INNER_THAN (lhs, rhs))); |
| 1360 | if (GDB_MULTI_ARCH) |
| 1361 | fprintf_unfiltered (file, |
| 1362 | "gdbarch_dump: INNER_THAN = 0x%08lx\n", |
| 1363 | (long) current_gdbarch->inner_than |
| 1364 | /*INNER_THAN ()*/); |
| 1365 | #endif |
| 1366 | #ifdef INTEGER_TO_ADDRESS |
| 1367 | fprintf_unfiltered (file, |
| 1368 | "gdbarch_dump: %s # %s\n", |
| 1369 | "INTEGER_TO_ADDRESS(type, buf)", |
| 1370 | XSTRING (INTEGER_TO_ADDRESS (type, buf))); |
| 1371 | if (GDB_MULTI_ARCH) |
| 1372 | fprintf_unfiltered (file, |
| 1373 | "gdbarch_dump: INTEGER_TO_ADDRESS = 0x%08lx\n", |
| 1374 | (long) current_gdbarch->integer_to_address |
| 1375 | /*INTEGER_TO_ADDRESS ()*/); |
| 1376 | #endif |
| 1377 | #ifdef IN_SOLIB_CALL_TRAMPOLINE |
| 1378 | fprintf_unfiltered (file, |
| 1379 | "gdbarch_dump: %s # %s\n", |
| 1380 | "IN_SOLIB_CALL_TRAMPOLINE(pc, name)", |
| 1381 | XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name))); |
| 1382 | if (GDB_MULTI_ARCH) |
| 1383 | fprintf_unfiltered (file, |
| 1384 | "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = 0x%08lx\n", |
| 1385 | (long) current_gdbarch->in_solib_call_trampoline |
| 1386 | /*IN_SOLIB_CALL_TRAMPOLINE ()*/); |
| 1387 | #endif |
| 1388 | #ifdef MAX_REGISTER_RAW_SIZE |
| 1389 | fprintf_unfiltered (file, |
| 1390 | "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n", |
| 1391 | XSTRING (MAX_REGISTER_RAW_SIZE)); |
| 1392 | fprintf_unfiltered (file, |
| 1393 | "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %d\n", |
| 1394 | MAX_REGISTER_RAW_SIZE); |
| 1395 | #endif |
| 1396 | #ifdef MAX_REGISTER_VIRTUAL_SIZE |
| 1397 | fprintf_unfiltered (file, |
| 1398 | "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n", |
| 1399 | XSTRING (MAX_REGISTER_VIRTUAL_SIZE)); |
| 1400 | fprintf_unfiltered (file, |
| 1401 | "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %d\n", |
| 1402 | MAX_REGISTER_VIRTUAL_SIZE); |
| 1403 | #endif |
| 1404 | #ifdef MEMORY_INSERT_BREAKPOINT |
| 1405 | fprintf_unfiltered (file, |
| 1406 | "gdbarch_dump: %s # %s\n", |
| 1407 | "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)", |
| 1408 | XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache))); |
| 1409 | if (GDB_MULTI_ARCH) |
| 1410 | fprintf_unfiltered (file, |
| 1411 | "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n", |
| 1412 | (long) current_gdbarch->memory_insert_breakpoint |
| 1413 | /*MEMORY_INSERT_BREAKPOINT ()*/); |
| 1414 | #endif |
| 1415 | #ifdef MEMORY_REMOVE_BREAKPOINT |
| 1416 | fprintf_unfiltered (file, |
| 1417 | "gdbarch_dump: %s # %s\n", |
| 1418 | "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)", |
| 1419 | XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache))); |
| 1420 | if (GDB_MULTI_ARCH) |
| 1421 | fprintf_unfiltered (file, |
| 1422 | "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n", |
| 1423 | (long) current_gdbarch->memory_remove_breakpoint |
| 1424 | /*MEMORY_REMOVE_BREAKPOINT ()*/); |
| 1425 | #endif |
| 1426 | #ifdef NNPC_REGNUM |
| 1427 | fprintf_unfiltered (file, |
| 1428 | "gdbarch_dump: NNPC_REGNUM # %s\n", |
| 1429 | XSTRING (NNPC_REGNUM)); |
| 1430 | fprintf_unfiltered (file, |
| 1431 | "gdbarch_dump: NNPC_REGNUM = %d\n", |
| 1432 | NNPC_REGNUM); |
| 1433 | #endif |
| 1434 | #ifdef NPC_REGNUM |
| 1435 | fprintf_unfiltered (file, |
| 1436 | "gdbarch_dump: NPC_REGNUM # %s\n", |
| 1437 | XSTRING (NPC_REGNUM)); |
| 1438 | fprintf_unfiltered (file, |
| 1439 | "gdbarch_dump: NPC_REGNUM = %d\n", |
| 1440 | NPC_REGNUM); |
| 1441 | #endif |
| 1442 | #ifdef NUM_PSEUDO_REGS |
| 1443 | fprintf_unfiltered (file, |
| 1444 | "gdbarch_dump: NUM_PSEUDO_REGS # %s\n", |
| 1445 | XSTRING (NUM_PSEUDO_REGS)); |
| 1446 | fprintf_unfiltered (file, |
| 1447 | "gdbarch_dump: NUM_PSEUDO_REGS = %d\n", |
| 1448 | NUM_PSEUDO_REGS); |
| 1449 | #endif |
| 1450 | #ifdef NUM_REGS |
| 1451 | fprintf_unfiltered (file, |
| 1452 | "gdbarch_dump: NUM_REGS # %s\n", |
| 1453 | XSTRING (NUM_REGS)); |
| 1454 | fprintf_unfiltered (file, |
| 1455 | "gdbarch_dump: NUM_REGS = %d\n", |
| 1456 | NUM_REGS); |
| 1457 | #endif |
| 1458 | #ifdef PARM_BOUNDARY |
| 1459 | fprintf_unfiltered (file, |
| 1460 | "gdbarch_dump: PARM_BOUNDARY # %s\n", |
| 1461 | XSTRING (PARM_BOUNDARY)); |
| 1462 | fprintf_unfiltered (file, |
| 1463 | "gdbarch_dump: PARM_BOUNDARY = %d\n", |
| 1464 | PARM_BOUNDARY); |
| 1465 | #endif |
| 1466 | #ifdef PC_IN_CALL_DUMMY |
| 1467 | fprintf_unfiltered (file, |
| 1468 | "gdbarch_dump: %s # %s\n", |
| 1469 | "PC_IN_CALL_DUMMY(pc, sp, frame_address)", |
| 1470 | XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address))); |
| 1471 | if (GDB_MULTI_ARCH) |
| 1472 | fprintf_unfiltered (file, |
| 1473 | "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n", |
| 1474 | (long) current_gdbarch->pc_in_call_dummy |
| 1475 | /*PC_IN_CALL_DUMMY ()*/); |
| 1476 | #endif |
| 1477 | #ifdef PC_REGNUM |
| 1478 | fprintf_unfiltered (file, |
| 1479 | "gdbarch_dump: PC_REGNUM # %s\n", |
| 1480 | XSTRING (PC_REGNUM)); |
| 1481 | fprintf_unfiltered (file, |
| 1482 | "gdbarch_dump: PC_REGNUM = %d\n", |
| 1483 | PC_REGNUM); |
| 1484 | #endif |
| 1485 | #ifdef POINTER_TO_ADDRESS |
| 1486 | fprintf_unfiltered (file, |
| 1487 | "gdbarch_dump: %s # %s\n", |
| 1488 | "POINTER_TO_ADDRESS(type, buf)", |
| 1489 | XSTRING (POINTER_TO_ADDRESS (type, buf))); |
| 1490 | if (GDB_MULTI_ARCH) |
| 1491 | fprintf_unfiltered (file, |
| 1492 | "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n", |
| 1493 | (long) current_gdbarch->pointer_to_address |
| 1494 | /*POINTER_TO_ADDRESS ()*/); |
| 1495 | #endif |
| 1496 | #ifdef POP_FRAME |
| 1497 | #if GDB_MULTI_ARCH |
| 1498 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1499 | fprintf_unfiltered (file, |
| 1500 | "gdbarch_dump: %s # %s\n", |
| 1501 | "POP_FRAME(-)", |
| 1502 | XSTRING (POP_FRAME (-))); |
| 1503 | #endif |
| 1504 | if (GDB_MULTI_ARCH) |
| 1505 | fprintf_unfiltered (file, |
| 1506 | "gdbarch_dump: POP_FRAME = 0x%08lx\n", |
| 1507 | (long) current_gdbarch->pop_frame |
| 1508 | /*POP_FRAME ()*/); |
| 1509 | #endif |
| 1510 | #ifdef PREPARE_TO_PROCEED |
| 1511 | fprintf_unfiltered (file, |
| 1512 | "gdbarch_dump: %s # %s\n", |
| 1513 | "PREPARE_TO_PROCEED(select_it)", |
| 1514 | XSTRING (PREPARE_TO_PROCEED (select_it))); |
| 1515 | if (GDB_MULTI_ARCH) |
| 1516 | fprintf_unfiltered (file, |
| 1517 | "gdbarch_dump: PREPARE_TO_PROCEED = 0x%08lx\n", |
| 1518 | (long) current_gdbarch->prepare_to_proceed |
| 1519 | /*PREPARE_TO_PROCEED ()*/); |
| 1520 | #endif |
| 1521 | #ifdef PRINT_FLOAT_INFO |
| 1522 | #if GDB_MULTI_ARCH |
| 1523 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1524 | fprintf_unfiltered (file, |
| 1525 | "gdbarch_dump: %s # %s\n", |
| 1526 | "PRINT_FLOAT_INFO()", |
| 1527 | XSTRING (PRINT_FLOAT_INFO ())); |
| 1528 | #endif |
| 1529 | if (GDB_MULTI_ARCH) |
| 1530 | fprintf_unfiltered (file, |
| 1531 | "gdbarch_dump: PRINT_FLOAT_INFO = 0x%08lx\n", |
| 1532 | (long) current_gdbarch->print_float_info |
| 1533 | /*PRINT_FLOAT_INFO ()*/); |
| 1534 | #endif |
| 1535 | #ifdef PROLOGUE_FRAMELESS_P |
| 1536 | fprintf_unfiltered (file, |
| 1537 | "gdbarch_dump: %s # %s\n", |
| 1538 | "PROLOGUE_FRAMELESS_P(ip)", |
| 1539 | XSTRING (PROLOGUE_FRAMELESS_P (ip))); |
| 1540 | if (GDB_MULTI_ARCH) |
| 1541 | fprintf_unfiltered (file, |
| 1542 | "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n", |
| 1543 | (long) current_gdbarch->prologue_frameless_p |
| 1544 | /*PROLOGUE_FRAMELESS_P ()*/); |
| 1545 | #endif |
| 1546 | #ifdef PUSH_ARGUMENTS |
| 1547 | fprintf_unfiltered (file, |
| 1548 | "gdbarch_dump: %s # %s\n", |
| 1549 | "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)", |
| 1550 | XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr))); |
| 1551 | if (GDB_MULTI_ARCH) |
| 1552 | fprintf_unfiltered (file, |
| 1553 | "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n", |
| 1554 | (long) current_gdbarch->push_arguments |
| 1555 | /*PUSH_ARGUMENTS ()*/); |
| 1556 | #endif |
| 1557 | #ifdef PUSH_DUMMY_FRAME |
| 1558 | #if GDB_MULTI_ARCH |
| 1559 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1560 | fprintf_unfiltered (file, |
| 1561 | "gdbarch_dump: %s # %s\n", |
| 1562 | "PUSH_DUMMY_FRAME(-)", |
| 1563 | XSTRING (PUSH_DUMMY_FRAME (-))); |
| 1564 | #endif |
| 1565 | if (GDB_MULTI_ARCH) |
| 1566 | fprintf_unfiltered (file, |
| 1567 | "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n", |
| 1568 | (long) current_gdbarch->push_dummy_frame |
| 1569 | /*PUSH_DUMMY_FRAME ()*/); |
| 1570 | #endif |
| 1571 | #ifdef PUSH_RETURN_ADDRESS |
| 1572 | fprintf_unfiltered (file, |
| 1573 | "gdbarch_dump: %s # %s\n", |
| 1574 | "PUSH_RETURN_ADDRESS(pc, sp)", |
| 1575 | XSTRING (PUSH_RETURN_ADDRESS (pc, sp))); |
| 1576 | if (GDB_MULTI_ARCH) |
| 1577 | fprintf_unfiltered (file, |
| 1578 | "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n", |
| 1579 | (long) current_gdbarch->push_return_address |
| 1580 | /*PUSH_RETURN_ADDRESS ()*/); |
| 1581 | #endif |
| 1582 | #ifdef REGISTER_BYTE |
| 1583 | fprintf_unfiltered (file, |
| 1584 | "gdbarch_dump: %s # %s\n", |
| 1585 | "REGISTER_BYTE(reg_nr)", |
| 1586 | XSTRING (REGISTER_BYTE (reg_nr))); |
| 1587 | if (GDB_MULTI_ARCH) |
| 1588 | fprintf_unfiltered (file, |
| 1589 | "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n", |
| 1590 | (long) current_gdbarch->register_byte |
| 1591 | /*REGISTER_BYTE ()*/); |
| 1592 | #endif |
| 1593 | #ifdef REGISTER_BYTES |
| 1594 | fprintf_unfiltered (file, |
| 1595 | "gdbarch_dump: REGISTER_BYTES # %s\n", |
| 1596 | XSTRING (REGISTER_BYTES)); |
| 1597 | fprintf_unfiltered (file, |
| 1598 | "gdbarch_dump: REGISTER_BYTES = %d\n", |
| 1599 | REGISTER_BYTES); |
| 1600 | #endif |
| 1601 | #ifdef REGISTER_BYTES_OK |
| 1602 | fprintf_unfiltered (file, |
| 1603 | "gdbarch_dump: %s # %s\n", |
| 1604 | "REGISTER_BYTES_OK(nr_bytes)", |
| 1605 | XSTRING (REGISTER_BYTES_OK (nr_bytes))); |
| 1606 | if (GDB_MULTI_ARCH) |
| 1607 | fprintf_unfiltered (file, |
| 1608 | "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n", |
| 1609 | (long) current_gdbarch->register_bytes_ok |
| 1610 | /*REGISTER_BYTES_OK ()*/); |
| 1611 | #endif |
| 1612 | #ifdef REGISTER_CONVERTIBLE |
| 1613 | fprintf_unfiltered (file, |
| 1614 | "gdbarch_dump: %s # %s\n", |
| 1615 | "REGISTER_CONVERTIBLE(nr)", |
| 1616 | XSTRING (REGISTER_CONVERTIBLE (nr))); |
| 1617 | if (GDB_MULTI_ARCH) |
| 1618 | fprintf_unfiltered (file, |
| 1619 | "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n", |
| 1620 | (long) current_gdbarch->register_convertible |
| 1621 | /*REGISTER_CONVERTIBLE ()*/); |
| 1622 | #endif |
| 1623 | #ifdef REGISTER_CONVERT_TO_RAW |
| 1624 | #if GDB_MULTI_ARCH |
| 1625 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1626 | fprintf_unfiltered (file, |
| 1627 | "gdbarch_dump: %s # %s\n", |
| 1628 | "REGISTER_CONVERT_TO_RAW(type, regnum, from, to)", |
| 1629 | XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to))); |
| 1630 | #endif |
| 1631 | if (GDB_MULTI_ARCH) |
| 1632 | fprintf_unfiltered (file, |
| 1633 | "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n", |
| 1634 | (long) current_gdbarch->register_convert_to_raw |
| 1635 | /*REGISTER_CONVERT_TO_RAW ()*/); |
| 1636 | #endif |
| 1637 | #ifdef REGISTER_CONVERT_TO_VIRTUAL |
| 1638 | #if GDB_MULTI_ARCH |
| 1639 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1640 | fprintf_unfiltered (file, |
| 1641 | "gdbarch_dump: %s # %s\n", |
| 1642 | "REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)", |
| 1643 | XSTRING (REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to))); |
| 1644 | #endif |
| 1645 | if (GDB_MULTI_ARCH) |
| 1646 | fprintf_unfiltered (file, |
| 1647 | "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n", |
| 1648 | (long) current_gdbarch->register_convert_to_virtual |
| 1649 | /*REGISTER_CONVERT_TO_VIRTUAL ()*/); |
| 1650 | #endif |
| 1651 | #ifdef REGISTER_NAME |
| 1652 | fprintf_unfiltered (file, |
| 1653 | "gdbarch_dump: %s # %s\n", |
| 1654 | "REGISTER_NAME(regnr)", |
| 1655 | XSTRING (REGISTER_NAME (regnr))); |
| 1656 | if (GDB_MULTI_ARCH) |
| 1657 | fprintf_unfiltered (file, |
| 1658 | "gdbarch_dump: REGISTER_NAME = 0x%08lx\n", |
| 1659 | (long) current_gdbarch->register_name |
| 1660 | /*REGISTER_NAME ()*/); |
| 1661 | #endif |
| 1662 | #ifdef REGISTER_RAW_SIZE |
| 1663 | fprintf_unfiltered (file, |
| 1664 | "gdbarch_dump: %s # %s\n", |
| 1665 | "REGISTER_RAW_SIZE(reg_nr)", |
| 1666 | XSTRING (REGISTER_RAW_SIZE (reg_nr))); |
| 1667 | if (GDB_MULTI_ARCH) |
| 1668 | fprintf_unfiltered (file, |
| 1669 | "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n", |
| 1670 | (long) current_gdbarch->register_raw_size |
| 1671 | /*REGISTER_RAW_SIZE ()*/); |
| 1672 | #endif |
| 1673 | #ifdef REGISTER_SIM_REGNO |
| 1674 | fprintf_unfiltered (file, |
| 1675 | "gdbarch_dump: %s # %s\n", |
| 1676 | "REGISTER_SIM_REGNO(reg_nr)", |
| 1677 | XSTRING (REGISTER_SIM_REGNO (reg_nr))); |
| 1678 | if (GDB_MULTI_ARCH) |
| 1679 | fprintf_unfiltered (file, |
| 1680 | "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n", |
| 1681 | (long) current_gdbarch->register_sim_regno |
| 1682 | /*REGISTER_SIM_REGNO ()*/); |
| 1683 | #endif |
| 1684 | #ifdef REGISTER_SIZE |
| 1685 | fprintf_unfiltered (file, |
| 1686 | "gdbarch_dump: REGISTER_SIZE # %s\n", |
| 1687 | XSTRING (REGISTER_SIZE)); |
| 1688 | fprintf_unfiltered (file, |
| 1689 | "gdbarch_dump: REGISTER_SIZE = %d\n", |
| 1690 | REGISTER_SIZE); |
| 1691 | #endif |
| 1692 | #ifdef REGISTER_VIRTUAL_SIZE |
| 1693 | fprintf_unfiltered (file, |
| 1694 | "gdbarch_dump: %s # %s\n", |
| 1695 | "REGISTER_VIRTUAL_SIZE(reg_nr)", |
| 1696 | XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr))); |
| 1697 | if (GDB_MULTI_ARCH) |
| 1698 | fprintf_unfiltered (file, |
| 1699 | "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n", |
| 1700 | (long) current_gdbarch->register_virtual_size |
| 1701 | /*REGISTER_VIRTUAL_SIZE ()*/); |
| 1702 | #endif |
| 1703 | #ifdef REGISTER_VIRTUAL_TYPE |
| 1704 | fprintf_unfiltered (file, |
| 1705 | "gdbarch_dump: %s # %s\n", |
| 1706 | "REGISTER_VIRTUAL_TYPE(reg_nr)", |
| 1707 | XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr))); |
| 1708 | if (GDB_MULTI_ARCH) |
| 1709 | fprintf_unfiltered (file, |
| 1710 | "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n", |
| 1711 | (long) current_gdbarch->register_virtual_type |
| 1712 | /*REGISTER_VIRTUAL_TYPE ()*/); |
| 1713 | #endif |
| 1714 | #ifdef REG_STRUCT_HAS_ADDR |
| 1715 | fprintf_unfiltered (file, |
| 1716 | "gdbarch_dump: %s # %s\n", |
| 1717 | "REG_STRUCT_HAS_ADDR(gcc_p, type)", |
| 1718 | XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type))); |
| 1719 | if (GDB_MULTI_ARCH) |
| 1720 | fprintf_unfiltered (file, |
| 1721 | "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n", |
| 1722 | (long) current_gdbarch->reg_struct_has_addr |
| 1723 | /*REG_STRUCT_HAS_ADDR ()*/); |
| 1724 | #endif |
| 1725 | #ifdef REMOTE_TRANSLATE_XFER_ADDRESS |
| 1726 | #if GDB_MULTI_ARCH |
| 1727 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1728 | fprintf_unfiltered (file, |
| 1729 | "gdbarch_dump: %s # %s\n", |
| 1730 | "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)", |
| 1731 | XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len))); |
| 1732 | #endif |
| 1733 | if (GDB_MULTI_ARCH) |
| 1734 | fprintf_unfiltered (file, |
| 1735 | "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n", |
| 1736 | (long) current_gdbarch->remote_translate_xfer_address |
| 1737 | /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/); |
| 1738 | #endif |
| 1739 | #ifdef RETURN_VALUE_ON_STACK |
| 1740 | fprintf_unfiltered (file, |
| 1741 | "gdbarch_dump: %s # %s\n", |
| 1742 | "RETURN_VALUE_ON_STACK(type)", |
| 1743 | XSTRING (RETURN_VALUE_ON_STACK (type))); |
| 1744 | if (GDB_MULTI_ARCH) |
| 1745 | fprintf_unfiltered (file, |
| 1746 | "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n", |
| 1747 | (long) current_gdbarch->return_value_on_stack |
| 1748 | /*RETURN_VALUE_ON_STACK ()*/); |
| 1749 | #endif |
| 1750 | #ifdef SAVED_PC_AFTER_CALL |
| 1751 | fprintf_unfiltered (file, |
| 1752 | "gdbarch_dump: %s # %s\n", |
| 1753 | "SAVED_PC_AFTER_CALL(frame)", |
| 1754 | XSTRING (SAVED_PC_AFTER_CALL (frame))); |
| 1755 | if (GDB_MULTI_ARCH) |
| 1756 | fprintf_unfiltered (file, |
| 1757 | "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n", |
| 1758 | (long) current_gdbarch->saved_pc_after_call |
| 1759 | /*SAVED_PC_AFTER_CALL ()*/); |
| 1760 | #endif |
| 1761 | #ifdef SAVE_DUMMY_FRAME_TOS |
| 1762 | #if GDB_MULTI_ARCH |
| 1763 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1764 | fprintf_unfiltered (file, |
| 1765 | "gdbarch_dump: %s # %s\n", |
| 1766 | "SAVE_DUMMY_FRAME_TOS(sp)", |
| 1767 | XSTRING (SAVE_DUMMY_FRAME_TOS (sp))); |
| 1768 | #endif |
| 1769 | if (GDB_MULTI_ARCH) |
| 1770 | fprintf_unfiltered (file, |
| 1771 | "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n", |
| 1772 | (long) current_gdbarch->save_dummy_frame_tos |
| 1773 | /*SAVE_DUMMY_FRAME_TOS ()*/); |
| 1774 | #endif |
| 1775 | #ifdef SDB_REG_TO_REGNUM |
| 1776 | fprintf_unfiltered (file, |
| 1777 | "gdbarch_dump: %s # %s\n", |
| 1778 | "SDB_REG_TO_REGNUM(sdb_regnr)", |
| 1779 | XSTRING (SDB_REG_TO_REGNUM (sdb_regnr))); |
| 1780 | if (GDB_MULTI_ARCH) |
| 1781 | fprintf_unfiltered (file, |
| 1782 | "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n", |
| 1783 | (long) current_gdbarch->sdb_reg_to_regnum |
| 1784 | /*SDB_REG_TO_REGNUM ()*/); |
| 1785 | #endif |
| 1786 | #ifdef SIZEOF_CALL_DUMMY_WORDS |
| 1787 | fprintf_unfiltered (file, |
| 1788 | "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n", |
| 1789 | XSTRING (SIZEOF_CALL_DUMMY_WORDS)); |
| 1790 | fprintf_unfiltered (file, |
| 1791 | "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n", |
| 1792 | (long) SIZEOF_CALL_DUMMY_WORDS); |
| 1793 | #endif |
| 1794 | #ifdef SKIP_PROLOGUE |
| 1795 | fprintf_unfiltered (file, |
| 1796 | "gdbarch_dump: %s # %s\n", |
| 1797 | "SKIP_PROLOGUE(ip)", |
| 1798 | XSTRING (SKIP_PROLOGUE (ip))); |
| 1799 | if (GDB_MULTI_ARCH) |
| 1800 | fprintf_unfiltered (file, |
| 1801 | "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n", |
| 1802 | (long) current_gdbarch->skip_prologue |
| 1803 | /*SKIP_PROLOGUE ()*/); |
| 1804 | #endif |
| 1805 | #ifdef SKIP_TRAMPOLINE_CODE |
| 1806 | fprintf_unfiltered (file, |
| 1807 | "gdbarch_dump: %s # %s\n", |
| 1808 | "SKIP_TRAMPOLINE_CODE(pc)", |
| 1809 | XSTRING (SKIP_TRAMPOLINE_CODE (pc))); |
| 1810 | if (GDB_MULTI_ARCH) |
| 1811 | fprintf_unfiltered (file, |
| 1812 | "gdbarch_dump: SKIP_TRAMPOLINE_CODE = 0x%08lx\n", |
| 1813 | (long) current_gdbarch->skip_trampoline_code |
| 1814 | /*SKIP_TRAMPOLINE_CODE ()*/); |
| 1815 | #endif |
| 1816 | #ifdef SMASH_TEXT_ADDRESS |
| 1817 | fprintf_unfiltered (file, |
| 1818 | "gdbarch_dump: %s # %s\n", |
| 1819 | "SMASH_TEXT_ADDRESS(addr)", |
| 1820 | XSTRING (SMASH_TEXT_ADDRESS (addr))); |
| 1821 | if (GDB_MULTI_ARCH) |
| 1822 | fprintf_unfiltered (file, |
| 1823 | "gdbarch_dump: SMASH_TEXT_ADDRESS = 0x%08lx\n", |
| 1824 | (long) current_gdbarch->smash_text_address |
| 1825 | /*SMASH_TEXT_ADDRESS ()*/); |
| 1826 | #endif |
| 1827 | #ifdef SOFTWARE_SINGLE_STEP |
| 1828 | #if GDB_MULTI_ARCH |
| 1829 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1830 | fprintf_unfiltered (file, |
| 1831 | "gdbarch_dump: %s # %s\n", |
| 1832 | "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)", |
| 1833 | XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p))); |
| 1834 | #endif |
| 1835 | if (GDB_MULTI_ARCH) |
| 1836 | fprintf_unfiltered (file, |
| 1837 | "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n", |
| 1838 | (long) current_gdbarch->software_single_step |
| 1839 | /*SOFTWARE_SINGLE_STEP ()*/); |
| 1840 | #endif |
| 1841 | #ifdef SP_REGNUM |
| 1842 | fprintf_unfiltered (file, |
| 1843 | "gdbarch_dump: SP_REGNUM # %s\n", |
| 1844 | XSTRING (SP_REGNUM)); |
| 1845 | fprintf_unfiltered (file, |
| 1846 | "gdbarch_dump: SP_REGNUM = %d\n", |
| 1847 | SP_REGNUM); |
| 1848 | #endif |
| 1849 | #ifdef STAB_REG_TO_REGNUM |
| 1850 | fprintf_unfiltered (file, |
| 1851 | "gdbarch_dump: %s # %s\n", |
| 1852 | "STAB_REG_TO_REGNUM(stab_regnr)", |
| 1853 | XSTRING (STAB_REG_TO_REGNUM (stab_regnr))); |
| 1854 | if (GDB_MULTI_ARCH) |
| 1855 | fprintf_unfiltered (file, |
| 1856 | "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n", |
| 1857 | (long) current_gdbarch->stab_reg_to_regnum |
| 1858 | /*STAB_REG_TO_REGNUM ()*/); |
| 1859 | #endif |
| 1860 | #ifdef STACK_ALIGN |
| 1861 | fprintf_unfiltered (file, |
| 1862 | "gdbarch_dump: %s # %s\n", |
| 1863 | "STACK_ALIGN(sp)", |
| 1864 | XSTRING (STACK_ALIGN (sp))); |
| 1865 | if (GDB_MULTI_ARCH) |
| 1866 | fprintf_unfiltered (file, |
| 1867 | "gdbarch_dump: STACK_ALIGN = 0x%08lx\n", |
| 1868 | (long) current_gdbarch->stack_align |
| 1869 | /*STACK_ALIGN ()*/); |
| 1870 | #endif |
| 1871 | #ifdef STORE_PSEUDO_REGISTER |
| 1872 | #if GDB_MULTI_ARCH |
| 1873 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1874 | fprintf_unfiltered (file, |
| 1875 | "gdbarch_dump: %s # %s\n", |
| 1876 | "STORE_PSEUDO_REGISTER(regnum)", |
| 1877 | XSTRING (STORE_PSEUDO_REGISTER (regnum))); |
| 1878 | #endif |
| 1879 | if (GDB_MULTI_ARCH) |
| 1880 | fprintf_unfiltered (file, |
| 1881 | "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n", |
| 1882 | (long) current_gdbarch->store_pseudo_register |
| 1883 | /*STORE_PSEUDO_REGISTER ()*/); |
| 1884 | #endif |
| 1885 | #ifdef STORE_RETURN_VALUE |
| 1886 | #if GDB_MULTI_ARCH |
| 1887 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1888 | fprintf_unfiltered (file, |
| 1889 | "gdbarch_dump: %s # %s\n", |
| 1890 | "STORE_RETURN_VALUE(type, valbuf)", |
| 1891 | XSTRING (STORE_RETURN_VALUE (type, valbuf))); |
| 1892 | #endif |
| 1893 | if (GDB_MULTI_ARCH) |
| 1894 | fprintf_unfiltered (file, |
| 1895 | "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n", |
| 1896 | (long) current_gdbarch->store_return_value |
| 1897 | /*STORE_RETURN_VALUE ()*/); |
| 1898 | #endif |
| 1899 | #ifdef STORE_STRUCT_RETURN |
| 1900 | #if GDB_MULTI_ARCH |
| 1901 | /* Macro might contain `[{}]' when not multi-arch */ |
| 1902 | fprintf_unfiltered (file, |
| 1903 | "gdbarch_dump: %s # %s\n", |
| 1904 | "STORE_STRUCT_RETURN(addr, sp)", |
| 1905 | XSTRING (STORE_STRUCT_RETURN (addr, sp))); |
| 1906 | #endif |
| 1907 | if (GDB_MULTI_ARCH) |
| 1908 | fprintf_unfiltered (file, |
| 1909 | "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n", |
| 1910 | (long) current_gdbarch->store_struct_return |
| 1911 | /*STORE_STRUCT_RETURN ()*/); |
| 1912 | #endif |
| 1913 | #ifdef TARGET_ADDR_BIT |
| 1914 | fprintf_unfiltered (file, |
| 1915 | "gdbarch_dump: TARGET_ADDR_BIT # %s\n", |
| 1916 | XSTRING (TARGET_ADDR_BIT)); |
| 1917 | fprintf_unfiltered (file, |
| 1918 | "gdbarch_dump: TARGET_ADDR_BIT = %d\n", |
| 1919 | TARGET_ADDR_BIT); |
| 1920 | #endif |
| 1921 | #ifdef TARGET_ARCHITECTURE |
| 1922 | fprintf_unfiltered (file, |
| 1923 | "gdbarch_dump: TARGET_ARCHITECTURE # %s\n", |
| 1924 | XSTRING (TARGET_ARCHITECTURE)); |
| 1925 | if (TARGET_ARCHITECTURE != NULL) |
| 1926 | fprintf_unfiltered (file, |
| 1927 | "gdbarch_dump: TARGET_ARCHITECTURE = %s\n", |
| 1928 | TARGET_ARCHITECTURE->printable_name); |
| 1929 | #endif |
| 1930 | #ifdef TARGET_BFD_VMA_BIT |
| 1931 | fprintf_unfiltered (file, |
| 1932 | "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n", |
| 1933 | XSTRING (TARGET_BFD_VMA_BIT)); |
| 1934 | fprintf_unfiltered (file, |
| 1935 | "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n", |
| 1936 | TARGET_BFD_VMA_BIT); |
| 1937 | #endif |
| 1938 | #ifdef TARGET_BYTE_ORDER |
| 1939 | fprintf_unfiltered (file, |
| 1940 | "gdbarch_dump: TARGET_BYTE_ORDER # %s\n", |
| 1941 | XSTRING (TARGET_BYTE_ORDER)); |
| 1942 | fprintf_unfiltered (file, |
| 1943 | "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n", |
| 1944 | (long) TARGET_BYTE_ORDER); |
| 1945 | #endif |
| 1946 | #ifdef TARGET_CHAR_SIGNED |
| 1947 | fprintf_unfiltered (file, |
| 1948 | "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n", |
| 1949 | XSTRING (TARGET_CHAR_SIGNED)); |
| 1950 | fprintf_unfiltered (file, |
| 1951 | "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n", |
| 1952 | TARGET_CHAR_SIGNED); |
| 1953 | #endif |
| 1954 | #ifdef TARGET_DOUBLE_BIT |
| 1955 | fprintf_unfiltered (file, |
| 1956 | "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n", |
| 1957 | XSTRING (TARGET_DOUBLE_BIT)); |
| 1958 | fprintf_unfiltered (file, |
| 1959 | "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n", |
| 1960 | TARGET_DOUBLE_BIT); |
| 1961 | #endif |
| 1962 | #ifdef TARGET_DOUBLE_FORMAT |
| 1963 | fprintf_unfiltered (file, |
| 1964 | "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n", |
| 1965 | XSTRING (TARGET_DOUBLE_FORMAT)); |
| 1966 | fprintf_unfiltered (file, |
| 1967 | "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n", |
| 1968 | (long) TARGET_DOUBLE_FORMAT); |
| 1969 | #endif |
| 1970 | #ifdef TARGET_FLOAT_BIT |
| 1971 | fprintf_unfiltered (file, |
| 1972 | "gdbarch_dump: TARGET_FLOAT_BIT # %s\n", |
| 1973 | XSTRING (TARGET_FLOAT_BIT)); |
| 1974 | fprintf_unfiltered (file, |
| 1975 | "gdbarch_dump: TARGET_FLOAT_BIT = %d\n", |
| 1976 | TARGET_FLOAT_BIT); |
| 1977 | #endif |
| 1978 | #ifdef TARGET_FLOAT_FORMAT |
| 1979 | fprintf_unfiltered (file, |
| 1980 | "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n", |
| 1981 | XSTRING (TARGET_FLOAT_FORMAT)); |
| 1982 | fprintf_unfiltered (file, |
| 1983 | "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n", |
| 1984 | (long) TARGET_FLOAT_FORMAT); |
| 1985 | #endif |
| 1986 | #ifdef TARGET_INT_BIT |
| 1987 | fprintf_unfiltered (file, |
| 1988 | "gdbarch_dump: TARGET_INT_BIT # %s\n", |
| 1989 | XSTRING (TARGET_INT_BIT)); |
| 1990 | fprintf_unfiltered (file, |
| 1991 | "gdbarch_dump: TARGET_INT_BIT = %d\n", |
| 1992 | TARGET_INT_BIT); |
| 1993 | #endif |
| 1994 | #ifdef TARGET_LONG_BIT |
| 1995 | fprintf_unfiltered (file, |
| 1996 | "gdbarch_dump: TARGET_LONG_BIT # %s\n", |
| 1997 | XSTRING (TARGET_LONG_BIT)); |
| 1998 | fprintf_unfiltered (file, |
| 1999 | "gdbarch_dump: TARGET_LONG_BIT = %d\n", |
| 2000 | TARGET_LONG_BIT); |
| 2001 | #endif |
| 2002 | #ifdef TARGET_LONG_DOUBLE_BIT |
| 2003 | fprintf_unfiltered (file, |
| 2004 | "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n", |
| 2005 | XSTRING (TARGET_LONG_DOUBLE_BIT)); |
| 2006 | fprintf_unfiltered (file, |
| 2007 | "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n", |
| 2008 | TARGET_LONG_DOUBLE_BIT); |
| 2009 | #endif |
| 2010 | #ifdef TARGET_LONG_DOUBLE_FORMAT |
| 2011 | fprintf_unfiltered (file, |
| 2012 | "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n", |
| 2013 | XSTRING (TARGET_LONG_DOUBLE_FORMAT)); |
| 2014 | fprintf_unfiltered (file, |
| 2015 | "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n", |
| 2016 | (long) TARGET_LONG_DOUBLE_FORMAT); |
| 2017 | #endif |
| 2018 | #ifdef TARGET_LONG_LONG_BIT |
| 2019 | fprintf_unfiltered (file, |
| 2020 | "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n", |
| 2021 | XSTRING (TARGET_LONG_LONG_BIT)); |
| 2022 | fprintf_unfiltered (file, |
| 2023 | "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n", |
| 2024 | TARGET_LONG_LONG_BIT); |
| 2025 | #endif |
| 2026 | #ifdef TARGET_PRINT_INSN |
| 2027 | fprintf_unfiltered (file, |
| 2028 | "gdbarch_dump: %s # %s\n", |
| 2029 | "TARGET_PRINT_INSN(vma, info)", |
| 2030 | XSTRING (TARGET_PRINT_INSN (vma, info))); |
| 2031 | if (GDB_MULTI_ARCH) |
| 2032 | fprintf_unfiltered (file, |
| 2033 | "gdbarch_dump: TARGET_PRINT_INSN = 0x%08lx\n", |
| 2034 | (long) current_gdbarch->print_insn |
| 2035 | /*TARGET_PRINT_INSN ()*/); |
| 2036 | #endif |
| 2037 | #ifdef TARGET_PTR_BIT |
| 2038 | fprintf_unfiltered (file, |
| 2039 | "gdbarch_dump: TARGET_PTR_BIT # %s\n", |
| 2040 | XSTRING (TARGET_PTR_BIT)); |
| 2041 | fprintf_unfiltered (file, |
| 2042 | "gdbarch_dump: TARGET_PTR_BIT = %d\n", |
| 2043 | TARGET_PTR_BIT); |
| 2044 | #endif |
| 2045 | #ifdef TARGET_READ_FP |
| 2046 | fprintf_unfiltered (file, |
| 2047 | "gdbarch_dump: %s # %s\n", |
| 2048 | "TARGET_READ_FP()", |
| 2049 | XSTRING (TARGET_READ_FP ())); |
| 2050 | if (GDB_MULTI_ARCH) |
| 2051 | fprintf_unfiltered (file, |
| 2052 | "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n", |
| 2053 | (long) current_gdbarch->read_fp |
| 2054 | /*TARGET_READ_FP ()*/); |
| 2055 | #endif |
| 2056 | #ifdef TARGET_READ_PC |
| 2057 | fprintf_unfiltered (file, |
| 2058 | "gdbarch_dump: %s # %s\n", |
| 2059 | "TARGET_READ_PC(ptid)", |
| 2060 | XSTRING (TARGET_READ_PC (ptid))); |
| 2061 | if (GDB_MULTI_ARCH) |
| 2062 | fprintf_unfiltered (file, |
| 2063 | "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n", |
| 2064 | (long) current_gdbarch->read_pc |
| 2065 | /*TARGET_READ_PC ()*/); |
| 2066 | #endif |
| 2067 | #ifdef TARGET_READ_SP |
| 2068 | fprintf_unfiltered (file, |
| 2069 | "gdbarch_dump: %s # %s\n", |
| 2070 | "TARGET_READ_SP()", |
| 2071 | XSTRING (TARGET_READ_SP ())); |
| 2072 | if (GDB_MULTI_ARCH) |
| 2073 | fprintf_unfiltered (file, |
| 2074 | "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n", |
| 2075 | (long) current_gdbarch->read_sp |
| 2076 | /*TARGET_READ_SP ()*/); |
| 2077 | #endif |
| 2078 | #ifdef TARGET_SHORT_BIT |
| 2079 | fprintf_unfiltered (file, |
| 2080 | "gdbarch_dump: TARGET_SHORT_BIT # %s\n", |
| 2081 | XSTRING (TARGET_SHORT_BIT)); |
| 2082 | fprintf_unfiltered (file, |
| 2083 | "gdbarch_dump: TARGET_SHORT_BIT = %d\n", |
| 2084 | TARGET_SHORT_BIT); |
| 2085 | #endif |
| 2086 | #ifdef TARGET_VIRTUAL_FRAME_POINTER |
| 2087 | #if GDB_MULTI_ARCH |
| 2088 | /* Macro might contain `[{}]' when not multi-arch */ |
| 2089 | fprintf_unfiltered (file, |
| 2090 | "gdbarch_dump: %s # %s\n", |
| 2091 | "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)", |
| 2092 | XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset))); |
| 2093 | #endif |
| 2094 | if (GDB_MULTI_ARCH) |
| 2095 | fprintf_unfiltered (file, |
| 2096 | "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = 0x%08lx\n", |
| 2097 | (long) current_gdbarch->virtual_frame_pointer |
| 2098 | /*TARGET_VIRTUAL_FRAME_POINTER ()*/); |
| 2099 | #endif |
| 2100 | #ifdef TARGET_WRITE_FP |
| 2101 | #if GDB_MULTI_ARCH |
| 2102 | /* Macro might contain `[{}]' when not multi-arch */ |
| 2103 | fprintf_unfiltered (file, |
| 2104 | "gdbarch_dump: %s # %s\n", |
| 2105 | "TARGET_WRITE_FP(val)", |
| 2106 | XSTRING (TARGET_WRITE_FP (val))); |
| 2107 | #endif |
| 2108 | if (GDB_MULTI_ARCH) |
| 2109 | fprintf_unfiltered (file, |
| 2110 | "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n", |
| 2111 | (long) current_gdbarch->write_fp |
| 2112 | /*TARGET_WRITE_FP ()*/); |
| 2113 | #endif |
| 2114 | #ifdef TARGET_WRITE_PC |
| 2115 | #if GDB_MULTI_ARCH |
| 2116 | /* Macro might contain `[{}]' when not multi-arch */ |
| 2117 | fprintf_unfiltered (file, |
| 2118 | "gdbarch_dump: %s # %s\n", |
| 2119 | "TARGET_WRITE_PC(val, ptid)", |
| 2120 | XSTRING (TARGET_WRITE_PC (val, ptid))); |
| 2121 | #endif |
| 2122 | if (GDB_MULTI_ARCH) |
| 2123 | fprintf_unfiltered (file, |
| 2124 | "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n", |
| 2125 | (long) current_gdbarch->write_pc |
| 2126 | /*TARGET_WRITE_PC ()*/); |
| 2127 | #endif |
| 2128 | #ifdef TARGET_WRITE_SP |
| 2129 | #if GDB_MULTI_ARCH |
| 2130 | /* Macro might contain `[{}]' when not multi-arch */ |
| 2131 | fprintf_unfiltered (file, |
| 2132 | "gdbarch_dump: %s # %s\n", |
| 2133 | "TARGET_WRITE_SP(val)", |
| 2134 | XSTRING (TARGET_WRITE_SP (val))); |
| 2135 | #endif |
| 2136 | if (GDB_MULTI_ARCH) |
| 2137 | fprintf_unfiltered (file, |
| 2138 | "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n", |
| 2139 | (long) current_gdbarch->write_sp |
| 2140 | /*TARGET_WRITE_SP ()*/); |
| 2141 | #endif |
| 2142 | #ifdef USE_GENERIC_DUMMY_FRAMES |
| 2143 | fprintf_unfiltered (file, |
| 2144 | "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n", |
| 2145 | XSTRING (USE_GENERIC_DUMMY_FRAMES)); |
| 2146 | fprintf_unfiltered (file, |
| 2147 | "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %d\n", |
| 2148 | USE_GENERIC_DUMMY_FRAMES); |
| 2149 | #endif |
| 2150 | #ifdef USE_STRUCT_CONVENTION |
| 2151 | fprintf_unfiltered (file, |
| 2152 | "gdbarch_dump: %s # %s\n", |
| 2153 | "USE_STRUCT_CONVENTION(gcc_p, value_type)", |
| 2154 | XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type))); |
| 2155 | if (GDB_MULTI_ARCH) |
| 2156 | fprintf_unfiltered (file, |
| 2157 | "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n", |
| 2158 | (long) current_gdbarch->use_struct_convention |
| 2159 | /*USE_STRUCT_CONVENTION ()*/); |
| 2160 | #endif |
| 2161 | if (current_gdbarch->dump_tdep != NULL) |
| 2162 | current_gdbarch->dump_tdep (current_gdbarch, file); |
| 2163 | } |
| 2164 | |
| 2165 | struct gdbarch_tdep * |
| 2166 | gdbarch_tdep (struct gdbarch *gdbarch) |
| 2167 | { |
| 2168 | if (gdbarch_debug >= 2) |
| 2169 | fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); |
| 2170 | return gdbarch->tdep; |
| 2171 | } |
| 2172 | |
| 2173 | |
| 2174 | const struct bfd_arch_info * |
| 2175 | gdbarch_bfd_arch_info (struct gdbarch *gdbarch) |
| 2176 | { |
| 2177 | if (gdbarch_debug >= 2) |
| 2178 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n"); |
| 2179 | return gdbarch->bfd_arch_info; |
| 2180 | } |
| 2181 | |
| 2182 | int |
| 2183 | gdbarch_byte_order (struct gdbarch *gdbarch) |
| 2184 | { |
| 2185 | if (gdbarch_debug >= 2) |
| 2186 | fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n"); |
| 2187 | return gdbarch->byte_order; |
| 2188 | } |
| 2189 | |
| 2190 | int |
| 2191 | gdbarch_short_bit (struct gdbarch *gdbarch) |
| 2192 | { |
| 2193 | /* Skip verify of short_bit, invalid_p == 0 */ |
| 2194 | if (gdbarch_debug >= 2) |
| 2195 | fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n"); |
| 2196 | return gdbarch->short_bit; |
| 2197 | } |
| 2198 | |
| 2199 | void |
| 2200 | set_gdbarch_short_bit (struct gdbarch *gdbarch, |
| 2201 | int short_bit) |
| 2202 | { |
| 2203 | gdbarch->short_bit = short_bit; |
| 2204 | } |
| 2205 | |
| 2206 | int |
| 2207 | gdbarch_int_bit (struct gdbarch *gdbarch) |
| 2208 | { |
| 2209 | /* Skip verify of int_bit, invalid_p == 0 */ |
| 2210 | if (gdbarch_debug >= 2) |
| 2211 | fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n"); |
| 2212 | return gdbarch->int_bit; |
| 2213 | } |
| 2214 | |
| 2215 | void |
| 2216 | set_gdbarch_int_bit (struct gdbarch *gdbarch, |
| 2217 | int int_bit) |
| 2218 | { |
| 2219 | gdbarch->int_bit = int_bit; |
| 2220 | } |
| 2221 | |
| 2222 | int |
| 2223 | gdbarch_long_bit (struct gdbarch *gdbarch) |
| 2224 | { |
| 2225 | /* Skip verify of long_bit, invalid_p == 0 */ |
| 2226 | if (gdbarch_debug >= 2) |
| 2227 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n"); |
| 2228 | return gdbarch->long_bit; |
| 2229 | } |
| 2230 | |
| 2231 | void |
| 2232 | set_gdbarch_long_bit (struct gdbarch *gdbarch, |
| 2233 | int long_bit) |
| 2234 | { |
| 2235 | gdbarch->long_bit = long_bit; |
| 2236 | } |
| 2237 | |
| 2238 | int |
| 2239 | gdbarch_long_long_bit (struct gdbarch *gdbarch) |
| 2240 | { |
| 2241 | /* Skip verify of long_long_bit, invalid_p == 0 */ |
| 2242 | if (gdbarch_debug >= 2) |
| 2243 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n"); |
| 2244 | return gdbarch->long_long_bit; |
| 2245 | } |
| 2246 | |
| 2247 | void |
| 2248 | set_gdbarch_long_long_bit (struct gdbarch *gdbarch, |
| 2249 | int long_long_bit) |
| 2250 | { |
| 2251 | gdbarch->long_long_bit = long_long_bit; |
| 2252 | } |
| 2253 | |
| 2254 | int |
| 2255 | gdbarch_float_bit (struct gdbarch *gdbarch) |
| 2256 | { |
| 2257 | /* Skip verify of float_bit, invalid_p == 0 */ |
| 2258 | if (gdbarch_debug >= 2) |
| 2259 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n"); |
| 2260 | return gdbarch->float_bit; |
| 2261 | } |
| 2262 | |
| 2263 | void |
| 2264 | set_gdbarch_float_bit (struct gdbarch *gdbarch, |
| 2265 | int float_bit) |
| 2266 | { |
| 2267 | gdbarch->float_bit = float_bit; |
| 2268 | } |
| 2269 | |
| 2270 | int |
| 2271 | gdbarch_double_bit (struct gdbarch *gdbarch) |
| 2272 | { |
| 2273 | /* Skip verify of double_bit, invalid_p == 0 */ |
| 2274 | if (gdbarch_debug >= 2) |
| 2275 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n"); |
| 2276 | return gdbarch->double_bit; |
| 2277 | } |
| 2278 | |
| 2279 | void |
| 2280 | set_gdbarch_double_bit (struct gdbarch *gdbarch, |
| 2281 | int double_bit) |
| 2282 | { |
| 2283 | gdbarch->double_bit = double_bit; |
| 2284 | } |
| 2285 | |
| 2286 | int |
| 2287 | gdbarch_long_double_bit (struct gdbarch *gdbarch) |
| 2288 | { |
| 2289 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
| 2290 | if (gdbarch_debug >= 2) |
| 2291 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n"); |
| 2292 | return gdbarch->long_double_bit; |
| 2293 | } |
| 2294 | |
| 2295 | void |
| 2296 | set_gdbarch_long_double_bit (struct gdbarch *gdbarch, |
| 2297 | int long_double_bit) |
| 2298 | { |
| 2299 | gdbarch->long_double_bit = long_double_bit; |
| 2300 | } |
| 2301 | |
| 2302 | int |
| 2303 | gdbarch_ptr_bit (struct gdbarch *gdbarch) |
| 2304 | { |
| 2305 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
| 2306 | if (gdbarch_debug >= 2) |
| 2307 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n"); |
| 2308 | return gdbarch->ptr_bit; |
| 2309 | } |
| 2310 | |
| 2311 | void |
| 2312 | set_gdbarch_ptr_bit (struct gdbarch *gdbarch, |
| 2313 | int ptr_bit) |
| 2314 | { |
| 2315 | gdbarch->ptr_bit = ptr_bit; |
| 2316 | } |
| 2317 | |
| 2318 | int |
| 2319 | gdbarch_addr_bit (struct gdbarch *gdbarch) |
| 2320 | { |
| 2321 | if (gdbarch->addr_bit == 0) |
| 2322 | internal_error (__FILE__, __LINE__, |
| 2323 | "gdbarch: gdbarch_addr_bit invalid"); |
| 2324 | if (gdbarch_debug >= 2) |
| 2325 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n"); |
| 2326 | return gdbarch->addr_bit; |
| 2327 | } |
| 2328 | |
| 2329 | void |
| 2330 | set_gdbarch_addr_bit (struct gdbarch *gdbarch, |
| 2331 | int addr_bit) |
| 2332 | { |
| 2333 | gdbarch->addr_bit = addr_bit; |
| 2334 | } |
| 2335 | |
| 2336 | int |
| 2337 | gdbarch_bfd_vma_bit (struct gdbarch *gdbarch) |
| 2338 | { |
| 2339 | /* Skip verify of bfd_vma_bit, invalid_p == 0 */ |
| 2340 | if (gdbarch_debug >= 2) |
| 2341 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n"); |
| 2342 | return gdbarch->bfd_vma_bit; |
| 2343 | } |
| 2344 | |
| 2345 | void |
| 2346 | set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, |
| 2347 | int bfd_vma_bit) |
| 2348 | { |
| 2349 | gdbarch->bfd_vma_bit = bfd_vma_bit; |
| 2350 | } |
| 2351 | |
| 2352 | int |
| 2353 | gdbarch_char_signed (struct gdbarch *gdbarch) |
| 2354 | { |
| 2355 | if (gdbarch->char_signed == -1) |
| 2356 | internal_error (__FILE__, __LINE__, |
| 2357 | "gdbarch: gdbarch_char_signed invalid"); |
| 2358 | if (gdbarch_debug >= 2) |
| 2359 | fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n"); |
| 2360 | return gdbarch->char_signed; |
| 2361 | } |
| 2362 | |
| 2363 | void |
| 2364 | set_gdbarch_char_signed (struct gdbarch *gdbarch, |
| 2365 | int char_signed) |
| 2366 | { |
| 2367 | gdbarch->char_signed = char_signed; |
| 2368 | } |
| 2369 | |
| 2370 | CORE_ADDR |
| 2371 | gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid) |
| 2372 | { |
| 2373 | if (gdbarch->read_pc == 0) |
| 2374 | internal_error (__FILE__, __LINE__, |
| 2375 | "gdbarch: gdbarch_read_pc invalid"); |
| 2376 | if (gdbarch_debug >= 2) |
| 2377 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); |
| 2378 | return gdbarch->read_pc (ptid); |
| 2379 | } |
| 2380 | |
| 2381 | void |
| 2382 | set_gdbarch_read_pc (struct gdbarch *gdbarch, |
| 2383 | gdbarch_read_pc_ftype read_pc) |
| 2384 | { |
| 2385 | gdbarch->read_pc = read_pc; |
| 2386 | } |
| 2387 | |
| 2388 | void |
| 2389 | gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid) |
| 2390 | { |
| 2391 | if (gdbarch->write_pc == 0) |
| 2392 | internal_error (__FILE__, __LINE__, |
| 2393 | "gdbarch: gdbarch_write_pc invalid"); |
| 2394 | if (gdbarch_debug >= 2) |
| 2395 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); |
| 2396 | gdbarch->write_pc (val, ptid); |
| 2397 | } |
| 2398 | |
| 2399 | void |
| 2400 | set_gdbarch_write_pc (struct gdbarch *gdbarch, |
| 2401 | gdbarch_write_pc_ftype write_pc) |
| 2402 | { |
| 2403 | gdbarch->write_pc = write_pc; |
| 2404 | } |
| 2405 | |
| 2406 | CORE_ADDR |
| 2407 | gdbarch_read_fp (struct gdbarch *gdbarch) |
| 2408 | { |
| 2409 | if (gdbarch->read_fp == 0) |
| 2410 | internal_error (__FILE__, __LINE__, |
| 2411 | "gdbarch: gdbarch_read_fp invalid"); |
| 2412 | if (gdbarch_debug >= 2) |
| 2413 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n"); |
| 2414 | return gdbarch->read_fp (); |
| 2415 | } |
| 2416 | |
| 2417 | void |
| 2418 | set_gdbarch_read_fp (struct gdbarch *gdbarch, |
| 2419 | gdbarch_read_fp_ftype read_fp) |
| 2420 | { |
| 2421 | gdbarch->read_fp = read_fp; |
| 2422 | } |
| 2423 | |
| 2424 | void |
| 2425 | gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val) |
| 2426 | { |
| 2427 | if (gdbarch->write_fp == 0) |
| 2428 | internal_error (__FILE__, __LINE__, |
| 2429 | "gdbarch: gdbarch_write_fp invalid"); |
| 2430 | if (gdbarch_debug >= 2) |
| 2431 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n"); |
| 2432 | gdbarch->write_fp (val); |
| 2433 | } |
| 2434 | |
| 2435 | void |
| 2436 | set_gdbarch_write_fp (struct gdbarch *gdbarch, |
| 2437 | gdbarch_write_fp_ftype write_fp) |
| 2438 | { |
| 2439 | gdbarch->write_fp = write_fp; |
| 2440 | } |
| 2441 | |
| 2442 | CORE_ADDR |
| 2443 | gdbarch_read_sp (struct gdbarch *gdbarch) |
| 2444 | { |
| 2445 | if (gdbarch->read_sp == 0) |
| 2446 | internal_error (__FILE__, __LINE__, |
| 2447 | "gdbarch: gdbarch_read_sp invalid"); |
| 2448 | if (gdbarch_debug >= 2) |
| 2449 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); |
| 2450 | return gdbarch->read_sp (); |
| 2451 | } |
| 2452 | |
| 2453 | void |
| 2454 | set_gdbarch_read_sp (struct gdbarch *gdbarch, |
| 2455 | gdbarch_read_sp_ftype read_sp) |
| 2456 | { |
| 2457 | gdbarch->read_sp = read_sp; |
| 2458 | } |
| 2459 | |
| 2460 | void |
| 2461 | gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) |
| 2462 | { |
| 2463 | if (gdbarch->write_sp == 0) |
| 2464 | internal_error (__FILE__, __LINE__, |
| 2465 | "gdbarch: gdbarch_write_sp invalid"); |
| 2466 | if (gdbarch_debug >= 2) |
| 2467 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n"); |
| 2468 | gdbarch->write_sp (val); |
| 2469 | } |
| 2470 | |
| 2471 | void |
| 2472 | set_gdbarch_write_sp (struct gdbarch *gdbarch, |
| 2473 | gdbarch_write_sp_ftype write_sp) |
| 2474 | { |
| 2475 | gdbarch->write_sp = write_sp; |
| 2476 | } |
| 2477 | |
| 2478 | void |
| 2479 | gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) |
| 2480 | { |
| 2481 | if (gdbarch->virtual_frame_pointer == 0) |
| 2482 | internal_error (__FILE__, __LINE__, |
| 2483 | "gdbarch: gdbarch_virtual_frame_pointer invalid"); |
| 2484 | if (gdbarch_debug >= 2) |
| 2485 | fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); |
| 2486 | gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset); |
| 2487 | } |
| 2488 | |
| 2489 | void |
| 2490 | set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, |
| 2491 | gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer) |
| 2492 | { |
| 2493 | gdbarch->virtual_frame_pointer = virtual_frame_pointer; |
| 2494 | } |
| 2495 | |
| 2496 | int |
| 2497 | gdbarch_register_read_p (struct gdbarch *gdbarch) |
| 2498 | { |
| 2499 | return gdbarch->register_read != 0; |
| 2500 | } |
| 2501 | |
| 2502 | void |
| 2503 | gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf) |
| 2504 | { |
| 2505 | if (gdbarch->register_read == 0) |
| 2506 | internal_error (__FILE__, __LINE__, |
| 2507 | "gdbarch: gdbarch_register_read invalid"); |
| 2508 | if (gdbarch_debug >= 2) |
| 2509 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_read called\n"); |
| 2510 | gdbarch->register_read (gdbarch, regnum, buf); |
| 2511 | } |
| 2512 | |
| 2513 | void |
| 2514 | set_gdbarch_register_read (struct gdbarch *gdbarch, |
| 2515 | gdbarch_register_read_ftype register_read) |
| 2516 | { |
| 2517 | gdbarch->register_read = register_read; |
| 2518 | } |
| 2519 | |
| 2520 | int |
| 2521 | gdbarch_register_write_p (struct gdbarch *gdbarch) |
| 2522 | { |
| 2523 | return gdbarch->register_write != 0; |
| 2524 | } |
| 2525 | |
| 2526 | void |
| 2527 | gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf) |
| 2528 | { |
| 2529 | if (gdbarch->register_write == 0) |
| 2530 | internal_error (__FILE__, __LINE__, |
| 2531 | "gdbarch: gdbarch_register_write invalid"); |
| 2532 | if (gdbarch_debug >= 2) |
| 2533 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_write called\n"); |
| 2534 | gdbarch->register_write (gdbarch, regnum, buf); |
| 2535 | } |
| 2536 | |
| 2537 | void |
| 2538 | set_gdbarch_register_write (struct gdbarch *gdbarch, |
| 2539 | gdbarch_register_write_ftype register_write) |
| 2540 | { |
| 2541 | gdbarch->register_write = register_write; |
| 2542 | } |
| 2543 | |
| 2544 | int |
| 2545 | gdbarch_num_regs (struct gdbarch *gdbarch) |
| 2546 | { |
| 2547 | if (gdbarch->num_regs == -1) |
| 2548 | internal_error (__FILE__, __LINE__, |
| 2549 | "gdbarch: gdbarch_num_regs invalid"); |
| 2550 | if (gdbarch_debug >= 2) |
| 2551 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); |
| 2552 | return gdbarch->num_regs; |
| 2553 | } |
| 2554 | |
| 2555 | void |
| 2556 | set_gdbarch_num_regs (struct gdbarch *gdbarch, |
| 2557 | int num_regs) |
| 2558 | { |
| 2559 | gdbarch->num_regs = num_regs; |
| 2560 | } |
| 2561 | |
| 2562 | int |
| 2563 | gdbarch_num_pseudo_regs (struct gdbarch *gdbarch) |
| 2564 | { |
| 2565 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
| 2566 | if (gdbarch_debug >= 2) |
| 2567 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n"); |
| 2568 | return gdbarch->num_pseudo_regs; |
| 2569 | } |
| 2570 | |
| 2571 | void |
| 2572 | set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, |
| 2573 | int num_pseudo_regs) |
| 2574 | { |
| 2575 | gdbarch->num_pseudo_regs = num_pseudo_regs; |
| 2576 | } |
| 2577 | |
| 2578 | int |
| 2579 | gdbarch_sp_regnum (struct gdbarch *gdbarch) |
| 2580 | { |
| 2581 | if (gdbarch->sp_regnum == -1) |
| 2582 | internal_error (__FILE__, __LINE__, |
| 2583 | "gdbarch: gdbarch_sp_regnum invalid"); |
| 2584 | if (gdbarch_debug >= 2) |
| 2585 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); |
| 2586 | return gdbarch->sp_regnum; |
| 2587 | } |
| 2588 | |
| 2589 | void |
| 2590 | set_gdbarch_sp_regnum (struct gdbarch *gdbarch, |
| 2591 | int sp_regnum) |
| 2592 | { |
| 2593 | gdbarch->sp_regnum = sp_regnum; |
| 2594 | } |
| 2595 | |
| 2596 | int |
| 2597 | gdbarch_fp_regnum (struct gdbarch *gdbarch) |
| 2598 | { |
| 2599 | if (gdbarch->fp_regnum == -1) |
| 2600 | internal_error (__FILE__, __LINE__, |
| 2601 | "gdbarch: gdbarch_fp_regnum invalid"); |
| 2602 | if (gdbarch_debug >= 2) |
| 2603 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n"); |
| 2604 | return gdbarch->fp_regnum; |
| 2605 | } |
| 2606 | |
| 2607 | void |
| 2608 | set_gdbarch_fp_regnum (struct gdbarch *gdbarch, |
| 2609 | int fp_regnum) |
| 2610 | { |
| 2611 | gdbarch->fp_regnum = fp_regnum; |
| 2612 | } |
| 2613 | |
| 2614 | int |
| 2615 | gdbarch_pc_regnum (struct gdbarch *gdbarch) |
| 2616 | { |
| 2617 | if (gdbarch->pc_regnum == -1) |
| 2618 | internal_error (__FILE__, __LINE__, |
| 2619 | "gdbarch: gdbarch_pc_regnum invalid"); |
| 2620 | if (gdbarch_debug >= 2) |
| 2621 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); |
| 2622 | return gdbarch->pc_regnum; |
| 2623 | } |
| 2624 | |
| 2625 | void |
| 2626 | set_gdbarch_pc_regnum (struct gdbarch *gdbarch, |
| 2627 | int pc_regnum) |
| 2628 | { |
| 2629 | gdbarch->pc_regnum = pc_regnum; |
| 2630 | } |
| 2631 | |
| 2632 | int |
| 2633 | gdbarch_fp0_regnum (struct gdbarch *gdbarch) |
| 2634 | { |
| 2635 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
| 2636 | if (gdbarch_debug >= 2) |
| 2637 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n"); |
| 2638 | return gdbarch->fp0_regnum; |
| 2639 | } |
| 2640 | |
| 2641 | void |
| 2642 | set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, |
| 2643 | int fp0_regnum) |
| 2644 | { |
| 2645 | gdbarch->fp0_regnum = fp0_regnum; |
| 2646 | } |
| 2647 | |
| 2648 | int |
| 2649 | gdbarch_npc_regnum (struct gdbarch *gdbarch) |
| 2650 | { |
| 2651 | /* Skip verify of npc_regnum, invalid_p == 0 */ |
| 2652 | if (gdbarch_debug >= 2) |
| 2653 | fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n"); |
| 2654 | return gdbarch->npc_regnum; |
| 2655 | } |
| 2656 | |
| 2657 | void |
| 2658 | set_gdbarch_npc_regnum (struct gdbarch *gdbarch, |
| 2659 | int npc_regnum) |
| 2660 | { |
| 2661 | gdbarch->npc_regnum = npc_regnum; |
| 2662 | } |
| 2663 | |
| 2664 | int |
| 2665 | gdbarch_nnpc_regnum (struct gdbarch *gdbarch) |
| 2666 | { |
| 2667 | /* Skip verify of nnpc_regnum, invalid_p == 0 */ |
| 2668 | if (gdbarch_debug >= 2) |
| 2669 | fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n"); |
| 2670 | return gdbarch->nnpc_regnum; |
| 2671 | } |
| 2672 | |
| 2673 | void |
| 2674 | set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, |
| 2675 | int nnpc_regnum) |
| 2676 | { |
| 2677 | gdbarch->nnpc_regnum = nnpc_regnum; |
| 2678 | } |
| 2679 | |
| 2680 | int |
| 2681 | gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr) |
| 2682 | { |
| 2683 | if (gdbarch->stab_reg_to_regnum == 0) |
| 2684 | internal_error (__FILE__, __LINE__, |
| 2685 | "gdbarch: gdbarch_stab_reg_to_regnum invalid"); |
| 2686 | if (gdbarch_debug >= 2) |
| 2687 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n"); |
| 2688 | return gdbarch->stab_reg_to_regnum (stab_regnr); |
| 2689 | } |
| 2690 | |
| 2691 | void |
| 2692 | set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, |
| 2693 | gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum) |
| 2694 | { |
| 2695 | gdbarch->stab_reg_to_regnum = stab_reg_to_regnum; |
| 2696 | } |
| 2697 | |
| 2698 | int |
| 2699 | gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr) |
| 2700 | { |
| 2701 | if (gdbarch->ecoff_reg_to_regnum == 0) |
| 2702 | internal_error (__FILE__, __LINE__, |
| 2703 | "gdbarch: gdbarch_ecoff_reg_to_regnum invalid"); |
| 2704 | if (gdbarch_debug >= 2) |
| 2705 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n"); |
| 2706 | return gdbarch->ecoff_reg_to_regnum (ecoff_regnr); |
| 2707 | } |
| 2708 | |
| 2709 | void |
| 2710 | set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, |
| 2711 | gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum) |
| 2712 | { |
| 2713 | gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum; |
| 2714 | } |
| 2715 | |
| 2716 | int |
| 2717 | gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr) |
| 2718 | { |
| 2719 | if (gdbarch->dwarf_reg_to_regnum == 0) |
| 2720 | internal_error (__FILE__, __LINE__, |
| 2721 | "gdbarch: gdbarch_dwarf_reg_to_regnum invalid"); |
| 2722 | if (gdbarch_debug >= 2) |
| 2723 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n"); |
| 2724 | return gdbarch->dwarf_reg_to_regnum (dwarf_regnr); |
| 2725 | } |
| 2726 | |
| 2727 | void |
| 2728 | set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, |
| 2729 | gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum) |
| 2730 | { |
| 2731 | gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum; |
| 2732 | } |
| 2733 | |
| 2734 | int |
| 2735 | gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr) |
| 2736 | { |
| 2737 | if (gdbarch->sdb_reg_to_regnum == 0) |
| 2738 | internal_error (__FILE__, __LINE__, |
| 2739 | "gdbarch: gdbarch_sdb_reg_to_regnum invalid"); |
| 2740 | if (gdbarch_debug >= 2) |
| 2741 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n"); |
| 2742 | return gdbarch->sdb_reg_to_regnum (sdb_regnr); |
| 2743 | } |
| 2744 | |
| 2745 | void |
| 2746 | set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, |
| 2747 | gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum) |
| 2748 | { |
| 2749 | gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum; |
| 2750 | } |
| 2751 | |
| 2752 | int |
| 2753 | gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr) |
| 2754 | { |
| 2755 | if (gdbarch->dwarf2_reg_to_regnum == 0) |
| 2756 | internal_error (__FILE__, __LINE__, |
| 2757 | "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid"); |
| 2758 | if (gdbarch_debug >= 2) |
| 2759 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n"); |
| 2760 | return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr); |
| 2761 | } |
| 2762 | |
| 2763 | void |
| 2764 | set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, |
| 2765 | gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum) |
| 2766 | { |
| 2767 | gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum; |
| 2768 | } |
| 2769 | |
| 2770 | char * |
| 2771 | gdbarch_register_name (struct gdbarch *gdbarch, int regnr) |
| 2772 | { |
| 2773 | if (gdbarch->register_name == 0) |
| 2774 | internal_error (__FILE__, __LINE__, |
| 2775 | "gdbarch: gdbarch_register_name invalid"); |
| 2776 | if (gdbarch_debug >= 2) |
| 2777 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); |
| 2778 | return gdbarch->register_name (regnr); |
| 2779 | } |
| 2780 | |
| 2781 | void |
| 2782 | set_gdbarch_register_name (struct gdbarch *gdbarch, |
| 2783 | gdbarch_register_name_ftype register_name) |
| 2784 | { |
| 2785 | gdbarch->register_name = register_name; |
| 2786 | } |
| 2787 | |
| 2788 | int |
| 2789 | gdbarch_register_size (struct gdbarch *gdbarch) |
| 2790 | { |
| 2791 | if (gdbarch->register_size == -1) |
| 2792 | internal_error (__FILE__, __LINE__, |
| 2793 | "gdbarch: gdbarch_register_size invalid"); |
| 2794 | if (gdbarch_debug >= 2) |
| 2795 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n"); |
| 2796 | return gdbarch->register_size; |
| 2797 | } |
| 2798 | |
| 2799 | void |
| 2800 | set_gdbarch_register_size (struct gdbarch *gdbarch, |
| 2801 | int register_size) |
| 2802 | { |
| 2803 | gdbarch->register_size = register_size; |
| 2804 | } |
| 2805 | |
| 2806 | int |
| 2807 | gdbarch_register_bytes (struct gdbarch *gdbarch) |
| 2808 | { |
| 2809 | if (gdbarch->register_bytes == -1) |
| 2810 | internal_error (__FILE__, __LINE__, |
| 2811 | "gdbarch: gdbarch_register_bytes invalid"); |
| 2812 | if (gdbarch_debug >= 2) |
| 2813 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n"); |
| 2814 | return gdbarch->register_bytes; |
| 2815 | } |
| 2816 | |
| 2817 | void |
| 2818 | set_gdbarch_register_bytes (struct gdbarch *gdbarch, |
| 2819 | int register_bytes) |
| 2820 | { |
| 2821 | gdbarch->register_bytes = register_bytes; |
| 2822 | } |
| 2823 | |
| 2824 | int |
| 2825 | gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr) |
| 2826 | { |
| 2827 | if (gdbarch->register_byte == 0) |
| 2828 | internal_error (__FILE__, __LINE__, |
| 2829 | "gdbarch: gdbarch_register_byte invalid"); |
| 2830 | if (gdbarch_debug >= 2) |
| 2831 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n"); |
| 2832 | return gdbarch->register_byte (reg_nr); |
| 2833 | } |
| 2834 | |
| 2835 | void |
| 2836 | set_gdbarch_register_byte (struct gdbarch *gdbarch, |
| 2837 | gdbarch_register_byte_ftype register_byte) |
| 2838 | { |
| 2839 | gdbarch->register_byte = register_byte; |
| 2840 | } |
| 2841 | |
| 2842 | int |
| 2843 | gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr) |
| 2844 | { |
| 2845 | if (gdbarch->register_raw_size == 0) |
| 2846 | internal_error (__FILE__, __LINE__, |
| 2847 | "gdbarch: gdbarch_register_raw_size invalid"); |
| 2848 | if (gdbarch_debug >= 2) |
| 2849 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n"); |
| 2850 | return gdbarch->register_raw_size (reg_nr); |
| 2851 | } |
| 2852 | |
| 2853 | void |
| 2854 | set_gdbarch_register_raw_size (struct gdbarch *gdbarch, |
| 2855 | gdbarch_register_raw_size_ftype register_raw_size) |
| 2856 | { |
| 2857 | gdbarch->register_raw_size = register_raw_size; |
| 2858 | } |
| 2859 | |
| 2860 | int |
| 2861 | gdbarch_max_register_raw_size (struct gdbarch *gdbarch) |
| 2862 | { |
| 2863 | if (gdbarch->max_register_raw_size == -1) |
| 2864 | internal_error (__FILE__, __LINE__, |
| 2865 | "gdbarch: gdbarch_max_register_raw_size invalid"); |
| 2866 | if (gdbarch_debug >= 2) |
| 2867 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n"); |
| 2868 | return gdbarch->max_register_raw_size; |
| 2869 | } |
| 2870 | |
| 2871 | void |
| 2872 | set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, |
| 2873 | int max_register_raw_size) |
| 2874 | { |
| 2875 | gdbarch->max_register_raw_size = max_register_raw_size; |
| 2876 | } |
| 2877 | |
| 2878 | int |
| 2879 | gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) |
| 2880 | { |
| 2881 | if (gdbarch->register_virtual_size == 0) |
| 2882 | internal_error (__FILE__, __LINE__, |
| 2883 | "gdbarch: gdbarch_register_virtual_size invalid"); |
| 2884 | if (gdbarch_debug >= 2) |
| 2885 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n"); |
| 2886 | return gdbarch->register_virtual_size (reg_nr); |
| 2887 | } |
| 2888 | |
| 2889 | void |
| 2890 | set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, |
| 2891 | gdbarch_register_virtual_size_ftype register_virtual_size) |
| 2892 | { |
| 2893 | gdbarch->register_virtual_size = register_virtual_size; |
| 2894 | } |
| 2895 | |
| 2896 | int |
| 2897 | gdbarch_max_register_virtual_size (struct gdbarch *gdbarch) |
| 2898 | { |
| 2899 | if (gdbarch->max_register_virtual_size == -1) |
| 2900 | internal_error (__FILE__, __LINE__, |
| 2901 | "gdbarch: gdbarch_max_register_virtual_size invalid"); |
| 2902 | if (gdbarch_debug >= 2) |
| 2903 | fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n"); |
| 2904 | return gdbarch->max_register_virtual_size; |
| 2905 | } |
| 2906 | |
| 2907 | void |
| 2908 | set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, |
| 2909 | int max_register_virtual_size) |
| 2910 | { |
| 2911 | gdbarch->max_register_virtual_size = max_register_virtual_size; |
| 2912 | } |
| 2913 | |
| 2914 | struct type * |
| 2915 | gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) |
| 2916 | { |
| 2917 | if (gdbarch->register_virtual_type == 0) |
| 2918 | internal_error (__FILE__, __LINE__, |
| 2919 | "gdbarch: gdbarch_register_virtual_type invalid"); |
| 2920 | if (gdbarch_debug >= 2) |
| 2921 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n"); |
| 2922 | return gdbarch->register_virtual_type (reg_nr); |
| 2923 | } |
| 2924 | |
| 2925 | void |
| 2926 | set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, |
| 2927 | gdbarch_register_virtual_type_ftype register_virtual_type) |
| 2928 | { |
| 2929 | gdbarch->register_virtual_type = register_virtual_type; |
| 2930 | } |
| 2931 | |
| 2932 | void |
| 2933 | gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs) |
| 2934 | { |
| 2935 | if (gdbarch->do_registers_info == 0) |
| 2936 | internal_error (__FILE__, __LINE__, |
| 2937 | "gdbarch: gdbarch_do_registers_info invalid"); |
| 2938 | if (gdbarch_debug >= 2) |
| 2939 | fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n"); |
| 2940 | gdbarch->do_registers_info (reg_nr, fpregs); |
| 2941 | } |
| 2942 | |
| 2943 | void |
| 2944 | set_gdbarch_do_registers_info (struct gdbarch *gdbarch, |
| 2945 | gdbarch_do_registers_info_ftype do_registers_info) |
| 2946 | { |
| 2947 | gdbarch->do_registers_info = do_registers_info; |
| 2948 | } |
| 2949 | |
| 2950 | void |
| 2951 | gdbarch_print_float_info (struct gdbarch *gdbarch) |
| 2952 | { |
| 2953 | if (gdbarch->print_float_info == 0) |
| 2954 | internal_error (__FILE__, __LINE__, |
| 2955 | "gdbarch: gdbarch_print_float_info invalid"); |
| 2956 | if (gdbarch_debug >= 2) |
| 2957 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); |
| 2958 | gdbarch->print_float_info (); |
| 2959 | } |
| 2960 | |
| 2961 | void |
| 2962 | set_gdbarch_print_float_info (struct gdbarch *gdbarch, |
| 2963 | gdbarch_print_float_info_ftype print_float_info) |
| 2964 | { |
| 2965 | gdbarch->print_float_info = print_float_info; |
| 2966 | } |
| 2967 | |
| 2968 | int |
| 2969 | gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) |
| 2970 | { |
| 2971 | if (gdbarch->register_sim_regno == 0) |
| 2972 | internal_error (__FILE__, __LINE__, |
| 2973 | "gdbarch: gdbarch_register_sim_regno invalid"); |
| 2974 | if (gdbarch_debug >= 2) |
| 2975 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); |
| 2976 | return gdbarch->register_sim_regno (reg_nr); |
| 2977 | } |
| 2978 | |
| 2979 | void |
| 2980 | set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, |
| 2981 | gdbarch_register_sim_regno_ftype register_sim_regno) |
| 2982 | { |
| 2983 | gdbarch->register_sim_regno = register_sim_regno; |
| 2984 | } |
| 2985 | |
| 2986 | int |
| 2987 | gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch) |
| 2988 | { |
| 2989 | return gdbarch->register_bytes_ok != 0; |
| 2990 | } |
| 2991 | |
| 2992 | int |
| 2993 | gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes) |
| 2994 | { |
| 2995 | if (gdbarch->register_bytes_ok == 0) |
| 2996 | internal_error (__FILE__, __LINE__, |
| 2997 | "gdbarch: gdbarch_register_bytes_ok invalid"); |
| 2998 | if (gdbarch_debug >= 2) |
| 2999 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n"); |
| 3000 | return gdbarch->register_bytes_ok (nr_bytes); |
| 3001 | } |
| 3002 | |
| 3003 | void |
| 3004 | set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, |
| 3005 | gdbarch_register_bytes_ok_ftype register_bytes_ok) |
| 3006 | { |
| 3007 | gdbarch->register_bytes_ok = register_bytes_ok; |
| 3008 | } |
| 3009 | |
| 3010 | int |
| 3011 | gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) |
| 3012 | { |
| 3013 | if (gdbarch->cannot_fetch_register == 0) |
| 3014 | internal_error (__FILE__, __LINE__, |
| 3015 | "gdbarch: gdbarch_cannot_fetch_register invalid"); |
| 3016 | if (gdbarch_debug >= 2) |
| 3017 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); |
| 3018 | return gdbarch->cannot_fetch_register (regnum); |
| 3019 | } |
| 3020 | |
| 3021 | void |
| 3022 | set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, |
| 3023 | gdbarch_cannot_fetch_register_ftype cannot_fetch_register) |
| 3024 | { |
| 3025 | gdbarch->cannot_fetch_register = cannot_fetch_register; |
| 3026 | } |
| 3027 | |
| 3028 | int |
| 3029 | gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) |
| 3030 | { |
| 3031 | if (gdbarch->cannot_store_register == 0) |
| 3032 | internal_error (__FILE__, __LINE__, |
| 3033 | "gdbarch: gdbarch_cannot_store_register invalid"); |
| 3034 | if (gdbarch_debug >= 2) |
| 3035 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); |
| 3036 | return gdbarch->cannot_store_register (regnum); |
| 3037 | } |
| 3038 | |
| 3039 | void |
| 3040 | set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, |
| 3041 | gdbarch_cannot_store_register_ftype cannot_store_register) |
| 3042 | { |
| 3043 | gdbarch->cannot_store_register = cannot_store_register; |
| 3044 | } |
| 3045 | |
| 3046 | int |
| 3047 | gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) |
| 3048 | { |
| 3049 | return gdbarch->get_longjmp_target != 0; |
| 3050 | } |
| 3051 | |
| 3052 | int |
| 3053 | gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc) |
| 3054 | { |
| 3055 | if (gdbarch->get_longjmp_target == 0) |
| 3056 | internal_error (__FILE__, __LINE__, |
| 3057 | "gdbarch: gdbarch_get_longjmp_target invalid"); |
| 3058 | if (gdbarch_debug >= 2) |
| 3059 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n"); |
| 3060 | return gdbarch->get_longjmp_target (pc); |
| 3061 | } |
| 3062 | |
| 3063 | void |
| 3064 | set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, |
| 3065 | gdbarch_get_longjmp_target_ftype get_longjmp_target) |
| 3066 | { |
| 3067 | gdbarch->get_longjmp_target = get_longjmp_target; |
| 3068 | } |
| 3069 | |
| 3070 | int |
| 3071 | gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch) |
| 3072 | { |
| 3073 | if (gdbarch->use_generic_dummy_frames == -1) |
| 3074 | internal_error (__FILE__, __LINE__, |
| 3075 | "gdbarch: gdbarch_use_generic_dummy_frames invalid"); |
| 3076 | if (gdbarch_debug >= 2) |
| 3077 | fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n"); |
| 3078 | return gdbarch->use_generic_dummy_frames; |
| 3079 | } |
| 3080 | |
| 3081 | void |
| 3082 | set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, |
| 3083 | int use_generic_dummy_frames) |
| 3084 | { |
| 3085 | gdbarch->use_generic_dummy_frames = use_generic_dummy_frames; |
| 3086 | } |
| 3087 | |
| 3088 | int |
| 3089 | gdbarch_call_dummy_location (struct gdbarch *gdbarch) |
| 3090 | { |
| 3091 | if (gdbarch->call_dummy_location == 0) |
| 3092 | internal_error (__FILE__, __LINE__, |
| 3093 | "gdbarch: gdbarch_call_dummy_location invalid"); |
| 3094 | if (gdbarch_debug >= 2) |
| 3095 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); |
| 3096 | return gdbarch->call_dummy_location; |
| 3097 | } |
| 3098 | |
| 3099 | void |
| 3100 | set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, |
| 3101 | int call_dummy_location) |
| 3102 | { |
| 3103 | gdbarch->call_dummy_location = call_dummy_location; |
| 3104 | } |
| 3105 | |
| 3106 | CORE_ADDR |
| 3107 | gdbarch_call_dummy_address (struct gdbarch *gdbarch) |
| 3108 | { |
| 3109 | if (gdbarch->call_dummy_address == 0) |
| 3110 | internal_error (__FILE__, __LINE__, |
| 3111 | "gdbarch: gdbarch_call_dummy_address invalid"); |
| 3112 | if (gdbarch_debug >= 2) |
| 3113 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n"); |
| 3114 | return gdbarch->call_dummy_address (); |
| 3115 | } |
| 3116 | |
| 3117 | void |
| 3118 | set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, |
| 3119 | gdbarch_call_dummy_address_ftype call_dummy_address) |
| 3120 | { |
| 3121 | gdbarch->call_dummy_address = call_dummy_address; |
| 3122 | } |
| 3123 | |
| 3124 | CORE_ADDR |
| 3125 | gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch) |
| 3126 | { |
| 3127 | if (gdbarch->call_dummy_start_offset == -1) |
| 3128 | internal_error (__FILE__, __LINE__, |
| 3129 | "gdbarch: gdbarch_call_dummy_start_offset invalid"); |
| 3130 | if (gdbarch_debug >= 2) |
| 3131 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n"); |
| 3132 | return gdbarch->call_dummy_start_offset; |
| 3133 | } |
| 3134 | |
| 3135 | void |
| 3136 | set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, |
| 3137 | CORE_ADDR call_dummy_start_offset) |
| 3138 | { |
| 3139 | gdbarch->call_dummy_start_offset = call_dummy_start_offset; |
| 3140 | } |
| 3141 | |
| 3142 | CORE_ADDR |
| 3143 | gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch) |
| 3144 | { |
| 3145 | if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1) |
| 3146 | internal_error (__FILE__, __LINE__, |
| 3147 | "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid"); |
| 3148 | if (gdbarch_debug >= 2) |
| 3149 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n"); |
| 3150 | return gdbarch->call_dummy_breakpoint_offset; |
| 3151 | } |
| 3152 | |
| 3153 | void |
| 3154 | set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, |
| 3155 | CORE_ADDR call_dummy_breakpoint_offset) |
| 3156 | { |
| 3157 | gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset; |
| 3158 | } |
| 3159 | |
| 3160 | int |
| 3161 | gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch) |
| 3162 | { |
| 3163 | if (gdbarch->call_dummy_breakpoint_offset_p == -1) |
| 3164 | internal_error (__FILE__, __LINE__, |
| 3165 | "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid"); |
| 3166 | if (gdbarch_debug >= 2) |
| 3167 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n"); |
| 3168 | return gdbarch->call_dummy_breakpoint_offset_p; |
| 3169 | } |
| 3170 | |
| 3171 | void |
| 3172 | set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, |
| 3173 | int call_dummy_breakpoint_offset_p) |
| 3174 | { |
| 3175 | gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p; |
| 3176 | } |
| 3177 | |
| 3178 | int |
| 3179 | gdbarch_call_dummy_length (struct gdbarch *gdbarch) |
| 3180 | { |
| 3181 | if (gdbarch->call_dummy_length == -1) |
| 3182 | internal_error (__FILE__, __LINE__, |
| 3183 | "gdbarch: gdbarch_call_dummy_length invalid"); |
| 3184 | if (gdbarch_debug >= 2) |
| 3185 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n"); |
| 3186 | return gdbarch->call_dummy_length; |
| 3187 | } |
| 3188 | |
| 3189 | void |
| 3190 | set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, |
| 3191 | int call_dummy_length) |
| 3192 | { |
| 3193 | gdbarch->call_dummy_length = call_dummy_length; |
| 3194 | } |
| 3195 | |
| 3196 | int |
| 3197 | gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) |
| 3198 | { |
| 3199 | if (gdbarch->pc_in_call_dummy == 0) |
| 3200 | internal_error (__FILE__, __LINE__, |
| 3201 | "gdbarch: gdbarch_pc_in_call_dummy invalid"); |
| 3202 | if (gdbarch_debug >= 2) |
| 3203 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n"); |
| 3204 | return gdbarch->pc_in_call_dummy (pc, sp, frame_address); |
| 3205 | } |
| 3206 | |
| 3207 | void |
| 3208 | set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, |
| 3209 | gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy) |
| 3210 | { |
| 3211 | gdbarch->pc_in_call_dummy = pc_in_call_dummy; |
| 3212 | } |
| 3213 | |
| 3214 | int |
| 3215 | gdbarch_call_dummy_p (struct gdbarch *gdbarch) |
| 3216 | { |
| 3217 | if (gdbarch->call_dummy_p == -1) |
| 3218 | internal_error (__FILE__, __LINE__, |
| 3219 | "gdbarch: gdbarch_call_dummy_p invalid"); |
| 3220 | if (gdbarch_debug >= 2) |
| 3221 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n"); |
| 3222 | return gdbarch->call_dummy_p; |
| 3223 | } |
| 3224 | |
| 3225 | void |
| 3226 | set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, |
| 3227 | int call_dummy_p) |
| 3228 | { |
| 3229 | gdbarch->call_dummy_p = call_dummy_p; |
| 3230 | } |
| 3231 | |
| 3232 | LONGEST * |
| 3233 | gdbarch_call_dummy_words (struct gdbarch *gdbarch) |
| 3234 | { |
| 3235 | /* Skip verify of call_dummy_words, invalid_p == 0 */ |
| 3236 | if (gdbarch_debug >= 2) |
| 3237 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n"); |
| 3238 | return gdbarch->call_dummy_words; |
| 3239 | } |
| 3240 | |
| 3241 | void |
| 3242 | set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, |
| 3243 | LONGEST * call_dummy_words) |
| 3244 | { |
| 3245 | gdbarch->call_dummy_words = call_dummy_words; |
| 3246 | } |
| 3247 | |
| 3248 | int |
| 3249 | gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch) |
| 3250 | { |
| 3251 | /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ |
| 3252 | if (gdbarch_debug >= 2) |
| 3253 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n"); |
| 3254 | return gdbarch->sizeof_call_dummy_words; |
| 3255 | } |
| 3256 | |
| 3257 | void |
| 3258 | set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, |
| 3259 | int sizeof_call_dummy_words) |
| 3260 | { |
| 3261 | gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words; |
| 3262 | } |
| 3263 | |
| 3264 | int |
| 3265 | gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) |
| 3266 | { |
| 3267 | if (gdbarch->call_dummy_stack_adjust_p == -1) |
| 3268 | internal_error (__FILE__, __LINE__, |
| 3269 | "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid"); |
| 3270 | if (gdbarch_debug >= 2) |
| 3271 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n"); |
| 3272 | return gdbarch->call_dummy_stack_adjust_p; |
| 3273 | } |
| 3274 | |
| 3275 | void |
| 3276 | set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, |
| 3277 | int call_dummy_stack_adjust_p) |
| 3278 | { |
| 3279 | gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p; |
| 3280 | } |
| 3281 | |
| 3282 | int |
| 3283 | gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch) |
| 3284 | { |
| 3285 | if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0) |
| 3286 | internal_error (__FILE__, __LINE__, |
| 3287 | "gdbarch: gdbarch_call_dummy_stack_adjust invalid"); |
| 3288 | if (gdbarch_debug >= 2) |
| 3289 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n"); |
| 3290 | return gdbarch->call_dummy_stack_adjust; |
| 3291 | } |
| 3292 | |
| 3293 | void |
| 3294 | set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, |
| 3295 | int call_dummy_stack_adjust) |
| 3296 | { |
| 3297 | gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust; |
| 3298 | } |
| 3299 | |
| 3300 | void |
| 3301 | gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) |
| 3302 | { |
| 3303 | if (gdbarch->fix_call_dummy == 0) |
| 3304 | internal_error (__FILE__, __LINE__, |
| 3305 | "gdbarch: gdbarch_fix_call_dummy invalid"); |
| 3306 | if (gdbarch_debug >= 2) |
| 3307 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n"); |
| 3308 | gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); |
| 3309 | } |
| 3310 | |
| 3311 | void |
| 3312 | set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, |
| 3313 | gdbarch_fix_call_dummy_ftype fix_call_dummy) |
| 3314 | { |
| 3315 | gdbarch->fix_call_dummy = fix_call_dummy; |
| 3316 | } |
| 3317 | |
| 3318 | void |
| 3319 | gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) |
| 3320 | { |
| 3321 | if (gdbarch->init_frame_pc_first == 0) |
| 3322 | internal_error (__FILE__, __LINE__, |
| 3323 | "gdbarch: gdbarch_init_frame_pc_first invalid"); |
| 3324 | if (gdbarch_debug >= 2) |
| 3325 | fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n"); |
| 3326 | gdbarch->init_frame_pc_first (fromleaf, prev); |
| 3327 | } |
| 3328 | |
| 3329 | void |
| 3330 | set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, |
| 3331 | gdbarch_init_frame_pc_first_ftype init_frame_pc_first) |
| 3332 | { |
| 3333 | gdbarch->init_frame_pc_first = init_frame_pc_first; |
| 3334 | } |
| 3335 | |
| 3336 | void |
| 3337 | gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) |
| 3338 | { |
| 3339 | if (gdbarch->init_frame_pc == 0) |
| 3340 | internal_error (__FILE__, __LINE__, |
| 3341 | "gdbarch: gdbarch_init_frame_pc invalid"); |
| 3342 | if (gdbarch_debug >= 2) |
| 3343 | fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n"); |
| 3344 | gdbarch->init_frame_pc (fromleaf, prev); |
| 3345 | } |
| 3346 | |
| 3347 | void |
| 3348 | set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, |
| 3349 | gdbarch_init_frame_pc_ftype init_frame_pc) |
| 3350 | { |
| 3351 | gdbarch->init_frame_pc = init_frame_pc; |
| 3352 | } |
| 3353 | |
| 3354 | int |
| 3355 | gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) |
| 3356 | { |
| 3357 | if (gdbarch_debug >= 2) |
| 3358 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n"); |
| 3359 | return gdbarch->believe_pcc_promotion; |
| 3360 | } |
| 3361 | |
| 3362 | void |
| 3363 | set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, |
| 3364 | int believe_pcc_promotion) |
| 3365 | { |
| 3366 | gdbarch->believe_pcc_promotion = believe_pcc_promotion; |
| 3367 | } |
| 3368 | |
| 3369 | int |
| 3370 | gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch) |
| 3371 | { |
| 3372 | if (gdbarch_debug >= 2) |
| 3373 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n"); |
| 3374 | return gdbarch->believe_pcc_promotion_type; |
| 3375 | } |
| 3376 | |
| 3377 | void |
| 3378 | set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, |
| 3379 | int believe_pcc_promotion_type) |
| 3380 | { |
| 3381 | gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type; |
| 3382 | } |
| 3383 | |
| 3384 | int |
| 3385 | gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual) |
| 3386 | { |
| 3387 | if (gdbarch->coerce_float_to_double == 0) |
| 3388 | internal_error (__FILE__, __LINE__, |
| 3389 | "gdbarch: gdbarch_coerce_float_to_double invalid"); |
| 3390 | if (gdbarch_debug >= 2) |
| 3391 | fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n"); |
| 3392 | return gdbarch->coerce_float_to_double (formal, actual); |
| 3393 | } |
| 3394 | |
| 3395 | void |
| 3396 | set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, |
| 3397 | gdbarch_coerce_float_to_double_ftype coerce_float_to_double) |
| 3398 | { |
| 3399 | gdbarch->coerce_float_to_double = coerce_float_to_double; |
| 3400 | } |
| 3401 | |
| 3402 | void |
| 3403 | gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval) |
| 3404 | { |
| 3405 | if (gdbarch->get_saved_register == 0) |
| 3406 | internal_error (__FILE__, __LINE__, |
| 3407 | "gdbarch: gdbarch_get_saved_register invalid"); |
| 3408 | if (gdbarch_debug >= 2) |
| 3409 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n"); |
| 3410 | gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval); |
| 3411 | } |
| 3412 | |
| 3413 | void |
| 3414 | set_gdbarch_get_saved_register (struct gdbarch *gdbarch, |
| 3415 | gdbarch_get_saved_register_ftype get_saved_register) |
| 3416 | { |
| 3417 | gdbarch->get_saved_register = get_saved_register; |
| 3418 | } |
| 3419 | |
| 3420 | int |
| 3421 | gdbarch_register_convertible (struct gdbarch *gdbarch, int nr) |
| 3422 | { |
| 3423 | if (gdbarch->register_convertible == 0) |
| 3424 | internal_error (__FILE__, __LINE__, |
| 3425 | "gdbarch: gdbarch_register_convertible invalid"); |
| 3426 | if (gdbarch_debug >= 2) |
| 3427 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n"); |
| 3428 | return gdbarch->register_convertible (nr); |
| 3429 | } |
| 3430 | |
| 3431 | void |
| 3432 | set_gdbarch_register_convertible (struct gdbarch *gdbarch, |
| 3433 | gdbarch_register_convertible_ftype register_convertible) |
| 3434 | { |
| 3435 | gdbarch->register_convertible = register_convertible; |
| 3436 | } |
| 3437 | |
| 3438 | void |
| 3439 | gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) |
| 3440 | { |
| 3441 | if (gdbarch->register_convert_to_virtual == 0) |
| 3442 | internal_error (__FILE__, __LINE__, |
| 3443 | "gdbarch: gdbarch_register_convert_to_virtual invalid"); |
| 3444 | if (gdbarch_debug >= 2) |
| 3445 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n"); |
| 3446 | gdbarch->register_convert_to_virtual (regnum, type, from, to); |
| 3447 | } |
| 3448 | |
| 3449 | void |
| 3450 | set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, |
| 3451 | gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual) |
| 3452 | { |
| 3453 | gdbarch->register_convert_to_virtual = register_convert_to_virtual; |
| 3454 | } |
| 3455 | |
| 3456 | void |
| 3457 | gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to) |
| 3458 | { |
| 3459 | if (gdbarch->register_convert_to_raw == 0) |
| 3460 | internal_error (__FILE__, __LINE__, |
| 3461 | "gdbarch: gdbarch_register_convert_to_raw invalid"); |
| 3462 | if (gdbarch_debug >= 2) |
| 3463 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n"); |
| 3464 | gdbarch->register_convert_to_raw (type, regnum, from, to); |
| 3465 | } |
| 3466 | |
| 3467 | void |
| 3468 | set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, |
| 3469 | gdbarch_register_convert_to_raw_ftype register_convert_to_raw) |
| 3470 | { |
| 3471 | gdbarch->register_convert_to_raw = register_convert_to_raw; |
| 3472 | } |
| 3473 | |
| 3474 | int |
| 3475 | gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch) |
| 3476 | { |
| 3477 | return gdbarch->fetch_pseudo_register != 0; |
| 3478 | } |
| 3479 | |
| 3480 | void |
| 3481 | gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum) |
| 3482 | { |
| 3483 | if (gdbarch->fetch_pseudo_register == 0) |
| 3484 | internal_error (__FILE__, __LINE__, |
| 3485 | "gdbarch: gdbarch_fetch_pseudo_register invalid"); |
| 3486 | if (gdbarch_debug >= 2) |
| 3487 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n"); |
| 3488 | gdbarch->fetch_pseudo_register (regnum); |
| 3489 | } |
| 3490 | |
| 3491 | void |
| 3492 | set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, |
| 3493 | gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register) |
| 3494 | { |
| 3495 | gdbarch->fetch_pseudo_register = fetch_pseudo_register; |
| 3496 | } |
| 3497 | |
| 3498 | int |
| 3499 | gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch) |
| 3500 | { |
| 3501 | return gdbarch->store_pseudo_register != 0; |
| 3502 | } |
| 3503 | |
| 3504 | void |
| 3505 | gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum) |
| 3506 | { |
| 3507 | if (gdbarch->store_pseudo_register == 0) |
| 3508 | internal_error (__FILE__, __LINE__, |
| 3509 | "gdbarch: gdbarch_store_pseudo_register invalid"); |
| 3510 | if (gdbarch_debug >= 2) |
| 3511 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n"); |
| 3512 | gdbarch->store_pseudo_register (regnum); |
| 3513 | } |
| 3514 | |
| 3515 | void |
| 3516 | set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, |
| 3517 | gdbarch_store_pseudo_register_ftype store_pseudo_register) |
| 3518 | { |
| 3519 | gdbarch->store_pseudo_register = store_pseudo_register; |
| 3520 | } |
| 3521 | |
| 3522 | CORE_ADDR |
| 3523 | gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) |
| 3524 | { |
| 3525 | if (gdbarch->pointer_to_address == 0) |
| 3526 | internal_error (__FILE__, __LINE__, |
| 3527 | "gdbarch: gdbarch_pointer_to_address invalid"); |
| 3528 | if (gdbarch_debug >= 2) |
| 3529 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); |
| 3530 | return gdbarch->pointer_to_address (type, buf); |
| 3531 | } |
| 3532 | |
| 3533 | void |
| 3534 | set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, |
| 3535 | gdbarch_pointer_to_address_ftype pointer_to_address) |
| 3536 | { |
| 3537 | gdbarch->pointer_to_address = pointer_to_address; |
| 3538 | } |
| 3539 | |
| 3540 | void |
| 3541 | gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr) |
| 3542 | { |
| 3543 | if (gdbarch->address_to_pointer == 0) |
| 3544 | internal_error (__FILE__, __LINE__, |
| 3545 | "gdbarch: gdbarch_address_to_pointer invalid"); |
| 3546 | if (gdbarch_debug >= 2) |
| 3547 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); |
| 3548 | gdbarch->address_to_pointer (type, buf, addr); |
| 3549 | } |
| 3550 | |
| 3551 | void |
| 3552 | set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, |
| 3553 | gdbarch_address_to_pointer_ftype address_to_pointer) |
| 3554 | { |
| 3555 | gdbarch->address_to_pointer = address_to_pointer; |
| 3556 | } |
| 3557 | |
| 3558 | int |
| 3559 | gdbarch_integer_to_address_p (struct gdbarch *gdbarch) |
| 3560 | { |
| 3561 | return gdbarch->integer_to_address != 0; |
| 3562 | } |
| 3563 | |
| 3564 | CORE_ADDR |
| 3565 | gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) |
| 3566 | { |
| 3567 | if (gdbarch->integer_to_address == 0) |
| 3568 | internal_error (__FILE__, __LINE__, |
| 3569 | "gdbarch: gdbarch_integer_to_address invalid"); |
| 3570 | if (gdbarch_debug >= 2) |
| 3571 | fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n"); |
| 3572 | return gdbarch->integer_to_address (type, buf); |
| 3573 | } |
| 3574 | |
| 3575 | void |
| 3576 | set_gdbarch_integer_to_address (struct gdbarch *gdbarch, |
| 3577 | gdbarch_integer_to_address_ftype integer_to_address) |
| 3578 | { |
| 3579 | gdbarch->integer_to_address = integer_to_address; |
| 3580 | } |
| 3581 | |
| 3582 | int |
| 3583 | gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type) |
| 3584 | { |
| 3585 | if (gdbarch->return_value_on_stack == 0) |
| 3586 | internal_error (__FILE__, __LINE__, |
| 3587 | "gdbarch: gdbarch_return_value_on_stack invalid"); |
| 3588 | if (gdbarch_debug >= 2) |
| 3589 | fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n"); |
| 3590 | return gdbarch->return_value_on_stack (type); |
| 3591 | } |
| 3592 | |
| 3593 | void |
| 3594 | set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, |
| 3595 | gdbarch_return_value_on_stack_ftype return_value_on_stack) |
| 3596 | { |
| 3597 | gdbarch->return_value_on_stack = return_value_on_stack; |
| 3598 | } |
| 3599 | |
| 3600 | void |
| 3601 | gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) |
| 3602 | { |
| 3603 | if (gdbarch->extract_return_value == 0) |
| 3604 | internal_error (__FILE__, __LINE__, |
| 3605 | "gdbarch: gdbarch_extract_return_value invalid"); |
| 3606 | if (gdbarch_debug >= 2) |
| 3607 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); |
| 3608 | gdbarch->extract_return_value (type, regbuf, valbuf); |
| 3609 | } |
| 3610 | |
| 3611 | void |
| 3612 | set_gdbarch_extract_return_value (struct gdbarch *gdbarch, |
| 3613 | gdbarch_extract_return_value_ftype extract_return_value) |
| 3614 | { |
| 3615 | gdbarch->extract_return_value = extract_return_value; |
| 3616 | } |
| 3617 | |
| 3618 | CORE_ADDR |
| 3619 | gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) |
| 3620 | { |
| 3621 | if (gdbarch->push_arguments == 0) |
| 3622 | internal_error (__FILE__, __LINE__, |
| 3623 | "gdbarch: gdbarch_push_arguments invalid"); |
| 3624 | if (gdbarch_debug >= 2) |
| 3625 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n"); |
| 3626 | return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr); |
| 3627 | } |
| 3628 | |
| 3629 | void |
| 3630 | set_gdbarch_push_arguments (struct gdbarch *gdbarch, |
| 3631 | gdbarch_push_arguments_ftype push_arguments) |
| 3632 | { |
| 3633 | gdbarch->push_arguments = push_arguments; |
| 3634 | } |
| 3635 | |
| 3636 | void |
| 3637 | gdbarch_push_dummy_frame (struct gdbarch *gdbarch) |
| 3638 | { |
| 3639 | if (gdbarch->push_dummy_frame == 0) |
| 3640 | internal_error (__FILE__, __LINE__, |
| 3641 | "gdbarch: gdbarch_push_dummy_frame invalid"); |
| 3642 | if (gdbarch_debug >= 2) |
| 3643 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n"); |
| 3644 | gdbarch->push_dummy_frame (); |
| 3645 | } |
| 3646 | |
| 3647 | void |
| 3648 | set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, |
| 3649 | gdbarch_push_dummy_frame_ftype push_dummy_frame) |
| 3650 | { |
| 3651 | gdbarch->push_dummy_frame = push_dummy_frame; |
| 3652 | } |
| 3653 | |
| 3654 | int |
| 3655 | gdbarch_push_return_address_p (struct gdbarch *gdbarch) |
| 3656 | { |
| 3657 | return gdbarch->push_return_address != 0; |
| 3658 | } |
| 3659 | |
| 3660 | CORE_ADDR |
| 3661 | gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) |
| 3662 | { |
| 3663 | if (gdbarch->push_return_address == 0) |
| 3664 | internal_error (__FILE__, __LINE__, |
| 3665 | "gdbarch: gdbarch_push_return_address invalid"); |
| 3666 | if (gdbarch_debug >= 2) |
| 3667 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n"); |
| 3668 | return gdbarch->push_return_address (pc, sp); |
| 3669 | } |
| 3670 | |
| 3671 | void |
| 3672 | set_gdbarch_push_return_address (struct gdbarch *gdbarch, |
| 3673 | gdbarch_push_return_address_ftype push_return_address) |
| 3674 | { |
| 3675 | gdbarch->push_return_address = push_return_address; |
| 3676 | } |
| 3677 | |
| 3678 | void |
| 3679 | gdbarch_pop_frame (struct gdbarch *gdbarch) |
| 3680 | { |
| 3681 | if (gdbarch->pop_frame == 0) |
| 3682 | internal_error (__FILE__, __LINE__, |
| 3683 | "gdbarch: gdbarch_pop_frame invalid"); |
| 3684 | if (gdbarch_debug >= 2) |
| 3685 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n"); |
| 3686 | gdbarch->pop_frame (); |
| 3687 | } |
| 3688 | |
| 3689 | void |
| 3690 | set_gdbarch_pop_frame (struct gdbarch *gdbarch, |
| 3691 | gdbarch_pop_frame_ftype pop_frame) |
| 3692 | { |
| 3693 | gdbarch->pop_frame = pop_frame; |
| 3694 | } |
| 3695 | |
| 3696 | void |
| 3697 | gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) |
| 3698 | { |
| 3699 | if (gdbarch->store_struct_return == 0) |
| 3700 | internal_error (__FILE__, __LINE__, |
| 3701 | "gdbarch: gdbarch_store_struct_return invalid"); |
| 3702 | if (gdbarch_debug >= 2) |
| 3703 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n"); |
| 3704 | gdbarch->store_struct_return (addr, sp); |
| 3705 | } |
| 3706 | |
| 3707 | void |
| 3708 | set_gdbarch_store_struct_return (struct gdbarch *gdbarch, |
| 3709 | gdbarch_store_struct_return_ftype store_struct_return) |
| 3710 | { |
| 3711 | gdbarch->store_struct_return = store_struct_return; |
| 3712 | } |
| 3713 | |
| 3714 | void |
| 3715 | gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) |
| 3716 | { |
| 3717 | if (gdbarch->store_return_value == 0) |
| 3718 | internal_error (__FILE__, __LINE__, |
| 3719 | "gdbarch: gdbarch_store_return_value invalid"); |
| 3720 | if (gdbarch_debug >= 2) |
| 3721 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); |
| 3722 | gdbarch->store_return_value (type, valbuf); |
| 3723 | } |
| 3724 | |
| 3725 | void |
| 3726 | set_gdbarch_store_return_value (struct gdbarch *gdbarch, |
| 3727 | gdbarch_store_return_value_ftype store_return_value) |
| 3728 | { |
| 3729 | gdbarch->store_return_value = store_return_value; |
| 3730 | } |
| 3731 | |
| 3732 | int |
| 3733 | gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch) |
| 3734 | { |
| 3735 | return gdbarch->extract_struct_value_address != 0; |
| 3736 | } |
| 3737 | |
| 3738 | CORE_ADDR |
| 3739 | gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf) |
| 3740 | { |
| 3741 | if (gdbarch->extract_struct_value_address == 0) |
| 3742 | internal_error (__FILE__, __LINE__, |
| 3743 | "gdbarch: gdbarch_extract_struct_value_address invalid"); |
| 3744 | if (gdbarch_debug >= 2) |
| 3745 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n"); |
| 3746 | return gdbarch->extract_struct_value_address (regbuf); |
| 3747 | } |
| 3748 | |
| 3749 | void |
| 3750 | set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, |
| 3751 | gdbarch_extract_struct_value_address_ftype extract_struct_value_address) |
| 3752 | { |
| 3753 | gdbarch->extract_struct_value_address = extract_struct_value_address; |
| 3754 | } |
| 3755 | |
| 3756 | int |
| 3757 | gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type) |
| 3758 | { |
| 3759 | if (gdbarch->use_struct_convention == 0) |
| 3760 | internal_error (__FILE__, __LINE__, |
| 3761 | "gdbarch: gdbarch_use_struct_convention invalid"); |
| 3762 | if (gdbarch_debug >= 2) |
| 3763 | fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n"); |
| 3764 | return gdbarch->use_struct_convention (gcc_p, value_type); |
| 3765 | } |
| 3766 | |
| 3767 | void |
| 3768 | set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, |
| 3769 | gdbarch_use_struct_convention_ftype use_struct_convention) |
| 3770 | { |
| 3771 | gdbarch->use_struct_convention = use_struct_convention; |
| 3772 | } |
| 3773 | |
| 3774 | void |
| 3775 | gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) |
| 3776 | { |
| 3777 | if (gdbarch->frame_init_saved_regs == 0) |
| 3778 | internal_error (__FILE__, __LINE__, |
| 3779 | "gdbarch: gdbarch_frame_init_saved_regs invalid"); |
| 3780 | if (gdbarch_debug >= 2) |
| 3781 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n"); |
| 3782 | gdbarch->frame_init_saved_regs (frame); |
| 3783 | } |
| 3784 | |
| 3785 | void |
| 3786 | set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, |
| 3787 | gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs) |
| 3788 | { |
| 3789 | gdbarch->frame_init_saved_regs = frame_init_saved_regs; |
| 3790 | } |
| 3791 | |
| 3792 | int |
| 3793 | gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch) |
| 3794 | { |
| 3795 | return gdbarch->init_extra_frame_info != 0; |
| 3796 | } |
| 3797 | |
| 3798 | void |
| 3799 | gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame) |
| 3800 | { |
| 3801 | if (gdbarch->init_extra_frame_info == 0) |
| 3802 | internal_error (__FILE__, __LINE__, |
| 3803 | "gdbarch: gdbarch_init_extra_frame_info invalid"); |
| 3804 | if (gdbarch_debug >= 2) |
| 3805 | fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n"); |
| 3806 | gdbarch->init_extra_frame_info (fromleaf, frame); |
| 3807 | } |
| 3808 | |
| 3809 | void |
| 3810 | set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, |
| 3811 | gdbarch_init_extra_frame_info_ftype init_extra_frame_info) |
| 3812 | { |
| 3813 | gdbarch->init_extra_frame_info = init_extra_frame_info; |
| 3814 | } |
| 3815 | |
| 3816 | CORE_ADDR |
| 3817 | gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) |
| 3818 | { |
| 3819 | if (gdbarch->skip_prologue == 0) |
| 3820 | internal_error (__FILE__, __LINE__, |
| 3821 | "gdbarch: gdbarch_skip_prologue invalid"); |
| 3822 | if (gdbarch_debug >= 2) |
| 3823 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); |
| 3824 | return gdbarch->skip_prologue (ip); |
| 3825 | } |
| 3826 | |
| 3827 | void |
| 3828 | set_gdbarch_skip_prologue (struct gdbarch *gdbarch, |
| 3829 | gdbarch_skip_prologue_ftype skip_prologue) |
| 3830 | { |
| 3831 | gdbarch->skip_prologue = skip_prologue; |
| 3832 | } |
| 3833 | |
| 3834 | int |
| 3835 | gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip) |
| 3836 | { |
| 3837 | if (gdbarch->prologue_frameless_p == 0) |
| 3838 | internal_error (__FILE__, __LINE__, |
| 3839 | "gdbarch: gdbarch_prologue_frameless_p invalid"); |
| 3840 | if (gdbarch_debug >= 2) |
| 3841 | fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n"); |
| 3842 | return gdbarch->prologue_frameless_p (ip); |
| 3843 | } |
| 3844 | |
| 3845 | void |
| 3846 | set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, |
| 3847 | gdbarch_prologue_frameless_p_ftype prologue_frameless_p) |
| 3848 | { |
| 3849 | gdbarch->prologue_frameless_p = prologue_frameless_p; |
| 3850 | } |
| 3851 | |
| 3852 | int |
| 3853 | gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) |
| 3854 | { |
| 3855 | if (gdbarch->inner_than == 0) |
| 3856 | internal_error (__FILE__, __LINE__, |
| 3857 | "gdbarch: gdbarch_inner_than invalid"); |
| 3858 | if (gdbarch_debug >= 2) |
| 3859 | fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); |
| 3860 | return gdbarch->inner_than (lhs, rhs); |
| 3861 | } |
| 3862 | |
| 3863 | void |
| 3864 | set_gdbarch_inner_than (struct gdbarch *gdbarch, |
| 3865 | gdbarch_inner_than_ftype inner_than) |
| 3866 | { |
| 3867 | gdbarch->inner_than = inner_than; |
| 3868 | } |
| 3869 | |
| 3870 | unsigned char * |
| 3871 | gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) |
| 3872 | { |
| 3873 | if (gdbarch->breakpoint_from_pc == 0) |
| 3874 | internal_error (__FILE__, __LINE__, |
| 3875 | "gdbarch: gdbarch_breakpoint_from_pc invalid"); |
| 3876 | if (gdbarch_debug >= 2) |
| 3877 | fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); |
| 3878 | return gdbarch->breakpoint_from_pc (pcptr, lenptr); |
| 3879 | } |
| 3880 | |
| 3881 | void |
| 3882 | set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, |
| 3883 | gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc) |
| 3884 | { |
| 3885 | gdbarch->breakpoint_from_pc = breakpoint_from_pc; |
| 3886 | } |
| 3887 | |
| 3888 | int |
| 3889 | gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) |
| 3890 | { |
| 3891 | if (gdbarch->memory_insert_breakpoint == 0) |
| 3892 | internal_error (__FILE__, __LINE__, |
| 3893 | "gdbarch: gdbarch_memory_insert_breakpoint invalid"); |
| 3894 | if (gdbarch_debug >= 2) |
| 3895 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); |
| 3896 | return gdbarch->memory_insert_breakpoint (addr, contents_cache); |
| 3897 | } |
| 3898 | |
| 3899 | void |
| 3900 | set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, |
| 3901 | gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint) |
| 3902 | { |
| 3903 | gdbarch->memory_insert_breakpoint = memory_insert_breakpoint; |
| 3904 | } |
| 3905 | |
| 3906 | int |
| 3907 | gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) |
| 3908 | { |
| 3909 | if (gdbarch->memory_remove_breakpoint == 0) |
| 3910 | internal_error (__FILE__, __LINE__, |
| 3911 | "gdbarch: gdbarch_memory_remove_breakpoint invalid"); |
| 3912 | if (gdbarch_debug >= 2) |
| 3913 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); |
| 3914 | return gdbarch->memory_remove_breakpoint (addr, contents_cache); |
| 3915 | } |
| 3916 | |
| 3917 | void |
| 3918 | set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, |
| 3919 | gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint) |
| 3920 | { |
| 3921 | gdbarch->memory_remove_breakpoint = memory_remove_breakpoint; |
| 3922 | } |
| 3923 | |
| 3924 | CORE_ADDR |
| 3925 | gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) |
| 3926 | { |
| 3927 | if (gdbarch->decr_pc_after_break == -1) |
| 3928 | internal_error (__FILE__, __LINE__, |
| 3929 | "gdbarch: gdbarch_decr_pc_after_break invalid"); |
| 3930 | if (gdbarch_debug >= 2) |
| 3931 | fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); |
| 3932 | return gdbarch->decr_pc_after_break; |
| 3933 | } |
| 3934 | |
| 3935 | void |
| 3936 | set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, |
| 3937 | CORE_ADDR decr_pc_after_break) |
| 3938 | { |
| 3939 | gdbarch->decr_pc_after_break = decr_pc_after_break; |
| 3940 | } |
| 3941 | |
| 3942 | int |
| 3943 | gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it) |
| 3944 | { |
| 3945 | if (gdbarch->prepare_to_proceed == 0) |
| 3946 | internal_error (__FILE__, __LINE__, |
| 3947 | "gdbarch: gdbarch_prepare_to_proceed invalid"); |
| 3948 | if (gdbarch_debug >= 2) |
| 3949 | fprintf_unfiltered (gdb_stdlog, "gdbarch_prepare_to_proceed called\n"); |
| 3950 | return gdbarch->prepare_to_proceed (select_it); |
| 3951 | } |
| 3952 | |
| 3953 | void |
| 3954 | set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, |
| 3955 | gdbarch_prepare_to_proceed_ftype prepare_to_proceed) |
| 3956 | { |
| 3957 | gdbarch->prepare_to_proceed = prepare_to_proceed; |
| 3958 | } |
| 3959 | |
| 3960 | CORE_ADDR |
| 3961 | gdbarch_function_start_offset (struct gdbarch *gdbarch) |
| 3962 | { |
| 3963 | if (gdbarch->function_start_offset == -1) |
| 3964 | internal_error (__FILE__, __LINE__, |
| 3965 | "gdbarch: gdbarch_function_start_offset invalid"); |
| 3966 | if (gdbarch_debug >= 2) |
| 3967 | fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n"); |
| 3968 | return gdbarch->function_start_offset; |
| 3969 | } |
| 3970 | |
| 3971 | void |
| 3972 | set_gdbarch_function_start_offset (struct gdbarch *gdbarch, |
| 3973 | CORE_ADDR function_start_offset) |
| 3974 | { |
| 3975 | gdbarch->function_start_offset = function_start_offset; |
| 3976 | } |
| 3977 | |
| 3978 | void |
| 3979 | gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len) |
| 3980 | { |
| 3981 | if (gdbarch->remote_translate_xfer_address == 0) |
| 3982 | internal_error (__FILE__, __LINE__, |
| 3983 | "gdbarch: gdbarch_remote_translate_xfer_address invalid"); |
| 3984 | if (gdbarch_debug >= 2) |
| 3985 | fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n"); |
| 3986 | gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len); |
| 3987 | } |
| 3988 | |
| 3989 | void |
| 3990 | set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, |
| 3991 | gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address) |
| 3992 | { |
| 3993 | gdbarch->remote_translate_xfer_address = remote_translate_xfer_address; |
| 3994 | } |
| 3995 | |
| 3996 | CORE_ADDR |
| 3997 | gdbarch_frame_args_skip (struct gdbarch *gdbarch) |
| 3998 | { |
| 3999 | if (gdbarch->frame_args_skip == -1) |
| 4000 | internal_error (__FILE__, __LINE__, |
| 4001 | "gdbarch: gdbarch_frame_args_skip invalid"); |
| 4002 | if (gdbarch_debug >= 2) |
| 4003 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); |
| 4004 | return gdbarch->frame_args_skip; |
| 4005 | } |
| 4006 | |
| 4007 | void |
| 4008 | set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, |
| 4009 | CORE_ADDR frame_args_skip) |
| 4010 | { |
| 4011 | gdbarch->frame_args_skip = frame_args_skip; |
| 4012 | } |
| 4013 | |
| 4014 | int |
| 4015 | gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi) |
| 4016 | { |
| 4017 | if (gdbarch->frameless_function_invocation == 0) |
| 4018 | internal_error (__FILE__, __LINE__, |
| 4019 | "gdbarch: gdbarch_frameless_function_invocation invalid"); |
| 4020 | if (gdbarch_debug >= 2) |
| 4021 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n"); |
| 4022 | return gdbarch->frameless_function_invocation (fi); |
| 4023 | } |
| 4024 | |
| 4025 | void |
| 4026 | set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, |
| 4027 | gdbarch_frameless_function_invocation_ftype frameless_function_invocation) |
| 4028 | { |
| 4029 | gdbarch->frameless_function_invocation = frameless_function_invocation; |
| 4030 | } |
| 4031 | |
| 4032 | CORE_ADDR |
| 4033 | gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) |
| 4034 | { |
| 4035 | if (gdbarch->frame_chain == 0) |
| 4036 | internal_error (__FILE__, __LINE__, |
| 4037 | "gdbarch: gdbarch_frame_chain invalid"); |
| 4038 | if (gdbarch_debug >= 2) |
| 4039 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n"); |
| 4040 | return gdbarch->frame_chain (frame); |
| 4041 | } |
| 4042 | |
| 4043 | void |
| 4044 | set_gdbarch_frame_chain (struct gdbarch *gdbarch, |
| 4045 | gdbarch_frame_chain_ftype frame_chain) |
| 4046 | { |
| 4047 | gdbarch->frame_chain = frame_chain; |
| 4048 | } |
| 4049 | |
| 4050 | int |
| 4051 | gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe) |
| 4052 | { |
| 4053 | if (gdbarch->frame_chain_valid == 0) |
| 4054 | internal_error (__FILE__, __LINE__, |
| 4055 | "gdbarch: gdbarch_frame_chain_valid invalid"); |
| 4056 | if (gdbarch_debug >= 2) |
| 4057 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n"); |
| 4058 | return gdbarch->frame_chain_valid (chain, thisframe); |
| 4059 | } |
| 4060 | |
| 4061 | void |
| 4062 | set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, |
| 4063 | gdbarch_frame_chain_valid_ftype frame_chain_valid) |
| 4064 | { |
| 4065 | gdbarch->frame_chain_valid = frame_chain_valid; |
| 4066 | } |
| 4067 | |
| 4068 | CORE_ADDR |
| 4069 | gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi) |
| 4070 | { |
| 4071 | if (gdbarch->frame_saved_pc == 0) |
| 4072 | internal_error (__FILE__, __LINE__, |
| 4073 | "gdbarch: gdbarch_frame_saved_pc invalid"); |
| 4074 | if (gdbarch_debug >= 2) |
| 4075 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n"); |
| 4076 | return gdbarch->frame_saved_pc (fi); |
| 4077 | } |
| 4078 | |
| 4079 | void |
| 4080 | set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, |
| 4081 | gdbarch_frame_saved_pc_ftype frame_saved_pc) |
| 4082 | { |
| 4083 | gdbarch->frame_saved_pc = frame_saved_pc; |
| 4084 | } |
| 4085 | |
| 4086 | CORE_ADDR |
| 4087 | gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) |
| 4088 | { |
| 4089 | if (gdbarch->frame_args_address == 0) |
| 4090 | internal_error (__FILE__, __LINE__, |
| 4091 | "gdbarch: gdbarch_frame_args_address invalid"); |
| 4092 | if (gdbarch_debug >= 2) |
| 4093 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n"); |
| 4094 | return gdbarch->frame_args_address (fi); |
| 4095 | } |
| 4096 | |
| 4097 | void |
| 4098 | set_gdbarch_frame_args_address (struct gdbarch *gdbarch, |
| 4099 | gdbarch_frame_args_address_ftype frame_args_address) |
| 4100 | { |
| 4101 | gdbarch->frame_args_address = frame_args_address; |
| 4102 | } |
| 4103 | |
| 4104 | CORE_ADDR |
| 4105 | gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) |
| 4106 | { |
| 4107 | if (gdbarch->frame_locals_address == 0) |
| 4108 | internal_error (__FILE__, __LINE__, |
| 4109 | "gdbarch: gdbarch_frame_locals_address invalid"); |
| 4110 | if (gdbarch_debug >= 2) |
| 4111 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n"); |
| 4112 | return gdbarch->frame_locals_address (fi); |
| 4113 | } |
| 4114 | |
| 4115 | void |
| 4116 | set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, |
| 4117 | gdbarch_frame_locals_address_ftype frame_locals_address) |
| 4118 | { |
| 4119 | gdbarch->frame_locals_address = frame_locals_address; |
| 4120 | } |
| 4121 | |
| 4122 | CORE_ADDR |
| 4123 | gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame) |
| 4124 | { |
| 4125 | if (gdbarch->saved_pc_after_call == 0) |
| 4126 | internal_error (__FILE__, __LINE__, |
| 4127 | "gdbarch: gdbarch_saved_pc_after_call invalid"); |
| 4128 | if (gdbarch_debug >= 2) |
| 4129 | fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n"); |
| 4130 | return gdbarch->saved_pc_after_call (frame); |
| 4131 | } |
| 4132 | |
| 4133 | void |
| 4134 | set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, |
| 4135 | gdbarch_saved_pc_after_call_ftype saved_pc_after_call) |
| 4136 | { |
| 4137 | gdbarch->saved_pc_after_call = saved_pc_after_call; |
| 4138 | } |
| 4139 | |
| 4140 | int |
| 4141 | gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) |
| 4142 | { |
| 4143 | if (gdbarch->frame_num_args == 0) |
| 4144 | internal_error (__FILE__, __LINE__, |
| 4145 | "gdbarch: gdbarch_frame_num_args invalid"); |
| 4146 | if (gdbarch_debug >= 2) |
| 4147 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); |
| 4148 | return gdbarch->frame_num_args (frame); |
| 4149 | } |
| 4150 | |
| 4151 | void |
| 4152 | set_gdbarch_frame_num_args (struct gdbarch *gdbarch, |
| 4153 | gdbarch_frame_num_args_ftype frame_num_args) |
| 4154 | { |
| 4155 | gdbarch->frame_num_args = frame_num_args; |
| 4156 | } |
| 4157 | |
| 4158 | int |
| 4159 | gdbarch_stack_align_p (struct gdbarch *gdbarch) |
| 4160 | { |
| 4161 | return gdbarch->stack_align != 0; |
| 4162 | } |
| 4163 | |
| 4164 | CORE_ADDR |
| 4165 | gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp) |
| 4166 | { |
| 4167 | if (gdbarch->stack_align == 0) |
| 4168 | internal_error (__FILE__, __LINE__, |
| 4169 | "gdbarch: gdbarch_stack_align invalid"); |
| 4170 | if (gdbarch_debug >= 2) |
| 4171 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n"); |
| 4172 | return gdbarch->stack_align (sp); |
| 4173 | } |
| 4174 | |
| 4175 | void |
| 4176 | set_gdbarch_stack_align (struct gdbarch *gdbarch, |
| 4177 | gdbarch_stack_align_ftype stack_align) |
| 4178 | { |
| 4179 | gdbarch->stack_align = stack_align; |
| 4180 | } |
| 4181 | |
| 4182 | int |
| 4183 | gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch) |
| 4184 | { |
| 4185 | /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ |
| 4186 | if (gdbarch_debug >= 2) |
| 4187 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n"); |
| 4188 | return gdbarch->extra_stack_alignment_needed; |
| 4189 | } |
| 4190 | |
| 4191 | void |
| 4192 | set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, |
| 4193 | int extra_stack_alignment_needed) |
| 4194 | { |
| 4195 | gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed; |
| 4196 | } |
| 4197 | |
| 4198 | int |
| 4199 | gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch) |
| 4200 | { |
| 4201 | return gdbarch->reg_struct_has_addr != 0; |
| 4202 | } |
| 4203 | |
| 4204 | int |
| 4205 | gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) |
| 4206 | { |
| 4207 | if (gdbarch->reg_struct_has_addr == 0) |
| 4208 | internal_error (__FILE__, __LINE__, |
| 4209 | "gdbarch: gdbarch_reg_struct_has_addr invalid"); |
| 4210 | if (gdbarch_debug >= 2) |
| 4211 | fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n"); |
| 4212 | return gdbarch->reg_struct_has_addr (gcc_p, type); |
| 4213 | } |
| 4214 | |
| 4215 | void |
| 4216 | set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, |
| 4217 | gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr) |
| 4218 | { |
| 4219 | gdbarch->reg_struct_has_addr = reg_struct_has_addr; |
| 4220 | } |
| 4221 | |
| 4222 | int |
| 4223 | gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch) |
| 4224 | { |
| 4225 | return gdbarch->save_dummy_frame_tos != 0; |
| 4226 | } |
| 4227 | |
| 4228 | void |
| 4229 | gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp) |
| 4230 | { |
| 4231 | if (gdbarch->save_dummy_frame_tos == 0) |
| 4232 | internal_error (__FILE__, __LINE__, |
| 4233 | "gdbarch: gdbarch_save_dummy_frame_tos invalid"); |
| 4234 | if (gdbarch_debug >= 2) |
| 4235 | fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n"); |
| 4236 | gdbarch->save_dummy_frame_tos (sp); |
| 4237 | } |
| 4238 | |
| 4239 | void |
| 4240 | set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, |
| 4241 | gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos) |
| 4242 | { |
| 4243 | gdbarch->save_dummy_frame_tos = save_dummy_frame_tos; |
| 4244 | } |
| 4245 | |
| 4246 | int |
| 4247 | gdbarch_parm_boundary (struct gdbarch *gdbarch) |
| 4248 | { |
| 4249 | if (gdbarch_debug >= 2) |
| 4250 | fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n"); |
| 4251 | return gdbarch->parm_boundary; |
| 4252 | } |
| 4253 | |
| 4254 | void |
| 4255 | set_gdbarch_parm_boundary (struct gdbarch *gdbarch, |
| 4256 | int parm_boundary) |
| 4257 | { |
| 4258 | gdbarch->parm_boundary = parm_boundary; |
| 4259 | } |
| 4260 | |
| 4261 | const struct floatformat * |
| 4262 | gdbarch_float_format (struct gdbarch *gdbarch) |
| 4263 | { |
| 4264 | if (gdbarch_debug >= 2) |
| 4265 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n"); |
| 4266 | return gdbarch->float_format; |
| 4267 | } |
| 4268 | |
| 4269 | void |
| 4270 | set_gdbarch_float_format (struct gdbarch *gdbarch, |
| 4271 | const struct floatformat * float_format) |
| 4272 | { |
| 4273 | gdbarch->float_format = float_format; |
| 4274 | } |
| 4275 | |
| 4276 | const struct floatformat * |
| 4277 | gdbarch_double_format (struct gdbarch *gdbarch) |
| 4278 | { |
| 4279 | if (gdbarch_debug >= 2) |
| 4280 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n"); |
| 4281 | return gdbarch->double_format; |
| 4282 | } |
| 4283 | |
| 4284 | void |
| 4285 | set_gdbarch_double_format (struct gdbarch *gdbarch, |
| 4286 | const struct floatformat * double_format) |
| 4287 | { |
| 4288 | gdbarch->double_format = double_format; |
| 4289 | } |
| 4290 | |
| 4291 | const struct floatformat * |
| 4292 | gdbarch_long_double_format (struct gdbarch *gdbarch) |
| 4293 | { |
| 4294 | if (gdbarch_debug >= 2) |
| 4295 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n"); |
| 4296 | return gdbarch->long_double_format; |
| 4297 | } |
| 4298 | |
| 4299 | void |
| 4300 | set_gdbarch_long_double_format (struct gdbarch *gdbarch, |
| 4301 | const struct floatformat * long_double_format) |
| 4302 | { |
| 4303 | gdbarch->long_double_format = long_double_format; |
| 4304 | } |
| 4305 | |
| 4306 | CORE_ADDR |
| 4307 | gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr) |
| 4308 | { |
| 4309 | if (gdbarch->convert_from_func_ptr_addr == 0) |
| 4310 | internal_error (__FILE__, __LINE__, |
| 4311 | "gdbarch: gdbarch_convert_from_func_ptr_addr invalid"); |
| 4312 | if (gdbarch_debug >= 2) |
| 4313 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n"); |
| 4314 | return gdbarch->convert_from_func_ptr_addr (addr); |
| 4315 | } |
| 4316 | |
| 4317 | void |
| 4318 | set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, |
| 4319 | gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr) |
| 4320 | { |
| 4321 | gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr; |
| 4322 | } |
| 4323 | |
| 4324 | CORE_ADDR |
| 4325 | gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) |
| 4326 | { |
| 4327 | if (gdbarch->addr_bits_remove == 0) |
| 4328 | internal_error (__FILE__, __LINE__, |
| 4329 | "gdbarch: gdbarch_addr_bits_remove invalid"); |
| 4330 | if (gdbarch_debug >= 2) |
| 4331 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n"); |
| 4332 | return gdbarch->addr_bits_remove (addr); |
| 4333 | } |
| 4334 | |
| 4335 | void |
| 4336 | set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, |
| 4337 | gdbarch_addr_bits_remove_ftype addr_bits_remove) |
| 4338 | { |
| 4339 | gdbarch->addr_bits_remove = addr_bits_remove; |
| 4340 | } |
| 4341 | |
| 4342 | CORE_ADDR |
| 4343 | gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr) |
| 4344 | { |
| 4345 | if (gdbarch->smash_text_address == 0) |
| 4346 | internal_error (__FILE__, __LINE__, |
| 4347 | "gdbarch: gdbarch_smash_text_address invalid"); |
| 4348 | if (gdbarch_debug >= 2) |
| 4349 | fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n"); |
| 4350 | return gdbarch->smash_text_address (addr); |
| 4351 | } |
| 4352 | |
| 4353 | void |
| 4354 | set_gdbarch_smash_text_address (struct gdbarch *gdbarch, |
| 4355 | gdbarch_smash_text_address_ftype smash_text_address) |
| 4356 | { |
| 4357 | gdbarch->smash_text_address = smash_text_address; |
| 4358 | } |
| 4359 | |
| 4360 | int |
| 4361 | gdbarch_software_single_step_p (struct gdbarch *gdbarch) |
| 4362 | { |
| 4363 | return gdbarch->software_single_step != 0; |
| 4364 | } |
| 4365 | |
| 4366 | void |
| 4367 | gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p) |
| 4368 | { |
| 4369 | if (gdbarch->software_single_step == 0) |
| 4370 | internal_error (__FILE__, __LINE__, |
| 4371 | "gdbarch: gdbarch_software_single_step invalid"); |
| 4372 | if (gdbarch_debug >= 2) |
| 4373 | fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n"); |
| 4374 | gdbarch->software_single_step (sig, insert_breakpoints_p); |
| 4375 | } |
| 4376 | |
| 4377 | void |
| 4378 | set_gdbarch_software_single_step (struct gdbarch *gdbarch, |
| 4379 | gdbarch_software_single_step_ftype software_single_step) |
| 4380 | { |
| 4381 | gdbarch->software_single_step = software_single_step; |
| 4382 | } |
| 4383 | |
| 4384 | int |
| 4385 | gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info) |
| 4386 | { |
| 4387 | if (gdbarch->print_insn == 0) |
| 4388 | internal_error (__FILE__, __LINE__, |
| 4389 | "gdbarch: gdbarch_print_insn invalid"); |
| 4390 | if (gdbarch_debug >= 2) |
| 4391 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n"); |
| 4392 | return gdbarch->print_insn (vma, info); |
| 4393 | } |
| 4394 | |
| 4395 | void |
| 4396 | set_gdbarch_print_insn (struct gdbarch *gdbarch, |
| 4397 | gdbarch_print_insn_ftype print_insn) |
| 4398 | { |
| 4399 | gdbarch->print_insn = print_insn; |
| 4400 | } |
| 4401 | |
| 4402 | CORE_ADDR |
| 4403 | gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc) |
| 4404 | { |
| 4405 | if (gdbarch->skip_trampoline_code == 0) |
| 4406 | internal_error (__FILE__, __LINE__, |
| 4407 | "gdbarch: gdbarch_skip_trampoline_code invalid"); |
| 4408 | if (gdbarch_debug >= 2) |
| 4409 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n"); |
| 4410 | return gdbarch->skip_trampoline_code (pc); |
| 4411 | } |
| 4412 | |
| 4413 | void |
| 4414 | set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, |
| 4415 | gdbarch_skip_trampoline_code_ftype skip_trampoline_code) |
| 4416 | { |
| 4417 | gdbarch->skip_trampoline_code = skip_trampoline_code; |
| 4418 | } |
| 4419 | |
| 4420 | int |
| 4421 | gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) |
| 4422 | { |
| 4423 | if (gdbarch->in_solib_call_trampoline == 0) |
| 4424 | internal_error (__FILE__, __LINE__, |
| 4425 | "gdbarch: gdbarch_in_solib_call_trampoline invalid"); |
| 4426 | if (gdbarch_debug >= 2) |
| 4427 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n"); |
| 4428 | return gdbarch->in_solib_call_trampoline (pc, name); |
| 4429 | } |
| 4430 | |
| 4431 | void |
| 4432 | set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, |
| 4433 | gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline) |
| 4434 | { |
| 4435 | gdbarch->in_solib_call_trampoline = in_solib_call_trampoline; |
| 4436 | } |
| 4437 | |
| 4438 | int |
| 4439 | gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr) |
| 4440 | { |
| 4441 | if (gdbarch->in_function_epilogue_p == 0) |
| 4442 | internal_error (__FILE__, __LINE__, |
| 4443 | "gdbarch: gdbarch_in_function_epilogue_p invalid"); |
| 4444 | if (gdbarch_debug >= 2) |
| 4445 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n"); |
| 4446 | return gdbarch->in_function_epilogue_p (gdbarch, addr); |
| 4447 | } |
| 4448 | |
| 4449 | void |
| 4450 | set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, |
| 4451 | gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p) |
| 4452 | { |
| 4453 | gdbarch->in_function_epilogue_p = in_function_epilogue_p; |
| 4454 | } |
| 4455 | |
| 4456 | char * |
| 4457 | gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv) |
| 4458 | { |
| 4459 | if (gdbarch->construct_inferior_arguments == 0) |
| 4460 | internal_error (__FILE__, __LINE__, |
| 4461 | "gdbarch: gdbarch_construct_inferior_arguments invalid"); |
| 4462 | if (gdbarch_debug >= 2) |
| 4463 | fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n"); |
| 4464 | return gdbarch->construct_inferior_arguments (gdbarch, argc, argv); |
| 4465 | } |
| 4466 | |
| 4467 | void |
| 4468 | set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, |
| 4469 | gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments) |
| 4470 | { |
| 4471 | gdbarch->construct_inferior_arguments = construct_inferior_arguments; |
| 4472 | } |
| 4473 | |
| 4474 | int |
| 4475 | gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch) |
| 4476 | { |
| 4477 | return gdbarch->dwarf2_build_frame_info != 0; |
| 4478 | } |
| 4479 | |
| 4480 | void |
| 4481 | gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile) |
| 4482 | { |
| 4483 | if (gdbarch->dwarf2_build_frame_info == 0) |
| 4484 | internal_error (__FILE__, __LINE__, |
| 4485 | "gdbarch: gdbarch_dwarf2_build_frame_info invalid"); |
| 4486 | if (gdbarch_debug >= 2) |
| 4487 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_build_frame_info called\n"); |
| 4488 | gdbarch->dwarf2_build_frame_info (objfile); |
| 4489 | } |
| 4490 | |
| 4491 | void |
| 4492 | set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, |
| 4493 | gdbarch_dwarf2_build_frame_info_ftype dwarf2_build_frame_info) |
| 4494 | { |
| 4495 | gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info; |
| 4496 | } |
| 4497 | |
| 4498 | void |
| 4499 | gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym) |
| 4500 | { |
| 4501 | if (gdbarch->elf_make_msymbol_special == 0) |
| 4502 | internal_error (__FILE__, __LINE__, |
| 4503 | "gdbarch: gdbarch_elf_make_msymbol_special invalid"); |
| 4504 | if (gdbarch_debug >= 2) |
| 4505 | fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n"); |
| 4506 | gdbarch->elf_make_msymbol_special (sym, msym); |
| 4507 | } |
| 4508 | |
| 4509 | void |
| 4510 | set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, |
| 4511 | gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special) |
| 4512 | { |
| 4513 | gdbarch->elf_make_msymbol_special = elf_make_msymbol_special; |
| 4514 | } |
| 4515 | |
| 4516 | void |
| 4517 | gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym) |
| 4518 | { |
| 4519 | if (gdbarch->coff_make_msymbol_special == 0) |
| 4520 | internal_error (__FILE__, __LINE__, |
| 4521 | "gdbarch: gdbarch_coff_make_msymbol_special invalid"); |
| 4522 | if (gdbarch_debug >= 2) |
| 4523 | fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n"); |
| 4524 | gdbarch->coff_make_msymbol_special (val, msym); |
| 4525 | } |
| 4526 | |
| 4527 | void |
| 4528 | set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, |
| 4529 | gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special) |
| 4530 | { |
| 4531 | gdbarch->coff_make_msymbol_special = coff_make_msymbol_special; |
| 4532 | } |
| 4533 | |
| 4534 | |
| 4535 | /* Keep a registry of per-architecture data-pointers required by GDB |
| 4536 | modules. */ |
| 4537 | |
| 4538 | struct gdbarch_data |
| 4539 | { |
| 4540 | unsigned index; |
| 4541 | gdbarch_data_init_ftype *init; |
| 4542 | gdbarch_data_free_ftype *free; |
| 4543 | }; |
| 4544 | |
| 4545 | struct gdbarch_data_registration |
| 4546 | { |
| 4547 | struct gdbarch_data *data; |
| 4548 | struct gdbarch_data_registration *next; |
| 4549 | }; |
| 4550 | |
| 4551 | struct gdbarch_data_registry |
| 4552 | { |
| 4553 | unsigned nr; |
| 4554 | struct gdbarch_data_registration *registrations; |
| 4555 | }; |
| 4556 | |
| 4557 | struct gdbarch_data_registry gdbarch_data_registry = |
| 4558 | { |
| 4559 | 0, NULL, |
| 4560 | }; |
| 4561 | |
| 4562 | struct gdbarch_data * |
| 4563 | register_gdbarch_data (gdbarch_data_init_ftype *init, |
| 4564 | gdbarch_data_free_ftype *free) |
| 4565 | { |
| 4566 | struct gdbarch_data_registration **curr; |
| 4567 | for (curr = &gdbarch_data_registry.registrations; |
| 4568 | (*curr) != NULL; |
| 4569 | curr = &(*curr)->next); |
| 4570 | (*curr) = XMALLOC (struct gdbarch_data_registration); |
| 4571 | (*curr)->next = NULL; |
| 4572 | (*curr)->data = XMALLOC (struct gdbarch_data); |
| 4573 | (*curr)->data->index = gdbarch_data_registry.nr++; |
| 4574 | (*curr)->data->init = init; |
| 4575 | (*curr)->data->free = free; |
| 4576 | return (*curr)->data; |
| 4577 | } |
| 4578 | |
| 4579 | |
| 4580 | /* Walk through all the registered users initializing each in turn. */ |
| 4581 | |
| 4582 | static void |
| 4583 | init_gdbarch_data (struct gdbarch *gdbarch) |
| 4584 | { |
| 4585 | struct gdbarch_data_registration *rego; |
| 4586 | for (rego = gdbarch_data_registry.registrations; |
| 4587 | rego != NULL; |
| 4588 | rego = rego->next) |
| 4589 | { |
| 4590 | struct gdbarch_data *data = rego->data; |
| 4591 | gdb_assert (data->index < gdbarch->nr_data); |
| 4592 | if (data->init != NULL) |
| 4593 | { |
| 4594 | void *pointer = data->init (gdbarch); |
| 4595 | set_gdbarch_data (gdbarch, data, pointer); |
| 4596 | } |
| 4597 | } |
| 4598 | } |
| 4599 | |
| 4600 | /* Create/delete the gdbarch data vector. */ |
| 4601 | |
| 4602 | static void |
| 4603 | alloc_gdbarch_data (struct gdbarch *gdbarch) |
| 4604 | { |
| 4605 | gdb_assert (gdbarch->data == NULL); |
| 4606 | gdbarch->nr_data = gdbarch_data_registry.nr; |
| 4607 | gdbarch->data = xcalloc (gdbarch->nr_data, sizeof (void*)); |
| 4608 | } |
| 4609 | |
| 4610 | static void |
| 4611 | free_gdbarch_data (struct gdbarch *gdbarch) |
| 4612 | { |
| 4613 | struct gdbarch_data_registration *rego; |
| 4614 | gdb_assert (gdbarch->data != NULL); |
| 4615 | for (rego = gdbarch_data_registry.registrations; |
| 4616 | rego != NULL; |
| 4617 | rego = rego->next) |
| 4618 | { |
| 4619 | struct gdbarch_data *data = rego->data; |
| 4620 | gdb_assert (data->index < gdbarch->nr_data); |
| 4621 | if (data->free != NULL && gdbarch->data[data->index] != NULL) |
| 4622 | { |
| 4623 | data->free (gdbarch, gdbarch->data[data->index]); |
| 4624 | gdbarch->data[data->index] = NULL; |
| 4625 | } |
| 4626 | } |
| 4627 | xfree (gdbarch->data); |
| 4628 | gdbarch->data = NULL; |
| 4629 | } |
| 4630 | |
| 4631 | |
| 4632 | /* Initialize the current value of thee specified per-architecture |
| 4633 | data-pointer. */ |
| 4634 | |
| 4635 | void |
| 4636 | set_gdbarch_data (struct gdbarch *gdbarch, |
| 4637 | struct gdbarch_data *data, |
| 4638 | void *pointer) |
| 4639 | { |
| 4640 | gdb_assert (data->index < gdbarch->nr_data); |
| 4641 | if (data->free != NULL && gdbarch->data[data->index] != NULL) |
| 4642 | data->free (gdbarch, gdbarch->data[data->index]); |
| 4643 | gdbarch->data[data->index] = pointer; |
| 4644 | } |
| 4645 | |
| 4646 | /* Return the current value of the specified per-architecture |
| 4647 | data-pointer. */ |
| 4648 | |
| 4649 | void * |
| 4650 | gdbarch_data (struct gdbarch_data *data) |
| 4651 | { |
| 4652 | gdb_assert (data->index < current_gdbarch->nr_data); |
| 4653 | return current_gdbarch->data[data->index]; |
| 4654 | } |
| 4655 | |
| 4656 | |
| 4657 | |
| 4658 | /* Keep a registry of swapped data required by GDB modules. */ |
| 4659 | |
| 4660 | struct gdbarch_swap |
| 4661 | { |
| 4662 | void *swap; |
| 4663 | struct gdbarch_swap_registration *source; |
| 4664 | struct gdbarch_swap *next; |
| 4665 | }; |
| 4666 | |
| 4667 | struct gdbarch_swap_registration |
| 4668 | { |
| 4669 | void *data; |
| 4670 | unsigned long sizeof_data; |
| 4671 | gdbarch_swap_ftype *init; |
| 4672 | struct gdbarch_swap_registration *next; |
| 4673 | }; |
| 4674 | |
| 4675 | struct gdbarch_swap_registry |
| 4676 | { |
| 4677 | int nr; |
| 4678 | struct gdbarch_swap_registration *registrations; |
| 4679 | }; |
| 4680 | |
| 4681 | struct gdbarch_swap_registry gdbarch_swap_registry = |
| 4682 | { |
| 4683 | 0, NULL, |
| 4684 | }; |
| 4685 | |
| 4686 | void |
| 4687 | register_gdbarch_swap (void *data, |
| 4688 | unsigned long sizeof_data, |
| 4689 | gdbarch_swap_ftype *init) |
| 4690 | { |
| 4691 | struct gdbarch_swap_registration **rego; |
| 4692 | for (rego = &gdbarch_swap_registry.registrations; |
| 4693 | (*rego) != NULL; |
| 4694 | rego = &(*rego)->next); |
| 4695 | (*rego) = XMALLOC (struct gdbarch_swap_registration); |
| 4696 | (*rego)->next = NULL; |
| 4697 | (*rego)->init = init; |
| 4698 | (*rego)->data = data; |
| 4699 | (*rego)->sizeof_data = sizeof_data; |
| 4700 | } |
| 4701 | |
| 4702 | |
| 4703 | static void |
| 4704 | init_gdbarch_swap (struct gdbarch *gdbarch) |
| 4705 | { |
| 4706 | struct gdbarch_swap_registration *rego; |
| 4707 | struct gdbarch_swap **curr = &gdbarch->swap; |
| 4708 | for (rego = gdbarch_swap_registry.registrations; |
| 4709 | rego != NULL; |
| 4710 | rego = rego->next) |
| 4711 | { |
| 4712 | if (rego->data != NULL) |
| 4713 | { |
| 4714 | (*curr) = XMALLOC (struct gdbarch_swap); |
| 4715 | (*curr)->source = rego; |
| 4716 | (*curr)->swap = xmalloc (rego->sizeof_data); |
| 4717 | (*curr)->next = NULL; |
| 4718 | memset (rego->data, 0, rego->sizeof_data); |
| 4719 | curr = &(*curr)->next; |
| 4720 | } |
| 4721 | if (rego->init != NULL) |
| 4722 | rego->init (); |
| 4723 | } |
| 4724 | } |
| 4725 | |
| 4726 | static void |
| 4727 | swapout_gdbarch_swap (struct gdbarch *gdbarch) |
| 4728 | { |
| 4729 | struct gdbarch_swap *curr; |
| 4730 | for (curr = gdbarch->swap; |
| 4731 | curr != NULL; |
| 4732 | curr = curr->next) |
| 4733 | memcpy (curr->swap, curr->source->data, curr->source->sizeof_data); |
| 4734 | } |
| 4735 | |
| 4736 | static void |
| 4737 | swapin_gdbarch_swap (struct gdbarch *gdbarch) |
| 4738 | { |
| 4739 | struct gdbarch_swap *curr; |
| 4740 | for (curr = gdbarch->swap; |
| 4741 | curr != NULL; |
| 4742 | curr = curr->next) |
| 4743 | memcpy (curr->source->data, curr->swap, curr->source->sizeof_data); |
| 4744 | } |
| 4745 | |
| 4746 | |
| 4747 | /* Keep a registry of the architectures known by GDB. */ |
| 4748 | |
| 4749 | struct gdbarch_registration |
| 4750 | { |
| 4751 | enum bfd_architecture bfd_architecture; |
| 4752 | gdbarch_init_ftype *init; |
| 4753 | gdbarch_dump_tdep_ftype *dump_tdep; |
| 4754 | struct gdbarch_list *arches; |
| 4755 | struct gdbarch_registration *next; |
| 4756 | }; |
| 4757 | |
| 4758 | static struct gdbarch_registration *gdbarch_registry = NULL; |
| 4759 | |
| 4760 | static void |
| 4761 | append_name (const char ***buf, int *nr, const char *name) |
| 4762 | { |
| 4763 | *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1)); |
| 4764 | (*buf)[*nr] = name; |
| 4765 | *nr += 1; |
| 4766 | } |
| 4767 | |
| 4768 | const char ** |
| 4769 | gdbarch_printable_names (void) |
| 4770 | { |
| 4771 | if (GDB_MULTI_ARCH) |
| 4772 | { |
| 4773 | /* Accumulate a list of names based on the registed list of |
| 4774 | architectures. */ |
| 4775 | enum bfd_architecture a; |
| 4776 | int nr_arches = 0; |
| 4777 | const char **arches = NULL; |
| 4778 | struct gdbarch_registration *rego; |
| 4779 | for (rego = gdbarch_registry; |
| 4780 | rego != NULL; |
| 4781 | rego = rego->next) |
| 4782 | { |
| 4783 | const struct bfd_arch_info *ap; |
| 4784 | ap = bfd_lookup_arch (rego->bfd_architecture, 0); |
| 4785 | if (ap == NULL) |
| 4786 | internal_error (__FILE__, __LINE__, |
| 4787 | "gdbarch_architecture_names: multi-arch unknown"); |
| 4788 | do |
| 4789 | { |
| 4790 | append_name (&arches, &nr_arches, ap->printable_name); |
| 4791 | ap = ap->next; |
| 4792 | } |
| 4793 | while (ap != NULL); |
| 4794 | } |
| 4795 | append_name (&arches, &nr_arches, NULL); |
| 4796 | return arches; |
| 4797 | } |
| 4798 | else |
| 4799 | /* Just return all the architectures that BFD knows. Assume that |
| 4800 | the legacy architecture framework supports them. */ |
| 4801 | return bfd_arch_list (); |
| 4802 | } |
| 4803 | |
| 4804 | |
| 4805 | void |
| 4806 | gdbarch_register (enum bfd_architecture bfd_architecture, |
| 4807 | gdbarch_init_ftype *init, |
| 4808 | gdbarch_dump_tdep_ftype *dump_tdep) |
| 4809 | { |
| 4810 | struct gdbarch_registration **curr; |
| 4811 | const struct bfd_arch_info *bfd_arch_info; |
| 4812 | /* Check that BFD recognizes this architecture */ |
| 4813 | bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); |
| 4814 | if (bfd_arch_info == NULL) |
| 4815 | { |
| 4816 | internal_error (__FILE__, __LINE__, |
| 4817 | "gdbarch: Attempt to register unknown architecture (%d)", |
| 4818 | bfd_architecture); |
| 4819 | } |
| 4820 | /* Check that we haven't seen this architecture before */ |
| 4821 | for (curr = &gdbarch_registry; |
| 4822 | (*curr) != NULL; |
| 4823 | curr = &(*curr)->next) |
| 4824 | { |
| 4825 | if (bfd_architecture == (*curr)->bfd_architecture) |
| 4826 | internal_error (__FILE__, __LINE__, |
| 4827 | "gdbarch: Duplicate registraration of architecture (%s)", |
| 4828 | bfd_arch_info->printable_name); |
| 4829 | } |
| 4830 | /* log it */ |
| 4831 | if (gdbarch_debug) |
| 4832 | fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n", |
| 4833 | bfd_arch_info->printable_name, |
| 4834 | (long) init); |
| 4835 | /* Append it */ |
| 4836 | (*curr) = XMALLOC (struct gdbarch_registration); |
| 4837 | (*curr)->bfd_architecture = bfd_architecture; |
| 4838 | (*curr)->init = init; |
| 4839 | (*curr)->dump_tdep = dump_tdep; |
| 4840 | (*curr)->arches = NULL; |
| 4841 | (*curr)->next = NULL; |
| 4842 | /* When non- multi-arch, install whatever target dump routine we've |
| 4843 | been provided - hopefully that routine has been written correctly |
| 4844 | and works regardless of multi-arch. */ |
| 4845 | if (!GDB_MULTI_ARCH && dump_tdep != NULL |
| 4846 | && startup_gdbarch.dump_tdep == NULL) |
| 4847 | startup_gdbarch.dump_tdep = dump_tdep; |
| 4848 | } |
| 4849 | |
| 4850 | void |
| 4851 | register_gdbarch_init (enum bfd_architecture bfd_architecture, |
| 4852 | gdbarch_init_ftype *init) |
| 4853 | { |
| 4854 | gdbarch_register (bfd_architecture, init, NULL); |
| 4855 | } |
| 4856 | |
| 4857 | |
| 4858 | /* Look for an architecture using gdbarch_info. Base search on only |
| 4859 | BFD_ARCH_INFO and BYTE_ORDER. */ |
| 4860 | |
| 4861 | struct gdbarch_list * |
| 4862 | gdbarch_list_lookup_by_info (struct gdbarch_list *arches, |
| 4863 | const struct gdbarch_info *info) |
| 4864 | { |
| 4865 | for (; arches != NULL; arches = arches->next) |
| 4866 | { |
| 4867 | if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info) |
| 4868 | continue; |
| 4869 | if (info->byte_order != arches->gdbarch->byte_order) |
| 4870 | continue; |
| 4871 | return arches; |
| 4872 | } |
| 4873 | return NULL; |
| 4874 | } |
| 4875 | |
| 4876 | |
| 4877 | /* Update the current architecture. Return ZERO if the update request |
| 4878 | failed. */ |
| 4879 | |
| 4880 | int |
| 4881 | gdbarch_update_p (struct gdbarch_info info) |
| 4882 | { |
| 4883 | struct gdbarch *new_gdbarch; |
| 4884 | struct gdbarch_list **list; |
| 4885 | struct gdbarch_registration *rego; |
| 4886 | |
| 4887 | /* Fill in missing parts of the INFO struct using a number of |
| 4888 | sources: ``set ...''; INFOabfd supplied; existing target. */ |
| 4889 | |
| 4890 | /* ``(gdb) set architecture ...'' */ |
| 4891 | if (info.bfd_arch_info == NULL |
| 4892 | && !TARGET_ARCHITECTURE_AUTO) |
| 4893 | info.bfd_arch_info = TARGET_ARCHITECTURE; |
| 4894 | if (info.bfd_arch_info == NULL |
| 4895 | && info.abfd != NULL |
| 4896 | && bfd_get_arch (info.abfd) != bfd_arch_unknown |
| 4897 | && bfd_get_arch (info.abfd) != bfd_arch_obscure) |
| 4898 | info.bfd_arch_info = bfd_get_arch_info (info.abfd); |
| 4899 | if (info.bfd_arch_info == NULL) |
| 4900 | info.bfd_arch_info = TARGET_ARCHITECTURE; |
| 4901 | |
| 4902 | /* ``(gdb) set byte-order ...'' */ |
| 4903 | if (info.byte_order == BFD_ENDIAN_UNKNOWN |
| 4904 | && !TARGET_BYTE_ORDER_AUTO) |
| 4905 | info.byte_order = TARGET_BYTE_ORDER; |
| 4906 | /* From the INFO struct. */ |
| 4907 | if (info.byte_order == BFD_ENDIAN_UNKNOWN |
| 4908 | && info.abfd != NULL) |
| 4909 | info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG |
| 4910 | : bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE |
| 4911 | : BFD_ENDIAN_UNKNOWN); |
| 4912 | /* From the current target. */ |
| 4913 | if (info.byte_order == BFD_ENDIAN_UNKNOWN) |
| 4914 | info.byte_order = TARGET_BYTE_ORDER; |
| 4915 | |
| 4916 | /* Must have found some sort of architecture. */ |
| 4917 | gdb_assert (info.bfd_arch_info != NULL); |
| 4918 | |
| 4919 | if (gdbarch_debug) |
| 4920 | { |
| 4921 | fprintf_unfiltered (gdb_stdlog, |
| 4922 | "gdbarch_update: info.bfd_arch_info %s\n", |
| 4923 | (info.bfd_arch_info != NULL |
| 4924 | ? info.bfd_arch_info->printable_name |
| 4925 | : "(null)")); |
| 4926 | fprintf_unfiltered (gdb_stdlog, |
| 4927 | "gdbarch_update: info.byte_order %d (%s)\n", |
| 4928 | info.byte_order, |
| 4929 | (info.byte_order == BFD_ENDIAN_BIG ? "big" |
| 4930 | : info.byte_order == BFD_ENDIAN_LITTLE ? "little" |
| 4931 | : "default")); |
| 4932 | fprintf_unfiltered (gdb_stdlog, |
| 4933 | "gdbarch_update: info.abfd 0x%lx\n", |
| 4934 | (long) info.abfd); |
| 4935 | fprintf_unfiltered (gdb_stdlog, |
| 4936 | "gdbarch_update: info.tdep_info 0x%lx\n", |
| 4937 | (long) info.tdep_info); |
| 4938 | } |
| 4939 | |
| 4940 | /* Find the target that knows about this architecture. */ |
| 4941 | for (rego = gdbarch_registry; |
| 4942 | rego != NULL; |
| 4943 | rego = rego->next) |
| 4944 | if (rego->bfd_architecture == info.bfd_arch_info->arch) |
| 4945 | break; |
| 4946 | if (rego == NULL) |
| 4947 | { |
| 4948 | if (gdbarch_debug) |
| 4949 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n"); |
| 4950 | return 0; |
| 4951 | } |
| 4952 | |
| 4953 | /* Ask the target for a replacement architecture. */ |
| 4954 | new_gdbarch = rego->init (info, rego->arches); |
| 4955 | |
| 4956 | /* Did the target like it? No. Reject the change. */ |
| 4957 | if (new_gdbarch == NULL) |
| 4958 | { |
| 4959 | if (gdbarch_debug) |
| 4960 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n"); |
| 4961 | return 0; |
| 4962 | } |
| 4963 | |
| 4964 | /* Did the architecture change? No. Do nothing. */ |
| 4965 | if (current_gdbarch == new_gdbarch) |
| 4966 | { |
| 4967 | if (gdbarch_debug) |
| 4968 | fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n", |
| 4969 | (long) new_gdbarch, |
| 4970 | new_gdbarch->bfd_arch_info->printable_name); |
| 4971 | return 1; |
| 4972 | } |
| 4973 | |
| 4974 | /* Swap all data belonging to the old target out */ |
| 4975 | swapout_gdbarch_swap (current_gdbarch); |
| 4976 | |
| 4977 | /* Is this a pre-existing architecture? Yes. Swap it in. */ |
| 4978 | for (list = ®o->arches; |
| 4979 | (*list) != NULL; |
| 4980 | list = &(*list)->next) |
| 4981 | { |
| 4982 | if ((*list)->gdbarch == new_gdbarch) |
| 4983 | { |
| 4984 | if (gdbarch_debug) |
| 4985 | fprintf_unfiltered (gdb_stdlog, |
| 4986 | "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n", |
| 4987 | (long) new_gdbarch, |
| 4988 | new_gdbarch->bfd_arch_info->printable_name); |
| 4989 | current_gdbarch = new_gdbarch; |
| 4990 | swapin_gdbarch_swap (new_gdbarch); |
| 4991 | architecture_changed_event (); |
| 4992 | return 1; |
| 4993 | } |
| 4994 | } |
| 4995 | |
| 4996 | /* Append this new architecture to this targets list. */ |
| 4997 | (*list) = XMALLOC (struct gdbarch_list); |
| 4998 | (*list)->next = NULL; |
| 4999 | (*list)->gdbarch = new_gdbarch; |
| 5000 | |
| 5001 | /* Switch to this new architecture. Dump it out. */ |
| 5002 | current_gdbarch = new_gdbarch; |
| 5003 | if (gdbarch_debug) |
| 5004 | { |
| 5005 | fprintf_unfiltered (gdb_stdlog, |
| 5006 | "gdbarch_update: New architecture 0x%08lx (%s) selected\n", |
| 5007 | (long) new_gdbarch, |
| 5008 | new_gdbarch->bfd_arch_info->printable_name); |
| 5009 | } |
| 5010 | |
| 5011 | /* Check that the newly installed architecture is valid. Plug in |
| 5012 | any post init values. */ |
| 5013 | new_gdbarch->dump_tdep = rego->dump_tdep; |
| 5014 | verify_gdbarch (new_gdbarch); |
| 5015 | |
| 5016 | /* Initialize the per-architecture memory (swap) areas. |
| 5017 | CURRENT_GDBARCH must be update before these modules are |
| 5018 | called. */ |
| 5019 | init_gdbarch_swap (new_gdbarch); |
| 5020 | |
| 5021 | /* Initialize the per-architecture data-pointer of all parties that |
| 5022 | registered an interest in this architecture. CURRENT_GDBARCH |
| 5023 | must be updated before these modules are called. */ |
| 5024 | init_gdbarch_data (new_gdbarch); |
| 5025 | architecture_changed_event (); |
| 5026 | |
| 5027 | if (gdbarch_debug) |
| 5028 | gdbarch_dump (current_gdbarch, gdb_stdlog); |
| 5029 | |
| 5030 | return 1; |
| 5031 | } |
| 5032 | |
| 5033 | |
| 5034 | /* Disassembler */ |
| 5035 | |
| 5036 | /* Pointer to the target-dependent disassembly function. */ |
| 5037 | int (*tm_print_insn) (bfd_vma, disassemble_info *); |
| 5038 | disassemble_info tm_print_insn_info; |
| 5039 | |
| 5040 | |
| 5041 | extern void _initialize_gdbarch (void); |
| 5042 | |
| 5043 | void |
| 5044 | _initialize_gdbarch (void) |
| 5045 | { |
| 5046 | struct cmd_list_element *c; |
| 5047 | |
| 5048 | INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered); |
| 5049 | tm_print_insn_info.flavour = bfd_target_unknown_flavour; |
| 5050 | tm_print_insn_info.read_memory_func = dis_asm_read_memory; |
| 5051 | tm_print_insn_info.memory_error_func = dis_asm_memory_error; |
| 5052 | tm_print_insn_info.print_address_func = dis_asm_print_address; |
| 5053 | |
| 5054 | add_show_from_set (add_set_cmd ("arch", |
| 5055 | class_maintenance, |
| 5056 | var_zinteger, |
| 5057 | (char *)&gdbarch_debug, |
| 5058 | "Set architecture debugging.\n\ |
| 5059 | When non-zero, architecture debugging is enabled.", &setdebuglist), |
| 5060 | &showdebuglist); |
| 5061 | c = add_set_cmd ("archdebug", |
| 5062 | class_maintenance, |
| 5063 | var_zinteger, |
| 5064 | (char *)&gdbarch_debug, |
| 5065 | "Set architecture debugging.\n\ |
| 5066 | When non-zero, architecture debugging is enabled.", &setlist); |
| 5067 | |
| 5068 | deprecate_cmd (c, "set debug arch"); |
| 5069 | deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch"); |
| 5070 | } |