1/* Native-dependent definitions for FreeBSD/i386. 2 3 Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1997, 2000, 2001, 2004 4 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#ifndef NM_FBSD_H 24#define NM_FBSD_H 25 26#ifdef HAVE_PT_GETDBREGS 27#define I386_USE_GENERIC_WATCHPOINTS 28#endif 29 30#include "i386/nm-i386.h" 31 32#ifdef HAVE_SYS_PARAM_H 33#include <sys/param.h> 34#endif 35 36/* Provide access to the i386 hardware debugging registers. */ 37 38#define I386_DR_LOW_SET_CONTROL(control) \ 39 i386bsd_dr_set_control (control) 40extern void i386bsd_dr_set_control (unsigned long control); 41 42#define I386_DR_LOW_SET_ADDR(regnum, addr) \ 43 i386bsd_dr_set_addr (regnum, addr) 44extern void i386bsd_dr_set_addr (int regnum, CORE_ADDR addr); 45 46#define I386_DR_LOW_RESET_ADDR(regnum) \ 47 i386bsd_dr_reset_addr (regnum) 48extern void i386bsd_dr_reset_addr (int regnum); 49 50#define I386_DR_LOW_GET_STATUS() \ 51 i386bsd_dr_get_status () 52extern unsigned long i386bsd_dr_get_status (void); 53 54 55/* Type of the third argument to the `ptrace' system call. */ 56#define PTRACE_ARG3_TYPE caddr_t 57 58/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ 59#define FETCH_INFERIOR_REGISTERS 60 61/* Override child_resume in `infptrace.c' to work around a kernel bug. */ 62#define CHILD_RESUME 63 64/* Override child_pid_to_exec_file in 'inftarg.c'. */ 65#define CHILD_PID_TO_EXEC_FILE 66 67/* We can attach and detach. */ 68#define ATTACH_DETACH 69 70 71/* Support for the user struct. */ 72 73/* Return the size of the user struct. */ 74 75#define KERNEL_U_SIZE kernel_u_size () 76extern int kernel_u_size (void); 77 78/* This is the amount to subtract from u.u_ar0 79 to get the offset in the core file of the register values. */ 80 81#include <machine/vmparam.h> 82#define KERNEL_U_ADDR USRSTACK 83 84#define REGISTER_U_ADDR(addr, blockend, regno) \ 85 (addr) = register_u_addr ((blockend), (regno)) 86extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno); 87 88 89/* Shared library support. */ 90 91#include "solib.h" 92 93/* Make structure definitions match up with those expected in 94 `solib-sunos.c'. */ 95 96#define link_object sod 97#define lo_name sod_name 98#define lo_library sod_library 99#define lo_unused sod_reserved 100#define lo_major sod_major 101#define lo_minor sod_minor 102#define lo_next sod_next 103 104#define link_map so_map 105#define lm_addr som_addr 106#define lm_name som_path 107#define lm_next som_next 108#define lm_lop som_sod 109#define lm_lob som_sodbase 110#define lm_rwt som_write 111#define lm_ld som_dynamic 112#define lm_lpd som_spd 113 114#define link_dynamic_2 section_dispatch_table 115#define ld_loaded sdt_loaded 116#define ld_need sdt_sods 117#define ld_rules sdt_filler1 118#define ld_got sdt_got 119#define ld_plt sdt_plt 120#define ld_rel sdt_rel 121#define ld_hash sdt_hash 122#define ld_stab sdt_nzlist 123#define ld_stab_hash sdt_filler2 124#define ld_buckets sdt_buckets 125#define ld_symbols sdt_strings 126#define ld_symb_size sdt_str_sz 127#define ld_text sdt_text_sz 128#define ld_plt_sz sdt_plt_sz 129 130#define rtc_symb rt_symbol 131#define rtc_sp rt_sp 132#define rtc_next rt_next 133 134#define ld_debug so_debug 135#define ldd_version dd_version 136#define ldd_in_debugger dd_in_debugger 137#define ldd_sym_loaded dd_sym_loaded 138#define ldd_bp_addr dd_bpt_addr 139#define ldd_bp_inst dd_bpt_shadow 140#define ldd_cp dd_cc 141 142#define link_dynamic _dynamic 143#define ld_version d_version 144#define ldd d_debug 145#define ld_un d_un 146#define ld_2 d_sdt 147 148#endif /* nm-fbsd.h */ 149