GP-3369 Implement shortened display names in decompiler

This commit is contained in:
caheckman 2023-05-17 15:51:48 -04:00
parent 69549f576f
commit ba694068ef
31 changed files with 709 additions and 134 deletions

View file

@ -30,7 +30,7 @@ ElementId ELEM_VARNODES = ElementId("varnodes",119);
/// \param addr is the entry address for the function
/// \param sym is the symbol representing the function
/// \param sz is the number of bytes (of code) in the function body
Funcdata::Funcdata(const string &nm,Scope *scope,const Address &addr,FunctionSymbol *sym,int4 sz)
Funcdata::Funcdata(const string &nm,const string &disp,Scope *scope,const Address &addr,FunctionSymbol *sym,int4 sz)
: baseaddr(addr),
funcp(),
vbank(scope->getArch()),
@ -47,6 +47,7 @@ Funcdata::Funcdata(const string &nm,Scope *scope,const Address &addr,FunctionSym
glb = scope->getArch();
minLanedSize = glb->getMinimumLanedRegisterSize();
name = nm;
displayName = disp;
size = sz;
AddrSpace *stackid = glb->getStackSpace();
@ -734,9 +735,13 @@ uint8 Funcdata::decode(Decoder &decoder)
if (decoder.readBool())
flags |= no_code;
}
else if (attribId == ATTRIB_LABEL)
displayName = decoder.readString();
}
if (name.size() == 0)
throw LowlevelError("Missing function name");
if (displayName.size() == 0)
displayName = name;
if (size == -1)
throw LowlevelError("Missing function size");
baseaddr = Address::decode( decoder );