summaryrefslogtreecommitdiffstats
path: root/Tools/gdb/libpython.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-08-25 12:44:20 (GMT)
committerGitHub <noreply@github.com>2021-08-25 12:44:20 (GMT)
commitf9242d50b18572ef0d584a1c815ed08d1a38e4f4 (patch)
tree0c7c137c701b1dd69f89227dee85aaee95ff5dfb /Tools/gdb/libpython.py
parent214c2e5d916d3ce5e7b1db800210b93001850bbb (diff)
downloadcpython-f9242d50b18572ef0d584a1c815ed08d1a38e4f4.zip
cpython-f9242d50b18572ef0d584a1c815ed08d1a38e4f4.tar.gz
cpython-f9242d50b18572ef0d584a1c815ed08d1a38e4f4.tar.bz2
bpo-44990: Change layout of evaluation frames. "Layout B" (GH-27933)
Places the locals between the specials and stack. This is the more "natural" layout for a C struct, makes the code simpler and gives a slight speedup (~1%)
Diffstat (limited to 'Tools/gdb/libpython.py')
-rwxr-xr-xTools/gdb/libpython.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 8b09563..c11b23e 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -958,9 +958,11 @@ class PyFramePtr:
if self.is_optimized_out():
return
+
obj_ptr_ptr = gdb.lookup_type("PyObject").pointer().pointer()
- base = self._gdbval.cast(obj_ptr_ptr)
- localsplus = base - self._f_nlocalsplus()
+
+ localsplus = self._gdbval["localsplus"].cast(obj_ptr_ptr)
+
for i in safe_range(self.co_nlocals):
pyop_value = PyObjectPtr.from_pyobject_ptr(localsplus[i])
if pyop_value.is_null():