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 @@ id(42)
breakpoint='time_gmtime', breakpoint='time_gmtime',
cmds_after_breakpoint=['py-bt-full'], 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(), @unittest.skipIf(python_is_optimized(),
"Python was compiled with optimizations") "Python was compiled with optimizations")

View File

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