[3.11] [3.12] gh-109972: Enhance test_gdb (GH-110026) (GH-110351) #110354
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
test_gdb failed with 15 min timeout on PPC64LE RHEL8 3.x (LTO + pydebug) #109972: Enhance test_gdb (gh-109972: Enhance test_gdb #110026)
Split test_pycfunction.py: add test_cfunction_full.py.
Split the function into the following 6 functions. 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 instead of "replace".
Add check_gdb() function to util.py.
Enhance support.check_cflags_pgo(): check also for sysconfig
PGO_PROF_USE_FLAG (if available) in compiler flags.
Move some SkipTest checks to test_gdb/init.py.
Elaborate why gdb cannot be tested on Windows: gdb doesn't support
PDB debug symbol files.
(cherry picked from commit 757cbd4)
Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex:
Fedora 38). Search patterns in gdb "bt" command output to detect
when gdb fails to retrieve the traceback. For example, skip a test if
"Backtrace stopped: frame did not save the PC" is found.
(cherry picked from commit 44d9a71)
CFunctionFullTests now also runs "bt" command before "py-bt-full",
similar to CFunctionTests which also runs "bt" command before
"py-bt". So test_gdb can skip the test if patterns like "?? ()" are
found in the gdb output.
(cherry picked from commit bbce8bd)
Co-authored-by: Victor Stinner vstinner@python.org
(cherry picked from commit 1de9406)