forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Split PyBtTests.test_pycfunction() into 2 files, test_cfunction and test_cfunction_full, and 6 functions: * test_pycfunction_noargs() * test_pycfunction_o() * test_pycfunction_varargs() * test_pycfunction_varargs_keywords() * test_pycfunction_fastcall() * test_pycfunction_fastcall_keywords() * In verbose mode, these "pycfunction" tests now log each tested call. * Move get_gdb_repr() to PrettyPrintTests. * Replace DebuggerTests.get_sample_script() with SAMPLE_SCRIPT. * Rename checkout_hook_path to CHECKOUT_HOOK_PATH. * Rename gdb_version to GDB_VERSION_TEXT. * Replace (gdb_major_version, gdb_minor_version) with GDB_VERSION. * run_gdb() uses "backslashreplace" error handler. * Add check_gdb() function to util.py.
- Loading branch information
Showing
7 changed files
with
285 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Similar to test_cfunction but test "py-bt-full" command. | ||
""" | ||
|
||
import re | ||
|
||
from .util import setup_module | ||
from .test_cfunction import CFunctionTests | ||
|
||
|
||
def setUpModule(): | ||
setup_module() | ||
|
||
|
||
class CFunctionFullTests(CFunctionTests): | ||
def check(self, func_name, cmd): | ||
# Verify with "py-bt-full": | ||
gdb_output = self.get_stack_trace( | ||
cmd, | ||
breakpoint=func_name, | ||
cmds_after_breakpoint=['py-bt-full'], | ||
# bpo-45207: Ignore 'Function "meth_varargs" not | ||
# defined.' message in stderr. | ||
ignore_stderr=True, | ||
) | ||
|
||
# bpo-46600: If the compiler inlines _null_to_none() in | ||
# meth_varargs() (ex: clang -Og), _null_to_none() is the | ||
# frame #1. Otherwise, meth_varargs() is the frame #1. | ||
regex = r'#(1|2)' | ||
regex += re.escape(f' <built-in method {func_name}') | ||
self.assertRegex(gdb_output, regex) | ||
|
||
|
||
# Delete the test case, otherwise it's executed twice | ||
del CFunctionTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.