void _initialize_i386obsd_nat (void) { /* Add some extra features to the common *BSD/i386 target. */ obsd_add_target (i386bsd_target ()); /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (i386obsd_supply_pcb); /* OpenBSD provides a vm.psstrings sysctl that we can use to locate the sigtramp. That way we can still recognize a sigtramp if its location is changed in a new kernel. This is especially important for OpenBSD, since it uses a different memory layout than NetBSD, yet we cannot distinguish between the two. Of course this is still based on the assumption that the sigtramp is placed directly under the location where the program arguments and environment can be found. */ #ifdef VM_PSSTRINGS { struct _ps_strings _ps; int mib[2]; size_t len; mib[0] = CTL_VM; mib[1] = VM_PSSTRINGS; len = sizeof (_ps); if (sysctl (mib, 2, &_ps, &len, NULL, 0) == 0) { i386obsd_sigtramp_start_addr = (u_long) _ps.val - 128; i386obsd_sigtramp_end_addr = (u_long) _ps.val; } } #endif }
void _initialize_mips64obsd_nat (void) { struct target_ops *t; t = inf_ptrace_target (); t->to_fetch_registers = mips64obsd_fetch_inferior_registers; t->to_store_registers = mips64obsd_store_inferior_registers; obsd_add_target (t); }
void _initialize_hppaobsd_nat (void) { struct target_ops *t; t = inf_ptrace_target (); t->to_fetch_registers = hppaobsd_fetch_registers; t->to_store_registers = hppaobsd_store_registers; obsd_add_target (t); }
void _initialize_sparc64obsd_nat (void) { sparc_supply_gregset = sparc64_supply_gregset; sparc_collect_gregset = sparc64_collect_gregset; sparc_supply_fpregset = sparc64_supply_fpregset; sparc_collect_fpregset = sparc64_collect_fpregset; sparc_gregset_supplies_p = sparc64obsd_gregset_supplies_p; sparc_fpregset_supplies_p = sparc64obsd_fpregset_supplies_p; sparc_gregmap = &sparc64nbsd_gregmap; sparc_fpregmap = &sparc64_bsd_fpregmap; /* Add some extra features to the generic SPARC target. */ obsd_add_target (sparc_target ()); /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (sparc64obsd_supply_pcb); }
void _initialize_ppcobsd_nat (void) { struct target_ops *t; /* Add in local overrides. */ t = inf_ptrace_target (); t->to_fetch_registers = ppcobsd_fetch_registers; t->to_store_registers = ppcobsd_store_registers; obsd_add_target (t); /* General-purpose registers. */ ppcobsd_reg_offsets.r0_offset = offsetof (struct reg, gpr); ppcobsd_reg_offsets.gpr_size = 4; ppcobsd_reg_offsets.xr_size = 4; ppcobsd_reg_offsets.pc_offset = offsetof (struct reg, pc); ppcobsd_reg_offsets.ps_offset = offsetof (struct reg, ps); ppcobsd_reg_offsets.cr_offset = offsetof (struct reg, cnd); ppcobsd_reg_offsets.lr_offset = offsetof (struct reg, lr); ppcobsd_reg_offsets.ctr_offset = offsetof (struct reg, cnt); ppcobsd_reg_offsets.xer_offset = offsetof (struct reg, xer); ppcobsd_reg_offsets.mq_offset = offsetof (struct reg, mq); /* Floating-point registers. */ ppcobsd_reg_offsets.f0_offset = offsetof (struct reg, fpr); ppcobsd_reg_offsets.fpscr_offset = -1; #ifdef PT_GETFPREGS ppcobsd_fpreg_offsets.f0_offset = offsetof (struct fpreg, fpr); ppcobsd_fpreg_offsets.fpscr_offset = offsetof (struct fpreg, fpscr); ppcobsd_fpreg_offsets.fpscr_size = 4; #endif /* AltiVec registers. */ ppcobsd_reg_offsets.vr0_offset = offsetof (struct vreg, vreg); ppcobsd_reg_offsets.vscr_offset = offsetof (struct vreg, vscr); ppcobsd_reg_offsets.vrsave_offset = offsetof (struct vreg, vrsave); /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (ppcobsd_supply_pcb); }