diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2022-04-07 19:31:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 19:31:01 (GMT) |
commit | ef6a482b0285870c45f39c9b17ed827362b334ae (patch) | |
tree | a32a27a4d209b974d9f4d92e7e997dc3ff771409 /Tools | |
parent | 87eec70d97b250f820325b4f1b4f781b443b5180 (diff) | |
download | cpython-ef6a482b0285870c45f39c9b17ed827362b334ae.zip cpython-ef6a482b0285870c45f39c9b17ed827362b334ae.tar.gz cpython-ef6a482b0285870c45f39c9b17ed827362b334ae.tar.bz2 |
bpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208)
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/gdb/libpython.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 00cdcca..4f7a8bc 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -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) |