imgtools/romtools/rombuild/symbolgenerator.h
changeset 600 6d08f4a05d93
child 654 7c11c3d8d025
equal deleted inserted replaced
599:fa7a3cc6effd 600:6d08f4a05d93
       
     1 #ifndef __SYMBOLSCREATER_H__
       
     2 #define __SYMBOLSCREATER_H__
       
     3 #include <queue>
       
     4 #include <string>
       
     5 #include <fstream>
       
     6 #include <vector>
       
     7 #include <map>
       
     8 
       
     9 using namespace std;
       
    10 
       
    11 #include <boost/thread/thread.hpp>
       
    12 #include <boost/thread/condition.hpp>
       
    13 
       
    14 struct SymGenContext {
       
    15 	const char* iFileName ;
       
    16 	TUint32	iTotalSize ;
       
    17 	TUint32 iCodeAddress; 
       
    18 	TUint32 iDataAddress; 
       
    19 	TUint32 iDataBssLinearBase;	 
       
    20 	TInt iTextSize; 
       
    21 	TInt iDataSize; 
       
    22 	TInt iBssSize;   	
       
    23 	TInt iTotalDataSize;
       
    24 	TBool iExecutable ;
       
    25 };
       
    26 
       
    27 class SymbolGenerator  {  
       
    28 public :
       
    29 		SymbolGenerator(const char* aSymbolFileName, int aMultiThreadsCount = 1);
       
    30 		~SymbolGenerator();		
       
    31 		void AddEntry(const SymGenContext& aEntry); 
       
    32 		void WaitThreads();
       
    33 private :
       
    34 		SymbolGenerator();
       
    35 		SymbolGenerator& operator = (const SymbolGenerator& aRight);
       
    36 		static void ThreadFunc(SymbolGenerator* aInst); 
       
    37 		bool ProcessEntry(const SymGenContext& aContext);
       
    38 		bool ProcessARMV5Map(ifstream& aStream, const SymGenContext& aContext);
       
    39 		bool ProcessGCCMap(ifstream& aStream, const SymGenContext& aContext);
       
    40 		bool ProcessX86Map(ifstream& aStream, const SymGenContext& aContext);
       
    41 		ofstream iOutput ; 
       
    42 		boost::thread_group iThreads ;
       
    43 		boost::condition_variable iCond;
       
    44 		boost::mutex iQueueMutex;
       
    45 		boost::mutex iFileMutex ;
       
    46 		queue<SymGenContext> iEntries ;	
       
    47 		vector<char*> iErrMsgs ;
       
    48 	
       
    49 };
       
    50 
       
    51 #endif //__ROMSYMBOLGENERATOR_H__