Esempio n. 1
0
        private void RefreshExternHighlightData(System.ReadOnlySpan <uint> externNodes)
        {
            ProtoGraph?   graph      = _ActiveGraph?.InternalProtoGraph;
            ProcessRecord?processrec = graph?.ProcessData;

            if (processrec == null || graph is null)
            {
                return;
            }

            foreach (uint nodeIdx in externNodes)
            {
                NodeData?n = graph.GetNode(nodeIdx);
                System.Diagnostics.Debug.Assert(n is not null);
                if (!_activeHighlights.displayedModules.TryGetValue(n.GlobalModuleID, out moduleEntry modentry))
                {
                    modentry         = new moduleEntry();
                    modentry.symbols = new Dictionary <ulong, symbolInfo>();
                    modentry.path    = processrec.GetModulePath(n.GlobalModuleID);
                    _activeHighlights.displayedModules.Add(n.GlobalModuleID, modentry);
                }
                if (!modentry.symbols.TryGetValue(n.Address, out symbolInfo symentry))
                {
                    symentry          = new symbolInfo();
                    symentry.address  = n.Address;
                    symentry.selected = false;
                    symentry.moduleID = n.GlobalModuleID;

                    string?foundName;
                    if (processrec.GetSymbol(n.GlobalModuleID, n.Address, out foundName) && foundName is not null)
                    {
                        symentry.name = foundName;
                    }
                    else
                    {
                        symentry.name = "[No Symbol Name]";
                    }
                    symentry.threadNodes = new List <uint>()
                    {
                        n.Index
                    };

                    modentry.symbols.Add(n.Address, symentry);
                }
                else
                {
                    if (!symentry.threadNodes.Contains(n.Index))
                    {
                        symentry.threadNodes.Add(n.Index);
                    }
                }
            }
            _activeHighlights.LastExternNodeCount = externNodes.Length;
        }
Esempio n. 2
0
 private static void HandleMouseoverSym(PlottedGraph plot, moduleEntry module_modentry, symbolInfo syminfo)
 {
     module_modentry.symbols[syminfo.address] = syminfo;
     if (syminfo.hovered)
     {
         plot.AddHighlightedNodes(syminfo.threadNodes, CONSTANTS.HighlightType.Externals);
     }
     else
     {
         plot.RemoveHighlightedNodes(syminfo.threadNodes, CONSTANTS.HighlightType.Externals);
     }
 }
Esempio n. 3
0
        private void HandleSelectedSym(PlottedGraph plot, moduleEntry module_modentry, symbolInfo syminfo)
        {
            syminfo.selected = !syminfo.selected;
            module_modentry.symbols[syminfo.address] = syminfo;

            plot.LayoutState.Lock.EnterUpgradeableReadLock();
            plot.LayoutState.GetAttributes(plot.ActiveLayoutStyle, out float[]? attribsArray);


            if (syminfo.selected)
            {
                plot.AddHighlightedNodes(syminfo.threadNodes, CONSTANTS.HighlightType.Externals);
                _activeHighlights.SelectedSymbols.Add(syminfo);
            }
            else
            {
                plot.RemoveHighlightedNodes(syminfo.threadNodes, CONSTANTS.HighlightType.Externals);
                _activeHighlights.SelectedSymbols = _activeHighlights.SelectedSymbols.Where(s => s.address != syminfo.address).ToList();
            }
            plot.LayoutState.Lock.ExitUpgradeableReadLock();
        }