dt_errtags.h revision 237624
1264790Sbapt/*
2264790Sbapt * CDDL HEADER START
3264790Sbapt *
4264790Sbapt * The contents of this file are subject to the terms of the
5264790Sbapt * Common Development and Distribution License, Version 1.0 only
6264790Sbapt * (the "License").  You may not use this file except in compliance
7264790Sbapt * with the License.
8264790Sbapt *
9264790Sbapt * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10264790Sbapt * or http://www.opensolaris.org/os/licensing.
11264790Sbapt * See the License for the specific language governing permissions
12264790Sbapt * and limitations under the License.
13264790Sbapt *
14264790Sbapt * When distributing Covered Code, include this CDDL HEADER in each
15264790Sbapt * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16264790Sbapt * If applicable, add the following below this CDDL HEADER, with the
17264790Sbapt * fields enclosed by brackets "[]" replaced with your own identifying
18264790Sbapt * information: Portions Copyright [yyyy] [name of copyright owner]
19264790Sbapt *
20264790Sbapt * CDDL HEADER END
21264790Sbapt */
22264790Sbapt/*
23264790Sbapt * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24264790Sbapt * Use is subject to license terms.
25264790Sbapt */
26264790Sbapt
27264790Sbapt#ifndef	_DT_ERRTAGS_H
28264790Sbapt#define	_DT_ERRTAGS_H
29264790Sbapt
30264790Sbapt#pragma ident	"%Z%%M%	%I%	%E% SMI"
31264790Sbapt
32264790Sbapt#ifdef	__cplusplus
33264790Sbaptextern "C" {
34264790Sbapt#endif
35264790Sbapt
36264790Sbapt/*
37264790Sbapt * This enum definition is used to define a set of error tags associated with
38264790Sbapt * the D compiler's various error conditions.  The shell script mkerrtags.sh is
39264790Sbapt * used to parse this file and create a corresponding dt_errtags.c source file.
40264790Sbapt * If you do something other than add a new error tag here, you may need to
41264790Sbapt * update the mkerrtags shell script as it is based upon simple regexps.
42264790Sbapt */
43264790Sbapttypedef enum {
44264790Sbapt	D_UNKNOWN,			/* unknown D compiler error */
45264790Sbapt	D_SYNTAX,			/* syntax error in input stream */
46264790Sbapt	D_EMPTY,			/* empty translation unit */
47264790Sbapt	D_TYPE_ERR,			/* type definition missing */
48264790Sbapt	D_TYPE_MEMBER,			/* type member not found */
49264790Sbapt	D_ASRELO,			/* relocation remains against symbol */
50264790Sbapt	D_CG_EXPR,			/* tracing function called from expr */
51264790Sbapt	D_CG_DYN,			/* expression returns dynamic result */
52264790Sbapt	D_ATTR_MIN,			/* attributes less than amin setting */
53264790Sbapt	D_ID_OFLOW,			/* identifier space overflow */
54264790Sbapt	D_PDESC_ZERO,			/* probedesc matches zero probes */
55264790Sbapt	D_PDESC_INVAL,			/* probedesc is not valid */
56264790Sbapt	D_PRED_SCALAR,			/* predicate must be of scalar type */
57264790Sbapt	D_FUNC_IDENT,			/* function designator is not ident */
58264790Sbapt	D_FUNC_UNDEF,			/* function ident is not defined */
59264790Sbapt	D_FUNC_IDKIND,			/* function ident is of wrong idkind */
60264790Sbapt	D_OFFSETOF_TYPE,		/* offsetof arg is not sou type */
61264790Sbapt	D_OFFSETOF_BITFIELD,		/* offsetof applied to field member */
62264790Sbapt	D_SIZEOF_TYPE,			/* invalid sizeof type */
63264790Sbapt	D_SIZEOF_BITFIELD,		/* sizeof applied to field member */
64264790Sbapt	D_STRINGOF_TYPE,		/* invalid stringof type */
65264790Sbapt	D_OP_IDENT,			/* operand must be an identifier */
66264790Sbapt	D_OP_INT,			/* operand must be integral type */
67264790Sbapt	D_OP_SCALAR,			/* operand must be scalar type */
68264790Sbapt	D_OP_ARITH,			/* operand must be arithmetic type */
69264790Sbapt	D_OP_WRITE,			/* operand must be writable variable */
70264790Sbapt	D_OP_LVAL,			/* operand must be lvalue */
71264790Sbapt	D_OP_INCOMPAT,			/* operand types are not compatible */
72264790Sbapt	D_OP_VFPTR,			/* operand cannot be void or func ptr */
73264790Sbapt	D_OP_ARRFUN,			/* operand cannot be array or func */
74264790Sbapt	D_OP_PTR,			/* operand must be a pointer */
75264790Sbapt	D_OP_SOU,			/* operand must be struct or union */
76264790Sbapt	D_OP_INCOMPLETE,		/* operand is an incomplete type */
77264790Sbapt	D_OP_DYN,			/* operand cannot be of dynamic type */
78264790Sbapt	D_OP_ACT,			/* operand cannot be action */
79264790Sbapt	D_AGG_REDEF,			/* aggregation cannot be redefined */
80264790Sbapt	D_AGG_FUNC,			/* aggregating function required */
81264790Sbapt	D_AGG_MDIM,			/* aggregation used as multi-dim arr */
82264790Sbapt	D_ARR_BADREF,			/* access non-array using tuple */
83264790Sbapt	D_ARR_LOCAL,			/* cannot define local assc array */
84264790Sbapt	D_DIV_ZERO,			/* division by zero detected */
85264790Sbapt	D_DEREF_NONPTR,			/* dereference non-pointer type */
86264790Sbapt	D_DEREF_VOID,			/* dereference void pointer */
87264790Sbapt	D_DEREF_FUNC,			/* dereference function pointer */
88264790Sbapt	D_ADDROF_LVAL,			/* unary & applied to non-lvalue */
89264790Sbapt	D_ADDROF_VAR,			/* unary & applied to variable */
90264790Sbapt	D_ADDROF_BITFIELD,		/* unary & applied to field member */
91264790Sbapt	D_XLATE_REDECL,			/* translator redeclared */
92264790Sbapt	D_XLATE_NOCONV,			/* no conversion for member defined */
93264790Sbapt	D_XLATE_NONE,			/* no translator for type combo */
94264790Sbapt	D_XLATE_SOU,			/* dst must be struct or union type */
95264790Sbapt	D_XLATE_INCOMPAT,		/* translator member type incompat */
96264790Sbapt	D_XLATE_MEMB,			/* translator member is not valid */
97264790Sbapt	D_CAST_INVAL,			/* invalid cast expression */
98264790Sbapt	D_PRAGERR,			/* #pragma error message */
99264790Sbapt	D_PRAGCTL_INVAL,		/* invalid control directive */
100264790Sbapt	D_PRAGMA_INVAL,			/* invalid compiler pragma */
101264790Sbapt	D_PRAGMA_UNUSED,		/* unused compiler pragma */
102264790Sbapt	D_PRAGMA_MALFORM,		/* malformed #pragma argument list */
103264790Sbapt	D_PRAGMA_OPTSET,		/* failed to set #pragma option */
104264790Sbapt	D_PRAGMA_SCOPE,			/* #pragma identifier scope error */
105264790Sbapt	D_PRAGMA_DEPEND,		/* #pragma dependency not satisfied */
106264790Sbapt	D_MACRO_UNDEF,			/* macro parameter is not defined */
107264790Sbapt	D_MACRO_OFLOW,			/* macro parameter integer overflow */
108264790Sbapt	D_MACRO_UNUSED,			/* macro parameter is never used */
109264790Sbapt	D_INT_OFLOW,			/* integer constant overflow */
110264790Sbapt	D_INT_DIGIT,			/* integer digit is not valid */
111264790Sbapt	D_STR_NL,			/* newline in string literal */
112264790Sbapt	D_CHR_NL,			/* newline in character constant */
113264790Sbapt	D_CHR_NULL,			/* empty character constant */
114264790Sbapt	D_CHR_OFLOW,			/* character constant is too long */
115264790Sbapt	D_IDENT_BADREF,			/* identifier expected type mismatch */
116264790Sbapt	D_IDENT_UNDEF,			/* identifier is not known/defined */
117264790Sbapt	D_IDENT_AMBIG,			/* identifier is ambiguous (var/enum) */
118264790Sbapt	D_SYM_BADREF,			/* kernel/user symbol ref mismatch */
119264790Sbapt	D_SYM_NOTYPES,			/* no CTF data available for sym ref */
120264790Sbapt	D_SYM_MODEL,			/* module/program data model mismatch */
121264790Sbapt	D_VAR_UNDEF,			/* reference to undefined variable */
122264790Sbapt	D_VAR_UNSUP,			/* unsupported variable specification */
123264790Sbapt	D_PROTO_LEN,			/* prototype length mismatch */
124264790Sbapt	D_PROTO_ARG,			/* prototype argument mismatch */
125264790Sbapt	D_ARGS_MULTI,			/* description matches unstable set */
126264790Sbapt	D_ARGS_XLATOR,			/* no args[] translator defined */
127264790Sbapt	D_ARGS_NONE,			/* no args[] available */
128264790Sbapt	D_ARGS_TYPE,			/* invalid args[] type */
129264790Sbapt	D_ARGS_IDX,			/* invalid args[] index */
130264790Sbapt	D_REGS_IDX,			/* invalid regs[] index */
131264790Sbapt	D_KEY_TYPE,			/* invalid agg or array key type */
132264790Sbapt	D_PRINTF_DYN_PROTO,		/* dynamic size argument missing */
133264790Sbapt	D_PRINTF_DYN_TYPE,		/* dynamic size type mismatch */
134264790Sbapt	D_PRINTF_AGG_CONV,		/* improper use of %@ conversion */
135264790Sbapt	D_PRINTF_ARG_PROTO,		/* conversion missing value argument */
136264790Sbapt	D_PRINTF_ARG_TYPE,		/* conversion arg has wrong type */
137264790Sbapt	D_PRINTF_ARG_EXTRA,		/* extra arguments specified */
138264790Sbapt	D_PRINTF_ARG_FMT,		/* format string is not a constant */
139264790Sbapt	D_PRINTF_FMT_EMPTY,		/* format string is empty */
140264790Sbapt	D_DECL_CHARATTR,		/* bad attributes for char decl */
141264790Sbapt	D_DECL_VOIDATTR,		/* bad attributes for void decl */
142264790Sbapt	D_DECL_SIGNINT,			/* sign/unsign with non-integer decl */
143264790Sbapt	D_DECL_LONGINT,			/* long with non-arithmetic decl */
144264790Sbapt	D_DECL_IDENT,			/* old-style declaration or bad type */
145264790Sbapt	D_DECL_CLASS,			/* more than one storage class given */
146264790Sbapt	D_DECL_BADCLASS,		/* decl class not supported in D */
147264790Sbapt	D_DECL_PARMCLASS,		/* invalid class for parameter type */
148264790Sbapt	D_DECL_COMBO, 			/* bad decl specifier combination */
149264790Sbapt	D_DECL_ARRSUB,			/* const int required for array size */
150264790Sbapt	D_DECL_ARRNULL,			/* array decl requires dim or tuple */
151264790Sbapt	D_DECL_ARRBIG,			/* array size too big */
152264790Sbapt	D_DECL_IDRED,			/* decl identifier redeclared */
153264790Sbapt	D_DECL_TYPERED,			/* decl type redeclared */
154264790Sbapt	D_DECL_MNAME,			/* member name missing */
155264790Sbapt	D_DECL_SCOPE,			/* scoping operator used in decl */
156264790Sbapt	D_DECL_BFCONST,			/* bit-field requires const size expr */
157264790Sbapt	D_DECL_BFSIZE,			/* bit-field size too big for type */
158264790Sbapt	D_DECL_BFTYPE,			/* bit-field type is not valid */
159264790Sbapt	D_DECL_ENCONST,			/* enum tag requires const size expr */
160264790Sbapt	D_DECL_ENOFLOW,			/* enumerator value overflows INT_MAX */
161264790Sbapt	D_DECL_USELESS,			/* useless external declaration */
162264790Sbapt	D_DECL_LOCASSC,			/* attempt to decl local assc array */
163277086Sjkim	D_DECL_VOIDOBJ,			/* attempt to decl void object */
164264790Sbapt	D_DECL_DYNOBJ,			/* attempt to decl dynamic object */
165264790Sbapt	D_DECL_INCOMPLETE,		/* declaration uses incomplete type */
166264790Sbapt	D_DECL_PROTO_VARARGS,		/* varargs not allowed in prototype */
167264790Sbapt	D_DECL_PROTO_TYPE,		/* type not allowed in prototype */
168264790Sbapt	D_DECL_PROTO_VOID,		/* void must be sole parameter */
169264790Sbapt	D_DECL_PROTO_NAME,		/* void parameter may not have a name */
170264790Sbapt	D_DECL_PROTO_FORM,		/* parameter name has no formal */
171264790Sbapt	D_COMM_COMM,			/* commit() after commit() */
172264790Sbapt	D_COMM_DREC,			/* commit() after data action */
173264790Sbapt	D_SPEC_SPEC,			/* speculate() after speculate() */
174264790Sbapt	D_SPEC_COMM,			/* speculate() after commit() */
175264790Sbapt	D_SPEC_DREC,			/* speculate() after data action */
176264790Sbapt	D_AGG_COMM,			/* aggregating act after commit() */
177264790Sbapt	D_AGG_SPEC,			/* aggregating act after speculate() */
178264790Sbapt	D_AGG_NULL,			/* aggregation stmt has null effect */
179264790Sbapt	D_AGG_SCALAR,			/* aggregating function needs scalar */
180264790Sbapt	D_ACT_SPEC,			/* destructive action after speculate */
181264790Sbapt	D_EXIT_SPEC,			/* exit() action after speculate */
182264790Sbapt	D_DREC_COMM,			/* data action after commit() */
183264790Sbapt	D_PRINTA_PROTO,			/* printa() prototype mismatch */
184264790Sbapt	D_PRINTA_AGGARG,		/* aggregation arg type mismatch */
185264790Sbapt	D_PRINTA_AGGBAD,		/* printa() aggregation not defined */
186264790Sbapt	D_PRINTA_AGGKEY,		/* printa() aggregation key mismatch */
187264790Sbapt	D_PRINTA_AGGPROTO,		/* printa() aggregation mismatch */
188264790Sbapt	D_TRACE_VOID,			/* trace() argument has void type */
189264790Sbapt	D_TRACE_DYN,			/* trace() argument has dynamic type */
190264790Sbapt	D_TRACEMEM_ADDR,		/* tracemem() address bad type */
191264790Sbapt	D_TRACEMEM_SIZE,		/* tracemem() size bad type */
192264790Sbapt	D_STACK_PROTO,			/* stack() prototype mismatch */
193264790Sbapt	D_STACK_SIZE,			/* stack() size argument bad type */
194264790Sbapt	D_USTACK_FRAMES,		/* ustack() frames arg bad type */
195264790Sbapt	D_USTACK_STRSIZE,		/* ustack() strsize arg bad type */
196264790Sbapt	D_USTACK_PROTO,			/* ustack() prototype mismatch */
197264790Sbapt	D_LQUANT_BASETYPE,		/* lquantize() bad base type */
198264790Sbapt	D_LQUANT_BASEVAL,		/* lquantize() bad base value */
199264790Sbapt	D_LQUANT_LIMTYPE,		/* lquantize() bad limit type */
200264790Sbapt	D_LQUANT_LIMVAL,		/* lquantize() bad limit value */
201264790Sbapt	D_LQUANT_MISMATCH,		/* lquantize() limit < base */
202264790Sbapt	D_LQUANT_STEPTYPE,		/* lquantize() bad step type */
203264790Sbapt	D_LQUANT_STEPVAL,		/* lquantize() bad step value */
204264790Sbapt	D_LQUANT_STEPLARGE,		/* lquantize() step too large */
205264790Sbapt	D_LQUANT_STEPSMALL,		/* lquantize() step too small */
206264790Sbapt	D_QUANT_PROTO,			/* quantize() prototype mismatch */
207264790Sbapt	D_PROC_OFF,			/* byte offset exceeds function size */
208264790Sbapt	D_PROC_ALIGN,			/* byte offset has invalid alignment */
209264790Sbapt	D_PROC_NAME,			/* invalid process probe name */
210264790Sbapt	D_PROC_GRAB,			/* failed to grab process */
211264790Sbapt	D_PROC_DYN,			/* process is not dynamically linked */
212264790Sbapt	D_PROC_LIB,			/* invalid process library name */
213264790Sbapt	D_PROC_FUNC,			/* no such function in process */
214264790Sbapt	D_PROC_CREATEFAIL,		/* pid probe creation failed */
215264790Sbapt	D_PROC_NODEV,			/* fasttrap device is not installed */
216264790Sbapt	D_PROC_BADPID,			/* user probe pid invalid */
217264790Sbapt	D_PROC_BADPROV,			/* user probe provider invalid */
218264790Sbapt	D_PROC_USDT,			/* problem initializing usdt */
219264790Sbapt	D_CLEAR_PROTO,			/* clear() prototype mismatch */
220264790Sbapt	D_CLEAR_AGGARG,			/* aggregation arg type mismatch */
221264790Sbapt	D_CLEAR_AGGBAD,			/* clear() aggregation not defined */
222264790Sbapt	D_NORMALIZE_PROTO,		/* normalize() prototype mismatch */
223264790Sbapt	D_NORMALIZE_SCALAR,		/* normalize() value must be scalar */
224264790Sbapt	D_NORMALIZE_AGGARG,		/* aggregation arg type mismatch */
225264790Sbapt	D_NORMALIZE_AGGBAD,		/* normalize() aggregation not def. */
226264790Sbapt	D_TRUNC_PROTO,			/* trunc() prototype mismatch */
227264790Sbapt	D_TRUNC_SCALAR,			/* trunc() value must be scalar */
228264790Sbapt	D_TRUNC_AGGARG,			/* aggregation arg type mismatch */
229264790Sbapt	D_TRUNC_AGGBAD,			/* trunc() aggregation not def. */
230264790Sbapt	D_PROV_BADNAME,			/* invalid provider name */
231264790Sbapt	D_PROV_INCOMPAT,		/* provider/probe interface mismatch */
232264790Sbapt	D_PROV_PRDUP,			/* duplicate probe declaration */
233264790Sbapt	D_PROV_PRARGLEN,		/* probe argument list too long */
234264790Sbapt	D_PROV_PRXLATOR,		/* probe argument translator missing */
235264790Sbapt	D_FREOPEN_INVALID,		/* frename() filename is invalid */
236264790Sbapt	D_LQUANT_MATCHBASE,		/* lquantize() mismatch on base */
237264790Sbapt	D_LQUANT_MATCHLIM,		/* lquantize() mismatch on limit */
238264790Sbapt	D_LQUANT_MATCHSTEP,		/* lquantize() mismatch on step */
239264790Sbapt	D_LLQUANT_FACTORTYPE,		/* llquantize() bad magnitude type */
240264790Sbapt	D_LLQUANT_FACTORVAL,		/* llquantize() bad magnitude value */
241264790Sbapt	D_LLQUANT_FACTORMATCH,		/* llquantize() mismatch on magnitude */
242264790Sbapt	D_LLQUANT_LOWTYPE,		/* llquantize() bad low mag type */
243264790Sbapt	D_LLQUANT_LOWVAL,		/* llquantize() bad low mag value */
244264790Sbapt	D_LLQUANT_LOWMATCH,		/* llquantize() mismatch on low mag */
245264790Sbapt	D_LLQUANT_HIGHTYPE,		/* llquantize() bad high mag type */
246264790Sbapt	D_LLQUANT_HIGHVAL,		/* llquantize() bad high mag value */
247264790Sbapt	D_LLQUANT_HIGHMATCH,		/* llquantize() mismatch on high mag */
248264790Sbapt	D_LLQUANT_NSTEPTYPE,		/* llquantize() bad # steps type */
249264790Sbapt	D_LLQUANT_NSTEPVAL,		/* llquantize() bad # steps value */
250264790Sbapt	D_LLQUANT_NSTEPMATCH,		/* llquantize() mismatch on # steps */
251264790Sbapt	D_LLQUANT_MAGRANGE,		/* llquantize() bad magnitude range */
252264790Sbapt	D_LLQUANT_FACTORNSTEPS,		/* llquantize() # steps < factor */
253264790Sbapt	D_LLQUANT_FACTOREVEN,		/* llquantize() bad # steps/factor */
254264790Sbapt	D_LLQUANT_FACTORSMALL,		/* llquantize() magnitude too small */
255264790Sbapt	D_LLQUANT_MAGTOOBIG,		/* llquantize() high mag too large */
256264790Sbapt	D_PRINTM_ADDR,			/* printm() memref bad type */
257264790Sbapt	D_PRINTM_SIZE,			/* printm() size bad type */
258264790Sbapt	D_PRINTT_ADDR,			/* printt() typeref bad type */
259264790Sbapt	D_PRINTT_SIZE			/* printt() size bad type */
260264790Sbapt} dt_errtag_t;
261264790Sbapt
262264790Sbaptextern const char *dt_errtag(dt_errtag_t);
263264790Sbapt
264264790Sbapt#ifdef	__cplusplus
265264790Sbapt}
266264790Sbapt#endif
267264790Sbapt
268264790Sbapt#endif	/* _DT_ERRTAGS_H */
269264790Sbapt