2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
29 * Revision 1.1.1.1 1998/09/22 21:05:47 wsanchez
30 * Import of Mac OS X kernel (~semeria)
32 * Revision 1.1.1.1 1998/03/07 02:26:09 wsanchez
33 * Import of OSF Mach kernel (~mburg)
35 * Revision 1.1.18.3 1995/01/06 19:10:05 devrcs
36 * mk6 CR668 - 1.3b26 merge
37 * 64bit cleanup, prototypes.
38 * [1994/10/14 03:39:52 dwm]
40 * Revision 1.1.18.2 1994/09/23 01:18:04 ezf
41 * change marker to not FREE
42 * [1994/09/22 21:09:24 ezf]
44 * Revision 1.1.18.1 1994/06/11 21:11:29 bolinger
45 * Merge up to NMK17.2.
46 * [1994/06/11 20:03:39 bolinger]
48 * Revision 1.1.16.1 1994/04/11 09:34:32 bernadat
49 * Moved db_breakpoint struct declaration from db_break.c
53 * Revision 1.1.12.2 1994/03/17 22:35:24 dwm
54 * The infamous name change: thread_activation + thread_shuttle = thread.
55 * [1994/03/17 21:25:41 dwm]
57 * Revision 1.1.12.1 1994/01/12 17:50:30 dwm
58 * Coloc: initial restructuring to follow Utah model.
59 * [1994/01/12 17:13:00 dwm]
61 * Revision 1.1.4.4 1993/07/27 18:26:51 elliston
62 * Add ANSI prototypes. CR #9523.
63 * [1993/07/27 18:10:59 elliston]
65 * Revision 1.1.4.3 1993/06/07 22:06:31 jeffc
66 * CR9176 - ANSI C violations: trailing tokens on CPP
67 * directives, extra semicolons after decl_ ..., asm keywords
68 * [1993/06/07 18:57:06 jeffc]
70 * Revision 1.1.4.2 1993/06/02 23:10:21 jeffc
71 * Added to OSF/1 R1.3 from NMK15.0.
72 * [1993/06/02 20:55:49 jeffc]
74 * Revision 1.1 1992/09/30 02:24:12 robert
81 * Revision 2.6 91/10/09 15:58:03 af
82 * Revision 2.5.3.1 91/10/05 13:05:04 jeffreyh
83 * Added db_thread_breakpoint structure, and added task and threads
84 * field to db_breakpoint structure. Some status flags were also
85 * added to keep track user space break point correctly.
88 * Revision 2.5.3.1 91/10/05 13:05:04 jeffreyh
89 * Added db_thread_breakpoint structure, and added task and threads
90 * field to db_breakpoint structure. Some status flags were also
91 * added to keep track user space break point correctly.
94 * Revision 2.5 91/05/14 15:32:35 mrt
95 * Correcting copyright
97 * Revision 2.4 91/02/05 17:06:06 mrt
98 * Changed to new Mach copyright
99 * [91/01/31 16:17:10 mrt]
101 * Revision 2.3 90/10/25 14:43:40 rwd
102 * Added map field to breakpoints.
105 * Revision 2.2 90/08/27 21:50:00 dbg
106 * Modularized typedef names.
108 * Add external defintions.
116 * Mach Operating System
117 * Copyright (c) 1991,1990 Carnegie Mellon University
118 * All Rights Reserved.
120 * Permission to use, copy, modify and distribute this software and its
121 * documentation is hereby granted, provided that both the copyright
122 * notice and this permission notice appear in all copies of the
123 * software, derivative works or modified versions, and any portions
124 * thereof, and that both notices appear in supporting documentation.
126 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
127 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
128 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
130 * Carnegie Mellon requests users of this software to return to
132 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
133 * School of Computer Science
134 * Carnegie Mellon University
135 * Pittsburgh PA 15213-3890
137 * any improvements or extensions that they make and grant Carnegie Mellon
138 * the rights to redistribute these changes.
143 * Author: David B. Golub, Carnegie Mellon University
146 #ifndef _DDB_DB_BREAK_H_
147 #define _DDB_DB_BREAK_H_
149 #include <machine/db_machdep.h>
150 #include <kern/thread.h>
151 #include <kern/task.h>
152 #include <mach/boolean.h>
155 * thread list at the same breakpoint address
157 struct db_thread_breakpoint
{
158 vm_offset_t tb_task_thd
; /* target task or thread */
159 boolean_t tb_is_task
; /* task qualified */
160 short tb_number
; /* breakpoint number */
161 short tb_init_count
; /* skip count(initial value) */
162 short tb_count
; /* current skip count */
163 short tb_cond
; /* break condition */
164 struct db_thread_breakpoint
*tb_next
; /* next chain */
166 typedef struct db_thread_breakpoint
*db_thread_breakpoint_t
;
171 struct db_breakpoint
{
172 task_t task
; /* target task */
173 db_addr_t address
; /* set here */
174 db_thread_breakpoint_t threads
; /* thread */
175 int flags
; /* flags: */
176 #define BKPT_SINGLE_STEP 0x2 /* to simulate single step */
177 #define BKPT_TEMP 0x4 /* temporary */
178 #define BKPT_USR_GLOBAL 0x8 /* global user space break point */
179 #define BKPT_SET_IN_MEM 0x10 /* break point is set in memory */
180 #define BKPT_1ST_SET 0x20 /* 1st time set of user global bkpt */
181 vm_size_t bkpt_inst
; /* saved instruction at bkpt */
182 struct db_breakpoint
*link
; /* link in in-use or free chain */
185 typedef struct db_breakpoint
*db_breakpoint_t
;
189 * Prototypes for functions exported by this module.
192 db_thread_breakpoint_t
db_find_thread_breakpoint_here(
196 void db_check_breakpoint_valid(void);
198 void db_set_breakpoint(
205 db_breakpoint_t
db_find_breakpoint(
209 boolean_t
db_find_breakpoint_here(
213 db_thread_breakpoint_t
db_find_breakpoint_number(
215 db_breakpoint_t
*bkptp
);
217 void db_set_breakpoints(void);
219 void db_clear_breakpoints(void);
221 db_breakpoint_t
db_set_temp_breakpoint(
225 void db_delete_temp_breakpoint(
227 db_breakpoint_t bkpt
);
229 void db_delete_cmd(void);
231 void db_breakpoint_cmd(
237 void db_listbreak_cmd(void);
239 #endif /* !_DDB_DB_BREAK_H_ */