static void i386_darwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* We support the SSE registers. */ tdep->num_xmm_regs = I386_NUM_XREGS - 1; set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS); dwarf2_frame_set_signal_frame_p (gdbarch, darwin_dwarf_signal_frame_p); set_gdbarch_push_dummy_call (gdbarch, i386_darwin_push_dummy_call); tdep->struct_return = reg_struct_return; tdep->sigtramp_p = i386_sigtramp_p; tdep->sigcontext_addr = i386_darwin_sigcontext_addr; tdep->sc_reg_offset = i386_darwin_thread_state_reg_offset; tdep->sc_num_regs = i386_darwin_thread_state_num_regs; tdep->jb_pc_offset = 48; /* Although the i387 extended floating-point has only 80 significant bits, a `long double' actually takes up 128, probably to enforce alignment. */ set_gdbarch_long_double_bit (gdbarch, 128); set_solib_ops (gdbarch, &darwin_so_ops); }
static void arm_wince_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = new_gdbarch_tdep(gdbarch); tdep->arm_breakpoint = arm_wince_le_breakpoint; tdep->arm_breakpoint_size = sizeof (arm_wince_le_breakpoint); tdep->thumb_breakpoint = arm_wince_thumb_le_breakpoint; tdep->thumb_breakpoint_size = sizeof (arm_wince_thumb_le_breakpoint); tdep->struct_return = pcc_struct_return; tdep->fp_model = ARM_FLOAT_SOFT_VFP; tdep->jb_pc = ARM_WINCE_JB_PC; tdep->jb_elt_size = ARM_WINCE_JB_ELEMENT_SIZE; /* On ARM WinCE char defaults to signed. */ set_gdbarch_char_signed (gdbarch, 1); /* Shared library handling. */ set_solib_ops (gdbarch, &solib_target_so_ops); set_gdbarch_skip_trampoline_code (gdbarch, arm_pe_skip_trampoline_code); /* Single stepping. */ set_gdbarch_software_single_step (gdbarch, arm_software_single_step); /* Skip call to __gccmain that gcc places in main. */ set_gdbarch_skip_main_prologue (gdbarch, arm_wince_skip_main_prologue); }
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 i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); set_gdbarch_skip_trampoline_code (gdbarch, i386_cygwin_skip_trampoline_code); set_gdbarch_skip_main_prologue (gdbarch, i386_skip_main_prologue); tdep->struct_return = reg_struct_return; tdep->gregset_reg_offset = i386_windows_gregset_reg_offset; tdep->gregset_num_regs = ARRAY_SIZE (i386_windows_gregset_reg_offset); tdep->sizeof_gregset = I386_WINDOWS_SIZEOF_GREGSET; set_solib_ops (gdbarch, &solib_target_so_ops); /* Core file support. */ set_gdbarch_regset_from_core_section (gdbarch, i386_windows_regset_from_core_section); set_gdbarch_core_xfer_shared_libraries (gdbarch, windows_core_xfer_shared_libraries); set_gdbarch_core_pid_to_str (gdbarch, i386_windows_core_pid_to_str); set_gdbarch_auto_wide_charset (gdbarch, i386_cygwin_auto_wide_charset); /* Canonical paths on this target look like `c:\Program Files\Foo App\mydll.dll', for example. */ set_gdbarch_has_dos_based_file_system (gdbarch, 1); set_gdbarch_iterate_over_objfiles_in_search_order (gdbarch, windows_iterate_over_objfiles_in_search_order); }
static void mips_irix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { set_solib_ops (gdbarch, &irix_so_ops); tramp_frame_prepend_unwinder (gdbarch, &mips_irix_n32_tramp_frame); }
static void i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); static struct target_so_ops nto_svr4_so_ops; /* Deal with our strange signals. */ nto_initialize_signals (); /* NTO uses ELF. */ i386_elf_init_abi (info, gdbarch); /* Neutrino rewinds to look more normal. Need to override the i386 default which is [unfortunately] to decrement the PC. */ set_gdbarch_decr_pc_after_break (gdbarch, 0); tdep->gregset_reg_offset = i386nto_gregset_reg_offset; tdep->gregset_num_regs = ARRAY_SIZE (i386nto_gregset_reg_offset); tdep->sizeof_gregset = NUM_GPREGS * 4; tdep->sigtramp_p = i386nto_sigtramp_p; tdep->sigcontext_addr = i386nto_sigcontext_addr; tdep->sc_pc_offset = 56; tdep->sc_sp_offset = 68; /* Setjmp()'s return PC saved in EDX (5). */ tdep->jb_pc_offset = 20; /* 5x32 bit ints in. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); /* Initialize this lazily, to avoid an initialization order dependency on solib-svr4.c's _initialize routine. */ if (nto_svr4_so_ops.in_dynsym_resolve_code == NULL) { nto_svr4_so_ops = svr4_so_ops; /* Our loader handles solib relocations differently than svr4. */ nto_svr4_so_ops.relocate_section_addresses = nto_relocate_section_addresses; /* Supply a nice function to find our solibs. */ nto_svr4_so_ops.find_and_open_solib = nto_find_and_open_solib; /* Our linker code is in libc. */ nto_svr4_so_ops.in_dynsym_resolve_code = nto_in_dynsym_resolve_code; } set_solib_ops (gdbarch, &nto_svr4_so_ops); nto_set_target (&i386_nto_target); }
static void amd64fbsd_kernel_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) { amd64_init_abi(info, gdbarch); frame_unwind_prepend_unwinder(gdbarch, &amd64fbsd_trapframe_unwind); set_solib_ops(gdbarch, &kld_so_ops); fbsd_vmcore_set_supply_pcb(gdbarch, amd64fbsd_supply_pcb); fbsd_vmcore_set_cpu_pcb_addr(gdbarch, kgdb_trgt_stop_pcb); }
static void x86_darwin_init_abi_64 (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); amd64_init_abi (info, gdbarch); tdep->struct_return = reg_struct_return; dwarf2_frame_set_signal_frame_p (gdbarch, darwin_dwarf_signal_frame_p); tdep->sigtramp_p = i386_sigtramp_p; tdep->sigcontext_addr = amd64_darwin_sigcontext_addr; tdep->sc_reg_offset = amd64_darwin_thread_state_reg_offset; tdep->sc_num_regs = amd64_darwin_thread_state_num_regs; tdep->jb_pc_offset = 148; set_solib_ops (gdbarch, &darwin_so_ops); }
/* Install SPE "shared library" handling. This is called by -tdep code that wants to support SPU as a secondary architecture. */ void set_spu_solib_ops (struct gdbarch *gdbarch) { static struct target_so_ops spu_so_ops; /* Initialize this lazily, to avoid an initialization order dependency on solib-svr4.c's _initialize routine. */ if (spu_so_ops.current_sos == NULL) { spu_so_ops = svr4_so_ops; spu_so_ops.solib_create_inferior_hook = spu_solib_create_inferior_hook; spu_so_ops.relocate_section_addresses = spu_relocate_section_addresses; spu_so_ops.free_so = spu_free_so; spu_so_ops.current_sos = spu_current_sos; spu_so_ops.bfd_open = spu_bfd_open; spu_so_ops.lookup_lib_global_symbol = spu_lookup_lib_symbol; } set_solib_ops (gdbarch, &spu_so_ops); }
static void tic6x_uclinux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); linux_init_abi (info, gdbarch); /* Shared library handling. */ set_solib_ops (gdbarch, &dsbt_so_ops); tdep->syscall_next_pc = tic6x_linux_syscall_next_pc; #ifdef HAVE_ELF /* In tic6x Linux kernel, breakpoint instructions varies on different archs. On C64x+ and C67x+, breakpoint instruction is 0x56454314, which is an illegal opcode. On other arch, breakpoint instruction is 0x0000a122 (BNOP .S2 0,5). */ if (info.abfd) switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC, Tag_ISA)) { case C6XABI_Tag_ISA_C64XP: case C6XABI_Tag_ISA_C67XP: if (info.byte_order == BFD_ENDIAN_BIG) tdep->breakpoint = tic6x_bkpt_illegal_opcode_be; else tdep->breakpoint = tic6x_bkpt_illegal_opcode_le; break; default: { if (info.byte_order == BFD_ENDIAN_BIG) tdep->breakpoint = tic6x_bkpt_bnop_be; else tdep->breakpoint = tic6x_bkpt_bnop_le; } } #endif /* Signal trampoline support. */ tramp_frame_prepend_unwinder (gdbarch, &tic6x_linux_rt_sigreturn_tramp_frame); }
static void i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); set_gdbarch_skip_trampoline_code (gdbarch, i386_cygwin_skip_trampoline_code); set_gdbarch_skip_main_prologue (gdbarch, i386_skip_main_prologue); tdep->struct_return = reg_struct_return; tdep->gregset_reg_offset = i386_windows_gregset_reg_offset; tdep->gregset_num_regs = ARRAY_SIZE (i386_windows_gregset_reg_offset); tdep->sizeof_gregset = I386_WINDOWS_SIZEOF_GREGSET; set_solib_ops (gdbarch, &solib_target_so_ops); /* Core file support. */ set_gdbarch_regset_from_core_section (gdbarch, i386_windows_regset_from_core_section); set_gdbarch_core_xfer_shared_libraries (gdbarch, windows_core_xfer_shared_libraries); }
void dicos_init_abi (struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); set_solib_ops (gdbarch, &solib_target_so_ops); /* Every process, although has its own address space, sees the same list of shared libraries. There's no "main executable" in DICOS, so this accounts for all code. */ set_gdbarch_has_global_solist (gdbarch, 1); /* The DICOS breakpoint API takes care of magically making breakpoints visible to all inferiors. */ set_gdbarch_has_global_breakpoints (gdbarch, 1); /* There's no (standard definition of) entry point or a guaranteed text location with a symbol where to place the call dummy, so we need it on the stack. Rely on i386_gdbarch_init used also for amd64 to set up ON_STACK inferior calls. */ /* DICOS rewinds the PC itself. */ set_gdbarch_decr_pc_after_break (gdbarch, 0); }
static void arm_symbian_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* Shared library handling. */ set_gdbarch_skip_trampoline_code (gdbarch, arm_symbian_skip_trampoline_code); /* On this target, the toolchain outputs ELF files, with `sym' for filename extension (e.g., `FOO.sym'); these are post-linker processed into PE-ish DLLs (e.g., `FOO.dll'), and it's these that are actually copied to and run on the target. Naturally, when listing shared libraries, Symbian stubs report the DLL filenames. Setting this makes it so that GDB automatically looks for the corresponding ELF files on the host's filesystem. */ set_gdbarch_solib_symbols_extension (gdbarch, "sym"); /* Canonical paths on this target look like `c:\sys\bin\bar.dll', for example. */ set_gdbarch_has_dos_based_file_system (gdbarch, 1); set_solib_ops (gdbarch, &solib_target_so_ops); }
static void mips_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum mips_abi abi = mips_abi (gdbarch); struct tdesc_arch_data *tdesc_data = (void *) info.tdep_info; linux_init_abi (info, gdbarch); switch (abi) { case MIPS_ABI_O32: set_gdbarch_get_longjmp_target (gdbarch, mips_linux_get_longjmp_target); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_o32_sigframe); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_o32_rt_sigframe); break; case MIPS_ABI_N32: set_gdbarch_get_longjmp_target (gdbarch, mips_linux_get_longjmp_target); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); set_gdbarch_long_double_bit (gdbarch, 128); /* These floatformats should probably be renamed. MIPS uses the same 128-bit IEEE floating point format that IA-64 uses, except that the quiet/signalling NaN bit is reversed (GDB does not distinguish between quiet and signalling NaNs). */ set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_n32_rt_sigframe); break; case MIPS_ABI_N64: set_gdbarch_get_longjmp_target (gdbarch, mips64_linux_get_longjmp_target); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_lp64_fetch_link_map_offsets); set_gdbarch_long_double_bit (gdbarch, 128); /* These floatformats should probably be renamed. MIPS uses the same 128-bit IEEE floating point format that IA-64 uses, except that the quiet/signalling NaN bit is reversed (GDB does not distinguish between quiet and signalling NaNs). */ set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_n64_rt_sigframe); break; default: break; } set_gdbarch_skip_solib_resolver (gdbarch, mips_linux_skip_resolver); set_gdbarch_software_single_step (gdbarch, mips_software_single_step); /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); /* Initialize this lazily, to avoid an initialization order dependency on solib-svr4.c's _initialize routine. */ if (mips_svr4_so_ops.in_dynsym_resolve_code == NULL) { mips_svr4_so_ops = svr4_so_ops; mips_svr4_so_ops.in_dynsym_resolve_code = mips_linux_in_dynsym_resolve_code; } set_solib_ops (gdbarch, &mips_svr4_so_ops); set_gdbarch_write_pc (gdbarch, mips_linux_write_pc); set_gdbarch_core_read_description (gdbarch, mips_linux_core_read_description); set_gdbarch_regset_from_core_section (gdbarch, mips_linux_regset_from_core_section); tdep->syscall_next_pc = mips_linux_syscall_next_pc; if (tdesc_data) { const struct tdesc_feature *feature; /* If we have target-described registers, then we can safely reserve a number for MIPS_RESTART_REGNUM (whether it is described or not). */ gdb_assert (gdbarch_num_regs (gdbarch) <= MIPS_RESTART_REGNUM); set_gdbarch_num_regs (gdbarch, MIPS_RESTART_REGNUM + 1); set_gdbarch_num_pseudo_regs (gdbarch, MIPS_RESTART_REGNUM + 1); /* If it's present, then assign it to the reserved number. */ feature = tdesc_find_feature (info.target_desc, "org.gnu.gdb.mips.linux"); if (feature != NULL) tdesc_numbered_register (feature, tdesc_data, MIPS_RESTART_REGNUM, "restart"); } }
static void mips_irix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { set_solib_ops (gdbarch, &irix_so_ops); }