44#include "lldb/Host/Config.h"
58#include "llvm/ADT/STLExtras.h"
59#include "llvm/ADT/StringRef.h"
60#include "llvm/Support/DynamicLibrary.h"
61#include "llvm/Support/ManagedStatic.h"
62#include "llvm/Support/PrettyStackTrace.h"
63#include "llvm/Support/Signals.h"
93 : m_opaque_sp(debugger_sp) {
119 uint64_t &progress_id,
122 bool &is_debugger_specific) {
127 if (progress_data ==
nullptr)
129 progress_id = progress_data->
GetID();
148 data.m_impl_up->SetObjectSP(std::move(dictionary_sp));
163 data.m_impl_up->SetObjectSP(std::move(dictionary_sp));
184 llvm::sys::DynamicLibrary dynlib =
185 llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
186 if (dynlib.isValid()) {
194 LLDBCommandPluginInit init_func =
195 (LLDBCommandPluginInit)(uintptr_t)dynlib.getAddressOfSymbol(
196 "_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
198 if (init_func(debugger_sb))
201 error.SetErrorString(
"plug-in refused to load "
202 "(lldb::PluginInitialize(lldb::SBDebugger) "
205 error.SetErrorString(
"plug-in is missing the required initialization: "
206 "lldb::PluginInitialize(lldb::SBDebugger)");
210 error.SetErrorString(
"this file does not represent a loadable dylib");
212 error.SetErrorString(
"no such file");
214 return llvm::sys::DynamicLibrary();
219 std::make_unique<SystemInitializerFull>(), LoadPlugin)) {
228 llvm::EnablePrettyStackTrace();
229 static std::string executable =
230 llvm::sys::fs::getMainExecutable(
nullptr,
nullptr);
231 llvm::sys::PrintStackTraceOnErrorSignal(executable);
284 static std::recursive_mutex g_mutex;
285 std::lock_guard<std::recursive_mutex> guard(g_mutex);
290 if (source_init_files) {
320 const bool mandatory =
false;
327 return this->
operator bool();
329SBDebugger::operator bool()
const {
332 return m_opaque_sp.get() !=
nullptr;
352 m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b);
359 m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
366 (
FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
372 if (
data ==
nullptr) {
377 size_t size = strlen(
data);
400 error.ref().SetErrorString(
"invalid debugger");
404 error.ref().SetErrorString(
"invalid file");
430 error.ref().SetErrorString(
"invalid debugger");
434 error.ref().SetErrorString(
"invalid file");
455 error.ref().SetErrorString(
"invalid debugger");
459 error.ref().SetErrorString(
"invalid file");
475 m_opaque_sp->GetCommandInterpreter().GetExecutionContext());
476 if (setting && strlen(setting) > 0)
477 m_opaque_sp->DumpPropertyValue(&exe_ctx, json_strm, setting,
481 m_opaque_sp->DumpAllPropertyValues(&exe_ctx, json_strm, 0,
563 return sb_interpreter;
571 std::unique_lock<std::recursive_mutex> lock;
573 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
589 while (lldb_listener_sp->GetEventForBroadcaster(
590 process_sp.get(), event_sp, std::chrono::seconds(0))) {
618 const SBEvent &event, FILE *out,
622 FileSP outfile = std::make_shared<NativeFile>(out,
false);
623 FileSP errfile = std::make_shared<NativeFile>(err,
false);
640 const uint32_t event_type =
event.GetType();
641 char stdio_buffer[1024];
644 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
649 while ((len = process.
GetSTDOUT(stdio_buffer,
sizeof(stdio_buffer))) > 0)
651 out_sp->Write(stdio_buffer, len);
657 while ((len = process.
GetSTDERR(stdio_buffer,
sizeof(stdio_buffer))) > 0)
659 err_sp->Write(stdio_buffer, len);
678 return sb_source_manager;
684 if (arch_name && arch_name_len) {
688 const std::string &triple_str = default_arch.
GetTriple().str();
689 if (!triple_str.empty())
690 ::snprintf(arch_name, arch_name_len,
"%s", triple_str.c_str());
692 ::snprintf(arch_name, arch_name_len,
"%s",
697 if (arch_name && arch_name_len)
719 if (!script_language_name)
752 llvm::StringRef name,
bool value,
753 llvm::StringRef description) {
754 auto entry_up = std::make_unique<StructuredData::Dictionary>();
755 entry_up->AddBooleanItem(
"value", value);
756 entry_up->AddStringItem(
"description", description);
757 dict.
AddItem(name, std::move(entry_up));
761 auto array_up = std::make_unique<StructuredData::Array>();
762#define LLVM_TARGET(target) \
763 array_up->AddItem(std::make_unique<StructuredData::String>(#target));
764#include "llvm/Config/Targets.def"
765 auto entry_up = std::make_unique<StructuredData::Dictionary>();
766 entry_up->AddItem(
"value", std::move(array_up));
767 entry_up->AddStringItem(
"description",
"A list of configured LLVM targets.");
768 dict.
AddItem(
"targets", std::move(entry_up));
774 auto config_up = std::make_unique<StructuredData::Dictionary>();
777 "A boolean value that indicates if XML support is enabled in LLDB");
779 *config_up,
"curl", LLVM_ENABLE_CURL,
780 "A boolean value that indicates if CURL support is enabled in LLDB");
782 *config_up,
"curses", LLDB_ENABLE_CURSES,
783 "A boolean value that indicates if curses support is enabled in LLDB");
785 *config_up,
"editline", LLDB_ENABLE_LIBEDIT,
786 "A boolean value that indicates if editline support is enabled in LLDB");
788 "A boolean value that indicates if editline wide "
789 "characters support is enabled in LLDB");
791 *config_up,
"lzma", LLDB_ENABLE_LZMA,
792 "A boolean value that indicates if lzma support is enabled in LLDB");
794 *config_up,
"python", LLDB_ENABLE_PYTHON,
795 "A boolean value that indicates if python support is enabled in LLDB");
797 *config_up,
"lua", LLDB_ENABLE_LUA,
798 "A boolean value that indicates if lua support is enabled in LLDB");
800 "A boolean value that indicates if fbsdvmcore support is "
805 data.m_impl_up->SetObjectSP(std::move(config_up));
826 const char *target_triple,
827 const char *platform_name,
828 bool add_dependent_modules,
831 add_dependent_modules, sb_error);
843 &platform_options, target_sp);
846 sb_target.
SetSP(target_sp);
853 "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
854 "platform_name=%s, add_dependent_modules=%u, error=%s) => "
856 static_cast<void *
>(
m_opaque_sp.get()), filename, target_triple,
857 platform_name, add_dependent_modules, sb_error.
GetCString(),
858 static_cast<void *
>(target_sp.get()));
865 const char *target_triple) {
871 const bool add_dependent_modules =
true;
876 sb_target.
SetSP(target_sp);
881 "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
882 "(filename=\"%s\", triple=%s) => SBTarget(%p)",
883 static_cast<void *
>(
m_opaque_sp.get()), filename, target_triple,
884 static_cast<void *
>(target_sp.get()));
890 const char *arch_cstr) {
899 if (arch_cstr ==
nullptr) {
908 m_opaque_sp->GetPlatformList().GetSelectedPlatform();
916 error.SetErrorStringWithFormat(
"invalid arch_cstr: %s", arch_cstr);
919 sb_target.
SetSP(target_sp);
923 "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
924 "arch=%s) => SBTarget(%p)",
926 filename ? filename :
"<unspecified>",
927 arch_cstr ? arch_cstr :
"<unspecified>",
928 static_cast<void *
>(target_sp.get()));
940 const bool add_dependent_modules =
true;
947 sb_target.
SetSP(target_sp);
951 "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
953 static_cast<void *
>(target_sp.get()));
965 LLDB_LOGF(log,
"SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
967 static_cast<void *
>(sb_target.
GetSP().get()));
979 result =
m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
980 target_sp->Destroy();
986 LLDB_LOGF(log,
"SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
988 static_cast<void *
>(target.
m_opaque_sp.get()), result);
1023 sb_target.
SetSP(
m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid));
1029 const char *arch_name) {
1036 m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name);
1038 m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
1039 FileSpec(filename), arch_name ? &arch :
nullptr));
1040 sb_target.
SetSP(target_sp);
1050 m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
1060 return m_opaque_sp->GetTargetList().GetNumTargets();
1074 target_sp =
m_opaque_sp->GetTargetList().GetSelectedTarget();
1075 sb_target.
SetSP(target_sp);
1081 LLDB_LOGF(log,
"SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
1083 static_cast<void *
>(target_sp.get()), sstr.
GetData());
1096 m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp);
1101 LLDB_LOGF(log,
"SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
1103 static_cast<void *
>(target_sp.get()), sstr.
GetData());
1115 sb_platform.
SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
1117 LLDB_LOGF(log,
"SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
1119 static_cast<void *
>(sb_platform.
GetSP().get()),
1131 debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.
GetSP());
1134 LLDB_LOGF(log,
"SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
1136 static_cast<void *
>(sb_platform.
GetSP().get()),
1179 auto platform_dict = std::make_unique<StructuredData::Dictionary>();
1180 llvm::StringRef name_str(
"name"), desc_str(
"description");
1184 platform_dict->AddStringItem(name_str, host_platform_sp->GetPluginName());
1185 platform_dict->AddStringItem(
1186 desc_str, llvm::StringRef(host_platform_sp->GetDescription()));
1187 }
else if (idx > 0) {
1188 llvm::StringRef plugin_name =
1190 if (plugin_name.empty()) {
1193 platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name));
1195 llvm::StringRef plugin_desc =
1197 platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc));
1200 data.m_impl_up->SetObjectSP(
1247 bool spawn_thread) {
1254 m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
1261 int &num_errors,
bool &quit_requested,
1262 bool &stopped_for_crash)
1266 num_errors, quit_requested, stopped_for_crash);
1297 const char *repl_options) {
1304 error.SetErrorString(
"invalid debugger");
1328 sb_debugger.
reset(debugger_sp);
1342 const char *debugger_instance_name) {
1351 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1355 error.SetErrorStringWithFormat(
"invalid debugger instance name '%s'",
1356 debugger_instance_name);
1365 const char *debugger_instance_name) {
1373 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1375 debugger_sp->GetPropertyValue(&exe_ctx, var_name,
error));
1379 const std::string &value_str = std::string(value_strm.
GetString());
1380 if (!value_str.empty()) {
1408 LLDB_LOG(log,
"SBDebugger({0:x})::GetPrompt () => \"{1}\"",
1426 return "GetReproducerPath has been deprecated";
1499 const char *name =
m_opaque_sp->GetInstanceName().c_str();
1501 strm.
Printf(
"Debugger (instance: \"%s\", id: %" PRIu64
")", name,
id);
1519 if (platform_name_cstr && platform_name_cstr[0]) {
1538 platform.SetSDKRoot(sysroot);
1557 if (!category_name || *category_name == 0)
1563 category_sp,
false)) {
1584 if (!category_name || *category_name == 0)
1590 category_sp,
true)) {
1600 if (!category_name || *category_name == 0)
1660 if (categories ==
nullptr)
1663 while (categories[len] !=
nullptr)
1665 return llvm::ArrayRef(categories, len);
1672 uint32_t log_options =
1675 llvm::raw_string_ostream error_stream(
error);
1688 return m_opaque_sp->SetLoggingCallback(log_callback, baton);
1692void SBDebugger::SetDestroyCallback(
1697 destroy_callback, baton);
1707 return m_opaque_sp->AddDestroyCallback(destroy_callback, baton);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT()
#define LLDB_INSTRUMENT_VA(...)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
#define LLDB_LOG_OPTION_PREPEND_TIMESTAMP
#define LLDB_LOG_OPTION_PREPEND_THREAD_NAME
static llvm::ArrayRef< const char * > GetCategoryArray(const char **categories)
static void DumpDiagnostics(void *cookie)
static void AddBoolConfigEntry(StructuredData::Dictionary &dict, llvm::StringRef name, bool value, llvm::StringRef description)
static void AddLLVMTargets(StructuredData::Dictionary &dict)
static llvm::ManagedStatic< SystemLifetimeManager > g_debugger_lifetime
void SetAutoHandleEvents(bool)
void SetSpawnThread(bool)
lldb_private::CommandInterpreterRunOptions & ref() const
void reset(lldb_private::CommandInterpreter *)
void SourceInitFileInHomeDirectory(lldb::SBCommandReturnObject &result)
lldb_private::CommandInterpreter * get()
void SourceInitFileInGlobalDirectory(lldb::SBCommandReturnObject &result)
lldb::ReturnStatus HandleCommand(const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history=false)
size_t PutOutput(SBFile file)
size_t PutError(SBFile file)
static lldb::SBError SetInternalVariable(const char *var_name, const char *value, const char *debugger_instance_name)
bool DeleteCategory(const char *category_name)
lldb::LanguageType GetREPLLanguage() const
lldb::SBTarget GetTargetAtIndex(uint32_t idx)
lldb::SBTarget CreateTarget(const char *filename, const char *target_triple, const char *platform_name, bool add_dependent_modules, lldb::SBError &error)
SBError RunREPL(lldb::LanguageType language, const char *repl_options)
bool DeleteTarget(lldb::SBTarget &target)
void SkipAppInitFiles(bool b)
lldb::SBDebugger & operator=(const lldb::SBDebugger &rhs)
lldb::SBPlatform GetPlatformAtIndex(uint32_t idx)
Get one of the currently active platforms.
void SkipLLDBInitFiles(bool b)
SBTypeSummary GetSummaryForType(SBTypeNameSpecifier)
SBTypeCategory GetCategoryAtIndex(uint32_t)
bool SetUseExternalEditor(bool input)
bool GetCloseInputOnEOF() const
static bool GetDefaultArchitecture(char *arch_name, size_t arch_name_len)
static void MemoryPressureDetected()
void SetPrompt(const char *prompt)
bool GetDescription(lldb::SBStream &description)
void DispatchInput(const void *data, size_t data_len)
bool GetUseExternalEditor()
static void PrintStackTraceOnError()
static lldb::SBDebugger Create()
void SetInputFileHandle(FILE *f, bool transfer_ownership)
void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread)
Run the command interpreter.
static const char * GetVersionString()
lldb_private::Debugger & ref() const
lldb::SBStructuredData GetSetting(const char *setting=nullptr)
Getting a specific setting value into SBStructuredData format.
const void size_t data_len
const char * GetReproducerPath() const
void SetOutputFileHandle(FILE *f, bool transfer_ownership)
static lldb::SBError InitializeWithErrorHandling()
void SetTerminalWidth(uint32_t term_width)
void HandleCommand(const char *command)
lldb::SBCommandInterpreter GetCommandInterpreter()
const char * GetPrompt() const
bool SetUseColor(bool use_color)
const lldb::DebuggerSP & get_sp() const
static bool StateIsRunningState(lldb::StateType state)
SBError SetErrorFile(SBFile file)
bool SetUseSourceCache(bool use_source_cache)
uint32_t GetNumCategories()
static lldb::SBStringList GetInternalVariableValue(const char *var_name, const char *debugger_instance_name)
static bool SupportsLanguage(lldb::LanguageType language)
lldb::SBListener GetListener()
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
lldb::DebuggerSP m_opaque_sp
lldb::ScriptLanguage GetScriptLanguage() const
LLDB_DEPRECATED_FIXME("Use AddDestroyCallback and RemoveDestroyCallback", "AddDestroyCallback") void SetDestroyCallback(lldb lldb::callback_token_t AddDestroyCallback(lldb::SBDebuggerDestroyCallback destroy_callback, void *baton)
Clear all previously added callbacks and only add the given one.
void SetScriptLanguage(lldb::ScriptLanguage script_lang)
uint32_t GetNumAvailablePlatforms()
Get the number of available platforms.
lldb::SBTarget FindTargetWithLLDBProcess(const lldb::ProcessSP &processSP)
SBStructuredData GetScriptInterpreterInfo(ScriptLanguage)
lldb::SBPlatform GetSelectedPlatform()
static const char * GetBroadcasterClass()
lldb::SBTarget CreateTargetWithFileAndArch(const char *filename, const char *archname)
LLDB_DEPRECATED_FIXME("Use HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, " "SBFile) or HandleProcessEvent(const SBProcess &, const SBEvent &, " "FileSP, FileSP)", "HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, SBFile)") void HandleProcessEvent(const lldb void HandleProcessEvent(const lldb::SBProcess &process, const lldb::SBEvent &event, SBFile out, SBFile err)
static bool StateIsStoppedState(lldb::StateType state)
lldb::SBError SetCurrentPlatform(const char *platform_name)
lldb::SBSourceManager GetSourceManager()
SBTypeCategory GetCategory(const char *category_name)
void SetREPLLanguage(lldb::LanguageType repl_lang)
static SBDebugger FindDebuggerWithID(int id)
uint32_t GetNumPlatforms()
Get the number of currently active platforms.
void DispatchInputEndOfFile()
uint32_t GetTerminalWidth() const
bool InterruptRequested()
SBTypeFilter GetFilterForType(SBTypeNameSpecifier)
lldb::SBTarget FindTargetWithFileAndArch(const char *filename, const char *arch)
static lldb::SBStructuredData GetProgressDataFromEvent(const lldb::SBEvent &event)
static const char * StateAsCString(lldb::StateType state)
void PushInputReader(lldb::SBInputReader &reader)
static const char * GetProgressFromEvent(const lldb::SBEvent &event, uint64_t &progress_id, uint64_t &completed, uint64_t &total, bool &is_debugger_specific)
Get progress data from a SBEvent whose type is eBroadcastBitProgress.
lldb::SBTarget GetDummyTarget()
bool EnableLog(const char *channel, const char **categories)
static bool SetDefaultArchitecture(const char *arch_name)
lldb_private::Debugger * get() const
void RestoreInputTerminalState()
lldb::SBBroadcaster GetBroadcaster()
void SetSelectedTarget(SBTarget &target)
SBTypeCategory GetDefaultCategory()
bool GetUseSourceCache() const
lldb::SBStructuredData GetAvailablePlatformInfoAtIndex(uint32_t idx)
Get the name and description of one of the available platforms.
static SBStructuredData GetBuildConfiguration()
SBTypeCategory CreateCategory(const char *category_name)
bool SetCurrentPlatformSDKRoot(const char *sysroot)
void SetErrorFileHandle(FILE *f, bool transfer_ownership)
SBTrace LoadTraceFromFile(SBError &error, const SBFileSpec &trace_description_file)
Load a trace from a trace description file and create Targets, Processes and Threads based on the con...
void CancelInterruptRequest()
FILE * GetInputFileHandle()
SBError SetInputFile(SBFile file)
void DispatchInputInterrupt()
SBError SetInputString(const char *data)
uint32_t GetIndexOfTarget(lldb::SBTarget target)
SBError SetOutputFile(SBFile file)
SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier)
lldb::SBTarget GetSelectedTarget()
void SaveInputTerminalState()
FILE * GetErrorFileHandle()
void SetSelectedPlatform(lldb::SBPlatform &platform)
void reset(const lldb::DebuggerSP &debugger_sp)
FILE * GetOutputFileHandle()
const char * GetInstanceName()
lldb::SBTarget FindTargetWithProcessID(lldb::pid_t pid)
static void PrintDiagnosticsOnError()
void SetCloseInputOnEOF(bool b)
lldb::SBTarget CreateTargetWithFileAndTargetTriple(const char *filename, const char *target_triple)
bool RemoveDestroyCallback(lldb::callback_token_t token)
Remove the specified callback. Return true if successful.
static lldb::SBStructuredData GetDiagnosticFromEvent(const lldb::SBEvent &event)
lldb::ScriptLanguage GetScriptingLanguage(const char *script_language_name)
static void Destroy(lldb::SBDebugger &debugger)
SBTypeFormat GetFormatForType(SBTypeNameSpecifier)
void SetErrorString(const char *err_str)
void SetError(uint32_t err, lldb::ErrorType type)
lldb_private::Status & ref()
const char * GetCString() const
Get the error string as a NULL terminated UTF8 c-string.
lldb_private::Event * get() const
void reset(lldb::ListenerSP listener_sp)
void ReportEventState(const lldb::SBEvent &event, FILE *out) const
lldb::ProcessSP GetSP() const
static lldb::StateType GetStateFromEvent(const lldb::SBEvent &event)
lldb::SBTarget GetTarget() const
size_t GetSTDOUT(char *dst, size_t dst_len) const
size_t GetSTDERR(char *dst, size_t dst_len) const
lldb_private::Stream & ref()
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
void SetSP(const lldb::TargetSP &target_sp)
lldb::TargetSP GetSP() const
lldb::TargetSP m_opaque_sp
static SBTrace LoadTraceFromFile(SBError &error, SBDebugger &debugger, const SBFileSpec &trace_description_file)
See SBDebugger::LoadTraceFromFile.
SBTypeFormat GetFormatForType(SBTypeNameSpecifier)
lldb::TypeNameSpecifierImplSP GetSP()
An architecture specification class.
bool IsValid() const
Tests if this ArchSpec is valid.
llvm::Triple & GetTriple()
Architecture triple accessor.
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
void SetSpawnThread(bool spawn_thread)
void SetAutoHandleEvents(bool auto_handle_events)
bool IsResult(lldb::CommandInterpreterResult result)
uint32_t GetNumErrors() const
void SkipAppInitFiles(bool skip_app_init_files)
void SkipLLDBInitFiles(bool skip_lldbinit_files)
CommandInterpreterRunResult RunCommandInterpreter(CommandInterpreterRunOptions &options)
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const char * GetCString() const
Get the string value as a C string.
static bool Delete(ConstString category)
static lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t)
static bool GetCategory(ConstString category, lldb::TypeCategoryImplSP &entry, bool allow_create=true)
static uint32_t GetCount()
static lldb::ScriptedSyntheticChildrenSP GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp)
static lldb::TypeFilterImplSP GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp)
static lldb::TypeSummaryImplSP GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp)
A class to manage flag bits.
static lldb::DebuggerSP FindDebuggerWithInstanceName(llvm::StringRef instance_name)
static llvm::StringRef GetStaticBroadcasterClass()
static lldb::DebuggerSP CreateInstance(lldb::LogOutputCallback log_callback=nullptr, void *baton=nullptr)
static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id)
static void Destroy(lldb::DebuggerSP &debugger_sp)
static StructuredData::DictionarySP GetAsStructuredData(const Event *event_ptr)
bool Dump(llvm::raw_ostream &stream)
Gather diagnostics and print a message to the given output stream.
static Diagnostics & Instance()
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
static FileSystem & Instance()
An abstract base class for files.
virtual FILE * GetStream()
Get the underlying libc stream for this file, or NULL.
static size_t RemoveOrphanSharedModules(bool mandatory)
static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx)
@ eBroadcastBitStateChanged
static const ProgressEventData * GetEventDataFromEvent(const Event *event_ptr)
bool IsDebuggerSpecific() const
static StructuredData::DictionarySP GetAsStructuredData(const Event *event_ptr)
uint64_t GetCompleted() const
uint64_t GetTotal() const
std::string GetMessage() const
virtual StructuredData::DictionarySP GetInterpreterInfo()
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t SplitIntoLines(const std::string &lines)
void AddItem(llvm::StringRef key, ObjectSP value_sp)
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
static ObjectSP ParseJSON(llvm::StringRef json_text)
static ArchSpec GetDefaultArchitecture()
static void SetDefaultArchitecture(const ArchSpec &arch)
static bool SupportsLanguageStatic(lldb::LanguageType language)
#define LLDB_INVALID_CALLBACK_TOKEN
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
const char * GetVersion()
Retrieves a string representing the complete LLDB version, which includes the lldb version number,...
bool StateIsStoppedState(lldb::StateType state, bool must_exist)
Check if a state represents a state where the process or thread is stopped.
bool StateIsRunningState(lldb::StateType state)
Check if a state represents a state where the process or thread is running.
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
ScriptLanguage
Script interpreter types.
@ eCommandInterpreterResultInferiorCrash
Stopped because the corresponding option was set and the inferior crashed.
@ eCommandInterpreterResultQuitRequested
Stopped because quit was requested.
std::shared_ptr< lldb_private::Platform > PlatformSP
StateType
Process and Thread States.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Debugger > DebuggerSP
std::shared_ptr< lldb_private::Event > EventSP
std::shared_ptr< lldb_private::Listener > ListenerSP
std::shared_ptr< lldb_private::TypeCategoryImpl > TypeCategoryImplSP
void(* SBDebuggerDestroyCallback)(lldb::user_id_t debugger_id, void *baton)
void(* LogOutputCallback)(const char *, void *baton)
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::File > FileSP
std::shared_ptr< lldb_private::OptionValue > OptionValueSP
InputReaderGranularity
Token size/granularities for Input Readers.
static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value, bool *success_ptr)