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:47 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.1.18.3 1995/01/06 19:10:05 devrcs
38 * mk6 CR668 - 1.3b26 merge
39 * 64bit cleanup, prototypes.
40 * [1994/10/14 03:39:52 dwm]
42 * Revision 1.1.18.2 1994/09/23 01:18:04 ezf
43 * change marker to not FREE
44 * [1994/09/22 21:09:24 ezf]
46 * Revision 1.1.18.1 1994/06/11 21:11:29 bolinger
47 * Merge up to NMK17.2.
48 * [1994/06/11 20:03:39 bolinger]
50 * Revision 1.1.16.1 1994/04/11 09:34:32 bernadat
51 * Moved db_breakpoint struct declaration from db_break.c
55 * Revision 1.1.12.2 1994/03/17 22:35:24 dwm
56 * The infamous name change: thread_activation + thread_shuttle = thread.
57 * [1994/03/17 21:25:41 dwm]
59 * Revision 1.1.12.1 1994/01/12 17:50:30 dwm
60 * Coloc: initial restructuring to follow Utah model.
61 * [1994/01/12 17:13:00 dwm]
63 * Revision 1.1.4.4 1993/07/27 18:26:51 elliston
64 * Add ANSI prototypes. CR #9523.
65 * [1993/07/27 18:10:59 elliston]
67 * Revision 1.1.4.3 1993/06/07 22:06:31 jeffc
68 * CR9176 - ANSI C violations: trailing tokens on CPP
69 * directives, extra semicolons after decl_ ..., asm keywords
70 * [1993/06/07 18:57:06 jeffc]
72 * Revision 1.1.4.2 1993/06/02 23:10:21 jeffc
73 * Added to OSF/1 R1.3 from NMK15.0.
74 * [1993/06/02 20:55:49 jeffc]
76 * Revision 1.1 1992/09/30 02:24:12 robert
83 * Revision 2.6 91/10/09 15:58:03 af
84 * Revision 2.5.3.1 91/10/05 13:05:04 jeffreyh
85 * Added db_thread_breakpoint structure, and added task and threads
86 * field to db_breakpoint structure. Some status flags were also
87 * added to keep track user space break point correctly.
90 * Revision 2.5.3.1 91/10/05 13:05:04 jeffreyh
91 * Added db_thread_breakpoint structure, and added task and threads
92 * field to db_breakpoint structure. Some status flags were also
93 * added to keep track user space break point correctly.
96 * Revision 2.5 91/05/14 15:32:35 mrt
97 * Correcting copyright
99 * Revision 2.4 91/02/05 17:06:06 mrt
100 * Changed to new Mach copyright
101 * [91/01/31 16:17:10 mrt]
103 * Revision 2.3 90/10/25 14:43:40 rwd
104 * Added map field to breakpoints.
107 * Revision 2.2 90/08/27 21:50:00 dbg
108 * Modularized typedef names.
110 * Add external defintions.
118 * Mach Operating System
119 * Copyright (c) 1991,1990 Carnegie Mellon University
120 * All Rights Reserved.
122 * Permission to use, copy, modify and distribute this software and its
123 * documentation is hereby granted, provided that both the copyright
124 * notice and this permission notice appear in all copies of the
125 * software, derivative works or modified versions, and any portions
126 * thereof, and that both notices appear in supporting documentation.
128 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
129 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
130 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
132 * Carnegie Mellon requests users of this software to return to
134 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
135 * School of Computer Science
136 * Carnegie Mellon University
137 * Pittsburgh PA 15213-3890
139 * any improvements or extensions that they make and grant Carnegie Mellon
140 * the rights to redistribute these changes.
145 * Author: David B. Golub, Carnegie Mellon University
148 #ifndef _DDB_DB_BREAK_H_
149 #define _DDB_DB_BREAK_H_
151 #include <machine/db_machdep.h>
152 #include <kern/thread.h>
153 #include <kern/task.h>
154 #include <mach/boolean.h>
157 * thread list at the same breakpoint address
159 struct db_thread_breakpoint
{
160 vm_offset_t tb_task_thd
; /* target task or thread */
161 boolean_t tb_is_task
; /* task qualified */
162 short tb_number
; /* breakpoint number */
163 short tb_init_count
; /* skip count(initial value) */
164 short tb_count
; /* current skip count */
165 short tb_cond
; /* break condition */
166 struct db_thread_breakpoint
*tb_next
; /* next chain */
168 typedef struct db_thread_breakpoint
*db_thread_breakpoint_t
;
173 struct db_breakpoint
{
174 task_t task
; /* target task */
175 db_addr_t address
; /* set here */
176 db_thread_breakpoint_t threads
; /* thread */
177 int flags
; /* flags: */
178 #define BKPT_SINGLE_STEP 0x2 /* to simulate single step */
179 #define BKPT_TEMP 0x4 /* temporary */
180 #define BKPT_USR_GLOBAL 0x8 /* global user space break point */
181 #define BKPT_SET_IN_MEM 0x10 /* break point is set in memory */
182 #define BKPT_1ST_SET 0x20 /* 1st time set of user global bkpt */
183 vm_size_t bkpt_inst
; /* saved instruction at bkpt */
184 struct db_breakpoint
*link
; /* link in in-use or free chain */
187 typedef struct db_breakpoint
*db_breakpoint_t
;
191 * Prototypes for functions exported by this module.
194 db_thread_breakpoint_t
db_find_thread_breakpoint_here(
198 void db_check_breakpoint_valid(void);
200 void db_set_breakpoint(
204 thread_act_t thr_act
,
207 db_breakpoint_t
db_find_breakpoint(
211 boolean_t
db_find_breakpoint_here(
215 db_thread_breakpoint_t
db_find_breakpoint_number(
217 db_breakpoint_t
*bkptp
);
219 void db_set_breakpoints(void);
221 void db_clear_breakpoints(void);
223 db_breakpoint_t
db_set_temp_breakpoint(
227 void db_delete_temp_breakpoint(
229 db_breakpoint_t bkpt
);
231 void db_delete_cmd(void);
233 void db_breakpoint_cmd(
239 void db_listbreak_cmd(void);
241 #endif /* !_DDB_DB_BREAK_H_ */