mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Merge remote-tracking branch 'origin/Ghidra_11.4'
This commit is contained in:
commit
8365cf0a19
1 changed files with 18 additions and 13 deletions
|
@ -38,6 +38,7 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
||||||
|
|
||||||
public static final String POINTER_NAME = "pointer";
|
public static final String POINTER_NAME = "pointer";
|
||||||
public static final String POINTER_LABEL_PREFIX = "PTR";
|
public static final String POINTER_LABEL_PREFIX = "PTR";
|
||||||
|
public static final String POINTER_LABEL_PREFIX_U = POINTER_LABEL_PREFIX + "_";
|
||||||
public static final String POINTER_LOOP_LABEL_PREFIX = "PTR_LOOP";
|
public static final String POINTER_LOOP_LABEL_PREFIX = "PTR_LOOP";
|
||||||
public static final String NOT_A_POINTER = "NaP";
|
public static final String NOT_A_POINTER = "NaP";
|
||||||
|
|
||||||
|
@ -203,16 +204,6 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
||||||
return POINTER_LABEL_PREFIX;
|
return POINTER_LABEL_PREFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
PointerReferenceClassification pointerClassification =
|
|
||||||
getPointerClassification(program, ref);
|
|
||||||
if (pointerClassification == PointerReferenceClassification.DEEP) {
|
|
||||||
// pointer exceed depth limit of 2
|
|
||||||
return POINTER_LABEL_PREFIX + "_" + POINTER_LABEL_PREFIX;
|
|
||||||
}
|
|
||||||
if (pointerClassification == PointerReferenceClassification.LOOP) {
|
|
||||||
return POINTER_LOOP_LABEL_PREFIX;// pointer is self referencing
|
|
||||||
}
|
|
||||||
|
|
||||||
Symbol symbol = program.getSymbolTable().getSymbol(ref);
|
Symbol symbol = program.getSymbolTable().getSymbol(ref);
|
||||||
if (symbol == null) {
|
if (symbol == null) {
|
||||||
// unexpected
|
// unexpected
|
||||||
|
@ -222,7 +213,21 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
||||||
String symName = symbol.getName();
|
String symName = symbol.getName();
|
||||||
symName = SymbolUtilities.getCleanSymbolName(symName, ref.getToAddress());
|
symName = SymbolUtilities.getCleanSymbolName(symName, ref.getToAddress());
|
||||||
symName = symName.replace(Namespace.DELIMITER, "_");
|
symName = symName.replace(Namespace.DELIMITER, "_");
|
||||||
return POINTER_LABEL_PREFIX + "_" + symName;
|
|
||||||
|
if (!symName.startsWith(POINTER_LABEL_PREFIX_U)) {
|
||||||
|
return POINTER_LABEL_PREFIX_U + symName;
|
||||||
|
}
|
||||||
|
|
||||||
|
PointerReferenceClassification pointerClassification =
|
||||||
|
getPointerClassification(program, ref);
|
||||||
|
if (pointerClassification == PointerReferenceClassification.DEEP) {
|
||||||
|
// pointer exceed depth limit of 2
|
||||||
|
return POINTER_LABEL_PREFIX_U + POINTER_LABEL_PREFIX;
|
||||||
|
}
|
||||||
|
if (pointerClassification == PointerReferenceClassification.LOOP) {
|
||||||
|
return POINTER_LOOP_LABEL_PREFIX;// pointer is self referencing
|
||||||
|
}
|
||||||
|
return POINTER_LABEL_PREFIX_U + symName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum PointerReferenceClassification {
|
private enum PointerReferenceClassification {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue