예제 #1
0
        public void WriteObjectId(ITextColorWriter output, ValueNode vm)
        {
            Debug.Assert(ObjectIdService != null);
            if (ObjectIdService == null)
            {
                return;
            }
            var vmImpl = (ValueNodeImpl)vm;

            if (vmImpl.RawNode is DebuggerValueRawNode rawNode)
            {
                var language = Language;
                Debug.Assert(language != null);
                if (language == null)
                {
                    return;
                }
                var value = rawNode.DebuggerValueNode.Value;
                if (value == null)
                {
                    return;
                }
                var objectId = ObjectIdService.GetObjectId(value);
                if (objectId != null)
                {
                    output.WriteSpace();
                    output.Write(BoxedTextColor.Punctuation, "{");
                    var evalInfo = vmImpl.Context.EvaluationInfo;
                    Debug.Assert(evalInfo != null);
                    if (evalInfo == null)
                    {
                        output.Write(BoxedTextColor.Error, "???");
                    }
                    else
                    {
                        language.Formatter.FormatObjectIdName(evalInfo.Context, output, objectId.Id);
                    }
                    output.Write(BoxedTextColor.Punctuation, "}");
                }
            }
        }
예제 #2
0
        public void WriteObjectId(IDbgTextWriter output, ValueNode vm)
        {
            Debug2.Assert(!(ObjectIdService is null));
            if (ObjectIdService is null)
            {
                return;
            }
            var vmImpl = (ValueNodeImpl)vm;

            if (vmImpl.RawNode is DebuggerValueRawNode rawNode)
            {
                var language = Language;
                Debug2.Assert(!(language is null));
                if (language is null)
                {
                    return;
                }
                var value = rawNode.DebuggerValueNode.Value;
                if (value is null)
                {
                    return;
                }
                var objectId = ObjectIdService.GetObjectId(value);
                if (!(objectId is null))
                {
                    output.Write(DbgTextColor.Text, " ");
                    output.Write(DbgTextColor.Punctuation, "{");
                    var evalInfo = vmImpl.Context.EvaluationInfo;
                    Debug2.Assert(!(evalInfo is null));
                    if (evalInfo is null)
                    {
                        output.Write(DbgTextColor.Error, "???");
                    }
                    else
                    {
                        language.Formatter.FormatObjectIdName(evalInfo.Context, output, objectId.Id);
                    }
                    output.Write(DbgTextColor.Punctuation, "}");
                }
            }
        }