xref: /illumos-gate/usr/src/cmd/sgs/liblddbg/common/_debug.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_DEBUG_DOT_H
28 #define	_DEBUG_DOT_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <debug.h>
33 #include <conv.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 extern	uint_t		_Dbg_mask;
40 
41 
42 /*
43  * Debugging is enabled by various tokens (see debug.c) that result in an
44  * internal bit mask (_Dbg_mask) being initialized.  Each debugging function is
45  * appropriate for one or more of the classes specified by the bit mask.  Each
46  * debugging function validates whether it is appropriate for the present
47  * classes before printing anything.
48  */
49 #define	DBG_NOTCLASS(c)	!(_Dbg_mask & DBG_MSK_CLASS & (c))
50 #define	DBG_NOTDETAIL()	!(_Dbg_mask & DBG_DETAIL)
51 #define	DBG_NOTLONG()	!(_Dbg_mask & DBG_LONG)
52 
53 #define	DBG_GLOBAL	0xf0000000	/* see include/debug.h */
54 #define	DBG_LOCAL	0x0fffffff
55 #define	DBG_MSK_CLASS	0x00ffffff
56 
57 #define	DBG_DETAIL	0x01000000
58 #define	DBG_LONG	0x02000000
59 
60 #define	DBG_ARGS	0x00000001
61 #define	DBG_BASIC	0x00000002
62 #define	DBG_BINDINGS	0x00000004
63 #define	DBG_ENTRY	0x00000008
64 #define	DBG_FILES	0x00000010
65 #define	DBG_HELP	0x00000020
66 #define	DBG_LIBS	0x00000040
67 #define	DBG_MAP		0x00000080
68 #define	DBG_RELOC	0x00000100
69 #define	DBG_SECTIONS	0x00000200
70 #define	DBG_SEGMENTS	0x00000400
71 #define	DBG_SYMBOLS	0x00000800
72 #define	DBG_SUPPORT	0x00001000
73 #define	DBG_VERSIONS	0x00002000
74 #define	DBG_AUDITING	0x00004000
75 #define	DBG_GOT		0x00008000
76 #define	DBG_MOVE	0x00010000
77 #define	DBG_DEMANGLE	0x00020000
78 #define	DBG_TLS		0x00040000
79 #define	DBG_STRTAB	0x00080000
80 #define	DBG_STATISTICS	0x00100000
81 #define	DBG_UNUSED	0x00200000
82 #define	DBG_CAP		0x00400000
83 
84 typedef struct options {
85 	const char	*o_name;	/* command line argument name */
86 	uint_t		o_mask;		/* associated bit mask for this name */
87 } DBG_options, *DBG_opts;
88 
89 
90 /*
91  * Internal debugging routines.
92  */
93 #ifdef _ELF64
94 #define	_Dbg_seg_desc_entry	_Dbg_seg_desc_entry64
95 #endif
96 extern	const char	*_Dbg_sym_dem(const char *);
97 extern	void		_Dbg_elf_data_in(Os_desc *, Is_desc *);
98 extern	void		_Dbg_elf_data_out(Os_desc *);
99 extern	void		_Dbg_ent_entry(Half, Ent_desc * enp);
100 extern	void		_Dbg_seg_desc_entry(Half, int, Sg_desc *);
101 
102 #ifdef	__cplusplus
103 }
104 #endif
105 
106 #endif	/* _DEBUG_DOT_H */
107