]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/ddb/db_variables.h
9e00a411a0252001e4cac3506a1c1f4adbce2e52
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
34 * Revision 1.1.1.1 1998/09/22 21:05:48 wsanchez
35 * Import of Mac OS X kernel (~semeria)
37 * Revision 1.1.1.1 1998/03/07 02:26:09 wsanchez
38 * Import of OSF Mach kernel (~mburg)
40 * Revision 1.2.17.5 1996/01/09 19:16:39 devrcs
41 * Define alternate register definitions.
42 * [1995/12/01 21:42:46 jfraser]
44 * Merged '64-bit safe' changes from DEC alpha port.
45 * [1995/11/21 18:04:00 jfraser]
47 * Revision 1.2.17.4 1995/02/23 21:44:00 alanl
48 * Merged with DIPC2_SHARED.
49 * [1995/01/05 13:36:23 alanl]
51 * Revision 1.2.20.2 1994/10/14 03:47:19 dwm
52 * mk6 CR668 - 1.3b26 merge
54 * [1994/10/14 03:40:00 dwm]
56 * Revision 1.2.17.2 1994/09/23 01:22:42 ezf
57 * change marker to not FREE
58 * [1994/09/22 21:11:29 ezf]
60 * Revision 1.2.17.1 1994/06/11 21:12:42 bolinger
61 * Merge up to NMK17.2.
62 * [1994/06/11 20:04:23 bolinger]
64 * Revision 1.2.22.1 1994/12/06 19:43:29 alanl
65 * Intel merge, Oct 94 code drop.
67 * Add prototype for db_find_reg_name.
70 * Revision 1.2.15.1 1994/02/08 10:59:16 bernadat
71 * Added db_show_one_variable & db_show_variable prototypes
73 * Got DB_MACRO_LEVEL and DB_MACRO_NARGS macros from <ddb/db_variables.h>.
74 * Added new fields (hidden_xxx) into struct db_variable and into
75 * struct db_var_aux_param.
76 * Added DB_VAR_SHOW for showing variables.
80 * Revision 1.2.4.3 1993/07/27 18:28:29 elliston
81 * Add ANSI prototypes. CR #9523.
82 * [1993/07/27 18:13:26 elliston]
84 * Revision 1.2.4.2 1993/06/09 02:21:06 gm
85 * Added to OSF/1 R1.3 from NMK15.0.
86 * [1993/06/02 20:57:48 jeffc]
88 * Revision 1.2 1993/04/19 16:03:36 devrcs
89 * New field used to display old register values with 'set' command
93 * Revision 1.1 1992/09/30 02:24:26 robert
100 * Revision 2.5 91/10/09 16:04:17 af
101 * Revision 2.4.3.1 91/10/05 13:08:42 jeffreyh
102 * Added suffix related field to db_variable structure.
103 * Added macro definitions of db_{read,write}_variable.
106 * Revision 2.4.3.1 91/10/05 13:08:42 jeffreyh
107 * Added suffix related field to db_variable structure.
108 * Added macro definitions of db_{read,write}_variable.
111 * Revision 2.4 91/05/14 15:37:12 mrt
112 * Correcting copyright
114 * Revision 2.3 91/02/05 17:07:23 mrt
115 * Changed to new Mach copyright
116 * [91/01/31 16:19:54 mrt]
118 * Revision 2.2 90/08/27 21:53:40 dbg
119 * Modularized typedef name. Documented the calling sequence of
120 * the (optional) access function of a variable. Now the valuep
121 * field can be made opaque, eg be an offset that fcn() resolves.
130 * Mach Operating System
131 * Copyright (c) 1991,1990 Carnegie Mellon University
132 * All Rights Reserved.
134 * Permission to use, copy, modify and distribute this software and its
135 * documentation is hereby granted, provided that both the copyright
136 * notice and this permission notice appear in all copies of the
137 * software, derivative works or modified versions, and any portions
138 * thereof, and that both notices appear in supporting documentation.
140 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
141 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
142 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
144 * Carnegie Mellon requests users of this software to return to
146 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
147 * School of Computer Science
148 * Carnegie Mellon University
149 * Pittsburgh PA 15213-3890
151 * any improvements or extensions that they make and grant Carnegie Mellon
152 * the rights to redistribute these changes.
157 * Author: David B. Golub, Carnegie Mellon University
161 #ifndef _DDB_DB_VARIABLES_H_
162 #define _DDB_DB_VARIABLES_H_
164 #include <kern/thread.h>
165 #include <machine/db_machdep.h> /* For db_expr_t */
168 #define DB_VAR_LEVEL 3 /* maximum number of suffix level */
171 * auxiliary parameters passed to a variable handler
173 struct db_var_aux_param
{
174 char *modif
; /* option strings */
175 short level
; /* number of levels */
176 short hidden_level
; /* hidden level */
177 short suffix
[DB_VAR_LEVEL
]; /* suffix */
178 thread_t thr_act
; /* target thr_act */
181 typedef struct db_var_aux_param
*db_var_aux_param_t
;
185 * Debugger variables.
188 char *name
; /* Name of variable */
189 db_expr_t
*valuep
; /* pointer to value of variable */
190 /* function to call when reading/writing */
191 int (*fcn
)(struct db_variable
*,db_expr_t
*,int,db_var_aux_param_t
);
192 short min_level
; /* number of minimum suffix levels */
193 short max_level
; /* number of maximum suffix levels */
194 short low
; /* low value of level 1 suffix */
195 short high
; /* high value of level 1 suffix */
196 boolean_t hidden_level
; /* is there a hidden suffix level ? */
197 short hidden_low
; /* low value of hidden level */
198 short hidden_high
; /* high value of hidden level */
199 int *hidden_levelp
; /* value of current hidden level */
200 boolean_t precious
; /* print old value when affecting ? */
203 #define DB_VAR_SHOW 2
206 typedef struct db_variable
*db_variable_t
;
208 #define DB_VAR_NULL (db_variable_t)0
210 #define FCN_NULL ((int (*)(struct db_variable *, \
213 db_var_aux_param_t)) 0)
215 #define DB_VAR_LEVEL 3 /* maximum number of suffix level */
216 #define DB_MACRO_LEVEL 5 /* max macro nesting */
217 #define DB_MACRO_NARGS 10 /* max args per macro */
219 #define db_read_variable(vp, valuep) \
220 db_read_write_variable(vp, valuep, DB_VAR_GET, 0)
221 #define db_write_variable(vp, valuep) \
222 db_read_write_variable(vp, valuep, DB_VAR_SET, 0)
225 extern struct db_variable db_vars
[]; /* debugger variables */
226 extern struct db_variable
*db_evars
;
227 extern struct db_variable db_regs
[]; /* machine registers */
228 extern struct db_variable
*db_eregs
;
230 #if defined(ALTERNATE_REGISTER_DEFS)
232 extern struct db_variable db_altregs
[]; /* alternate machine regs */
233 extern struct db_variable
*db_ealtregs
;
235 #endif /* defined(ALTERNATE_REGISTER_DEFS) */
237 /* Prototypes for functions exported by this module.
240 int db_get_variable(db_expr_t
*valuep
);
242 void db_read_write_variable(
243 struct db_variable
*vp
,
246 db_var_aux_param_t ap
);
248 void db_set_cmd(void);
250 void db_show_one_variable(void);
252 void db_show_variable(void);
254 db_variable_t
db_find_reg_name(char *s
);
256 #endif /* !_DDB_DB_VARIABLES_H_ */