44#include "lldb/Host/Config.h"
58#include "llvm/ADT/STLExtras.h"
59#include "llvm/ADT/StringRef.h"
60#include "llvm/Config/llvm-config.h"
61#include "llvm/Support/DynamicLibrary.h"
62#include "llvm/Support/ManagedStatic.h"
63#include "llvm/Support/PrettyStackTrace.h"
64#include "llvm/Support/Signals.h"
94 : m_opaque_sp(debugger_sp) {
120 uint64_t &progress_id,
123 bool &is_debugger_specific) {
128 if (progress_data ==
nullptr)
130 progress_id = progress_data->
GetID();
149 data.m_impl_up->SetObjectSP(std::move(dictionary_sp));
164 data.m_impl_up->SetObjectSP(std::move(dictionary_sp));
185 llvm::sys::DynamicLibrary dynlib =
186 llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
187 if (dynlib.isValid()) {
195 LLDBCommandPluginInit init_func =
196 (LLDBCommandPluginInit)(uintptr_t)dynlib.getAddressOfSymbol(
197 "_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
199 if (init_func(debugger_sb))
203 "plug-in refused to load "
204 "(lldb::PluginInitialize(lldb::SBDebugger) "
208 "plug-in is missing the required initialization: "
209 "lldb::PluginInitialize(lldb::SBDebugger)");
214 "this file does not represent a loadable dylib");
218 return llvm::sys::DynamicLibrary();
223 std::make_unique<SystemInitializerFull>(), LoadPlugin)) {
232 llvm::EnablePrettyStackTrace();
233 static std::string executable =
234 llvm::sys::fs::getMainExecutable(
nullptr,
nullptr);
235 llvm::sys::PrintStackTraceOnErrorSignal(executable);
288 static std::recursive_mutex g_mutex;
289 std::lock_guard<std::recursive_mutex> guard(g_mutex);
294 if (source_init_files) {
324 const bool mandatory =
false;
331 return this->
operator bool();
333SBDebugger::operator bool()
const {
336 return m_opaque_sp.get() !=
nullptr;
356 m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b);
363 m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
370 (
FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
376 if (
data ==
nullptr) {
381 size_t size = strlen(
data);
479 m_opaque_sp->GetCommandInterpreter().GetExecutionContext());
480 if (setting && strlen(setting) > 0)
481 m_opaque_sp->DumpPropertyValue(&exe_ctx, json_strm, setting,
485 m_opaque_sp->DumpAllPropertyValues(&exe_ctx, json_strm, 0,
567 return sb_interpreter;
575 std::unique_lock<std::recursive_mutex> lock;
577 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
593 while (lldb_listener_sp->GetEventForBroadcaster(
594 process_sp.get(), event_sp, std::chrono::seconds(0))) {
622 const SBEvent &event, FILE *out,
626 FileSP outfile = std::make_shared<NativeFile>(out,
false);
627 FileSP errfile = std::make_shared<NativeFile>(err,
false);
644 const uint32_t event_type =
event.GetType();
645 char stdio_buffer[1024];
648 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
653 while ((len = process.
GetSTDOUT(stdio_buffer,
sizeof(stdio_buffer))) > 0)
655 out_sp->Write(stdio_buffer, len);
661 while ((len = process.
GetSTDERR(stdio_buffer,
sizeof(stdio_buffer))) > 0)
663 err_sp->Write(stdio_buffer, len);
682 return sb_source_manager;
688 if (arch_name && arch_name_len) {
692 const std::string &triple_str = default_arch.
GetTriple().str();
693 if (!triple_str.empty())
694 ::snprintf(arch_name, arch_name_len,
"%s", triple_str.c_str());
696 ::snprintf(arch_name, arch_name_len,
"%s",
701 if (arch_name && arch_name_len)
723 if (!script_language_name)
756 llvm::StringRef name,
bool value,
757 llvm::StringRef description) {
758 auto entry_up = std::make_unique<StructuredData::Dictionary>();
759 entry_up->AddBooleanItem(
"value", value);
760 entry_up->AddStringItem(
"description", description);
761 dict.
AddItem(name, std::move(entry_up));
765 auto array_up = std::make_unique<StructuredData::Array>();
766#define LLVM_TARGET(target) \
767 array_up->AddItem(std::make_unique<StructuredData::String>(#target));
768#include "llvm/Config/Targets.def"
769 auto entry_up = std::make_unique<StructuredData::Dictionary>();
770 entry_up->AddItem(
"value", std::move(array_up));
771 entry_up->AddStringItem(
"description",
"A list of configured LLVM targets.");
772 dict.
AddItem(
"targets", std::move(entry_up));
778 auto config_up = std::make_unique<StructuredData::Dictionary>();
781 "A boolean value that indicates if XML support is enabled in LLDB");
783 *config_up,
"curl", LLVM_ENABLE_CURL,
784 "A boolean value that indicates if CURL support is enabled in LLDB");
786 *config_up,
"curses", LLDB_ENABLE_CURSES,
787 "A boolean value that indicates if curses support is enabled in LLDB");
789 *config_up,
"editline", LLDB_ENABLE_LIBEDIT,
790 "A boolean value that indicates if editline support is enabled in LLDB");
792 "A boolean value that indicates if editline wide "
793 "characters support is enabled in LLDB");
795 *config_up,
"lzma", LLDB_ENABLE_LZMA,
796 "A boolean value that indicates if lzma support is enabled in LLDB");
798 *config_up,
"python", LLDB_ENABLE_PYTHON,
799 "A boolean value that indicates if python support is enabled in LLDB");
801 *config_up,
"lua", LLDB_ENABLE_LUA,
802 "A boolean value that indicates if lua support is enabled in LLDB");
804 "A boolean value that indicates if fbsdvmcore support is "
809 data.m_impl_up->SetObjectSP(std::move(config_up));
830 const char *target_triple,
831 const char *platform_name,
832 bool add_dependent_modules,
835 add_dependent_modules, sb_error);
847 &platform_options, target_sp);
850 sb_target.
SetSP(target_sp);
857 "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
858 "platform_name=%s, add_dependent_modules=%u, error=%s) => "
860 static_cast<void *
>(
m_opaque_sp.get()), filename, target_triple,
861 platform_name, add_dependent_modules, sb_error.
GetCString(),
862 static_cast<void *
>(target_sp.get()));
869 const char *target_triple) {
875 const bool add_dependent_modules =
true;
880 sb_target.
SetSP(target_sp);
885 "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
886 "(filename=\"%s\", triple=%s) => SBTarget(%p)",
887 static_cast<void *
>(
m_opaque_sp.get()), filename, target_triple,
888 static_cast<void *
>(target_sp.get()));
894 const char *arch_cstr) {
903 if (arch_cstr ==
nullptr) {
912 m_opaque_sp->GetPlatformList().GetSelectedPlatform();
924 sb_target.
SetSP(target_sp);
928 "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
929 "arch=%s) => SBTarget(%p)",
931 filename ? filename :
"<unspecified>",
932 arch_cstr ? arch_cstr :
"<unspecified>",
933 static_cast<void *
>(target_sp.get()));
945 const bool add_dependent_modules =
true;
952 sb_target.
SetSP(target_sp);
956 "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
958 static_cast<void *
>(target_sp.get()));
970 LLDB_LOGF(log,
"SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
972 static_cast<void *
>(sb_target.
GetSP().get()));
984 result =
m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
985 target_sp->Destroy();
991 LLDB_LOGF(log,
"SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
993 static_cast<void *
>(target.
m_opaque_sp.get()), result);
1028 sb_target.
SetSP(
m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid));
1034 const char *arch_name) {
1041 m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name);
1043 m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
1044 FileSpec(filename), arch_name ? &arch :
nullptr));
1045 sb_target.
SetSP(target_sp);
1055 m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
1065 return m_opaque_sp->GetTargetList().GetNumTargets();
1079 target_sp =
m_opaque_sp->GetTargetList().GetSelectedTarget();
1080 sb_target.
SetSP(target_sp);
1086 LLDB_LOGF(log,
"SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
1088 static_cast<void *
>(target_sp.get()), sstr.
GetData());
1101 m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp);
1106 LLDB_LOGF(log,
"SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
1108 static_cast<void *
>(target_sp.get()), sstr.
GetData());
1120 sb_platform.
SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
1122 LLDB_LOGF(log,
"SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
1124 static_cast<void *
>(sb_platform.
GetSP().get()),
1136 debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.
GetSP());
1139 LLDB_LOGF(log,
"SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
1141 static_cast<void *
>(sb_platform.
GetSP().get()),
1184 auto platform_dict = std::make_unique<StructuredData::Dictionary>();
1185 llvm::StringRef name_str(
"name"), desc_str(
"description");
1189 platform_dict->AddStringItem(name_str, host_platform_sp->GetPluginName());
1190 platform_dict->AddStringItem(
1191 desc_str, llvm::StringRef(host_platform_sp->GetDescription()));
1192 }
else if (idx > 0) {
1193 llvm::StringRef plugin_name =
1195 if (plugin_name.empty()) {
1198 platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name));
1200 llvm::StringRef plugin_desc =
1202 platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc));
1205 data.m_impl_up->SetObjectSP(
1252 bool spawn_thread) {
1259 m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
1266 int &num_errors,
bool &quit_requested,
1267 bool &stopped_for_crash)
1271 num_errors, quit_requested, stopped_for_crash);
1302 const char *repl_options) {
1333 sb_debugger.
reset(debugger_sp);
1347 const char *debugger_instance_name) {
1356 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1361 "invalid debugger instance name '%s'", debugger_instance_name);
1370 const char *debugger_instance_name) {
1378 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1380 debugger_sp->GetPropertyValue(&exe_ctx, var_name,
error));
1384 const std::string &value_str = std::string(value_strm.
GetString());
1385 if (!value_str.empty()) {
1426 LLDB_LOG(log,
"SBDebugger({0:x})::GetPrompt () => \"{1}\"",
1444 return "GetReproducerPath has been deprecated";
1523 const char *name =
m_opaque_sp->GetInstanceName().c_str();
1525 strm.
Printf(
"Debugger (instance: \"%s\", id: %" PRIu64
")", name,
id);
1543 if (platform_name_cstr && platform_name_cstr[0]) {
1562 platform.SetSDKRoot(sysroot);
1581 if (!category_name || *category_name == 0)
1587 category_sp,
false)) {
1608 if (!category_name || *category_name == 0)
1614 category_sp,
true)) {
1624 if (!category_name || *category_name == 0)
1690 if (categories ==
nullptr)
1693 while (categories[len] !=
nullptr)
1695 return llvm::ArrayRef(categories, len);
1702 uint32_t log_options =
1705 llvm::raw_string_ostream error_stream(
error);
1718 return m_opaque_sp->SetLoggingCallback(log_callback, baton);
1722void SBDebugger::SetDestroyCallback(
1727 destroy_callback, baton);
1737 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()
bool SetShowInlineDiagnostics(bool)
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 ResetStatistics()
Clear collected statistics for targets belonging to this debugger.
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
void SetTerminalHeight(uint32_t term_height)
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
uint32_t GetTerminalHeight() 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 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)
static void ResetStatistics(Debugger &debugger, Target *target)
Reset metrics associated with one or all targets in a debugger.
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.
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()
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
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)