GP-6008 Changed SourceType examination to base upon priorty instead of specific value equality when appropriate

This commit is contained in:
ghidra1 2025-09-24 09:16:04 -04:00
parent edea7dfd65
commit a3bd708160
20 changed files with 131 additions and 144 deletions

View file

@ -43,8 +43,7 @@ import ghidra.program.model.symbol.*;
public class AutoRenameSimpleLabels extends GhidraScript {
boolean isDefaultName(Symbol symbol) {
return symbol.getSource() == SourceType.DEFAULT ||
symbol.getSource() == SourceType.ANALYSIS;
return symbol.getSource().isLowerOrEqualPriorityThan(SourceType.ANALYSIS);
}
@Override
@ -61,6 +60,9 @@ public class AutoRenameSimpleLabels extends GhidraScript {
//get this instruction's info
Symbol s = iter.next();
Address startAddr = s.getAddress();
if (!startAddr.isLoadedMemoryAddress()) {
continue;
}
// read the instruction type and operand
Instruction inst = getInstructionAt(startAddr);