SBTarget#
- class lldb.SBTarget(*args)#
Represents the target program running under the debugger.
SBTarget supports module, breakpoint, and watchpoint iterations. For example,
for m in target.module_iter(): print m
produces:
(x86_64) /Volumes/data/lldb/svn/trunk/test/python_api/lldbutil/iter/a.out (x86_64) /usr/lib/dyld (x86_64) /usr/lib/libstdc++.6.dylib (x86_64) /usr/lib/libSystem.B.dylib (x86_64) /usr/lib/system/libmathCommon.A.dylib (x86_64) /usr/lib/libSystem.B.dylib(__commpage)
and,
for b in target.breakpoint_iter(): print b
produces:
SBBreakpoint: id = 1, file ='main.cpp', line = 66, locations = 1 SBBreakpoint: id = 2, file ='main.cpp', line = 85, locations = 1
and,
for wp_loc in target.watchpoint_iter(): print wp_loc
produces:
Watchpoint 1: addr = 0x1034ca048 size = 4 state = enabled type = rw declare @ '/Volumes/data/lldb/svn/trunk/test/python_api/watchpoint/main.c:12' hit_count = 2 ignore_count = 0
Attributes Summary
A read only property that returns the size in bytes of an address for this target.
A read only property that returns an object that can be used to access breakpoints as an array ("bkpt_12 = lldb.target.bkpt[12]").
A read only property that returns a list() of lldb.SBBreakpoint objects for all breakpoints in this target.
A read only property that an lldb object that represents the broadcaster (lldb.SBBroadcaster) for this target.
A read only property that returns an lldb enumeration value (lldb.eByteOrderLittle, lldb.eByteOrderBig, lldb.eByteOrderInvalid) that represents the byte order for this target.
A read only property that returns the size in host bytes of a byte in the code address space for this target.
A read only property that returns the size in host bytes of a byte in the data address space for this target.
A read only property that returns an lldb object that represents the debugger (lldb.SBDebugger) that owns this target.
A read only property that returns an lldb object that represents the main executable module (lldb.SBModule) for this target.
A read only property that returns an object that implements python operator overloading with the square brackets().n target.module[<int>] allows array access to any modules.n target.module[<str>] allows access to modules by basename, full path, or uuid string value.n target.module[uuid.UUID()] allows module access by UUID.n target.module[re] allows module access using a regular expression that matches the module full path.
A read only property that returns a list() of lldb.SBModule objects contained in this target.
A read only property that returns the number of breakpoints that this target has as an integer.
A read only property that returns the number of watchpoints that this target has as an integer.
A read only property that returns the platform associated with with this target.
A read only property that returns an lldb object that represents the process (lldb.SBProcess) that this target owns.
A read only property that returns the target triple (arch-vendor-os) for this target as a string.
A read only property that returns an object that can be used to access watchpoints as an array ("watchpoint_12 = lldb.target.watchpoint[12]").
A read only property that returns a list() of lldb.SBwatchpoint objects for all watchpoints in this target.
Methods Summary
AddModule
(-> bool -> SBModule -> SBModule)AppendImageSearchPath
(SBTarget self, ...)Append the path mapping (from -> to) to the target's paths mapping list.
Attach
(SBTarget self, ...)AttachToProcessWithID
(SBTarget self, ...)Attach to process with pid.
AttachToProcessWithName
(SBTarget self, ...)Attach to process with name.
BreakpointCreateByAddress
(SBTarget self, lldb)BreakpointCreateBySBAddress
(SBTarget self, ...)BreakpointCreateForException
(SBTarget self, ...)BreakpointCreateFromScript
(SBTarget self, ...)Create a breakpoint using a scripted resolver.
BreakpointDelete
(SBTarget self, lldb)BreakpointsCreateFromFile
(-> SBError)Read breakpoints from source_file and return the newly created breakpoints in bkpt_list.
BreakpointsWriteToFile
(-> SBError)Write breakpoints listed in bkpt_list to dest_file.
Clear
(SBTarget self)ClearModuleLoadAddress
(module)Clear the section base load addresses for all sections in a module.
ClearSectionLoadAddress
(section)Clear the base load address for a module section.
ConnectRemote
(SBTarget self, ...)Connect to a remote debug server with url.
CreateTrace
(error)Create a Trace object for the current target using the using the default supported tracing technology for this process.
CreateValueFromAddress
(SBTarget self, ...)Create an SBValue with the given name by treating the memory starting at addr as an entity of type.
CreateValueFromData
(SBTarget self, ...)CreateValueFromExpression
(SBTarget self, ...)DeleteAllBreakpoints
(SBTarget self)DeleteAllWatchpoints
(SBTarget self)DeleteBreakpointName
(SBTarget self, ...)DeleteWatchpoint
(SBTarget self, lldb)DisableAllBreakpoints
(SBTarget self)DisableAllWatchpoints
(SBTarget self)EnableAllBreakpoints
(SBTarget self)EnableAllWatchpoints
(SBTarget self)EvaluateExpression
(-> SBValue)EventIsTargetEvent
(SBEvent event)FindBreakpointByID
(SBTarget self, lldb)FindBreakpointsByName
(SBTarget self, ...)FindCompileUnits
(SBTarget self, ...)Find compile units related to this target and passed source file.
FindFirstGlobalVariable
(SBTarget self, ...)Find the first global (or static) variable by name.
FindFirstType
(SBTarget self, char const * type)FindFunctions
(SBTarget self, ...)Find functions by name.
FindGlobalFunctions
(name, max_matches, matchtype)Find global functions by their name with pattern matching.
FindGlobalVariables
(-> SBValueList)Find global and static variables by name.
FindModule
(*args)Find a module with the given module specification.
FindSymbols
(SBTarget self, ...)FindTypes
(SBTarget self, char const * type)FindWatchpointByID
(SBTarget self, lldb)GetABIName
(SBTarget self)GetAPIMutex
(SBTarget self)GetAddressByteSize
(SBTarget self)GetBasicType
(SBTarget self, lldb)GetBreakpointAtIndex
(SBTarget self, uint32_t idx)GetBreakpointNames
(SBTarget self, ...)GetBroadcaster
(SBTarget self)GetByteOrder
(SBTarget self)GetCodeByteSize
(SBTarget self)Architecture code byte width accessor.
Returns whether statistics collection are enabled.
GetDataByteSize
(SBTarget self)Architecture data byte width accessor
GetDebugger
(SBTarget self)GetDescription
(SBTarget self, ...)Return the environment variables that would be used to launch a new process.
GetExecutable
(SBTarget self)GetInstructions
(SBTarget self, ...)Disassemble the bytes in a buffer and return them in an SBInstructionList.
GetInstructionsWithFlavor
(SBTarget self, ...)Disassemble the bytes in a buffer and return them in an SBInstructionList, with a supplied flavor.
GetLabel
(SBTarget self)GetLaunchInfo
(SBTarget self)Gets the target.max-children-count value It should be used to limit the number of children of large data structures to be displayed.
Architecture opcode byte size width accessor
Architecture opcode byte size width accessor
GetModuleAtIndex
(SBTarget self, uint32_t idx)GetNumBreakpoints
(SBTarget self)GetNumModules
(SBTarget self)GetNumModulesFromEvent
(SBEvent event)GetNumWatchpoints
(SBTarget self)GetPlatform
(SBTarget self)Return the platform object associated with the target.
GetProcess
(SBTarget self)GetSourceManager
(SBTarget self)GetStackRedZoneSize
(SBTarget self)GetStatistics
(*args)Overload 1: Returns a dump of the collected statistics.
GetTargetFromEvent
(SBEvent event)GetTrace
()Get a SBTrace object the can manage the processor trace information of this target.
GetTriple
(SBTarget self)GetWatchpointAtIndex
(SBTarget self, uint32_t idx)Install
(SBTarget self)Install any binaries that need to be installed.
IsLoaded
(SBTarget self, SBModule module)Returns true if the module has been loaded in this
SBTarget
.IsValid
(SBTarget self)Launch
(-> SBProcess)Launch a new process.
LaunchSimple
(SBTarget self, ...)Launch a new process with sensible defaults.
LoadCore
(-> SBProcess)Load a core file
ReadInstructions
(...)Disassemble a specified number of instructions starting at an address.
ReadMemory
(SBTarget self, SBAddress addr, ...)Read target memory.
RemoveModule
(SBTarget self, SBModule module)Reset the statistics collected for this target.
ResolveFileAddress
(SBTarget self, lldb)Resolve a current file address into a section offset address.
ResolveLoadAddress
(vm_addr)Resolve a current load address into a section offset address.
ResolvePastLoadAddress
(stop_id, vm_addr)Resolve a current load address into a section offset address using the process stop ID to identify a time in the past.
Sets whether we should collect statistics on lldb or not.
SetLabel
(SBTarget self, char const * label)SetLaunchInfo
(SBTarget self, ...)SetModuleLoadAddress
(module, sections_offset)Slide all file addresses for all module sections so that module appears to loaded at these slide addresses.
SetSectionLoadAddress
(section, section_base_addr)Set the base load address for a module section.
WatchAddress
(SBTarget self, lldb, ...)WatchpointCreateByAddress
(SBTarget self, ...)Returns an iterator over all breakpoints in a lldb.SBTarget object.
An accessor function that returns a bkpts_access() object which allows lazy bkpt access from a lldb.SBtarget object.
An accessor function that returns a modules_access() object which allows lazy module access from a lldb.SBTarget object.
An accessor function that returns a list() that contains all modules in a lldb.SBTarget object.
An accessor function that returns a list() that contains all bkpts in a lldb.SBtarget object.
An accessor function that returns a list() that contains all watchpoints in a lldb.SBtarget object.
An accessor function that returns a watchpoints_access() object which allows lazy watchpoint access from a lldb.SBtarget object.
Returns an iterator over all modules in a lldb.SBTarget object.
Returns an iterator over all watchpoints in a lldb.SBTarget object.
Attributes Documentation
- addr_size#
A read only property that returns the size in bytes of an address for this target.
- breakpoint#
A read only property that returns an object that can be used to access breakpoints as an array (“bkpt_12 = lldb.target.bkpt[12]”).
- breakpoints#
A read only property that returns a list() of lldb.SBBreakpoint objects for all breakpoints in this target.
- broadcaster#
A read only property that an lldb object that represents the broadcaster (lldb.SBBroadcaster) for this target.
- byte_order#
A read only property that returns an lldb enumeration value (lldb.eByteOrderLittle, lldb.eByteOrderBig, lldb.eByteOrderInvalid) that represents the byte order for this target.
- code_byte_size#
A read only property that returns the size in host bytes of a byte in the code address space for this target.
- data_byte_size#
A read only property that returns the size in host bytes of a byte in the data address space for this target.
- debugger#
A read only property that returns an lldb object that represents the debugger (lldb.SBDebugger) that owns this target.
- eBroadcastBitBreakpointChanged = <Mock name='mock.SBTarget_eBroadcastBitBreakpointChanged' id='126815303215744'>#
- eBroadcastBitModulesLoaded = <Mock name='mock.SBTarget_eBroadcastBitModulesLoaded' id='126815303215696'>#
- eBroadcastBitModulesUnloaded = <Mock name='mock.SBTarget_eBroadcastBitModulesUnloaded' id='126815303215888'>#
- eBroadcastBitSymbolsChanged = <Mock name='mock.SBTarget_eBroadcastBitSymbolsChanged' id='126815303216032'>#
- eBroadcastBitSymbolsLoaded = <Mock name='mock.SBTarget_eBroadcastBitSymbolsLoaded' id='126815303215984'>#
- eBroadcastBitWatchpointChanged = <Mock name='mock.SBTarget_eBroadcastBitWatchpointChanged' id='126815303215936'>#
- executable#
A read only property that returns an lldb object that represents the main executable module (lldb.SBModule) for this target.
- module#
A read only property that returns an object that implements python operator overloading with the square brackets().n target.module[<int>] allows array access to any modules.n target.module[<str>] allows access to modules by basename, full path, or uuid string value.n target.module[uuid.UUID()] allows module access by UUID.n target.module[re] allows module access using a regular expression that matches the module full path.
- modules#
A read only property that returns a list() of lldb.SBModule objects contained in this target. This list is a list all modules that the target currently is tracking (the main executable and all dependent shared libraries).
- num_breakpoints#
A read only property that returns the number of breakpoints that this target has as an integer.
- num_watchpoints#
A read only property that returns the number of watchpoints that this target has as an integer.
- platform#
A read only property that returns the platform associated with with this target.
- process#
A read only property that returns an lldb object that represents the process (lldb.SBProcess) that this target owns.
- triple#
A read only property that returns the target triple (arch-vendor-os) for this target as a string.
- watchpoint#
A read only property that returns an object that can be used to access watchpoints as an array (“watchpoint_12 = lldb.target.watchpoint[12]”).
- watchpoints#
A read only property that returns a list() of lldb.SBwatchpoint objects for all watchpoints in this target.
Methods Documentation
- AddModule(SBTarget self, SBModule module) bool #
- AddModule(SBTarget self, char const * path, char const * triple, char const * uuid) SBModule
- AddModule(SBTarget self, char const * path, char const * triple, char const * uuid_cstr, char const * symfile) SBModule
- AddModule(SBTarget self, SBModuleSpec module_spec) SBModule
- AppendImageSearchPath(SBTarget self, char const * _from, char const * to, SBError error)#
Append the path mapping (from -> to) to the target’s paths mapping list.
- AttachToProcessWithID(SBTarget self, SBListener listener, lldb::pid_t pid, SBError error) SBProcess #
Attach to process with pid.
- @param[in] listener
An optional listener that will receive all process events. If listener is valid then listener will listen to all process events. If not valid, then this target’s debugger (SBTarget::GetDebugger()) will listen to all process events.
- @param[in] pid
The process ID to attach to.
- @param[out]
An error explaining what went wrong if attach fails.
- @return
A process object for the attached process.
- AttachToProcessWithName(SBTarget self, SBListener listener, char const * name, bool wait_for, SBError error) SBProcess #
Attach to process with name.
- @param[in] listener
An optional listener that will receive all process events. If listener is valid then listener will listen to all process events. If not valid, then this target’s debugger (SBTarget::GetDebugger()) will listen to all process events.
- @param[in] name
Basename of process to attach to.
- @param[in] wait_for
If true wait for a new instance of ‘name’ to be launched.
- @param[out]
An error explaining what went wrong if attach fails.
- @return
A process object for the attached process.
- BreakpointCreateByAddress(SBTarget self, lldb::addr_t address) SBBreakpoint #
- BreakpointCreateByLocation(SBTarget self, char const * file, uint32_t line) SBBreakpoint #
- BreakpointCreateByLocation(SBTarget self, SBFileSpec file_spec, uint32_t line) SBBreakpoint
- BreakpointCreateByLocation(SBTarget self, SBFileSpec file_spec, uint32_t line, lldb::addr_t offset) SBBreakpoint
- BreakpointCreateByLocation(SBTarget self, SBFileSpec file_spec, uint32_t line, lldb::addr_t offset, SBFileSpecList module_list) SBBreakpoint
- BreakpointCreateByLocation(SBTarget self, SBFileSpec file_spec, uint32_t line, uint32_t column, lldb::addr_t offset, SBFileSpecList module_list) SBBreakpoint
- BreakpointCreateByLocation(SBTarget self, SBFileSpec file_spec, uint32_t line, uint32_t column, lldb::addr_t offset, SBFileSpecList module_list, bool move_to_nearest_code) SBBreakpoint
- BreakpointCreateByName(SBTarget self, char const * symbol_name, char const * module_name=None) SBBreakpoint #
- BreakpointCreateByName(SBTarget self, char const * symbol_name, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint
- BreakpointCreateByName(SBTarget self, char const * symbol_name, uint32_t name_type_mask, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint
- BreakpointCreateByName(SBTarget self, char const * symbol_name, uint32_t name_type_mask, lldb::LanguageType symbol_language, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint
- BreakpointCreateByName(SBTarget self, char const * symbol_name, uint32_t name_type_mask, lldb::LanguageType symbol_language, lldb::addr_t offset, bool offset_is_insn_count, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint
- BreakpointCreateByNames(SBTarget self, char const ** symbol_name, uint32_t name_type_mask, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint #
- BreakpointCreateByNames(SBTarget self, char const ** symbol_name, uint32_t name_type_mask, lldb::LanguageType symbol_language, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint
- BreakpointCreateByNames(SBTarget self, char const ** symbol_name, uint32_t name_type_mask, lldb::LanguageType symbol_language, lldb::addr_t offset, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint
- BreakpointCreateByRegex(SBTarget self, char const * symbol_name_regex, char const * module_name=None) SBBreakpoint #
- BreakpointCreateByRegex(SBTarget self, char const * symbol_name_regex, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint
- BreakpointCreateByRegex(SBTarget self, char const * symbol_name_regex, lldb::LanguageType symbol_language, SBFileSpecList module_list, SBFileSpecList comp_unit_list) SBBreakpoint
- BreakpointCreateBySBAddress(SBTarget self, SBAddress address) SBBreakpoint #
- BreakpointCreateBySourceRegex(SBTarget self, char const * source_regex, SBFileSpec source_file, char const * module_name=None) SBBreakpoint #
- BreakpointCreateBySourceRegex(SBTarget self, char const * source_regex, SBFileSpecList module_list, SBFileSpecList source_file) SBBreakpoint
- BreakpointCreateBySourceRegex(SBTarget self, char const * source_regex, SBFileSpecList module_list, SBFileSpecList source_file, SBStringList func_names) SBBreakpoint
- BreakpointCreateForException(SBTarget self, lldb::LanguageType language, bool catch_bp, bool throw_bp) SBBreakpoint #
- BreakpointCreateFromScript(SBTarget self, char const * class_name, SBStructuredData extra_args, SBFileSpecList module_list, SBFileSpecList file_list, bool request_hardware=False) SBBreakpoint #
Create a breakpoint using a scripted resolver.
- @param[in] class_name
This is the name of the class that implements a scripted resolver. The class should have the following signature:
class Resolver: def __init__(self, bkpt, extra_args): # bkpt - the breakpoint for which this is the resolver. When # the resolver finds an interesting address, call AddLocation # on this breakpoint to add it. # # extra_args - an SBStructuredData that can be used to # parametrize this instance. Same as the extra_args passed # to BreakpointCreateFromScript. def __get_depth__ (self): # This is optional, but if defined, you should return the # depth at which you want the callback to be called. The # available options are: # lldb.eSearchDepthModule # lldb.eSearchDepthCompUnit # The default if you don't implement this method is # eSearchDepthModule. def __callback__(self, sym_ctx): # sym_ctx - an SBSymbolContext that is the cursor in the # search through the program to resolve breakpoints. # The sym_ctx will be filled out to the depth requested in # __get_depth__. # Look in this sym_ctx for new breakpoint locations, # and if found use bkpt.AddLocation to add them. # Note, you will only get called for modules/compile_units that # pass the SearchFilter provided by the module_list & file_list # passed into BreakpointCreateFromScript. def get_short_help(self): # Optional, but if implemented return a short string that will # be printed at the beginning of the break list output for the # breakpoint.
- @param[in] extra_args
This is an SBStructuredData object that will get passed to the constructor of the class in class_name. You can use this to reuse the same class, parametrizing it with entries from this dictionary.
- @param module_list
If this is non-empty, this will be used as the module filter in the SearchFilter created for this breakpoint.
- @param file_list
If this is non-empty, this will be used as the comp unit filter in the SearchFilter created for this breakpoint.
- @return
An SBBreakpoint that will set locations based on the logic in the resolver’s search callback.
- BreakpointDelete(SBTarget self, lldb::break_id_t break_id) bool #
- BreakpointsCreateFromFile(SBTarget self, SBFileSpec source_file, SBBreakpointList new_bps) SBError #
- BreakpointsCreateFromFile(SBTarget self, SBFileSpec source_file, SBStringList matching_names, SBBreakpointList new_bps) SBError
Read breakpoints from source_file and return the newly created breakpoints in bkpt_list.
- @param[in] source_file
The file from which to read the breakpoints
- @param[in] matching_names
Only read in breakpoints whose names match one of the names in this list.
- @param[out] bkpt_list
A list of the newly created breakpoints.
- @return
An SBError detailing any errors in reading in the breakpoints.
- BreakpointsWriteToFile(SBTarget self, SBFileSpec dest_file) SBError #
- BreakpointsWriteToFile(SBTarget self, SBFileSpec dest_file, SBBreakpointList bkpt_list, bool append=False) SBError
Write breakpoints listed in bkpt_list to dest_file.
- @param[in] dest_file
The file to which to write the breakpoints.
- @param[in] bkpt_list
Only write breakpoints from this list.
- @param[in] append
If true, append the breakpoints in bkpt_list to the others serialized in dest_file. If dest_file doesn’t exist, then a new file will be created and the breakpoints in bkpt_list written to it.
- @return
An SBError detailing any errors in writing in the breakpoints.
- Clear(SBTarget self)#
- ClearModuleLoadAddress(module)#
Clear the section base load addresses for all sections in a module.
- ClearSectionLoadAddress(section)#
Clear the base load address for a module section.
- ConnectRemote(SBTarget self, SBListener listener, char const * url, char const * plugin_name, SBError error) SBProcess #
Connect to a remote debug server with url.
- @param[in] listener
An optional listener that will receive all process events. If listener is valid then listener will listen to all process events. If not valid, then this target’s debugger (SBTarget::GetDebugger()) will listen to all process events.
- @param[in] url
The url to connect to, e.g., ‘connect://localhost:12345’.
- @param[in] plugin_name
The plugin name to be used; can be NULL.
- @param[out]
An error explaining what went wrong if the connect fails.
- @return
A process object for the connected process.
- CreateTrace(error)#
Create a Trace object for the current target using the using the default supported tracing technology for this process.
- Parameters:
error (
SBError
, out) – An error if a Trace already exists or the trace couldn’t be created.
- CreateValueFromAddress(SBTarget self, char const * name, SBAddress addr, SBType type) SBValue #
Create an SBValue with the given name by treating the memory starting at addr as an entity of type.
- @param[in] name
The name of the resultant SBValue
- @param[in] addr
The address of the start of the memory region to be used.
- @param[in] type
The type to use to interpret the memory starting at addr.
- @return
An SBValue of the given type, may be invalid if there was an error reading the underlying memory.
- DeleteAllBreakpoints(SBTarget self) bool #
- DeleteAllWatchpoints(SBTarget self) bool #
- DeleteBreakpointName(SBTarget self, char const * name)#
- DeleteWatchpoint(SBTarget self, lldb::watch_id_t watch_id) bool #
- DisableAllBreakpoints(SBTarget self) bool #
- DisableAllWatchpoints(SBTarget self) bool #
- EnableAllBreakpoints(SBTarget self) bool #
- EnableAllWatchpoints(SBTarget self) bool #
- EvaluateExpression(SBTarget self, char const * expr) SBValue #
- EvaluateExpression(SBTarget self, char const * expr, SBExpressionOptions options) SBValue
- static EventIsTargetEvent(SBEvent event) bool #
- FindBreakpointByID(SBTarget self, lldb::break_id_t break_id) SBBreakpoint #
- FindBreakpointsByName(SBTarget self, char const * name, SBBreakpointList bkpt_list) bool #
- FindCompileUnits(SBTarget self, SBFileSpec sb_file_spec) SBSymbolContextList #
Find compile units related to this target and passed source file.
- Parameters:
sb_file_spec – A
lldb::SBFileSpec
object that contains source file specification.- Returns:
The symbol contexts for all the matches.
- Return type:
- FindFirstGlobalVariable(SBTarget self, char const * name) SBValue #
Find the first global (or static) variable by name.
- @param[in] name
The name of the global or static variable we are looking for.
- @return
An SBValue that gets filled in with the found variable (if any).
- FindFunctions(SBTarget self, char const * name, uint32_t name_type_mask=eFunctionNameTypeAny) SBSymbolContextList #
Find functions by name.
- Parameters:
name – The name of the function we are looking for.
name_type_mask – A logical OR of one or more FunctionNameType enum bits that indicate what kind of names should be used when doing the lookup. Bits include fully qualified names, base names, C++ methods, or ObjC selectors. See FunctionNameType for more details.
- Returns:
A lldb::SBSymbolContextList that gets filled in with all of the symbol contexts for all the matches.
- FindGlobalFunctions(name, max_matches, matchtype)#
Find global functions by their name with pattern matching.
- Parameters:
name (string, in) – The pattern to search for global or static variables
max_matches (int, in) – Allow the number of matches to be limited to max_matches.
matchtype (int, in) – The match type to use.
- Return type:
- Returns:
A list of matched variables in an SBValueList.
- FindGlobalVariables(SBTarget self, char const * name, uint32_t max_matches) SBValueList #
- FindGlobalVariables(SBTarget self, char const * name, uint32_t max_matches, lldb::MatchType matchtype) SBValueList
Find global and static variables by name.
- @param[in] name
The name of the global or static variable we are looking for.
- @param[in] max_matches
Allow the number of matches to be limited to max_matches.
- @return
A list of matched variables in an SBValueList.
- FindModule(*args)#
Find a module with the given module specification.
- Parameters:
module_spec (
SBModuleSpec
, in) – A lldb::SBModuleSpec object that contains module specification.- Return type:
- Returns:
A lldb::SBModule object that represents the found module, or an invalid SBModule object if no module was found.
- FindSymbols(SBTarget self, char const * name, lldb::SymbolType type=eSymbolTypeAny) SBSymbolContextList #
- FindTypes(SBTarget self, char const * type) SBTypeList #
- FindWatchpointByID(SBTarget self, lldb::watch_id_t watch_id) SBWatchpoint #
- GetABIName(SBTarget self) char const * #
- GetAddressByteSize(SBTarget self) uint32_t #
- GetBreakpointAtIndex(SBTarget self, uint32_t idx) SBBreakpoint #
- GetBreakpointNames(SBTarget self, SBStringList names)#
- GetBroadcaster(SBTarget self) SBBroadcaster #
- static GetBroadcasterClassName() char const * #
- GetByteOrder(SBTarget self) lldb::ByteOrder #
- GetCodeByteSize(SBTarget self) uint32_t #
Architecture code byte width accessor.
- Returns:
The size in 8-bit (host) bytes of a minimum addressable unit from the Architecture’s code bus.
- GetCollectingStats()#
Returns whether statistics collection are enabled.
- Return type:
boolean
- Returns:
true if statistics are currently being collected, false otherwise.
- GetDataByteSize(SBTarget self) uint32_t #
Architecture data byte width accessor
- Returns:
The size in 8-bit (host) bytes of a minimum addressable unit from the Architecture’s data bus.
- GetDebugger(SBTarget self) SBDebugger #
- GetDescription(SBTarget self, SBStream description, lldb::DescriptionLevel description_level) bool #
- GetEnvironment()#
Return the environment variables that would be used to launch a new process.
- Return type:
- Returns:
An lldb::SBEnvironment object which is a copy of the target’s environment.
- GetExecutable(SBTarget self) SBFileSpec #
- GetInstructions(SBTarget self, SBAddress base_addr, void const * buf) SBInstructionList #
Disassemble the bytes in a buffer and return them in an SBInstructionList.
- Parameters:
base_addr – used for symbolicating the offsets in the byte stream when disassembling.
buf – bytes to be disassembled.
size – (C++) size of the buffer.
- Return type:
- GetInstructionsWithFlavor(SBTarget self, SBAddress base_addr, char const * flavor_string, void const * buf) SBInstructionList #
Disassemble the bytes in a buffer and return them in an SBInstructionList, with a supplied flavor.
- Parameters:
base_addr – used for symbolicating the offsets in the byte stream when disassembling.
flavor – may be ‘intel’ or ‘att’ on x86 targets to specify that style of disassembly.
buf – bytes to be disassembled.
size – (C++) size of the buffer.
- Return type:
- GetLabel(SBTarget self) char const * #
- GetLaunchInfo(SBTarget self) SBLaunchInfo #
- GetMaximumNumberOfChildrenToDisplay()#
Gets the target.max-children-count value It should be used to limit the number of children of large data structures to be displayed.
- GetMaximumOpcodeByteSize()#
Architecture opcode byte size width accessor
- Return type:
int
- Returns:
The maximum size in 8-bit (host) bytes of an opcode.
- GetMinimumOpcodeByteSize()#
Architecture opcode byte size width accessor
- Return type:
int
- Returns:
The minimum size in 8-bit (host) bytes of an opcode.
- GetNumBreakpoints(SBTarget self) uint32_t #
- GetNumModules(SBTarget self) uint32_t #
- static GetNumModulesFromEvent(SBEvent event) uint32_t #
- GetNumWatchpoints(SBTarget self) uint32_t #
- GetPlatform(SBTarget self) SBPlatform #
Return the platform object associated with the target.
After return, the platform object should be checked for validity.
- @return
A platform object.
- GetSourceManager(SBTarget self) SBSourceManager #
- GetStackRedZoneSize(SBTarget self) lldb::addr_t #
- GetStatistics(*args)#
Overload 1: Returns a dump of the collected statistics.
- Return type:
- Returns:
A SBStructuredData with the statistics collected.
Overload 2: Returns a dump of the collected statistics.
- Parameters:
options (
SBStatisticsOptions
, in) – An objects object that contains all options for the statistics dumping.- Return type:
- Returns:
A SBStructuredData with the statistics collected.
- GetTrace()#
Get a SBTrace object the can manage the processor trace information of this target.
- Return type:
- Returns:
The trace object. The returned SBTrace object might not be valid, so it should be checked with a call to “bool SBTrace::IsValid()”.
- GetTriple(SBTarget self) char const * #
- GetWatchpointAtIndex(SBTarget self, uint32_t idx) SBWatchpoint #
- Install(SBTarget self) SBError #
Install any binaries that need to be installed.
This function does nothing when debugging on the host system. When connected to remote platforms, the target’s main executable and any modules that have their install path set will be installed on the remote platform. If the main executable doesn’t have an install location set, it will be installed in the remote platform’s working directory.
- @return
An error describing anything that went wrong during installation.
- IsLoaded(SBTarget self, SBModule module) bool #
Returns true if the module has been loaded in this
SBTarget
. A module can be loaded either by the dynamic loader or by being manually added to the target (seeSBTarget.AddModule
and thetarget module add
command).- Return type:
bool
- IsValid(SBTarget self) bool #
- Launch(SBTarget self, SBListener listener, char const ** argv, char const ** envp, char const * stdin_path, char const * stdout_path, char const * stderr_path, char const * working_directory, uint32_t launch_flags, bool stop_at_entry, SBError error) SBProcess #
- Launch(SBTarget self, SBLaunchInfo launch_info, SBError error) SBProcess
Launch a new process.
Launch a new process by spawning a new process using the target object’s executable module’s file as the file to launch. Arguments are given in argv, and the environment variables are in envp. Standard input and output files can be optionally re-directed to stdin_path, stdout_path, and stderr_path.
- @param[in] listener
An optional listener that will receive all process events. If listener is valid then listener will listen to all process events. If not valid, then this target’s debugger (SBTarget::GetDebugger()) will listen to all process events.
- @param[in] argv
The argument array.
- @param[in] envp
The environment array.
- @param[in] launch_flags
Flags to modify the launch (@see lldb::LaunchFlags)
- @param[in] stdin_path
The path to use when re-directing the STDIN of the new process. If all stdXX_path arguments are NULL, a pseudo terminal will be used.
- @param[in] stdout_path
The path to use when re-directing the STDOUT of the new process. If all stdXX_path arguments are NULL, a pseudo terminal will be used.
- @param[in] stderr_path
The path to use when re-directing the STDERR of the new process. If all stdXX_path arguments are NULL, a pseudo terminal will be used.
- @param[in] working_directory
The working directory to have the child process run in
- @param[in] launch_flags
Some launch options specified by logical OR’ing lldb::LaunchFlags enumeration values together.
- @param[in] stop_at_entry
If false do not stop the inferior at the entry point.
- @param[out]
An error object. Contains the reason if there is some failure.
- @return
A process object for the newly created process.
For example,
- process = target.Launch(self.dbg.GetListener(), None, None,
None, ‘/tmp/stdout.txt’, None, None, 0, False, error)
launches a new process by passing nothing for both the args and the envs and redirect the standard output of the inferior to the /tmp/stdout.txt file. It does not specify a working directory so that the debug server will use its idea of what the current working directory is for the inferior. Also, we ask the debugger not to stop the inferior at the entry point. If no breakpoint is specified for the inferior, it should run to completion if no user interaction is required.
- LaunchSimple(SBTarget self, char const ** argv, char const ** envp, char const * working_directory) SBProcess #
Launch a new process with sensible defaults.
- Parameters:
argv – The argument array.
envp – The environment array.
working_directory – The working directory to have the child process run in
- Returns:
The newly created process.
- Return type:
A pseudo terminal will be used as stdin/stdout/stderr. No launch flags are passed and the target’s debuger is used as a listener.
For example,
process = target.LaunchSimple(['X', 'Y', 'Z'], None, os.getcwd())
launches a new process by passing ‘X’, ‘Y’, ‘Z’ as the args to the executable.
- LoadCore(SBTarget self, char const * core_file) SBProcess #
- LoadCore(SBTarget self, char const * core_file, SBError error) SBProcess
Load a core file
- @param[in] core_file
File path of the core dump.
- @param[out] error
An error explaining what went wrong if the operation fails. (Optional)
- @return
A process object for the newly created core file.
For example,
process = target.LoadCore(‘./a.out.core’)
loads a new core file and returns the process object.
- ReadInstructions(SBTarget self, SBAddress base_addr, uint32_t count) SBInstructionList #
- ReadInstructions(SBTarget self, SBAddress base_addr, uint32_t count, char const * flavor_string) SBInstructionList
- ReadInstructions(SBTarget self, SBAddress start_addr, SBAddress end_addr, char const * flavor_string) SBInstructionList
Disassemble a specified number of instructions starting at an address.
- Parameters:
base_addr – the address to start disassembly from.
count – the number of instructions to disassemble.
flavor_string – may be ‘intel’ or ‘att’ on x86 targets to specify that style of disassembly.
- Return type:
- ReadMemory(SBTarget self, SBAddress addr, void * buf, SBError error) size_t #
Read target memory. If a target process is running then memory is read from here. Otherwise the memory is read from the object files. For a target whose bytes are sized as a multiple of host bytes, the data read back will preserve the target’s byte order.
- @param[in] addr
A target address to read from.
- @param[out] buf
The buffer to read memory into.
- @param[in] size
The maximum number of host bytes to read in the buffer passed into this call
- @param[out] error
Error information is written here if the memory read fails.
- @return
The amount of data read in host bytes.
- RemoveModule(SBTarget self, SBModule module) bool #
- ResetStatistics()#
Reset the statistics collected for this target. This includes clearing symbol table and debug info parsing/index time for all modules, breakpoint resolve time and target statistics.
- ResolveFileAddress(SBTarget self, lldb::addr_t file_addr) SBAddress #
Resolve a current file address into a section offset address.
@param[in] file_addr
- @return
An SBAddress which will be valid if…
- ResolveLoadAddress(vm_addr)#
Resolve a current load address into a section offset address.
- Parameters:
vm_addr (int, in) – A virtual address from the current process state that is to be translated into a section offset address.
- Return type:
- Returns:
An SBAddress which will be valid if vm_addr was successfully resolved into a section offset address, or an invalid SBAddress if vm_addr doesn’t resolve to a section in a module.
- ResolvePastLoadAddress(stop_id, vm_addr)#
Resolve a current load address into a section offset address using the process stop ID to identify a time in the past.
- Parameters:
stop_id (int, in) – Each time a process stops, the process stop ID integer gets incremented. These stop IDs are used to identify past times and can be used in history objects as a cheap way to store the time at which the sample was taken. Specifying UINT32_MAX will always resolve the address using the currently loaded sections.
vm_addr (int, in) – A virtual address from the current process state that is to be translated into a section offset address.
- Return type:
- Returns:
An SBAddress which will be valid if vm_addr was successfully resolved into a section offset address, or an invalid SBAddress if vm_addr doesn’t resolve to a section in a module.
- ResolveSymbolContextForAddress(SBTarget self, SBAddress addr, uint32_t resolve_scope) SBSymbolContext #
- SetCollectingStats(v)#
Sets whether we should collect statistics on lldb or not.
- Parameters:
v (boolean, in) – A boolean to control the collection.
- SetLaunchInfo(SBTarget self, SBLaunchInfo launch_info)#
- SetModuleLoadAddress(module, sections_offset)#
Slide all file addresses for all module sections so that module appears to loaded at these slide addresses.
When you need all sections within a module to be loaded at a rigid slide from the addresses found in the module object file, this function will allow you to easily and quickly slide all module sections.
- SetSectionLoadAddress(section, section_base_addr)#
Set the base load address for a module section.
- WatchAddress(SBTarget self, lldb::addr_t addr, size_t size, bool read, bool modify, SBError error) SBWatchpoint #
- WatchpointCreateByAddress(SBTarget self, lldb::addr_t addr, size_t size, SBWatchpointOptions options, SBError error) SBWatchpoint #
- breakpoint_iter()#
Returns an iterator over all breakpoints in a lldb.SBTarget object.
- get_bkpts_access_object()#
An accessor function that returns a bkpts_access() object which allows lazy bkpt access from a lldb.SBtarget object.
- get_modules_access_object()#
An accessor function that returns a modules_access() object which allows lazy module access from a lldb.SBTarget object.
- get_modules_array()#
An accessor function that returns a list() that contains all modules in a lldb.SBTarget object.
- get_target_bkpts()#
An accessor function that returns a list() that contains all bkpts in a lldb.SBtarget object.
- get_target_watchpoints()#
An accessor function that returns a list() that contains all watchpoints in a lldb.SBtarget object.
- get_watchpoints_access_object()#
An accessor function that returns a watchpoints_access() object which allows lazy watchpoint access from a lldb.SBtarget object.
- module_iter()#
Returns an iterator over all modules in a lldb.SBTarget object.
- watchpoint_iter()#
Returns an iterator over all watchpoints in a lldb.SBTarget object.