Skip to content
This repository was archived by the owner on May 29, 2020. It is now read-only.

Commit 141b104

Browse files
Fixed bug for .NET native
1 parent 1990c1b commit 141b104

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

SymbolFetch/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
3+
<!--<appSettings>
4+
<add key="SymbolServer" value="http://symweb"/>
5+
</appSettings>-->
36
<startup>
47
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
58
</startup>

SymbolFetch/Helpers/Constants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public static class Constants
1515
static Constants()
1616
{
1717
SymbolServer = @"Microsoft-Symbol-Server/10.0.10522.521";
18-
DownloadFolder = @"c:\symcache";
19-
EnableBulkDownload = false;
18+
DownloadFolder = @"c:\symbols";
19+
EnableBulkDownload = true;
2020
}
2121

2222
#endregion

SymbolFetch/MainWindow.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ private void btnStart_Click(object sender, RoutedEventArgs e)
8282
{
8383

8484
var builder = new UrlBuilder();
85-
86-
8785
downloader.LocalDirectory = downloader.DownloadLocation;
88-
8986
downloader.Files.Clear();
9087

9188
foreach (var item in lstFiles.Items)
@@ -98,7 +95,10 @@ private void btnStart_Click(object sender, RoutedEventArgs e)
9895
downloader.Files.Add(fileInfo);
9996
}
10097
else
101-
downloader.FailedFiles.Add(item.ToString(), " - No Debug information in PE header");
98+
{
99+
if(!downloader.FailedFiles.ContainsKey(item.ToString()))
100+
downloader.FailedFiles.Add(item.ToString(), " - No Debug information in PE header");
101+
}
102102
}
103103

104104
downloader.Start();

SymbolFetch/PeHeaderReader.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,20 @@ public PeHeaderReader(string filePath)
368368
if (loopexit == 0)
369369
{
370370
imageDebugDirectory = FromBinaryReader<IMAGE_DEBUG_DIRECTORY>(reader);
371+
long seekPosition = stream.Position;
371372

372373
if (imageDebugDirectory.Type == 0x2)
373374
{
374375
stream.Seek(imageDebugDirectory.PointerToRawData, SeekOrigin.Begin);
375376
DebugInfo = FromBinaryReader<IMAGE_DEBUG_DIRECTORY_RAW>(reader);
376377
loopexit = 1;
378+
379+
//Downloading logic for .NET native images
380+
if (new string(DebugInfo.name).Contains(".ni."))
381+
{
382+
stream.Seek(seekPosition, SeekOrigin.Begin);
383+
loopexit = 0;
384+
}
377385
}
378386

379387
if ((imageDebugDirectory.PointerToRawData != 0) &&

0 commit comments

Comments
 (0)