GP-4975 - PDB - allow VxTable mangled symbol to be primary for Demangler

This commit is contained in:
ghizard 2024-09-30 21:42:44 +00:00
parent 22f95a5eba
commit b776df4c7c

View File

@ -2335,9 +2335,11 @@ public class DefaultPdbApplicator implements PdbApplicator {
}
if (!existingSymbol.getParentNamespace().equals(program.getGlobalNamespace())) {
// existing symbol has a non-global namespace
// Existing symbol has a non-global namespace
if (!preferNewSymbolOverExistingNamespacedSymbol(symbolPath)) {
return doCreateSymbol(address, symbolPath, false, plateAddition);
}
}
if (symbolPath.getParent() != null) {
// new symbol has non-global namespace
@ -2353,6 +2355,22 @@ public class DefaultPdbApplicator implements PdbApplicator {
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,
String plateAddition) {
Symbol symbol = null;