string TryGetExceptionMessage(CorValue exObj) { if (EvalReflectionUtils.ReadExceptionMessage(exObj, out var message)) { return(message ?? dnSpy_Debugger_DotNet_CorDebug_Resources.ExceptionMessageIsNull); } return(null); }
static ulong?GetManagedId(DnThread thread) { var threadObj = TryGetThreadObject(thread); if (threadObj == null) { return(null); } // mscorlib 2.0 and 4.0 and CoreCLR all use this field name if (!EvalReflectionUtils.ReadValue(threadObj, "m_ManagedThreadId", out int managedId)) { return(null); } return((uint)managedId); }
static string GetThreadName(DnThread thread) { var threadObj = TryGetThreadObject(thread); if (threadObj == null) { return(null); } // mscorlib 2.0 and 4.0 and CoreCLR all use this field name. It's unlikely to change since // VS' debugger probably hard codes the name as well. if (!EvalReflectionUtils.ReadValue(threadObj, "m_Name", out string name)) { return(null); } return(name); }