bpo-36974: Fix GDB integration (GH-13665)

As it changes the way functions are called, the PEP 590 implementation
skipped the functions that the GDB integration is looking for
(by name) to find function calls.

Looking for the new helper `cfunction_call_varargs` hopefully fixes the
tests, and thus buildbots.

The changed frame nuber in test_gdb is due to there being fewer
C calls when calling a built-in method.
This commit is contained in:
Petr Viktorin 2019-05-29 22:45:41 +02:00 committed by GitHub
parent e70bfa95e6
commit fecb75c1bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -887,7 +887,7 @@ def test_pycfunction(self):
breakpoint='time_gmtime',
cmds_after_breakpoint=['py-bt-full'],
)
self.assertIn('#2 <built-in method gmtime', gdb_output)
self.assertIn('#1 <built-in method gmtime', gdb_output)
@unittest.skipIf(python_is_optimized(),
"Python was compiled with optimizations")

View file

@ -1564,7 +1564,8 @@ def is_other_python_frame(self):
return False
if caller in ('_PyCFunction_FastCallDict',
'_PyCFunction_FastCallKeywords'):
'_PyCFunction_FastCallKeywords',
'cfunction_call_varargs'):
arg_name = 'func'
# Within that frame:
# "func" is the local containing the PyObject* of the