apicompatanamdw/compatanalysercmd/libraryanalyser/inc/la.hpp
author shrivatsa
Mon, 27 Sep 2010 14:51:17 +0530
changeset 20 a0eee409ff14
parent 3 ebe3f8f03b59
permissions -rw-r--r--
Updates to CompatibilityAnalyser - The Tool should now work with Symbian^4 - Some minor bug fixes related to Qt headers in the Symbian Platform
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     1
/*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     2
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     3
* All rights reserved.
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     4
* This component and the accompanying materials are made available
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     6
* which accompanies this distribution, and is available
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     8
*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     9
* Initial Contributors:
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    11
*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    12
* Contributors:
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    13
*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    14
* Description:  Header file of LibraryAnalyser
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    15
*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    16
*/
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    17
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    18
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    19
#ifndef __LA_HPP__
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    20
#define __LA_HPP__
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    21
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    22
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    23
#if (defined(_MSC_VER) && (_MSC_VER < 1400))
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    24
  #error "ERROR: Minimum supported version of Visual C++ is 8.0 (2005)."
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    25
#endif
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    26
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    27
#ifdef _MSC_VER
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    28
  #pragma message("IMPORTANT: You can use Visual C++ to aid development, but please compile the releasable executable with MinGW/MSYS !!!")
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    29
  #pragma warning(disable:4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    30
  #pragma warning(disable:4996) // 'function': was declared deprecated
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    31
  #define _CRT_SECURE_NO_DEPRECATE
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    32
  #ifndef WIN32
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    33
    #error "ERROR: Only Win32 target supported!"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    34
  #endif
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    35
#endif
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    36
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    37
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    38
#include <algorithm>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    39
#include <string>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    40
#include <cctype>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    41
#include <fstream>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    42
#include <iostream>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    43
#include <vector>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    44
#include <sstream>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    45
#include <time.h>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    46
#include <sys/stat.h>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    47
#include <stdio.h>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    48
#include <boost/regex.hpp>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    49
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    50
#ifdef _MSC_VER
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    51
  #include <direct.h>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    52
  #define S_ISDIR(m)  ((m) & S_IFDIR)
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    53
#else
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    54
  #include <dirent.h>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    55
#endif
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    56
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    57
using namespace std;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    58
20
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents: 3
diff changeset
    59
#define LA_VERSION "3.3.3.1"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents: 3
diff changeset
    60
#define LA_DATE "21st June 2010"
0
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    61
#define LA_REPORT_FORMAT_VERSION "1.1"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    62
#define TEMP_FILENAME "la-temp.txt"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    63
#define REPORT_TAB_CHAR '\t'
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    64
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    65
#ifdef WIN32
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    66
  #define DIR_SEPARATOR "\\"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    67
  #define DIR_SEPARATOR2 '\\'
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    68
  #define GCC_NM_EXE "nm.exe"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    69
  #define GCCE_NM_EXE "arm-none-symbianelf-nm.exe"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    70
  #define GCCE_READELF_EXE "arm-none-symbianelf-readelf.exe"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    71
  #define GCCE_CFILT_EXE "arm-none-symbianelf-c++filt.exe"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    72
  #define RVCT_ARMAR_EXE "armar.exe"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    73
  #define RVCT_FROMELF_EXE "fromelf.exe"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    74
  #define CERR_TO_NULL "2>NUL"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    75
  #define DIR_COMMAND "dir /b"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    76
