teak-llvm/lldb/scripts/Python/interface
Greg Clayton 6b2bd93918 Added many more python convenience accessors:
You can now access a frame in a thread using:

lldb.SBThread.frame[int] -> lldb.SBFrame object for a frame in a thread

Where "int" is an integer index. You can also access a list object with all of
the frames using:

lldb.SBThread.frames => list() of lldb.SBFrame objects

All SB objects that give out SBAddress objects have properties named "addr"

lldb.SBInstructionList now has the following convenience accessors for len() and
instruction access using an index:

insts = lldb.frame.function.instructions
for idx in range(len(insts)):
    print insts[idx]
    
Instruction lists can also lookup an isntruction using a lldb.SBAddress as the key:

pc_inst = lldb.frame.function.instructions[lldb.frame.addr]

lldb.SBProcess now exposes:

lldb.SBProcess.is_alive => BOOL Check if a process is exists and is alive
lldb.SBProcess.is_running => BOOL check if a process is running (or stepping):
lldb.SBProcess.is_running => BOOL check if a process is currently stopped or crashed:
lldb.SBProcess.thread[int] => lldb.SBThreads for a given "int" zero based index
lldb.SBProcess.threads => list() containing all lldb.SBThread objects in a process

SBInstruction now exposes:
lldb.SBInstruction.mnemonic => python string for instruction mnemonic
lldb.SBInstruction.operands => python string for instruction operands
lldb.SBInstruction.command => python string for instruction comment

SBModule now exposes:

lldb.SBModule.uuid => uuid.UUID(), an UUID object from the "uuid" python module
lldb.SBModule.symbol[int] => lldb.Symbol, lookup symbol by zero based index
lldb.SBModule.symbol[str] => list() of lldb.Symbol objects that match "str"
lldb.SBModule.symbol[re] => list() of lldb.Symbol objecxts that match the regex
lldb.SBModule.symbols => list() of all symbols in a module

  
SBAddress objects can now access the current load address with the "lldb.SBAddress.load_addr"
property. The current "lldb.target" will be used to try and resolve the load address.

Load addresses can also be set using this accessor:

addr = lldb.SBAddress()
addd.load_addr = 0x123023

Then you can check the section and offset to see if the address got resolved.

SBTarget now exposes:

lldb.SBTarget.module[int] => lldb.SBModule from zero based module index
lldb.SBTarget.module[str] => lldb.SBModule by basename or fullpath or uuid string
lldb.SBTarget.module[uuid.UUID()] => lldb.SBModule whose UUID matches
lldb.SBTarget.module[re] => list() of lldb.SBModule objects that match the regex
lldb.SBTarget.modules => list() of all lldb.SBModule objects in the target

SBSymbol now exposes:

lldb.SBSymbol.name => python string for demangled symbol name
lldb.SBSymbol.mangled => python string for mangled symbol name or None if there is none
lldb.SBSymbol.type => lldb.eSymbolType enum value
lldb.SBSymbol.addr => SBAddress object that represents the start address for this symbol (if there is one)
lldb.SBSymbol.end_addr => SBAddress for the end address of the symbol  (if there is one)
lldb.SBSymbol.prologue_size => pythin int containing The size of the prologue in bytes
lldb.SBSymbol.instructions => SBInstructionList containing all instructions for this symbol

SBFunction now also has these new properties in addition to what is already has:
lldb.SBFunction.addr => SBAddress object that represents the start address for this function
lldb.SBFunction.end_addr => SBAddress for the end address of the function
lldb.SBFunction.instructions => SBInstructionList containing all instructions for this function

SBFrame now exposes the SBAddress for the frame:
lldb.SBFrame.addr => SBAddress which is the section offset address for the current frame PC

These are all in addition to what was already added. Documentation and website
updates coming soon.

llvm-svn: 149489
2012-02-01 08:09:32 +00:00
..
SBAddress.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBBlock.i Added more functionality to the public API to allow for better 2011-09-26 07:11:27 +00:00
SBBreakpoint.i Add docstrings for SetCondition() and GetCondition() APIs. 2011-10-18 19:13:06 +00:00
SBBreakpointLocation.i Add docstrings for SetCondition() and GetCondition() APIs. 2011-10-18 19:13:06 +00:00
SBBroadcaster.i Add docstring for SBBroadcaster class. 2011-07-20 22:29:58 +00:00
SBCommandInterpreter.i <rdar://problem/10750012> 2012-01-27 00:13:27 +00:00
SBCommandReturnObject.i Changes to Python commands: 2011-08-16 23:24:13 +00:00
SBCommunication.i Move the rest of the SB headers to interface files. 2011-07-19 22:41:47 +00:00
SBCompileUnit.i Added the ability to get the target triple, byte order and address byte size 2012-01-29 06:07:39 +00:00
SBData.i Added the ability to get the target triple, byte order and address byte size 2012-01-29 06:07:39 +00:00
SBDebugger.i <rdar://problem/10584789> 2011-12-15 04:38:41 +00:00
SBError.i Added the ability to get the target triple, byte order and address byte size 2012-01-29 06:07:39 +00:00
SBEvent.i Add SWIG Python interface files for SBDebugger, SBCompileUnit, and SBEvent. 2011-07-18 22:11:53 +00:00
SBFileSpec.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBFileSpecList.i Added the ability to restrict breakpoints by function name, function regexp, selector 2011-09-23 00:54:11 +00:00
SBFrame.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBFunction.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBHostOS.i Move the rest of the SB headers to interface files. 2011-07-19 22:41:47 +00:00
SBInputReader.i Move the rest of the SB headers to interface files. 2011-07-19 22:41:47 +00:00
SBInstruction.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBInstructionList.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBLineEntry.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBListener.i Add SWIG Python interface files for SBLineEntry, SBListener, and SBModule. 2011-07-18 23:11:07 +00:00
SBModule.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBProcess.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBSection.i Added the ability to get the target triple, byte order and address byte size 2012-01-29 06:07:39 +00:00
SBSourceManager.i Add some docstrings for SBSourceManager class. 2011-07-19 23:35:10 +00:00
SBStream.i Add some docstrings for SBStream class. 2011-07-19 23:24:36 +00:00
SBStringList.i Move the rest of the SB headers to interface files. 2011-07-19 22:41:47 +00:00
SBSymbol.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBSymbolContext.i Cleaned up the the code that figures out the inlined stack frames given a 2011-10-01 00:45:15 +00:00
SBSymbolContextList.i Add SWIG interface files for SBSymbol, SBSymbolContext, and SBSymbolContextList. 2011-07-19 01:07:06 +00:00
SBTarget.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBThread.i Added many more python convenience accessors: 2012-02-01 08:09:32 +00:00
SBType.i Added fuzz testing for when we call API calls with an invalid object. 2012-01-31 23:19:33 +00:00
SBValue.i Added the ability to get the target triple, byte order and address byte size 2012-01-29 06:07:39 +00:00
SBValueList.i Add needed Clear methods. 2011-12-19 20:39:44 +00:00
SBWatchpoint.i Fix typo in the docstring. 2011-10-26 00:44:40 +00:00