# epasveer/seer architecture

> Architecture diagram of the GitHub repository epasveer/seer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/epasveer/seer
- Repository: https://github.com/epasveer/seer

## Overview

##### Project type and purpose
- Project type: Desktop GUI application (C++17/Qt6) that serves as a front-end to GDB’s Machine Interface (MI) for Linux.
- Purpose: Provide a user-friendly interface for launching and controlling GDB, visualizing source, assembly, memory, arrays, structs, threads, stack frames, breakpoints, watchpoints, catchpoints, printpoints, and reverse debugging.

##### File structure
- Top-level directories
- src/            – All C++ source (.cpp/.h), Qt UI definitions (.ui), QRC resource files, and the main entrypoints (seergdb.cpp, seerutl_test.cpp).
- tests/          – Integration and example tests against various languages and platforms (Rpi4, C, Fortran, Ada, CUDA, Rust, etc.).
- debian/, .github/ – Packaging scripts and CI workflows for multiple OS targets.
- notes/, images/ – Design notes and screenshots.
- Key patterns
- Modular Qt widgets for each view (e.g., SeerConsoleWidget, SeerMemoryVisualizerWidget).
- A GdbMonitor class to encapsulate GDB MI interaction.
- Multiple “browser” widgets implementing MVC-style separation:
– Model: QAbstractItemModel subclasses hold data (e.g., SeerBreakpointModel).
– View: Qt widgets (QTreeView, QTextEdit) render data.
– Controller: Slots and commands injected into GdbMonitor.
- CMake build structure with build_seerutl subproject for command-line helper.

##### README for additional insights
- Confirms dependencies: C++17, Qt6 (Widgets, Charts, Svg, PrintSupport), CMake, GDB MI.
- Describes core UI areas: Code Manager, Variable/Register Info, Breakpoint/Watchpoint/Catchpoint/Printpoint managers, Stack/Thread explorers, Memory/Array/Struct/Image visualizers, Reverse Debugging controls.
- Emphasizes GDB MI protocol as communication channel.

##### Elements
- Clear labels for each block (component name and role).
- UI → Logic → GdbMonitor → GDB
- GDB → GdbMonitor → Models → UI
- Blue rectangles for UI components.
- Green rectangles for core logic/models.
- Orange ellipse for GdbMonitor / communication layer.
- Use connectors with labels like “MI Request”, “MI Response”, “Signal/Slot”.

