mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-100987: Allow objects other than code objects as the "executable" of an internal frame. (GH-105727)
* Add table describing possible executable classes for out-of-process debuggers. * Remove shim code object creation code as it is no longer needed. * Make lltrace a bit more robust w.r.t. non-standard frames.
This commit is contained in:
parent
ad56340b66
commit
7199584ac8
28 changed files with 541 additions and 606 deletions
|
@ -1009,14 +1009,18 @@ class PyFramePtr:
|
|||
self._gdbval = gdbval
|
||||
|
||||
if not self.is_optimized_out():
|
||||
self.co = self._f_code()
|
||||
self.co_name = self.co.pyop_field('co_name')
|
||||
self.co_filename = self.co.pyop_field('co_filename')
|
||||
try:
|
||||
self.co = self._f_code()
|
||||
self.co_name = self.co.pyop_field('co_name')
|
||||
self.co_filename = self.co.pyop_field('co_filename')
|
||||
|
||||
self.f_lasti = self._f_lasti()
|
||||
self.co_nlocals = int_from_int(self.co.field('co_nlocals'))
|
||||
pnames = self.co.field('co_localsplusnames')
|
||||
self.co_localsplusnames = PyTupleObjectPtr.from_pyobject_ptr(pnames)
|
||||
self.f_lasti = self._f_lasti()
|
||||
self.co_nlocals = int_from_int(self.co.field('co_nlocals'))
|
||||
pnames = self.co.field('co_localsplusnames')
|
||||
self.co_localsplusnames = PyTupleObjectPtr.from_pyobject_ptr(pnames)
|
||||
self._is_code = True
|
||||
except:
|
||||
self._is_code = False
|
||||
|
||||
def is_optimized_out(self):
|
||||
return self._gdbval.is_optimized_out
|
||||
|
@ -1051,7 +1055,10 @@ class PyFramePtr:
|
|||
return self._f_special("f_builtins")
|
||||
|
||||
def _f_code(self):
|
||||
return self._f_special("f_code", PyCodeObjectPtr.from_pyobject_ptr)
|
||||
return self._f_special("f_executable", PyCodeObjectPtr.from_pyobject_ptr)
|
||||
|
||||
def _f_executable(self):
|
||||
return self._f_special("f_executable")
|
||||
|
||||
def _f_nlocalsplus(self):
|
||||
return self._f_special("nlocalsplus", int_from_int)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue