sl@0
|
1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __NONXIP__
|
sl@0
|
17 |
#define __NONXIP__
|
sl@0
|
18 |
|
sl@0
|
19 |
#ifndef __MSVCDOTNET__
|
sl@0
|
20 |
#pragma warning(push, 3) // cannot compile MSVC's STL at warning level 4
|
sl@0
|
21 |
#pragma warning(disable: 4786 4710 4530)
|
sl@0
|
22 |
#endif //__MSVCDOTNET__
|
sl@0
|
23 |
|
sl@0
|
24 |
#include <map>
|
sl@0
|
25 |
#include <vector>
|
sl@0
|
26 |
#include <string>
|
sl@0
|
27 |
#include "trace.h"
|
sl@0
|
28 |
#include "codespace.h"
|
sl@0
|
29 |
|
sl@0
|
30 |
class NonXIP
|
sl@0
|
31 |
{
|
sl@0
|
32 |
friend class ObyFile;
|
sl@0
|
33 |
typedef std::vector<std::string> FilesVec;
|
sl@0
|
34 |
|
sl@0
|
35 |
struct OrigName
|
sl@0
|
36 |
{
|
sl@0
|
37 |
OrigName() : iName(""), iId(0) {}
|
sl@0
|
38 |
OrigName(const char* aName, int aId) : iName(aName), iId(aId) {}
|
sl@0
|
39 |
std::string iName;
|
sl@0
|
40 |
int iId;
|
sl@0
|
41 |
};
|
sl@0
|
42 |
typedef std::map<std::string, OrigName> NamesMap;
|
sl@0
|
43 |
|
sl@0
|
44 |
struct Segment
|
sl@0
|
45 |
{
|
sl@0
|
46 |
PC iSegSize;
|
sl@0
|
47 |
NamesMap::const_iterator iName;
|
sl@0
|
48 |
bool iUnloaded;
|
sl@0
|
49 |
};
|
sl@0
|
50 |
typedef std::map<PC, Segment> SegData;
|
sl@0
|
51 |
|
sl@0
|
52 |
public:
|
sl@0
|
53 |
enum TReportMask {ENonXip=1, ENodebugSupport=2};
|
sl@0
|
54 |
|
sl@0
|
55 |
NonXIP();
|
sl@0
|
56 |
~NonXIP();
|
sl@0
|
57 |
|
sl@0
|
58 |
void AddObyFile(const char* aName) {iObyFiles.push_back(aName);}
|
sl@0
|
59 |
void AddSymbolFile(const char* aName) {iSymbolFiles.push_back(aName);}
|
sl@0
|
60 |
|
sl@0
|
61 |
void CreateNamesMap();
|
sl@0
|
62 |
void SetMappedCodeSpace(MappedCodeSpace* aCodeSpace) {iCodeSpace = aCodeSpace;}
|
sl@0
|
63 |
|
sl@0
|
64 |
void AddSegment(PC aAddress, PC aSegSize, const char *aSegName);
|
sl@0
|
65 |
void DeleteSegment(PC aAddress);
|
sl@0
|
66 |
|
sl@0
|
67 |
unsigned int iRowBufferErrors;
|
sl@0
|
68 |
unsigned int iCookBufferErrors;
|
sl@0
|
69 |
unsigned int iReportMask;
|
sl@0
|
70 |
|
sl@0
|
71 |
private:
|
sl@0
|
72 |
void AddObyNames(const char* aOrigName, const char* aSegName);
|
sl@0
|
73 |
bool TryUnDeleteSegment(PC aAddress, PC aSegSize, const char *aSegName);
|
sl@0
|
74 |
|
sl@0
|
75 |
private:
|
sl@0
|
76 |
FilesVec iObyFiles;
|
sl@0
|
77 |
FilesVec iSymbolFiles;
|
sl@0
|
78 |
NamesMap iNamesMap;
|
sl@0
|
79 |
int iCurId;
|
sl@0
|
80 |
MappedCodeSpace* iCodeSpace;
|
sl@0
|
81 |
SegData iSegData;
|
sl@0
|
82 |
std::vector<SymbolFile*> iSymbols;
|
sl@0
|
83 |
|
sl@0
|
84 |
};
|
sl@0
|
85 |
|
sl@0
|
86 |
#endif // __NONXIP__ |