Merge remote-tracking branch 'origin/caheckman_UndefinedFunction' into Ghidra_9.2

This commit is contained in:
ghidra1 2020-10-13 18:21:55 -04:00
commit 165a767365
4 changed files with 26 additions and 8 deletions

View file

@ -79,14 +79,15 @@ public class HighFunction extends PcodeSyntaxTree {
}
/**
* Get the id with the associated function symbol, if it exists
* @return the id or 0 otherwise
* Get the id with the associated function symbol, if it exists.
* Otherwise return a dynamic id based on the entry point.
* @return the symbol id, or possibly a dynamic id
*/
public long getID() {
if (func instanceof FunctionDB) {
return func.getSymbol().getID();
}
return 0;
return func.getProgram().getSymbolTable().getDynamicSymbolID(func.getEntryPoint());
}
/**

View file

@ -55,6 +55,7 @@ public class HighFunctionShellSymbol extends HighSymbol {
@Override
public void saveXML(StringBuilder buf) {
buf.append("<function");
SpecXmlUtils.encodeUnsignedIntegerAttribute(buf, "id", getId());
SpecXmlUtils.xmlEscapeAttribute(buf, "name", name);
SpecXmlUtils.encodeSignedIntegerAttribute(buf, "size", 1);
buf.append(">\n");