From f8efa7bc8583e2134655b37b6ac4e7a5ff1edbed Mon Sep 17 00:00:00 2001 From: Jonathan CHang Date: Thu, 7 Jul 2022 15:43:43 -0500 Subject: try catch + nukk check --- Mono.Debugging.Soft/SoftDebuggerSession.cs | 34 ++++++++++++++++-------------- 1 file 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 } -- cgit v1.2.3