##### Detail
- How QProcess is invoked and stdout parsed.
- Packaging and CI as external processes if relevant.
- Don’t over-aggregate—represent each major feature area as its own component.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        MW["MainWindow & Menu"]:::ui
        CBW["Code Manager"]:::ui
        VarM["Variable Manager"]:::ui
        RegB["Register Values Browser"]:::ui
        BP["Breakpoints Panel"]:::ui
        WP["Watchpoints Panel"]:::ui
        CP["Catchpoints Panel"]:::ui
        PP["Printpoints Panel"]:::ui
        SM["Stack Manager"]:::ui
        TM["Thread Manager"]:::ui
        subgraph "Data Visualizers"
            direction TB
            MemV["Memory Visualizer"]:::ui
            ArrV["Array Visualizer"]:::ui
            StrV["Struct Visualizer"]:::ui
            ImgV["Image Visualizer"]:::ui
            MatV["Matrix Visualizer"]:::ui
            HexV["Hex Widget"]:::ui
            VarV["Var Visualizer"]:::ui
        end
        Console["Console & Manual Command"]:::ui
    end

    %% Logic & Models
    subgraph "Application Logic & Models"
        direction TB
        CoreUtl["Core Utilities"]:::logic
        HistLE["History Line Edit"]:::logic
        DirF["Directory Filter Model"]:::logic
        ExecF["Executable Filter Model"]:::logic
        subgraph "Config & Settings"
            direction TB
            GenC["General Config Page"]:::logic
            GdbC["GDB Config Page"]:::logic
            AsmC["Assembly Config Page"]:::logic
            EditC["Editor Config Page"]:::logic
            KeysC["Keys Config Page"]:::logic
            RRC["RR Config Page"]:::logic
            SrcC["Source Config Page"]:::logic
            HighS["Highlighter Settings"]:::logic
            KeyS["Key Settings"]:::logic
        end
        subgraph "Syntax Highlighters"
            direction TB
            CppH["C++ Highlighter"]:::logic
            RustH["Rust Highlighter"]:::logic
            OdinH["Odin Highlighter"]:::logic
            GenH["Generic Source Highlighter"]:::logic
        end
    end

    %% GDB MI Communication Layer
    subgraph "GDB MI Communication" 
        direction TB
        GM["GdbMonitor"]:::comm
        PIW["Process Info Widget"]:::comm
        MIPy["MI-Python Scripts"]:::comm
    end

    %% Persistence & Config
    ConfigStorage["Config Storage (ini/json)"]:::persist

    %% External GDB Process
    GDB["GDB Process"]:::external

    %% Resources & Side
    Resources["Resource Layer (QRC, Icons, Help, Themes)"]:::side
    SeerUtl["seerutl CLI Helper"]:::side
    Tests["Integration Tests"]:::side
    CI["CI/Packaging Workflows"]:::side

    %% Relationships
    MW -->|uses| CoreUtl
    CBW -->|queries| CoreUtl
    VarM -->|binds to| CoreUtl
    RegB -->|binds to| CoreUtl
    BP -->|binds to| CoreUtl
    WP -->|binds to| CoreUtl
    CP -->|binds to| CoreUtl
    PP -->|binds to| CoreUtl
    SM -->|binds to| CoreUtl
    TM -->|binds to| CoreUtl
    MEM_VIS["Data Visualizers"] -->|updates| CoreUtl
    
    MW -->|triggers| GM
    CBW -->|"MI Request"| GM
    VarM -->|"MI Request"| GM
    RegB -->|"MI Request"| GM
    BP -->|"MI Request"| GM
    SM -->|"MI Request"| GM
    TM -->|"MI Request"| GM
    Console -->|"manual MI"| GM

    GM -->|"MI Response"| CoreUtl
    GM -->|launches| GDB
    GDB -->|stdout| GM
    GM -->|signals| CoreUtl
    CoreUtl -->|updates| MW

    GenC -->|loads/saves| ConfigStorage
    GdbC -->|loads/saves| ConfigStorage
    AsmC -->|loads/saves| ConfigStorage

    MW -->|loads| Resources
    Tests -->|invoke| MW
    Tests -->|invoke| SeerUtl
    SeerUtl -->|uses| GM
    CI -->|packages| MW
    CI -->|packages| SeerUtl

    %% Click Events
    click MW "https://github.com/epasveer/seer/blob/main/src/SeerMainWindow.h"
    click CBW "https://github.com/epasveer/seer/blob/main/src/SeerSourceBrowserWidget.h"
    click VarM "https://github.com/epasveer/seer/blob/main/src/SeerVariableManagerWidget.h"
    click RegB "https://github.com/epasveer/seer/blob/main/src/SeerRegisterValuesBrowserWidget.h"
    click BP "https://github.com/epasveer/seer/blob/main/src/SeerBreakpointsBrowserWidget.h"
    click WP "https://github.com/epasveer/seer/blob/main/src/SeerWatchpointsBrowserWidget.h"
    click CP "https://github.com/epasveer/seer/blob/main/src/SeerCatchpointsBrowserWidget.h"
    click PP "https://github.com/epasveer/seer/blob/main/src/SeerPrintpointsBrowserWidget.h"
    click SM "https://github.com/epasveer/seer/blob/main/src/SeerStackManagerWidget.h"
    click TM "https://github.com/epasveer/seer/blob/main/src/SeerThreadManagerWidget.h"
    click MemV "https://github.com/epasveer/seer/blob/main/src/SeerMemoryVisualizerWidget.h"
    click ArrV "https://github.com/epasveer/seer/blob/main/src/SeerArrayVisualizerWidget.h"
    click StrV "https://github.com/epasveer/seer/blob/main/src/SeerStructVisualizerWidget.h"
    click ImgV "https://github.com/epasveer/seer/blob/main/src/SeerImageVisualizerWidget.h"
    click MatV "https://github.com/epasveer/seer/blob/main/src/SeerMatrixVisualizerWidget.h"
    click HexV "https://github.com/epasveer/seer/blob/main/src/SeerHexWidget.h"
    click VarV "https://github.com/epasveer/seer/blob/main/src/SeerVarVisualizerWidget.h"
    click Console "https://github.com/epasveer/seer/blob/main/src/SeerConsoleWidget.h"
    click GenC "https://github.com/epasveer/seer/blob/main/src/SeerConfigDialog.h"
    click GdbC "https://github.com/epasveer/seer/blob/main/src/SeerGdbConfigPage.h"
    click AsmC "https://github.com/epasveer/seer/blob/main/src/SeerAssemblyConfigPage.h"
    click EditC "https://github.com/epasveer/seer/blob/main/src/SeerEditorConfigPage.h"
    click KeysC "https://github.com/epasveer/seer/blob/main/src/SeerKeysConfigPage.h"
    click RRC "https://github.com/epasveer/seer/blob/main/src/SeerRRConfigPage.h"
    click SrcC "https://github.com/epasveer/seer/blob/main/src/SeerSourceConfigPage.h"
    click HighS "https://github.com/epasveer/seer/blob/main/src/SeerHighlighterSettings.h"
    click KeyS "https://github.com/epasveer/seer/blob/main/src/SeerKeySettings.h"
    click CoreUtl "https://github.com/epasveer/seer/blob/main/src/SeerUtl.h"
    click HistLE "https://github.com/epasveer/seer/blob/main/src/SeerHistoryLineEdit.h"
    click DirF "https://github.com/epasveer/seer/blob/main/src/SeerDirectoryFilterProxyModel.h"
    click ExecF "https://github.com/epasveer/seer/blob/main/src/SeerExecutableFilterProxyModel.h"
    click CppH "https://github.com/epasveer/seer/blob/main/src/SeerCppSourceHighlighter.h"
    click RustH "https://github.com/epasveer/seer/blob/main/src/SeerRustSourceHighlighter.h"
    click OdinH "https://github.com/epasveer/seer/blob/main/src/SeerOdinSourceHighlighter.h"
    click GenH "https://github.com/epasveer/seer/blob/main/src/SeerSourceHighlighter.h"
    click GM "https://github.com/epasveer/seer/blob/main/src/GdbMonitor.h"
    click PIW "https://github.com/epasveer/seer/blob/main/src/QProcessInfoWidget.h"
    click MIPy "https://github.com/epasveer/seer/tree/main/src/resources/mi-python/"
    click Resources "https://github.com/epasveer/seer/blob/main/src/resource.qrc"
    click SeerUtl "https://github.com/epasveer/seer/blob/main/src/build_seerutl/CMakeLists.txt"
    click Tests "https://github.com/epasveer/seer/tree/main/tests/"
    click CI "https://github.com/epasveer/seer/tree/main/ .github/workflows/"
    
    %% Styles
    classDef ui fill:#cce5ff,stroke:#66b0ff,stroke-width:1px
    classDef logic fill:#d4edda,stroke:#8fd19e,stroke-width:1px
    classDef comm fill:#ffe5b4,stroke:#ffcc80,stroke-width:1px
    classDef persist fill:#e2e3e5,stroke:#bdbfc1,stroke-width:1px,stroke-dasharray: 5 5
    classDef external fill:none,stroke:#6c757d,stroke-width:1px,stroke-dasharray: 5 5
    classDef side fill:#f8d7da,stroke:#f5c6cb,stroke-width:1px,stroke-dasharray: 2 2
```
