llvm/lldb/source/API/SBDebugger.cpp

//===-- SBDebugger.cpp ----------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "lldb/API/SBDebugger.h"
#include "SystemInitializerFull.h"
#include "lldb/Utility/Instrumentation.h"
#include "lldb/Utility/LLDBLog.h"

#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/API/SBCommandInterpreterRunOptions.h"
#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBError.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBFile.h"
#include "lldb/API/SBFrame.h"
#include "lldb/API/SBListener.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBSourceManager.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBStructuredData.h"
#include "lldb/API/SBTarget.h"
#include "lldb/API/SBThread.h"
#include "lldb/API/SBTrace.h"
#include "lldb/API/SBTypeCategory.h"
#include "lldb/API/SBTypeFilter.h"
#include "lldb/API/SBTypeFormat.h"
#include "lldb/API/SBTypeNameSpecifier.h"
#include "lldb/API/SBTypeSummary.h"
#include "lldb/API/SBTypeSynthetic.h"

#include "lldb/Core/Debugger.h"
#include "lldb/Core/DebuggerEvents.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Progress.h"
#include "lldb/Core/StructuredDataImpl.h"
#include "lldb/DataFormatters/DataVisualization.h"
#include "lldb/Host/Config.h"
#include "lldb/Host/StreamFile.h"
#include "lldb/Host/XML.h"
#include "lldb/Initialization/SystemLifetimeManager.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupPlatform.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/TargetList.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/Diagnostics.h"
#include "lldb/Utility/State.h"
#include "lldb/Version/Version.h"

#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_CURL
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"

usingnamespacelldb;
usingnamespacelldb_private;

static llvm::ManagedStatic<SystemLifetimeManager> g_debugger_lifetime;

SBError SBInputReader::Initialize(
    lldb::SBDebugger &sb_debugger,
    unsigned long (*callback)(void *, lldb::SBInputReader *,
                              lldb::InputReaderAction, char const *,
                              unsigned long),
    void *a, lldb::InputReaderGranularity b, char const *c, char const *d,
    bool e) {}

void SBInputReader::SetIsDone(bool b) {}

bool SBInputReader::IsActive() const {}

SBDebugger::SBDebugger() {}

SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp)
    :{}

SBDebugger::SBDebugger(const SBDebugger &rhs) :{}

SBDebugger::~SBDebugger() = default;

SBDebugger &SBDebugger::operator=(const SBDebugger &rhs) {}

const char *SBDebugger::GetBroadcasterClass() {}

const char *SBDebugger::GetProgressFromEvent(const lldb::SBEvent &event,
                                             uint64_t &progress_id,
                                             uint64_t &completed,
                                             uint64_t &total,
                                             bool &is_debugger_specific) {}

lldb::SBStructuredData
SBDebugger::GetProgressDataFromEvent(const lldb::SBEvent &event) {}

lldb::SBStructuredData
SBDebugger::GetDiagnosticFromEvent(const lldb::SBEvent &event) {}

SBBroadcaster SBDebugger::GetBroadcaster() {}

void SBDebugger::Initialize() {}

lldb::SBError SBDebugger::InitializeWithErrorHandling() {}

void SBDebugger::PrintStackTraceOnError() {}

static void DumpDiagnostics(void *cookie) {}

void SBDebugger::PrintDiagnosticsOnError() {}

void SBDebugger::Terminate() {}

void SBDebugger::Clear() {}

SBDebugger SBDebugger::Create() {}

SBDebugger SBDebugger::Create(bool source_init_files) {}

SBDebugger SBDebugger::Create(bool source_init_files,
                              lldb::LogOutputCallback callback, void *baton)

{}

void SBDebugger::Destroy(SBDebugger &debugger) {}

void SBDebugger::MemoryPressureDetected() {}

bool SBDebugger::IsValid() const {}
operator bool()

void SBDebugger::SetAsync(bool b) {}

bool SBDebugger::GetAsync() {}

void SBDebugger::SkipLLDBInitFiles(bool b) {}

void SBDebugger::SkipAppInitFiles(bool b) {}

void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) {}

SBError SBDebugger::SetInputString(const char *data) {}

// Shouldn't really be settable after initialization as this could cause lots
// of problems; don't want users trying to switch modes in the middle of a
// debugging session.
SBError SBDebugger::SetInputFile(SBFile file) {}

SBError SBDebugger::SetInputFile(FileSP file_sp) {}

SBError SBDebugger::SetOutputFile(FileSP file_sp) {}

void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) {}

SBError SBDebugger::SetOutputFile(SBFile file) {}

