コード例 #1
0
ファイル: AD7Property.cs プロジェクト: zachwieja/RTVS
 int IDebugProperty3.GetCustomViewerList(uint celtSkip, uint celtRequested, DEBUG_CUSTOM_VIEWER[] rgViewers, out uint pceltFetched)
 {
     if (celtSkip > 0 || celtRequested == 0)
     {
         pceltFetched = 0;
     }
     else
     {
         pceltFetched = 1;
         rgViewers[0] = new DEBUG_CUSTOM_VIEWER {
             bstrMenuName = "Grid Visualizer",
             bstrMetric   = "CustomViewerCLSID",
             guidLang     = DebuggerGuids.LanguageGuid,
             guidVendor   = DebuggerGuids.VendorGuid,
             dwID         = 0
         };
     }
     return(VSConstants.S_OK);
 }
コード例 #2
0
ファイル: AD7Property.cs プロジェクト: lioaphy/nodejstools
 public int GetCustomViewerList(uint celtSkip, uint celtRequested, DEBUG_CUSTOM_VIEWER[] rgViewers, out uint pceltFetched) {
     pceltFetched = 0;
     return VSConstants.E_NOTIMPL;
 }
コード例 #3
0
ファイル: AD7Property.cs プロジェクト: robindegen/MIEngine
 public int GetCustomViewerList(uint celtSkip, uint celtRequested, DEBUG_CUSTOM_VIEWER[] rgViewers, out uint pceltFetched)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
        public int DisplayValue(uint ownerHwnd, uint visualizerId, IDebugProperty3 debugProperty)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            try
            {
                DEBUG_PROPERTY_INFO[] propertyInfo = new DEBUG_PROPERTY_INFO[1];
                debugProperty.GetPropertyInfo(
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_STANDARD |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE_RAW,
                    10 /* Radix */,
                    10000 /* Eval Timeout */,
                    new IDebugReference2[] { },
                    0,
                    propertyInfo);

                DebugValue debugValue = new DebugValue();
                debugValue.visualizerId = visualizerId;

                int index = propertyInfo[0].bstrType.IndexOf(" {");
                if (index != -1)
                {
                    propertyInfo[0].bstrType = propertyInfo[0].bstrType.Remove(index);
                }
                bool isPointer   = IsEndsWith(propertyInfo[0].bstrType, "*") || IsEndsWith(propertyInfo[0].bstrType, "* const");
                bool isReference = IsEndsWith(propertyInfo[0].bstrType, "&");

                string variableName = propertyInfo[0].bstrName;
                if (propertyInfo[0].bstrFullName != propertyInfo[0].bstrName)
                {
                    variableName = Regex.Match(propertyInfo[0].bstrFullName, @"^[^$.-]*").Value + "..." + variableName;
                }
                debugValue.variableName = Regex.Replace(variableName, @"[""'\/ ]", "_");

                debugValue.expressionResult = ExecuteExpression((isPointer ? "" : "&") + propertyInfo[0].bstrFullName);
                if (Parse(debugValue.expressionResult, 16).GetValueOrDefault(0) == 0)
                {
                    throw new Exception("Incorrect argument!");
                }

                string typeName = null;
                if (visualizerId > 1000)
                {
                    debugProperty.GetCustomViewerCount(out uint viewersCount);
                    DEBUG_CUSTOM_VIEWER[] viewers = new DEBUG_CUSTOM_VIEWER[viewersCount];
                    debugProperty.GetCustomViewerList(0, viewersCount, viewers, out uint _);

                    for (uint i = 0; i != viewersCount; ++i)
                    {
                        if (System.Guid.Parse(viewers[i].bstrMetric) == typeof(IRuntimeDumperService).GUID &&
                            viewers[i].dwID == visualizerId)
                        {
                            debugValue.externalDumper = viewers[i].bstrMenuName;
                            typeName = viewers[i].bstrDescription;
                            break;
                        }
                    }
                    if (debugValue.externalDumper is null)
                    {
                        throw new Exception("External dumper is not found!");
                    }
                }
                else if (isReference)
                {
                    int length = propertyInfo[0].bstrType.Length;
                    typeName = propertyInfo[0].bstrType.Substring(0, length - 1) + " *";
                }
                else if (isPointer)
                {
                    typeName = propertyInfo[0].bstrType;
                }
                else
                {
                    typeName = propertyInfo[0].bstrType + " *";
                }
                debugValue.typeName = @"\""" + Regex.Replace(typeName, @"[\w.]+!", "") + @"\""";

                debugValues.Add(debugValue);
                int count = debugValues.Count;
                _ = System.Threading.Tasks.Task.Delay(1000).ContinueWith(t =>
                {
                    Dump(count);
                }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext());
            }
            catch (Exception ex)
            {
                dte.StatusBar.Text = "[Dumper] " + ex.Message;
                dte.StatusBar.Highlight(true);
                Utils.PrintMessage("Debug", "[Dumper] [ERROR] " + ex.Message, true);
                Utils.PrintMessage("Dumper", "[Dumper] [ERROR] " + ex.Message + "\n" + ex.StackTrace);
            }

            return(0);
        }
コード例 #5
0
ファイル: AD7Property.cs プロジェクト: AlexanderSher/RTVS-Old
 int IDebugProperty3.GetCustomViewerList(uint celtSkip, uint celtRequested, DEBUG_CUSTOM_VIEWER[] rgViewers, out uint pceltFetched) {
     if (celtSkip > 0 || celtRequested == 0) {
         pceltFetched = 0;
     } else {
         pceltFetched = 1;
         rgViewers[0] = new DEBUG_CUSTOM_VIEWER {
             bstrMenuName = "Grid Visualizer",
             bstrMetric = "CustomViewerCLSID",
             guidLang = DebuggerGuids.LanguageGuid,
             guidVendor = DebuggerGuids.VendorGuid,
             dwID = 0
         };
     }
     return VSConstants.S_OK;
 }