Index: lldb/scripts/interface/SBAddress.i =================================================================== --- lldb/scripts/interface/SBAddress.i +++ lldb/scripts/interface/SBAddress.i @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +%include + namespace lldb { %feature("docstring", @@ -162,39 +164,20 @@ '''Convert the address to an hex string''' return '0x%x' % int(self) - __swig_getmethods__["module"] = GetModule - if _newclass: module = property(GetModule, None, doc='''A read only property that returns an lldb object that represents the module (lldb.SBModule) that this address resides within.''') - - __swig_getmethods__["compile_unit"] = GetCompileUnit - if _newclass: compile_unit = property(GetCompileUnit, None, doc='''A read only property that returns an lldb object that represents the compile unit (lldb.SBCompileUnit) that this address resides within.''') - - __swig_getmethods__["line_entry"] = GetLineEntry - if _newclass: line_entry = property(GetLineEntry, None, doc='''A read only property that returns an lldb object that represents the line entry (lldb.SBLineEntry) that this address resides within.''') - - __swig_getmethods__["function"] = GetFunction - if _newclass: function = property(GetFunction, None, doc='''A read only property that returns an lldb object that represents the function (lldb.SBFunction) that this address resides within.''') - - __swig_getmethods__["block"] = GetBlock - if _newclass: block = property(GetBlock, None, doc='''A read only property that returns an lldb object that represents the block (lldb.SBBlock) that this address resides within.''') - - __swig_getmethods__["symbol"] = GetSymbol - if _newclass: symbol = property(GetSymbol, None, doc='''A read only property that returns an lldb object that represents the symbol (lldb.SBSymbol) that this address resides within.''') - - __swig_getmethods__["offset"] = GetOffset - if _newclass: offset = property(GetOffset, None, doc='''A read only property that returns the section offset in bytes as an integer.''') - - __swig_getmethods__["section"] = GetSection - if _newclass: section = property(GetSection, None, doc='''A read only property that returns an lldb object that represents the section (lldb.SBSection) that this address resides within.''') - - __swig_getmethods__["file_addr"] = GetFileAddress - if _newclass: file_addr = property(GetFileAddress, None, doc='''A read only property that returns file address for the section as an integer. This is the address that represents the address as it is found in the object file that defines it.''') - - __swig_getmethods__["load_addr"] = __get_load_addr_property__ - __swig_setmethods__["load_addr"] = __set_load_addr_property__ - if _newclass: load_addr = property(__get_load_addr_property__, __set_load_addr_property__, doc='''A read/write property that gets/sets the SBAddress using load address. The setter resolves SBAddress using the SBTarget from lldb.target so this property can ONLY be used in the interactive script interpreter (i.e. under the lldb script command) and not in Python based commands, or breakpoint commands.''') %} }; +%attributeref(lldb::SBAddress, lldb::SBModule, module, GetModule); +%attributeref(lldb::SBAddress, lldb::SBCompileUnit, compile_unit, GetCompileUnit); +%attributeref(lldb::SBAddress, lldb::SBLineEntry, line_entry, GetLineEntry); +%attributeref(lldb::SBAddress, lldb::SBFunction, function, GetFunction); +%attributeref(lldb::SBAddress, lldb::SBBlock, block, GetBlock); +%attributeref(lldb::SBAddress, lldb::SBSymbol, symbol, GetSymbol); +%attributeref(lldb::SBAddress, lldb::SBSection, section, GetSection); +%attribute(lldb::SBAddress, lldb::addr_t, symbol, GetOffset); +%attribute(lldb::SBAddress, lldb::addr_t, file_addr, GetFileAddress); +%attribute(lldb::SBAddress, lldb::addr_t, load_addr, GetLoadAddress, SetLoadAddress); + } // namespace lldb Index: lldb/scripts/interface/SBBlock.i =================================================================== --- lldb/scripts/interface/SBBlock.i +++ lldb/scripts/interface/SBBlock.i @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +%include + namespace lldb { %feature("docstring", @@ -143,34 +145,17 @@ def get_call_site(self): return declaration(self.GetInlinedCallSiteFile(), self.GetInlinedCallSiteLine(), self.GetInlinedCallSiteColumn()) - __swig_getmethods__["parent"] = GetParent - if _newclass: parent = property(GetParent, None, doc='''A read only property that returns the same result as GetParent().''') - - __swig_getmethods__["first_child"] = GetFirstChild - if _newclass: first_child = property(GetFirstChild, None, doc='''A read only property that returns the same result as GetFirstChild().''') - - __swig_getmethods__["call_site"] = get_call_site - if _newclass: call_site = property(get_call_site, None, doc='''A read only property that returns a lldb.declaration object that contains the inlined call site file, line and column.''') - - __swig_getmethods__["sibling"] = GetSibling - if _newclass: sibling = property(GetSibling, None, doc='''A read only property that returns the same result as GetSibling().''') - - __swig_getmethods__["name"] = GetInlinedName - if _newclass: name = property(GetInlinedName, None, doc='''A read only property that returns the same result as GetInlinedName().''') - - __swig_getmethods__["inlined_block"] = GetContainingInlinedBlock - if _newclass: inlined_block = property(GetContainingInlinedBlock, None, doc='''A read only property that returns the same result as GetContainingInlinedBlock().''') - - __swig_getmethods__["range"] = get_ranges_access_object - if _newclass: range = property(get_ranges_access_object, None, doc='''A read only property that allows item access to the address ranges for a block by integer (range = block.range[0]) and by lldb.SBAdddress (find the range that contains the specified lldb.SBAddress like "pc_range = lldb.frame.block.range[frame.addr]").''') - - __swig_getmethods__["ranges"] = get_ranges_array - if _newclass: ranges = property(get_ranges_array, None, doc='''A read only property that returns a list() object that contains all of the address ranges for the block.''') - - __swig_getmethods__["num_ranges"] = GetNumRanges - if _newclass: num_ranges = property(GetNumRanges, None, doc='''A read only property that returns the same result as GetNumRanges().''') + call_site = property(get_call_site) + range = property(get_ranges_access_object) + ranges = property(get_ranges_array) %} - }; +%attributeref(lldb::SBBlock, lldb::SBBlock, parent, GetParent); +%attributeref(lldb::SBBlock, lldb::SBBlock, first_child, GetFirstChild); +%attributeref(lldb::SBBlock, lldb::SBBlock, sibling, GetSibling); +%attributeref(lldb::SBBlock, lldb::SBBlock, inlined_block, GetContainingInlinedBlock); +%attribute(lldb::SBBlock, const char*, name, GetInlinedName); +%attribute(lldb::SBBlock, uint32_t, num_ranges, GetNumRanges); + } // namespace lldb