mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Basic multi-entry merge capability
This commit is contained in:
parent
76d0f12bd3
commit
b99772a784
8 changed files with 123 additions and 6 deletions
|
@ -1656,6 +1656,8 @@ SymbolEntry *ScopeInternal::addMapInternal(Symbol *sym,uint4 exfl,const Address
|
|||
list<SymbolEntry>::iterator iter = rangemap->insert(initdata,addr.getOffset(),lastaddress.getOffset());
|
||||
// Store reference to map in symbol
|
||||
sym->mapentry.push_back(iter);
|
||||
if (sym->mapentry.size() == 2)
|
||||
multiEntrySet.insert(sym);
|
||||
return &(*iter);
|
||||
}
|
||||
|
||||
|
@ -1666,6 +1668,8 @@ SymbolEntry *ScopeInternal::addDynamicMapInternal(Symbol *sym,uint4 exfl,uint8 h
|
|||
list<SymbolEntry>::iterator iter = dynamicentry.end();
|
||||
--iter;
|
||||
sym->mapentry.push_back(iter); // Store reference to map entry in symbol
|
||||
if (sym->mapentry.size() == 2)
|
||||
multiEntrySet.insert(sym);
|
||||
return &dynamicentry.back();
|
||||
}
|
||||
|
||||
|
@ -1890,6 +1894,8 @@ void ScopeInternal::removeSymbol(Symbol *symbol)
|
|||
list.pop_back();
|
||||
}
|
||||
|
||||
if (symbol->mapentry.size() > 1)
|
||||
multiEntrySet.erase(symbol);
|
||||
// Remove each mapping of the symbol
|
||||
for(iter=symbol->mapentry.begin();iter!=symbol->mapentry.end();++iter) {
|
||||
AddrSpace *spc = (*(*iter)).getAddr().getSpace();
|
||||
|
@ -1907,10 +1913,14 @@ void ScopeInternal::removeSymbol(Symbol *symbol)
|
|||
void ScopeInternal::renameSymbol(Symbol *sym,const string &newname)
|
||||
|
||||
{
|
||||
nametree.erase(sym); // Erase under old name
|
||||
nametree.erase(sym); // Erase under old name
|
||||
if (sym->mapentry.size() > 1)
|
||||
multiEntrySet.erase(sym); // The multi-entry set is sorted by name, remove
|
||||
string oldname = sym->name;
|
||||
sym->name = newname;
|
||||
insertNameTree(sym);
|
||||
if (sym->mapentry.size() > 1)
|
||||
multiEntrySet.insert(sym); // Reenter into the multi-entry set now that name is changed
|
||||
}
|
||||
|
||||
void ScopeInternal::retypeSymbol(Symbol *sym,Datatype *ct)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue