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