Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-0 - PDB - Fix FunctionSymbolApplier from GP-3991

ghizard039056fe4188
diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/FunctionSymbolApplier.java b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/FunctionSymbolApplier.java
index 7f72e77a67..183d3c72cf 100644
--- a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/FunctionSymbolApplier.java
+++ b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/FunctionSymbolApplier.java
@@ -39,13 +39,10 @@ public class FunctionSymbolApplier extends AbstractBlockContextApplier
// Do not trust any of these variables... this is work in progress (possibly getting
// torn up), but non-functioning code in other classes or this class still depend on these
- private Address address_x;
private Function function_x = null;
private long specifiedFrameSize_x = 0;
private long currentFrameSize_x = 0;
- private Address currentBlockAddress;
-
// might not need this, but investigating whether it will help us. TODO remove?
private int baseParamOffset = 0;
@@ -139,7 +136,7 @@ public class FunctionSymbolApplier extends AbstractBlockContextApplier
MsTypeApplier applier = applicator.getTypeApplier(fType);
if (!(applier instanceof AbstractFunctionTypeApplier)) {
applicator.appendLogMsg("Error: Failed to resolve datatype RecordNumber " +
- typeRecordNumber + " at " + address_x);
+ typeRecordNumber + " at " + address);
return false;
}
@@ -248,14 +245,15 @@ public class FunctionSymbolApplier extends AbstractBlockContextApplier
* @param dataType data type of the variable.
*/
void setLocalVariable(Address varAddress, String varName, DataType dataType) {
- if (currentBlockAddress == null) {
+ if (varAddress == null) {
return; // silently return.
}
if (varName.isBlank()) {
return; // silently return.
}
- String plateAddition = "PDB: static local for function (" + address_x + "): " + getName();
+ String plateAddition =
+ "PDB: static local for function (" + applicator.getAddress(symbol) + "): " + getName();
// TODO: 20220210... consider adding function name as namespace to varName
applicator.createSymbol(varAddress, varName, true, plateAddition);
}