Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Fix too early stream close and several other bugs in StackParser #61

Merged
merged 3 commits into from
Feb 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/StackParser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class Program
static string s_outputFile;
static string s_symbolServerPath;
static bool s_keepModules = false;
static Dictionary<string, IDiaSession> s_pdbMap = new Dictionary<string, IDiaSession>();
static Dictionary<string, string> s_moduleToPeFileMap = new Dictionary<string, string>();
static Dictionary<string, IDiaSession> s_pdbMap = new Dictionary<string, IDiaSession>(StringComparer.OrdinalIgnoreCase);
static Dictionary<string, string> s_moduleToPeFileMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
static List<string> s_pdbFileList = new List<string>();
static char[] s_OptionValSeparator = { ':', '=' };
static SymStore s_symStore = null;
Expand Down Expand Up @@ -263,16 +263,6 @@ static void Main(string[] args)
}
}

if (sr != null)
{
sr.Close();
}

if (sw != null)
{
sw.Close();
}

while((line = tr.ReadLine()) != null)
{
const string separator = "!<BaseAddress>+0x";
Expand All @@ -281,7 +271,7 @@ static void Main(string[] args)
{
string moduleStr = frags[0];
int idx = moduleStr.LastIndexOf(' ');
if (idx < 0) idx = 0;
if (idx < 0) idx = -1;
string moduleName = moduleStr.Substring(idx + 1);
string prefix = moduleStr.Substring(0, idx + 1);

Expand Down Expand Up @@ -386,6 +376,16 @@ static void Main(string[] args)
}
}
}

if (sr != null)
{
sr.Close();
}

if (sw != null)
{
sw.Close();
}
}

static CodeViewDebugData CvDataFromPE(string fileName)
Expand Down