mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-2385 - PDB Universal - allow mangleds to be primary when PDB has no
type information
This commit is contained in:
@@ -272,8 +272,19 @@ public class PdbApplicator {
|
|||||||
// underlying type. Then we can apply the mangled symbols and demangle them without
|
// underlying type. Then we can apply the mangled symbols and demangle them without
|
||||||
// affecting our ability to lay down PDB type information--any type information from
|
// affecting our ability to lay down PDB type information--any type information from
|
||||||
// the mangled symbols can happen afterward.
|
// the mangled symbols can happen afterward.
|
||||||
processGlobalSymbolsNoTypedefs();
|
// 20220801: Used to be global followed by public symbols, but adding temporary if/else,
|
||||||
processPublicSymbols();
|
// switching the order when there are no data types in the PDB so that mangled symbols will
|
||||||
|
// become primary, allowing their limited type information to be gleaned. Future plans are
|
||||||
|
// to have more sophisticated processing, per address.
|
||||||
|
if (pdb.getTypeProgramInterface()
|
||||||
|
.getTypeIndexMaxExclusive() == pdb.getTypeProgramInterface().getTypeIndexMin()) {
|
||||||
|
processPublicSymbols();
|
||||||
|
processGlobalSymbolsNoTypedefs();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
processGlobalSymbolsNoTypedefs();
|
||||||
|
processPublicSymbols();
|
||||||
|
}
|
||||||
|
|
||||||
// Seems that we shouldn't do the following, as it could be a buffer of invalid symbols
|
// Seems that we shouldn't do the following, as it could be a buffer of invalid symbols
|
||||||
// that hadn't been gone through for garbage collection of sorts.
|
// that hadn't been gone through for garbage collection of sorts.
|
||||||
@@ -652,7 +663,8 @@ public class PdbApplicator {
|
|||||||
//==============================================================================================
|
//==============================================================================================
|
||||||
//==============================================================================================
|
//==============================================================================================
|
||||||
int findModuleNumberBySectionOffsetContribution(int section, long offset) throws PdbException {
|
int findModuleNumberBySectionOffsetContribution(int section, long offset) throws PdbException {
|
||||||
for (AbstractSectionContribution sectionContribution : pdb.getDebugInfo().getSectionContributionList()) {
|
for (AbstractSectionContribution sectionContribution : pdb.getDebugInfo()
|
||||||
|
.getSectionContributionList()) {
|
||||||
int sectionContributionOffset = sectionContribution.getOffset();
|
int sectionContributionOffset = sectionContribution.getOffset();
|
||||||
int maxSectionContributionOffset =
|
int maxSectionContributionOffset =
|
||||||
sectionContributionOffset + sectionContribution.getLength();
|
sectionContributionOffset + sectionContribution.getLength();
|
||||||
@@ -1164,11 +1176,15 @@ public class PdbApplicator {
|
|||||||
@SuppressWarnings("unused") // for method not being called.
|
@SuppressWarnings("unused") // for method not being called.
|
||||||
private void processNonPublicOrGlobalSymbols() throws CancelledException, PdbException {
|
private void processNonPublicOrGlobalSymbols() throws CancelledException, PdbException {
|
||||||
Set<Long> offsetsRemaining = getSymbolGroup().getOffsets();
|
Set<Long> offsetsRemaining = getSymbolGroup().getOffsets();
|
||||||
for (long off : pdb.getDebugInfo().getPublicSymbolInformation().getModifiedHashRecordSymbolOffsets()) {
|
for (long off : pdb.getDebugInfo()
|
||||||
|
.getPublicSymbolInformation()
|
||||||
|
.getModifiedHashRecordSymbolOffsets()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
offsetsRemaining.remove(off);
|
offsetsRemaining.remove(off);
|
||||||
}
|
}
|
||||||
for (long off : pdb.getDebugInfo().getGlobalSymbolInformation().getModifiedHashRecordSymbolOffsets()) {
|
for (long off : pdb.getDebugInfo()
|
||||||
|
.getGlobalSymbolInformation()
|
||||||
|
.getModifiedHashRecordSymbolOffsets()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
offsetsRemaining.remove(off);
|
offsetsRemaining.remove(off);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user