LLDB mainline
Statusline.h
Go to the documentation of this file.
1//===-- Statusline.h -----------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_CORE_STATUSLINE_H
10#define LLDB_CORE_STATUSLINE_H
11
14#include "lldb/lldb-forward.h"
15#include <cstdint>
16#include <string>
17
18namespace lldb_private {
20public:
21 Statusline(Debugger &debugger);
23
24 using Context = std::pair<ExecutionContextRef, SymbolContext>;
25
26 /// Reduce the scroll window and draw the statusline.
27 void Enable(std::optional<ExecutionContextRef> exe_ctx_ref);
28
29 /// Hide the statusline and extend the scroll window.
30 void Disable();
31
32 /// Redraw the statusline.
33 void Redraw(std::optional<ExecutionContextRef> exe_ctx_ref);
34
35 /// Clear the cached execution context to discard stale pointers.
37
38 /// Inform the statusline that the terminal dimensions have changed.
40
41private:
42 /// Draw the statusline with the given text.
43 void Draw(std::string msg);
44
50
51 /// Set the scroll window for the given mode. On a resize, \p prev_width and
52 /// \p prev_height are the dimensions the statusline was last drawn at, used
53 /// to clear the rows it still occupies.
54 void UpdateScrollWindow(ScrollWindowMode mode, uint64_t prev_width = 0,
55 uint64_t prev_height = 0);
56
58
59 /// Cached copy of the execution context that allows us to redraw the
60 /// statusline.
62
63 uint64_t m_terminal_width = 0;
64 uint64_t m_terminal_height = 0;
65};
66} // namespace lldb_private
67#endif // LLDB_CORE_STATUSLINE_H
A class to manage flag bits.
Definition Debugger.h:100
Execution context objects refer to objects in the execution of the program that is being debugged.
void UpdateScrollWindow(ScrollWindowMode mode, uint64_t prev_width=0, uint64_t prev_height=0)
Set the scroll window for the given mode.
void TerminalSizeChanged()
Inform the statusline that the terminal dimensions have changed.
void Enable(std::optional< ExecutionContextRef > exe_ctx_ref)
Reduce the scroll window and draw the statusline.
std::pair< ExecutionContextRef, SymbolContext > Context
Definition Statusline.h:24
Statusline(Debugger &debugger)
void ClearExecutionContext()
Clear the cached execution context to discard stale pointers.
void Redraw(std::optional< ExecutionContextRef > exe_ctx_ref)
Redraw the statusline.
void Disable()
Hide the statusline and extend the scroll window.
ExecutionContextRef m_exe_ctx_ref
Cached copy of the execution context that allows us to redraw the statusline.
Definition Statusline.h:61
void Draw(std::string msg)
Draw the statusline with the given text.
A class that represents a running process on the host machine.