mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
populate HighFunctionShellSymbol in GlobalSymbolMap
This commit is contained in:
parent
97b43b9470
commit
7b407f1965
11 changed files with 104 additions and 42 deletions
|
@ -682,11 +682,14 @@ void Funcdata::saveXmlTree(ostream &s) const
|
|||
/// If indicated by the caller, a description of the entire PcodeOp and Varnode
|
||||
/// tree is also emitted.
|
||||
/// \param s is the output stream
|
||||
/// \param id is the unique id associated with the function symbol
|
||||
/// \param savetree is \b true if the p-code tree should be emitted
|
||||
void Funcdata::saveXml(ostream &s,bool savetree) const
|
||||
void Funcdata::saveXml(ostream &s,uint8 id,bool savetree) const
|
||||
|
||||
{
|
||||
s << "<function";
|
||||
if (id != 0)
|
||||
a_v_u(s, "id", id);
|
||||
a_v(s,"name",name);
|
||||
a_v_i(s,"size",size);
|
||||
if (hasNoCode())
|
||||
|
@ -712,22 +715,30 @@ void Funcdata::saveXml(ostream &s,bool savetree) const
|
|||
/// From an XML \<function> tag, recover the name, address, prototype, symbol,
|
||||
/// jump-table, and override information for \b this function.
|
||||
/// \param el is the root \<function> tag
|
||||
void Funcdata::restoreXml(const Element *el)
|
||||
/// \return the symbol id associated with the function
|
||||
uint8 Funcdata::restoreXml(const Element *el)
|
||||
|
||||
{
|
||||
// clear(); // Shouldn't be needed
|
||||
name.clear();
|
||||
size = -1;
|
||||
uint8 id = 0;
|
||||
AddrSpace *stackid = glb->getStackSpace();
|
||||
for(int4 i=0;i<el->getNumAttributes();++i) {
|
||||
if (el->getAttributeName(i) == "name")
|
||||
const string &attrName(el->getAttributeName(i));
|
||||
if (attrName == "name")
|
||||
name = el->getAttributeValue(i);
|
||||
else if (el->getAttributeName(i) == "size") {
|
||||
else if (attrName == "size") {
|
||||
istringstream s( el->getAttributeValue(i));
|
||||
s.unsetf(ios::dec | ios::hex | ios::oct);
|
||||
s >> size;
|
||||
}
|
||||
else if (el->getAttributeName(i) == "nocode") {
|
||||
else if (attrName == "id") {
|
||||
istringstream s( el->getAttributeValue(i));
|
||||
s.unsetf(ios::dec | ios::hex | ios::oct);
|
||||
s >> id;
|
||||
}
|
||||
else if (attrName == "nocode") {
|
||||
if (xml_readbool(el->getAttributeValue(i)))
|
||||
flags |= no_code;
|
||||
}
|
||||
|
@ -779,6 +790,7 @@ void Funcdata::restoreXml(const Element *el)
|
|||
funcp.setScope(localmap,baseaddr+ -1);
|
||||
}
|
||||
localmap->resetLocalWindow();
|
||||
return id;
|
||||
}
|
||||
|
||||
/// \brief Inject p-code from a \e payload into \b this live function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue