xref: /freebsd/sys/ddb/ddb.h (revision 48991a368427cadb9cdac39581d1676c29619c52)
1 /*-
2  * Copyright (c) 1993, Garrett A. Wollman.
3  * Copyright (c) 1993, University of Vermont and State Agricultural College.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. Neither the name of the University nor the names of its contributors
15  *    may be used to endorse or promote products derived from this software
16  *    without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  *	$Id: ddb.h,v 1.7 1995/11/24 13:53:05 bde Exp $
31  */
32 
33 /*
34  * Necessary declarations for the `ddb' kernel debugger.
35  */
36 
37 #ifndef _DDB_DDB_H_
38 #define	_DDB_DDB_H_
39 
40 #include <machine/db_machdep.h>		/* type definitions */
41 #include <vm/vm.h>
42 
43 typedef void db_cmdfcn_t __P((db_expr_t addr, boolean_t have_addr,
44 			      db_expr_t count, char *modif));
45 
46 /*
47  * Global variables...
48  */
49 extern char *esym;
50 extern unsigned int db_maxoff;
51 extern int db_inst_count;
52 extern int db_load_count;
53 extern int db_store_count;
54 extern int db_radix;
55 extern int db_max_width;
56 extern int db_tab_stop_width;
57 
58 struct vm_map;			/* forward declaration */
59 
60 /*
61  * Functions...
62  */
63 
64 void		cnpollc __P((int));
65 void		db_check_interrupt __P((void));
66 void		db_clear_watchpoints __P((void));
67 db_addr_t	db_disasm __P((db_addr_t loc, boolean_t altfmt));
68 				/* instruction disassembler */
69 void		db_error __P((char *s));
70 int		db_expression __P((db_expr_t *valuep));
71 int		db_get_variable __P((db_expr_t *valuep));
72 struct vm_map	*db_map_addr __P((vm_offset_t));
73 boolean_t	db_map_current __P((struct vm_map *));
74 boolean_t	db_map_equal __P((struct vm_map *, struct vm_map *));
75 void		db_print_loc_and_inst __P((db_addr_t loc));
76 void		db_printf __P((const char *fmt, ...));
77 void		db_putchar __P((int c));
78 void		db_read_bytes __P((vm_offset_t addr, int size, char *data));
79 				/* machine-dependent */
80 int		db_readline __P((char *lstart, int lsize));
81 void		db_restart_at_pc __P((boolean_t watchpt));
82 void		db_set_watchpoints __P((void));
83 void		db_skip_to_eol __P((void));
84 boolean_t	db_stop_at_pc __P((boolean_t *is_breakpoint));
85 #define		db_strcpy	strcpy
86 void		db_trap __P((int type, int code));
87 int		db_value_of_name __P((char *name, db_expr_t *valuep));
88 void		db_write_bytes __P((vm_offset_t addr, int size, char *data));
89 				/* machine-dependent */
90 void		kdb_init __P((void));
91 void		kdbprintf __P((const char *fmt, ...));
92 void		kdbprinttrap __P((int, int));
93 
94 db_cmdfcn_t	db_breakpoint_cmd;
95 db_cmdfcn_t	db_continue_cmd;
96 db_cmdfcn_t	db_delete_cmd;
97 db_cmdfcn_t	db_deletewatch_cmd;
98 db_cmdfcn_t	db_examine_cmd;
99 db_cmdfcn_t	db_listbreak_cmd;
100 db_cmdfcn_t	db_listwatch_cmd;
101 db_cmdfcn_t	db_print_cmd;
102 db_cmdfcn_t	db_ps;
103 db_cmdfcn_t	db_search_cmd;
104 db_cmdfcn_t	db_set_cmd;
105 db_cmdfcn_t	db_show_regs;
106 db_cmdfcn_t	db_single_step_cmd;
107 db_cmdfcn_t	db_stack_trace_cmd;
108 db_cmdfcn_t	db_trace_until_call_cmd;
109 db_cmdfcn_t	db_trace_until_matching_cmd;
110 db_cmdfcn_t	db_watchpoint_cmd;
111 db_cmdfcn_t	db_write_cmd;
112 
113 #if 0
114 db_cmdfcn_t	db_help_cmd;
115 db_cmdfcn_t	db_show_all_threads;
116 db_cmdfcn_t	db_show_one_thread;
117 db_cmdfcn_t	ipc_port_print;
118 db_cmdfcn_t	vm_page_print;
119 #endif
120 
121 #endif /* !_DDB_DDB_H_ */
122