FreeBSD/Linux Kernel Cross Reference
sys/ddb/db_break.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: db_break.h,v $
29 * Revision 2.8 93/11/17 16:20:20 dbg
30 * Added declarations for conditional breakpoint routines.
31 * [93/10/08 dbg]
32 *
33 * Revision 2.7 93/01/14 17:24:37 danner
34 * 64bit cleanup. Enabled prototypes.
35 * [92/11/30 af]
36 *
37 * Revision 2.6 91/10/09 15:58:03 af
38 * Added db_thread_breakpoint structure, and added task and threads
39 * field to db_breakpoint structure. Some status flags were also
40 * added to keep track user space break point correctly.
41 * [91/08/29 tak]
42 *
43 * Revision 2.5 91/05/14 15:32:35 mrt
44 * Correcting copyright
45 *
46 * Revision 2.4 91/02/05 17:06:06 mrt
47 * Changed to new Mach copyright
48 * [91/01/31 16:17:10 mrt]
49 *
50 * Revision 2.3 90/10/25 14:43:40 rwd
51 * Added map field to breakpoints.
52 * [90/10/18 rpd]
53 *
54 * Revision 2.2 90/08/27 21:50:00 dbg
55 * Modularized typedef names.
56 * [90/08/20 af]
57 * Add external defintions.
58 * [90/08/07 dbg]
59 * Created.
60 * [90/07/25 dbg]
61 *
62 */
63 /*
64 * Author: David B. Golub, Carnegie Mellon University
65 * Date: 7/90
66 */
67 #ifndef _DDB_DB_BREAK_H_
68 #define _DDB_DB_BREAK_H_
69
70 #include <machine/db_machdep.h>
71 #include <kern/thread.h>
72 #include <kern/task.h>
73 #include <mach/boolean.h>
74
75 /*
76 * thread list at the same breakpoint address
77 */
78 struct db_thread_breakpoint {
79 vm_offset_t tb_task_thd; /* target task or thread */
80 boolean_t tb_is_task; /* task qualified */
81 short tb_number; /* breakpoint number */
82 short tb_init_count; /* skip count(initial value) */
83 short tb_count; /* current skip count */
84 short tb_cond; /* break condition */
85 struct db_thread_breakpoint *tb_next; /* next chain */
86 };
87
88 typedef struct db_thread_breakpoint *db_thread_breakpoint_t;
89
90 /*
91 * Breakpoint.
92 */
93
94 struct db_breakpoint {
95 task_t task; /* target task */
96 db_addr_t address; /* set here */
97 db_thread_breakpoint_t threads; /* thread */
98 int flags; /* flags: */
99 #define BKPT_SINGLE_STEP 0x2 /* to simulate single step */
100 #define BKPT_TEMP 0x4 /* temporary */
101 #define BKPT_USR_GLOBAL 0x8 /* global user space break point */
102 #define BKPT_SET_IN_MEM 0x10 /* break point is set in memory */
103 #define BKPT_1ST_SET 0x20 /* 1st time set of user global bkpt */
104 vm_size_t bkpt_inst; /* saved instruction at bkpt */
105 struct db_breakpoint *link; /* link in in-use or free chain */
106 };
107
108 typedef struct db_breakpoint *db_breakpoint_t;
109
110 extern db_breakpoint_t db_find_breakpoint( task_t task, db_addr_t addr);
111 extern boolean_t db_find_breakpoint_here( task_t task, db_addr_t addr);
112 extern void db_set_breakpoints(void);
113 extern void db_clear_breakpoints(void);
114 extern db_thread_breakpoint_t db_find_thread_breakpoint_here
115 ( task_t task, db_addr_t addr );
116 extern db_thread_breakpoint_t db_find_breakpoint_number
117 ( int num, db_breakpoint_t *bkptp);
118 extern void db_check_breakpoint_valid(void);
119
120 extern db_breakpoint_t db_set_temp_breakpoint( task_t task, db_addr_t addr);
121 extern void db_delete_temp_breakpoint
122 ( task_t task, db_breakpoint_t bkpt);
123
124 extern void db_cond_free(db_thread_breakpoint_t bkpt);
125 extern boolean_t db_cond_check(db_thread_breakpoint_t bkpt);
126 extern void db_cond_print(db_thread_breakpoint_t bkpt);
127
128 extern void db_breakpoint_cmd(
129 db_expr_t addr, boolean_t have_addr,
130 db_expr_t count, char *modif);
131 extern void db_delete_cmd();
132 extern void db_listbreak_cmd();
133
134 extern void db_cond_cmd();
135
136 #endif /* _DDB_DB_BREAK_H_ */
Cache object: ba5498308de484462d7f0d6bbdc3a1f6
|