Skip to content

View Modes and Layout

github-actions[bot] edited this page Dec 6, 2026 · 1 revision

View Modes and Central Workspace Layout

GridLock manages the central source editor (EditorTabManager / SourceCodeView) and binary analysis container (DisassemblyView) through a single deterministic state machine (MainWindow::EditorViewMode). Toolbar perspective pills, View -> View Mode menu checkmarks, keyboard shortcuts, and internal DisassemblyView header buttons stay mutually exclusive and synchronized across manual switches and automatic debugger frame transitions.


Central View-Mode Reference Matrix

Mode (EditorViewMode) Toolbar / Header Control View Menu Action Shortcut Visible Central Panes MasterHorizontalSplitter Behavior Automatic Debugger Transition Rules
SOURCE (SourceOnly) #perspectiveSourceBtn (SOURCE) View Mode: Source Only Alt+1 EditorTabManager (SourceCodeView / EditorViewport) only; DisassemblyView hidden Unpins any active disassembly split, sets disassembly width to 0, and allocates 100% of central width to SourceCodeView Default editing mode. If stepping enters a sourceless frame (Auto-Assembly Step Mode), GridLock saves SourceOnly in pre_auto_asm_mode, switches to AsmCfgOnly, and automatically restores full-width SourceOnly upon returning to a frame with DWARF source lines.
SPLIT (SplitSourceAsm) #perspectiveDebugBtn (DEBUG) or pinned Toggle Disassembly Split View Mode: Split Source + Assembly Alt+2 / Ctrl+Alt+D SourceCodeView (left) + DisassemblyView linear listing (right) Restores user-adjusted MasterHorizontalSplitter ratio (m_savedSplitSourceRatio, default 50% / 50%) and records drag changes via QSplitter::splitterMoved Activated when entering the DEBUG perspective or toggling disassembly split. Stepping across sourceless frames keeps both panes visible and restores SplitSourceAsm with the saved splitter ratio when returning to source code.
CFG / ASM (AsmCfgOnly) DisassemblyView #cutterCfgToggleBtn (CFG (Space) / Linear (Space)) View Mode: Assembly / CFG Only Ctrl+Shift+Alt+3 (Space toggles Linear/CFG inside pane) DisassemblyView 2D Control Flow Graph or linear assembly only; SourceCodeView & Decompiler hidden Hides EditorTabManager (width = 0) and allocates 100% width to DisassemblyView without orphaned decompiler splitters Automatically entered when Auto-Assembly Step Mode stops in a sourceless library/PLT/assembly frame while SourceOnly was active; toolbar displays [ASM STEP] and routes F11/F10 to -exec-step-instruction / -exec-next-instruction.
DECOMPILER (DecompilerOnly) DisassemblyView #cutterDecompilerBtn (DECOMPILER) View Mode: Decompiler Only Ctrl+Shift+Alt+4 Standalone pseudo-C decompiler (#decompilerPageContainer) only; SourceCodeView & CFG stack hidden Hides EditorTabManager (width = 0) and collapses the internal assembly/CFG stack ({0, 100%} inside DisassemblyView) Stays active while inspecting stripped functions until the user selects another view mode or clicks SOURCE (Alt+1).
BINARY (BinaryHex) #perspectiveBinaryBtn (BINARY) & #cutterSplitViewBtn (SPLIT (CFG+DECOMP)) View Mode: Binary (CFG + Decompiler) Alt+3 Full-width DisassemblyView in side-by-side 2D CFG + Decompiler split alongside Registers & Memory View docks Hides EditorTabManager (width = 0), allocates 100% central width to DisassemblyView, and splits internal CFG / Decompiler 50% / 50% Shows AddressNavToolbar segment ribbon and synchronizes instruction PC, basic-block highlight, and pseudo-C decompilation on every rank stop.

State-Machine Invariants

  1. Full-Width SOURCE Guarantee: Clicking the toolbar SOURCE button (#perspectiveSourceBtn) or triggering View -> View Mode: Source Only unconditionally clears m_disassemblySplitPinned, sets DisassemblyView minimum width to 0 and isVisible() == false, and gives EditorTabManager 100% of MasterHorizontalSplitter.
  2. Splitter Ratio Persistence: Whenever both EditorTabManager and DisassemblyView are visible in SplitSourceAsm, dragging the MasterHorizontalSplitter handle records the exact horizontal proportion (clamped to [0.15, 0.85]). Toggling to SOURCE, BINARY, or DECOMPILER and back to SPLIT restores that user-chosen ratio instead of resetting to hardcoded pixel widths.
  3. Mutually Exclusive Toggle State:
    • Top-level perspective buttons (SOURCE, DEBUG, BINARY) and the five QActionGroup items in View -> View Mode reflect MainWindow::editorViewMode() without signal feedback loops; MPI docks (Server Rack, Collective Alignment, Message Queues, MPI Diagnostics) remain accessible directly via dock tabs, the bottom MPI rail (Alt+5), and the View menu.
    • Inside DisassemblyView, the three header mode buttons (SPLIT (CFG+DECOMP), CFG (Space), DECOMPILER) update setChecked() deterministically from DisassemblyView::updateViewModeLayout().
  4. Sourceless Frame Recovery (Auto-Assembly Step Mode):
    • When Step Into (F11) enters a frame with no DWARF line table (or a missing source file after path substitution), DebugStepModeController enters Auto-Assembly Step Mode, saves the user's prior EditorViewMode in m_preAutoAsmViewMode, and switches SourceOnly workspaces cleanly into AsmCfgOnly.
    • As soon as execution stops back in a frame with valid source coordinates, GridLock restores *m_preAutoAsmViewMode—collapsing the assembly pane automatically if the user started in SOURCE mode, or preserving side-by-side panes if the user started in SPLIT mode.

Related Guides

Clone this wiki locally