@@ -39,23 +39,26 @@ public async Task<Tuple<int, string>> ExtractFromXELAsync(string[] xelFiles, boo
3939 }
4040
4141 /// Convert virtual-address only type frames to their module+offset format
42- private string [ ] PreProcessVAs ( string [ ] callStackLines , CancellationTokenSource cts ) {
43- string [ ] retval = new string [ callStackLines . Length ] ;
44- int frameNum = 0 ;
42+ private List < string > PreProcessVAs ( List < string > callStackLines , CancellationTokenSource cts ) {
43+ var retval = new List < string > ( callStackLines . Count ) ;
44+
4545 foreach ( var currentFrame in callStackLines ) {
4646 if ( cts . IsCancellationRequested ) return callStackLines ;
47- // let's see if this is an VA-only address
47+
48+ // Check if the frame is a VA-only address
4849 var matchVA = rgxVAOnly . Match ( currentFrame ) ;
4950 if ( matchVA . Success ) {
5051 ulong virtAddress = Convert . ToUInt64 ( matchVA . Groups [ "vaddress" ] . Value , 16 ) ;
51- retval [ frameNum ] = TryObtainModuleOffset ( virtAddress , out string moduleName , out uint offset )
52- ? string . Format ( CultureInfo . CurrentCulture , "{0}+0x{1:X}" , moduleName , offset )
53- : currentFrame . Trim ( ) ;
52+ if ( TryObtainModuleOffset ( virtAddress , out string moduleName , out uint offset ) ) {
53+ retval . Add ( string . Format ( CultureInfo . CurrentCulture , "{0}+0x{1:X}" , moduleName , offset ) ) ;
54+ } else {
55+ retval . Add ( currentFrame . Trim ( ) ) ;
56+ }
57+ } else {
58+ retval . Add ( currentFrame . Trim ( ) ) ;
5459 }
55- else retval [ frameNum ] = currentFrame . Trim ( ) ;
56-
57- frameNum ++ ;
5860 }
61+
5962 return retval ;
6063 }
6164
@@ -83,7 +86,7 @@ public bool IsInputVAOnly(string text) {
8386 }
8487
8588 /// Runs through each of the frames in a call stack and looks up symbols for each
86- private string ResolveSymbols ( Dictionary < string , DiaUtil > _diautils , Dictionary < string , string > moduleNamesMap , string [ ] callStackLines , string userSuppliedSymPath , string symSrvSymPath , bool searchPDBsRecursively , bool cachePDB , bool includeSourceInfo , bool relookupSource , bool includeOffsets , bool showInlineFrames , List < string > modulesToIgnore , CancellationTokenSource cts ) {
89+ private string ResolveSymbols ( Dictionary < string , DiaUtil > _diautils , Dictionary < string , string > moduleNamesMap , List < string > callStackLines , string userSuppliedSymPath , string symSrvSymPath , bool searchPDBsRecursively , bool cachePDB , bool includeSourceInfo , bool relookupSource , bool includeOffsets , bool showInlineFrames , List < string > modulesToIgnore , CancellationTokenSource cts ) {
8790 var finalCallstack = new StringBuilder ( ) ;
8891 int runningFrameNum = int . MinValue ;
8992 foreach ( var iterFrame in callStackLines ) {
0 commit comments