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