diff options
author | Jonathan CHang <jonathan34c@gmail.com> | 2022-07-07 23:43:43 +0300 |
---|---|---|
committer | Jonathan CHang <jonathan34c@gmail.com> | 2022-07-07 23:43:43 +0300 |
commit | f8efa7bc8583e2134655b37b6ac4e7a5ff1edbed (patch) | |
tree | 6670828fa33ade66131e0884372d1f03459373d8 | |
parent | 8c74e69a8fa5dd7c96756c9bc7878564510ca7fe (diff) |
try catch + nukk checkdev/t-jochang/unitSoft
-rw-r--r-- | Mono.Debugging.Soft/SoftDebuggerSession.cs | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/Mono.Debugging.Soft/SoftDebuggerSession.cs b/Mono.Debugging.Soft/SoftDebuggerSession.cs index e55a599..88bdbf8 100644 --- a/Mono.Debugging.Soft/SoftDebuggerSession.cs +++ b/Mono.Debugging.Soft/SoftDebuggerSession.cs @@ -2249,27 +2249,29 @@ namespace Mono.Debugging.Soft if (events.Length > 1 && events.Any (a => a.Assembly != asm)) throw new InvalidOperationException ("Simultaneous AssemblyLoadEvent for multiple assemblies"); - var symbolStatus = asm.GetMetadata ().MainModule.HasSymbols ? "Symbol loaded" : "Skipped loading symbols"; - try { + var metaData = asm?.GetMetadata (); + var symbolStatus = metaData?.MainModule.HasSymbols==true ? "Symbol loaded" : "Skipped loading symbols"; + var symbolVersion = asm?.GetName ()?.Version?.Major.ToString () ?? "Version"; var assembly = new Assembly ( - asm.GetMetadata ().MainModule.Name, - asm.Location, - true, - asm.GetMetadata ().MainModule.HasSymbols, - symbolStatus, - "", - -1, - asm.GetName ().Version.Major.ToString (), - // TODO: module time stamp - "", - asm.GetAssemblyObject ().Address.ToString (), - string.Format ("[{0}]{1}", asm.VirtualMachine.TargetProcess.Id, asm.VirtualMachine.TargetProcess.ProcessName), - asm.Domain.FriendlyName, - asm.VirtualMachine.TargetProcess.Id + metaData?.MainModule?.Name ?? "Name", + asm?.Location ?? "Location", + true, + metaData?.MainModule.HasSymbols == true, + symbolStatus, + "", + -1, + asm?.GetName ()?.Version?.Major.ToString () ?? "Version", + // TODO: module time stamp + "", + asm?.GetAssemblyObject ().Address.ToString ()??"Address", + string.Format ("[{0}]{1}", asm?.VirtualMachine?.TargetProcess?.Id, asm?.VirtualMachine?.TargetProcess?.ProcessName) ??"ID", + asm?.Domain.FriendlyName??"Domain Name", + asm?.VirtualMachine.TargetProcess.Id ?? -1 ); OnAssemblyLoaded (assembly.Address); + } catch (Exception e) { //TODO log exception } |