mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-3369 Implement shortened display names in decompiler
This commit is contained in:
parent
69549f576f
commit
ba694068ef
31 changed files with 709 additions and 134 deletions
|
@ -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 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue