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.''') + 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); + } // 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, None, doc='''A read only property that returns a lldb.declaration object that contains the inlined call site file, line and column.''')) + 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]").''') + 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.''') %} - }; +%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 Index: lldb/scripts/interface/SBBreakpoint.i =================================================================== --- lldb/scripts/interface/SBBreakpoint.i +++ lldb/scripts/interface/SBBreakpoint.i @@ -7,6 +7,8 @@ //===----------------------------------------------------------------------===// namespace lldb { +%include + %feature("docstring", "Represents a logical breakpoint and its associated settings. @@ -286,31 +288,18 @@ object.''' return self.GetNumLocations() - __swig_getmethods__["locations"] = get_breakpoint_location_list - if _newclass: locations = property(get_breakpoint_location_list, None, doc='''A read only property that returns a list() of lldb.SBBreakpointLocation objects for this breakpoint.''') - - __swig_getmethods__["location"] = get_locations_access_object - if _newclass: location = property(get_locations_access_object, None, doc='''A read only property that returns an object that can access locations by index (not location ID) (location = bkpt.location[12]).''') - - __swig_getmethods__["id"] = GetID - if _newclass: id = property(GetID, None, doc='''A read only property that returns the ID of this breakpoint.''') - - __swig_getmethods__["enabled"] = IsEnabled - __swig_setmethods__["enabled"] = SetEnabled - if _newclass: enabled = property(IsEnabled, SetEnabled, doc='''A read/write property that configures whether this breakpoint is enabled or not.''') - - __swig_getmethods__["one_shot"] = IsOneShot - __swig_setmethods__["one_shot"] = SetOneShot - if _newclass: one_shot = property(IsOneShot, SetOneShot, doc='''A read/write property that configures whether this breakpoint is one-shot (deleted when hit) or not.''') - - __swig_getmethods__["num_locations"] = GetNumLocations - if _newclass: num_locations = property(GetNumLocations, None, doc='''A read only property that returns the count of locations of this breakpoint.''') - + locations = property(get_breakpoint_location_list) + location = property(get_locations_access_object) %} }; +%attribute(lldb::SBBreakpoint, lldb::break_id_t, id, GetID); +%attribute(lldb::SBBreakpoint, bool, enabled, IsEnabled, SetEnabled); +%attribute(lldb::SBBreakpoint, bool, one_shot, IsOneShot, SetOneShot); +%attribute(lldb::SBBreakpoint, size_t, num_locations, GetNumLocations); + class SBBreakpointListImpl; class LLDB_API SBBreakpointList Index: lldb/scripts/interface/SBCompileUnit.i =================================================================== --- lldb/scripts/interface/SBCompileUnit.i +++ lldb/scripts/interface/SBCompileUnit.i @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +%include + namespace lldb { %feature("docstring", @@ -125,13 +127,10 @@ '''Return the number of line entries in a lldb.SBCompileUnit object.''' return self.GetNumLineEntries() - - __swig_getmethods__["file"] = GetFileSpec - if _newclass: file = property(GetFileSpec, None, doc='''A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.''') - - __swig_getmethods__["num_line_entries"] = GetNumLineEntries - if _newclass: num_line_entries = property(GetNumLineEntries, None, doc='''A read only property that returns the number of line entries in a compile unit as an integer.''') %} }; +%attributeref(lldb::SBCompileUnit, lldb::SBFileSpec, file, GetFileSpec); +%attribute(lldb::SBCompileUnit, uint32_t, num_line_entries, GetNumLineEntries); + } // namespace lldb Index: lldb/scripts/interface/SBData.i =================================================================== --- lldb/scripts/interface/SBData.i +++ lldb/scripts/interface/SBData.i @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +%include namespace lldb { @@ -264,78 +265,31 @@ def _read_all_double(self): return self._make_helper_double().all() - __swig_getmethods__["uint8"] = _make_helper_uint8 - if _newclass: uint8 = property(_make_helper_uint8, None, doc='''A read only property that returns an array-like object out of which you can read uint8 values.''') - - __swig_getmethods__["uint16"] = _make_helper_uint16 - if _newclass: uint16 = property(_make_helper_uint16, None, doc='''A read only property that returns an array-like object out of which you can read uint16 values.''') - - __swig_getmethods__["uint32"] = _make_helper_uint32 - if _newclass: uint32 = property(_make_helper_uint32, None, doc='''A read only property that returns an array-like object out of which you can read uint32 values.''') - - __swig_getmethods__["uint64"] = _make_helper_uint64 - if _newclass: uint64 = property(_make_helper_uint64, None, doc='''A read only property that returns an array-like object out of which you can read uint64 values.''') - - __swig_getmethods__["sint8"] = _make_helper_sint8 - if _newclass: sint8 = property(_make_helper_sint8, None, doc='''A read only property that returns an array-like object out of which you can read sint8 values.''') - - __swig_getmethods__["sint16"] = _make_helper_sint16 - if _newclass: sint16 = property(_make_helper_sint16, None, doc='''A read only property that returns an array-like object out of which you can read sint16 values.''') - - __swig_getmethods__["sint32"] = _make_helper_sint32 - if _newclass: sint32 = property(_make_helper_sint32, None, doc='''A read only property that returns an array-like object out of which you can read sint32 values.''') - - __swig_getmethods__["sint64"] = _make_helper_sint64 - if _newclass: sint64 = property(_make_helper_sint64, None, doc='''A read only property that returns an array-like object out of which you can read sint64 values.''') - - __swig_getmethods__["float"] = _make_helper_float - if _newclass: float = property(_make_helper_float, None, doc='''A read only property that returns an array-like object out of which you can read float values.''') - - __swig_getmethods__["double"] = _make_helper_double - if _newclass: double = property(_make_helper_double, None, doc='''A read only property that returns an array-like object out of which you can read double values.''') - - __swig_getmethods__["uint8s"] = _read_all_uint8 - if _newclass: uint8s = property(_read_all_uint8, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint8 values.''') - - __swig_getmethods__["uint16s"] = _read_all_uint16 - if _newclass: uint16s = property(_read_all_uint16, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint16 values.''') - - __swig_getmethods__["uint32s"] = _read_all_uint32 - if _newclass: uint32s = property(_read_all_uint32, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint32 values.''') - - __swig_getmethods__["uint64s"] = _read_all_uint64 - if _newclass: uint64s = property(_read_all_uint64, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint64 values.''') - - __swig_getmethods__["sint8s"] = _read_all_sint8 - if _newclass: sint8s = property(_read_all_sint8, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint8 values.''') - - __swig_getmethods__["sint16s"] = _read_all_sint16 - if _newclass: sint16s = property(_read_all_sint16, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint16 values.''') - - __swig_getmethods__["sint32s"] = _read_all_sint32 - if _newclass: sint32s = property(_read_all_sint32, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint32 values.''') - - __swig_getmethods__["sint64s"] = _read_all_sint64 - if _newclass: sint64s = property(_read_all_sint64, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint64 values.''') - - __swig_getmethods__["floats"] = _read_all_float - if _newclass: floats = property(_read_all_float, None, doc='''A read only property that returns an array with all the contents of this SBData represented as float values.''') - - __swig_getmethods__["doubles"] = _read_all_double - if _newclass: doubles = property(_read_all_double, None, doc='''A read only property that returns an array with all the contents of this SBData represented as double values.''') + uint8 = property(_make_helper_uint8, None, doc='''A read only property that returns an array-like object out of which you can read uint8 values.''') + uint16 = property(_make_helper_uint16, None, doc='''A read only property that returns an array-like object out of which you can read uint16 values.''') + uint32 = property(_make_helper_uint32, None, doc='''A read only property that returns an array-like object out of which you can read uint32 values.''') + uint64 = property(_make_helper_uint64, None, doc='''A read only property that returns an array-like object out of which you can read uint64 values.''') + sint8 = property(_make_helper_sint8, None, doc='''A read only property that returns an array-like object out of which you can read sint8 values.''') + sint16 = property(_make_helper_sint16, None, doc='''A read only property that returns an array-like object out of which you can read sint16 values.''') + sint32 = property(_make_helper_sint32, None, doc='''A read only property that returns an array-like object out of which you can read sint32 values.''') + sint64 = property(_make_helper_sint64, None, doc='''A read only property that returns an array-like object out of which you can read sint64 values.''') + float = property(_make_helper_float, None, doc='''A read only property that returns an array-like object out of which you can read float values.''') + double = property(_make_helper_double, None, doc='''A read only property that returns an array-like object out of which you can read double values.''') + uint8s = property(_read_all_uint8, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint8 values.''') + uint16s = property(_read_all_uint16, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint16 values.''') + uint32s = property(_read_all_uint32, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint32 values.''') + uint64s = property(_read_all_uint64, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint64 values.''') + sint8s = property(_read_all_sint8, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint8 values.''') + sint16s = property(_read_all_sint16, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint16 values.''') + sint32s = property(_read_all_sint32, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint32 values.''') + sint64s = property(_read_all_sint64, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint64 values.''') + floats = property(_read_all_float, None, doc='''A read only property that returns an array with all the contents of this SBData represented as float values.''') + doubles = property(_read_all_double, None, doc='''A read only property that returns an array with all the contents of this SBData represented as double values.''') %} - - %pythoncode %{ - __swig_getmethods__["byte_order"] = GetByteOrder - __swig_setmethods__["byte_order"] = SetByteOrder - if _newclass: byte_order = property(GetByteOrder, SetByteOrder, doc='''A read/write property getting and setting the endianness of this SBData (data.byte_order = lldb.eByteOrderLittle).''') - - __swig_getmethods__["size"] = GetByteSize - if _newclass: size = property(GetByteSize, None, doc='''A read only property that returns the size the same result as GetByteSize().''') - - %} - }; +%attribute(lldb::SBData, lldb::ByteOrder, byte_order, GetByteOrder, SetByteOrder); +%attribute(lldb::SBData, size_t, byte_order, GetByteSize); + } // namespace lldb