LLDB mainline
lldb_private::Statusline Class Reference

#include <Statusline.h>

Public Types

using Context = std::pair<ExecutionContextRef, SymbolContext>

Public Member Functions

 Statusline (Debugger &debugger)
 ~Statusline ()
void Enable (std::optional< ExecutionContextRef > exe_ctx_ref)
 Reduce the scroll window and draw the statusline.
void Disable ()
 Hide the statusline and extend the scroll window.
void Redraw (std::optional< ExecutionContextRef > exe_ctx_ref)
 Redraw the statusline.
void ClearExecutionContext ()
 Clear the cached execution context to discard stale pointers.
void TerminalSizeChanged ()
 Inform the statusline that the terminal dimensions have changed.

Private Types

enum  ScrollWindowMode { EnableStatusline , DisableStatusline , ResizeStatusline }

Private Member Functions

void Draw (std::string msg)
 Draw the statusline with the given text.
void UpdateScrollWindow (ScrollWindowMode mode, uint64_t prev_width=0, uint64_t prev_height=0)
 Set the scroll window for the given mode.

Private Attributes

Debuggerm_debugger
ExecutionContextRef m_exe_ctx_ref
 Cached copy of the execution context that allows us to redraw the statusline.
uint64_t m_terminal_width = 0
uint64_t m_terminal_height = 0

Detailed Description

Definition at line 19 of file Statusline.h.

Member Typedef Documentation

◆ Context

Definition at line 24 of file Statusline.h.

Member Enumeration Documentation

◆ ScrollWindowMode

Enumerator
EnableStatusline 
DisableStatusline 
ResizeStatusline 

Definition at line 45 of file Statusline.h.

Constructor & Destructor Documentation

◆ Statusline()

Statusline::Statusline ( Debugger & debugger)

Definition at line 38 of file Statusline.cpp.

References m_debugger, m_terminal_height, and m_terminal_width.

◆ ~Statusline()

Statusline::~Statusline ( )

Definition at line 42 of file Statusline.cpp.

References Disable().

Member Function Documentation

◆ ClearExecutionContext()

void Statusline::ClearExecutionContext ( )

Clear the cached execution context to discard stale pointers.

Definition at line 171 of file Statusline.cpp.

References m_exe_ctx_ref.

◆ Disable()

void Statusline::Disable ( )

Hide the statusline and extend the scroll window.

Definition at line 67 of file Statusline.cpp.

References DisableStatusline, and UpdateScrollWindow().

Referenced by ~Statusline().

◆ Draw()

void Statusline::Draw ( std::string msg)
private

◆ Enable()

void Statusline::Enable ( std::optional< ExecutionContextRef > exe_ctx_ref)

Reduce the scroll window and draw the statusline.

Definition at line 59 of file Statusline.cpp.

References EnableStatusline, Redraw(), and UpdateScrollWindow().

◆ Redraw()

void Statusline::Redraw ( std::optional< ExecutionContextRef > exe_ctx_ref)

◆ TerminalSizeChanged()

void Statusline::TerminalSizeChanged ( )

Inform the statusline that the terminal dimensions have changed.

Definition at line 44 of file Statusline.cpp.

References m_debugger, m_terminal_height, m_terminal_width, Redraw(), ResizeStatusline, and UpdateScrollWindow().

◆ UpdateScrollWindow()

void Statusline::UpdateScrollWindow ( ScrollWindowMode mode,
uint64_t prev_width = 0,
uint64_t prev_height = 0 )
private

Set the scroll window for the given mode.

On a resize, prev_width and prev_height are the dimensions the statusline was last drawn at, used to clear the rows it still occupies.

Definition at line 98 of file Statusline.cpp.

References ANSI_CLEAR_BELOW, ANSI_RESTORE_CURSOR, ANSI_SAVE_CURSOR, ANSI_SET_SCROLL_ROWS, ANSI_TO_START_OF_ROW, ANSI_UP_ROWS, DisableStatusline, EnableStatusline, m_debugger, m_terminal_height, m_terminal_width, lldb_private::Stream::Printf(), and ResizeStatusline.

Referenced by Disable(), Enable(), and TerminalSizeChanged().

Member Data Documentation

◆ m_debugger

Debugger& lldb_private::Statusline::m_debugger
private

Definition at line 57 of file Statusline.h.

Referenced by Draw(), Redraw(), Statusline(), TerminalSizeChanged(), and UpdateScrollWindow().

◆ m_exe_ctx_ref

ExecutionContextRef lldb_private::Statusline::m_exe_ctx_ref
private

Cached copy of the execution context that allows us to redraw the statusline.

Definition at line 61 of file Statusline.h.

Referenced by ClearExecutionContext(), and Redraw().

◆ m_terminal_height

uint64_t lldb_private::Statusline::m_terminal_height = 0
private

Definition at line 64 of file Statusline.h.

Referenced by Draw(), Statusline(), TerminalSizeChanged(), and UpdateScrollWindow().

◆ m_terminal_width

uint64_t lldb_private::Statusline::m_terminal_width = 0
private

Definition at line 63 of file Statusline.h.

Referenced by Draw(), Statusline(), TerminalSizeChanged(), and UpdateScrollWindow().


The documentation for this class was generated from the following files: