From f9242d50b18572ef0d584a1c815ed08d1a38e4f4 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Wed, 25 Aug 2021 13:44:20 +0100 Subject: 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%) --- Tools/gdb/libpython.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Tools/gdb/libpython.py') diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 8b09563c18..c11b23e74b 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(): -- cgit v1.2.1