mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Multi-merge functionality
This commit is contained in:
parent
cbcfaf54fa
commit
6c6d5f2f1b
9 changed files with 256 additions and 61 deletions
|
@ -899,7 +899,16 @@ bool Funcdata::syncVarnodesWithSymbol(VarnodeLocSet::const_iterator &iter,uint4
|
|||
vn = *iter++;
|
||||
if (vn->isFree()) continue;
|
||||
vnflags = vn->getFlags();
|
||||
if ((vnflags & mask) != flags) { // We have a change
|
||||
if (vn->mapentry != (SymbolEntry *)0) { // If there is already an attached SymbolEntry (dynamic)
|
||||
uint4 localMask = mask & ~Varnode::mapped; // Make sure 'mapped' bit is unchanged
|
||||
uint4 localFlags = flags & localMask;
|
||||
if ((vnflags & localMask) != localFlags) {
|
||||
updateoccurred = true;
|
||||
vn->setFlags(localFlags);
|
||||
vn->clearFlags((~localFlags)&localMask);
|
||||
}
|
||||
}
|
||||
else if ((vnflags & mask) != flags) { // We have a change
|
||||
updateoccurred = true;
|
||||
vn->setFlags(flags);
|
||||
vn->clearFlags((~flags)&mask);
|
||||
|
|
|
@ -2214,7 +2214,8 @@ bool PrintC::emitScopeVarDecls(const Scope *scope,int4 cat)
|
|||
list<SymbolEntry>::const_iterator iter_d = scope->beginDynamic();
|
||||
list<SymbolEntry>::const_iterator enditer_d = scope->endDynamic();
|
||||
for(;iter_d!=enditer_d;++iter_d) {
|
||||
if ((*iter_d).isPiece()) continue; // Don't do a partial entry
|
||||
const SymbolEntry *entry = &(*iter_d);
|
||||
if (entry->isPiece()) continue; // Don't do a partial entry
|
||||
Symbol *sym = (*iter_d).getSymbol();
|
||||
if (sym->getCategory() != cat) continue;
|
||||
if (sym->getName().size() == 0) continue;
|
||||
|
@ -2222,6 +2223,10 @@ bool PrintC::emitScopeVarDecls(const Scope *scope,int4 cat)
|
|||
continue;
|
||||
if (dynamic_cast<LabSymbol *>(sym) != (LabSymbol *)0)
|
||||
continue;
|
||||
if (sym->isMultiEntry()) {
|
||||
if (sym->getFirstWholeMap() != entry)
|
||||
continue;
|
||||
}
|
||||
notempty = true;
|
||||
emitVarDeclStatement(sym);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue