1 /* $DragonFly: src/gnu/usr.bin/gdb/gdb/Attic/nm-fbsd.h,v 1.1 2004/10/23 17:02:38 joerg Exp $ */
2 /* Native-dependent definitions for FreeBSD/i386.
4 Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1997, 2000, 2001, 2004
5 Free Software Foundation, Inc.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
27 #ifdef HAVE_PT_GETDBREGS
28 #define I386_USE_GENERIC_WATCHPOINTS
31 #include "i386/nm-i386.h"
33 #ifdef HAVE_SYS_PARAM_H
34 #include <sys/param.h>
37 extern int kernel_debugging;
38 extern int kernel_writablecore;
40 /* Provide access to the i386 hardware debugging registers. */
42 #define I386_DR_LOW_SET_CONTROL(control) \
43 i386bsd_dr_set_control (control)
44 extern void i386bsd_dr_set_control (unsigned long control);
46 #define I386_DR_LOW_SET_ADDR(regnum, addr) \
47 i386bsd_dr_set_addr (regnum, addr)
48 extern void i386bsd_dr_set_addr (int regnum, CORE_ADDR addr);
50 #define I386_DR_LOW_RESET_ADDR(regnum) \
51 i386bsd_dr_reset_addr (regnum)
52 extern void i386bsd_dr_reset_addr (int regnum);
54 #define I386_DR_LOW_GET_STATUS() \
55 i386bsd_dr_get_status ()
56 extern unsigned long i386bsd_dr_get_status (void);
59 /* Get generic BSD native definitions. */
60 #include "config/nm-bsd.h"
62 /* Override child_resume in `infptrace.c' to work around a kernel bug. */
65 /* Override child_pid_to_exec_file in 'inftarg.c'. */
66 #define CHILD_PID_TO_EXEC_FILE
69 /* Support for the user struct. */
71 /* Return the size of the user struct. */
73 #define KERNEL_U_SIZE kernel_u_size ()
74 extern int kernel_u_size (void);
76 /* This is the amount to subtract from u.u_ar0
77 to get the offset in the core file of the register values. */
79 #include <machine/vmparam.h>
80 #define KERNEL_U_ADDR USRSTACK
82 #define REGISTER_U_ADDR(addr, blockend, regno) \
83 (addr) = register_u_addr ((blockend), (regno))
84 extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno);
87 /* Shared library support. */
91 /* Make structure definitions match up with those expected in
94 #define link_object sod
95 #define lo_name sod_name
96 #define lo_library sod_library
97 #define lo_unused sod_reserved
98 #define lo_major sod_major
99 #define lo_minor sod_minor
100 #define lo_next sod_next
102 #define link_map so_map
103 #define lm_addr som_addr
104 #define lm_name som_path
105 #define lm_next som_next
106 #define lm_lop som_sod
107 #define lm_lob som_sodbase
108 #define lm_rwt som_write
109 #define lm_ld som_dynamic
110 #define lm_lpd som_spd
112 #define link_dynamic_2 section_dispatch_table
113 #define ld_loaded sdt_loaded
114 #define ld_need sdt_sods
115 #define ld_rules sdt_filler1
116 #define ld_got sdt_got
117 #define ld_plt sdt_plt
118 #define ld_rel sdt_rel
119 #define ld_hash sdt_hash
120 #define ld_stab sdt_nzlist
121 #define ld_stab_hash sdt_filler2
122 #define ld_buckets sdt_buckets
123 #define ld_symbols sdt_strings
124 #define ld_symb_size sdt_str_sz
125 #define ld_text sdt_text_sz
126 #define ld_plt_sz sdt_plt_sz
128 #define rtc_symb rt_symbol
130 #define rtc_next rt_next
132 #define ld_debug so_debug
133 #define ldd_version dd_version
134 #define ldd_in_debugger dd_in_debugger
135 #define ldd_sym_loaded dd_sym_loaded
136 #define ldd_bp_addr dd_bpt_addr
137 #define ldd_bp_inst dd_bpt_shadow
140 #define link_dynamic _dynamic
141 #define ld_version d_version
148 #define ADDITIONAL_OPTIONS \
149 {"kernel", no_argument, &kernel_debugging, 1}, \
150 {"k", no_argument, &kernel_debugging, 1}, \
151 {"wcore", no_argument, &kernel_writablecore, 1}, \
152 {"w", no_argument, &kernel_writablecore, 1},
154 #define ADDITIONAL_OPTION_HELP \
156 --kernel Enable kernel debugging.\n\
157 --wcore Make core file writable (only works for /dev/mem).\n\
158 This option only works while debugging a kernel !!\n\
161 #define DEFAULT_PROMPT kernel_debugging?"(kgdb) ":"(gdb) "
163 /* misuse START_PROGRESS to test whether we're running as kgdb */
164 /* START_PROGRESS is called at the top of main */
165 #undef START_PROGRESS
166 #define START_PROGRESS(STR,N) \
167 if (!strcmp (STR, "kgdb")) \
168 kernel_debugging = 1;
170 #endif /* nm-fbsd.h */