]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/ddb/db_task_thread.h
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@
26 * Mach Operating System
27 * Copyright (c) 1991,1990 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
53 #ifndef _DDB_DB_TASK_THREAD_H_
54 #define _DDB_DB_TASK_THREAD_H_
56 #include <kern/task.h>
57 #include <kern/thread.h>
58 #include <kern/processor.h>
59 #include <ddb/db_variables.h> /* For db_var_aux_param_t */
62 * On behalf of kernel-loaded tasks, distinguish between current task
63 * (=> symbol table) and current address space (=> where [e.g.]
64 * breakpoints are set). From ddb's perspective, kernel-loaded tasks
65 * can retain their own symbol tables, but share the kernel's address
68 #define db_current_task() \
69 ((current_thread())? current_thread()->task: TASK_NULL)
70 #define db_current_space() \
72 current_thread()->task: TASK_NULL)
73 #define db_target_space(thr_act, user_space) \
74 ((!(user_space) || ((thr_act)))?\
77 (thr_act)->task: db_current_space())
78 #define db_is_current_space(task) \
79 ((task) == TASK_NULL || (task) == db_current_space())
81 extern task_t db_default_task
; /* default target task */
82 extern thread_t db_default_act
; /* default target thr_act */
85 /* Prototypes for functions exported by this module.
88 int db_lookup_act(thread_t target_act
);
90 int db_lookup_task(task_t target_task
);
92 int db_lookup_task_act(
96 boolean_t
db_check_act_address_valid(thread_t thr_act
);
98 boolean_t
db_get_next_act(
102 void db_init_default_act(void);
104 int db_set_default_act(
105 struct db_variable
*vp
,
108 db_var_aux_param_t ap
);
111 struct db_variable
*vp
,
114 db_var_aux_param_t ap
);
116 #endif /* !_DDB_DB_TASK_THREAD_H_ */