equal
deleted
inserted
replaced
|
1 #ifndef __SYMBOLGENERATOR_H__ |
|
2 #define __SYMBOLGENERATOR_H__ |
|
3 #include <queue> |
|
4 #include <string> |
|
5 #include <fstream> |
|
6 using namespace std; |
|
7 #include <boost/thread/thread.hpp> |
|
8 #include <boost/thread/condition.hpp> |
|
9 |
|
10 |
|
11 struct TPlacedEntry{ |
|
12 string iFileName; |
|
13 bool iExecutable; |
|
14 TPlacedEntry(const string& aName, bool aExecutable) { |
|
15 iFileName = aName; |
|
16 iExecutable = aExecutable; |
|
17 } |
|
18 }; |
|
19 class SymbolGenerator : public boost::thread { |
|
20 public: |
|
21 static SymbolGenerator* GetInstance(); |
|
22 static void Release(); |
|
23 void SetSymbolFileName( const string& fileName ); |
|
24 void AddFile( const string& fileName, bool isExecutable ); |
|
25 private: |
|
26 SymbolGenerator(); |
|
27 ~SymbolGenerator(); |
|
28 void ProcessExecutable( const string& fileName ); |
|
29 void ProcessDatafile( const string& fileName ); |
|
30 void ProcessArmv5File( const string& fileName, ifstream& aMap ); |
|
31 void ProcessGcceOrArm4File( const string& fileName, ifstream& aMap ); |
|
32 int GetSizeFromBinFile( const string& fileName ); |
|
33 static void thrd_func(); |
|
34 |
|
35 queue<TPlacedEntry> iQueueFiles; |
|
36 boost::mutex iMutex; |
|
37 static boost::mutex iMutexSingleton; |
|
38 static SymbolGenerator* iInst; |
|
39 boost::condition_variable iCond; |
|
40 |
|
41 ofstream iSymFile; |
|
42 }; |
|
43 #endif |