You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lldb/bindings/interface/SBAddress.i
+16-9Lines changed: 16 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -144,27 +144,34 @@ public:
144
144
145
145
#ifdef SWIGPYTHON
146
146
%pythoncode %{
147
+
__runtime_error_str = 'This resolves the 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). For things like Python based commands and breakpoint callbacks use GetLoadAddress instead.'
148
+
147
149
def __get_load_addr_property__ (self):
148
-
'''Get the load address for a lldb.SBAddress using the current target.'''
150
+
'''Get the load address for a lldb.SBAddress using the current target. This resolves the 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). For things like Python based commands and breakpoint callbacks use GetLoadAddress instead.'''
151
+
ifnot target:
152
+
raise RuntimeError(self.__runtime_error_str)
149
153
return self.GetLoadAddress (target)
150
154
151
155
def __set_load_addr_property__ (self, load_addr):
152
-
'''Set the load address for a lldb.SBAddress using the current target.'''
156
+
'''Set the load address for a lldb.SBAddress using the current target. This resolves the 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). For things like Python based commands and breakpoint callbacks use GetLoadAddress instead.'''
157
+
ifnot target:
158
+
raise RuntimeError(self.__runtime_error_str)
153
159
return self.SetLoadAddress (load_addr, target)
154
160
155
161
def __int__(self):
156
-
'''Convert an address to a load address if there is a process and that process is alive, or to a file address otherwise.'''
157
-
if process and process.is_alive:
162
+
'''Convert an address to a load address if there is a process and that process is alive, or to a file address otherwise. This resolves the 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). For things like Python based commands and breakpoint callbacks use GetLoadAddress instead.'''
163
+
ifnot process ornot target:
164
+
raise RuntimeError(self.__runtime_error_str)
165
+
if process.is_alive:
158
166
return self.GetLoadAddress (target)
159
-
else:
160
-
return self.GetFileAddress ()
167
+
return self.GetFileAddress ()
161
168
162
169
def __oct__(self):
163
-
'''Convert the address to an octal string'''
170
+
'''Convert the address to an octal string. This resolves the 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). For things like Python based commands and breakpoint callbacks use GetLoadAddress instead.'''
164
171
return'%o' % int(self)
165
172
166
173
def __hex__(self):
167
-
'''Convert the address to an hex string'''
174
+
'''Convert the address to an hex string. This resolves the 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). For things like Python based commands and breakpoint callbacks use GetLoadAddress instead.'''
168
175
return'0x%x' % int(self)
169
176
170
177
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.''')
@@ -176,7 +183,7 @@ public:
176
183
offset = property(GetOffset, None, doc='''A read only property that returns the section offset in bytes as an integer.''')
177
184
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.''')
178
185
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.''')
179
-
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.''')
186
+
load_addr = property(__get_load_addr_property__, __set_load_addr_property__, doc='''A read/write property that gets/sets the SBAddress using load address. This resolves the 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). For things like Python based commands and breakpoint callbacks use GetLoadAddress instead.''')
# CHECK: RuntimeError: This resolves the 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). For things like Python based commands and breakpoint callbacks use GetLoadAddress instead.
0 commit comments