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

Commit

Permalink
Merge pull request #61 from teamneusta/pr/FixStreamCloseAndSeveralBugs
Browse files Browse the repository at this point in the history
Fix too early stream close and several other bugs in StackParser
  • Loading branch information
MattWhilden authored Feb 28, 2017
2 parents c048870 + bd22424 commit 2a313bb
Showing 1 changed file with 13 additions and 13 deletions.
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

0 comments on commit 2a313bb

Please sign in to comment.