History log of /external/lldb/scripts/Python/interface/SBFunction.i
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0765e3274aab0551fea7678bee565c7d68e0b786 03-May-2013 Enrico Granata <egranata@apple.com> <rdar://problem/11742979>

SWIG is smart enough to recognize that C++ operators == and != mean __eq__ and __ne__ in Python and do the appropriate translation
But it is not smart enough to recognize that mySBObject == None should return False instead of erroring out
The %pythoncode blocks are meant to provide those extra smarts (and they play some SWIG&Python magic to find the right function to call behind the scenes with no risk of typos :-)
Lastly, SBBreakpoint provides an == but never provided a != operator - common courtesy is to provide both

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/scripts/Python/interface/SBFunction.i
7d4083837c5a258375fdc185d464b4ed15759a4b 02-Mar-2013 Jim Ingham <jingham@apple.com> Convert from the C-based LLVM Disassembler shim to the full MC Disassembler API's.
Calculate "can branch" using the MC API's rather than our hand-rolled regex'es.
As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att.

<rdar://problem/11319574>
<rdar://problem/9329275>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/scripts/Python/interface/SBFunction.i
2a94be1aa46c90d6749d8c96ed396d5ebde452cd 30-Jun-2012 Greg Clayton <gclayton@apple.com> Added documentation for many of our python properties and also made the property help show up by declaring the properties correctly. We previosly declared properties into a local "x" variable, what I didn't realize is that the help will use this as the property name for the help output.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/scripts/Python/interface/SBFunction.i
7dd5c51fbab8384b18f20ecc125f9a1bb3c9bcb2 06-Feb-2012 Greg Clayton <gclayton@apple.com> Removed all of the "#ifndef SWIG" from the SB header files since we are using
interface (.i) files for each class.

Changed the FindFunction class from:

uint32_t
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask,
bool append,
lldb::SBSymbolContextList& sc_list)

uint32_t
SBModule::FindFunctions (const char *name,
uint32_t name_type_mask,
bool append,
lldb::SBSymbolContextList& sc_list)

To:

lldb::SBSymbolContextList
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);

lldb::SBSymbolContextList
SBModule::FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);

This makes the API easier to use from python. Also added the ability to
append a SBSymbolContext or a SBSymbolContextList to a SBSymbolContextList.

Exposed properties for lldb.SBSymbolContextList in python:

lldb.SBSymbolContextList.modules => list() or all lldb.SBModule objects in the list
lldb.SBSymbolContextList.compile_units => list() or all lldb.SBCompileUnits objects in the list
lldb.SBSymbolContextList.functions => list() or all lldb.SBFunction objects in the list
lldb.SBSymbolContextList.blocks => list() or all lldb.SBBlock objects in the list
lldb.SBSymbolContextList.line_entries => list() or all lldb.SBLineEntry objects in the list
lldb.SBSymbolContextList.symbols => list() or all lldb.SBSymbol objects in the list

This allows a call to the SBTarget::FindFunctions(...) and SBModule::FindFunctions(...)
and then the result can be used to extract the desired information:

sc_list = lldb.target.FindFunctions("erase")

for function in sc_list.functions:
print function
for symbol in sc_list.symbols:
print symbol

Exposed properties for the lldb.SBSymbolContext objects in python:

lldb.SBSymbolContext.module => lldb.SBModule
lldb.SBSymbolContext.compile_unit => lldb.SBCompileUnit
lldb.SBSymbolContext.function => lldb.SBFunction
lldb.SBSymbolContext.block => lldb.SBBlock
lldb.SBSymbolContext.line_entry => lldb.SBLineEntry
lldb.SBSymbolContext.symbol => lldb.SBSymbol


Exposed properties for the lldb.SBBlock objects in python:

lldb.SBBlock.parent => lldb.SBBlock for the parent block that contains
lldb.SBBlock.sibling => lldb.SBBlock for the sibling block to the current block
lldb.SBBlock.first_child => lldb.SBBlock for the first child block to the current block
lldb.SBBlock.call_site => for inline functions, return a lldb.declaration object that gives the call site file, line and column
lldb.SBBlock.name => for inline functions this is the name of the inline function that this block represents
lldb.SBBlock.inlined_block => returns the inlined function block that contains this block (might return itself if the current block is an inlined block)
lldb.SBBlock.range[int] => access the address ranges for a block by index, a list() with start and end address is returned
lldb.SBBlock.ranges => an array or all address ranges for this block
lldb.SBBlock.num_ranges => the number of address ranges for this blcok

SBFunction objects can now get the SBType and the SBBlock that represents the
top scope of the function.

SBBlock objects can now get the variable list from the current block. The value
list returned allows varaibles to be viewed prior with no process if code
wants to check the variables in a function. There are two ways to get a variable
list from a SBBlock:

lldb::SBValueList
SBBlock::GetVariables (lldb::SBFrame& frame,
bool arguments,
bool locals,
bool statics,
lldb::DynamicValueType use_dynamic);

lldb::SBValueList
SBBlock::GetVariables (lldb::SBTarget& target,
bool arguments,
bool locals,
bool statics);

When a SBFrame is used, the values returned will be locked down to the frame
and the values will be evaluated in the context of that frame.

When a SBTarget is used, global an static variables can be viewed without a
running process.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/scripts/Python/interface/SBFunction.i
b302dffacdadeef509d28133a4c66299418122f8 01-Feb-2012 Greg Clayton <gclayton@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/scripts/Python/interface/SBFunction.i
1b925206e3c4867fea9eb55a4c6460962cf32564 29-Jan-2012 Greg Clayton <gclayton@apple.com> Added the ability to get the target triple, byte order and address byte size
from the SBTarget and SBModule interfaces. Also added many python properties
for easier access to many things from many SB objects.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/scripts/Python/interface/SBFunction.i
ba6f252fa157521791eef0ba446e281290fe7c85 19-Jul-2011 Johnny Chen <johnny.chen@apple.com> Missed the interface file for SBFunction in the previous checkin.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/scripts/Python/interface/SBFunction.i