Пример #1
0
 string TryGetExceptionMessage(CorValue exObj)
 {
     if (EvalReflectionUtils.ReadExceptionMessage(exObj, out var message))
     {
         return(message ?? dnSpy_Debugger_DotNet_CorDebug_Resources.ExceptionMessageIsNull);
     }
     return(null);
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }