45#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"
68static llvm::sys::DynamicLibrary
LoadPlugin(
const lldb::DebuggerSP &debugger_sp,
71 llvm::sys::DynamicLibrary dynlib =
72 llvm::sys::DynamicLibrary::getPermanentLibrary(spec.
GetPath().c_str());
73 if (dynlib.isValid()) {
81 LLDBCommandPluginInit init_func =
82 (LLDBCommandPluginInit)(uintptr_t)dynlib.getAddressOfSymbol(
83 "_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
85 if (init_func(debugger_sb))
88 error.SetErrorString(
"plug-in refused to load "
89 "(lldb::PluginInitialize(lldb::SBDebugger) "
92 error.SetErrorString(
"plug-in is missing the required initialization: "
93 "lldb::PluginInitialize(lldb::SBDebugger)");
97 error.SetErrorString(
"this file does not represent a loadable dylib");
99 error.SetErrorString(
"no such file");
101 return llvm::sys::DynamicLibrary();
129 : m_opaque_sp(debugger_sp) {
155 uint64_t &progress_id,
158 bool &is_debugger_specific) {
162 if (progress_data ==
nullptr)
164 progress_id = progress_data->
GetID();
177 if (!diagnostic_data)
180 auto dictionary = std::make_unique<StructuredData::Dictionary>();
181 dictionary->AddStringItem(
"message", diagnostic_data->
GetMessage());
182 dictionary->AddStringItem(
"type", diagnostic_data->
GetPrefix());
183 dictionary->AddBooleanItem(
"debugger_specific",
187 data.
m_impl_up->SetObjectSP(std::move(dictionary));
207 std::make_unique<SystemInitializerFull>(),
LoadPlugin)) {
216 llvm::EnablePrettyStackTrace();
217 static std::string executable =
218 llvm::sys::fs::getMainExecutable(
nullptr,
nullptr);
219 llvm::sys::PrintStackTraceOnErrorSignal(executable);
272 static std::recursive_mutex g_mutex;
273 std::lock_guard<std::recursive_mutex> guard(g_mutex);
278 if (source_init_files) {
308 const bool mandatory =
false;
315 return this->
operator bool();
317SBDebugger::operator bool()
const {
320 return m_opaque_sp.get() !=
nullptr;
340 m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b);
347 m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
354 (FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
360 if (data ==
nullptr) {
365 size_t size = strlen(data);
388 error.ref().SetErrorString(
"invalid debugger");
392 error.ref().SetErrorString(
"invalid file");
411 SetOutputFile((FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
418 error.ref().SetErrorString(
"invalid debugger");
422 error.ref().SetErrorString(
"invalid file");
431 SetErrorFile((FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
443 error.ref().SetErrorString(
"invalid debugger");
447 error.ref().SetErrorString(
"invalid file");
463 m_opaque_sp->GetCommandInterpreter().GetExecutionContext());
464 if (setting && strlen(setting) > 0)
465 m_opaque_sp->DumpPropertyValue(&exe_ctx, json_strm, setting,
469 m_opaque_sp->DumpAllPropertyValues(&exe_ctx, json_strm, 0,
552 return sb_interpreter;
559 TargetSP target_sp(
m_opaque_sp->GetSelectedTarget());
560 std::unique_lock<std::recursive_mutex> lock;
562 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
574 ProcessSP process_sp(process.
GetSP());
577 ListenerSP lldb_listener_sp =
m_opaque_sp->GetListener();
578 while (lldb_listener_sp->GetEventForBroadcaster(
579 process_sp.get(), event_sp, std::chrono::seconds(0))) {
607 const SBEvent &event, FILE *out,
611 FileSP outfile = std::make_shared<NativeFile>(out,
false);
612 FileSP errfile = std::make_shared<NativeFile>(err,
false);
617 const SBEvent &event, FileSP out_sp,
629 const uint32_t event_type =
event.GetType();
630 char stdio_buffer[1024];
633 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
638 while ((len = process.
GetSTDOUT(stdio_buffer,
sizeof(stdio_buffer))) > 0)
640 out_sp->Write(stdio_buffer, len);
646 while ((len = process.
GetSTDERR(stdio_buffer,
sizeof(stdio_buffer))) > 0)
648 err_sp->Write(stdio_buffer, len);
667 return sb_source_manager;
673 if (arch_name && arch_name_len) {
677 const std::string &triple_str = default_arch.
GetTriple().str();
678 if (!triple_str.empty())
679 ::snprintf(arch_name, arch_name_len,
"%s", triple_str.c_str());
681 ::snprintf(arch_name, arch_name_len,
"%s",
686 if (arch_name && arch_name_len)
708 if (!script_language_name)
741 llvm::StringRef name,
bool value,
742 llvm::StringRef description) {
743 auto entry_up = std::make_unique<StructuredData::Dictionary>();
744 entry_up->AddBooleanItem(
"value", value);
745 entry_up->AddStringItem(
"description", description);
746 dict.
AddItem(name, std::move(entry_up));
750 auto array_up = std::make_unique<StructuredData::Array>();
751#define LLVM_TARGET(target) \
752 array_up->AddItem(std::make_unique<StructuredData::String>(#target));
753#include "llvm/Config/Targets.def"
754 auto entry_up = std::make_unique<StructuredData::Dictionary>();
755 entry_up->AddItem(
"value", std::move(array_up));
756 entry_up->AddStringItem(
"description",
"A list of configured LLVM targets.");
757 dict.
AddItem(
"targets", std::move(entry_up));
763 auto config_up = std::make_unique<StructuredData::Dictionary>();
766 "A boolean value that indicates if XML support is enabled in LLDB");
768 *config_up,
"curses", LLDB_ENABLE_CURSES,
769 "A boolean value that indicates if curses support is enabled in LLDB");
771 *config_up,
"editline", LLDB_ENABLE_LIBEDIT,
772 "A boolean value that indicates if editline support is enabled in LLDB");
774 *config_up,
"lzma", LLDB_ENABLE_LZMA,
775 "A boolean value that indicates if lzma support is enabled in LLDB");
777 *config_up,
"python", LLDB_ENABLE_PYTHON,
778 "A boolean value that indicates if python support is enabled in LLDB");
780 *config_up,
"lua", LLDB_ENABLE_LUA,
781 "A boolean value that indicates if lua support is enabled in LLDB");
783 "A boolean value that indicates if fbsdvmcore support is "
788 data.
m_impl_up->SetObjectSP(std::move(config_up));
809 const char *target_triple,
810 const char *platform_name,
811 bool add_dependent_modules,
814 add_dependent_modules, sb_error);
826 &platform_options, target_sp);
829 sb_target.
SetSP(target_sp);
836 "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
837 "platform_name=%s, add_dependent_modules=%u, error=%s) => "
839 static_cast<void *
>(
m_opaque_sp.get()), filename, target_triple,
840 platform_name, add_dependent_modules, sb_error.
GetCString(),
841 static_cast<void *
>(target_sp.get()));
848 const char *target_triple) {
854 const bool add_dependent_modules =
true;
859 sb_target.
SetSP(target_sp);
864 "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
865 "(filename=\"%s\", triple=%s) => SBTarget(%p)",
866 static_cast<void *
>(
m_opaque_sp.get()), filename, target_triple,
867 static_cast<void *
>(target_sp.get()));
873 const char *arch_cstr) {
882 if (arch_cstr ==
nullptr) {
890 PlatformSP platform_sp =
891 m_opaque_sp->GetPlatformList().GetSelectedPlatform();
899 error.SetErrorStringWithFormat(
"invalid arch_cstr: %s", arch_cstr);
902 sb_target.
SetSP(target_sp);
906 "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
907 "arch=%s) => SBTarget(%p)",
909 filename ? filename :
"<unspecified>",
910 arch_cstr ? arch_cstr :
"<unspecified>",
911 static_cast<void *
>(target_sp.get()));
923 const bool add_dependent_modules =
true;
930 sb_target.
SetSP(target_sp);
934 "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
936 static_cast<void *
>(target_sp.get()));
948 LLDB_LOGF(log,
"SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
950 static_cast<void *
>(sb_target.
GetSP().get()));
959 TargetSP target_sp(target.
GetSP());
962 result =
m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
963 target_sp->Destroy();
969 LLDB_LOGF(log,
"SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
971 static_cast<void *
>(target.
m_opaque_sp.get()), result);
990 lldb::TargetSP target_sp = target.
GetSP();
1006 sb_target.
SetSP(
m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid));
1012 const char *arch_name) {
1019 m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name);
1021 m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
1022 FileSpec(filename), arch_name ? &arch :
nullptr));
1023 sb_target.
SetSP(target_sp);
1033 m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
1043 return m_opaque_sp->GetTargetList().GetNumTargets();
1057 target_sp =
m_opaque_sp->GetTargetList().GetSelectedTarget();
1058 sb_target.
SetSP(target_sp);
1064 LLDB_LOGF(log,
"SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
1066 static_cast<void *
>(target_sp.get()), sstr.
GetData());
1077 TargetSP target_sp(sb_target.
GetSP());
1079 m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp);
1084 LLDB_LOGF(log,
"SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
1086 static_cast<void *
>(target_sp.get()), sstr.
GetData());
1098 sb_platform.
SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
1100 LLDB_LOGF(log,
"SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
1102 static_cast<void *
>(sb_platform.
GetSP().get()),
1114 debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.
GetSP());
1117 LLDB_LOGF(log,
"SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
1119 static_cast<void *
>(sb_platform.
GetSP().get()),
1162 auto platform_dict = std::make_unique<StructuredData::Dictionary>();
1163 llvm::StringRef name_str(
"name"), desc_str(
"description");
1167 platform_dict->AddStringItem(name_str, host_platform_sp->GetPluginName());
1168 platform_dict->AddStringItem(
1169 desc_str, llvm::StringRef(host_platform_sp->GetDescription()));
1170 }
else if (idx > 0) {
1171 llvm::StringRef plugin_name =
1173 if (plugin_name.empty()) {
1176 platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name));
1178 llvm::StringRef plugin_desc =
1180 platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc));
1230 bool spawn_thread) {
1237 m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
1244 int &num_errors,
bool &quit_requested,
1245 bool &stopped_for_crash)
1249 num_errors, quit_requested, stopped_for_crash);
1280 const char *repl_options) {
1287 error.SetErrorString(
"invalid debugger");
1311 sb_debugger.
reset(debugger_sp);
1322 const char *debugger_instance_name) {
1331 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1335 error.SetErrorStringWithFormat(
"invalid debugger instance name '%s'",
1336 debugger_instance_name);
1345 const char *debugger_instance_name) {
1353 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1354 lldb::OptionValueSP value_sp(
1355 debugger_sp->GetPropertyValue(&exe_ctx, var_name,
false,
error));
1359 const std::string &value_str = std::string(value_strm.
GetString());
1360 if (!value_str.empty()) {
1388 LLDB_LOGF(log,
"SBDebugger(%p)::GetPrompt () => \"%s\"",
1406 return "GetReproducerPath has been deprecated";
1479 const char *name =
m_opaque_sp->GetInstanceName().AsCString();
1481 strm.
Printf(
"Debugger (instance: \"%s\", id: %" PRIu64
")", name,
id);
1499 if (platform_name_cstr && platform_name_cstr[0]) {
1501 if (PlatformSP platform_sp = platforms.
GetOrCreate(platform_name_cstr))
1518 platform.SetSDKRoot(sysroot);
1540 if (!category_name || *category_name == 0)
1543 TypeCategoryImplSP category_sp;
1546 category_sp,
false)) {
1556 TypeCategoryImplSP category_sp;
1567 if (!category_name || *category_name == 0)
1570 TypeCategoryImplSP category_sp;
1573 category_sp,
true)) {
1583 if (!category_name || *category_name == 0)
1643 if (categories ==
nullptr)
1646 while (categories[len] !=
nullptr)
1648 return llvm::ArrayRef(categories, len);
1658 llvm::raw_string_ostream error_stream(
error);
1671 return m_opaque_sp->SetLoggingCallback(log_callback, baton);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT()
#define LLDB_INSTRUMENT_VA(...)
#define LLDB_LOGF(log,...)
#define LLDB_LOG_OPTION_PREPEND_TIMESTAMP
#define LLDB_LOG_OPTION_PREPEND_THREAD_NAME
static llvm::sys::DynamicLibrary LoadPlugin(const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error)
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 PutError(FILE *fh)
size_t PutOutput(FILE *fh)
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 FindTargetWithProcessID(pid_t pid)
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)
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 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()
void HandleProcessEvent(const lldb::SBProcess &process, const lldb::SBEvent &event, FILE *out, FILE *err)
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)
lldb::SBListener GetListener()
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
lldb::DebuggerSP m_opaque_sp
lldb::ScriptLanguage GetScriptLanguage() const
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)
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
SBTypeFilter GetFilterForType(SBTypeNameSpecifier)
lldb::SBTarget FindTargetWithFileAndArch(const char *filename, const char *arch)
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 DispatchInput(void *baton, const void *data, size_t data_len)
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...
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()
static void PrintDiagnosticsOnError()
void SetCloseInputOnEOF(bool b)
lldb::SBTarget CreateTargetWithFileAndTargetTriple(const char *filename, const char *target_triple)
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()
StructuredDataImplUP m_impl_up
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 CreateInstance(lldb::LogOutputCallback log_callback=nullptr, void *baton=nullptr)
static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id)
static ConstString GetStaticBroadcasterClass()
static lldb::DebuggerSP FindDebuggerWithInstanceName(ConstString instance_name)
static void Destroy(lldb::DebuggerSP &debugger_sp)
const std::string & GetMessage() const
llvm::StringRef GetPrefix() const
bool IsDebuggerSpecific() const
static const DiagnosticEventData * GetEventDataFromEvent(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.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
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
uint64_t GetCompleted() const
uint64_t GetTotal() const
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< Object > ObjectSP
static ObjectSP ParseJSON(const std::string &json_text)
static ArchSpec GetDefaultArchitecture()
static void SetDefaultArchitecture(const ArchSpec &arch)
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.
StateType
Process and Thread States.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
void(* LogOutputCallback)(const char *, void *baton)
InputReaderGranularity
Token size/granularities for Input Readers.
static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value, bool *success_ptr)