#include "lldb/Core/IOHandlerCursesGUI.h"
#include "lldb/Host/Config.h"
#if LLDB_ENABLE_CURSES
#if CURSES_HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#include <ncurses/panel.h>
#else
#include <curses.h>
#include <panel.h>
#endif
#endif
#if defined(__APPLE__)
#include <deque>
#endif
#include <string>
#include "lldb/Core/Debugger.h"
#include "lldb/Core/ValueObjectUpdater.h"
#include "lldb/Host/File.h"
#include "lldb/Utility/AnsiTerminal.h"
#include "lldb/Utility/Predicate.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-forward.h"
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/OptionGroupPlatform.h"
#if LLDB_ENABLE_CURSES
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/ValueObject.h"
#include "lldb/Core/ValueObjectRegister.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/State.h"
#endif
#include "llvm/ADT/StringRef.h"
#ifdef _WIN32
#include "lldb/Host/windows/windows.h"
#endif
#include <memory>
#include <mutex>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <functional>
#include <optional>
#include <type_traits>
usingnamespacelldb;
usingnamespacelldb_private;
StringRef;
#if LLDB_ENABLE_CURSES
#define KEY_CTRL_A …
#define KEY_CTRL_E …
#define KEY_CTRL_K …
#define KEY_RETURN …
#define KEY_ESCAPE …
#define KEY_DELETE …
#define KEY_SHIFT_TAB …
#define KEY_ALT_ENTER …
namespace curses {
class Menu;
class MenuDelegate;
class Window;
class WindowDelegate;
MenuSP;
MenuDelegateSP;
WindowSP;
WindowDelegateSP;
Menus;
Windows;
WindowDelegates;
#if 0
type summary add -s "x=${var.x}, y=${var.y}" curses::Point
type summary add -s "w=${var.width}, h=${var.height}" curses::Size
type summary add -s "${var.origin%S} ${var.size%S}" curses::Rect
#endif
struct Point { … };
bool operator==(const Point &lhs, const Point &rhs) { … }
bool operator!=(const Point &lhs, const Point &rhs) { … }
struct Size { … };
bool operator==(const Size &lhs, const Size &rhs) { … }
bool operator!=(const Size &lhs, const Size &rhs) { … }
struct Rect { … };
bool operator==(const Rect &lhs, const Rect &rhs) { … }
bool operator!=(const Rect &lhs, const Rect &rhs) { … }
enum HandleCharResult { … };
enum class MenuActionResult { … };
struct KeyHelp { … };
enum { … };
class WindowDelegate { … };
class HelpDialogDelegate : public WindowDelegate { … };
class Surface { … };
class Pad : public Surface { … };
class Window : public Surface { … };
struct ScrollContext { … };
class FieldDelegate { … };
FieldDelegateUP;
class TextFieldDelegate : public FieldDelegate { … };
class IntegerFieldDelegate : public TextFieldDelegate { … };
class FileFieldDelegate : public TextFieldDelegate { … };
class DirectoryFieldDelegate : public TextFieldDelegate { … };
class ArchFieldDelegate : public TextFieldDelegate { … };
class BooleanFieldDelegate : public FieldDelegate { … };
class ChoicesFieldDelegate : public FieldDelegate { … };
class PlatformPluginFieldDelegate : public ChoicesFieldDelegate { … };
class ProcessPluginFieldDelegate : public ChoicesFieldDelegate { … };
class LazyBooleanFieldDelegate : public ChoicesFieldDelegate { … };
template <class T> class ListFieldDelegate : public FieldDelegate { … };
class ArgumentsFieldDelegate : public ListFieldDelegate<TextFieldDelegate> { … };
template <class KeyFieldDelegateType, class ValueFieldDelegateType>
class MappingFieldDelegate : public FieldDelegate { … };
class EnvironmentVariableNameFieldDelegate : public TextFieldDelegate { … };
class EnvironmentVariableFieldDelegate
: public MappingFieldDelegate<EnvironmentVariableNameFieldDelegate,
TextFieldDelegate> { … };
class EnvironmentVariableListFieldDelegate
: public ListFieldDelegate<EnvironmentVariableFieldDelegate> { … };
class FormAction { … };
class FormDelegate { … };
FormDelegateSP;
class FormWindowDelegate : public WindowDelegate { … };
class DetachOrKillProcessFormDelegate : public FormDelegate { … };
class ProcessAttachFormDelegate : public FormDelegate { … };
class TargetCreateFormDelegate : public FormDelegate { … };
class ProcessLaunchFormDelegate : public FormDelegate { … };
class SearcherDelegate { … };
SearcherDelegateSP;
class SearcherWindowDelegate : public WindowDelegate { … };
class CommonCompletionSearcherDelegate : public SearcherDelegate { … };
class MenuDelegate { … };
class Menu : public WindowDelegate { … };
Menu::Menu(Type type)
: … { … }
Menu::Menu(const char *name, const char *key_name, int key_value,
uint64_t identifier)
: … { … }
void Menu::RecalculateNameLengths() { … }
void Menu::AddSubmenu(const MenuSP &menu_sp) { … }
void Menu::DrawMenuTitle(Window &window, bool highlight) { … }
bool Menu::WindowDelegateDraw(Window &window, bool force) { … }
HandleCharResult Menu::WindowDelegateHandleChar(Window &window, int key) { … }
class Application { … };
}
usingnamespacecurses;
struct Row { … };
struct DisplayOptions { … };
class TreeItem;
class TreeDelegate { … };
TreeDelegateSP;
struct TreeItemData { … };
class TreeItem : public TreeItemData { … };
class TreeWindowDelegate : public WindowDelegate { … };
class TextTreeDelegate : public TreeDelegate { … };
class FrameTreeDelegate : public TreeDelegate { … };
class ThreadTreeDelegate : public TreeDelegate { … };
class ThreadsTreeDelegate : public TreeDelegate { … };
class BreakpointLocationTreeDelegate : public TreeDelegate { … };
class BreakpointTreeDelegate : public TreeDelegate { … };
class BreakpointsTreeDelegate : public TreeDelegate { … };
class ValueObjectListDelegate : public WindowDelegate { … };
class FrameVariablesWindowDelegate : public ValueObjectListDelegate { … };
class RegistersWindowDelegate : public ValueObjectListDelegate { … };
static const char *CursesKeyToCString(int ch) { … }
HelpDialogDelegate::HelpDialogDelegate(const char *text,
KeyHelp *key_help_array)
: … { … }
HelpDialogDelegate::~HelpDialogDelegate() = default;
bool HelpDialogDelegate::WindowDelegateDraw(Window &window, bool force) { … }
HandleCharResult HelpDialogDelegate::WindowDelegateHandleChar(Window &window,
int key) { … }
class ApplicationDelegate : public WindowDelegate, public MenuDelegate { … };
class StatusBarWindowDelegate : public WindowDelegate { … };
class SourceFileWindowDelegate : public WindowDelegate { … };
DisplayOptions ValueObjectListDelegate::g_options = …;
IOHandlerCursesGUI::IOHandlerCursesGUI(Debugger &debugger)
: … { … }
void IOHandlerCursesGUI::Activate() { … }
void IOHandlerCursesGUI::Deactivate() { … }
void IOHandlerCursesGUI::Run() { … }
IOHandlerCursesGUI::~IOHandlerCursesGUI() = default;
void IOHandlerCursesGUI::Cancel() { … }
bool IOHandlerCursesGUI::Interrupt() { … }
void IOHandlerCursesGUI::GotEOF() { … }
void IOHandlerCursesGUI::TerminalSizeChanged() { … }
#endif