| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: db_machdep.c,v 1.5 2014/01/11 17:11:50 christos Exp $ */ | | 1 | /* $NetBSD: db_machdep.c,v 1.6 2017/08/15 06:39:37 maxv Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Mach Operating System | | 4 | * Mach Operating System |
5 | * Copyright (c) 1991,1990 Carnegie Mellon University | | 5 | * Copyright (c) 1991,1990 Carnegie Mellon University |
6 | * All Rights Reserved. | | 6 | * All Rights Reserved. |
7 | * | | 7 | * |
8 | * Permission to use, copy, modify and distribute this software and its | | 8 | * Permission to use, copy, modify and distribute this software and its |
9 | * documentation is hereby granted, provided that both the copyright | | 9 | * documentation is hereby granted, provided that both the copyright |
10 | * notice and this permission notice appear in all copies of the | | 10 | * notice and this permission notice appear in all copies of the |
11 | * software, derivative works or modified versions, and any portions | | 11 | * software, derivative works or modified versions, and any portions |
12 | * thereof, and that both notices appear in supporting documentation. | | 12 | * thereof, and that both notices appear in supporting documentation. |
13 | * | | 13 | * |
14 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | | 14 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" |
| @@ -17,27 +17,27 @@ | | | @@ -17,27 +17,27 @@ |
17 | * | | 17 | * |
18 | * Carnegie Mellon requests users of this software to return to | | 18 | * Carnegie Mellon requests users of this software to return to |
19 | * | | 19 | * |
20 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | | 20 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU |
21 | * School of Computer Science | | 21 | * School of Computer Science |
22 | * Carnegie Mellon University | | 22 | * Carnegie Mellon University |
23 | * Pittsburgh PA 15213-3890 | | 23 | * Pittsburgh PA 15213-3890 |
24 | * | | 24 | * |
25 | * any improvements or extensions that they make and grant Carnegie the | | 25 | * any improvements or extensions that they make and grant Carnegie the |
26 | * rights to redistribute these changes. | | 26 | * rights to redistribute these changes. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | __KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.5 2014/01/11 17:11:50 christos Exp $"); | | 30 | __KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.6 2017/08/15 06:39:37 maxv Exp $"); |
31 | | | 31 | |
32 | #include <sys/param.h> | | 32 | #include <sys/param.h> |
33 | #include <sys/systm.h> | | 33 | #include <sys/systm.h> |
34 | #include <sys/proc.h> | | 34 | #include <sys/proc.h> |
35 | | | 35 | |
36 | #ifndef _KERNEL | | 36 | #ifndef _KERNEL |
37 | #include <stdbool.h> | | 37 | #include <stdbool.h> |
38 | #endif | | 38 | #endif |
39 | | | 39 | |
40 | #include <machine/frame.h> | | 40 | #include <machine/frame.h> |
41 | #include <machine/trap.h> | | 41 | #include <machine/trap.h> |
42 | #include <machine/intrdefs.h> | | 42 | #include <machine/intrdefs.h> |
43 | #include <machine/cpu.h> | | 43 | #include <machine/cpu.h> |
| @@ -121,81 +121,52 @@ db_frame_info(long *frame, db_addr_t cal | | | @@ -121,81 +121,52 @@ db_frame_info(long *frame, db_addr_t cal |
121 | db_symbol_values(sym, &name, NULL); | | 121 | db_symbol_values(sym, &name, NULL); |
122 | if (sym == (db_sym_t)0) | | 122 | if (sym == (db_sym_t)0) |
123 | return (db_sym_t)0; | | 123 | return (db_sym_t)0; |
124 | | | 124 | |
125 | *is_trap = NONE; | | 125 | *is_trap = NONE; |
126 | narg = MAXNARG; | | 126 | narg = MAXNARG; |
127 | | | 127 | |
128 | if (INKERNEL((int)frame) && name) { | | 128 | if (INKERNEL((int)frame) && name) { |
129 | /* | | 129 | /* |
130 | * XXX traps should be based off of the Xtrap* | | 130 | * XXX traps should be based off of the Xtrap* |
131 | * locations rather than on trap, since some traps | | 131 | * locations rather than on trap, since some traps |
132 | * (e.g., npxdna) don't go through trap() | | 132 | * (e.g., npxdna) don't go through trap() |
133 | */ | | 133 | */ |
134 | #ifdef __ELF__ | | | |
135 | if (!strcmp(name, "trap_tss")) { | | 134 | if (!strcmp(name, "trap_tss")) { |
136 | *is_trap = TRAP_TSS; | | 135 | *is_trap = TRAP_TSS; |
137 | narg = 0; | | 136 | narg = 0; |
138 | } else if (!strcmp(name, "trap")) { | | 137 | } else if (!strcmp(name, "trap")) { |
139 | *is_trap = TRAP; | | 138 | *is_trap = TRAP; |
140 | narg = 0; | | 139 | narg = 0; |
141 | } else if (!strcmp(name, "syscall")) { | | 140 | } else if (!strcmp(name, "syscall")) { |
142 | *is_trap = SYSCALL; | | 141 | *is_trap = SYSCALL; |
143 | narg = 0; | | 142 | narg = 0; |
144 | } else if (name[0] == 'X') { | | 143 | } else if (name[0] == 'X') { |
145 | if (!strncmp(name, "Xintr", 5) || | | 144 | if (!strncmp(name, "Xintr", 5) || |
146 | !strncmp(name, "Xresume", 7) || | | 145 | !strncmp(name, "Xresume", 7) || |
147 | !strncmp(name, "Xstray", 6) || | | 146 | !strncmp(name, "Xstray", 6) || |
148 | !strncmp(name, "Xhold", 5) || | | 147 | !strncmp(name, "Xhold", 5) || |
149 | !strncmp(name, "Xrecurse", 8) || | | 148 | !strncmp(name, "Xrecurse", 8) || |
150 | !strcmp(name, "Xdoreti")) { | | 149 | !strcmp(name, "Xdoreti")) { |
151 | *is_trap = INTERRUPT; | | 150 | *is_trap = INTERRUPT; |
152 | narg = 0; | | 151 | narg = 0; |
153 | } else if (!strcmp(name, "Xsoftintr")) { | | 152 | } else if (!strcmp(name, "Xsoftintr")) { |
154 | *is_trap = SOFTINTR; | | 153 | *is_trap = SOFTINTR; |
155 | narg = 0; | | 154 | narg = 0; |
156 | } else if (!strncmp(name, "Xtss_", 5)) { | | 155 | } else if (!strncmp(name, "Xtss_", 5)) { |
157 | *is_trap = INTERRUPT_TSS; | | 156 | *is_trap = INTERRUPT_TSS; |
158 | narg = 0; | | 157 | narg = 0; |
159 | } | | 158 | } |
160 | } | | 159 | } |
161 | #else | | | |
162 | if (!strcmp(name, "_trap_tss")) { | | | |
163 | *is_trap = TRAP_TSS; | | | |
164 | narg = 0; | | | |
165 | } else if (!strcmp(name, "_trap")) { | | | |
166 | *is_trap = TRAP; | | | |
167 | narg = 0; | | | |
168 | } else if (!strcmp(name, "_syscall")) { | | | |
169 | *is_trap = SYSCALL; | | | |
170 | narg = 0; | | | |
171 | } else if (name[0] == '_' && name[1] == 'X') { | | | |
172 | if (!strncmp(name, "_Xintr", 6) || | | | |
173 | !strncmp(name, "_Xresume", 8) || | | | |
174 | !strncmp(name, "_Xstray", 7) || | | | |
175 | !strncmp(name, "_Xhold", 6) || | | | |
176 | !strncmp(name, "_Xrecurse", 9) || | | | |
177 | !strcmp(name, "_Xdoreti")) { | | | |
178 | *is_trap = INTERRUPT; | | | |
179 | narg = 0; | | | |
180 | } else if (!strcmp(name, "_Xsoftintr")) { | | | |
181 | *is_trap = SOFTINTR; | | | |
182 | narg = 0; | | | |
183 | } else if (!strncmp(name, "_Xtss_", 6)) { | | | |
184 | *is_trap = INTERRUPT_TSS; | | | |
185 | narg = 0; | | | |
186 | } | | | |
187 | } | | | |
188 | #endif /* __ELF__ */ | | | |
189 | } | | 160 | } |
190 | | | 161 | |
191 | if (offp != NULL) | | 162 | if (offp != NULL) |
192 | *offp = offset; | | 163 | *offp = offset; |
193 | if (nargp != NULL) | | 164 | if (nargp != NULL) |
194 | *nargp = narg; | | 165 | *nargp = narg; |
195 | if (namep != NULL) | | 166 | if (namep != NULL) |
196 | *namep = name; | | 167 | *namep = name; |
197 | return sym; | | 168 | return sym; |
198 | } | | 169 | } |
199 | | | 170 | |
200 | /* | | 171 | /* |
201 | * Figure out the next frame up in the call stack. | | 172 | * Figure out the next frame up in the call stack. |