dt_errtags.h revision 248690
1219820Sjeff/*
2219820Sjeff * CDDL HEADER START
3219820Sjeff *
4219820Sjeff * The contents of this file are subject to the terms of the
5219820Sjeff * Common Development and Distribution License, Version 1.0 only
6219820Sjeff * (the "License").  You may not use this file except in compliance
7219820Sjeff * with the License.
8219820Sjeff *
9219820Sjeff * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10219820Sjeff * or http://www.opensolaris.org/os/licensing.
11219820Sjeff * See the License for the specific language governing permissions
12219820Sjeff * and limitations under the License.
13219820Sjeff *
14219820Sjeff * When distributing Covered Code, include this CDDL HEADER in each
15219820Sjeff * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16219820Sjeff * If applicable, add the following below this CDDL HEADER, with the
17219820Sjeff * fields enclosed by brackets "[]" replaced with your own identifying
18219820Sjeff * information: Portions Copyright [yyyy] [name of copyright owner]
19219820Sjeff *
20219820Sjeff * CDDL HEADER END
21219820Sjeff */
22219820Sjeff/*
23219820Sjeff * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24219820Sjeff * Use is subject to license terms.
25219820Sjeff */
26219820Sjeff
27219820Sjeff#ifndef	_DT_ERRTAGS_H
28219820Sjeff#define	_DT_ERRTAGS_H
29219820Sjeff
30219820Sjeff#pragma ident	"%Z%%M%	%I%	%E% SMI"
31219820Sjeff
32219820Sjeff#ifdef	__cplusplus
33219820Sjeffextern "C" {
34219820Sjeff#endif
35219820Sjeff
36219820Sjeff/*
37219820Sjeff * This enum definition is used to define a set of error tags associated with
38219820Sjeff * the D compiler's various error conditions.  The shell script mkerrtags.sh is
39219820Sjeff * used to parse this file and create a corresponding dt_errtags.c source file.
40219820Sjeff * If you do something other than add a new error tag here, you may need to
41219820Sjeff * update the mkerrtags shell script as it is based upon simple regexps.
42219820Sjeff */
43219820Sjefftypedef enum {
44219820Sjeff	D_UNKNOWN,			/* unknown D compiler error */
45219820Sjeff	D_SYNTAX,			/* syntax error in input stream */
46219820Sjeff	D_EMPTY,			/* empty translation unit */
47219820Sjeff	D_TYPE_ERR,			/* type definition missing */
48219820Sjeff	D_TYPE_MEMBER,			/* type member not found */
49219820Sjeff	D_ASRELO,			/* relocation remains against symbol */
50219820Sjeff	D_CG_EXPR,			/* tracing function called from expr */
51219820Sjeff	D_CG_DYN,			/* expression returns dynamic result */
52219820Sjeff	D_ATTR_MIN,			/* attributes less than amin setting */
53219820Sjeff	D_ID_OFLOW,			/* identifier space overflow */
54219820Sjeff	D_PDESC_ZERO,			/* probedesc matches zero probes */
55219820Sjeff	D_PDESC_INVAL,			/* probedesc is not valid */
56219820Sjeff	D_PRED_SCALAR,			/* predicate must be of scalar type */
57219820Sjeff	D_FUNC_IDENT,			/* function designator is not ident */
58219820Sjeff	D_FUNC_UNDEF,			/* function ident is not defined */
59219820Sjeff	D_FUNC_IDKIND,			/* function ident is of wrong idkind */
60219820Sjeff	D_OFFSETOF_TYPE,		/* offsetof arg is not sou type */
61219820Sjeff	D_OFFSETOF_BITFIELD,		/* offsetof applied to field member */
62219820Sjeff	D_SIZEOF_TYPE,			/* invalid sizeof type */
63219820Sjeff	D_SIZEOF_BITFIELD,		/* sizeof applied to field member */
64219820Sjeff	D_STRINGOF_TYPE,		/* invalid stringof type */
65219820Sjeff	D_OP_IDENT,			/* operand must be an identifier */
66219820Sjeff	D_OP_INT,			/* operand must be integral type */
67219820Sjeff	D_OP_SCALAR,			/* operand must be scalar type */
68219820Sjeff	D_OP_ARITH,			/* operand must be arithmetic type */
69219820Sjeff	D_OP_WRITE,			/* operand must be writable variable */
70219820Sjeff	D_OP_LVAL,			/* operand must be lvalue */
71219820Sjeff	D_OP_INCOMPAT,			/* operand types are not compatible */
72219820Sjeff	D_OP_VFPTR,			/* operand cannot be void or func ptr */
73219820Sjeff	D_OP_ARRFUN,			/* operand cannot be array or func */
74219820Sjeff	D_OP_PTR,			/* operand must be a pointer */
75219820Sjeff	D_OP_SOU,			/* operand must be struct or union */
76219820Sjeff	D_OP_INCOMPLETE,		/* operand is an incomplete type */
77219820Sjeff	D_OP_DYN,			/* operand cannot be of dynamic type */
78219820Sjeff	D_OP_ACT,			/* operand cannot be action */
79219820Sjeff	D_AGG_REDEF,			/* aggregation cannot be redefined */
80219820Sjeff	D_AGG_FUNC,			/* aggregating function required */
81219820Sjeff	D_AGG_MDIM,			/* aggregation used as multi-dim arr */
82219820Sjeff	D_ARR_BADREF,			/* access non-array using tuple */
83219820Sjeff	D_ARR_LOCAL,			/* cannot define local assc array */
84219820Sjeff	D_DIV_ZERO,			/* division by zero detected */
85219820Sjeff	D_DEREF_NONPTR,			/* dereference non-pointer type */
86219820Sjeff	D_DEREF_VOID,			/* dereference void pointer */
87219820Sjeff	D_DEREF_FUNC,			/* dereference function pointer */
88219820Sjeff	D_ADDROF_LVAL,			/* unary & applied to non-lvalue */
89219820Sjeff	D_ADDROF_VAR,			/* unary & applied to variable */
90219820Sjeff	D_ADDROF_BITFIELD,		/* unary & applied to field member */
91219820Sjeff	D_XLATE_REDECL,			/* translator redeclared */
92219820Sjeff	D_XLATE_NOCONV,			/* no conversion for member defined */
93219820Sjeff	D_XLATE_NONE,			/* no translator for type combo */
94219820Sjeff	D_XLATE_SOU,			/* dst must be struct or union type */
95219820Sjeff	D_XLATE_INCOMPAT,		/* translator member type incompat */
96219820Sjeff	D_XLATE_MEMB,			/* translator member is not valid */
97219820Sjeff	D_CAST_INVAL,			/* invalid cast expression */
98219820Sjeff	D_PRAGERR,			/* #pragma error message */
99219820Sjeff	D_PRAGCTL_INVAL,		/* invalid control directive */
100219820Sjeff	D_PRAGMA_INVAL,			/* invalid compiler pragma */
101219820Sjeff	D_PRAGMA_UNUSED,		/* unused compiler pragma */
102219820Sjeff	D_PRAGMA_MALFORM,		/* malformed #pragma argument list */
103219820Sjeff	D_PRAGMA_OPTSET,		/* failed to set #pragma option */
104219820Sjeff	D_PRAGMA_SCOPE,			/* #pragma identifier scope error */
105219820Sjeff	D_PRAGMA_DEPEND,		/* #pragma dependency not satisfied */
106219820Sjeff	D_MACRO_UNDEF,			/* macro parameter is not defined */
107219820Sjeff	D_MACRO_OFLOW,			/* macro parameter integer overflow */
108219820Sjeff	D_MACRO_UNUSED,			/* macro parameter is never used */
109219820Sjeff	D_INT_OFLOW,			/* integer constant overflow */
110219820Sjeff	D_INT_DIGIT,			/* integer digit is not valid */
111219820Sjeff	D_STR_NL,			/* newline in string literal */
112219820Sjeff	D_CHR_NL,			/* newline in character constant */
113219820Sjeff	D_CHR_NULL,			/* empty character constant */
114219820Sjeff	D_CHR_OFLOW,			/* character constant is too long */
115219820Sjeff	D_IDENT_BADREF,			/* identifier expected type mismatch */
116219820Sjeff	D_IDENT_UNDEF,			/* identifier is not known/defined */
117219820Sjeff	D_IDENT_AMBIG,			/* identifier is ambiguous (var/enum) */
118219820Sjeff	D_SYM_BADREF,			/* kernel/user symbol ref mismatch */
119219820Sjeff	D_SYM_NOTYPES,			/* no CTF data available for sym ref */
120219820Sjeff	D_SYM_MODEL,			/* module/program data model mismatch */
121219820Sjeff	D_VAR_UNDEF,			/* reference to undefined variable */
122219820Sjeff	D_VAR_UNSUP,			/* unsupported variable specification */
123219820Sjeff	D_PROTO_LEN,			/* prototype length mismatch */
124219820Sjeff	D_PROTO_ARG,			/* prototype argument mismatch */
125219820Sjeff	D_ARGS_MULTI,			/* description matches unstable set */
126219820Sjeff	D_ARGS_XLATOR,			/* no args[] translator defined */
127219820Sjeff	D_ARGS_NONE,			/* no args[] available */
128219820Sjeff	D_ARGS_TYPE,			/* invalid args[] type */
129219820Sjeff	D_ARGS_IDX,			/* invalid args[] index */
130219820Sjeff	D_REGS_IDX,			/* invalid regs[] index */
131219820Sjeff	D_KEY_TYPE,			/* invalid agg or array key type */
132219820Sjeff	D_PRINTF_DYN_PROTO,		/* dynamic size argument missing */
133219820Sjeff	D_PRINTF_DYN_TYPE,		/* dynamic size type mismatch */
134219820Sjeff	D_PRINTF_AGG_CONV,		/* improper use of %@ conversion */
135219820Sjeff	D_PRINTF_ARG_PROTO,		/* conversion missing value argument */
136219820Sjeff	D_PRINTF_ARG_TYPE,		/* conversion arg has wrong type */
137219820Sjeff	D_PRINTF_ARG_EXTRA,		/* extra arguments specified */
138219820Sjeff	D_PRINTF_ARG_FMT,		/* format string is not a constant */
139219820Sjeff	D_PRINTF_FMT_EMPTY,		/* format string is empty */
140219820Sjeff	D_DECL_CHARATTR,		/* bad attributes for char decl */
141219820Sjeff	D_DECL_VOIDATTR,		/* bad attributes for void decl */
142219820Sjeff	D_DECL_SIGNINT,			/* sign/unsign with non-integer decl */
143219820Sjeff	D_DECL_LONGINT,			/* long with non-arithmetic decl */
144219820Sjeff	D_DECL_IDENT,			/* old-style declaration or bad type */
145219820Sjeff	D_DECL_CLASS,			/* more than one storage class given */
146219820Sjeff	D_DECL_BADCLASS,		/* decl class not supported in D */
147219820Sjeff	D_DECL_PARMCLASS,		/* invalid class for parameter type */
148	D_DECL_COMBO, 			/* bad decl specifier combination */
149	D_DECL_ARRSUB,			/* const int required for array size */
150	D_DECL_ARRNULL,			/* array decl requires dim or tuple */
151	D_DECL_ARRBIG,			/* array size too big */
152	D_DECL_IDRED,			/* decl identifier redeclared */
153	D_DECL_TYPERED,			/* decl type redeclared */
154	D_DECL_MNAME,			/* member name missing */
155	D_DECL_SCOPE,			/* scoping operator used in decl */
156	D_DECL_BFCONST,			/* bit-field requires const size expr */
157	D_DECL_BFSIZE,			/* bit-field size too big for type */
158	D_DECL_BFTYPE,			/* bit-field type is not valid */
159	D_DECL_ENCONST,			/* enum tag requires const size expr */
160	D_DECL_ENOFLOW,			/* enumerator value overflows INT_MAX */
161	D_DECL_USELESS,			/* useless external declaration */
162	D_DECL_LOCASSC,			/* attempt to decl local assc array */
163	D_DECL_VOIDOBJ,			/* attempt to decl void object */
164	D_DECL_DYNOBJ,			/* attempt to decl dynamic object */
165	D_DECL_INCOMPLETE,		/* declaration uses incomplete type */
166	D_DECL_PROTO_VARARGS,		/* varargs not allowed in prototype */
167	D_DECL_PROTO_TYPE,		/* type not allowed in prototype */
168	D_DECL_PROTO_VOID,		/* void must be sole parameter */
169	D_DECL_PROTO_NAME,		/* void parameter may not have a name */
170	D_DECL_PROTO_FORM,		/* parameter name has no formal */
171	D_COMM_COMM,			/* commit() after commit() */
172	D_COMM_DREC,			/* commit() after data action */
173	D_SPEC_SPEC,			/* speculate() after speculate() */
174	D_SPEC_COMM,			/* speculate() after commit() */
175	D_SPEC_DREC,			/* speculate() after data action */
176	D_AGG_COMM,			/* aggregating act after commit() */
177	D_AGG_SPEC,			/* aggregating act after speculate() */
178	D_AGG_NULL,			/* aggregation stmt has null effect */
179	D_AGG_SCALAR,			/* aggregating function needs scalar */
180	D_ACT_SPEC,			/* destructive action after speculate */
181	D_EXIT_SPEC,			/* exit() action after speculate */
182	D_DREC_COMM,			/* data action after commit() */
183	D_PRINTA_PROTO,			/* printa() prototype mismatch */
184	D_PRINTA_AGGARG,		/* aggregation arg type mismatch */
185	D_PRINTA_AGGBAD,		/* printa() aggregation not defined */
186	D_PRINTA_AGGKEY,		/* printa() aggregation key mismatch */
187	D_PRINTA_AGGPROTO,		/* printa() aggregation mismatch */
188	D_TRACE_VOID,			/* trace() argument has void type */
189	D_TRACE_DYN,			/* trace() argument has dynamic type */
190	D_TRACEMEM_ADDR,		/* tracemem() address bad type */
191	D_TRACEMEM_SIZE,		/* tracemem() size bad type */
192	D_TRACEMEM_ARGS,		/* tracemem() illegal number of args */
193	D_TRACEMEM_DYNSIZE,		/* tracemem() dynamic size bad type */
194	D_STACK_PROTO,			/* stack() prototype mismatch */
195	D_STACK_SIZE,			/* stack() size argument bad type */
196	D_USTACK_FRAMES,		/* ustack() frames arg bad type */
197	D_USTACK_STRSIZE,		/* ustack() strsize arg bad type */
198	D_USTACK_PROTO,			/* ustack() prototype mismatch */
199	D_LQUANT_BASETYPE,		/* lquantize() bad base type */
200	D_LQUANT_BASEVAL,		/* lquantize() bad base value */
201	D_LQUANT_LIMTYPE,		/* lquantize() bad limit type */
202	D_LQUANT_LIMVAL,		/* lquantize() bad limit value */
203	D_LQUANT_MISMATCH,		/* lquantize() limit < base */
204	D_LQUANT_STEPTYPE,		/* lquantize() bad step type */
205	D_LQUANT_STEPVAL,		/* lquantize() bad step value */
206	D_LQUANT_STEPLARGE,		/* lquantize() step too large */
207	D_LQUANT_STEPSMALL,		/* lquantize() step too small */
208	D_QUANT_PROTO,			/* quantize() prototype mismatch */
209	D_PROC_OFF,			/* byte offset exceeds function size */
210	D_PROC_ALIGN,			/* byte offset has invalid alignment */
211	D_PROC_NAME,			/* invalid process probe name */
212	D_PROC_GRAB,			/* failed to grab process */
213	D_PROC_DYN,			/* process is not dynamically linked */
214	D_PROC_LIB,			/* invalid process library name */
215	D_PROC_FUNC,			/* no such function in process */
216	D_PROC_CREATEFAIL,		/* pid probe creation failed */
217	D_PROC_NODEV,			/* fasttrap device is not installed */
218	D_PROC_BADPID,			/* user probe pid invalid */
219	D_PROC_BADPROV,			/* user probe provider invalid */
220	D_PROC_USDT,			/* problem initializing usdt */
221	D_CLEAR_PROTO,			/* clear() prototype mismatch */
222	D_CLEAR_AGGARG,			/* aggregation arg type mismatch */
223	D_CLEAR_AGGBAD,			/* clear() aggregation not defined */
224	D_NORMALIZE_PROTO,		/* normalize() prototype mismatch */
225	D_NORMALIZE_SCALAR,		/* normalize() value must be scalar */
226	D_NORMALIZE_AGGARG,		/* aggregation arg type mismatch */
227	D_NORMALIZE_AGGBAD,		/* normalize() aggregation not def. */
228	D_TRUNC_PROTO,			/* trunc() prototype mismatch */
229	D_TRUNC_SCALAR,			/* trunc() value must be scalar */
230	D_TRUNC_AGGARG,			/* aggregation arg type mismatch */
231	D_TRUNC_AGGBAD,			/* trunc() aggregation not def. */
232	D_PROV_BADNAME,			/* invalid provider name */
233	D_PROV_INCOMPAT,		/* provider/probe interface mismatch */
234	D_PROV_PRDUP,			/* duplicate probe declaration */
235	D_PROV_PRARGLEN,		/* probe argument list too long */
236	D_PROV_PRXLATOR,		/* probe argument translator missing */
237	D_FREOPEN_INVALID,		/* frename() filename is invalid */
238	D_LQUANT_MATCHBASE,		/* lquantize() mismatch on base */
239	D_LQUANT_MATCHLIM,		/* lquantize() mismatch on limit */
240	D_LQUANT_MATCHSTEP,		/* lquantize() mismatch on step */
241	D_LLQUANT_FACTORTYPE,		/* llquantize() bad magnitude type */
242	D_LLQUANT_FACTORVAL,		/* llquantize() bad magnitude value */
243	D_LLQUANT_FACTORMATCH,		/* llquantize() mismatch on magnitude */
244	D_LLQUANT_LOWTYPE,		/* llquantize() bad low mag type */
245	D_LLQUANT_LOWVAL,		/* llquantize() bad low mag value */
246	D_LLQUANT_LOWMATCH,		/* llquantize() mismatch on low mag */
247	D_LLQUANT_HIGHTYPE,		/* llquantize() bad high mag type */
248	D_LLQUANT_HIGHVAL,		/* llquantize() bad high mag value */
249	D_LLQUANT_HIGHMATCH,		/* llquantize() mismatch on high mag */
250	D_LLQUANT_NSTEPTYPE,		/* llquantize() bad # steps type */
251	D_LLQUANT_NSTEPVAL,		/* llquantize() bad # steps value */
252	D_LLQUANT_NSTEPMATCH,		/* llquantize() mismatch on # steps */
253	D_LLQUANT_MAGRANGE,		/* llquantize() bad magnitude range */
254	D_LLQUANT_FACTORNSTEPS,		/* llquantize() # steps < factor */
255	D_LLQUANT_FACTOREVEN,		/* llquantize() bad # steps/factor */
256	D_LLQUANT_FACTORSMALL,		/* llquantize() magnitude too small */
257	D_LLQUANT_MAGTOOBIG,		/* llquantize() high mag too large */
258	D_PRINTM_ADDR,			/* printm() memref bad type */
259	D_PRINTM_SIZE,			/* printm() size bad type */
260	D_PRINTT_ADDR,			/* printt() typeref bad type */
261	D_PRINTT_SIZE			/* printt() size bad type */
262} dt_errtag_t;
263
264extern const char *dt_errtag(dt_errtag_t);
265
266#ifdef	__cplusplus
267}
268#endif
269
270#endif	/* _DT_ERRTAGS_H */
271