Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / gnu / usr.bin / binutils / gdb / i386 / nm.h
1 /* $FreeBSD: src/gnu/usr.bin/binutils/gdb/i386/nm.h,v 1.9.4.1 2000/08/22 12:28:19 joerg Exp $ */
2 /* $DragonFly: src/gnu/usr.bin/binutils/gdb/i386/Attic/nm.h,v 1.2 2003/06/17 04:25:44 dillon Exp $ */
3 /* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
4    Copyright 1986, 1987, 1989, 1992, 1996 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, Boston, MA 02111-1307, USA.  */
21
22 #ifndef NM_FREEBSD_H
23 #define NM_FREEBSD_H
24
25 #define ATTACH_DETACH
26
27 /* Be shared lib aware */
28 #include "solib.h"
29 #ifdef FREEBSD_ELF
30 #define SVR4_SHARED_LIBS
31 #endif
32
33 /* This is the amount to subtract from u.u_ar0
34    to get the offset in the core file of the register values.  */
35
36 #include <machine/vmparam.h>
37 #define KERNEL_U_ADDR USRSTACK
38
39 #define REGISTER_U_ADDR(addr, blockend, regno) \
40         (addr) = i386_register_u_addr ((blockend),(regno));
41
42 /* We define our own fetch/store methods */
43 #define FETCH_INFERIOR_REGISTERS
44
45 extern int
46 i386_register_u_addr PARAMS ((int, int));
47
48 #define PTRACE_ARG3_TYPE char*
49
50 #ifndef FREEBSD_ELF
51
52 /* make structure definitions match up with those expected in solib.c */
53 #define link_object     sod
54 #define lo_name         sod_name
55 #define lo_library      sod_library
56 #define lo_unused       sod_reserved
57 #define lo_major        sod_major
58 #define lo_minor        sod_minor
59 #define lo_next         sod_next
60
61 #define link_map        so_map
62 #define lm_addr         som_addr
63 #define lm_name         som_path
64 #define lm_next         som_next
65 #define lm_lop          som_sod
66 #define lm_lob          som_sodbase
67 #define lm_rwt          som_write
68 #define lm_ld           som_dynamic
69 #define lm_lpd          som_spd
70
71 #define link_dynamic_2  section_dispatch_table
72 #define ld_loaded       sdt_loaded
73 #define ld_need         sdt_sods
74 #define ld_rules        sdt_filler1
75 #define ld_got          sdt_got
76 #define ld_plt          sdt_plt
77 #define ld_rel          sdt_rel
78 #define ld_hash         sdt_hash
79 #define ld_stab         sdt_nzlist
80 #define ld_stab_hash    sdt_filler2
81 #define ld_buckets      sdt_buckets
82 #define ld_symbols      sdt_strings
83 #define ld_symb_size    sdt_str_sz
84 #define ld_text         sdt_text_sz
85 #define ld_plt_sz       sdt_plt_sz
86
87 #define rtc_symb        rt_symbol
88 #define rtc_sp          rt_sp
89 #define rtc_next        rt_next
90
91 #define ld_debug        so_debug
92 #define ldd_version     dd_version
93 #define ldd_in_debugger dd_in_debugger
94 #define ldd_sym_loaded  dd_sym_loaded
95 #define ldd_bp_addr     dd_bpt_addr
96 #define ldd_bp_inst     dd_bpt_shadow
97 #define ldd_cp          dd_cc
98
99 #define link_dynamic    _dynamic
100 #define ld_version      d_version
101 #define ldd             d_debug
102 #define ld_un           d_un
103 #define ld_2            d_sdt
104
105 #endif
106
107 /* Return sizeof user struct to callers in less machine dependent routines */
108
109 #define KERNEL_U_SIZE kernel_u_size()
110 extern int kernel_u_size PARAMS ((void));
111
112 #define ADDITIONAL_OPTIONS \
113         {"kernel", no_argument, &kernel_debugging, 1}, \
114         {"k", no_argument, &kernel_debugging, 1}, \
115         {"wcore", no_argument, &kernel_writablecore, 1}, \
116         {"w", no_argument, &kernel_writablecore, 1},
117
118 #define ADDITIONAL_OPTION_HELP \
119         "\
120   --kernel           Enable kernel debugging.\n\
121   --wcore            Make core file writable (only works for /dev/mem).\n\
122                      This option only works while debugging a kernel !!\n\
123 "
124
125 extern int kernel_debugging;
126 extern int kernel_writablecore;
127
128 #define DEFAULT_PROMPT kernel_debugging?"(kgdb) ":"(gdb) "
129
130 /* misuse START_PROGRESS to test whether we're running as kgdb */
131 /* START_PROGRESS is called at the top of main */
132 #undef START_PROGRESS
133 #define START_PROGRESS(STR,N) \
134   if (!strcmp(STR, "kgdb")) \
135      kernel_debugging = 1;
136
137 #include <sys/types.h>
138 #include <sys/ptrace.h>
139
140 #ifdef PT_GETDBREGS
141 #define TARGET_HAS_HARDWARE_WATCHPOINTS
142
143 extern int can_watch PARAMS((int type, int cnt, int othertype));
144 extern int stopped_by_watchpoint PARAMS((void));
145 extern int insert_watchpoint PARAMS((int addr, int len, int type));
146 extern int remove_watchpoint PARAMS((int addr, int len, int type));
147
148 #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
149         can_watch(type, cnt, ot)
150
151 /* After a watchpoint trap, the PC points to the instruction after
152    the one that caused the trap.  Therefore we don't need to step over it.
153    But we do need to reset the status register to avoid another trap.  */
154 #define HAVE_CONTINUABLE_WATCHPOINT
155
156 #define STOPPED_BY_WATCHPOINT(W)  \
157         stopped_by_watchpoint()
158
159 /* Use these macros for watchpoint insertion/removal.  */
160
161 #define target_insert_watchpoint(addr, len, type)  \
162         insert_watchpoint(addr, len, type)
163
164 #define target_remove_watchpoint(addr, len, type)  \
165         remove_watchpoint(addr, len, type)
166
167 #endif /* PT_GETDBREGS */
168
169 #endif /* NM_FREEBSD_H */