analyzetool/commandlineengine/inc/ATCommonDefines.h
branchRCL_3
changeset 59 8ad140f3dd41
parent 49 7fdc9a71d314
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
    20 #define __ATCOMMONDEFINES_H__
    20 #define __ATCOMMONDEFINES_H__
    21 
    21 
    22 #include "../inc/stdafx.h"
    22 #include "../inc/stdafx.h"
    23 
    23 
    24 using namespace std;
    24 using namespace std;
    25 
       
    26 #define MAIN_ID "<AT>"
       
    27 #define ALLOC_ID "ALLOC" // < V.1.6 allocation. // todo remove
       
    28 #define ALLOCH_ID "ALH" // Header of multi message allocation.
       
    29 #define ALLOCF_ID "ALF" // Fragment of multi message allocation.
       
    30 #define REALLOCH_ID "RAH" // Header of multi message reallocation.
       
    31 #define REALLOCF_ID "RAF" // Fragment of multi message reallocation.
       
    32 #define FREE_ID "FREE"
       
    33 #define FREEH_ID "FRH" // Header of multi message free.
       
    34 #define FREEF_ID "FRF" // Fragment of multi message free.
       
    35 #define HANDLE_LEAK_ID "HANDLE_LEAK"
       
    36 
       
    37 const string ERROR_OCCURED = "ERR"; // Error messages.
       
    38 const string INCORRECT_ATOOL_VERSION = "INCORRECT_ATOOL_VERSION";
       
    39 
       
    40 // if changed, change also in analyzetoolfilelog.h
       
    41 enum EMessageType{
       
    42     EFileVersion = 0,
       
    43 	EProcessStart,
       
    44     EProcessEnd,
       
    45     EThreadStart,
       
    46 	EThreadEnd,
       
    47 	EDllLoad,
       
    48 	EDllUnload,
       
    49 	EAllocH,
       
    50 	EAllocF,
       
    51 	EFreeH,
       
    52 	EFreeF,
       
    53 	EReallocH,
       
    54 	EReallocF,
       
    55 	ETestStart,
       
    56 	ETestEnd,
       
    57 	EHandleLeak,
       
    58 	EDeviceInfo,
       
    59 	EError  
       
    60     };
       
    61 
       
    62 /**
       
    63 * Invalid characters in trace file line content.
       
    64 * These will be filtered out before actuall parsing of line.
       
    65 10 = LF
       
    66 13 = CR
       
    67 124 = |
       
    68 */
       
    69 const char cINVALID_TRACE_FILE_CHARS[] = { 10, 13, 124 };
       
    70 
    25 
    71 /**
    26 /**
    72 * Atool return code.
    27 * Atool return code.
    73 */
    28 */
    74 struct AT_RETURN_CODE {
    29 struct AT_RETURN_CODE {
   124 const char AT_TEMP_LST_DIR[] = "atool_temp\\static_lsts\\";
    79 const char AT_TEMP_LST_DIR[] = "atool_temp\\static_lsts\\";
   125 
    80 
   126 // makefile dir is used in atool.cpp to check will we use sbs2 (in analyze and clear)
    81 // makefile dir is used in atool.cpp to check will we use sbs2 (in analyze and clear)
   127 #define RAPTOR_MAKEFILE_DIR "atool_temp\\build"
    82 #define RAPTOR_MAKEFILE_DIR "atool_temp\\build"
   128 
    83 
   129 //part of user defined filename to be replaced by process name
       
   130 const string AT_PROCESSNAME_TAG = "%processname%";
       
   131 
       
   132 // Atool version number and date
    84 // Atool version number and date
   133 #define ATOOL_VERSION "1.10.0" // NOTE! This version number is written also to temporary cpp file.
    85 #define ATOOL_VERSION "1.9.1" // NOTE! This version number is written also to temporary cpp file.
   134 #define ATOOL_DATE "2nd July 2010"
    86 #define ATOOL_DATE "29th April 2010"
   135 
    87 
   136 // Default/min/max call stack sizes
    88 // Default/min/max call stack sizes
   137 const int AT_ALLOC_CALL_STACK_SIZE_DEFAULT = 40;
    89 const int AT_ALLOC_CALL_STACK_SIZE_DEFAULT = 40;
   138 const int AT_FREE_CALL_STACK_SIZE_DEFAULT = 0;
    90 const int AT_FREE_CALL_STACK_SIZE_DEFAULT = 0;
   139 const int AT_CALL_STACK_SIZE_MIN = 0;
    91 const int AT_CALL_STACK_SIZE_MIN = 0;
   142 // What version of data file contains timestamps in dll's.
    94 // What version of data file contains timestamps in dll's.
   143 const int AT_DLL_TIMESTAMP_DATA_VERSION = 2;
    95 const int AT_DLL_TIMESTAMP_DATA_VERSION = 2;
   144 
    96 
   145 // Constant compatibility string in temporary cpp.
    97 // Constant compatibility string in temporary cpp.
   146 // Api version ; current version.
    98 // Api version ; current version.
   147 #define ATOOL_COMPATIBILITY_STRING "1.7.6;1.10.0"
    99 #define ATOOL_COMPATIBILITY_STRING "1.7.5;1.9.1"
   148 
   100 
   149 // Datafile version
   101 // Datafile version
   150 #define AT_DATA_FILE_VERSION "DATA_FILE_VERSION 12"
   102 #define AT_DATA_FILE_VERSION "DATA_FILE_VERSION 11"
   151 
   103 
   152 // Latest dbghelp.dll version
   104 // Latest dbghelp.dll version
   153 const int DBGHELP_VERSION_MAJ = 6;
   105 const int DBGHELP_VERSION_MAJ = 6;
   154 const int DBGHELP_VERSION_MIN = 3;
   106 const int DBGHELP_VERSION_MIN = 3;
   155 const int DBGHELP_VERSION_BUILD = 0;
   107 const int DBGHELP_VERSION_BUILD = 0;
   161 const string AT_BUILD_SUMMARY_HEADER = "\n###  AnalyzeTool  ###\n### Build Summary ###\n\n";
   113 const string AT_BUILD_SUMMARY_HEADER = "\n###  AnalyzeTool  ###\n### Build Summary ###\n\n";
   162 const string AT_BUILD_SUMMARY_INSTRUMENTED_BUILD_COMPLETE = "Instrumented build complete: ";
   114 const string AT_BUILD_SUMMARY_INSTRUMENTED_BUILD_COMPLETE = "Instrumented build complete: ";
   163 const string AT_BUILD_SUMMARY_TARGET = "\tTarget: ";
   115 const string AT_BUILD_SUMMARY_TARGET = "\tTarget: ";
   164 const string AT_BUILD_SUMMARY_FAILED = "Build failed: ";
   116 const string AT_BUILD_SUMMARY_FAILED = "Build failed: ";
   165 const string AT_BUILD_SUMMARY_ERRORS = "\tErrors: ";
   117 const string AT_BUILD_SUMMARY_ERRORS = "\tErrors: ";
   166 const string AT_BUILD_SUMMARY_DATA_FILE_NAME = "\tLog file name: ";
   118 const string AT_BUILD_SUMMARY_DATA_FILE_NAME = "\tInternal data gathering filename: ";
   167 const string AT_BUILD_SUMMARY_DATA_FILE_PATH = "\tLog file path: ";
       
   168 const string AT_BUILD_SUMMARY_NORMAL_BUILD_COMPLETE = "Normal build complete: ";
   119 const string AT_BUILD_SUMMARY_NORMAL_BUILD_COMPLETE = "Normal build complete: ";
   169 const string AT_BUILD_SUMMARY_STATIC_LIBRARY = "\tModule is static library.";
   120 const string AT_BUILD_SUMMARY_STATIC_LIBRARY = "\tModule is static library.";
   170 const string AT_BUILD_SUMMARY_UNSUPPORTED_TARGET_TYPE = "\tModule has unsupported target type.";
   121 const string AT_BUILD_SUMMARY_UNSUPPORTED_TARGET_TYPE = "\tModule has unsupported target type.";
   171 const string AT_BUILD_SUMMARY_UNSUPPORTED_COMPILE_DEFINITION = "\tModule defined unsupported compile definition.";
   122 const string AT_BUILD_SUMMARY_UNSUPPORTED_COMPILE_DEFINITION = "\tModule defined unsupported compile definition.";
   172 const string AT_BUILD_SUMMARY_BUILD_TYPE = "Build type: ";
   123 const string AT_BUILD_SUMMARY_BUILD_TYPE = "Build type: ";
   174 const string AT_BUILD_SUMMARY_BUILD_PLATFORM = "Build platform: ";
   125 const string AT_BUILD_SUMMARY_BUILD_PLATFORM = "Build platform: ";
   175 const string AT_BUILD_SUMMARY_BUILD_VARIANT = "Build variant: ";
   126 const string AT_BUILD_SUMMARY_BUILD_VARIANT = "Build variant: ";
   176 const string AT_BUILD_SUMMARY_LOGGING_MODE = "Data gathering mode: ";
   127 const string AT_BUILD_SUMMARY_LOGGING_MODE = "Data gathering mode: ";
   177 const string AT_BUILD_SUMMARY_ALLOC_CALL_STACK_SIZE = "Allocation call stack size: ";
   128 const string AT_BUILD_SUMMARY_ALLOC_CALL_STACK_SIZE = "Allocation call stack size: ";
   178 const string AT_BUILD_SUMMARY_FREE_CALL_STACK_SIZE = "Free call stack size: ";
   129 const string AT_BUILD_SUMMARY_FREE_CALL_STACK_SIZE = "Free call stack size: ";
   179 const string AT_BUILD_SUMMARY_FILE = "log to file";
   130 const string AT_BUILD_SUMMARY_FILE = "monitored internal";
   180 const string AT_BUILD_SUMMARY_TRACE = "monitored external";
   131 const string AT_BUILD_SUMMARY_TRACE = "monitored external";
   181 const string AT_BUILD_SUMMARY_TRACE_FAST = "output to trace";
   132 const string AT_BUILD_SUMMARY_TRACE_FAST = "external";
   182 
   133 
   183 const string AT_UNSUPPORTED_TARGET_TYPE = "\tModule has unsupported target type.";
   134 const string AT_UNSUPPORTED_TARGET_TYPE = "\tModule has unsupported target type.";
   184 const string AT_UNSUPPORTED_COMPILE_DEFINITION = "\tModule defined unsupported compile definition.";
   135 const string AT_UNSUPPORTED_COMPILE_DEFINITION = "\tModule defined unsupported compile definition.";
   185 
   136 
   186 // List of locations under epocroot where analyzetool.h can be found.
   137 // List of locations under epocroot where analyzetool.h can be found.
   351 	"//*** AnalyzeTool changes end ***"
   302 	"//*** AnalyzeTool changes end ***"
   352 };
   303 };
   353 
   304 
   354 // Trace file constants definitions
   305 // Trace file constants definitions
   355 #define LABEL_DATA_FILE_VERSION "DATA_FILE_VERSION"
   306 #define LABEL_DATA_FILE_VERSION "DATA_FILE_VERSION"
   356 #define LABEL_PROCESS_START     "PCS"
   307 #define LABEL_PROCESS_START     "PROCESS_START"
   357 #define LABEL_DLL_LOAD          "DLL"
   308 #define LABEL_DLL_LOAD          "DLL_LOAD"
   358 #define LABEL_DLL_UNLOAD		"DLU"
   309 #define LABEL_DLL_UNLOAD		"DLL_UNLOAD"
   359 #define LABEL_MEM_LEAK          "MEM_LEAK"
   310 #define LABEL_MEM_LEAK          "MEM_LEAK"
   360 #define LABEL_PROCESS_END       "PCE"
   311 #define LABEL_PROCESS_END       "PROCESS_END"
   361 #define LABEL_ERROR_OCCURED     "ERR"
   312 #define LABEL_ERROR_OCCURED     "ERROR_OCCURED"
   362 #define LABEL_HANDLE_LEAK       "HDL"
   313 #define LABEL_HANDLE_LEAK       "HANDLE_LEAK"
   363 #define LABEL_TEST_START        "TSS"
   314 #define LABEL_TEST_START        "TEST_START"
   364 #define LABEL_TEST_END          "TSE"
   315 #define LABEL_TEST_END          "TEST_END"
   365 #define LABEL_THREAD_START		"TDS"
       
   366 #define LABEL_THREAD_END		"TDE"
       
   367 #define LABEL_DEVICE_INFO		"DEVINFO"
       
   368 #define LABEL_LOGGING_CANCELLED "LOGGING_CANCELLED"
   316 #define LABEL_LOGGING_CANCELLED "LOGGING_CANCELLED"
   369 
       
   370 
   317 
   371 // AddressToLine related constants
   318 // AddressToLine related constants
   372 
   319 
   373 #define LABEL_ABNORMAL "ABNORMAL"
   320 #define LABEL_ABNORMAL "ABNORMAL"
   374 const int FUNCTIONS_OFFSET_IN_MAP_FILE_ARMV5 = 0x8000;
   321 const int FUNCTIONS_OFFSET_IN_MAP_FILE_ARMV5 = 0x8000;
   522 */
   469 */
   523 struct ARGUMENTS_HOOK
   470 struct ARGUMENTS_HOOK
   524 {
   471 {
   525 	bool bNoBuild; /** Only intrument project? (no build) */ 
   472 	bool bNoBuild; /** Only intrument project? (no build) */ 
   526 	bool bDataFileName; /** Is internal data gathering filename defined */
   473 	bool bDataFileName; /** Is internal data gathering filename defined */
   527 	bool bDataFilePath; /** Is internal data gathering file path defined */
       
   528 	bool bAbldTest; /** Is build only for test modules (abld test build.. */
   474 	bool bAbldTest; /** Is build only for test modules (abld test build.. */
   529 	string sDataFileName; /** Internal data gathering filename */
   475 	string sDataFileName; /** Internal data gathering filename */
   530 	string sDataFilePath; /** Path to internal data gathering file */
       
   531 	int iBuildSystem; /** 1 = sbs, 2 = raptor */
   476 	int iBuildSystem; /** 1 = sbs, 2 = raptor */
   532 	int iLoggingMode; /** Just for old parameter parsing. 1=trace, 2=file, 0=? */
   477 	int iLoggingMode; /** Just for old parameter parsing. 1=trace, 2=file, 0=? */
   533 	int iAllocCallStackSize; /** Call stack size when memory allocated */
   478 	int iAllocCallStackSize; /** Call stack size when memory allocated */
   534 	int iFreeCallStackSize; /** Call stack size when memory freed */
   479 	int iFreeCallStackSize; /** Call stack size when memory freed */
   535 	string sBuildCmd; /** Original build command / user defined or given */
   480 	string sBuildCmd; /** Original build command / user defined or given */
   544 	ARGUMENTS_HOOK()
   489 	ARGUMENTS_HOOK()
   545 	{
   490 	{
   546 		bNoBuild = false;
   491 		bNoBuild = false;
   547 		bAbldTest = false;
   492 		bAbldTest = false;
   548 		bDataFileName = false;
   493 		bDataFileName = false;
   549 		bDataFilePath = false;
       
   550 		sDataFileName = "";
   494 		sDataFileName = "";
   551 		sDataFilePath = "";
       
   552 		iBuildSystem = 0;
   495 		iBuildSystem = 0;
   553 		iLoggingMode = 0;
   496 		iLoggingMode = 0;
   554 		iAllocCallStackSize = AT_ALLOC_CALL_STACK_SIZE_DEFAULT;
   497 		iAllocCallStackSize = AT_ALLOC_CALL_STACK_SIZE_DEFAULT;
   555 		iFreeCallStackSize = AT_FREE_CALL_STACK_SIZE_DEFAULT;
   498 		iFreeCallStackSize = AT_FREE_CALL_STACK_SIZE_DEFAULT;
   556 		sBuildCmd = "";
   499 		sBuildCmd = "";