void SBDebugger::SetErrorFileHandle(FILE *fh, bool transfer_ownership) {}

SBError SBDebugger::SetErrorFile(FileSP file_sp) {}

SBError SBDebugger::SetErrorFile(SBFile file) {}

lldb::SBStructuredData SBDebugger::GetSetting(const char *setting) {}

FILE *SBDebugger::GetInputFileHandle() {}

SBFile SBDebugger::GetInputFile() {}

FILE *SBDebugger::GetOutputFileHandle() {}

SBFile SBDebugger::GetOutputFile() {}

FILE *SBDebugger::GetErrorFileHandle() {}

SBFile SBDebugger::GetErrorFile() {}

void SBDebugger::SaveInputTerminalState() {}

void SBDebugger::RestoreInputTerminalState() {}
SBCommandInterpreter SBDebugger::GetCommandInterpreter() {}

void SBDebugger::HandleCommand(const char *command) {}

SBListener SBDebugger::GetListener() {}

void SBDebugger::HandleProcessEvent(const SBProcess &process,
                                    const SBEvent &event, SBFile out,
                                    SBFile err) {}

void SBDebugger::HandleProcessEvent(const SBProcess &process,
                                    const SBEvent &event, FILE *out,
                                    FILE *err) {}

void SBDebugger::HandleProcessEvent(const SBProcess &process,
                                    const SBEvent &event, FileSP out_sp,
                                    FileSP err_sp) {}

SBSourceManager SBDebugger::GetSourceManager() {}

bool SBDebugger::GetDefaultArchitecture(char *arch_name, size_t arch_name_len) {}

bool SBDebugger::SetDefaultArchitecture(const char *arch_name) {}

ScriptLanguage
SBDebugger::GetScriptingLanguage(const char *script_language_name) {}

SBStructuredData
SBDebugger::GetScriptInterpreterInfo(lldb::ScriptLanguage language) {}

const char *SBDebugger::GetVersionString() {}

const char *SBDebugger::StateAsCString(StateType state) {}

static void AddBoolConfigEntry(StructuredData::Dictionary &dict,
                               llvm::StringRef name, bool value,
                               llvm::StringRef description) {}

static void AddLLVMTargets(StructuredData::Dictionary &dict) {}

SBStructuredData SBDebugger::GetBuildConfiguration() {}

bool SBDebugger::StateIsRunningState(StateType state) {}

bool SBDebugger::StateIsStoppedState(StateType state) {}

lldb::SBTarget SBDebugger::CreateTarget(const char *filename,
                                        const char *target_triple,
                                        const char *platform_name,
                                        bool add_dependent_modules,
                                        lldb::SBError &sb_error) {}

SBTarget
SBDebugger::CreateTargetWithFileAndTargetTriple(const char *filename,
                                                const char *target_triple) {}

SBTarget SBDebugger::CreateTargetWithFileAndArch(const char *filename,
                                                 const char *arch_cstr) {}

SBTarget SBDebugger::CreateTarget(const char *filename) {}

SBTarget SBDebugger::GetDummyTarget() {}

bool SBDebugger::DeleteTarget(lldb::SBTarget &target) {}

SBTarget SBDebugger::GetTargetAtIndex(uint32_t idx) {}

uint32_t SBDebugger::GetIndexOfTarget(lldb::SBTarget target) {}

SBTarget SBDebugger::FindTargetWithProcessID(lldb::pid_t pid) {}

SBTarget SBDebugger::FindTargetWithFileAndArch(const char *filename,
                                               const char *arch_name) {}

SBTarget SBDebugger::FindTargetWithLLDBProcess(const ProcessSP &process_sp) {}

uint32_t SBDebugger::GetNumTargets() {}

SBTarget SBDebugger::GetSelectedTarget() {}

void SBDebugger::SetSelectedTarget(SBTarget &sb_target) {}

SBPlatform SBDebugger::GetSelectedPlatform() {}

void SBDebugger::SetSelectedPlatform(SBPlatform &sb_platform) {}

uint32_t SBDebugger::GetNumPlatforms() {}

SBPlatform SBDebugger::GetPlatformAtIndex(uint32_t idx) {}

uint32_t SBDebugger::GetNumAvailablePlatforms() {}

SBStructuredData SBDebugger::GetAvailablePlatformInfoAtIndex(uint32_t idx) {}

void SBDebugger::DispatchInput(void *baton, const void *data, size_t data_len) {}

void SBDebugger::DispatchInput(const void *data, size_t data_len) {}

void SBDebugger::DispatchInputInterrupt() {}

void SBDebugger::DispatchInputEndOfFile() {}