#else
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    77
  #define DIR_SEPARATOR "/"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    78
  #define DIR_SEPARATOR2 '/'
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    79
  #define GCC_NM_EXE "nm"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    80
  #define GCCE_NM_EXE "arm-none-symbianelf-nm"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    81
  #define GCCE_READELF_EXE "arm-none-symbianelf-readelf"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    82
  #define GCCE_CFILT_EXE "arm-none-symbianelf-c++filt"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    83
  #define RVCT_ARMAR_EXE "armar"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    84
  #define RVCT_FROMELF_EXE "fromelf"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    85
  #define CERR_TO_NULL "2>/dev/null"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    86
  #define DIR_COMMAND "ls --format=single-column"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    87
  #define _mkdir(X) mkdir(X, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    88
  #define _rmdir rmdir
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    89
  #define _unlink unlink
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    90
  #define _popen popen
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    91
  #define _pclose pclose
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    92
#endif
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    93
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    94
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    95
enum ReportIssues 
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    96
{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    97
    ISSUE_ONLY_IN_BASELINEDIR = 1,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    98
    ISSUE_ONLY_IN_CURRENTDIR,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    99
    ISSUE_MOVED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   100
    ISSUE_REMOVED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   101
    ISSUE_INSERTED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   102
    ISSUE_MODIFIED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   103
    ISSUE_ADDED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   104
	DLL_TARGET_TYPE_CHANGED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   105
	DLL_UID2_CHANGED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   106
	DLL_UID3_CHANGED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   107
	DLL_SID_CHANGED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   108
  	DLL_CAPABILITY_CHANGED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   109
	DLL_CURRENT_MISSING,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   110
    DLL_BASELINE_MISSING
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   111
};
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   112
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   113
enum TypeOfSeverity
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   114
{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   115
	CONFIRMED_BC_BREAK = 1,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   116
	POSSIBLE_BC_BREAK,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   117
	CONFIRMED_SC_BREAK,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   118
	POSSIBLE_SC_BREAK,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   119
	CONFIRMED_BC_AND_SC_BREAK,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   120
	POSSIBLE_BC_SC_BREAK,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   121
	CONFIRMED_BC_POSSIBLE_SC_BREAK,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   122
	POSSIBLE_BC_CONFIRMED_SC_BREAK,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   123
	BC_INFORMATIVE,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   124
	SC_INFORMATIVE,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   125
	BC_SC_INFORMATIVE,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   126
	NO_BREAK
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   127
};
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   128
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   129
enum ExitStates 
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   130
{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   131
    EXIT_NORMAL = 0,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   132
    EXIT_INVALID_ARGUMENT,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   133
    EXIT_WRONG_USAGE,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   134
    EXIT_BASELINEDIR_NOT_FOUND,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   135
    EXIT_CURRENTDIR_NOT_FOUND,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   136
    EXIT_TOOLCHAIN_NOT_FOUND_FROM_PATH,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   137
    EXIT_PATH_VARIABLE_NOT_FOUND,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   138
    EXIT_TEMP_VARIABLE_NOT_FOUND,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   139
    EXIT_TEMP_DIRECTORY_DOES_NOT_EXIST,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   140
    EXIT_ONLY_SUPPORTED_IN_WIN32,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   141
    EXIT_TOOLCHAIN_NOT_FOUND,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   142
    EXIT_CFILT_NOT_FOUND,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   143
    EXIT_CANNOT_WRITE_TO_TEMP_FILE,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   144
    EXIT_SET_FILE_NOT_FOUND,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   145
    EXIT_CANNOT_OPEN_SET_FILE,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   146
    EXIT_CANNOT_WRITE_TO_REPORT_FILE,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   147
    EXIT_GCC_NOT_SUPPORTED,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   148
	  EXIT_CANNOT_OPEN_FILE,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   149
	  EXIT_BASELINEDLLDIR_NOT_FOUND,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   150
    EXIT_CURRENTDLLDIR_NOT_FOUND
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   151
};
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   152
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   153
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   154
struct ordinal
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   155
{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   156
    unsigned int funcpos;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   157
    string funcname;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   158
    
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   159
    ordinal(unsigned int fp, string fn) 
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   160
    {
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   161
       funcpos = fp;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   162
       funcname = fn;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   163
    }
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   164
};
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   165
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   166
struct issue
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   167
{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   168
    unsigned int i_typeid;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   169
    string i_funcname;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   170
    string i_newfuncname;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   171
    unsigned int i_funcpos;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   172
    unsigned int i_newfuncpos;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   173
	string i_BC_severity;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   174
	string i_SC_severity;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   175
	
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   176
};
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   177
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   178
struct dll_issue
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   179
{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   180
	string l_dllname;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   181
	vector<unsigned int> i_list_typeid;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   182
};
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   183
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   184
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   185
// global variables
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   186
extern bool _cl_use_gcc;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   187
extern bool _cl_use_gcce;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   188
extern bool _cl_use_rvct;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   189
extern bool _cl_use_libs;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   190
extern bool _cl_print_debug;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   191
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   192
extern string _cl_baselinelibdir;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   193
extern string _cl_currentlibdir;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   194
extern string _cl_baselineversion;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   195
extern string _cl_currentversion;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   196
extern string _cl_reportfile;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   197
extern string _cl_toolsdir;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   198
extern string _cl_tempdir;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   199
extern string _cl_cfiltloc;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   200
extern string _cl_set;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   201
extern string _cl_baselinedlldir;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   202
extern string _cl_currentdlldir;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   203
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   204
extern string _gcc_nm_location;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   205
extern string _gcce_nm_location;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   206
extern string _gcce_readelf_location;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   207
extern string _gcce_cfilt_location;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   208
extern string _rvct_armar_location;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   209
extern string _rvct_fromelf_location;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   210
extern string _rvct_cfilt_location;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   211
extern string _tempfile_location;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   212
extern string _lib_extension;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   213
extern string _toolchain_name;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   214
extern string _baselinedllfile;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   215
extern string _currentdllfile;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   216
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   217
extern vector<string> _lib_files_baseline;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   218
extern vector<string> _lib_files_current;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   219
extern vector<string> _lib_dirs_baseline;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   220
extern vector<string> _lib_dirs_current;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   221
extern vector<string> _dll_dirs_baseline;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   222
extern vector<string> _dll_dirs_current;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   223
extern vector<dll_issue> _dll_issuelist;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   224
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   225
#define DLL_ENTRY_SIZE 5
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   226
#define UID1_OFFSET           0x00
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   227
#define UID2_OFFSET           0x04
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   228
#define UID3_OFFSET           0x08
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   229
#define SID_OFFSET            0x80
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   230
#define CAPABILITY_OFFSET     0x88
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   231
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   232
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   233
extern ofstream _reportf; 
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   234
extern struct tm* _timenow;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   235
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   236
// from oc_otherfunc.cpp
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   237
void ParseCommandLineParameters(int argc, char* argv[]);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   238
void ShowCommandLineOptionsAndExit();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   239
void DoInitialChecksAndPreparations();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   240
void GetListsOfImportLibraries();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   241
void FilterListsOfImportLibraries();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   242
void DoPreAnalysisChecks();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   243
void GetToolsPathFromEnvironmentVariable();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   244
void GetTempPathFromEnvironmentVariable();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   245
void GetFileNamesFromDirectory(const vector<string>& directory, const string& filter, vector<string>& resultset);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   246
void DoFinalTasks();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   247
void CreateDllDataFile(string dllDataFile, vector<string>& dllPath, string type);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   248
void GetDllDataFiles();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   249
    
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   250
// from oc_utils.cpp
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   251
void MakeSureTrailingDirectoryMarkerExists(string& path);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   252
bool FileExists(const string& path);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   253
bool DirectoryExists(const string& path);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   254
bool RemoveFile(const string& path);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   255
string LowerCase(const string& s);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   256
string Int2Str(int value);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   257
int Str2Int(const string& s);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   258
void MkDirAll(const string& path);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   259
string& TrimRight(string& s);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   260
string& TrimLeft(string& s);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   261
string& TrimAll(string& s);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   262
int StringICmp(const string& s1, const string& s2);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   263
int StringICmpFileNamesWithoutExtension(const string& s1, const string& s2);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   264
void InsertQuotesToFilePath(string& s);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   265
bool ExecuteCommand(const string& command, vector<string>& resultset);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   266
const string getFilename( const string& path);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   267
vector<string> splitString(const string& str, char separator);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   268
const string getPlatform(const string& path);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   269
string CharToHex(char* buf);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   270
string HexValueAt(fstream& f, const int offset);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   271
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   272
// from oc_getters.cpp
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   273
void GetSymbolTableWithNM(const string& nm_location, const string& lib_directory, vector<string>& symbol_table);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   274
void GetSymbolTableWithReadelf(const string& readelf_location, const string& cfilt_location, const string& lib_directory, vector<string>& symbol_table);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   275
void GetSymbolTableWithArmar(const string& armar_location, const string& cfilt_location, const string& lib_directory, vector<string>& symbol_table);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   276
void GetSymbolTableWithFromelf(const string& fromelf_location, const string& cfilt_location, const string& lib_directory, vector<string>& symbol_table);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   277
void ConvertOrdinalListIntoSymbolTable(const vector<ordinal>& ordinals, vector<string>& symbol_table, const string& lib_path);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   278
void DemangleOrdinalsInSymbolTable(const string& cfilt_location, vector<string>& symbol_table);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   279
bool OrdinalCompare(const ordinal& left, const ordinal& right);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   280
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   281
// from oc_analysis.cpp
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   282
void WriteReportHeader();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   283
void GenerateAndWriteIssueList();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   284
void WriteReportFooter();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   285
void AppendToIssueListCaseMoved(vector<issue>& issueList, const string& funcname, int funcpos, int newfuncpos,TypeOfSeverity severity);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   286
void AppendToIssueListCaseRemoved(vector<issue>& issueList, const string& funcname, int funcpos,TypeOfSeverity severity);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   287
void AppendToIssueListCaseInserted(vector<issue>& issueList, const string& newfuncname, int newfuncpos,TypeOfSeverity severity);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   288
void AppendToIssueListCaseModified(vector<issue>& issueList, const string& funcname, const string& newfuncname, int funcpos,TypeOfSeverity severity);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   289
void AppendToIssueListCaseAdded(vector<issue>& issueList, const string& newfuncname, int newfuncpos,TypeOfSeverity severity);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   290
bool IssueCompare(const issue& left, const issue& right);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   291
void WriteXMLLineOpenClosed(ofstream& f, unsigned int tabstops, const string& element, const string& data);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   292
void WriteXMLLineOpeningTag(ofstream& f, unsigned int tabstops, const string& element);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   293
void WriteXMLLineClosingTag(ofstream& f, unsigned int tabstops, const string& element);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   294
void WriteXMLIssueOnlyInBaselineDir(ofstream& f, const string& libname, dll_issue& dllIssue);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   295
void WriteXMLIssueOnlyInCurrentDir(ofstream& f, const string& libname);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   296
void WriteIssueListToXML(ofstream& f, const string& libname, const string& curlibname,vector<issue>& issue_list, dll_issue& dllIssue);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   297
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   298
// from oc_functionanalysis.cpp
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   299
TypeOfSeverity AreFunctionsCompatible(const string& baselineFunc, const string& currentFunc);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   300
void getSeverityString(TypeOfSeverity severity, string& bc_severity, string& sc_severity);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   301
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   302
//------------------------------------ For executable analysis -------------------------------------------- 
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   303
//file parsing and comparison between baseline and current xml file with executable info
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   304
void ParseAndCompareDLLXmlFiles(const string& abaselineXmlFile,const string& acurrentXmlFile,
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   305
								vector<string> lib_files_baseline);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   306
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   307
//Function to fill Executable issue with name and typeid corresponding to feature breaks ( i.e UID1,UID2,UID3,SID,capability)
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   308
void fillDllIssue ( char* dllMember ,  unsigned int& typeId);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   309
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   310
//Function to initialize struct exe_issue
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   311
void intializeDllIssue(dll_issue& aIssue);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   312
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   313
// Function to parse hex value and change it to decimal value (unsigned long)
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   314
int parseHex(const char* hex);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   315
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   316
// Get DLL break type info in a string depending on type id
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   317
string GetDllBreakTypeInfoString(int typeID);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   318
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   319
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
   320
#endif // __LA_HPP__