static void rs6000_lynx178_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch) { set_gdbarch_push_dummy_call (gdbarch, rs6000_lynx178_push_dummy_call); set_gdbarch_return_value (gdbarch, rs6000_lynx178_return_value); set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); }
static void ppcfbsd_kernel_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); frame_unwind_prepend_unwinder(gdbarch, &ppcfbsd_trapframe_unwind); set_solib_ops(gdbarch, &kld_so_ops); #ifdef __powerpc__ if (tdep->wordsize == sizeof(register_t)) { fbsd_vmcore_set_supply_pcb(gdbarch, ppcfbsd_supply_pcb); fbsd_vmcore_set_cpu_pcb_addr(gdbarch, kgdb_trgt_stop_pcb); } #endif /* FreeBSD doesn't support the 128-bit `long double' from the psABI. */ set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double); if (tdep->wordsize == 4) { set_gdbarch_return_value (gdbarch, ppc_sysv_abi_broken_return_value); } if (tdep->wordsize == 8) { set_gdbarch_convert_from_func_ptr_addr (gdbarch, ppc64_convert_from_func_ptr_addr); set_gdbarch_elf_make_msymbol_special (gdbarch, ppc64_elf_make_msymbol_special); } }
static void ppcfbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* FreeBSD doesn't support the 128-bit `long double' from the psABI. */ set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_pc_in_sigtramp (gdbarch, ppcfbsd_pc_in_sigtramp); if (tdep->wordsize == 4) { set_gdbarch_return_value (gdbarch, ppcfbsd_return_value); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); } if (tdep->wordsize == 8) { set_gdbarch_convert_from_func_ptr_addr (gdbarch, ppc64_fbsd_convert_from_func_ptr_addr); set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_lp64_fetch_link_map_offsets); } set_gdbarch_regset_from_core_section (gdbarch, ppcfbsd_regset_from_core_section); }
static void ppcnbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { /* For NetBSD, this is an on again, off again thing. Some systems do use the broken struct convention, and some don't. */ set_gdbarch_return_value (gdbarch, ppcnbsd_return_value); set_solib_svr4_fetch_link_map_offsets (gdbarch, nbsd_ilp32_solib_svr4_fetch_link_map_offsets); tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd_sigtramp); }
static struct gdbarch * m88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; /* If there is already a candidate, use it. */ arches = gdbarch_list_lookup_by_info (arches, &info); if (arches != NULL) return arches->gdbarch; /* Allocate space for the new architecture. */ gdbarch = gdbarch_alloc (&info, NULL); /* There is no real `long double'. */ set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double); set_gdbarch_num_regs (gdbarch, M88K_NUM_REGS); set_gdbarch_register_name (gdbarch, m88k_register_name); set_gdbarch_register_type (gdbarch, m88k_register_type); /* Register numbers of various important registers. */ set_gdbarch_sp_regnum (gdbarch, M88K_R31_REGNUM); set_gdbarch_pc_regnum (gdbarch, M88K_SXIP_REGNUM); /* Core file support. */ set_gdbarch_regset_from_core_section (gdbarch, m88k_regset_from_core_section); set_gdbarch_print_insn (gdbarch, print_insn_m88k); set_gdbarch_skip_prologue (gdbarch, m88k_skip_prologue); /* Stack grows downward. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Call dummy code. */ set_gdbarch_push_dummy_call (gdbarch, m88k_push_dummy_call); set_gdbarch_dummy_id (gdbarch, m88k_dummy_id); /* Return value info. */ set_gdbarch_return_value (gdbarch, m88k_return_value); set_gdbarch_addr_bits_remove (gdbarch, m88k_addr_bits_remove); set_gdbarch_breakpoint_from_pc (gdbarch, m88k_breakpoint_from_pc); set_gdbarch_unwind_pc (gdbarch, m88k_unwind_pc); set_gdbarch_write_pc (gdbarch, m88k_write_pc); frame_base_set_default (gdbarch, &m88k_frame_base); frame_unwind_append_unwinder (gdbarch, &m88k_frame_unwind); return gdbarch; }
static struct gdbarch * moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; /* If there is already a candidate, use it. */ arches = gdbarch_list_lookup_by_info (arches, &info); if (arches != NULL) return arches->gdbarch; /* Allocate space for the new architecture. */ tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); set_gdbarch_read_pc (gdbarch, moxie_read_pc); set_gdbarch_write_pc (gdbarch, moxie_write_pc); set_gdbarch_unwind_sp (gdbarch, moxie_unwind_sp); set_gdbarch_num_regs (gdbarch, MOXIE_NUM_REGS); set_gdbarch_sp_regnum (gdbarch, MOXIE_SP_REGNUM); set_gdbarch_register_name (gdbarch, moxie_register_name); set_gdbarch_register_type (gdbarch, moxie_register_type); set_gdbarch_return_value (gdbarch, moxie_return_value); set_gdbarch_skip_prologue (gdbarch, moxie_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_breakpoint_from_pc (gdbarch, moxie_breakpoint_from_pc); set_gdbarch_frame_align (gdbarch, moxie_frame_align); frame_base_set_default (gdbarch, &moxie_frame_base); /* Methods for saving / extracting a dummy frame's ID. The ID's stack address must match the SP value returned by PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */ set_gdbarch_dummy_id (gdbarch, moxie_dummy_id); set_gdbarch_unwind_pc (gdbarch, moxie_unwind_pc); set_gdbarch_print_insn (gdbarch, print_insn_moxie); /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); /* Hook in the default unwinders. */ frame_unwind_append_unwinder (gdbarch, &moxie_frame_unwind); /* Support simple overlay manager. */ set_gdbarch_overlay_update (gdbarch, simple_overlay_update); return gdbarch; }
static void ppcfbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* Generic FreeBSD support. */ fbsd_init_abi (info, gdbarch); /* FreeBSD doesn't support the 128-bit `long double' from the psABI. */ set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double); if (tdep->wordsize == 4) { set_gdbarch_return_value (gdbarch, ppcfbsd_return_value); set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); frame_unwind_append_unwinder (gdbarch, &ppcfbsd_sigtramp_frame_unwind); set_gdbarch_gcore_bfd_target (gdbarch, "elf32-powerpc"); } if (tdep->wordsize == 8) { set_gdbarch_convert_from_func_ptr_addr (gdbarch, ppc64_convert_from_func_ptr_addr); set_gdbarch_elf_make_msymbol_special (gdbarch, ppc64_elf_make_msymbol_special); set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_lp64_fetch_link_map_offsets); set_gdbarch_gcore_bfd_target (gdbarch, "elf64-powerpc"); } set_gdbarch_iterate_over_regset_sections (gdbarch, ppcfbsd_iterate_over_regset_sections); set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); set_gdbarch_get_thread_local_address (gdbarch, ppcfbsd_get_thread_local_address); }
static void ppcnbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { /* For NetBSD, this is an on again, off again thing. Some systems do use the broken struct convention, and some don't. */ set_gdbarch_return_value (gdbarch, ppcnbsd_return_value); /* NetBSD uses SVR4-style shared libraries. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); set_gdbarch_iterate_over_regset_sections (gdbarch, ppcnbsd_iterate_over_regset_sections); tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd_sigtramp); tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd2_sigtramp); }
static void ppcobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { /* OpenBSD doesn't support the 128-bit `long double' from the psABI. */ set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double); /* OpenBSD currently uses a broken GCC. */ set_gdbarch_return_value (gdbarch, ppc_sysv_abi_broken_return_value); /* OpenBSD uses SVR4-style shared libraries. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); set_gdbarch_iterate_over_regset_sections (gdbarch, ppcobsd_iterate_over_regset_sections); frame_unwind_append_unwinder (gdbarch, &ppcobsd_sigtramp_frame_unwind); }
static void amd64_windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* The dwarf2 unwinder (appended very early by i386_gdbarch_init) is preferred over the SEH one. The reasons are: - binaries without SEH but with dwarf2 debug info are correcly handled (although they aren't ABI compliant, gcc before 4.7 didn't emit SEH info). - dwarf3 DW_OP_call_frame_cfa is correctly handled (it can only be handled if the dwarf2 unwinder is used). The call to amd64_init_abi appends default unwinders, that aren't compatible with the SEH one. */ frame_unwind_append_unwinder (gdbarch, &amd64_windows_frame_unwind); amd64_init_abi (info, gdbarch); windows_init_abi (info, gdbarch); /* On Windows, "long"s are only 32bit. */ set_gdbarch_long_bit (gdbarch, 32); /* Function calls. */ set_gdbarch_push_dummy_call (gdbarch, amd64_windows_push_dummy_call); set_gdbarch_return_value (gdbarch, amd64_windows_return_value); set_gdbarch_skip_main_prologue (gdbarch, amd64_skip_main_prologue); set_gdbarch_skip_trampoline_code (gdbarch, amd64_windows_skip_trampoline_code); set_gdbarch_skip_prologue (gdbarch, amd64_windows_skip_prologue); set_gdbarch_auto_wide_charset (gdbarch, amd64_windows_auto_wide_charset); }
static struct gdbarch * sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch_tdep *tdep; struct gdbarch *gdbarch; /* If there is already a candidate, use it. */ arches = gdbarch_list_lookup_by_info (arches, &info); if (arches != NULL) return arches->gdbarch; /* Allocate space for the new architecture. */ tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); tdep->pc_regnum = SPARC32_PC_REGNUM; tdep->npc_regnum = SPARC32_NPC_REGNUM; tdep->gregset = NULL; tdep->sizeof_gregset = 0; tdep->fpregset = NULL; tdep->sizeof_fpregset = 0; tdep->plt_entry_size = 0; tdep->step_trap = sparc_step_trap; set_gdbarch_long_double_bit (gdbarch, 128); set_gdbarch_long_double_format (gdbarch, &floatformat_sparc_quad); set_gdbarch_num_regs (gdbarch, SPARC32_NUM_REGS); set_gdbarch_register_name (gdbarch, sparc32_register_name); set_gdbarch_register_type (gdbarch, sparc32_register_type); set_gdbarch_num_pseudo_regs (gdbarch, SPARC32_NUM_PSEUDO_REGS); set_gdbarch_pseudo_register_read (gdbarch, sparc32_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, sparc32_pseudo_register_write); /* Register numbers of various important registers. */ set_gdbarch_sp_regnum (gdbarch, SPARC_SP_REGNUM); /* %sp */ set_gdbarch_pc_regnum (gdbarch, SPARC32_PC_REGNUM); /* %pc */ set_gdbarch_fp0_regnum (gdbarch, SPARC_F0_REGNUM); /* %f0 */ /* Call dummy code. */ set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_push_dummy_code (gdbarch, sparc32_push_dummy_code); set_gdbarch_push_dummy_call (gdbarch, sparc32_push_dummy_call); set_gdbarch_return_value (gdbarch, sparc32_return_value); set_gdbarch_stabs_argument_has_addr (gdbarch, sparc32_stabs_argument_has_addr); set_gdbarch_skip_prologue (gdbarch, sparc32_skip_prologue); /* Stack grows downward. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_breakpoint_from_pc (gdbarch, sparc_breakpoint_from_pc); set_gdbarch_frame_args_skip (gdbarch, 8); set_gdbarch_print_insn (gdbarch, print_insn_sparc); set_gdbarch_software_single_step (gdbarch, sparc_software_single_step); set_gdbarch_write_pc (gdbarch, sparc_write_pc); set_gdbarch_unwind_dummy_id (gdbarch, sparc_unwind_dummy_id); set_gdbarch_unwind_pc (gdbarch, sparc_unwind_pc); frame_base_set_default (gdbarch, &sparc32_frame_base); /* Hook in the DWARF CFI frame unwinder. */ dwarf2_frame_set_init_reg (gdbarch, sparc32_dwarf2_frame_init_reg); /* FIXME: kettenis/20050423: Don't enable the unwinder until the StackGhost issues have been resolved. */ /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); frame_unwind_append_sniffer (gdbarch, sparc32_frame_sniffer); /* If we have register sets, enable the generic core file support. */ if (tdep->gregset) set_gdbarch_regset_from_core_section (gdbarch, sparc_regset_from_core_section); return gdbarch; }
static struct gdbarch * lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; /* If there is already a candidate, use it. */ arches = gdbarch_list_lookup_by_info (arches, &info); if (arches != NULL) return arches->gdbarch; /* None found, create a new architecture from the information provided. */ tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); /* Type sizes. */ set_gdbarch_short_bit (gdbarch, 16); set_gdbarch_int_bit (gdbarch, 32); set_gdbarch_long_bit (gdbarch, 32); set_gdbarch_long_long_bit (gdbarch, 64); set_gdbarch_float_bit (gdbarch, 32); set_gdbarch_double_bit (gdbarch, 64); set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_ptr_bit (gdbarch, 32); /* Register info. */ set_gdbarch_num_regs (gdbarch, SIM_LM32_NUM_REGS); set_gdbarch_sp_regnum (gdbarch, SIM_LM32_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, SIM_LM32_PC_REGNUM); set_gdbarch_register_name (gdbarch, lm32_register_name); set_gdbarch_register_type (gdbarch, lm32_register_type); set_gdbarch_cannot_store_register (gdbarch, lm32_cannot_store_register); /* Frame info. */ set_gdbarch_skip_prologue (gdbarch, lm32_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_frame_args_skip (gdbarch, 0); /* Frame unwinding. */ set_gdbarch_frame_align (gdbarch, lm32_frame_align); frame_base_set_default (gdbarch, &lm32_frame_base); set_gdbarch_unwind_pc (gdbarch, lm32_unwind_pc); set_gdbarch_unwind_sp (gdbarch, lm32_unwind_sp); set_gdbarch_dummy_id (gdbarch, lm32_dummy_id); frame_unwind_append_unwinder (gdbarch, &lm32_frame_unwind); /* Breakpoints. */ set_gdbarch_breakpoint_from_pc (gdbarch, lm32_breakpoint_from_pc); set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1); /* Calling functions in the inferior. */ set_gdbarch_push_dummy_call (gdbarch, lm32_push_dummy_call); set_gdbarch_return_value (gdbarch, lm32_return_value); /* Instruction disassembler. */ set_gdbarch_print_insn (gdbarch, print_insn_lm32); lm32_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, lm32_register_reggroup_p); return gdbarch; }
static struct gdbarch * tilegx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; int arch_size = 64; /* Handle arch_size == 32 or 64. Default to 64. */ if (info.abfd) arch_size = bfd_get_arch_size (info.abfd); /* Try to find a pre-existing architecture. */ for (arches = gdbarch_list_lookup_by_info (arches, &info); arches != NULL; arches = gdbarch_list_lookup_by_info (arches->next, &info)) { /* We only have two flavors -- just make sure arch_size matches. */ if (gdbarch_ptr_bit (arches->gdbarch) == arch_size) return (arches->gdbarch); } gdbarch = gdbarch_alloc (&info, NULL); /* Basic register fields and methods, datatype sizes and stuff. */ /* There are 64 physical registers which can be referenced by instructions (although only 56 of them can actually be debugged) and 1 magic register (the PC). The other three magic registers (ex1, syscall, orig_r0) which are known to "ptrace" are ignored by "gdb". Note that we simply pretend that there are 65 registers, and no "pseudo registers". */ set_gdbarch_num_regs (gdbarch, TILEGX_NUM_REGS); set_gdbarch_num_pseudo_regs (gdbarch, 0); set_gdbarch_sp_regnum (gdbarch, TILEGX_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, TILEGX_PC_REGNUM); set_gdbarch_register_name (gdbarch, tilegx_register_name); set_gdbarch_register_type (gdbarch, tilegx_register_type); set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_bit (gdbarch, arch_size); set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_ptr_bit (gdbarch, arch_size); set_gdbarch_addr_bit (gdbarch, arch_size); set_gdbarch_cannot_fetch_register (gdbarch, tilegx_cannot_reference_register); set_gdbarch_cannot_store_register (gdbarch, tilegx_cannot_reference_register); /* Stack grows down. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Frame Info. */ set_gdbarch_unwind_sp (gdbarch, tilegx_unwind_sp); set_gdbarch_unwind_pc (gdbarch, tilegx_unwind_pc); set_gdbarch_dummy_id (gdbarch, tilegx_unwind_dummy_id); set_gdbarch_frame_align (gdbarch, tilegx_frame_align); frame_base_set_default (gdbarch, &tilegx_frame_base); set_gdbarch_skip_prologue (gdbarch, tilegx_skip_prologue); set_gdbarch_stack_frame_destroyed_p (gdbarch, tilegx_stack_frame_destroyed_p); /* Map debug registers into internal register numbers. */ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, tilegx_dwarf2_reg_to_regnum); /* These values and methods are used when gdb calls a target function. */ set_gdbarch_push_dummy_call (gdbarch, tilegx_push_dummy_call); set_gdbarch_get_longjmp_target (gdbarch, tilegx_get_longjmp_target); set_gdbarch_write_pc (gdbarch, tilegx_write_pc); set_gdbarch_breakpoint_from_pc (gdbarch, tilegx_breakpoint_from_pc); set_gdbarch_return_value (gdbarch, tilegx_return_value); set_gdbarch_print_insn (gdbarch, print_insn_tilegx); gdbarch_init_osabi (info, gdbarch); dwarf2_append_unwinders (gdbarch); frame_unwind_append_unwinder (gdbarch, &tilegx_frame_unwind); return gdbarch; }
void amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* AMD64 generally uses `fxsave' instead of `fsave' for saving its floating-point registers. */ tdep->sizeof_fpregset = I387_SIZEOF_FXSAVE; /* AMD64 has an FPU and 16 SSE registers. */ tdep->st0_regnum = AMD64_ST0_REGNUM; tdep->num_xmm_regs = 16; /* This is what all the fuss is about. */ set_gdbarch_long_bit (gdbarch, 64); set_gdbarch_long_long_bit (gdbarch, 64); set_gdbarch_ptr_bit (gdbarch, 64); /* In contrast to the i386, on AMD64 a `long double' actually takes up 128 bits, even though it's still based on the i387 extended floating-point format which has only 80 significant bits. */ set_gdbarch_long_double_bit (gdbarch, 128); set_gdbarch_num_regs (gdbarch, AMD64_NUM_REGS); set_gdbarch_register_name (gdbarch, amd64_register_name); set_gdbarch_register_type (gdbarch, amd64_register_type); /* Register numbers of various important registers. */ set_gdbarch_sp_regnum (gdbarch, AMD64_RSP_REGNUM); /* %rsp */ set_gdbarch_pc_regnum (gdbarch, AMD64_RIP_REGNUM); /* %rip */ set_gdbarch_ps_regnum (gdbarch, AMD64_EFLAGS_REGNUM); /* %eflags */ set_gdbarch_fp0_regnum (gdbarch, AMD64_ST0_REGNUM); /* %st(0) */ /* APPLE LOCAL: Add the frame pointer register so it can be modified in expressions. */ set_gdbarch_deprecated_fp_regnum (gdbarch, AMD64_RBP_REGNUM); /* %rbp */ /* The "default" register numbering scheme for AMD64 is referred to as the "DWARF Register Number Mapping" in the System V psABI. The preferred debugging format for all known AMD64 targets is actually DWARF2, and GCC doesn't seem to support DWARF (that is DWARF-1), but we provide the same mapping just in case. This mapping is also used for stabs, which GCC does support. */ set_gdbarch_stab_reg_to_regnum (gdbarch, amd64_dwarf_reg_to_regnum); set_gdbarch_dwarf_reg_to_regnum (gdbarch, amd64_dwarf_reg_to_regnum); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, amd64_dwarf_reg_to_regnum); /* We don't override SDB_REG_RO_REGNUM, since COFF doesn't seem to be in use on any of the supported AMD64 targets. */ /* Call dummy code. */ set_gdbarch_push_dummy_call (gdbarch, amd64_push_dummy_call); set_gdbarch_frame_align (gdbarch, amd64_frame_align); set_gdbarch_frame_red_zone_size (gdbarch, 128); set_gdbarch_convert_register_p (gdbarch, amd64_convert_register_p); set_gdbarch_register_to_value (gdbarch, i387_register_to_value); set_gdbarch_value_to_register (gdbarch, i387_value_to_register); set_gdbarch_return_value (gdbarch, amd64_return_value); set_gdbarch_skip_prologue (gdbarch, amd64_skip_prologue); /* Avoid wiring in the MMX registers for now. */ set_gdbarch_num_pseudo_regs (gdbarch, 0); tdep->mm0_regnum = -1; set_gdbarch_unwind_dummy_id (gdbarch, amd64_unwind_dummy_id); frame_unwind_append_sniffer (gdbarch, amd64_sigtramp_frame_sniffer); frame_unwind_append_sniffer (gdbarch, amd64_frame_sniffer); frame_base_set_default (gdbarch, &amd64_frame_base); /* If we have a register mapping, enable the generic core file support. */ if (tdep->gregset_reg_offset) set_gdbarch_regset_from_core_section (gdbarch, amd64_regset_from_core_section); /* APPLE LOCAL: A handy little function. */ set_gdbarch_fetch_pointer_argument (gdbarch, amd64_fetch_pointer_argument); }
static struct gdbarch * ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; struct type *void_type; struct type *func_void_type; /* If there is already a candidate, use it. */ arches = gdbarch_list_lookup_by_info (arches, &info); if (arches != NULL) return arches->gdbarch; /* Allocate space for the new architecture. */ tdep = XNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); /* Create a type for PC. We can't use builtin types here, as they may not be defined. */ void_type = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void"); func_void_type = make_function_type (void_type, NULL); tdep->pc_type = arch_type (gdbarch, TYPE_CODE_PTR, 4, NULL); TYPE_TARGET_TYPE (tdep->pc_type) = func_void_type; TYPE_UNSIGNED (tdep->pc_type) = 1; TYPE_INSTANCE_FLAGS (tdep->pc_type) |= TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1; set_gdbarch_read_pc (gdbarch, ft32_read_pc); set_gdbarch_write_pc (gdbarch, ft32_write_pc); set_gdbarch_unwind_sp (gdbarch, ft32_unwind_sp); set_gdbarch_num_regs (gdbarch, FT32_NUM_REGS); set_gdbarch_sp_regnum (gdbarch, FT32_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, FT32_PC_REGNUM); set_gdbarch_register_name (gdbarch, ft32_register_name); set_gdbarch_register_type (gdbarch, ft32_register_type); set_gdbarch_return_value (gdbarch, ft32_return_value); set_gdbarch_pointer_to_address (gdbarch, ft32_pointer_to_address); set_gdbarch_skip_prologue (gdbarch, ft32_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_breakpoint_from_pc (gdbarch, ft32_breakpoint_from_pc); set_gdbarch_frame_align (gdbarch, ft32_frame_align); frame_base_set_default (gdbarch, &ft32_frame_base); /* Methods for saving / extracting a dummy frame's ID. The ID's stack address must match the SP value returned by PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */ set_gdbarch_dummy_id (gdbarch, ft32_dummy_id); set_gdbarch_unwind_pc (gdbarch, ft32_unwind_pc); set_gdbarch_print_insn (gdbarch, print_insn_ft32); /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); /* Hook in the default unwinders. */ frame_unwind_append_unwinder (gdbarch, &ft32_frame_unwind); /* Support simple overlay manager. */ set_gdbarch_overlay_update (gdbarch, simple_overlay_update); set_gdbarch_address_class_type_flags (gdbarch, ft32_address_class_type_flags); set_gdbarch_address_class_name_to_type_flags (gdbarch, ft32_address_class_name_to_type_flags); set_gdbarch_address_class_type_flags_to_name (gdbarch, ft32_address_class_type_flags_to_name); return gdbarch; }
static void ppc_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* NOTE: jimb/2004-03-26: The System V ABI PowerPC Processor Supplement says that long doubles are sixteen bytes long. However, as one of the known warts of its ABI, PPC GNU/Linux uses eight-byte long doubles. GCC only recently got 128-bit long double support on PPC, so it may be changing soon. The Linux[sic] Standards Base says that programs that use 'long double' on PPC GNU/Linux are non-conformant. */ /* NOTE: cagney/2005-01-25: True for both 32- and 64-bit. */ set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); /* Handle PPC GNU/Linux 64-bit function pointers (which are really function descriptors) and 32-bit secure PLT entries. */ set_gdbarch_convert_from_func_ptr_addr (gdbarch, ppc_linux_convert_from_func_ptr_addr); if (tdep->wordsize == 4) { /* Until November 2001, gcc did not comply with the 32 bit SysV R4 ABI requirement that structures less than or equal to 8 bytes should be returned in registers. Instead GCC was using the the AIX/PowerOpen ABI - everything returned in memory (well ignoring vectors that is). When this was corrected, it wasn't fixed for GNU/Linux native platform. Use the PowerOpen struct convention. */ set_gdbarch_return_value (gdbarch, ppc_linux_return_value); set_gdbarch_memory_remove_breakpoint (gdbarch, ppc_linux_memory_remove_breakpoint); /* Shared library handling. */ set_gdbarch_skip_trampoline_code (gdbarch, ppc_linux_skip_trampoline_code); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); /* Trampolines. */ tramp_frame_prepend_unwinder (gdbarch, &ppc32_linux_sigaction_tramp_frame); tramp_frame_prepend_unwinder (gdbarch, &ppc32_linux_sighandler_tramp_frame); } if (tdep->wordsize == 8) { /* Shared library handling. */ set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_lp64_fetch_link_map_offsets); /* Trampolines. */ tramp_frame_prepend_unwinder (gdbarch, &ppc64_linux_sigaction_tramp_frame); tramp_frame_prepend_unwinder (gdbarch, &ppc64_linux_sighandler_tramp_frame); } set_gdbarch_regset_from_core_section (gdbarch, ppc_linux_regset_from_core_section); /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); }