private void DrawExceptionSelectBox(PlottedGraph plot) { uint[]? exceptionNodes = plot.InternalProtoGraph.GetExceptionNodes(); if (exceptionNodes is null || exceptionNodes.Length == 0) { string caption = $"No exceptions recorded in thread ID {_ActiveGraph?.TID}"; ImGuiUtils.DrawRegionCenteredText(caption); return; } string[] labels = exceptionNodes.Select(x => x.ToString()).ToArray(); if (ImGui.BeginTable("##ExceptionsTable", 2, ImGuiTableFlags.ScrollY | ImGuiTableFlags.RowBg, ImGui.GetContentRegionAvail() - new Vector2(10, _activeHighlights.SelectedExceptionNodes.Any() ? 30 : 0))) { ImGui.TableSetupColumn("Address", ImGuiTableColumnFlags.WidthFixed, 160); ImGui.TableSetupColumn("Module"); ImGui.TableSetupScrollFreeze(0, 1); ImGui.TableHeadersRow(); foreach (uint nodeidx in exceptionNodes) { NodeData?n = plot.InternalProtoGraph.GetNode(nodeidx); if (n is not null) { ImGui.TableNextRow(); if (ImGui.TableNextColumn()) { if (ImGui.Selectable($"0x{n.Address:X}", _activeHighlights.SelectedExceptionNodes.Contains(nodeidx), ImGuiSelectableFlags.SpanAllColumns)) { if (_activeHighlights.SelectedExceptionNodes.Contains(nodeidx)) { _activeHighlights.SelectedExceptionNodes.Remove(nodeidx); plot.RemoveHighlightedNodes(new List <uint> { nodeidx }, CONSTANTS.HighlightType.Exceptions); } else { _activeHighlights.SelectedExceptionNodes.Add(nodeidx); plot.AddHighlightedNodes(new List <uint> { nodeidx }, CONSTANTS.HighlightType.Exceptions); } } } if (ImGui.TableNextColumn()) { ImGui.Text(System.IO.Path.GetFileName(plot.InternalProtoGraph.ProcessData.GetModulePath(n.GlobalModuleID))); } } } ImGui.EndTable(); } }
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); } }
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(); }