xref: /netbsd-src/sys/ddb/db_variables.h (revision bba310736c2d98c87abee8fe3ecfe518745a7946)
1*bba31073Schristos /*	$NetBSD: db_variables.h,v 1.16 2017/12/28 17:51:19 christos Exp $	*/
2cf92afd6Scgd 
361f28255Scgd /*
461f28255Scgd  * Mach Operating System
561f28255Scgd  * Copyright (c) 1991,1990 Carnegie Mellon University
661f28255Scgd  * All Rights Reserved.
761f28255Scgd  *
861f28255Scgd  * Permission to use, copy, modify and distribute this software and its
961f28255Scgd  * documentation is hereby granted, provided that both the copyright
1061f28255Scgd  * notice and this permission notice appear in all copies of the
1161f28255Scgd  * software, derivative works or modified versions, and any portions
1261f28255Scgd  * thereof, and that both notices appear in supporting documentation.
1361f28255Scgd  *
14b13e5d14Spk  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
1561f28255Scgd  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
1661f28255Scgd  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
1761f28255Scgd  *
1861f28255Scgd  * Carnegie Mellon requests users of this software to return to
1961f28255Scgd  *
2061f28255Scgd  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
2161f28255Scgd  *  School of Computer Science
2261f28255Scgd  *  Carnegie Mellon University
2361f28255Scgd  *  Pittsburgh PA 15213-3890
2461f28255Scgd  *
2561f28255Scgd  * any improvements or extensions that they make and grant Carnegie the
2661f28255Scgd  * rights to redistribute these changes.
2737cabe30Scgd  *
2861f28255Scgd  * 	Author: David B. Golub, Carnegie Mellon University
2961f28255Scgd  *	Date:	7/90
3061f28255Scgd  */
3161f28255Scgd 
3261f28255Scgd #ifndef	_DB_VARIABLES_H_
3361f28255Scgd #define	_DB_VARIABLES_H_
3461f28255Scgd 
3561f28255Scgd /*
3661f28255Scgd  * Debugger variables.
3761f28255Scgd  */
3861f28255Scgd struct db_variable {
399aa0a018Sjdolecek 	const char *name;	/* Name of variable */
40*bba31073Schristos 	void 	*valuep;	/* value of variable */
4161f28255Scgd 				/* function to call when reading/writing */
424eaa4d66Ssimonb 	int	(*fcn)(const struct db_variable *, db_expr_t *, int);
434d205d88Sdrochner 	const char	*modif;
4461f28255Scgd #define DB_VAR_GET	0
4561f28255Scgd #define DB_VAR_SET	1
4661f28255Scgd };
474eaa4d66Ssimonb #define	FCN_NULL ((int (*)(const struct db_variable *, db_expr_t *, int))0)
4861f28255Scgd 
499aa0a018Sjdolecek extern const struct db_variable	db_vars[];	/* debugger variables */
509aa0a018Sjdolecek extern const struct db_variable	* const db_evars;
51d5d431e8Sjdolecek extern const struct db_variable	db_regs[];	/* machine registers */
52d5d431e8Sjdolecek extern const struct db_variable	* const db_eregs;
5361f28255Scgd 
544eaa4d66Ssimonb int	db_get_variable(db_expr_t *);
554eaa4d66Ssimonb int	db_set_variable(db_expr_t);
564eaa4d66Ssimonb void	db_read_variable(const struct db_variable *, db_expr_t *);
574eaa4d66Ssimonb void	db_write_variable(const struct db_variable *, db_expr_t *);
5893feeb12Smatt void	db_set_cmd(db_expr_t, bool, db_expr_t, const char *);
598c2e3b4bSchristos 
6061f28255Scgd #endif	/* _DB_VARIABLES_H_ */
61