]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] [3.12] gh-109972: Enhance test_gdb (GH-110026) (GH-110351) (#110354)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 4 Oct 2023 12:03:28 +0000 (05:03 -0700)
committerGitHub <noreply@github.com>
Wed, 4 Oct 2023 12:03:28 +0000 (12:03 +0000)
commitaa8d3db6f201470b55debfe8a301317f39268ff1
tree3a41fab12b4432b5f11575b4bb44e20d2fa0b6c3
parentd507493078ccbc9bf75d0643716cf7b355e375f0
[3.11] [3.12] gh-109972: Enhance test_gdb (GH-110026) (GH-110351) (#110354)

[3.12] gh-109972: Enhance test_gdb (GH-110026) (GH-110351)

* gh-109972: Enhance test_gdb (GH-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.

  * test_pycfunction_noargs()
  * test_pycfunction_o()
  * test_pycfunction_varargs()
  * test_pycfunction_varargs_keywords()
  * test_pycfunction_fastcall()
  * test_pycfunction_fastcall_keywords()

* 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 757cbd4f29c9e89b38b975e0463dc8ed331b2515)

* gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360)

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 44d9a71ea246e7c3fb478d9be62c16914be6c545)

* gh-110166: Fix gdb CFunctionFullTests on ppc64le clang build (GH-110331)

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 bbce8bd05dd25c6e74487940fa1977485b52baf4)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 1de9406f9136e3952b849487f0151be3c669a3ea)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/support/__init__.py
Lib/test/test_gdb/__init__.py
Lib/test/test_gdb/test_backtrace.py
Lib/test/test_gdb/test_cfunction.py
Lib/test/test_gdb/test_cfunction_full.py [new file with mode: 0644]
Lib/test/test_gdb/test_misc.py
Lib/test/test_gdb/test_pretty_print.py
Lib/test/test_gdb/util.py
Misc/NEWS.d/next/Tests/2023-09-13-05-58-09.gh-issue-104736.lA25Fu.rst [new file with mode: 0644]