Skip to content

Threads Widget: Poor Visual Indication for Frozen/Solo Thread Status #975

@xusheng6

Description

@xusheng6

Threads Widget: Poor Visual Indication for Frozen/Solo Thread Status

Version and Platform:

  • Binary Ninja Version: [Development build]
  • OS: Windows
  • OS Version: [Current]
  • CPU Architecture: x64
  • Local or Remote Debugging: Local

Bug Description

The threads widget does not provide adequate visual indication for frozen/solo thread status. The State column shows only plain text ("Frozen" or "Unfrozen") with no visual distinction such as color coding, icons, or styling. Additionally, the frozen status indication does not appear to be working correctly - threads that should be shown as frozen are not being displayed with the correct status.

Current Implementation Issues

  1. No Visual Distinction: The State column renders frozen and unfrozen states as plain text in the default WindowText color (see threadframes.cpp:330-335):

    case ThreadFrameModel::StateColumn:
    {
        painter->setPen(option.palette.color(QPalette::WindowText).rgba());
        painter->drawText(textRect, data.toString());  // Just "Frozen" or "Unfrozen"
        break;
    }
  2. Status Not Updating: The frozen status indication does not seem to work at all - when threads are suspended/frozen (e.g., via "Make It Solo Thread"), the State column does not reliably reflect the frozen state.

  3. Hard to Distinguish at a Glance: Users must carefully read text rather than seeing visual cues, making it difficult to quickly identify which threads are frozen in multi-threaded debugging sessions.

Steps To Reproduce

  1. Launch a multi-threaded application in the debugger
  2. Right-click on a thread in the Threads widget
  3. Select "Make It Solo Thread" to freeze all other threads
  4. Observe the State column for other threads
  5. Expected: Other threads should show "Frozen" status with visual indication
  6. Actual: Status may not update, or shows plain text with no visual distinction

Expected Behavior

The threads widget should provide clear, immediate visual feedback for thread states:

  1. Frozen/suspended threads should be visually distinct from running threads
  2. The frozen status should update reliably when threads are suspended or resumed
  3. Users should be able to identify thread states at a glance without reading text

Proposed Fixes

High Priority: Fix Status Updates

  • Investigate why m_isFrozen state is not being updated or displayed correctly
  • Ensure SuspendThread() and ResumeThread() properly update the thread state
  • Verify that the widget refreshes when thread states change

Visual Improvements (following industry standards):

  1. Color Coding (Easiest to implement):

    • Frozen threads: Red or orange text
    • Running threads: Green text
    • Example from Visual Studio threads window
  2. Icons (Best practice):

    • ⏸️ Pause icon for frozen threads
    • ▶️ Play icon for running threads
    • Used by Visual Studio and JetBrains Rider
  3. Background Color:

    • Light red/orange background for entire row of frozen threads
    • Helps distinguish at a glance in dense thread lists
  4. Font Styling:

    • Bold or italic for frozen threads
    • Additional visual emphasis

Reference Implementation Examples

Visual Studio: Uses pause icon (⏸️) for frozen threads and play icon (▶️) for running threads

JetBrains Rider: Shows frozen threads with icon indicators

Code Locations

Files to modify:

  • ui/threadframes.cpp - Lines 330-335 (StateColumn rendering)
  • ui/threadframes.cpp - Lines 95-105 (StateColumn data model)
  • ui/threadframes.h - ThreadFramesItemDelegate class

Key functions:

  • ThreadFrameModel::data() - Returns state text
  • ThreadFramesItemDelegate::paint() - Renders state column
  • ThreadFramesWidget::makeItSoloThread() - Sets solo thread (lines 406-432)

Additional Context

The current implementation prioritizes the active thread indicator ("(*)" prefix + bold) but provides minimal feedback for frozen/suspended state, which is equally important for multi-threaded debugging. The "Make It Solo Thread" feature is useful but lacks clear visual feedback about which threads are affected.

Impact: This makes multi-threaded debugging more difficult, especially when working with applications that have many threads. Users cannot quickly determine which threads are frozen vs running, potentially leading to confusion about debugger state.

Suggested Implementation Order

  1. First: Fix the status update issue - ensure frozen state is correctly tracked and displayed
  2. Second: Add color coding to State column (minimal code change, immediate visual benefit)
  3. Third: Consider adding icons for professional appearance matching other debuggers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions