-
Notifications
You must be signed in to change notification settings - Fork 30
Description
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
-
No Visual Distinction: The State column renders frozen and unfrozen states as plain text in the default
WindowTextcolor (seethreadframes.cpp:330-335):case ThreadFrameModel::StateColumn: { painter->setPen(option.palette.color(QPalette::WindowText).rgba()); painter->drawText(textRect, data.toString()); // Just "Frozen" or "Unfrozen" break; }
-
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.
-
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
- Launch a multi-threaded application in the debugger
- Right-click on a thread in the Threads widget
- Select "Make It Solo Thread" to freeze all other threads
- Observe the State column for other threads
- Expected: Other threads should show "Frozen" status with visual indication
- 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:
- Frozen/suspended threads should be visually distinct from running threads
- The frozen status should update reliably when threads are suspended or resumed
- Users should be able to identify thread states at a glance without reading text
Proposed Fixes
High Priority: Fix Status Updates
- Investigate why
m_isFrozenstate is not being updated or displayed correctly - Ensure
SuspendThread()andResumeThread()properly update the thread state - Verify that the widget refreshes when thread states change
Visual Improvements (following industry standards):
-
Color Coding (Easiest to implement):
- Frozen threads: Red or orange text
- Running threads: Green text
- Example from Visual Studio threads window
-
Icons (Best practice):
- ⏸️ Pause icon for frozen threads
▶️ Play icon for running threads- Used by Visual Studio and JetBrains Rider
-
Background Color:
- Light red/orange background for entire row of frozen threads
- Helps distinguish at a glance in dense thread lists
-
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 (
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 textThreadFramesItemDelegate::paint()- Renders state columnThreadFramesWidget::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
- First: Fix the status update issue - ensure frozen state is correctly tracked and displayed
- Second: Add color coding to State column (minimal code change, immediate visual benefit)
- Third: Consider adding icons for professional appearance matching other debuggers