mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-02-16 15:40:14 +00:00
GP-4975 - PDB - allow VxTable mangled symbol to be primary for Demangler
This commit is contained in:
parent
22f95a5eba
commit
b776df4c7c
@ -2335,8 +2335,10 @@ public class DefaultPdbApplicator implements PdbApplicator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!existingSymbol.getParentNamespace().equals(program.getGlobalNamespace())) {
|
if (!existingSymbol.getParentNamespace().equals(program.getGlobalNamespace())) {
|
||||||
// existing symbol has a non-global namespace
|
// Existing symbol has a non-global namespace
|
||||||
return doCreateSymbol(address, symbolPath, false, plateAddition);
|
if (!preferNewSymbolOverExistingNamespacedSymbol(symbolPath)) {
|
||||||
|
return doCreateSymbol(address, symbolPath, false, plateAddition);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbolPath.getParent() != null) {
|
if (symbolPath.getParent() != null) {
|
||||||
@ -2353,6 +2355,22 @@ public class DefaultPdbApplicator implements PdbApplicator {
|
|||||||
return doCreateSymbol(address, symbolPath, false, plateAddition);
|
return doCreateSymbol(address, symbolPath, false, plateAddition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We've found that a mangled version of vxtables can present more detailed information
|
||||||
|
// than a non-mangled vxtable symbol that has a namespace (the information is not
|
||||||
|
// as descriptive regarding vxtables owned by the child for a parent). So do not
|
||||||
|
// accept these existing symbol with namespace to maintain their primary status.
|
||||||
|
//
|
||||||
|
// Kludge... this mechanism might go away later if/when instead we evaluate all symbols at
|
||||||
|
// an address to do the right thing or if/when we process the tables in some place other
|
||||||
|
// than or besides the Demangler.
|
||||||
|
private boolean preferNewSymbolOverExistingNamespacedSymbol(SymbolPath symbolPath) {
|
||||||
|
String name = symbolPath.getName();
|
||||||
|
if (name.startsWith("??_7") || name.startsWith("??_8")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private Symbol doCreateSymbol(Address address, SymbolPath symbolPath, boolean makePrimary,
|
private Symbol doCreateSymbol(Address address, SymbolPath symbolPath, boolean makePrimary,
|
||||||
String plateAddition) {
|
String plateAddition) {
|
||||||
Symbol symbol = null;
|
Symbol symbol = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user