mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Isolate property on Symbols
This commit is contained in:
parent
cdbee3fe39
commit
7fa8245f90
8 changed files with 155 additions and 23 deletions
|
@ -115,6 +115,7 @@ void IfaceDecompCapability::registerCommands(IfaceStatus *status)
|
|||
status->registerCom(new IfcRename(),"rename");
|
||||
status->registerCom(new IfcRetype(),"retype");
|
||||
status->registerCom(new IfcRemove(),"remove");
|
||||
status->registerCom(new IfcIsolate(),"isolate");
|
||||
status->registerCom(new IfcLockPrototype(),"prototype","lock");
|
||||
status->registerCom(new IfcUnlockPrototype(),"prototype","unlock");
|
||||
status->registerCom(new IfcCommentInstr(),"comment","instruction");
|
||||
|
@ -1057,6 +1058,32 @@ void IfcRetype::execute(istream &s)
|
|||
}
|
||||
}
|
||||
|
||||
void IfcIsolate::execute(istream &s)
|
||||
|
||||
{
|
||||
string name;
|
||||
|
||||
s >> ws >> name;
|
||||
if (name.size()==0)
|
||||
throw IfaceParseError("Must specify name of symbol");
|
||||
|
||||
Symbol *sym;
|
||||
vector<Symbol *> symList;
|
||||
if (dcp->fd != (Funcdata *)0)
|
||||
dcp->fd->getScopeLocal()->queryByName(name,symList);
|
||||
else
|
||||
dcp->conf->symboltab->getGlobalScope()->queryByName(name,symList);
|
||||
|
||||
if (symList.empty())
|
||||
throw IfaceExecutionError("No symbol named: "+name);
|
||||
if (symList.size() > 1)
|
||||
throw IfaceExecutionError("More than one symbol named : "+name);
|
||||
else
|
||||
sym = symList[0];
|
||||
|
||||
sym->setIsolated(true);
|
||||
}
|
||||
|
||||
static Varnode *iface_read_varnode(IfaceDecompData *dcp,istream &s)
|
||||
|
||||
{ // Return varnode identified by input stream
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue