LLDB Python API#

lldb Package#

The lldb module contains the public APIs for Python binding.

Some of the important classes are described here:

  • SBTarget: Represents the target program running under the debugger.

  • SBProcess: Represents the process associated with the target program.

  • SBThread: Represents a thread of execution. SBProcess contains SBThreads.

  • SBFrame: Represents one of the stack frames associated with a thread. SBThread contains SBFrame(s).

  • SBSymbolContext: A container that stores various debugger related info.

  • SBValue: Represents the value of a variable, a register, or an expression.

  • SBModule: Represents an executable image and its associated object and symbol files. SBTarget contains SBModule.

  • SBBreakpoint: Represents a logical breakpoint and its associated settings. SBTarget contains SBBreakpoints.

  • SBSymbol: Represents the symbol possibly associated with a stack frame.

  • SBCompileUnit: Represents a compilation unit, or compiled source file.

  • SBFunction: Represents a generic function, which can be inlined or not.

  • SBBlock: Represents a lexical block. SBFunction contains SBBlocks.

  • SBLineEntry: Specifies an association with a contiguous range of instructions and a source file location. SBCompileUnit contains SBLineEntry.

The different enums in the lldb module are described in Python API enumerators and constants.

Functions#

SBBreakpoint_EventIsBreakpointEvent(...)

SBBreakpoint_GetBreakpointEventTypeFromEvent(...)

SBBreakpoint_GetBreakpointFromEvent(...)

SBBreakpoint_GetBreakpointLocationAtIndexFromEvent(...)

SBBreakpoint_GetNumBreakpointLocationsFromEvent(...)

SBCommandInterpreter_EventIsCommandInterpreterEvent(...)

SBCommandInterpreter_GetArgumentDescriptionAsCString(lldb)

SBCommandInterpreter_GetArgumentTypeAsCString(lldb)

SBCommandInterpreter_GetBroadcasterClass()

SBCommunication_GetBroadcasterClass()

SBData_CreateDataFromCString(lldb, ...)

SBData_CreateDataFromDoubleArray(lldb, ...)

SBData_CreateDataFromSInt32Array(lldb, ...)

SBData_CreateDataFromSInt64Array(lldb, ...)

SBData_CreateDataFromUInt32Array(lldb, ...)

SBData_CreateDataFromUInt64Array(lldb, ...)

SBDebugger_Create(-> SBDebugger -> SBDebugger)

SBDebugger_Destroy(SBDebugger debugger)

SBDebugger_FindDebuggerWithID(int id)

SBDebugger_GetBroadcasterClass()

SBDebugger_GetBuildConfiguration()

SBDebugger_GetDefaultArchitecture(...)

SBDebugger_GetDiagnosticFromEvent(SBEvent event)

SBDebugger_GetInternalVariableValue(...)

SBDebugger_GetProgressDataFromEvent(...)

SBDebugger_GetProgressFromEvent(SBEvent event)

SBDebugger_GetVersionString()

SBDebugger_Initialize()

SBDebugger_InitializeWithErrorHandling()

SBDebugger_MemoryPressureDetected()

SBDebugger_PrintDiagnosticsOnError()

SBDebugger_PrintStackTraceOnError()

SBDebugger_SetDefaultArchitecture(...)

SBDebugger_SetInternalVariable(...)

SBDebugger_StateAsCString(lldb)

SBDebugger_StateIsRunningState(lldb)

SBDebugger_StateIsStoppedState(lldb)

SBDebugger_SupportsLanguage(lldb)

SBDebugger_Terminate()

SBEvent_GetCStringFromEvent(SBEvent event)

SBFileSpec_ResolvePath(...)

SBFile_MakeBorrowed(lldb)

SBFile_MakeBorrowedForcingIOMethods(lldb)

SBFile_MakeForcingIOMethods(lldb)

SBHostOS_GetLLDBPath(lldb)

SBHostOS_GetLLDBPythonPath()

SBHostOS_GetProgramFileSpec()

SBHostOS_GetUserHomeDirectory()

SBHostOS_ThreadCancel(lldb, SBError err)

SBHostOS_ThreadCreate(char const * name, ...)

SBHostOS_ThreadCreated(char const * name)

SBHostOS_ThreadDetach(lldb, SBError err)

SBHostOS_ThreadJoin(lldb, lldb, SBError err)

SBLanguageRuntime_GetCatchKeywordForLanguage(lldb)

SBLanguageRuntime_GetLanguageTypeFromString(...)

SBLanguageRuntime_GetNameForLanguageType(lldb)

SBLanguageRuntime_GetThrowKeywordForLanguage(lldb)

SBLanguageRuntime_LanguageIsCFamily(lldb)

SBLanguageRuntime_LanguageIsCPlusPlus(lldb)

SBLanguageRuntime_LanguageIsObjC(lldb)

SBLanguageRuntime_SupportsExceptionBreakpointsOnCatch(lldb)

SBLanguageRuntime_SupportsExceptionBreakpointsOnThrow(lldb)

SBModuleSpecList_GetModuleSpecifications(...)

SBModule_GarbageCollectAllocatedModules()

Removes all modules which are no longer needed by any part of LLDB from the module cache.

SBModule_GetNumberAllocatedModules()

Returns the number of modules in the module cache.

SBPlatform_GetHostPlatform()

SBProcess_EventIsProcessEvent(SBEvent event)

SBProcess_EventIsStructuredDataEvent(...)

SBProcess_GetBroadcasterClass()

Get default process broadcaster class name (lldb.process).

SBProcess_GetBroadcasterClassName()

SBProcess_GetInterruptedFromEvent(SBEvent event)

SBProcess_GetNumRestartedReasonsFromEvent(...)

SBProcess_GetProcessFromEvent(SBEvent event)

SBProcess_GetRestartedFromEvent(SBEvent event)

SBProcess_GetRestartedReasonAtIndexFromEvent(...)

SBProcess_GetStateFromEvent(SBEvent event)

SBProcess_GetStructuredDataFromEvent(...)

SBReproducer_Capture(char const * path)

SBReproducer_PassiveReplay(char const * path)

SBReproducer_SetAutoGenerate(bool b)

SBReproducer_SetWorkingDirectory(...)

SBTarget_EventIsTargetEvent(SBEvent event)

SBTarget_GetBroadcasterClassName()

SBTarget_GetModuleAtIndexFromEvent(...)

SBTarget_GetNumModulesFromEvent(SBEvent event)

SBTarget_GetTargetFromEvent(SBEvent event)

SBThread_EventIsThreadEvent(SBEvent event)

SBThread_GetBroadcasterClassName()

SBThread_GetStackFrameFromEvent(SBEvent event)

SBThread_GetThreadFromEvent(SBEvent event)

SBTrace_LoadTraceFromFile(SBError error, ...)

SBTypeSummary_CreateWithFunctionName(...)

SBTypeSummary_CreateWithScriptCode(...)

SBTypeSummary_CreateWithSummaryString(...)

SBTypeSynthetic_CreateWithClassName(...)

SBTypeSynthetic_CreateWithScriptCode(...)

SBWatchpoint_EventIsWatchpointEvent(...)

SBWatchpoint_GetWatchpointEventTypeFromEvent(...)

SBWatchpoint_GetWatchpointFromEvent(...)

Classes#

SBAddress(*args)

A section + offset based address class.

SBAddressRange(*args)

API clients can get address range information.

SBAddressRangeList(*args)

Represents a list of SBAddressRange.

SBAttachInfo(*args)

Describes how to attach when calling SBTarget.Attach.

SBBlock(*args)

Represents a lexical block.

SBBreakpoint(*args)

Represents a logical breakpoint and its associated settings.

SBBreakpointList(target)

Represents a list of SBBreakpoint.

SBBreakpointLocation(*args)

Represents one unique instance (by address) of a logical breakpoint.

SBBreakpointName(*args)

Represents a breakpoint name registered in a given SBTarget.

SBBroadcaster(*args)

Represents an entity which can broadcast events.

SBCommandInterpreter(*args)

SBCommandInterpreter handles/interprets commands for lldb.

SBCommandInterpreterRunOptions(*args)

SBCommandInterpreterRunOptions controls how the RunCommandInterpreter runs the code it is fed.

SBCommandReturnObject(*args)

Represents a container which holds the result from command execution.

SBCommunication(*args)

Allows sending/receiving data.

SBCompileUnit(*args)

Represents a compilation unit, or compiled source file.

SBData(*args)

Represents a data buffer.

SBDebugger(*args)

SBDebugger is the primordial object that creates SBTargets and provides access to them.

SBDeclaration(*args)

Specifies an association with a line and column for a variable.

SBEnvironment(*args)

Represents the environment of a certain process.

SBError(*args)

Represents a container for holding any error code.

SBEvent(*args)

API clients can register to receive events.

SBExecutionContext(*args)

Describes the program context in which a command should be executed.

SBExpressionOptions(*args)

A container for options to use when evaluating expressions.

SBFile(*args)

Represents a file.

SBFileSpec(*args)

Represents a file specification that divides the path into a directory and basename.

SBFileSpecList(*args)

Represents a list of SBFileSpec.

SBFormat(*args)

Class that represents a format string that can be used to generate descriptions of objects like frames and threads.

SBFrame(*args)

Represents one of the stack frames associated with a thread.

SBFunction(*args)

Represents a generic function, which can be inlined or not.

SBHostOS()

Provides information about the host system.

SBInstruction(*args)

Represents a (machine language) instruction.

SBInstructionList(*args)

Represents a list of machine instructions.

SBLanguageRuntime()

Utility functions for LanguageType

SBLaunchInfo(argv)

Describes how a target or program should be launched.

SBLineEntry(*args)

Specifies an association with a contiguous range of instructions and a source file location.

SBListener(*args)

API clients can register its own listener to debugger events.

SBMemoryRegionInfo(*args)

API clients can get information about memory regions in processes.

SBMemoryRegionInfoList(*args)

Represents a list of SBMemoryRegionInfo.

SBModule(*args)

Represents an executable image and its associated object and symbol files.

SBModuleSpec(*args)

Proxy of C++ lldb::SBModuleSpec class.

SBModuleSpecList(*args)

Represents a list of SBModuleSpec.

SBPlatform(*args)

A class that represents a platform that can represent the current host or a remote host debug platform.

SBPlatformConnectOptions(*args)

Describes how SBPlatform.ConnectRemote connects to a remote platform.

SBPlatformShellCommand(*args)

Represents a shell command that can be run by SBPlatform.Run.

SBProcess(*args)

Represents the process associated with the target program.

SBProcessInfo(*args)

Describes an existing process and any discoverable information that pertains to that process.

SBProcessInfoList(*args)

Proxy of C++ lldb::SBProcessInfoList class.

SBQueue(*args)

Represents a libdispatch queue in the process.

SBQueueItem()

This class represents an item in an SBQueue.

SBReproducer()

Controls LLDB's reproducer functionality.

SBSaveCoreOptions(*args)

Proxy of C++ lldb::SBSaveCoreOptions class.

SBScriptObject(*args)

Proxy of C++ lldb::SBScriptObject class.

SBSection(*args)

Represents an executable image section.

SBSourceManager(*args)

Represents a central authority for displaying source code.

SBStatisticsOptions(*args)

A container for options to use when dumping statistics.

SBStream()

Represents a destination for streaming data output to.

SBStringList(*args)

Represents a list of strings.

SBStructuredData(*args)

A class representing a StructuredData event.

SBSymbol(*args)

Represents the symbol possibly associated with a stack frame.

SBSymbolContext(*args)

A context object that provides access to core debugger entities.

SBSymbolContextList(*args)

Represents a list of symbol context object.

SBSyntheticValueProvider(valobj)

SBTarget(*args)

Represents the target program running under the debugger.

SBThread(*args)

Represents a thread of execution.

SBThreadCollection(*args)

Represents a collection of SBThread objects.

SBThreadPlan(*args)

Represents a plan for the execution control of a given thread.

SBTrace()

Represents a processor trace.

SBTraceCursor()

Represents a trace cursor.

SBType(*args)

Represents a data type in lldb.

SBTypeCategory(*args)

Represents a category that can contain formatters for types.

SBTypeEnumMember(*args)

Represents a member of an enum in lldb.

SBTypeEnumMemberList(*args)

Represents a list of SBTypeEnumMembers.

SBTypeFilter(*args)

Represents a filter that can be associated to one or more types.

SBTypeFormat(*args)

Represents a format that can be associated to one or more types.

SBTypeList(*args)

Represents a list of SBType s.

SBTypeMember(*args)

Represents a member of a type.

SBTypeMemberFunction(*args)

Represents a member function of a type.

SBTypeNameSpecifier(*args)

Represents a general way to provide a type name to LLDB APIs.

SBTypeStaticField(*args)

Proxy of C++ lldb::SBTypeStaticField class.

SBTypeSummary(*args)

Represents a summary that can be associated to one or more types.

SBTypeSummaryOptions(*args)

Proxy of C++ lldb::SBTypeSummaryOptions class.

SBTypeSynthetic(*args)

Represents a summary that can be associated to one or more types.

SBUnixSignals(*args)

Allows you to manipulate LLDB's signal disposition

SBValue(*args)

Represents the value of a variable, a register, or an expression.

SBValueList(*args)

Represents a collection of SBValues.

SBVariablesOptions(*args)

Describes which variables should be returned from SBFrame.GetVariables.

SBWatchpoint(*args)

Represents an instance of watchpoint for a specific target program.

SBWatchpointOptions(*args)

A container for options to use when creating watchpoints.

value(sbvalue)

Wraps SBValue objects so the resulting object can be used as a variable would be in code.

value_iter(value)

Allows iterating over the children of an SBValue.