mirror of https://github.com/acidanthera/audk.git
1. Change "BA" to "BaseAddress" and "EP" to "EntryPoint".
2. Sort modules by their preferred load address in ascending order. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2254 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
497ef745f0
commit
93d16c6993
|
@ -13,6 +13,7 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -349,31 +350,47 @@ CFvMapFile::CFvMapFile(const CIdAddressPathMap& idAddrPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CFvMapFile::~CFvMapFile(void)
|
||||||
|
{
|
||||||
|
Cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
void CFvMapFile::Cleanup(void)
|
void CFvMapFile::Cleanup(void)
|
||||||
{
|
{
|
||||||
for (iterator i = begin(); i != end(); i++)
|
for (iterator i = begin(); i != end(); i++)
|
||||||
delete i->second;
|
delete i->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool map_less(const CFvMapFile::const_iterator& l, const CFvMapFile::const_iterator& r)
|
||||||
|
{
|
||||||
|
return l->second->m_ullLoadAddr < r->second->m_ullLoadAddr;
|
||||||
|
}
|
||||||
|
|
||||||
ostream& operator << (ostream& os, const CFvMapFile& fvMap)
|
ostream& operator << (ostream& os, const CFvMapFile& fvMap)
|
||||||
{
|
{
|
||||||
for (CFvMapFile::const_iterator i = fvMap.begin(); !!os && i != fvMap.end(); i++)
|
vector<CFvMapFile::const_iterator> rgIter;
|
||||||
|
rgIter.reserve(fvMap.size());
|
||||||
|
for (CFvMapFile::const_iterator i = fvMap.begin(); i != fvMap.end(); i++)
|
||||||
|
rgIter.push_back(i);
|
||||||
|
sort(rgIter.begin(), rgIter.end(), map_less);
|
||||||
|
|
||||||
|
for (vector<CFvMapFile::const_iterator>::const_iterator i = rgIter.begin(); i != rgIter.end(); i++)
|
||||||
{
|
{
|
||||||
CMapFile::const_iterator j = i->second->begin();
|
CMapFile::const_iterator j = (*i)->second->begin();
|
||||||
while (j != i->second->end() && j->m_strAddress != i->second->m_strEntryPoint) j++;
|
while (j != (*i)->second->end() && j->m_strAddress != (*i)->second->m_strEntryPoint) j++;
|
||||||
if (j == i->second->end())
|
if (j == (*i)->second->end())
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
__FUNCTION__ ":Entry point not found for module " +
|
__FUNCTION__ ":Entry point not found for module " +
|
||||||
i->second->m_strModuleName);
|
(*i)->second->m_strModuleName);
|
||||||
|
|
||||||
os << hex
|
os << hex
|
||||||
<< i->second->m_strModuleName
|
<< (*i)->second->m_strModuleName
|
||||||
<< " (EP=" << j->m_ullRva
|
<< " (EntryPoint=" << j->m_ullRva
|
||||||
<< ", BA=" << i->second->m_ullLoadAddr
|
<< ", BaseAddress=" << (*i)->second->m_ullLoadAddr
|
||||||
<< ", GUID=" << i->first
|
<< ", GUID=" << (*i)->first
|
||||||
<< ")" << endl << endl;
|
<< ")" << endl << endl;
|
||||||
|
|
||||||
for (j = i->second->begin(); j != i->second->end(); j++)
|
for (j = (*i)->second->begin(); j != (*i)->second->end(); j++)
|
||||||
os << " " << *j << endl;
|
os << " " << *j << endl;
|
||||||
|
|
||||||
os << endl << endl;
|
os << endl << endl;
|
||||||
|
@ -382,11 +399,6 @@ ostream& operator << (ostream& os, const CFvMapFile& fvMap)
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFvMapFile::~CFvMapFile(void)
|
|
||||||
{
|
|
||||||
Cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
class CGenFvMapUsage : public invalid_argument
|
class CGenFvMapUsage : public invalid_argument
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue