#include "Driver.h"
#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/API/SBCommandInterpreterRunOptions.h"
#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBFile.h"
#include "lldb/API/SBHostOS.h"
#include "lldb/API/SBLanguageRuntime.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBStructuredData.h"
#include "lldb/Host/Config.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <atomic>
#include <bitset>
#include <clocale>
#include <csignal>
#include <future>
#include <string>
#include <thread>
#include <utility>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#if !defined(__APPLE__)
#include "llvm/Support/DataTypes.h"
#endif
usingnamespacelldb;
usingnamespacellvm;
namespace {
usingnamespacellvm::opt;
enum ID { … };
#define PREFIX …
#include "Options.inc"
#undef PREFIX
static constexpr opt::OptTable::Info InfoTable[] = …;
class LLDBOptTable : public opt::GenericOptTable { … };
}
static void reset_stdin_termios();
static bool g_old_stdin_termios_is_valid = …;
static struct termios g_old_stdin_termios;
static bool disable_color(const raw_ostream &OS) { … }
static Driver *g_driver = …;
static void reset_stdin_termios() { … }
Driver::Driver()
: … { … }
Driver::~Driver() { … }
void Driver::OptionData::AddInitialCommand(std::string command,
CommandPlacement placement,
bool is_file, SBError &error) { … }
void Driver::WriteCommandsForSourcing(CommandPlacement placement,
SBStream &strm) { … }
SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) { … }
std::string EscapeString(std::string arg) { … }
int Driver::MainLoop() { … }
void Driver::ResizeWindow(unsigned short col) { … }
void sigwinch_handler(int signo) { … }
void sigint_handler(int signo) { … }
#ifndef _WIN32
static void sigtstp_handler(int signo) { … }
#endif
static void printHelp(LLDBOptTable &table, llvm::StringRef tool_name) { … }
int main(int argc, char const *argv[]) { … }