nm-fbsd.h revision 104990
1/* Native-dependent definitions for FreeBSD/i386. 2 Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1997, 2000, 2001 3 Free Software Foundation, Inc. 4 5 This file is part of GDB. 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, write to the Free Software 19 Foundation, Inc., 59 Temple Place - Suite 330, 20 Boston, MA 02111-1307, USA. */ 21 22#ifndef NM_FBSD_H 23#define NM_FBSD_H 24 25#ifdef HAVE_PT_GETDBREGS 26#define I386_USE_GENERIC_WATCHPOINTS 27#endif 28 29#include "i386/nm-i386.h" 30 31#ifdef HAVE_SYS_PARAM_H 32#include <sys/param.h> 33#endif 34 35/* Provide access to the i386 hardware debugging registers. */ 36 37#define I386_DR_LOW_SET_CONTROL(control) \ 38 i386bsd_dr_set_control (control) 39extern void i386bsd_dr_set_control (unsigned long control); 40 41#define I386_DR_LOW_SET_ADDR(regnum, addr) \ 42 i386bsd_dr_set_addr (regnum, addr) 43extern void i386bsd_dr_set_addr (int regnum, CORE_ADDR addr); 44 45#define I386_DR_LOW_RESET_ADDR(regnum) \ 46 i386bsd_dr_reset_addr (regnum) 47extern void i386bsd_dr_reset_addr (int regnum); 48 49#define I386_DR_LOW_GET_STATUS() \ 50 i386bsd_dr_get_status () 51extern unsigned long i386bsd_dr_get_status (void); 52 53 54/* Type of the third argument to the `ptrace' system call. */ 55#define PTRACE_ARG3_TYPE caddr_t 56 57/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ 58#define FETCH_INFERIOR_REGISTERS 59 60/* Override child_resume in `infptrace.c' to work around a kernel bug. */ 61#define CHILD_RESUME 62 63/* We can attach and detach. */ 64#define ATTACH_DETACH 65 66 67/* Support for the user struct. */ 68 69/* Return the size of the user struct. */ 70 71#define KERNEL_U_SIZE kernel_u_size () 72extern int kernel_u_size (void); 73 74/* This is the amount to subtract from u.u_ar0 75 to get the offset in the core file of the register values. */ 76 77#include <machine/vmparam.h> 78#define KERNEL_U_ADDR USRSTACK 79 80#define REGISTER_U_ADDR(addr, blockend, regno) \ 81 (addr) = register_u_addr ((blockend), (regno)) 82extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno); 83 84 85/* Shared library support. */ 86 87/* The FreeBSD <link.h> uses the same condition to distinguish ELF 88 from a.out. ELF implies SVR4 shared libraries. */ 89#if (defined (FREEBSD_ELF) || defined (__ELF__)) && !defined (FREEBSD_AOUT) 90#define SVR4_SHARED_LIBS 91#endif 92 93#include "solib.h" /* Support for shared libraries. */ 94#ifdef SVR4_SHARED_LIBS 95#include "elf/common.h" /* Additional ELF shared library info. */ 96#endif 97 98#ifndef SVR4_SHARED_LIBS 99 100/* Make structure definitions match up with those expected in `solib.c'. */ 101 102#define link_object sod 103#define lo_name sod_name 104#define lo_library sod_library 105#define lo_unused sod_reserved 106#define lo_major sod_major 107#define lo_minor sod_minor 108#define lo_next sod_next 109 110#define link_map so_map 111#define lm_addr som_addr 112#define lm_name som_path 113#define lm_next som_next 114#define lm_lop som_sod 115#define lm_lob som_sodbase 116#define lm_rwt som_write 117#define lm_ld som_dynamic 118#define lm_lpd som_spd 119 120#define link_dynamic_2 section_dispatch_table 121#define ld_loaded sdt_loaded 122#define ld_need sdt_sods 123#define ld_rules sdt_filler1 124#define ld_got sdt_got 125#define ld_plt sdt_plt 126#define ld_rel sdt_rel 127#define ld_hash sdt_hash 128#define ld_stab sdt_nzlist 129#define ld_stab_hash sdt_filler2 130#define ld_buckets sdt_buckets 131#define ld_symbols sdt_strings 132#define ld_symb_size sdt_str_sz 133#define ld_text sdt_text_sz 134#define ld_plt_sz sdt_plt_sz 135 136#define rtc_symb rt_symbol 137#define rtc_sp rt_sp 138#define rtc_next rt_next 139 140#define ld_debug so_debug 141#define ldd_version dd_version 142#define ldd_in_debugger dd_in_debugger 143#define ldd_sym_loaded dd_sym_loaded 144#define ldd_bp_addr dd_bpt_addr 145#define ldd_bp_inst dd_bpt_shadow 146#define ldd_cp dd_cc 147 148#define link_dynamic _dynamic 149#define ld_version d_version 150#define ldd d_debug 151#define ld_un d_un 152#define ld_2 d_sdt 153 154#endif /* !SVR4_SHARED_LIBS */ 155 156#endif /* NM_FBSD_H */ 157