@@ -5,6 +5,7 @@ public class StackResolver : IDisposable {
5
5
public const string OperationCanceled = "Operation cancelled." ;
6
6
public const int OperationWaitIntervalMilliseconds = 300 ;
7
7
public const int Operation100Percent = 100 ;
8
+ public const string WARNING_PREFIX = "-- WARNING:" ;
8
9
9
10
/// This is used to store module name and start / end virtual address ranges
10
11
/// Only populated if the user provides a tab-separated string corresponding to the output of the following SQL query:
@@ -87,7 +88,9 @@ private string ResolveSymbols(Dictionary<string, DiaUtil> _diautils, Dictionary<
87
88
var matchAlreadySymbolized = rgxAlreadySymbolizedFrame . Match ( currentFrame ) ;
88
89
if ( matchAlreadySymbolized . Success ) {
89
90
var matchedModuleName = matchAlreadySymbolized . Groups [ "module" ] . Value ;
90
- if ( ! _diautils . ContainsKey ( matchedModuleName ) ) DiaUtil . LocateandLoadPDBs ( _diautils , userSuppliedSymPath , symSrvSymPath , searchPDBsRecursively , new Dictionary < string , string > ( ) { { matchedModuleName , matchedModuleName } } , cachePDB , modulesToIgnore ) ;
91
+ if ( ! _diautils . ContainsKey ( matchedModuleName ) && ! DiaUtil . LocateandLoadPDBs ( matchedModuleName , $ "{ matchedModuleName } .pdb", _diautils , userSuppliedSymPath , symSrvSymPath , searchPDBsRecursively , cachePDB , modulesToIgnore , out string errorDetails ) ) {
92
+ currentFrame += $ " { WARNING_PREFIX } could not load symbol file { errorDetails } . The file may possibly be corrupt.";
93
+ }
91
94
if ( _diautils . TryGetValue ( matchedModuleName , out var existingEntry ) && _diautils [ matchedModuleName ] . HasSourceInfo ) {
92
95
var myDIAsession = existingEntry . _IDiaSession ;
93
96
myDIAsession . findChildrenEx ( myDIAsession . globalScope , SymTagEnum . SymTagNull , matchAlreadySymbolized . Groups [ "symbolizedfunc" ] . Value , 0 , out IDiaEnumSymbols matchedSyms ) ;
@@ -107,7 +110,7 @@ private string ResolveSymbols(Dictionary<string, DiaUtil> _diautils, Dictionary<
107
110
if ( enumAllLineNums . Item ( tmpOrdinalInner ) . addressOffset <= currAddress
108
111
&& currAddress < enumAllLineNums . Item ( tmpOrdinalInner ) . addressOffset + enumAllLineNums . Item ( tmpOrdinalInner ) . length ) {
109
112
currentFrame = $ "{ matchedModuleName } +{ currAddress - enumAllLineNums . Item ( tmpOrdinalInner ) . addressOffset + enumAllLineNums . Item ( tmpOrdinalInner ) . relativeVirtualAddress : X} "
110
- + ( foundMatch ? " -- WARNING : ambiguous symbol; relookup might be incorrect -- " : String . Empty ) ;
113
+ + ( foundMatch ? $ " { WARNING_PREFIX } : ambiguous symbol; relookup might be incorrect -- " : String . Empty ) ;
111
114
foundMatch = true ;
112
115
}
113
116
Marshal . FinalReleaseComObject ( enumAllLineNums . Item ( tmpOrdinalInner ) ) ;
@@ -125,8 +128,14 @@ private string ResolveSymbols(Dictionary<string, DiaUtil> _diautils, Dictionary<
125
128
var match = rgxModuleName . Match ( currentFrame ) ;
126
129
if ( match . Success ) {
127
130
var matchedModuleName = match . Groups [ "module" ] . Value ;
128
- lock ( moduleNamesMap ) if ( ! moduleNamesMap . ContainsKey ( matchedModuleName ) ) moduleNamesMap . Add ( matchedModuleName , matchedModuleName ) ;
129
- if ( ! _diautils . ContainsKey ( matchedModuleName ) ) DiaUtil . LocateandLoadPDBs ( _diautils , userSuppliedSymPath , symSrvSymPath , searchPDBsRecursively , moduleNamesMap , cachePDB , modulesToIgnore ) ;
131
+ string pdbFileName ;
132
+ lock ( moduleNamesMap ) {
133
+ if ( ! moduleNamesMap . ContainsKey ( matchedModuleName ) ) moduleNamesMap . Add ( matchedModuleName , matchedModuleName ) ;
134
+ pdbFileName = $ "{ moduleNamesMap [ matchedModuleName ] } .pdb";
135
+ }
136
+ if ( ! _diautils . ContainsKey ( matchedModuleName ) && ! DiaUtil . LocateandLoadPDBs ( matchedModuleName , pdbFileName , _diautils , userSuppliedSymPath , symSrvSymPath , searchPDBsRecursively , cachePDB , modulesToIgnore , out string errorDetails ) ) {
137
+ currentFrame += $ " { WARNING_PREFIX } could not load symbol file { errorDetails } . The file may possibly be corrupt.";
138
+ }
130
139
int frameNumFromInput = string . IsNullOrWhiteSpace ( match . Groups [ "framenum" ] . Value ) ? int . MinValue : Convert . ToInt32 ( match . Groups [ "framenum" ] . Value , 16 ) ;
131
140
if ( frameNumFromInput != int . MinValue && runningFrameNum == int . MinValue ) runningFrameNum = frameNumFromInput ;
132
141
if ( _diautils . ContainsKey ( matchedModuleName ) ) {
@@ -216,7 +225,7 @@ private string ProcessFrameModuleOffset(Dictionary<string, DiaUtil> _diautils, D
216
225
Marshal . FinalReleaseComObject ( enumLineNums ) ;
217
226
}
218
227
var originalModuleName = moduleNamesMap . TryGetValue ( moduleName , out string existingModule ) ? existingModule : moduleName ;
219
- if ( showInlineFrames && pdbHasSourceInfo && ! sourceInfo . Contains ( "-- WARNING:" ) ) {
228
+ if ( showInlineFrames && pdbHasSourceInfo && ! sourceInfo . Contains ( WARNING_PREFIX ) ) {
220
229
inlineFrameAndSourceInfo = DiaUtil . ProcessInlineFrames ( originalModuleName , useUndecorateLogic , includeOffset , includeSourceInfo , rva , mysym , pdbHasSourceInfo ) ;
221
230
}
222
231
0 commit comments