2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
34 * Revision 1.1.1.1 1998/09/22 21:05:47 wsanchez
35 * Import of Mac OS X kernel (~semeria)
37 * Revision 1.1.1.1 1998/03/07 02:26:09 wsanchez
38 * Import of OSF Mach kernel (~mburg)
40 * Revision 1.1.18.3 1995/01/06 19:10:05 devrcs
41 * mk6 CR668 - 1.3b26 merge
42 * 64bit cleanup, prototypes.
43 * [1994/10/14 03:39:52 dwm]
45 * Revision 1.1.18.2 1994/09/23 01:18:04 ezf
46 * change marker to not FREE
47 * [1994/09/22 21:09:24 ezf]
49 * Revision 1.1.18.1 1994/06/11 21:11:29 bolinger
50 * Merge up to NMK17.2.
51 * [1994/06/11 20:03:39 bolinger]
53 * Revision 1.1.16.1 1994/04/11 09:34:32 bernadat
54 * Moved db_breakpoint struct declaration from db_break.c
58 * Revision 1.1.12.2 1994/03/17 22:35:24 dwm
59 * The infamous name change: thread_activation + thread_shuttle = thread.
60 * [1994/03/17 21:25:41 dwm]
62 * Revision 1.1.12.1 1994/01/12 17:50:30 dwm
63 * Coloc: initial restructuring to follow Utah model.
64 * [1994/01/12 17:13:00 dwm]
66 * Revision 1.1.4.4 1993/07/27 18:26:51 elliston
67 * Add ANSI prototypes. CR #9523.
68 * [1993/07/27 18:10:59 elliston]
70 * Revision 1.1.4.3 1993/06/07 22:06:31 jeffc
71 * CR9176 - ANSI C violations: trailing tokens on CPP
72 * directives, extra semicolons after decl_ ..., asm keywords
73 * [1993/06/07 18:57:06 jeffc]
75 * Revision 1.1.4.2 1993/06/02 23:10:21 jeffc
76 * Added to OSF/1 R1.3 from NMK15.0.
77 * [1993/06/02 20:55:49 jeffc]
79 * Revision 1.1 1992/09/30 02:24:12 robert
86 * Revision 2.6 91/10/09 15:58:03 af
87 * Revision 2.5.3.1 91/10/05 13:05:04 jeffreyh
88 * Added db_thread_breakpoint structure, and added task and threads
89 * field to db_breakpoint structure. Some status flags were also
90 * added to keep track user space break point correctly.
93 * Revision 2.5.3.1 91/10/05 13:05:04 jeffreyh
94 * Added db_thread_breakpoint structure, and added task and threads
95 * field to db_breakpoint structure. Some status flags were also
96 * added to keep track user space break point correctly.
99 * Revision 2.5 91/05/14 15:32:35 mrt
100 * Correcting copyright
102 * Revision 2.4 91/02/05 17:06:06 mrt
103 * Changed to new Mach copyright
104 * [91/01/31 16:17:10 mrt]
106 * Revision 2.3 90/10/25 14:43:40 rwd
107 * Added map field to breakpoints.
110 * Revision 2.2 90/08/27 21:50:00 dbg
111 * Modularized typedef names.
113 * Add external defintions.
121 * Mach Operating System
122 * Copyright (c) 1991,1990 Carnegie Mellon University
123 * All Rights Reserved.
125 * Permission to use, copy, modify and distribute this software and its
126 * documentation is hereby granted, provided that both the copyright
127 * notice and this permission notice appear in all copies of the
128 * software, derivative works or modified versions, and any portions
129 * thereof, and that both notices appear in supporting documentation.
131 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
132 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
133 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
135 * Carnegie Mellon requests users of this software to return to
137 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
138 * School of Computer Science
139 * Carnegie Mellon University
140 * Pittsburgh PA 15213-3890
142 * any improvements or extensions that they make and grant Carnegie Mellon
143 * the rights to redistribute these changes.
148 * Author: David B. Golub, Carnegie Mellon University
151 #ifndef _DDB_DB_BREAK_H_
152 #define _DDB_DB_BREAK_H_
154 #include <machine/db_machdep.h>
155 #include <kern/thread.h>
156 #include <kern/task.h>
157 #include <mach/boolean.h>
160 * thread list at the same breakpoint address
162 struct db_thread_breakpoint
{
163 vm_offset_t tb_task_thd
; /* target task or thread */
164 boolean_t tb_is_task
; /* task qualified */
165 short tb_number
; /* breakpoint number */
166 short tb_init_count
; /* skip count(initial value) */
167 short tb_count
; /* current skip count */
168 short tb_cond
; /* break condition */
169 struct db_thread_breakpoint
*tb_next
; /* next chain */
171 typedef struct db_thread_breakpoint
*db_thread_breakpoint_t
;
176 struct db_breakpoint
{
177 task_t task
; /* target task */
178 db_addr_t address
; /* set here */
179 db_thread_breakpoint_t threads
; /* thread */
180 int flags
; /* flags: */
181 #define BKPT_SINGLE_STEP 0x2 /* to simulate single step */
182 #define BKPT_TEMP 0x4 /* temporary */
183 #define BKPT_USR_GLOBAL 0x8 /* global user space break point */
184 #define BKPT_SET_IN_MEM 0x10 /* break point is set in memory */
185 #define BKPT_1ST_SET 0x20 /* 1st time set of user global bkpt */
186 vm_size_t bkpt_inst
; /* saved instruction at bkpt */
187 struct db_breakpoint
*link
; /* link in in-use or free chain */
190 typedef struct db_breakpoint
*db_breakpoint_t
;
194 * Prototypes for functions exported by this module.
197 db_thread_breakpoint_t
db_find_thread_breakpoint_here(
201 void db_check_breakpoint_valid(void);
203 void db_set_breakpoint(
210 db_breakpoint_t
db_find_breakpoint(
214 boolean_t
db_find_breakpoint_here(
218 db_thread_breakpoint_t
db_find_breakpoint_number(
220 db_breakpoint_t
*bkptp
);
222 void db_set_breakpoints(void);
224 void db_clear_breakpoints(void);
226 db_breakpoint_t
db_set_temp_breakpoint(
230 void db_delete_temp_breakpoint(
232 db_breakpoint_t bkpt
);
234 void db_delete_cmd(void);
236 void db_breakpoint_cmd(
242 void db_listbreak_cmd(db_expr_t
, boolean_t
, db_expr_t
, char *);
244 #endif /* !_DDB_DB_BREAK_H_ */