41
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
* Error codes for TraceCompiler
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
package com.nokia.tracecompiler.engine;
|
|
20 |
|
|
21 |
import com.nokia.tracecompiler.model.TraceCompilerErrorParameters;
|
|
22 |
import com.nokia.tracecompiler.model.TraceCompilerException.TraceCompilerExceptionCode;
|
|
23 |
|
|
24 |
/**
|
|
25 |
* Error codes for TraceCompiler
|
|
26 |
*
|
|
27 |
*/
|
|
28 |
public interface TraceCompilerEngineErrorCodes {
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Error parameters for a file-related errors
|
|
32 |
*/
|
|
33 |
public class FileErrorParameters extends TraceCompilerErrorParameters {
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Path to the file
|
|
37 |
*/
|
|
38 |
public String file;
|
|
39 |
|
|
40 |
}
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Error parameters for errors related to names, titles etc.
|
|
44 |
*/
|
|
45 |
public class StringErrorParameters extends TraceCompilerErrorParameters {
|
|
46 |
|
|
47 |
/**
|
|
48 |
* String
|
|
49 |
*/
|
|
50 |
public String string;
|
|
51 |
|
|
52 |
}
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Error parameters for integer values that must be between two values
|
|
56 |
*/
|
|
57 |
public class RangeErrorParameters extends TraceCompilerErrorParameters {
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Start of range
|
|
61 |
*/
|
|
62 |
public int start;
|
|
63 |
|
|
64 |
/**
|
|
65 |
* End of range
|
|
66 |
*/
|
|
67 |
public int end;
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Hex / decimal flag
|
|
71 |
*/
|
|
72 |
public boolean isHex;
|
|
73 |
|
|
74 |
}
|
|
75 |
|
|
76 |
/**
|
|
77 |
* Error codes for TraceCompiler
|
|
78 |
*/
|
|
79 |
public enum TraceCompilerErrorCode implements TraceCompilerExceptionCode {
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Success
|
|
83 |
*/
|
|
84 |
OK,
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Trace ID was duplicate
|
|
88 |
*/
|
|
89 |
DUPLICATE_TRACE_ID,
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Group ID was duplicate
|
|
93 |
*/
|
|
94 |
DUPLICATE_GROUP_ID,
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Trace name was duplicate
|
|
98 |
*/
|
|
99 |
DUPLICATE_TRACE_NAME,
|
|
100 |
|
|
101 |
/**
|
|
102 |
* Trace name was duplicate
|
|
103 |
*/
|
|
104 |
DUPLICATE_GROUP_NAME,
|
|
105 |
|
|
106 |
/**
|
|
107 |
* Trace ID was not valid. Parameters for this error are either
|
|
108 |
* RangeErrorParameters or null (no range)
|
|
109 |
*/
|
|
110 |
INVALID_TRACE_ID,
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Group ID was not valid. Parameters for this error are either
|
|
114 |
* RangeErrorParameters or null (no range)
|
|
115 |
*/
|
|
116 |
INVALID_GROUP_ID,
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Name was not valid
|
|
120 |
*/
|
|
121 |
INVALID_TRACE_NAME,
|
|
122 |
|
|
123 |
/**
|
|
124 |
* Name was not valid
|
|
125 |
*/
|
|
126 |
INVALID_GROUP_NAME,
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Trace string was not valid
|
|
130 |
*/
|
|
131 |
INVALID_TRACE_DATA,
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Cannot edit source file
|
|
135 |
*/
|
|
136 |
SOURCE_NOT_EDITABLE,
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Source location was not valid
|
|
140 |
*/
|
|
141 |
INVALID_SOURCE_LOCATION,
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Unreachable trace location
|
|
145 |
*/
|
|
146 |
UNREACHABLE_TRACE_LOCATION,
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Tried to perform group operation when group was not selected
|
|
150 |
*/
|
|
151 |
GROUP_NOT_SELECTED,
|
|
152 |
|
|
153 |
/**
|
|
154 |
* Tried to perform trace operation when trace was not selected
|
|
155 |
*/
|
|
156 |
TRACE_NOT_SELECTED,
|
|
157 |
|
|
158 |
/**
|
|
159 |
* Not enough parameters in trace
|
|
160 |
*/
|
|
161 |
NOT_ENOUGH_PARAMETERS,
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Unexpected exception occurred
|
|
165 |
*/
|
|
166 |
UNEXPECTED_EXCEPTION,
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Trace model is not ready
|
|
170 |
*/
|
|
171 |
MODEL_NOT_READY,
|
|
172 |
|
|
173 |
/**
|
|
174 |
* No trace groups
|
|
175 |
*/
|
|
176 |
NO_TRACE_GROUPS,
|
|
177 |
|
|
178 |
/**
|
|
179 |
* Parameter name is not valid
|
|
180 |
*/
|
|
181 |
INVALID_PARAMETER_NAME,
|
|
182 |
|
|
183 |
/**
|
|
184 |
* Model properties are not valid
|
|
185 |
*/
|
|
186 |
INVALID_MODEL_PROPERTIES_FOR_EXPORT,
|
|
187 |
|
|
188 |
/**
|
|
189 |
* Model name is not valid
|
|
190 |
*/
|
|
191 |
INVALID_MODEL_NAME,
|
|
192 |
|
|
193 |
/**
|
|
194 |
* Trace project file cannot be parsed
|
|
195 |
*/
|
|
196 |
INVALID_PROJECT_FILE,
|
|
197 |
|
|
198 |
/**
|
|
199 |
* File was not found. This error is related to FileErrorParameters
|
|
200 |
* class
|
|
201 |
*/
|
|
202 |
FILE_NOT_FOUND,
|
|
203 |
|
|
204 |
/**
|
|
205 |
* Path was not valid. This is related to FileErrorParameters class
|
|
206 |
*/
|
|
207 |
INVALID_PATH,
|
|
208 |
|
|
209 |
/**
|
|
210 |
* Constant value was duplicate
|
|
211 |
*/
|
|
212 |
DUPLICATE_CONSTANT_VALUE,
|
|
213 |
|
|
214 |
/**
|
|
215 |
* Constant name was already in use
|
|
216 |
*/
|
|
217 |
DUPLICATE_CONSTANT_TABLE_NAME,
|
|
218 |
|
|
219 |
/**
|
|
220 |
* Constant table name was not valid
|
|
221 |
*/
|
|
222 |
INVALID_CONSTANT_TABLE_NAME,
|
|
223 |
|
|
224 |
/**
|
|
225 |
* Constant table not part of project
|
|
226 |
*/
|
|
227 |
CONSTANT_TABLE_NOT_PART_OF_PROJECT,
|
|
228 |
|
|
229 |
/**
|
|
230 |
* Constant ID was already in use
|
|
231 |
*/
|
|
232 |
DUPLICATE_CONSTANT_ID,
|
|
233 |
|
|
234 |
/**
|
|
235 |
* Constant value was not valid
|
|
236 |
*/
|
|
237 |
INVALID_CONSTANT_VALUE,
|
|
238 |
|
|
239 |
/**
|
|
240 |
* Parameter name was already in use
|
|
241 |
*/
|
|
242 |
DUPLICATE_PARAMETER_NAME,
|
|
243 |
|
|
244 |
/**
|
|
245 |
* Parameter type was not supported
|
|
246 |
*/
|
|
247 |
INVALID_PARAMETER_TYPE,
|
|
248 |
|
|
249 |
/**
|
|
250 |
* Parameters cannot be added
|
|
251 |
*/
|
|
252 |
PARAMETER_ADD_NOT_ALLOWED,
|
|
253 |
|
|
254 |
/**
|
|
255 |
* Parameters cannot be removed
|
|
256 |
*/
|
|
257 |
PARAMETER_REMOVE_NOT_ALLOWED,
|
|
258 |
|
|
259 |
/**
|
|
260 |
* Parameter name was empty. This is generated when automatically adding
|
|
261 |
* function parameters to new trace and a parameter does not have a name
|
|
262 |
* in the declaration.
|
|
263 |
*/
|
|
264 |
EMPTY_PARAMETER_NAME,
|
|
265 |
|
|
266 |
/**
|
|
267 |
* Parameter template was already used by another parameter
|
|
268 |
*/
|
|
269 |
PARAMETER_TEMPLATE_ALREADY_IN_USE,
|
|
270 |
|
|
271 |
/**
|
|
272 |
* Tried to remove trace location when one was not selected
|
|
273 |
*/
|
|
274 |
LOCATION_NOT_SELECTED,
|
|
275 |
|
|
276 |
/**
|
|
277 |
* Cannot add a constant, since constant table was not selected
|
|
278 |
*/
|
|
279 |
CONSTANT_TABLE_NOT_SELECTED,
|
|
280 |
|
|
281 |
/**
|
|
282 |
* The selected object was not valid target for delete operation
|
|
283 |
*/
|
|
284 |
CANNOT_DELETE_SELECTED_OBJECT,
|
|
285 |
|
|
286 |
/**
|
|
287 |
* Trace text format is not valid
|
|
288 |
*/
|
|
289 |
INVALID_TRACE_TEXT_FORMAT,
|
|
290 |
|
|
291 |
/**
|
|
292 |
* Trace name format is not valid
|
|
293 |
*/
|
|
294 |
INVALID_TRACE_NAME_FORMAT,
|
|
295 |
|
|
296 |
/**
|
|
297 |
* Missing function name from trace name format
|
|
298 |
*/
|
|
299 |
TRACE_NAME_FORMAT_MISSING_FUNCTION,
|
|
300 |
|
|
301 |
/**
|
|
302 |
* No traces to delete
|
|
303 |
*/
|
|
304 |
NO_TRACES_TO_DELETE,
|
|
305 |
|
|
306 |
/**
|
|
307 |
* Source file is not open
|
|
308 |
*/
|
|
309 |
SOURCE_NOT_OPEN,
|
|
310 |
|
|
311 |
/**
|
|
312 |
* Failed to parse a constant table from source
|
|
313 |
*/
|
|
314 |
CONSTANT_TABLE_PARSE_FAILED,
|
|
315 |
|
|
316 |
/**
|
|
317 |
* Cannot open project file
|
|
318 |
*/
|
|
319 |
CANNOT_OPEN_PROJECT_FILE,
|
|
320 |
|
|
321 |
/**
|
|
322 |
* Cannot write project file
|
|
323 |
*/
|
|
324 |
CANNOT_WRITE_PROJECT_FILE,
|
|
325 |
|
|
326 |
/**
|
|
327 |
* Parameter ID was already in use
|
|
328 |
*/
|
|
329 |
DUPLICATE_PARAMETER_ID,
|
|
330 |
|
|
331 |
/**
|
|
332 |
* Constant table ID was already in use
|
|
333 |
*/
|
|
334 |
DUPLICATE_CONSTANT_TABLE_ID,
|
|
335 |
|
|
336 |
/**
|
|
337 |
* Instrumenter function list was empty
|
|
338 |
*/
|
|
339 |
NO_FUNCTIONS_TO_INSTRUMENT,
|
|
340 |
|
|
341 |
/**
|
|
342 |
* Instrumenter function list was empty. Related to
|
|
343 |
* StringErrorParameters
|
|
344 |
*/
|
|
345 |
NO_FUNCTIONS_TO_INSTRUMENT_WITH_TEMPLATE,
|
|
346 |
|
|
347 |
/**
|
|
348 |
* Multiple errors during an operation
|
|
349 |
*/
|
|
350 |
MULTIPLE_ERRORS_IN_OPERATION,
|
|
351 |
|
|
352 |
/**
|
|
353 |
* Printf parameter parameter format specification did not match the
|
|
354 |
* parameter count
|
|
355 |
*/
|
|
356 |
PARAMETER_FORMAT_MISMATCH,
|
|
357 |
|
|
358 |
/**
|
|
359 |
* A trace does not exist
|
|
360 |
*/
|
|
361 |
TRACE_DOES_NOT_EXIST,
|
|
362 |
|
|
363 |
/**
|
|
364 |
* Trace needs to be converted to correct API
|
|
365 |
*/
|
|
366 |
TRACE_NEEDS_CONVERSION,
|
|
367 |
|
|
368 |
/**
|
|
369 |
* Parameter count of location and trace do not match
|
|
370 |
*/
|
|
371 |
PARAMETER_COUNT_MISMATCH,
|
|
372 |
|
|
373 |
/**
|
|
374 |
* Parameter count in location does not match the API macro
|
|
375 |
*/
|
|
376 |
PARAMETER_COUNT_DOES_NOT_MATCH_API,
|
|
377 |
|
|
378 |
/**
|
|
379 |
* Location parser failed
|
|
380 |
*/
|
|
381 |
LOCATION_PARSER_FAILED,
|
|
382 |
|
|
383 |
/**
|
|
384 |
* Trace is not referenced from source files
|
|
385 |
*/
|
|
386 |
TRACE_HAS_NO_LOCATIONS,
|
|
387 |
|
|
388 |
/**
|
|
389 |
* Trace is used from multiple locations in source files
|
|
390 |
*/
|
|
391 |
TRACE_HAS_MULTIPLE_LOCATIONS,
|
|
392 |
|
|
393 |
/**
|
|
394 |
* Project was empty when export was called
|
|
395 |
*/
|
|
396 |
NO_TRACES_TO_EXPORT,
|
|
397 |
|
|
398 |
/**
|
|
399 |
* Source file cannot be opened
|
|
400 |
*/
|
|
401 |
CANNOT_OPEN_SOURCE_FILE,
|
|
402 |
|
|
403 |
/**
|
|
404 |
* Trace in source cannot be updated
|
|
405 |
*/
|
|
406 |
CANNOT_UPDATE_TRACE_INTO_SOURCE,
|
|
407 |
|
|
408 |
/**
|
|
409 |
* Parameter format is not supported
|
|
410 |
*/
|
|
411 |
PARAMETER_FORMAT_NOT_SUPPORTED,
|
|
412 |
|
|
413 |
/**
|
|
414 |
* Parameter format is not supported by default macros
|
|
415 |
*/
|
|
416 |
PARAMETER_FORMAT_NEEDS_EXT_MACRO,
|
|
417 |
|
|
418 |
/**
|
|
419 |
* Ext macro usage is not necessary with
|
|
420 |
*/
|
|
421 |
PARAMETER_FORMAT_UNNECESSARY_EXT_MACRO,
|
|
422 |
|
|
423 |
/**
|
|
424 |
* Parameter format cannot be used as an array
|
|
425 |
*/
|
|
426 |
PARAMETER_FORMAT_NOT_SUPPORTED_IN_ARRAY,
|
|
427 |
|
|
428 |
/**
|
|
429 |
* Property file element was unknown
|
|
430 |
*/
|
|
431 |
PROPERTY_FILE_ELEMENT_NOT_SUPPORTED,
|
|
432 |
|
|
433 |
/**
|
|
434 |
* Property file element was in wrong place
|
|
435 |
*/
|
|
436 |
PROPERTY_FILE_ELEMENT_MISPLACED,
|
|
437 |
|
|
438 |
/**
|
|
439 |
* Property file attribute was not valid
|
|
440 |
*/
|
|
441 |
PROPERTY_FILE_ATTRIBUTE_INVALID,
|
|
442 |
|
|
443 |
/**
|
|
444 |
* Inserting a trace into source will produce incorrect results
|
|
445 |
*/
|
|
446 |
INSERT_TRACE_DOES_NOT_WORK,
|
|
447 |
|
|
448 |
/**
|
|
449 |
* Trace found from source is not in valid source context
|
|
450 |
*/
|
|
451 |
NO_CONTEXT_FOR_LOCATION,
|
|
452 |
|
|
453 |
/**
|
|
454 |
* Function parameters could not be parsed
|
|
455 |
*/
|
|
456 |
CANNOT_PARSE_FUNCTION_PARAMETERS,
|
|
457 |
|
|
458 |
/**
|
|
459 |
* Parameter name is not valid exit trace return parameter name
|
|
460 |
*/
|
|
461 |
INVALID_PARAMETER_NAME_IN_RETURN_VALUE,
|
|
462 |
|
|
463 |
/**
|
|
464 |
* Run out of Group IDs
|
|
465 |
*/
|
|
466 |
RUN_OUT_OF_GROUP_IDS,
|
|
467 |
|
|
468 |
/**
|
|
469 |
* Run out of Trace IDs
|
|
470 |
*/
|
|
471 |
RUN_OUT_OF_TRACE_IDS,
|
|
472 |
|
|
473 |
/**
|
|
474 |
* Cannot add function parameters if there is var arg list
|
|
475 |
*/
|
|
476 |
VAR_ARG_LIST_PARAMETER_FOUND,
|
|
477 |
|
|
478 |
/**
|
|
479 |
* TRACE_STATE group name was used in non state trace
|
|
480 |
*/
|
|
481 |
INVALID_USAGE_OF_TRACE_STATE_GROUP_NAME,
|
|
482 |
|
|
483 |
/**
|
|
484 |
* TRACE_PERFORMANCE group name was used in non performance trace
|
|
485 |
*/
|
|
486 |
INVALID_USAGE_OF_TRACE_PERFORMACE_GROUP_NAME
|
|
487 |
}
|
|
488 |
|
|
489 |
}
|