655
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 the License "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 |
*/
|
|
17 |
|
600
|
18 |
#ifndef __SYMBOLGENERATOR_H__
|
|
19 |
#define __SYMBOLGENERATOR_H__
|
|
20 |
#include <queue>
|
|
21 |
#include <string>
|
|
22 |
#include <fstream>
|
|
23 |
using namespace std;
|
|
24 |
#include <boost/thread/thread.hpp>
|
|
25 |
#include <boost/thread/condition.hpp>
|
|
26 |
|
|
27 |
|
|
28 |
struct TPlacedEntry{
|
|
29 |
string iFileName;
|
|
30 |
bool iExecutable;
|
|
31 |
TPlacedEntry(const string& aName, bool aExecutable) {
|
|
32 |
iFileName = aName;
|
|
33 |
iExecutable = aExecutable;
|
|
34 |
}
|
|
35 |
};
|
|
36 |
class SymbolGenerator : public boost::thread {
|
|
37 |
public:
|
|
38 |
static SymbolGenerator* GetInstance();
|
|
39 |
static void Release();
|
|
40 |
void SetSymbolFileName( const string& fileName );
|
|
41 |
void AddFile( const string& fileName, bool isExecutable );
|
|
42 |
private:
|
|
43 |
SymbolGenerator();
|
|
44 |
~SymbolGenerator();
|
|
45 |
void ProcessExecutable( const string& fileName );
|
|
46 |
void ProcessDatafile( const string& fileName );
|
|
47 |
void ProcessArmv5File( const string& fileName, ifstream& aMap );
|
|
48 |
void ProcessGcceOrArm4File( const string& fileName, ifstream& aMap );
|
|
49 |
int GetSizeFromBinFile( const string& fileName );
|
|
50 |
static void thrd_func();
|
|
51 |
|
|
52 |
queue<TPlacedEntry> iQueueFiles;
|
|
53 |
boost::mutex iMutex;
|
|
54 |
static boost::mutex iMutexSingleton;
|
|
55 |
static SymbolGenerator* iInst;
|
|
56 |
boost::condition_variable iCond;
|
|
57 |
|
|
58 |
ofstream iSymFile;
|
|
59 |
};
|
|
60 |
#endif
|