gdb/gdb-rhbz2232086-refactor-selftest-support.patch
Tom de Vries 4a53ebe1ed - Patch added (swo#31524, bsc#1222188):
* make-pascal_language-print_type-handle-varstring-nul.patch
- Renable gcc-fortran for SLE-11.
- Use system compiler (gcc 4.3.4) for testing all languages on
  SLE-11.
- Maintenance script qa.sh:
  * Ignore all fails for SLE-11.
- Maintenance script import-fedora.sh:
  * Use %patch -P N instead of deprecated %patchN.
  * Drop patch skips:
    * gdb-6.5-readline-long-line-crash-test.patch
    * gdb-6.7-charsign-test.patch
    * gdb-test-ivy-bridge.patch
    * gdb-ppc-power7-test.patch
    * gdb-6.3-bz140532-ppc-unwinding-test.patch
- Patches added (import from fedora rawhide @ a27201b):
  * gdb-bz2196395-debuginfod-legacy-openssl-crash.patch
  * gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch
  * gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
  * gdb-rhbz-2232086-generate-gdb-index-consistently.patch
  * gdb-rhbz-2232086-reduce-size-of-gdb-index.patch
  * gdb-rhbz2232086-refactor-selftest-support.patch
- Patches updated (import from fedora rawhide @ a27201b):
  * gdb-6.6-buildid-locate-rpm.patch
  * gdb-6.6-buildid-locate.patch
  * gdb-fedora-libncursesw.patch
  * gdb-rhbz2233961-CVE-2022-4806.patch
  * gdb-rhbz2233965-memory-leak.patch
- Patches updated:  
  * gdb-6.6-buildid-locate-rpm-suse.patch
- Patches deleted (import from fedora rawhide @ a27201b):
  * gdb-rhbz1553104-s390x-arch12-test.patch
  * gdb-lineno-makeup-test.patch
  * gdb-6.3-bz202689-exec-from-pthread-test.patch
  * gdb-6.5-bz109921-DW_AT_decl_file-test.patch
  * gdb-6.5-ia64-libunwind-leak-test.patch
  * gdb-6.5-last-address-space-byte-test.patch
  * gdb-6.5-missed-trap-on-step-test.patch
  * gdb-6.5-sharedlibrary-path.patch
  * gdb-6.7-testsuite-stable-results.patch
  * gdb-6.8-bz442765-threaded-exec-test.patch
  * gdb-ccache-workaround.patch
  * gdb-opcodes-clflushopt-test.patch
  * gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
  * gdb-rhbz1350436-type-printers-error.patch
  * gdb-rhbz2196395-debuginfod-legacy-openssl-crash.patch
  * gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
  * gdb-test-pid0-core.patch
- Patches deleted:
  * fixup-gdb-rhbz1553104-s390x-arch12-test.patch
  * fixup-2-gdb-rhbz1553104-s390x-arch12-test.patch
  * fixup-gdb-lineno-makeup-test.patch
  * fixup-gdb-6.6-buildid-locate-rpm.patch
- Remove commented out mention of dropped patch
  gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=383
2024-04-24 09:31:51 +00:00

78 lines
2.5 KiB
Diff

From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Andrew Burgess <aburgess@redhat.com>
Date: Fri, 24 Nov 2023 11:10:08 +0000
Subject: gdb-rhbz2232086-refactor-selftest-support.patch
;; Back-port upstream commit 1f0fab7ff86 as part of a fix for
;; non-deterministic gdb-index generation (RH BZ 2232086).
gdb/testsuite: small refactor in selftest-support.exp
Split out the code that makes a copy of the GDB executable ready for
self testing into a new proc. A later commit in this series wants to
load the GDB executable into GDB (for creating an on-disk debug
index), but doesn't need to make use of the full do_self_tests proc.
There should be no changes in what is tested after this commit.
Approved-By: Tom Tromey <tom@tromey.com>
diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
--- a/gdb/testsuite/lib/selftest-support.exp
+++ b/gdb/testsuite/lib/selftest-support.exp
@@ -92,11 +92,13 @@ proc selftest_setup { executable function } {
return 0
}
-# A simple way to run some self-tests.
-
-proc do_self_tests {function body} {
- global GDB tool
-
+# Prepare for running a self-test by moving the GDB executable to a
+# location where we can use it as the inferior. Return the filename
+# of the new location.
+#
+# If the current testing setup is not suitable for running a
+# self-test, then return an empty string.
+proc selftest_prepare {} {
# Are we testing with a remote board? In that case, the target
# won't have access to the GDB's auxilliary data files
# (data-directory, etc.). It's simpler to just skip.
@@ -120,19 +122,31 @@ proc do_self_tests {function body} {
# Run the test with self. Copy the file executable file in case
# this OS doesn't like to edit its own text space.
- set GDB_FULLPATH [find_gdb $GDB]
+ set gdb_fullpath [find_gdb $::GDB]
if {[is_remote host]} {
- set xgdb x$tool
+ set xgdb x$::tool
} else {
- set xgdb [standard_output_file x$tool]
+ set xgdb [standard_output_file x$::tool]
}
# Remove any old copy lying around.
remote_file host delete $xgdb
+ set filename [remote_download host $gdb_fullpath $xgdb]
+
+ return $filename
+}
+
+# A simple way to run some self-tests.
+
+proc do_self_tests {function body} {
+ set file [selftest_prepare]
+ if { $file eq "" } {
+ return
+ }
+
gdb_start
- set file [remote_download host $GDB_FULLPATH $xgdb]
# When debugging GDB with GDB, some operations can take a relatively long
# time, especially if the build is non-optimized. Bump the timeout for the