From 3233a31b6c015a6c203935d4508e065fcee18abb Mon Sep 17 00:00:00 2001 From: TollyH Date: Tue, 1 Aug 2023 15:46:30 +0100 Subject: [PATCH] Fix issue with reading debug files with empty sections --- DebugInfo.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DebugInfo.cs b/DebugInfo.cs index 54a5fad..4e05d58 100644 --- a/DebugInfo.cs +++ b/DebugInfo.cs @@ -105,18 +105,30 @@ public static DebugInfoFile ParseDebugInfoFile(string fileText) foreach (string line in fileMatch.Groups["Instructions"].Value.Split('\n')) { + if (line.Trim() == string.Empty) + { + continue; + } string[] split = line.Split(" @ "); assembledInstructions.Add((Convert.ToUInt64(split[0], 16), split[1])); } foreach (string line in fileMatch.Groups["Labels"].Value.Split('\n')) { + if (line.Trim() == string.Empty) + { + continue; + } string[] split = line.Split(" @ "); addressLabels.Add((Convert.ToUInt64(split[0], 16), split[1].Split(','))); } foreach (string line in fileMatch.Groups["Imports"].Value.Split('\n')) { + if (line.Trim() == string.Empty) + { + continue; + } string[] split = line.Split(" @ "); importLocations.Add((Convert.ToUInt64(split[0], 16), split[1].Split(" -> ")[0].Trim('"'))); }