45#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"
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));
187 std::make_unique<SystemInitializerFull>())) {
196 llvm::EnablePrettyStackTrace();
197 static std::string executable =
198 llvm::sys::fs::getMainExecutable(
nullptr,
nullptr);
199 llvm::sys::PrintStackTraceOnErrorSignal(executable);
252 static std::recursive_mutex g_mutex;
253 std::lock_guard<std::recursive_mutex> guard(g_mutex);
258 if (source_init_files) {
288 const bool mandatory =
false;
295 return this->
operator bool();
297SBDebugger::operator
bool()
const {
320 m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b);
327 m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
340 if (
data ==
nullptr) {
345 size_t size = strlen(
data);
445 m_opaque_sp->GetCommandInterpreter().GetExecutionContext());
446 if (setting && strlen(setting) > 0)
447 m_opaque_sp->DumpPropertyValue(&exe_ctx, json_strm, setting,
451 m_opaque_sp->DumpAllPropertyValues(&exe_ctx, json_strm, 0,
478 return m_opaque_sp->GetOutputFileSP()->GetStream();
525 return sb_interpreter;
533 m_opaque_sp->GetCommandInterpreter().GetSelectedTarget());
535 std::unique_lock<TargetAPIMutex> guard;
538 guard = std::unique_lock<TargetAPIMutex>(api_lock);
555 while (lldb_listener_sp->GetEventForBroadcaster(
556 process_sp.get(), event_sp, std::chrono::seconds(0))) {
584 const SBEvent &event, FILE *out,
608 const uint32_t event_type =
event.GetType();
609 char stdio_buffer[1024];
612 TargetAPIMutex api_lock = target_sp->GetAPIMutex();
613 std::lock_guard<TargetAPIMutex> guard(api_lock);
618 while ((len = process.
GetSTDOUT(stdio_buffer,
sizeof(stdio_buffer))) > 0)
620 out_sp->Write(stdio_buffer, len);
626 while ((len = process.
GetSTDERR(stdio_buffer,
sizeof(stdio_buffer))) > 0)
628 err_sp->Write(stdio_buffer, len);
647 return sb_source_manager;
653 if (arch_name && arch_name_len) {
657 const std::string &triple_str = default_arch.
GetTriple().str();
658 if (!triple_str.empty())
659 ::snprintf(arch_name, arch_name_len,
"%s", triple_str.c_str());
661 ::snprintf(arch_name, arch_name_len,
"%s",
666 if (arch_name && arch_name_len)
688 if (!script_language_name)
745 const char *target_triple,
746 const char *platform_name,
747 bool add_dependent_modules,
750 add_dependent_modules, sb_error);
762 &platform_options, target_sp);
765 sb_target.
SetSP(target_sp);
772 "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
773 "platform_name=%s, add_dependent_modules=%u, error=%s) => "
775 static_cast<void *
>(
m_opaque_sp.get()), filename, target_triple,
776 platform_name, add_dependent_modules, sb_error.
GetCString(),
777 static_cast<void *
>(target_sp.get()));
784 const char *target_triple) {
790 const bool add_dependent_modules =
true;
795 sb_target.
SetSP(target_sp);
800 "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
801 "(filename=\"%s\", triple=%s) => SBTarget(%p)",
802 static_cast<void *
>(
m_opaque_sp.get()), filename, target_triple,
803 static_cast<void *
>(target_sp.get()));
809 const char *arch_cstr) {
818 if (arch_cstr ==
nullptr) {
827 m_opaque_sp->GetPlatformList().GetSelectedPlatform();
839 sb_target.
SetSP(target_sp);
843 "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
844 "arch=%s) => SBTarget(%p)",
846 filename ? filename :
"<unspecified>",
847 arch_cstr ? arch_cstr :
"<unspecified>",
848 static_cast<void *
>(target_sp.get()));
860 const bool add_dependent_modules =
true;
867 sb_target.
SetSP(target_sp);
871 "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
873 static_cast<void *
>(target_sp.get()));
885 LLDB_LOGF(log,
"SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
887 static_cast<void *
>(sb_target.
GetSP().get()));
898 "Could not send telemetry from SBDebugger - debugger was null.");
910 result =
m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
911 target_sp->Destroy();
917 LLDB_LOGF(log,
"SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
919 static_cast<void *
>(target.
m_opaque_sp.get()), result);
954 m_opaque_sp->GetTargetList().FindTargetByGloballyUniqueID(
id));
971 const char *arch_name) {
978 m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name);
980 m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
981 FileSpec(filename), arch_name ? &arch :
nullptr));
982 sb_target.
SetSP(target_sp);
992 m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
1002 return m_opaque_sp->GetTargetList().GetNumTargets();
1016 target_sp =
m_opaque_sp->GetTargetList().GetSelectedTarget();
1017 sb_target.
SetSP(target_sp);
1023 LLDB_LOGF(log,
"SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
1025 static_cast<void *
>(target_sp.get()), sstr.
GetData());
1038 m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp);
1043 LLDB_LOGF(log,
"SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
1045 static_cast<void *
>(target_sp.get()), sstr.
GetData());
1057 sb_platform.
SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
1059 LLDB_LOGF(log,
"SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
1061 static_cast<void *
>(sb_platform.
GetSP().get()),
1073 debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.
GetSP());
1076 LLDB_LOGF(log,
"SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
1078 static_cast<void *
>(sb_platform.
GetSP().get()),
1121 auto platform_dict = std::make_unique<StructuredData::Dictionary>();
1122 llvm::StringRef name_str(
"name"), desc_str(
"description");
1126 platform_dict->AddStringItem(name_str, host_platform_sp->GetPluginName());
1127 platform_dict->AddStringItem(
1128 desc_str, llvm::StringRef(host_platform_sp->GetDescription()));
1129 }
else if (idx > 0) {
1130 llvm::StringRef plugin_name =
1132 if (plugin_name.empty()) {
1135 platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name));
1137 llvm::StringRef plugin_desc =
1139 platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc));
1142 data.m_impl_up->SetObjectSP(
1189 bool spawn_thread) {
1196 m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
1203 int &num_errors,
bool &quit_requested,
1204 bool &stopped_for_crash)
1208 num_errors, quit_requested, stopped_for_crash);
1239 const char *repl_options) {
1270 sb_debugger.
reset(debugger_sp);
1284 const char *debugger_instance_name) {
1293 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1298 "invalid debugger instance name '%s'", debugger_instance_name);
1307 const char *debugger_instance_name) {
1315 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1317 debugger_sp->GetPropertyValue(&exe_ctx, var_name,
error));
1321 const std::string &value_str = std::string(value_strm.
GetString());
1322 if (!value_str.empty()) {
1338void SBDebugger::SetTerminalWidth(uint32_t term_width) {
1351void SBDebugger::SetTerminalHeight(uint32_t term_height) {
1359 uint32_t term_height) {
1363 m_opaque_sp->SetTerminalDimensions(term_width, term_height);
1371 LLDB_LOG(log,
"SBDebugger({0:x})::GetPrompt () => \"{1}\"",
1389 return "GetReproducerPath has been deprecated";
1468 const char *name =
m_opaque_sp->GetInstanceName().c_str();
1470 strm.
Printf(
"Debugger (instance: \"%s\", id: %" PRIu64
")", name,
id);
1488 if (platform_name_cstr && platform_name_cstr[0]) {
1507 platform.SetSDKRoot(sysroot);
1526 if (!category_name || *category_name == 0)
1532 category_sp,
false)) {
1553 if (!category_name || *category_name == 0)
1559 category_sp,
true)) {
1569 if (!category_name || *category_name == 0)
1635 if (categories ==
nullptr)
1638 while (categories[len] !=
nullptr)
1640 return llvm::ArrayRef(categories, len);
1647 uint32_t log_options =
1652 bool succeeded = !
bool(err);
1653 llvm::consumeError(std::move(err));
1664 return m_opaque_sp->SetLoggingCallback(log_callback, baton);
1668void SBDebugger::SetDestroyCallback(
1673 destroy_callback, baton);
1683 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 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)
Set an internal variable.
bool DeleteCategory(const char *category_name)
Delete a type category.
lldb::LanguageType GetREPLLanguage() const
Get the current REPL language.
lldb::SBTarget GetTargetAtIndex(uint32_t idx)
Get a target by index.
lldb::SBTarget CreateTarget(const char *filename, const char *target_triple, const char *platform_name, bool add_dependent_modules, lldb::SBError &error)
Create a target with the specified parameters.
SBTypeFilter GetFilterForType(SBTypeNameSpecifier type_name_spec)
Get the filter for a type.
SBError RunREPL(lldb::LanguageType language, const char *repl_options)
Run a REPL (Read-Eval-Print Loop) for the specified language.
bool DeleteTarget(lldb::SBTarget &target)
Delete a target from the debugger.
void SkipAppInitFiles(bool b)
Set whether to skip loading application-specific .lldbinit files.
lldb::SBDebugger & operator=(const lldb::SBDebugger &rhs)
Assignment operator.
static void Terminate()
Terminate LLDB and its subsystems.
lldb::SBPlatform GetPlatformAtIndex(uint32_t idx)
Get one of the currently active platforms.
void SkipLLDBInitFiles(bool b)
Set whether to skip loading .lldbinit files.
void SetAsync(bool b)
Set whether the debugger should run in asynchronous mode.
bool SetUseExternalEditor(bool input)
Set whether to use an external editor.
bool GetCloseInputOnEOF() const
Get whether to close input on EOF (deprecated).
static bool GetDefaultArchitecture(char *arch_name, size_t arch_name_len)
Get the default architecture.
static void MemoryPressureDetected()
Notify the debugger that system memory pressure has been detected.
void SetPrompt(const char *prompt)
Set the command prompt string.
bool GetDescription(lldb::SBStream &description)
Get a description of this debugger.
void DispatchInput(const void *data, size_t data_len)
Dispatch input to the debugger.
friend class SBStructuredData
bool GetUseExternalEditor()
Get whether an external editor is being used.
static void PrintStackTraceOnError()
Configure LLDB to print a stack trace when it crashes.
static lldb::SBDebugger Create()
Create a new debugger instance (deprecated).
void SetInputFileHandle(FILE *f, bool transfer_ownership)
Set the input file handle for the debugger.
void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread)
Run the command interpreter.
static const char * GetVersionString()
Get the LLDB version string.
lldb_private::Debugger & ref() const
lldb::SBStructuredData GetSetting(const char *setting=nullptr)
Get debugger settings as structured data.
const void size_t data_len
const char * GetReproducerPath() const
Get the path to the reproducer.
void SetOutputFileHandle(FILE *f, bool transfer_ownership)
Set the output file handle for the debugger.
static lldb::SBError InitializeWithErrorHandling()
Initialize the LLDB debugger subsystem with error handling.
SBTypeSummary GetSummaryForType(SBTypeNameSpecifier type_name_spec)
Get the summary for a type.
void HandleCommand(const char *command)
Execute a command in the command interpreter.
lldb::SBCommandInterpreter GetCommandInterpreter()
Get the command interpreter for this debugger.
SBFile GetInputFile()
Get the input file for the debugger.
const char * GetPrompt() const
Get the command prompt string.
void SetTerminalDimensions(uint32_t term_width, uint32_t term_height)
Set the terminal width and height together.
friend class SBInputReader
bool SetUseColor(bool use_color)
Set whether to use color in output.
bool GetAsync()
Get whether the debugger is running in asynchronous mode.
const lldb::DebuggerSP & get_sp() const
static bool StateIsRunningState(lldb::StateType state)
Check if a state is a running state.
SBError SetErrorFile(SBFile file)
Set the error file for the debugger.
bool SetUseSourceCache(bool use_source_cache)
Set whether to use the source cache.
uint32_t GetNumCategories()
Get the number of type categories.
static lldb::SBStringList GetInternalVariableValue(const char *var_name, const char *debugger_instance_name)
Get the value of an internal variable.
void Clear()
Clear this debugger instance.
SBTypeFormat GetFormatForType(SBTypeNameSpecifier type_name_spec)
Get the format for a type.
bool GetUseColor() const
Get whether color is being used in output.
static bool SupportsLanguage(lldb::LanguageType language)
Check if a specific language is supported by LLDB.
lldb::SBListener GetListener()
Get the listener associated with this debugger.
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
Set a callback for log output.
lldb::DebuggerSP m_opaque_sp
lldb::ScriptLanguage GetScriptLanguage() const
Get the current scripting language.
LLDB_DEPRECATED_FIXME("Use AddDestroyCallback and RemoveDestroyCallback", "AddDestroyCallback") void SetDestroyCallback(lldb lldb::callback_token_t AddDestroyCallback(lldb::SBDebuggerDestroyCallback destroy_callback, void *baton)
Set a callback for when the debugger is destroyed (deprecated).
void SetScriptLanguage(lldb::ScriptLanguage script_lang)
Set the current scripting language.
uint32_t GetNumAvailablePlatforms()
Get the number of available platforms.
lldb::SBTarget FindTargetWithLLDBProcess(const lldb::ProcessSP &processSP)
SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier type_name_spec)
Get the synthetic for a type.
void DispatchClientTelemetry(const lldb::SBStructuredData &data)
Dispatch telemetry data from client to server.
SBTypeCategory GetCategoryAtIndex(uint32_t index)
Get a type category by index.
lldb::SBPlatform GetSelectedPlatform()
Get the selected platform.
static const char * GetBroadcasterClass()
Get the broadcaster class name.
lldb::SBTarget CreateTargetWithFileAndArch(const char *filename, const char *archname)
Create a target with the specified file and architecture.
bool IsValid() const
Check if this is a valid SBDebugger object.
static void Initialize()
Initialize LLDB and its subsystems.
static bool StateIsStoppedState(lldb::StateType state)
Check if a state is a stopped state.
lldb::SBError SetCurrentPlatform(const char *platform_name)
Set the current platform by name.
lldb::SBSourceManager GetSourceManager()
Get the source manager for this debugger.
SBTypeCategory GetCategory(const char *category_name)
Get a type category by name.
void ResetStatistics()
Clear collected statistics for targets belonging to this debugger.
void SetREPLLanguage(lldb::LanguageType repl_lang)
Set the current REPL language.
SBStructuredData GetScriptInterpreterInfo(ScriptLanguage language)
Get information about a script interpreter as structured data.
static SBDebugger FindDebuggerWithID(int id)
Find a debugger by ID. Returns an invalid debugger if not found.
bool SetShowInlineDiagnostics(bool b)
Set whether to show inline diagnostics.
uint32_t GetNumPlatforms()
Get the number of currently active platforms.
void DispatchInputEndOfFile()
Signal end-of-file to the current input dispatch.
uint32_t GetTerminalWidth() const
Get the terminal width.
bool InterruptRequested()
Check if an interrupt has been requested.
lldb::SBTarget FindTargetWithFileAndArch(const char *filename, const char *arch)
Find a target with the specified file and architecture.
static lldb::SBStructuredData GetProgressDataFromEvent(const lldb::SBEvent &event)
Get progress data from an event.
static const char * StateAsCString(lldb::StateType state)
Convert a state type to a string.
void PushInputReader(lldb::SBInputReader &reader)
Push an input reader onto the IO handler stack.
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()
Get the dummy target.
bool EnableLog(const char *channel, const char **categories)
Enable logging for a specific channel and category.
static bool SetDefaultArchitecture(const char *arch_name)
Set the default architecture.
lldb_private::Debugger * get() const
void RestoreInputTerminalState()
Restore the previously saved terminal state.
SBFile GetOutputFile()
Get the output file for the debugger.
lldb::SBBroadcaster GetBroadcaster()
Get the broadcaster that allows subscribing to events from this debugger.
void SetSelectedTarget(SBTarget &target)
Set the selected target.
SBTypeCategory GetDefaultCategory()
Get the default type category.
bool GetUseSourceCache() const
Get whether the source cache is being used.
SBFile GetErrorFile()
Get the error file for the debugger.
uint32_t GetTerminalHeight() const
Get the terminal height.
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 voi HandleProcessEvent)(const lldb::SBProcess &process, const lldb::SBEvent &event, SBFile out, SBFile err)
Handle a process event (deprecated).
lldb::SBStructuredData GetAvailablePlatformInfoAtIndex(uint32_t idx)
Get information about the available platform at the given index as structured data.
static SBStructuredData GetBuildConfiguration()
Get the build configuration as structured data.
SBTypeCategory CreateCategory(const char *category_name)
Create a new type category.
bool SetCurrentPlatformSDKRoot(const char *sysroot)
Set the SDK root for the current platform.
void SetErrorFileHandle(FILE *f, bool transfer_ownership)
Set the error file handle for the debugger.
SBTrace LoadTraceFromFile(SBError &error, const SBFileSpec &trace_description_file)
Load a trace from a trace description file.
void CancelInterruptRequest()
Cancel a previously requested interrupt.
uint32_t GetNumTargets()
Get the number of targets in the debugger.
FILE * GetInputFileHandle()
Get the input file handle for the debugger.
SBError SetInputFile(SBFile file)
Set the input file for the debugger.
void DispatchInputInterrupt()
Interrupt the current input dispatch.
SBError SetInputString(const char *data)
Set the input from a string.
uint32_t GetIndexOfTarget(lldb::SBTarget target)
Get the index of a target.
SBError SetOutputFile(SBFile file)
Set the output file for the debugger.
lldb::SBTarget GetSelectedTarget()
Get the currently selected target.
void SaveInputTerminalState()
Save the current terminal state.
FILE * GetErrorFileHandle()
Get the error file handle for the debugger.
void SetSelectedPlatform(lldb::SBPlatform &platform)
Set the selected platform.
friend class SBSourceManager
void reset(const lldb::DebuggerSP &debugger_sp)
FILE * GetOutputFileHandle()
Get the output file handle for the debugger.
const char * GetInstanceName()
Get the instance name of this debugger.
lldb::SBTarget FindTargetWithProcessID(lldb::pid_t pid)
Find a target with the specified process ID.
static void PrintDiagnosticsOnError()
Configure LLDB to print diagnostic information when it crashes.
void SetCloseInputOnEOF(bool b)
Set whether to close input on EOF (deprecated).
friend class SBCommandInterpreter
lldb::user_id_t GetID()
Get the unique ID of this debugger.
lldb::SBTarget CreateTargetWithFileAndTargetTriple(const char *filename, const char *target_triple)
Create a target with the specified file and target triple.
SBDebugger()
Default constructor creates an invalid SBDebugger instance.
bool RemoveDestroyCallback(lldb::callback_token_t token)
Remove a destroy callback.
static lldb::SBStructuredData GetDiagnosticFromEvent(const lldb::SBEvent &event)
Get diagnostic information from an event.
lldb::ScriptLanguage GetScriptingLanguage(const char *script_language_name)
Get the scripting language by name.
lldb::SBTarget FindTargetByGloballyUniqueID(lldb::user_id_t id) const
Find a target with the specified unique ID.
static void Destroy(lldb::SBDebugger &debugger)
Destroy a debugger instance.
void RequestInterrupt()
Request an interrupt of the current operation.
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 * GetCString() const
Get the string value as a C string.
const char * AsCString(const char *value_if_empty) 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 StructuredData::DictionarySP GetBuildConfiguration()
Get the build configuration as structured data.
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)
Write the diagnostic log into a directory and print a message to the given output stream.
static Diagnostics & Instance()
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
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)
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
static ObjectSP ParseJSON(llvm::StringRef json_text)
A Lockable handle over a Target's API mutex, returned by Target::GetAPIMutex() and backing the public...
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.
class LLDB_API SBBroadcaster
@ eCommandInterpreterResultInferiorCrash
Stopped because the corresponding option was set and the inferior crashed.
@ eCommandInterpreterResultQuitRequested
Stopped because quit was requested.
class LLDB_API SBTypeCategory
std::shared_ptr< lldb_private::Platform > PlatformSP
StateType
Process and Thread States.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
class LLDB_API SBTypeFilter
class LLDB_API SBTypeFormat
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
class LLDB_API SBStringList
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
class LLDB_API SBTypeSynthetic
class LLDB_API SBCommandInterpreterRunResult
InputReaderGranularity
Token size/granularities for Input Readers.
class LLDB_API SBTypeSummary
static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value, bool *success_ptr)