void SBDebugger::PushInputReader(SBInputReader &reader) {}

void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
                                       bool spawn_thread) {}

void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
                                       bool spawn_thread,
                                       SBCommandInterpreterRunOptions &options,
                                       int &num_errors, bool &quit_requested,
                                       bool &stopped_for_crash)

{}

SBCommandInterpreterRunResult SBDebugger::RunCommandInterpreter(
    const SBCommandInterpreterRunOptions &options) {}

SBError SBDebugger::RunREPL(lldb::LanguageType language,
                            const char *repl_options) {}

void SBDebugger::reset(const DebuggerSP &debugger_sp) {}

Debugger *SBDebugger::get() const {}

Debugger &SBDebugger::ref() const {}

const lldb::DebuggerSP &SBDebugger::get_sp() const {}

SBDebugger SBDebugger::FindDebuggerWithID(int id) {}

const char *SBDebugger::GetInstanceName() {}

SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value,
                                        const char *debugger_instance_name) {}

SBStringList
SBDebugger::GetInternalVariableValue(const char *var_name,
                                     const char *debugger_instance_name) {}

uint32_t SBDebugger::GetTerminalWidth() const {}

void SBDebugger::SetTerminalWidth(uint32_t term_width) {}

const char *SBDebugger::GetPrompt() const {}

void SBDebugger::SetPrompt(const char *prompt) {}

const char *SBDebugger::GetReproducerPath() const {}

ScriptLanguage SBDebugger::GetScriptLanguage() const {}

void SBDebugger::SetScriptLanguage(ScriptLanguage script_lang) {}

LanguageType SBDebugger::GetREPLLanguage() const {}

void SBDebugger::SetREPLLanguage(LanguageType repl_lang) {}

bool SBDebugger::SetUseExternalEditor(bool value) {}

bool SBDebugger::GetUseExternalEditor() {}

bool SBDebugger::SetUseColor(bool value) {}

bool SBDebugger::GetUseColor() const {}

bool SBDebugger::SetShowInlineDiagnostics(bool value) {}

bool SBDebugger::SetUseSourceCache(bool value) {}

bool SBDebugger::GetUseSourceCache() const {}

bool SBDebugger::GetDescription(SBStream &description) {}

user_id_t SBDebugger::GetID() {}

SBError SBDebugger::SetCurrentPlatform(const char *platform_name_cstr) {}

bool SBDebugger::SetCurrentPlatformSDKRoot(const char *sysroot) {}

bool SBDebugger::GetCloseInputOnEOF() const {}

void SBDebugger::SetCloseInputOnEOF(bool b) {}

SBTypeCategory SBDebugger::GetCategory(const char *category_name) {}

SBTypeCategory SBDebugger::GetCategory(lldb::LanguageType lang_type) {}

SBTypeCategory SBDebugger::CreateCategory(const char *category_name) {}

bool SBDebugger::DeleteCategory(const char *category_name) {}

uint32_t SBDebugger::GetNumCategories() {}

SBTypeCategory SBDebugger::GetCategoryAtIndex(uint32_t index) {}

SBTypeCategory SBDebugger::GetDefaultCategory() {}

SBTypeFormat SBDebugger::GetFormatForType(SBTypeNameSpecifier type_name) {}

SBTypeSummary SBDebugger::GetSummaryForType(SBTypeNameSpecifier type_name) {}

SBTypeFilter SBDebugger::GetFilterForType(SBTypeNameSpecifier type_name) {}

SBTypeSynthetic SBDebugger::GetSyntheticForType(SBTypeNameSpecifier type_name) {}

static llvm::ArrayRef<const char *> GetCategoryArray(const char **categories) {}

bool SBDebugger::EnableLog(const char *channel, const char **categories) {}

void SBDebugger::SetLoggingCallback(lldb::LogOutputCallback log_callback,
                                    void *baton) {}

void SBDebugger::SetDestroyCallback(
    lldb::SBDebuggerDestroyCallback destroy_callback, void *baton) {}

lldb::callback_token_t
SBDebugger::AddDestroyCallback(lldb::SBDebuggerDestroyCallback destroy_callback,
                               void *baton) {}

bool SBDebugger::RemoveDestroyCallback(lldb::callback_token_t token) {}

SBTrace
SBDebugger::LoadTraceFromFile(SBError &error,
                              const SBFileSpec &trace_description_file) {}

void SBDebugger::RequestInterrupt() {}
void SBDebugger::CancelInterruptRequest()  {}

bool SBDebugger::InterruptRequested()   {}

bool SBDebugger::SupportsLanguage(lldb::LanguageType language) {}