GP-3316 - PDB developer script to apply to empty program

This commit is contained in:
ghizard 2023-04-11 22:14:11 -04:00
parent 3f13d99079
commit 815a38b4fe
2 changed files with 106 additions and 3 deletions

View file

@ -355,9 +355,14 @@ public class FunctionSymbolApplier extends MsSymbolApplier {
private Function createFunctionCommand(TaskMonitor monitor) {
CreateFunctionCmd funCmd = new CreateFunctionCmd(address);
if (!funCmd.applyTo(applicator.getProgram(), monitor)) {
applicator.appendLogMsg("Failed to apply function at address " + address.toString() +
"; attempting to use possible existing function");
return applicator.getProgram().getListing().getFunctionAt(address);
funCmd = new CreateFunctionCmd(null, address, new AddressSet(address, address),
SourceType.DEFAULT);
if (!funCmd.applyTo(applicator.getProgram(), monitor)) {
applicator
.appendLogMsg("Failed to apply function at address " + address.toString() +
"; attempting to use possible existing function");
return applicator.getProgram().getListing().getFunctionAt(address);
}
}
return funCmd.getFunction();
}