xref: /illumos-gate/usr/src/cmd/mdb/common/mdb/mdb_tdb.h (revision ed093b41)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_MDB_TDB_H
28 #define	_MDB_TDB_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 #ifdef _MDB
35 
36 #include <sys/types.h>
37 #include <sys/param.h>
38 #include <thread_db.h>
39 
40 typedef struct mdb_tdb_ops {
41 	td_err_e (*td_ta_new)(struct ps_prochandle *, td_thragent_t **);
42 	td_err_e (*td_ta_delete)(td_thragent_t *);
43 	td_err_e (*td_ta_thr_iter)(const td_thragent_t *, td_thr_iter_f *,
44 	    void *, td_thr_state_e, int, sigset_t *, uint_t);
45 	td_err_e (*td_ta_map_id2thr)(const td_thragent_t *,
46 	    thread_t, td_thrhandle_t *);
47 	td_err_e (*td_ta_map_lwp2thr)(const td_thragent_t *,
48 	    lwpid_t, td_thrhandle_t *);
49 	td_err_e (*td_thr_get_info)(const td_thrhandle_t *, td_thrinfo_t *);
50 	td_err_e (*td_thr_getgregs)(const td_thrhandle_t *, prgregset_t);
51 	td_err_e (*td_thr_setgregs)(const td_thrhandle_t *, const prgregset_t);
52 	td_err_e (*td_thr_getfpregs)(const td_thrhandle_t *, prfpregset_t *);
53 	td_err_e (*td_thr_setfpregs)(const td_thrhandle_t *,
54 	    const prfpregset_t *);
55 	td_err_e (*td_thr_tlsbase)(const td_thrhandle_t *, ulong_t, psaddr_t *);
56 	td_err_e (*td_thr_getxregsize)(const td_thrhandle_t *, int *);
57 	td_err_e (*td_thr_getxregs)(const td_thrhandle_t *, void *);
58 	td_err_e (*td_thr_setxregs)(const td_thrhandle_t *, const void *);
59 } mdb_tdb_ops_t;
60 
61 typedef struct mdb_tdb_lib {
62 	char tdb_pathname[MAXPATHLEN];	/* Absolute pathname of library */
63 	mdb_tdb_ops_t tdb_ops;		/* Ops vector for this library */
64 	void *tdb_handle;		/* Library rtld object handle */
65 	struct mdb_tdb_lib *tdb_next;	/* Pointer to next library in cache */
66 } mdb_tdb_lib_t;
67 
68 extern const mdb_tdb_ops_t *mdb_tdb_load(const char *);
69 extern void mdb_tdb_flush(void);
70 
71 #endif	/* _MDB */
72 
73 #ifdef	__cplusplus
74 }
75 #endif
76 
77 #endif	/* _MDB_TDB_H */
78