mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
bpo-47177: Replace f_lasti
with prev_instr
(GH-32208)
This commit is contained in:
parent
87eec70d97
commit
ef6a482b02
10 changed files with 90 additions and 75 deletions
|
@ -1015,7 +1015,10 @@ class PyFramePtr:
|
|||
return self._f_special("nlocalsplus", int_from_int)
|
||||
|
||||
def _f_lasti(self):
|
||||
return self._f_special("f_lasti", int_from_int)
|
||||
codeunit_p = gdb.lookup_type("_Py_CODEUNIT").pointer()
|
||||
prev_instr = self._gdbval["prev_instr"]
|
||||
first_instr = self._f_code().field("co_code_adaptive").cast(codeunit_p)
|
||||
return int(prev_instr - first_instr)
|
||||
|
||||
def is_entry(self):
|
||||
return self._f_special("is_entry", bool)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue