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