Rebase RHEL9 GDB to 16.3
Resolves: RHEL-91381 Resolves: RHEL-50069
This commit is contained in:
parent
10ce6088bd
commit
020e733491
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@
|
||||
/v2.0.4.tar.gz
|
||||
/gdb-14.2.tar.xz
|
||||
/v2.0.5.tar.gz
|
||||
/gdb-16.3.tar.xz
|
||||
|
@ -1,153 +1,43 @@
|
||||
# Check distro name is included in the version output.
|
||||
Patch001: gdb-6.3-rh-testversion-20041202.patch
|
||||
|
||||
# Add a wrapper script to GDB that implements pstack using the
|
||||
# --readnever option.
|
||||
#=push
|
||||
Patch002: gdb-6.3-gstack-20050411.patch
|
||||
|
||||
# Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
|
||||
#=push+jan: It should be replaced by Infinity project.
|
||||
Patch003: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
|
||||
# Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
|
||||
#=fedoratest
|
||||
Patch004: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
|
||||
# Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
|
||||
#=fedoratest
|
||||
Patch005: gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
|
||||
# Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
|
||||
#=fedoratest
|
||||
Patch006: gdb-6.6-testsuite-timeouts.patch
|
||||
Patch002: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
|
||||
# Support for stepping over PPC atomic instruction sequences (BZ 237572).
|
||||
#=fedoratest
|
||||
Patch007: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
|
||||
# Test kernel VDSO decoding while attaching to an i386 process.
|
||||
#=fedoratest
|
||||
Patch008: gdb-6.3-attach-see-vdso-test.patch
|
||||
|
||||
# Test leftover zombie process (BZ 243845).
|
||||
#=fedoratest
|
||||
Patch009: gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
|
||||
# New locating of the matching binaries from the pure core file (build-id).
|
||||
#=push+jan
|
||||
Patch010: gdb-6.6-buildid-locate.patch
|
||||
|
||||
# Fix loading of core files without build-ids but with build-ids in executables.
|
||||
# Load strictly build-id-checked core files only if no executable is specified
|
||||
# (Jan Kratochvil, RH BZ 1339862).
|
||||
#=push+jan
|
||||
Patch011: gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
|
||||
#=push+jan
|
||||
Patch012: gdb-6.6-buildid-locate-rpm.patch
|
||||
|
||||
# Test PPC hiding of call-volatile parameter register.
|
||||
#=fedoratest
|
||||
Patch013: gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
Patch003: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
|
||||
# Test gcore memory and time requirements for large inferiors.
|
||||
#=fedoratest
|
||||
Patch014: gdb-6.5-gcore-buffer-limit-test.patch
|
||||
Patch004: gdb-6.5-gcore-buffer-limit-test.patch
|
||||
|
||||
# Test GCORE for shmid 0 shared memory mappings.
|
||||
#=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible.
|
||||
Patch015: gdb-6.3-mapping-zero-inode-test.patch
|
||||
|
||||
# Test a crash on libraries missing the .text section.
|
||||
#=fedoratest
|
||||
Patch016: gdb-6.5-section-num-fixup-test.patch
|
||||
Patch005: gdb-6.3-mapping-zero-inode-test.patch
|
||||
|
||||
# Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
|
||||
#=fedoratest
|
||||
Patch017: gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
|
||||
# New test for step-resume breakpoint placed in multiple threads at once.
|
||||
#=fedoratest
|
||||
Patch018: gdb-simultaneous-step-resume-breakpoint-test.patch
|
||||
|
||||
# Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
||||
# Fix regression of undisplayed missing shared libraries caused by a fix for.
|
||||
#=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*>
|
||||
Patch019: gdb-core-open-vdso-warning.patch
|
||||
Patch006: gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
|
||||
# Fix follow-exec for C++ programs (bugreported by Martin Stransky).
|
||||
#=fedoratest
|
||||
Patch020: gdb-archer-next-over-throw-cxx-exec.patch
|
||||
|
||||
# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
|
||||
#=push+jan
|
||||
Patch021: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
|
||||
# [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604).
|
||||
#=fedoratest
|
||||
Patch022: gdb-test-bt-cfi-without-die.patch
|
||||
|
||||
# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
|
||||
#=fedoratest
|
||||
Patch023: gdb-bz634108-solib_address.patch
|
||||
|
||||
# [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp.
|
||||
#=fedoratest
|
||||
Patch024: gdb-test-dw2-aranges.patch
|
||||
|
||||
# Workaround PR libc/14166 for inferior calls of strstr.
|
||||
#=fedoratest: Compatibility with RHELs (unchecked which ones).
|
||||
Patch025: gdb-glibc-strstr-workaround.patch
|
||||
Patch007: gdb-archer-next-over-throw-cxx-exec.patch
|
||||
|
||||
# Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343).
|
||||
#=fedoratest
|
||||
Patch026: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
|
||||
|
||||
# Import regression test for `gdb/findvar.c:417: internal-error:
|
||||
# read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5.
|
||||
#=fedoratest
|
||||
Patch027: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
|
||||
|
||||
# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
|
||||
#=fedoratest
|
||||
Patch028: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
|
||||
|
||||
# Fix 'gdb gives highly misleading error when debuginfo pkg is present,
|
||||
# but not corresponding binary pkg' (RH BZ 981154).
|
||||
#=push+jan
|
||||
Patch029: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
|
||||
|
||||
# Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to
|
||||
# crash.' (RH BZ 1156192).
|
||||
#=fedoratest
|
||||
Patch030: gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
Patch008: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
|
||||
|
||||
# Fix '`catch syscall' doesn't work for parent after `fork' is called'
|
||||
# (Philippe Waroquiers, RH BZ 1149205).
|
||||
#=fedoratest
|
||||
Patch031: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
Patch009: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
|
||||
# Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan
|
||||
# Kratochvil, RH BZ 1084404).
|
||||
#=fedoratest
|
||||
Patch032: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
|
||||
|
||||
# Force libncursesw over libncurses to match the includes (RH BZ 1270534).
|
||||
#=push+jan
|
||||
Patch033: gdb-fedora-libncursesw.patch
|
||||
|
||||
# [aarch64] Fix hardware watchpoints (RH BZ 1261564).
|
||||
#=fedoratest
|
||||
Patch034: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
|
||||
|
||||
# Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
|
||||
#=fedora
|
||||
Patch035: gdb-container-rh-pkg.patch
|
||||
|
||||
# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
|
||||
#=fedora
|
||||
Patch036: gdb-linux_perf-bundle.patch
|
||||
Patch010: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
|
||||
|
||||
# Update gdb-add-index.sh such that, when the GDB environment
|
||||
# variable is not set, the script is smarter than just looking for
|
||||
@ -161,121 +51,13 @@ Patch036: gdb-linux_perf-bundle.patch
|
||||
# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
|
||||
#
|
||||
#=fedora
|
||||
Patch037: gdb-add-index.patch
|
||||
Patch011: gdb-add-index.patch
|
||||
|
||||
# Back-port upstream commit 1f0fab7ff86 as part of a fix for
|
||||
# non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
Patch038: gdb-rhbz2232086-refactor-selftest-support.patch
|
||||
# Not a backport. Add a new script which hooks into GDB and suggests
|
||||
# RPMs to install when GDB finds an objfile with no debug info.
|
||||
Patch012: gdb-add-rpm-suggestion-script.patch
|
||||
|
||||
# Back-port upstream commit aa19bc1d259 as part of a fix for
|
||||
# non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
Patch039: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch
|
||||
|
||||
# Back-port upstream commit acc117b57f7 as part of a fix for
|
||||
# non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
Patch040: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch
|
||||
|
||||
# Back-port upstream commit aff250145af as part of a fix for
|
||||
# non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
Patch041: gdb-rhbz-2232086-generate-gdb-index-consistently.patch
|
||||
|
||||
# Back-port upstream commit 3644f41dc80 as part of a fix for
|
||||
# non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
Patch042: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
|
||||
|
||||
|
||||
Patch043: gdb-rhbz2250652-gdbpy_gil.patch
|
||||
|
||||
|
||||
Patch044: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch
|
||||
|
||||
|
||||
Patch045: gdb-ftbs-swapped-calloc-args.patch
|
||||
|
||||
# Backport upstream workaround for GCC 14 problem which cause assertion
|
||||
# failures in GDB.
|
||||
Patch046: gdb-rhbz2261580-intrusive_list-assertion-fix.patch
|
||||
|
||||
# Backport "gdb: s390: Add arch14 record/replay support"
|
||||
# (Andreas Arnez, RHEL-36225)
|
||||
Patch047: gdb-rhel-36225-add-arch14-record.patch
|
||||
|
||||
# Backport "PowerPC: Add support for Power11 options"
|
||||
# (Peter Bergner, RHEL-36518)
|
||||
Patch048: gdb-rhel-36518-add-power11-support.patch
|
||||
|
||||
# Update x86 disassembler
|
||||
Patch049: gdb-rhel-36527-apx-disasm.patch
|
||||
|
||||
#Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait"
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch050: gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
|
||||
|
||||
#gdb: fix b/p conditions with infcalls in multi-threaded inferiors
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch051: gdb-rhel-13298-inferior-funcall-bp-condition-2-of-5.patch
|
||||
|
||||
#gdb: add timeouts for inferior function calls
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch052: gdb-rhel-13298-inferior-funcall-bp-condition-3-of-5.patch
|
||||
|
||||
#gdb: introduce unwind-on-timeout setting
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch053: gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
|
||||
|
||||
#gdb: rename unwindonsignal to unwind-on-signal
|
||||
#(Andrew Burgess, RHEL-13298)
|
||||
Patch054: gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
|
||||
|
||||
#gdb/unwinders: better support for $pc not saved
|
||||
#(Andrew Burgess, RHEL-19390)
|
||||
Patch055: gdb-rhel-19390-pc-not-saved.patch
|
||||
|
||||
# Backkport "s390: Make operand table indices relative to each other"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch056: gdb-rhel-86801-binutils-z17-update-1of12.patch
|
||||
|
||||
# Backkport "s390: Align optional operand definition to specs"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch057: gdb-rhel-86801-binutils-z17-update-2of12.patch
|
||||
|
||||
# Backkport "s390: Add missing extended mnemonics"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch058: gdb-rhel-86801-binutils-z17-update-3of12.patch
|
||||
|
||||
# Backkport "s390: Correct prno instruction name"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch059: gdb-rhel-86801-binutils-z17-update-4of12.patch
|
||||
|
||||
# Backkport "Fix building for the s390 target with clang"
|
||||
# (Nick Clifton, RHEL-86801)
|
||||
Patch060: gdb-rhel-86801-binutils-z17-update-5of12.patch
|
||||
|
||||
# Backkport "s390: Align letter case of instruction descriptions"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch061: gdb-rhel-86801-binutils-z17-update-6of12.patch
|
||||
|
||||
# Backkport "s390: Provide IBM z16 (arch14) instruction descriptions"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch062: gdb-rhel-86801-binutils-z17-update-7of12.patch
|
||||
|
||||
# Backkport "s390: Align opcodes to lower-case"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch063: gdb-rhel-86801-binutils-z17-update-8of12.patch
|
||||
|
||||
# Backkport "s390: Simplify (dis)assembly of insn operands with const bits"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch064: gdb-rhel-86801-binutils-z17-update-9of12.patch
|
||||
|
||||
# Backkport "s390: Relax risbg[n]z, risb{h|l}gz, {rns|ros|rxs}bgt operand constraints"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch065: gdb-rhel-86801-binutils-z17-update-10of12.patch
|
||||
|
||||
# Backkport "s390: Add arch15 instructions"
|
||||
# (Andreas Krebbel, RHEL-86801)
|
||||
Patch066: gdb-rhel-86801-binutils-z17-update-11of12.patch
|
||||
|
||||
# Backkport "s390: Add support for z17 as CPU name"
|
||||
# (Jens Remus, RHEL-86801)
|
||||
Patch067: gdb-rhel-86801-binutils-z17-update-12of12.patch
|
||||
# Backport "s390: Add support for z17 as CPU name"
|
||||
# (Jens Remus, RHEL-50069)
|
||||
Patch013: gdb-rhel-50069-support-z17.patch
|
||||
|
||||
|
@ -11,57 +11,3 @@
|
||||
%patch -p1 -P011
|
||||
%patch -p1 -P012
|
||||
%patch -p1 -P013
|
||||
%patch -p1 -P014
|
||||
%patch -p1 -P015
|
||||
%patch -p1 -P016
|
||||
%patch -p1 -P017
|
||||
%patch -p1 -P018
|
||||
%patch -p1 -P019
|
||||
%patch -p1 -P020
|
||||
%patch -p1 -P021
|
||||
%patch -p1 -P022
|
||||
%patch -p1 -P023
|
||||
%patch -p1 -P024
|
||||
%patch -p1 -P025
|
||||
%patch -p1 -P026
|
||||
%patch -p1 -P027
|
||||
%patch -p1 -P028
|
||||
%patch -p1 -P029
|
||||
%patch -p1 -P030
|
||||
%patch -p1 -P031
|
||||
%patch -p1 -P032
|
||||
%patch -p1 -P033
|
||||
%patch -p1 -P034
|
||||
%patch -p1 -P035
|
||||
%patch -p1 -P036
|
||||
%patch -p1 -P037
|
||||
%patch -p1 -P038
|
||||
%patch -p1 -P039
|
||||
%patch -p1 -P040
|
||||
%patch -p1 -P041
|
||||
%patch -p1 -P042
|
||||
%patch -p1 -P043
|
||||
%patch -p1 -P044
|
||||
%patch -p1 -P045
|
||||
%patch -p1 -P046
|
||||
%patch -p1 -P047
|
||||
%patch -p1 -P048
|
||||
%patch -p1 -P049
|
||||
%patch -p1 -P050
|
||||
%patch -p1 -P051
|
||||
%patch -p1 -P052
|
||||
%patch -p1 -P053
|
||||
%patch -p1 -P054
|
||||
%patch -p1 -P055
|
||||
%patch -p1 -P056
|
||||
%patch -p1 -P057
|
||||
%patch -p1 -P058
|
||||
%patch -p1 -P059
|
||||
%patch -p1 -P060
|
||||
%patch -p1 -P061
|
||||
%patch -p1 -P062
|
||||
%patch -p1 -P063
|
||||
%patch -p1 -P064
|
||||
%patch -p1 -P065
|
||||
%patch -p1 -P066
|
||||
%patch -p1 -P067
|
||||
|
@ -1 +1 @@
|
||||
02c10eaecb63e5dbb99cbfdd1c5385e53ed031ff
|
||||
140ba011c003fda0fb2f746cf2bc0f010bf4ac03
|
||||
|
58
_patch_order
58
_patch_order
@ -1,67 +1,13 @@
|
||||
gdb-6.3-rh-testversion-20041202.patch
|
||||
gdb-6.3-gstack-20050411.patch
|
||||
gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||
gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
gdb-6.6-testsuite-timeouts.patch
|
||||
gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
|
||||
gdb-6.3-attach-see-vdso-test.patch
|
||||
gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
gdb-6.6-buildid-locate.patch
|
||||
gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
gdb-6.6-buildid-locate-rpm.patch
|
||||
gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
gdb-6.5-gcore-buffer-limit-test.patch
|
||||
gdb-6.3-mapping-zero-inode-test.patch
|
||||
gdb-6.5-section-num-fixup-test.patch
|
||||
gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
||||
gdb-simultaneous-step-resume-breakpoint-test.patch
|
||||
gdb-core-open-vdso-warning.patch
|
||||
gdb-archer-next-over-throw-cxx-exec.patch
|
||||
gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
gdb-test-bt-cfi-without-die.patch
|
||||
gdb-bz634108-solib_address.patch
|
||||
gdb-test-dw2-aranges.patch
|
||||
gdb-glibc-strstr-workaround.patch
|
||||
gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
|
||||
gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
|
||||
gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
|
||||
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
|
||||
gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
|
||||
gdb-fedora-libncursesw.patch
|
||||
gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
|
||||
gdb-container-rh-pkg.patch
|
||||
gdb-linux_perf-bundle.patch
|
||||
gdb-add-index.patch
|
||||
gdb-rhbz2232086-refactor-selftest-support.patch
|
||||
gdb-rhbz-2232086-reduce-size-of-gdb-index.patch
|
||||
gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch
|
||||
gdb-rhbz-2232086-generate-gdb-index-consistently.patch
|
||||
gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
|
||||
gdb-rhbz2250652-gdbpy_gil.patch
|
||||
gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch
|
||||
gdb-ftbs-swapped-calloc-args.patch
|
||||
gdb-rhbz2261580-intrusive_list-assertion-fix.patch
|
||||
gdb-rhel-36225-add-arch14-record.patch
|
||||
gdb-rhel-36518-add-power11-support.patch
|
||||
gdb-rhel-36527-apx-disasm.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-2-of-5.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-3-of-5.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
|
||||
gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
|
||||
gdb-rhel-19390-pc-not-saved.patch
|
||||
gdb-rhel-86801-binutils-z17-update-1of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-2of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-3of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-4of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-5of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-6of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-7of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-8of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-9of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-10of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-11of12.patch
|
||||
gdb-rhel-86801-binutils-z17-update-12of12.patch
|
||||
gdb-add-rpm-suggestion-script.patch
|
||||
gdb-rhel-50069-support-z17.patch
|
||||
|
@ -1,120 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-attach-see-vdso-test.patch
|
||||
|
||||
;; Test kernel VDSO decoding while attaching to an i386 process.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.c
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+int main ()
|
||||
+{
|
||||
+ pause ();
|
||||
+ return 1;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp
|
||||
@@ -0,0 +1,77 @@
|
||||
+# Copyright 2007
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
|
||||
+
|
||||
+# This test only works on Linux
|
||||
+if { ![istarget "*-*-linux-gnu*"] } {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+if {[use_gdb_stub]} {
|
||||
+ untested "skipping test because of use_gdb_stub"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set testfile "attach-see-vdso"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]]
|
||||
+
|
||||
+# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
|
||||
+#
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } {
|
||||
+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail."
|
||||
+}
|
||||
+
|
||||
+if [get_compiler_info ${binfile}] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Start the program running and then wait for a bit, to be sure
|
||||
+# that it can be attached to.
|
||||
+
|
||||
+set testpid [eval exec $binfile &]
|
||||
+
|
||||
+# Avoid some race:
|
||||
+sleep 2
|
||||
+
|
||||
+# Start with clean gdb
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+# Never call: gdb_load ${binfile}
|
||||
+# as the former problem would not reproduce otherwise.
|
||||
+
|
||||
+set test "attach"
|
||||
+gdb_test_multiple "attach $testpid" "$test" {
|
||||
+ -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
|
||||
+
|
||||
+# Exit and detach the process.
|
||||
+
|
||||
+gdb_exit
|
||||
+
|
||||
+# Make sure we don't leave a process around to confuse
|
||||
+# the next test run (and prevent the compile by keeping
|
||||
+# the text file busy), in case the "set should_exit" didn't
|
||||
+# work.
|
||||
+
|
||||
+remote_exec build "kill -9 ${testpid}"
|
@ -1,258 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Cagney <cagney@gnu.org>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.3-gstack-20050411.patch
|
||||
|
||||
;; Add a wrapper script to GDB that implements pstack using the
|
||||
;; --readnever option.
|
||||
;;=push
|
||||
|
||||
2004-11-23 Andrew Cagney <cagney@redhat.com>
|
||||
|
||||
* Makefile.in (uninstall-gstack, install-gstack): New rules, add
|
||||
to install and uninstall.
|
||||
* gstack.sh, gstack.1: New files.
|
||||
|
||||
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
|
||||
--- a/gdb/Makefile.in
|
||||
+++ b/gdb/Makefile.in
|
||||
@@ -2035,7 +2035,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
|
||||
install: all
|
||||
@$(MAKE) $(FLAGS_TO_PASS) install-only
|
||||
|
||||
-install-only: $(CONFIG_INSTALL)
|
||||
+install-only: install-gstack $(CONFIG_INSTALL)
|
||||
transformed_name=`t='$(program_transform_name)'; \
|
||||
echo gdb | sed -e "$$t"` ; \
|
||||
if test "x$$transformed_name" = x; then \
|
||||
@@ -2085,7 +2085,25 @@ install-guile:
|
||||
install-python:
|
||||
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
|
||||
|
||||
-uninstall: force $(CONFIG_UNINSTALL)
|
||||
+GSTACK=gstack
|
||||
+.PHONY: install-gstack
|
||||
+install-gstack:
|
||||
+ transformed_name=`t='$(program_transform_name)'; \
|
||||
+ echo $(GSTACK) | sed -e "$$t"` ; \
|
||||
+ if test "x$$transformed_name" = x; then \
|
||||
+ transformed_name=$(GSTACK) ; \
|
||||
+ else \
|
||||
+ true ; \
|
||||
+ fi ; \
|
||||
+ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
|
||||
+ $(INSTALL_PROGRAM) $(srcdir)/$(GSTACK).sh \
|
||||
+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
|
||||
+ : $(SHELL) $(srcdir)/../mkinstalldirs \
|
||||
+ $(DESTDIR)$(man1dir) ; \
|
||||
+ : $(INSTALL_DATA) $(srcdir)/gstack.1 \
|
||||
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
|
||||
+
|
||||
+uninstall: force uninstall-gstack $(CONFIG_UNINSTALL)
|
||||
transformed_name=`t='$(program_transform_name)'; \
|
||||
echo gdb | sed -e $$t` ; \
|
||||
if test "x$$transformed_name" = x; then \
|
||||
@@ -2116,6 +2134,18 @@ uninstall: force $(CONFIG_UNINSTALL)
|
||||
rm -f $(DESTDIR)$(bindir)/$$transformed_name
|
||||
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
||||
|
||||
+.PHONY: uninstall-gstack
|
||||
+uninstall-gstack:
|
||||
+ transformed_name=`t='$(program_transform_name)'; \
|
||||
+ echo $(GSTACK) | sed -e $$t` ; \
|
||||
+ if test "x$$transformed_name" = x; then \
|
||||
+ transformed_name=$(GSTACK) ; \
|
||||
+ else \
|
||||
+ true ; \
|
||||
+ fi ; \
|
||||
+ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
|
||||
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
|
||||
+
|
||||
# The C++ name parser can be built standalone for testing.
|
||||
test-cp-name-parser.o: cp-name-parser.c
|
||||
$(COMPILE) -DTEST_CPNAMES cp-name-parser.c
|
||||
diff --git a/gdb/gstack.sh b/gdb/gstack.sh
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/gstack.sh
|
||||
@@ -0,0 +1,43 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+if test $# -ne 1; then
|
||||
+ echo "Usage: `basename $0 .sh` <process-id>" 1>&2
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+if test ! -r /proc/$1; then
|
||||
+ echo "Process $1 not found." 1>&2
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+# GDB doesn't allow "thread apply all bt" when the process isn't
|
||||
+# threaded; need to peek at the process to determine if that or the
|
||||
+# simpler "bt" should be used.
|
||||
+
|
||||
+backtrace="bt"
|
||||
+if test -d /proc/$1/task ; then
|
||||
+ # Newer kernel; has a task/ directory.
|
||||
+ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
|
||||
+ backtrace="thread apply all bt"
|
||||
+ fi
|
||||
+elif test -f /proc/$1/maps ; then
|
||||
+ # Older kernel; go by it loading libpthread.
|
||||
+ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
||||
+ backtrace="thread apply all bt"
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+GDB=${GDB:-gdb}
|
||||
+
|
||||
+# Run GDB, strip out unwanted noise.
|
||||
+# --readnever is no longer used since .gdb_index is now in use.
|
||||
+$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 |
|
||||
+set width 0
|
||||
+set height 0
|
||||
+set pagination no
|
||||
+$backtrace
|
||||
+EOF
|
||||
+/bin/sed -n \
|
||||
+ -e 's/^\((gdb) \)*//' \
|
||||
+ -e '/^#/p' \
|
||||
+ -e '/^Thread/p'
|
||||
diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gstack.c
|
||||
@@ -0,0 +1,43 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+void
|
||||
+func (void)
|
||||
+{
|
||||
+ const char msg[] = "looping\n";
|
||||
+
|
||||
+ /* Use the most simple notification not to get caught by attach on exiting
|
||||
+ the function. */
|
||||
+ write (1, msg, strlen (msg));
|
||||
+
|
||||
+ for (;;);
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ alarm (60);
|
||||
+ nice (100);
|
||||
+
|
||||
+ func ();
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gstack.exp
|
||||
@@ -0,0 +1,84 @@
|
||||
+# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+set testfile gstack
|
||||
+set executable ${testfile}
|
||||
+set binfile [standard_output_file $executable]
|
||||
+if {[build_executable ${testfile} ${executable} "" {debug}] == -1} {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set test "spawn inferior"
|
||||
+set command "${binfile}"
|
||||
+set res [remote_spawn host $command];
|
||||
+if { $res < 0 || $res == "" } {
|
||||
+ perror "Spawning $command failed."
|
||||
+ fail $test
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# The spawn id of the test inferior.
|
||||
+set test_spawn_id $res
|
||||
+
|
||||
+set use_gdb_stub 1
|
||||
+set pid [exp_pid -i $res]
|
||||
+gdb_expect {
|
||||
+ -re "looping\r\n" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ eof {
|
||||
+ fail "$test (eof)"
|
||||
+ return
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "$test (timeout)"
|
||||
+ return
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Testcase uses the most simple notification not to get caught by attach on
|
||||
+# exiting the function. Still we could retry the gstack command if we fail.
|
||||
+
|
||||
+set test "spawn gstack"
|
||||
+set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END"
|
||||
+set res [remote_spawn host $command];
|
||||
+if { $res < 0 || $res == "" } {
|
||||
+ perror "Spawning $command failed."
|
||||
+ fail $test
|
||||
+}
|
||||
+
|
||||
+set gdb_spawn_id $res
|
||||
+
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "^#0 +(0x\[0-9a-f\]+ in )?\\.?func \\(\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in \\.?main \\(\\) at \[^\r\n\]*\r\nGSTACK-END\r\n\$" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test_multiple "" "gstack exits" {
|
||||
+ eof {
|
||||
+ set result [wait -i $gdb_spawn_id]
|
||||
+ verbose $result
|
||||
+
|
||||
+ gdb_assert { [lindex $result 2] == 0 } "gstack exits with no error"
|
||||
+ gdb_assert { [lindex $result 3] == 0 } "gstack's exit status is 0"
|
||||
+
|
||||
+ remote_close host
|
||||
+ clear_gdb_spawn_id
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Kill the test inferior.
|
||||
+kill_wait_spawned_process $test_spawn_id
|
@ -1,265 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
|
||||
|
||||
;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
|
||||
;;=push+jan: It should be replaced by Infinity project.
|
||||
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
|
||||
|
||||
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Port to GDB-6.8pre.
|
||||
|
||||
currently for trivial nonthreaded helloworld with no debug info up to -ggdb2 you
|
||||
will get:
|
||||
(gdb) p errno
|
||||
[some error]
|
||||
|
||||
* with -ggdb2 and less "errno" in fact does not exist anywhere as it was
|
||||
compiled to "(*__errno_location ())" and the macro definition is not present.
|
||||
Unfortunately gdb will find the TLS symbol and it will try to access it but
|
||||
as the program has been compiled without -lpthread the TLS base register
|
||||
(%gs on i386) is not setup and it will result in:
|
||||
Cannot access memory at address 0x8
|
||||
|
||||
Attached suggestion patch how to deal with the most common "errno" symbol
|
||||
for the most common under-ggdb3 compiled programs.
|
||||
|
||||
Original patch hooked into target_translate_tls_address. But its inferior
|
||||
call invalidates `struct frame *' in the callers - RH BZ 690908.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1166549
|
||||
|
||||
2007-11-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer
|
||||
DW_AT_MIPS_linkage_name over DW_AT_name now only for non-C.
|
||||
|
||||
glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
|
||||
<81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location
|
||||
<81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
|
||||
|
||||
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
|
||||
--- a/gdb/printcmd.c
|
||||
+++ b/gdb/printcmd.c
|
||||
@@ -1308,6 +1308,11 @@ process_print_command_args (const char *args, value_print_options *print_opts,
|
||||
|
||||
if (exp != nullptr && *exp)
|
||||
{
|
||||
+ /* '*((int *(*) (void)) __errno_location) ()' is incompatible with
|
||||
+ function descriptors. */
|
||||
+ if (target_has_execution () && strcmp (exp, "errno") == 0)
|
||||
+ exp = "*(*(int *(*)(void)) __errno_location) ()";
|
||||
+
|
||||
/* This setting allows large arrays to be printed by limiting the
|
||||
number of elements that are loaded into GDB's memory; we only
|
||||
need to load as many array elements as we plan to print. */
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
|
||||
@@ -0,0 +1,28 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005, 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+#include <errno.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ errno = 42;
|
||||
+
|
||||
+ return 0; /* breakpoint */
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
|
||||
@@ -0,0 +1,60 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+set testfile dw2-errno
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+proc prep {} {
|
||||
+ global srcdir subdir binfile
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ gdb_load ${binfile}
|
||||
+
|
||||
+ runto_main
|
||||
+
|
||||
+ gdb_breakpoint [gdb_get_line_number "breakpoint"]
|
||||
+ gdb_continue_to_breakpoint "breakpoint"
|
||||
+}
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+prep
|
||||
+gdb_test "print errno" ".* = 42" "errno with macros=N threads=N"
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+prep
|
||||
+gdb_test "print errno" ".* = 42" "errno with macros=Y threads=N"
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+prep
|
||||
+gdb_test "print errno" ".* = 42" "errno with macros=N threads=Y"
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+prep
|
||||
+gdb_test "print errno" ".* = 42" "errno with macros=Y threads=Y"
|
||||
+
|
||||
+# TODO: Test the error on resolving ERRNO with only libc loaded.
|
||||
+# Just how to find the current libc filename?
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
|
||||
@@ -0,0 +1,28 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005, 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+#include <errno.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ errno = 42;
|
||||
+
|
||||
+ return 0; /* breakpoint */
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
|
||||
@@ -0,0 +1,71 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+set testfile dw2-errno2
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+proc prep { message {do_xfail 0} } { with_test_prefix $message {
|
||||
+ global srcdir subdir binfile variant
|
||||
+ gdb_exit
|
||||
+ gdb_start
|
||||
+ gdb_reinitialize_dir $srcdir/$subdir
|
||||
+ gdb_load ${binfile}${variant}
|
||||
+
|
||||
+ runto_main
|
||||
+
|
||||
+ gdb_breakpoint [gdb_get_line_number "breakpoint"]
|
||||
+ gdb_continue_to_breakpoint "breakpoint"
|
||||
+
|
||||
+ gdb_test "gcore ${binfile}${variant}.core" "\r\nSaved corefile .*" "gcore $variant"
|
||||
+
|
||||
+ gdb_test "print errno" ".* = 42"
|
||||
+
|
||||
+ gdb_test "kill" ".*" "kill" {Kill the program being debugged\? \(y or n\) } "y"
|
||||
+ gdb_test "core-file ${binfile}${variant}.core" "\r\nCore was generated by .*" "core-file"
|
||||
+ if $do_xfail {
|
||||
+ setup_xfail "*-*-*"
|
||||
+ }
|
||||
+ gdb_test "print (int) errno" ".* = 42" "print errno for core"
|
||||
+}}
|
||||
+
|
||||
+set variant g2thrN
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+prep "macros=N threads=N" 1
|
||||
+
|
||||
+set variant g3thrN
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+prep "macros=Y threads=N" 1
|
||||
+
|
||||
+set variant g2thrY
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+prep "macros=N threads=Y"
|
||||
+
|
||||
+set variant g3thrY
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+prep "macros=Y threads=Y" 1
|
||||
+
|
||||
+# TODO: Test the error on resolving ERRNO with only libc loaded.
|
||||
+# Just how to find the current libc filename?
|
@ -1,89 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-bz243845-stale-testing-zombie-test.patch
|
||||
|
||||
;; Test leftover zombie process (BZ 243845).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp
|
||||
@@ -0,0 +1,76 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
+
|
||||
+# are we on a target board
|
||||
+if {[use_gdb_stub]} {
|
||||
+ untested "skipping test because of use_gdb_stub"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Start the program running and then wait for a bit, to be sure
|
||||
+# that it can be attached to.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_load sleep
|
||||
+
|
||||
+set gdb_pid [exp_pid -i [board_info host fileid]]
|
||||
+set test "identified the child GDB"
|
||||
+if {$gdb_pid != "" && $gdb_pid > 0} {
|
||||
+ pass $test
|
||||
+ verbose -log "Child GDB PID $gdb_pid"
|
||||
+} else {
|
||||
+ fail $test
|
||||
+}
|
||||
+
|
||||
+set testpid [eval exec sleep 10 &]
|
||||
+exec sleep 2
|
||||
+
|
||||
+set test "attach"
|
||||
+gdb_test_multiple "attach $testpid" "$test" {
|
||||
+ -re "Attaching to program.*`?.*'?, process $testpid..*$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+ -re "Attaching to program.*`?.*\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
|
||||
+ # Response expected on Cygwin
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Some time to let GDB spawn its testing child.
|
||||
+exec sleep 2
|
||||
+
|
||||
+set found none
|
||||
+foreach procpid [glob -directory /proc -type d {[0-9]*}] {
|
||||
+ if {[catch {open $procpid/status} statusfi]} {
|
||||
+ continue
|
||||
+ }
|
||||
+ set status [read $statusfi]
|
||||
+ close $statusfi
|
||||
+ if {1
|
||||
+ && [regexp -line {^Name:\tgdb$} $status]
|
||||
+ && [regexp -line {^PPid:\t1$} $status]
|
||||
+ && [regexp -line "^TracerPid:\t$gdb_pid$" $status]} {
|
||||
+ set found $procpid
|
||||
+ verbose -log "Found linux_test_for_tracefork zombie PID $procpid"
|
||||
+ }
|
||||
+}
|
||||
+set test "linux_test_for_tracefork leaves no zombie"
|
||||
+if {$found eq {none}} {
|
||||
+ pass $test
|
||||
+} else {
|
||||
+ fail $test
|
||||
+}
|
@ -1,127 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.5-section-num-fixup-test.patch
|
||||
|
||||
;; Test a crash on libraries missing the .text section.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/datalib-lib.c
|
||||
@@ -0,0 +1,22 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int var;
|
||||
diff --git a/gdb/testsuite/gdb.base/datalib-main.c b/gdb/testsuite/gdb.base/datalib-main.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/datalib-main.c
|
||||
@@ -0,0 +1,26 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ Please email any bugs, comments, and/or additions to this file to:
|
||||
+ bug-gdb@prep.ai.mit.edu */
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/datalib.exp
|
||||
@@ -0,0 +1,56 @@
|
||||
+# Copyright 2008 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+if {[use_gdb_stub]} {
|
||||
+ untested "skipping test because of use_gdb_stub"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set testfile datalib
|
||||
+set srcfilemain ${testfile}-main.c
|
||||
+set srcfilelib ${testfile}-lib.c
|
||||
+set libfile [standard_output_file ${testfile}-lib.so]
|
||||
+set binfile [standard_output_file ${testfile}-main]
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfilelib}" "${libfile}" executable [list debug {additional_flags=-shared -nostdlib}]] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfilemain}" "${binfile} ${libfile}" executable {debug}] != "" } {
|
||||
+ untested "Couldn't compile test program"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get things started.
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+# We must use a separate library as the main executable is compiled to the
|
||||
+# address 0 by default and it would get fixed up already at the end of
|
||||
+# INIT_OBJFILE_SECT_INDICES. We also cannot PRELINK it as PRELINK is missing
|
||||
+# on ia64. The library must be NOSTDLIB as otherwise some stub code would
|
||||
+# create the `.text' section there. Also DEBUG option is useful as some of
|
||||
+# the crashes occur in dwarf2read.c.
|
||||
+
|
||||
+# FAIL case:
|
||||
+# ../../gdb/ia64-tdep.c:2838: internal-error: sect_index_text not initialized
|
||||
+# A problem internal to GDB has been detected,
|
||||
+
|
||||
+gdb_test "start" \
|
||||
+ "main \\(\\) at .*${srcfilemain}.*" \
|
||||
+ "start"
|
@ -1,129 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject:
|
||||
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
|
||||
|
||||
;; Fix 'gdb gives highly misleading error when debuginfo pkg is present,
|
||||
;; but not corresponding binary pkg' (RH BZ 981154).
|
||||
;;=push+jan
|
||||
|
||||
Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
|
||||
|
||||
This is the fix for RH BZ #981154
|
||||
|
||||
It is mainly a testcase addition, but a minor fix in the gdb/build-id.c
|
||||
file was also needed.
|
||||
|
||||
gdb/build-id.c was added by:
|
||||
|
||||
commit dc294be54c96414035eed7d53dafdea0a6f31a72
|
||||
Author: Tom Tromey <tromey@redhat.com>
|
||||
Date: Tue Oct 8 19:56:15 2013 +0000
|
||||
|
||||
and had a little thinko there. The variable 'filename' needs to be set to
|
||||
NULL after it is free'd, otherwise the code below thinks that it is still
|
||||
valid and doesn't print the necessary warning ("Try: yum install ...").
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
|
||||
@@ -0,0 +1,97 @@
|
||||
+# Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+standard_testfile "normal.c"
|
||||
+
|
||||
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Get the build-id of the file
|
||||
+set build_id_debug_file [build_id_debug_filename_get $binfile]
|
||||
+regsub -all ".debug$" $build_id_debug_file "" build_id_without_debug
|
||||
+
|
||||
+# Run to main
|
||||
+if { ![runto_main] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# We first need to generate a corefile
|
||||
+set escapedfilename [string_to_regexp [standard_output_file gcore.test]]
|
||||
+set core_supported 0
|
||||
+gdb_test_multiple "gcore [standard_output_file gcore.test]" \
|
||||
+ "save a corefile" \
|
||||
+{
|
||||
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
|
||||
+ pass "save a corefile"
|
||||
+ global core_supported
|
||||
+ set core_supported 1
|
||||
+ }
|
||||
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
|
||||
+ unsupported "save a corefile"
|
||||
+ global core_supported
|
||||
+ set core_supported 0
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if {!$core_supported} {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Move the binfile to a temporary name
|
||||
+remote_exec build "mv $binfile ${binfile}.old"
|
||||
+
|
||||
+# Reinitialize GDB and see if we get a yum/dnf warning
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+with_test_prefix "first run:" {
|
||||
+ gdb_test "set build-id-verbose 1" "" \
|
||||
+ "set build-id-verbose"
|
||||
+
|
||||
+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
|
||||
+ "set debug-file-directory"
|
||||
+
|
||||
+ gdb_test "core-file [standard_output_file gcore.test]" \
|
||||
+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install [standard_output_file $build_id_without_debug]\r\n.*" \
|
||||
+ "test first yum/dnf warning"
|
||||
+}
|
||||
+
|
||||
+# Now we define and create our .build-id
|
||||
+file mkdir [file dirname [standard_output_file ${build_id_without_debug}]]
|
||||
+# Cannot use "file link" (from TCL) because it requires the target file to
|
||||
+# exist.
|
||||
+remote_exec build "ln -s $binfile [standard_output_file ${build_id_without_debug}]"
|
||||
+
|
||||
+# Reinitialize GDB to get the second yum/dnf warning
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+with_test_prefix "second run:" {
|
||||
+ gdb_test "set build-id-verbose 1" "" \
|
||||
+ "set build-id-verbose"
|
||||
+
|
||||
+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
|
||||
+ "set debug-file-directory"
|
||||
+
|
||||
+ gdb_test "core-file [standard_output_file gcore.test]" \
|
||||
+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \
|
||||
+ "test second yum/dnf warning"
|
||||
+}
|
||||
+
|
||||
+# Leaving the link there will cause breakage in the next run.
|
||||
+remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"
|
@ -1,19 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
|
||||
|
||||
;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
|
||||
;;=push+jan
|
||||
|
||||
diff --git a/gdb/proc-service.list b/gdb/proc-service.list
|
||||
--- a/gdb/proc-service.list
|
||||
+++ b/gdb/proc-service.list
|
||||
@@ -37,4 +37,7 @@
|
||||
ps_pstop;
|
||||
ps_ptread;
|
||||
ps_ptwrite;
|
||||
+
|
||||
+ /* gdb-6.6-buildid-locate-rpm.patch */
|
||||
+ rpmsqEnable;
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -1,238 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-buildid-locate-solib-missing-ids.patch
|
||||
|
||||
;; Fix loading of core files without build-ids but with build-ids in executables.
|
||||
;; Load strictly build-id-checked core files only if no executable is specified
|
||||
;; (Jan Kratochvil, RH BZ 1339862).
|
||||
;;=push+jan
|
||||
|
||||
gdb returns an incorrect back trace when applying a debuginfo
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1339862
|
||||
|
||||
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
|
||||
--- a/gdb/solib-svr4.c
|
||||
+++ b/gdb/solib-svr4.c
|
||||
@@ -1320,14 +1320,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
}
|
||||
|
||||
{
|
||||
- struct bfd_build_id *build_id;
|
||||
+ struct bfd_build_id *build_id = NULL;
|
||||
|
||||
strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1);
|
||||
newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
|
||||
/* May get overwritten below. */
|
||||
strcpy (newobj->so_name, newobj->so_original_name);
|
||||
|
||||
- build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld);
|
||||
+ /* In the case the main executable was found according to its build-id
|
||||
+ (from a core file) prevent loading a different build of a library
|
||||
+ with accidentally the same SO_NAME.
|
||||
+
|
||||
+ It suppresses bogus backtraces (and prints "??" there instead) if
|
||||
+ the on-disk files no longer match the running program version.
|
||||
+
|
||||
+ If the main executable was not loaded according to its build-id do
|
||||
+ not do any build-id checking of the libraries. There may be missing
|
||||
+ build-ids dumped in the core file and we would map all the libraries
|
||||
+ to the only existing file loaded that time - the executable. */
|
||||
+ if (current_program_space->symfile_object_file != NULL
|
||||
+ && (current_program_space->symfile_object_file->flags
|
||||
+ & OBJF_BUILD_ID_CORE_LOADED) != 0)
|
||||
+ build_id = build_id_addr_get (li->l_ld);
|
||||
if (build_id != NULL)
|
||||
{
|
||||
char *name, *build_id_filename;
|
||||
@@ -1342,23 +1356,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
|
||||
xfree (name);
|
||||
}
|
||||
else
|
||||
- {
|
||||
- debug_print_missing (newobj->so_name, build_id_filename);
|
||||
-
|
||||
- /* In the case the main executable was found according to
|
||||
- its build-id (from a core file) prevent loading
|
||||
- a different build of a library with accidentally the
|
||||
- same SO_NAME.
|
||||
-
|
||||
- It suppresses bogus backtraces (and prints "??" there
|
||||
- instead) if the on-disk files no longer match the
|
||||
- running program version. */
|
||||
-
|
||||
- if (current_program_space->symfile_object_file != NULL
|
||||
- && (current_program_space->symfile_object_file->flags
|
||||
- & OBJF_BUILD_ID_CORE_LOADED) != 0)
|
||||
- newobj->so_name[0] = 0;
|
||||
- }
|
||||
+ debug_print_missing (newobj->so_name, build_id_filename);
|
||||
|
||||
xfree (build_id_filename);
|
||||
xfree (build_id);
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
|
||||
@@ -0,0 +1,21 @@
|
||||
+/* Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+void
|
||||
+lib (void)
|
||||
+{
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+extern void lib (void);
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ lib ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
|
||||
@@ -0,0 +1,105 @@
|
||||
+# Copyright 2016 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+if {[skip_shlib_tests]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "gcore-buildid-exec-but-not-solib"
|
||||
+set srcmainfile ${testfile}-main.c
|
||||
+set srclibfile ${testfile}-lib.c
|
||||
+set libfile [standard_output_file ${testfile}-lib.so]
|
||||
+set objfile [standard_output_file ${testfile}-main.o]
|
||||
+set executable ${testfile}-main
|
||||
+set binfile [standard_output_file ${executable}]
|
||||
+set gcorefile [standard_output_file ${executable}.gcore]
|
||||
+set outdir [file dirname $binfile]
|
||||
+
|
||||
+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != ""
|
||||
+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
|
||||
+ unsupported "-Wl,--build-id compilation failed"
|
||||
+ return -1
|
||||
+}
|
||||
+set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
|
||||
+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
|
||||
+ unsupported "-Wl,--build-id compilation failed"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+clean_restart $executable
|
||||
+gdb_load_shlib $libfile
|
||||
+
|
||||
+# Does this gdb support gcore?
|
||||
+set test "help gcore"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
|
||||
+ # gcore command not supported -- nothing to test here.
|
||||
+ unsupported "gdb does not support gcore on this target"
|
||||
+ return -1;
|
||||
+ }
|
||||
+ -re "Save a core file .*\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if { ![runto lib] } then {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set escapedfilename [string_to_regexp ${gcorefile}]
|
||||
+
|
||||
+set test "save a corefile"
|
||||
+gdb_test_multiple "gcore ${gcorefile}" $test {
|
||||
+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "Can't create a corefile\r\n$gdb_prompt $" {
|
||||
+ unsupported $test
|
||||
+ return -1
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+# Now restart gdb and load the corefile.
|
||||
+
|
||||
+clean_restart $executable
|
||||
+gdb_load_shlib $libfile
|
||||
+
|
||||
+set buildid [build_id_debug_filename_get $libfile]
|
||||
+
|
||||
+regsub {\.debug$} $buildid {} buildid
|
||||
+
|
||||
+set debugdir [standard_output_file ${testfile}-debugdir]
|
||||
+file delete -force -- $debugdir
|
||||
+
|
||||
+file mkdir $debugdir/[file dirname $libfile]
|
||||
+file copy $libfile $debugdir/${libfile}
|
||||
+
|
||||
+file mkdir $debugdir/[file dirname $buildid]
|
||||
+file copy $libfile $debugdir/${buildid}
|
||||
+
|
||||
+remote_exec build "ln -s /lib ${debugdir}/"
|
||||
+remote_exec build "ln -s /lib64 ${debugdir}/"
|
||||
+# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2
|
||||
+
|
||||
+gdb_test "set solib-absolute-prefix $debugdir"
|
||||
+
|
||||
+gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory"
|
||||
+
|
||||
+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
|
||||
+
|
||||
+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
|
||||
+
|
||||
+gdb_test "bt"
|
||||
+gdb_test "info shared"
|
File diff suppressed because it is too large
Load Diff
@ -1,188 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-bz229517-gcore-without-terminal.patch
|
||||
|
||||
;; Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
|
||||
;;=fedoratest
|
||||
|
||||
2007-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb_gcore.sh: Redirect GDB from `</dev/null'.
|
||||
|
||||
2007-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gcorebg.c b/gdb/testsuite/gdb.base/gcorebg.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcorebg.c
|
||||
@@ -0,0 +1,49 @@
|
||||
+#include <stdio.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <signal.h>
|
||||
+#include <string.h>
|
||||
+#include <assert.h>
|
||||
+
|
||||
+int main (int argc, char **argv)
|
||||
+{
|
||||
+ pid_t pid = 0;
|
||||
+ pid_t ppid;
|
||||
+ char buf[1024*2 + 500];
|
||||
+ int gotint;
|
||||
+
|
||||
+ if (argc != 4)
|
||||
+ {
|
||||
+ fprintf (stderr, "Syntax: %s {standard|detached} <gcore command> <core output file>\n",
|
||||
+ argv[0]);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ pid = fork ();
|
||||
+
|
||||
+ switch (pid)
|
||||
+ {
|
||||
+ case 0:
|
||||
+ if (strcmp (argv[1], "detached") == 0)
|
||||
+ setpgrp ();
|
||||
+ ppid = getppid ();
|
||||
+ gotint = snprintf (buf, sizeof (buf), "sh %s -o %s %d", argv[2], argv[3], (int) ppid);
|
||||
+ assert (gotint < sizeof (buf));
|
||||
+ system (buf);
|
||||
+ fprintf (stderr, "Killing parent PID %d\n", ppid);
|
||||
+ kill (ppid, SIGTERM);
|
||||
+ break;
|
||||
+
|
||||
+ case -1:
|
||||
+ perror ("fork err\n");
|
||||
+ exit (1);
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ fprintf (stderr,"Sleeping as PID %d\n", getpid ());
|
||||
+ sleep (60);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gcorebg.exp b/gdb/testsuite/gdb.base/gcorebg.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gcorebg.exp
|
||||
@@ -0,0 +1,113 @@
|
||||
+# Copyright 2007 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+# Please email any bugs, comments, and/or additions to this file to:
|
||||
+# bug-gdb@prep.ai.mit.edu
|
||||
+
|
||||
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
|
||||
+# This is a test for `gdb_gcore.sh' functionality.
|
||||
+# It also tests a regression with `gdb_gcore.sh' being run without its
|
||||
+# accessible terminal.
|
||||
+
|
||||
+if ![info exists GCORE] {
|
||||
+ set GCORE "[standard_output_file ../../../../gcore]"
|
||||
+}
|
||||
+verbose "using GCORE = $GCORE" 2
|
||||
+
|
||||
+set testfile "gcorebg"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set corefile [standard_output_file ${testfile}.test]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ untested gcorebg.exp
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Cleanup.
|
||||
+
|
||||
+proc core_clean {} {
|
||||
+ global corefile
|
||||
+
|
||||
+ foreach file [glob -nocomplain [join [list $corefile *] ""]] {
|
||||
+ verbose "Delete file $file" 1
|
||||
+ remote_file target delete $file
|
||||
+ }
|
||||
+}
|
||||
+core_clean
|
||||
+remote_file target delete "./gdb"
|
||||
+
|
||||
+# Generate the core file.
|
||||
+
|
||||
+# Provide `./gdb' for `gdb_gcore.sh' running it as a bare `gdb' command.
|
||||
+# Setup also `$PATH' appropriately.
|
||||
+# If GDB was not found let `gdb_gcore.sh' to find the system GDB by `$PATH'.
|
||||
+if {$GDB != "gdb"} {
|
||||
+ file link ./gdb $GDB
|
||||
+}
|
||||
+global env
|
||||
+set oldpath $env(PATH)
|
||||
+set env(PATH) [join [list . $env(PATH)] ":"]
|
||||
+verbose "PATH = $env(PATH)" 2
|
||||
+
|
||||
+# Test file body.
|
||||
+# $detached == "standard" || $detached == "detached"
|
||||
+
|
||||
+proc test_body { detached } {
|
||||
+ global binfile
|
||||
+ global GCORE
|
||||
+ global corefile
|
||||
+
|
||||
+ set res [remote_spawn target "$binfile $detached $GCORE $corefile"]
|
||||
+ if { $res < 0 || $res == "" } {
|
||||
+ fail "Spawning $detached gcore"
|
||||
+ return 1
|
||||
+ }
|
||||
+ pass "Spawning $detached gcore"
|
||||
+ remote_expect target 20 {
|
||||
+ timeout {
|
||||
+ fail "Spawned $detached gcore finished (timeout)"
|
||||
+ remote_exec target "kill -9 -[exp_pid -i $res]"
|
||||
+ return 1
|
||||
+ }
|
||||
+ "Saved corefile .*\r\nKilling parent PID " {
|
||||
+ pass "Spawned $detached gcore finished"
|
||||
+ remote_wait target 20
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if {1 == [llength [glob -nocomplain [join [list $corefile *] ""]]]} {
|
||||
+ pass "Core file generated by $detached gcore"
|
||||
+ } else {
|
||||
+ fail "Core file generated by $detached gcore"
|
||||
+ }
|
||||
+ core_clean
|
||||
+}
|
||||
+
|
||||
+# First a general `gdb_gcore.sh' spawn with its controlling terminal available.
|
||||
+
|
||||
+test_body standard
|
||||
+
|
||||
+# And now `gdb_gcore.sh' spawn without its controlling terminal available.
|
||||
+# It is spawned through `gcorebg.c' using setpgrp ().
|
||||
+
|
||||
+test_body detached
|
||||
+
|
||||
+
|
||||
+# Cleanup.
|
||||
+
|
||||
+set env(PATH) $oldpath
|
||||
+remote_file target delete "./gdb"
|
@ -1,32 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.6-testsuite-timeouts.patch
|
||||
|
||||
;; Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
|
||||
--- a/gdb/testsuite/gdb.base/annota1.exp
|
||||
+++ b/gdb/testsuite/gdb.base/annota1.exp
|
||||
@@ -37,6 +37,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
|
||||
|
||||
clean_restart ${binfile}
|
||||
|
||||
+gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions"
|
||||
+
|
||||
# The commands we test here produce many lines of output; disable "press
|
||||
# <return> to continue" prompts.
|
||||
gdb_test_no_output "set height 0"
|
||||
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
|
||||
--- a/gdb/testsuite/gdb.base/annota3.exp
|
||||
+++ b/gdb/testsuite/gdb.base/annota3.exp
|
||||
@@ -36,6 +36,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
|
||||
|
||||
clean_restart ${binfile}
|
||||
|
||||
+gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions"
|
||||
+
|
||||
# The commands we test here produce many lines of output; disable "press
|
||||
# <return> to continue" prompts.
|
||||
gdb_test_no_output "set height 0"
|
@ -1,108 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-6.7-ppc-clobbered-registers-O2-test.patch
|
||||
|
||||
;; Test PPC hiding of call-volatile parameter register.
|
||||
;;=fedoratest
|
||||
|
||||
2007-11-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.arch/ppc-clobbered-registers-O2.exp: `powerpc64' changed to
|
||||
`powerpc*'.
|
||||
|
||||
Testcase for:
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
|
||||
|
||||
2007-10-21 Luis Machado <luisgpm@br.ibm.com>
|
||||
|
||||
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): New function.
|
||||
* (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as
|
||||
default dwarf2_frame_set_init_reg function.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c
|
||||
@@ -0,0 +1,21 @@
|
||||
+
|
||||
+unsigned * __attribute__((noinline))
|
||||
+start_sequence (unsigned * x, unsigned * y)
|
||||
+{
|
||||
+ return (unsigned *)0xdeadbeef;
|
||||
+};
|
||||
+
|
||||
+unsigned __attribute__((noinline))
|
||||
+gen_movsd (unsigned * operand0, unsigned * operand1)
|
||||
+{
|
||||
+ return *start_sequence(operand0, operand1);
|
||||
+}
|
||||
+
|
||||
+int main(void)
|
||||
+{
|
||||
+ unsigned x, y;
|
||||
+
|
||||
+ x = 13;
|
||||
+ y = 14;
|
||||
+ return (int)gen_movsd (&x, &y);
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp
|
||||
@@ -0,0 +1,54 @@
|
||||
+# Copyright 2006 Free Software Foundation, Inc.
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program; if not, write to the Free Software
|
||||
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+#
|
||||
+# This file is part of the gdb testsuite.
|
||||
+
|
||||
+# Test displaying call clobbered registers in optimized binaries for ppc.
|
||||
+# GDB should not show incorrect values.
|
||||
+
|
||||
+if ![istarget "powerpc*-*"] then {
|
||||
+ verbose "Skipping powerpc* call clobbered registers testing."
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set testfile "ppc-clobbered-registers-O2"
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+set compile_flags "debug additional_flags=-O2"
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${compile_flags}] != "" } {
|
||||
+ unsupported "Testcase compile failed."
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+if ![runto_main] then {
|
||||
+ perror "Couldn't run to breakpoint"
|
||||
+ continue
|
||||
+}
|
||||
+
|
||||
+gdb_test "b start_sequence" ".*Breakpoint 2 at.*line 6.*" \
|
||||
+ "Insert breakpoint at problematic function"
|
||||
+
|
||||
+gdb_test continue ".*Breakpoint 2.*in start_sequence.*" \
|
||||
+ "Run until problematic function"
|
||||
+
|
||||
+gdb_test backtrace ".*operand0=<value optimized out>.*operand1=<value optimized out>.*" \
|
||||
+ "Check value of call clobbered registers"
|
1009
gdb-add-rpm-suggestion-script.patch
Normal file
1009
gdb-add-rpm-suggestion-script.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -59,7 +59,7 @@ new file mode 100644
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+if { [skip_cplus_tests] } { continue }
|
||||
+require allow_cplus_tests
|
||||
+
|
||||
+set testfile cxxexec
|
||||
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } {
|
||||
|
@ -1,41 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-bz634108-solib_address.patch
|
||||
|
||||
;; Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
|
||||
;;=fedoratest
|
||||
|
||||
Fix gdb.solib_address (fix by Phil Muldoon).
|
||||
|
||||
s/solib_address/solib_name/ during upstreaming.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
|
||||
@@ -0,0 +1,24 @@
|
||||
+# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# https://bugzilla.redhat.com/show_bug.cgi?id=634108
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+
|
||||
+# Skip all tests if Python scripting is not enabled.
|
||||
+if { [skip_python_tests] } { continue }
|
||||
+
|
||||
+gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists"
|
@ -1,30 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-container-rh-pkg.patch
|
||||
|
||||
;; Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
|
||||
;;=fedora
|
||||
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -14742,7 +14742,17 @@ remote_target::pid_to_exec_file (int pid)
|
||||
char *annex = NULL;
|
||||
|
||||
if (m_features.packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE)
|
||||
- return NULL;
|
||||
+ {
|
||||
+ warning (_("Remote gdbserver does not support determining executable "
|
||||
+ "automatically.\n"
|
||||
+"RHEL <=6.8 and <=7.2 versions of gdbserver do not support such automatic executable detection.\n"
|
||||
+"The following versions of gdbserver support it:\n"
|
||||
+"- Upstream version of gdbserver (unsupported) 7.10 or later\n"
|
||||
+"- Red Hat Developer Toolset (DTS) version of gdbserver from DTS 4.0 or later (only on x86_64)\n"
|
||||
+"- RHEL-7.3 versions of gdbserver (on any architecture)"
|
||||
+));
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
inferior *inf = find_inferior_pid (this, pid);
|
||||
if (inf == NULL)
|
@ -1,58 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-core-open-vdso-warning.patch
|
||||
|
||||
;; Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
||||
;; Fix regression of undisplayed missing shared libraries caused by a fix for.
|
||||
;;=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*>
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
|
||||
Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
||||
|
||||
[ New patch variant. ]
|
||||
|
||||
commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f
|
||||
Author: Ulrich Weigand <uweigand@de.ibm.com>
|
||||
Date: Wed Sep 25 11:52:50 2013 +0000
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp
|
||||
--- a/gdb/testsuite/gdb.base/solib-symbol.exp
|
||||
+++ b/gdb/testsuite/gdb.base/solib-symbol.exp
|
||||
@@ -27,6 +27,7 @@ set testfile "solib-symbol-main"
|
||||
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
set binfile [standard_output_file ${testfile}]
|
||||
set bin_flags [list debug shlib=${binfile_lib}]
|
||||
+set executable ${testfile}
|
||||
|
||||
if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
|
||||
|| [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
|
||||
@@ -61,4 +62,28 @@ gdb_test "br foo2" \
|
||||
"Breakpoint.*: foo2. .2 locations..*" \
|
||||
"foo2 in mdlib"
|
||||
|
||||
+# Test GDB warns for shared libraris which have not been found.
|
||||
+
|
||||
+gdb_test "info sharedlibrary" "/${libname}.*"
|
||||
+
|
||||
+clean_restart ${executable}
|
||||
+gdb_breakpoint "main"
|
||||
+gdb_run_cmd
|
||||
+set test "no warning for missing libraries"
|
||||
+gdb_test_multiple "" $test {
|
||||
+ -re "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\n$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+ -re "Breakpoint \[0-9\]+, main .*\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+clean_restart ${executable}
|
||||
+gdb_test_no_output "set solib-absolute-prefix /doESnotEXIST"
|
||||
+gdb_breakpoint "main"
|
||||
+gdb_run_cmd
|
||||
+gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \
|
||||
+ "warning for missing libraries"
|
||||
+
|
||||
gdb_exit
|
@ -1,333 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-fedora-libncursesw.patch
|
||||
|
||||
;; Force libncursesw over libncurses to match the includes (RH BZ 1270534).
|
||||
;;=push+jan
|
||||
|
||||
Fedora: Force libncursesw over libncurses to match the includes.
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1270534
|
||||
|
||||
diff --git a/gdb/configure b/gdb/configure
|
||||
--- a/gdb/configure
|
||||
+++ b/gdb/configure
|
||||
@@ -780,9 +780,6 @@ ENABLE_BFD_64_BIT_TRUE
|
||||
subdirs
|
||||
RPM_LIBS
|
||||
RPM_CFLAGS
|
||||
-PKG_CONFIG_LIBDIR
|
||||
-PKG_CONFIG_PATH
|
||||
-PKG_CONFIG
|
||||
GDB_DATADIR
|
||||
DEBUGDIR
|
||||
MAKEINFO_EXTRA_FLAGS
|
||||
@@ -990,12 +987,12 @@ PKG_CONFIG_PATH
|
||||
PKG_CONFIG_LIBDIR
|
||||
MAKEINFO
|
||||
MAKEINFOFLAGS
|
||||
+RPM_CFLAGS
|
||||
+RPM_LIBS
|
||||
AMD_DBGAPI_CFLAGS
|
||||
AMD_DBGAPI_LIBS
|
||||
DEBUGINFOD_CFLAGS
|
||||
DEBUGINFOD_LIBS
|
||||
-RPM_CFLAGS
|
||||
-RPM_LIBS
|
||||
YACC
|
||||
YFLAGS
|
||||
ZSTD_CFLAGS
|
||||
@@ -1684,11 +1681,11 @@ Optional Packages:
|
||||
[--with-auto-load-dir]
|
||||
--without-auto-load-safe-path
|
||||
do not restrict auto-loaded files locations
|
||||
+ --with-rpm query rpm database for missing debuginfos (yes/no,
|
||||
+ def. auto=librpm.so)
|
||||
--with-amd-dbgapi support for the amd-dbgapi target (yes / no / auto)
|
||||
--with-debuginfod Enable debuginfo lookups with debuginfod
|
||||
(auto/yes/no)
|
||||
- --with-rpm query rpm database for missing debuginfos (yes/no,
|
||||
- def. auto=librpm.so)
|
||||
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
|
||||
--with-curses use the curses library instead of the termcap
|
||||
library
|
||||
@@ -1761,6 +1758,8 @@ Some influential environment variables:
|
||||
MAKEINFO Parent configure detects if it is of sufficient version.
|
||||
MAKEINFOFLAGS
|
||||
Parameters for MAKEINFO.
|
||||
+ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
|
||||
+ RPM_LIBS linker flags for RPM, overriding pkg-config
|
||||
AMD_DBGAPI_CFLAGS
|
||||
C compiler flags for AMD_DBGAPI, overriding pkg-config
|
||||
AMD_DBGAPI_LIBS
|
||||
@@ -1769,8 +1768,6 @@ Some influential environment variables:
|
||||
C compiler flags for DEBUGINFOD, overriding pkg-config
|
||||
DEBUGINFOD_LIBS
|
||||
linker flags for DEBUGINFOD, overriding pkg-config
|
||||
- RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
|
||||
- RPM_LIBS linker flags for RPM, overriding pkg-config
|
||||
YACC The `Yet Another Compiler Compiler' implementation to use.
|
||||
Defaults to the first program found out of: `bison -y', `byacc',
|
||||
`yacc'.
|
||||
@@ -11495,7 +11492,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
-#line 11486 "configure"
|
||||
+#line 11495 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -11601,7 +11598,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
-#line 11592 "configure"
|
||||
+#line 11601 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -18102,8 +18099,8 @@ $as_echo_n "checking specific librpm version... " >&6; }
|
||||
if test "$cross_compiling" = yes; then :
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
-as_fn_error "cannot run test program while cross compiling
|
||||
-See \`config.log' for more details." "$LINENO" 5; }
|
||||
+as_fn_error $? "cannot run test program while cross compiling
|
||||
+See \`config.log' for more details" "$LINENO" 5; }
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
@@ -18275,132 +18272,12 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
|
||||
$as_echo "no" >&6; }
|
||||
LIBS="$save_LIBS"
|
||||
if $DLOPEN_REQUIRE; then
|
||||
- as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
|
||||
+ as_fn_error $? "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
|
||||
fi
|
||||
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
- if test -n "$ac_tool_prefix"; then
|
||||
- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
|
||||
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
-$as_echo_n "checking for $ac_word... " >&6; }
|
||||
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
|
||||
- $as_echo_n "(cached) " >&6
|
||||
-else
|
||||
- case $PKG_CONFIG in
|
||||
- [\\/]* | ?:[\\/]*)
|
||||
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
|
||||
- ;;
|
||||
- *)
|
||||
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
-for as_dir in $PATH
|
||||
-do
|
||||
- IFS=$as_save_IFS
|
||||
- test -z "$as_dir" && as_dir=.
|
||||
- for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
- break 2
|
||||
- fi
|
||||
-done
|
||||
- done
|
||||
-IFS=$as_save_IFS
|
||||
-
|
||||
- ;;
|
||||
-esac
|
||||
-fi
|
||||
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
|
||||
-if test -n "$PKG_CONFIG"; then
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
|
||||
-$as_echo "$PKG_CONFIG" >&6; }
|
||||
-else
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
-$as_echo "no" >&6; }
|
||||
-fi
|
||||
-
|
||||
-
|
||||
-fi
|
||||
-if test -z "$ac_cv_path_PKG_CONFIG"; then
|
||||
- ac_pt_PKG_CONFIG=$PKG_CONFIG
|
||||
- # Extract the first word of "pkg-config", so it can be a program name with args.
|
||||
-set dummy pkg-config; ac_word=$2
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
-$as_echo_n "checking for $ac_word... " >&6; }
|
||||
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
|
||||
- $as_echo_n "(cached) " >&6
|
||||
-else
|
||||
- case $ac_pt_PKG_CONFIG in
|
||||
- [\\/]* | ?:[\\/]*)
|
||||
- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
|
||||
- ;;
|
||||
- *)
|
||||
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
-for as_dir in $PATH
|
||||
-do
|
||||
- IFS=$as_save_IFS
|
||||
- test -z "$as_dir" && as_dir=.
|
||||
- for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
- break 2
|
||||
- fi
|
||||
-done
|
||||
- done
|
||||
-IFS=$as_save_IFS
|
||||
-
|
||||
- ;;
|
||||
-esac
|
||||
-fi
|
||||
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
|
||||
-if test -n "$ac_pt_PKG_CONFIG"; then
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
|
||||
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
|
||||
-else
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
-$as_echo "no" >&6; }
|
||||
-fi
|
||||
-
|
||||
- if test "x$ac_pt_PKG_CONFIG" = x; then
|
||||
- PKG_CONFIG=""
|
||||
- else
|
||||
- case $cross_compiling:$ac_tool_warned in
|
||||
-yes:)
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
-ac_tool_warned=yes ;;
|
||||
-esac
|
||||
- PKG_CONFIG=$ac_pt_PKG_CONFIG
|
||||
- fi
|
||||
-else
|
||||
- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
|
||||
-fi
|
||||
-
|
||||
-fi
|
||||
-if test -n "$PKG_CONFIG"; then
|
||||
- _pkg_min_version=0.9.0
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
|
||||
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
|
||||
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
-$as_echo "yes" >&6; }
|
||||
- else
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
-$as_echo "no" >&6; }
|
||||
- PKG_CONFIG=""
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
pkg_failed=no
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
|
||||
-$as_echo_n "checking for RPM... " >&6; }
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpm" >&5
|
||||
+$as_echo_n "checking for rpm... " >&6; }
|
||||
|
||||
if test -n "$RPM_CFLAGS"; then
|
||||
pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
|
||||
@@ -18437,6 +18314,30 @@ fi
|
||||
pkg_failed=untried
|
||||
fi
|
||||
|
||||
+if test $pkg_failed = no; then
|
||||
+ pkg_save_LDFLAGS="$LDFLAGS"
|
||||
+ LDFLAGS="$LDFLAGS $pkg_cv_RPM_LIBS"
|
||||
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+
|
||||
+else
|
||||
+ pkg_failed=yes
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+ LDFLAGS=$pkg_save_LDFLAGS
|
||||
+fi
|
||||
+
|
||||
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
@@ -18531,7 +18432,7 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
|
||||
LIBS="$LIBS $RPM_LIBS"
|
||||
else
|
||||
if $RPM_REQUIRE; then
|
||||
- as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
|
||||
+ as_fn_error $? "$RPM_PKG_ERRORS" "$LINENO" 5
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
|
||||
$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
|
||||
@@ -21164,6 +21065,7 @@ if test x"$prefer_curses" = xyes; then
|
||||
# search /usr/local/include, if ncurses is installed in /usr/local. A
|
||||
# default installation of ncurses on alpha*-dec-osf* will lead to such
|
||||
# a situation.
|
||||
+ # Fedora: Force libncursesw over libncurses to match the includes.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
|
||||
$as_echo_n "checking for library containing waddstr... " >&6; }
|
||||
if ${ac_cv_search_waddstr+:} false; then :
|
||||
@@ -21188,7 +21090,7 @@ return waddstr ();
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
-for ac_lib in '' ncursesw ncurses cursesX curses; do
|
||||
+for ac_lib in '' ncursesw; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
@@ -21260,6 +21162,7 @@ case $host_os in
|
||||
esac
|
||||
|
||||
# These are the libraries checked by Readline.
|
||||
+# Fedora: Force libncursesw over libncurses to match the includes.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
|
||||
$as_echo_n "checking for library containing tgetent... " >&6; }
|
||||
if ${ac_cv_search_tgetent+:} false; then :
|
||||
@@ -21284,7 +21187,7 @@ return tgetent ();
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
-for ac_lib in '' termcap tinfow tinfo curses ncursesw ncurses; do
|
||||
+for ac_lib in '' ncursesw; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
diff --git a/gdb/configure.ac b/gdb/configure.ac
|
||||
--- a/gdb/configure.ac
|
||||
+++ b/gdb/configure.ac
|
||||
@@ -749,7 +749,8 @@ if test x"$prefer_curses" = xyes; then
|
||||
# search /usr/local/include, if ncurses is installed in /usr/local. A
|
||||
# default installation of ncurses on alpha*-dec-osf* will lead to such
|
||||
# a situation.
|
||||
- AC_SEARCH_LIBS(waddstr, [ncursesw ncurses cursesX curses],
|
||||
+ # Fedora: Force libncursesw over libncurses to match the includes.
|
||||
+ AC_SEARCH_LIBS(waddstr, [ncursesw],
|
||||
[curses_found=yes
|
||||
AC_DEFINE([HAVE_LIBCURSES], [1],
|
||||
[Define to 1 if curses is enabled.])
|
||||
@@ -789,7 +790,8 @@ case $host_os in
|
||||
esac
|
||||
|
||||
# These are the libraries checked by Readline.
|
||||
-AC_SEARCH_LIBS(tgetent, [termcap tinfow tinfo curses ncursesw ncurses])
|
||||
+# Fedora: Force libncursesw over libncurses to match the includes.
|
||||
+AC_SEARCH_LIBS(tgetent, [ncursesw])
|
||||
|
||||
if test "$ac_cv_search_tgetent" = no; then
|
||||
CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
|
@ -1,42 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Wed, 17 Jan 2024 12:53:53 -0700
|
||||
Subject: gdb-ftbs-swapped-calloc-args.patch
|
||||
|
||||
Backport upstream commit 54195469c18ec9873cc5ba6907f768509473fa9b
|
||||
which fixes a build problem in which arguments to calloc were swapped.
|
||||
|
||||
[opcodes] ARC + PPC: Fix -Walloc-size warnings
|
||||
|
||||
Recently, -Walloc-size warnings started to kick in. Fix these two
|
||||
calloc() calls to match the intended usage pattern.
|
||||
|
||||
opcodes/ChangeLog:
|
||||
|
||||
* arc-dis.c (init_arc_disasm_info): Fix calloc() call.
|
||||
* ppc-dis.c (powerpc_init_dialect): Ditto.
|
||||
|
||||
diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c
|
||||
--- a/opcodes/arc-dis.c
|
||||
+++ b/opcodes/arc-dis.c
|
||||
@@ -147,7 +147,7 @@ static bool
|
||||
init_arc_disasm_info (struct disassemble_info *info)
|
||||
{
|
||||
struct arc_disassemble_info *arc_infop
|
||||
- = calloc (sizeof (*arc_infop), 1);
|
||||
+ = calloc (1, sizeof (*arc_infop));
|
||||
|
||||
if (arc_infop == NULL)
|
||||
return false;
|
||||
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
|
||||
--- a/opcodes/ppc-dis.c
|
||||
+++ b/opcodes/ppc-dis.c
|
||||
@@ -348,7 +348,7 @@ powerpc_init_dialect (struct disassemble_info *info)
|
||||
{
|
||||
ppc_cpu_t dialect = 0;
|
||||
ppc_cpu_t sticky = 0;
|
||||
- struct dis_private *priv = calloc (sizeof (*priv), 1);
|
||||
+ struct dis_private *priv = calloc (1, sizeof (*priv));
|
||||
|
||||
if (priv == NULL)
|
||||
return;
|
@ -1,132 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-glibc-strstr-workaround.patch
|
||||
|
||||
;; Workaround PR libc/14166 for inferior calls of strstr.
|
||||
;;=fedoratest: Compatibility with RHELs (unchecked which ones).
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
|
||||
@@ -0,0 +1,119 @@
|
||||
+# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Workaround for:
|
||||
+# invalid IFUNC DW_AT_linkage_name: memmove strstr time
|
||||
+# http://sourceware.org/bugzilla/show_bug.cgi?id=14166
|
||||
+
|
||||
+if {[skip_shlib_tests]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "gnu-ifunc-strstr-workaround"
|
||||
+set executable ${testfile}
|
||||
+set srcfile start.c
|
||||
+set binfile [standard_output_file ${executable}]
|
||||
+
|
||||
+if [prepare_for_testing ${testfile}.exp $executable $srcfile] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if ![runto_main] {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set test "ptype atoi"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "type = int \\(const char \\*\\)\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "type = int \\(\\)\r\n$gdb_prompt $" {
|
||||
+ untested "$test (no DWARF)"
|
||||
+ return 0
|
||||
+ }
|
||||
+ -re "type = <unknown return type> \\(\\)\r\n$gdb_prompt $" {
|
||||
+ untested "$test (no DWARF)"
|
||||
+ return 0
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set addr ""
|
||||
+set test "print strstr"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} (0x\[0-9a-f\]+) <strstr>\r\n$gdb_prompt $" {
|
||||
+ set addr $expect_out(1,string)
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} (0x\[0-9a-f\]+) <__strstr>\r\n$gdb_prompt $" {
|
||||
+ set addr $expect_out(1,string)
|
||||
+ pass "$test (GDB workaround)"
|
||||
+ }
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} (0x\[0-9a-f\]+) <__libc_strstr>\r\n$gdb_prompt $" {
|
||||
+ set addr $expect_out(1,string)
|
||||
+ pass "$test (fixed glibc)"
|
||||
+ }
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} (0x\[0-9a-f\]+) <__libc_strstr_ifunc>\r\n$gdb_prompt $" {
|
||||
+ set addr $expect_out(1,string)
|
||||
+ pass "$test (fixed glibc)"
|
||||
+ }
|
||||
+ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ <strstr>\r\n$gdb_prompt $" {
|
||||
+ untested "$test (gnu-ifunc not in use by glibc)"
|
||||
+ return 0
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set test "info sym"
|
||||
+gdb_test_multiple "info sym $addr" $test {
|
||||
+ -re "strstr in section \\.text of /lib\[^/\]*/libc.so.6\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ <strstr>\r\n$gdb_prompt $" {
|
||||
+ # unexpected
|
||||
+ xfail "$test (not in libc.so.6)"
|
||||
+ return 0
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set test "info addr strstr"
|
||||
+gdb_test_multiple $test $test {
|
||||
+ -re "Symbol \"strstr\" is a function at address $addr\\.\r\n$gdb_prompt $" {
|
||||
+ fail "$test (DWARF for strstr)"
|
||||
+ }
|
||||
+ -re "Symbol \"strstr\" is at $addr in a file compiled without debugging\\.\r\n$gdb_prompt $" {
|
||||
+ pass "$test"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+set test "print strstr second time"
|
||||
+gdb_test_multiple "print strstr" $test {
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} $addr <strstr>\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} $addr <__strstr>\r\n$gdb_prompt $" {
|
||||
+ pass "$test (GDB workaround)"
|
||||
+ }
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} $addr <__libc_strstr>\r\n$gdb_prompt $" {
|
||||
+ pass "$test (fixed glibc)"
|
||||
+ }
|
||||
+ -re " = {<text gnu-indirect-function variable, no debug info>} $addr <__libc_strstr_ifunc>\r\n$gdb_prompt $" {
|
||||
+ pass "$test (fixed glibc)"
|
||||
+ }
|
||||
+ -re " = {void \\*\\(void\\)} 0x\[0-9a-f\]+ <strstr>\r\n$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test {print (char *)strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
|
||||
+gdb_test {print (char *)strstr("def","e")} { = 0x[0-9a-f]+ "ef"}
|
@ -1,226 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-linux_perf-bundle.patch
|
||||
|
||||
;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
|
||||
;;=fedora
|
||||
|
||||
diff --git a/gdb/gdb.c b/gdb/gdb.c
|
||||
--- a/gdb/gdb.c
|
||||
+++ b/gdb/gdb.c
|
||||
@@ -21,6 +21,10 @@
|
||||
#include "interps.h"
|
||||
#include "run-on-main-thread.h"
|
||||
|
||||
+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
|
||||
+extern "C" void __libipt_init(void);
|
||||
+#endif
|
||||
+
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
@@ -32,6 +36,10 @@ main (int argc, char **argv)
|
||||
|
||||
struct captured_main_args args;
|
||||
|
||||
+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
|
||||
+ __libipt_init();
|
||||
+#endif
|
||||
+
|
||||
memset (&args, 0, sizeof args);
|
||||
args.argc = argc;
|
||||
args.argv = argv;
|
||||
diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h
|
||||
--- a/gdb/nat/linux-btrace.h
|
||||
+++ b/gdb/nat/linux-btrace.h
|
||||
@@ -28,6 +28,177 @@
|
||||
# include <linux/perf_event.h>
|
||||
#endif
|
||||
|
||||
+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
|
||||
+#ifndef HAVE_LINUX_PERF_EVENT_H
|
||||
+# error "PERF_ATTR_SIZE_VER5_BUNDLE && !HAVE_LINUX_PERF_EVENT_H"
|
||||
+#endif
|
||||
+#ifndef PERF_ATTR_SIZE_VER5
|
||||
+#define PERF_ATTR_SIZE_VER5
|
||||
+#define perf_event_mmap_page perf_event_mmap_page_bundle
|
||||
+// kernel-headers-3.10.0-493.el7.x86_64/usr/include/linux/perf_event.h
|
||||
+/*
|
||||
+ * Structure of the page that can be mapped via mmap
|
||||
+ */
|
||||
+struct perf_event_mmap_page {
|
||||
+ __u32 version; /* version number of this structure */
|
||||
+ __u32 compat_version; /* lowest version this is compat with */
|
||||
+
|
||||
+ /*
|
||||
+ * Bits needed to read the hw events in user-space.
|
||||
+ *
|
||||
+ * u32 seq, time_mult, time_shift, index, width;
|
||||
+ * u64 count, enabled, running;
|
||||
+ * u64 cyc, time_offset;
|
||||
+ * s64 pmc = 0;
|
||||
+ *
|
||||
+ * do {
|
||||
+ * seq = pc->lock;
|
||||
+ * barrier()
|
||||
+ *
|
||||
+ * enabled = pc->time_enabled;
|
||||
+ * running = pc->time_running;
|
||||
+ *
|
||||
+ * if (pc->cap_usr_time && enabled != running) {
|
||||
+ * cyc = rdtsc();
|
||||
+ * time_offset = pc->time_offset;
|
||||
+ * time_mult = pc->time_mult;
|
||||
+ * time_shift = pc->time_shift;
|
||||
+ * }
|
||||
+ *
|
||||
+ * index = pc->index;
|
||||
+ * count = pc->offset;
|
||||
+ * if (pc->cap_user_rdpmc && index) {
|
||||
+ * width = pc->pmc_width;
|
||||
+ * pmc = rdpmc(index - 1);
|
||||
+ * }
|
||||
+ *
|
||||
+ * barrier();
|
||||
+ * } while (pc->lock != seq);
|
||||
+ *
|
||||
+ * NOTE: for obvious reason this only works on self-monitoring
|
||||
+ * processes.
|
||||
+ */
|
||||
+ __u32 lock; /* seqlock for synchronization */
|
||||
+ __u32 index; /* hardware event identifier */
|
||||
+ __s64 offset; /* add to hardware event value */
|
||||
+ __u64 time_enabled; /* time event active */
|
||||
+ __u64 time_running; /* time event on cpu */
|
||||
+ union {
|
||||
+ __u64 capabilities;
|
||||
+ struct {
|
||||
+ __u64 cap_bit0 : 1, /* Always 0, deprecated, see commit 860f085b74e9 */
|
||||
+ cap_bit0_is_deprecated : 1, /* Always 1, signals that bit 0 is zero */
|
||||
+
|
||||
+ cap_user_rdpmc : 1, /* The RDPMC instruction can be used to read counts */
|
||||
+ cap_user_time : 1, /* The time_* fields are used */
|
||||
+ cap_user_time_zero : 1, /* The time_zero field is used */
|
||||
+ cap_____res : 59;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ /*
|
||||
+ * If cap_user_rdpmc this field provides the bit-width of the value
|
||||
+ * read using the rdpmc() or equivalent instruction. This can be used
|
||||
+ * to sign extend the result like:
|
||||
+ *
|
||||
+ * pmc <<= 64 - width;
|
||||
+ * pmc >>= 64 - width; // signed shift right
|
||||
+ * count += pmc;
|
||||
+ */
|
||||
+ __u16 pmc_width;
|
||||
+
|
||||
+ /*
|
||||
+ * If cap_usr_time the below fields can be used to compute the time
|
||||
+ * delta since time_enabled (in ns) using rdtsc or similar.
|
||||
+ *
|
||||
+ * u64 quot, rem;
|
||||
+ * u64 delta;
|
||||
+ *
|
||||
+ * quot = (cyc >> time_shift);
|
||||
+ * rem = cyc & (((u64)1 << time_shift) - 1);
|
||||
+ * delta = time_offset + quot * time_mult +
|
||||
+ * ((rem * time_mult) >> time_shift);
|
||||
+ *
|
||||
+ * Where time_offset,time_mult,time_shift and cyc are read in the
|
||||
+ * seqcount loop described above. This delta can then be added to
|
||||
+ * enabled and possible running (if index), improving the scaling:
|
||||
+ *
|
||||
+ * enabled += delta;
|
||||
+ * if (index)
|
||||
+ * running += delta;
|
||||
+ *
|
||||
+ * quot = count / running;
|
||||
+ * rem = count % running;
|
||||
+ * count = quot * enabled + (rem * enabled) / running;
|
||||
+ */
|
||||
+ __u16 time_shift;
|
||||
+ __u32 time_mult;
|
||||
+ __u64 time_offset;
|
||||
+ /*
|
||||
+ * If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated
|
||||
+ * from sample timestamps.
|
||||
+ *
|
||||
+ * time = timestamp - time_zero;
|
||||
+ * quot = time / time_mult;
|
||||
+ * rem = time % time_mult;
|
||||
+ * cyc = (quot << time_shift) + (rem << time_shift) / time_mult;
|
||||
+ *
|
||||
+ * And vice versa:
|
||||
+ *
|
||||
+ * quot = cyc >> time_shift;
|
||||
+ * rem = cyc & (((u64)1 << time_shift) - 1);
|
||||
+ * timestamp = time_zero + quot * time_mult +
|
||||
+ * ((rem * time_mult) >> time_shift);
|
||||
+ */
|
||||
+ __u64 time_zero;
|
||||
+ __u32 size; /* Header size up to __reserved[] fields. */
|
||||
+
|
||||
+ /*
|
||||
+ * Hole for extension of the self monitor capabilities
|
||||
+ */
|
||||
+
|
||||
+ __u8 __reserved[118*8+4]; /* align to 1k. */
|
||||
+
|
||||
+ /*
|
||||
+ * Control data for the mmap() data buffer.
|
||||
+ *
|
||||
+ * User-space reading the @data_head value should issue an smp_rmb(),
|
||||
+ * after reading this value.
|
||||
+ *
|
||||
+ * When the mapping is PROT_WRITE the @data_tail value should be
|
||||
+ * written by userspace to reflect the last read data, after issueing
|
||||
+ * an smp_mb() to separate the data read from the ->data_tail store.
|
||||
+ * In this case the kernel will not over-write unread data.
|
||||
+ *
|
||||
+ * See perf_output_put_handle() for the data ordering.
|
||||
+ *
|
||||
+ * data_{offset,size} indicate the location and size of the perf record
|
||||
+ * buffer within the mmapped area.
|
||||
+ */
|
||||
+ __u64 data_head; /* head in the data section */
|
||||
+ __u64 data_tail; /* user-space written tail */
|
||||
+ __u64 data_offset; /* where the buffer starts */
|
||||
+ __u64 data_size; /* data buffer size */
|
||||
+
|
||||
+ /*
|
||||
+ * AUX area is defined by aux_{offset,size} fields that should be set
|
||||
+ * by the userspace, so that
|
||||
+ *
|
||||
+ * aux_offset >= data_offset + data_size
|
||||
+ *
|
||||
+ * prior to mmap()ing it. Size of the mmap()ed area should be aux_size.
|
||||
+ *
|
||||
+ * Ring buffer pointers aux_{head,tail} have the same semantics as
|
||||
+ * data_{head,tail} and same ordering rules apply.
|
||||
+ */
|
||||
+ __u64 aux_head;
|
||||
+ __u64 aux_tail;
|
||||
+ __u64 aux_offset;
|
||||
+ __u64 aux_size;
|
||||
+};
|
||||
+#endif // PERF_ATTR_SIZE_VER5
|
||||
+#endif // PERF_ATTR_SIZE_VER5_BUNDLE
|
||||
+
|
||||
struct target_ops;
|
||||
|
||||
#if HAVE_LINUX_PERF_EVENT_H
|
||||
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
|
||||
--- a/gdbsupport/common.m4
|
||||
+++ b/gdbsupport/common.m4
|
||||
@@ -168,7 +168,7 @@ AC_DEFUN([GDB_AC_COMMON], [
|
||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <linux/perf_event.h>
|
||||
#ifndef PERF_ATTR_SIZE_VER5
|
||||
- # error
|
||||
+ // error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
|
||||
#endif
|
||||
]])], [perf_event=yes], [perf_event=no])
|
||||
if test "$perf_event" != yes; then
|
@ -1,264 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Sat, 25 Nov 2023 10:35:37 +0000
|
||||
Subject: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch
|
||||
|
||||
;; Back-port upstream commit acc117b57f7 as part of a fix for
|
||||
;; non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
|
||||
gdb: C++-ify mapped_symtab from dwarf2/index-write.c
|
||||
|
||||
Make static the functions add_index_entry, find_slot, and hash_expand,
|
||||
member functions of the mapped_symtab class.
|
||||
|
||||
Fold an additional snippet of code from write_gdbindex into
|
||||
mapped_symtab::minimize, this code relates to minimisation, so this
|
||||
seems like a good home for it.
|
||||
|
||||
Make the n_elements, data, and m_string_obstack member variables of
|
||||
mapped_symtab private. Provide a new obstack() member function to
|
||||
provide access to the obstack when needed, and also add member
|
||||
functions begin(), end(), cbegin(), and cend() so that the
|
||||
mapped_symtab class can be treated like a contained and iterated
|
||||
over.
|
||||
|
||||
I've also taken this opportunity to split out the logic for whether
|
||||
the hash table (m_data) needs expanding, this is the new function
|
||||
hash_needs_expanding. This will be useful in a later commit.
|
||||
|
||||
There should be no user visible changes after this commit.
|
||||
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
|
||||
--- a/gdb/dwarf2/index-write.c
|
||||
+++ b/gdb/dwarf2/index-write.c
|
||||
@@ -187,86 +187,135 @@ struct mapped_symtab
|
||||
{
|
||||
mapped_symtab ()
|
||||
{
|
||||
- data.resize (1024);
|
||||
+ m_data.resize (1024);
|
||||
}
|
||||
|
||||
- /* Minimize each entry in the symbol table, removing duplicates. */
|
||||
+ /* If there are no elements in the symbol table, then reduce the table
|
||||
+ size to zero. Otherwise call symtab_index_entry::minimize each entry
|
||||
+ in the symbol table. */
|
||||
+
|
||||
void minimize ()
|
||||
{
|
||||
- for (symtab_index_entry &item : data)
|
||||
+ if (m_element_count == 0)
|
||||
+ m_data.resize (0);
|
||||
+
|
||||
+ for (symtab_index_entry &item : m_data)
|
||||
item.minimize ();
|
||||
}
|
||||
|
||||
- offset_type n_elements = 0;
|
||||
- std::vector<symtab_index_entry> data;
|
||||
+ /* Add an entry to SYMTAB. NAME is the name of the symbol. CU_INDEX is
|
||||
+ the index of the CU in which the symbol appears. IS_STATIC is one if
|
||||
+ the symbol is static, otherwise zero (global). */
|
||||
+
|
||||
+ void add_index_entry (const char *name, int is_static,
|
||||
+ gdb_index_symbol_kind kind, offset_type cu_index);
|
||||
+
|
||||
+ /* Access the obstack. */
|
||||
+ struct obstack *obstack ()
|
||||
+ { return &m_string_obstack; }
|
||||
+
|
||||
+private:
|
||||
+
|
||||
+ /* Find a slot in SYMTAB for the symbol NAME. Returns a reference to
|
||||
+ the slot.
|
||||
+
|
||||
+ Function is used only during write_hash_table so no index format
|
||||
+ backward compatibility is needed. */
|
||||
+
|
||||
+ symtab_index_entry &find_slot (const char *name);
|
||||
+
|
||||
+ /* Expand SYMTAB's hash table. */
|
||||
+
|
||||
+ void hash_expand ();
|
||||
+
|
||||
+ /* Return true if the hash table in data needs to grow. */
|
||||
+
|
||||
+ bool hash_needs_expanding () const
|
||||
+ { return 4 * m_element_count / 3 >= m_data.size (); }
|
||||
+
|
||||
+ /* A vector that is used as a hash table. */
|
||||
+ std::vector<symtab_index_entry> m_data;
|
||||
+
|
||||
+ /* The number of elements stored in the m_data hash. */
|
||||
+ offset_type m_element_count = 0;
|
||||
|
||||
/* Temporary storage for names. */
|
||||
auto_obstack m_string_obstack;
|
||||
-};
|
||||
|
||||
-/* Find a slot in SYMTAB for the symbol NAME. Returns a reference to
|
||||
- the slot.
|
||||
+public:
|
||||
+ using iterator = decltype (m_data)::iterator;
|
||||
+ using const_iterator = decltype (m_data)::const_iterator;
|
||||
|
||||
- Function is used only during write_hash_table so no index format backward
|
||||
- compatibility is needed. */
|
||||
+ iterator begin ()
|
||||
+ { return m_data.begin (); }
|
||||
|
||||
-static symtab_index_entry &
|
||||
-find_slot (struct mapped_symtab *symtab, const char *name)
|
||||
+ iterator end ()
|
||||
+ { return m_data.end (); }
|
||||
+
|
||||
+ const_iterator cbegin ()
|
||||
+ { return m_data.cbegin (); }
|
||||
+
|
||||
+ const_iterator cend ()
|
||||
+ { return m_data.cend (); }
|
||||
+};
|
||||
+
|
||||
+/* See class definition. */
|
||||
+
|
||||
+symtab_index_entry &
|
||||
+mapped_symtab::find_slot (const char *name)
|
||||
{
|
||||
offset_type index, step, hash = mapped_index_string_hash (INT_MAX, name);
|
||||
|
||||
- index = hash & (symtab->data.size () - 1);
|
||||
- step = ((hash * 17) & (symtab->data.size () - 1)) | 1;
|
||||
+ index = hash & (m_data.size () - 1);
|
||||
+ step = ((hash * 17) & (m_data.size () - 1)) | 1;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
- if (symtab->data[index].name == NULL
|
||||
- || strcmp (name, symtab->data[index].name) == 0)
|
||||
- return symtab->data[index];
|
||||
- index = (index + step) & (symtab->data.size () - 1);
|
||||
+ if (m_data[index].name == NULL
|
||||
+ || strcmp (name, m_data[index].name) == 0)
|
||||
+ return m_data[index];
|
||||
+ index = (index + step) & (m_data.size () - 1);
|
||||
}
|
||||
}
|
||||
|
||||
-/* Expand SYMTAB's hash table. */
|
||||
+/* See class definition. */
|
||||
|
||||
-static void
|
||||
-hash_expand (struct mapped_symtab *symtab)
|
||||
+void
|
||||
+mapped_symtab::hash_expand ()
|
||||
{
|
||||
- auto old_entries = std::move (symtab->data);
|
||||
+ auto old_entries = std::move (m_data);
|
||||
|
||||
- symtab->data.clear ();
|
||||
- symtab->data.resize (old_entries.size () * 2);
|
||||
+ gdb_assert (m_data.size () == 0);
|
||||
+ m_data.resize (old_entries.size () * 2);
|
||||
|
||||
for (auto &it : old_entries)
|
||||
if (it.name != NULL)
|
||||
{
|
||||
- auto &ref = find_slot (symtab, it.name);
|
||||
+ auto &ref = this->find_slot (it.name);
|
||||
ref = std::move (it);
|
||||
}
|
||||
}
|
||||
|
||||
-/* Add an entry to SYMTAB. NAME is the name of the symbol.
|
||||
- CU_INDEX is the index of the CU in which the symbol appears.
|
||||
- IS_STATIC is one if the symbol is static, otherwise zero (global). */
|
||||
+/* See class definition. */
|
||||
|
||||
-static void
|
||||
-add_index_entry (struct mapped_symtab *symtab, const char *name,
|
||||
- int is_static, gdb_index_symbol_kind kind,
|
||||
- offset_type cu_index)
|
||||
+void
|
||||
+mapped_symtab::add_index_entry (const char *name, int is_static,
|
||||
+ gdb_index_symbol_kind kind,
|
||||
+ offset_type cu_index)
|
||||
{
|
||||
- symtab_index_entry *slot = &find_slot (symtab, name);
|
||||
+ symtab_index_entry *slot = &this->find_slot (name);
|
||||
if (slot->name == NULL)
|
||||
{
|
||||
/* This is a new element in the hash table. */
|
||||
- ++symtab->n_elements;
|
||||
+ ++this->m_element_count;
|
||||
|
||||
/* We might need to grow the hash table. */
|
||||
- if (4 * symtab->n_elements / 3 >= symtab->data.size ())
|
||||
+ if (this->hash_needs_expanding ())
|
||||
{
|
||||
- hash_expand (symtab);
|
||||
+ this->hash_expand ();
|
||||
|
||||
/* This element will have a different slot in the new table. */
|
||||
- slot = &find_slot (symtab, name);
|
||||
+ slot = &this->find_slot (name);
|
||||
|
||||
/* But it should still be a new element in the hash table. */
|
||||
gdb_assert (slot->name == nullptr);
|
||||
@@ -387,7 +436,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool)
|
||||
|
||||
/* We add all the index vectors to the constant pool first, to
|
||||
ensure alignment is ok. */
|
||||
- for (symtab_index_entry &entry : symtab->data)
|
||||
+ for (symtab_index_entry &entry : *symtab)
|
||||
{
|
||||
if (entry.name == NULL)
|
||||
continue;
|
||||
@@ -416,7 +465,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool)
|
||||
|
||||
/* Now write out the hash table. */
|
||||
std::unordered_map<c_str_view, offset_type, c_str_view_hasher> str_table;
|
||||
- for (const auto &entry : symtab->data)
|
||||
+ for (const auto &entry : *symtab)
|
||||
{
|
||||
offset_type str_off, vec_off;
|
||||
|
||||
@@ -1151,7 +1200,7 @@ write_cooked_index (cooked_index *table,
|
||||
const auto it = cu_index_htab.find (entry->per_cu);
|
||||
gdb_assert (it != cu_index_htab.cend ());
|
||||
|
||||
- const char *name = entry->full_name (&symtab->m_string_obstack);
|
||||
+ const char *name = entry->full_name (symtab->obstack ());
|
||||
|
||||
if (entry->per_cu->lang () == language_ada)
|
||||
{
|
||||
@@ -1159,7 +1208,7 @@ write_cooked_index (cooked_index *table,
|
||||
gdb, it has to use the encoded name, with any
|
||||
suffixes stripped. */
|
||||
std::string encoded = ada_encode (name, false);
|
||||
- name = obstack_strdup (&symtab->m_string_obstack,
|
||||
+ name = obstack_strdup (symtab->obstack (),
|
||||
encoded.c_str ());
|
||||
}
|
||||
else if (entry->per_cu->lang () == language_cplus
|
||||
@@ -1191,8 +1240,8 @@ write_cooked_index (cooked_index *table,
|
||||
else
|
||||
kind = GDB_INDEX_SYMBOL_KIND_TYPE;
|
||||
|
||||
- add_index_entry (symtab, name, (entry->flags & IS_STATIC) != 0,
|
||||
- kind, it->second);
|
||||
+ symtab->add_index_entry (name, (entry->flags & IS_STATIC) != 0,
|
||||
+ kind, it->second);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1267,8 +1316,6 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table,
|
||||
symtab.minimize ();
|
||||
|
||||
data_buf symtab_vec, constant_pool;
|
||||
- if (symtab.n_elements == 0)
|
||||
- symtab.data.resize (0);
|
||||
|
||||
write_hash_table (&symtab, symtab_vec, constant_pool);
|
||||
|
@ -1,101 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Mon, 27 Nov 2023 13:19:39 +0000
|
||||
Subject: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
|
||||
|
||||
;; Back-port upstream commit 3644f41dc80 as part of a fix for
|
||||
;; non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
|
||||
gdb: generate dwarf-5 index identically as worker-thread count changes
|
||||
|
||||
Similar to the previous commit, this commit ensures that the dwarf-5
|
||||
index files are generated identically as the number of worker-threads
|
||||
changes.
|
||||
|
||||
Building the dwarf-5 index makes use of a closed hash table, the
|
||||
bucket_hash local within debug_names::build(). Entries are added to
|
||||
bucket_hash from m_name_to_value_set, which, in turn, is populated
|
||||
by calls to debug_names::insert() in write_debug_names. The insert
|
||||
calls are ordered based on the entries within the cooked_index, and
|
||||
the ordering within cooked_index depends on the number of worker
|
||||
threads that GDB is using.
|
||||
|
||||
My proposal is to sort each chain within the bucket_hash closed hash
|
||||
table prior to using this to build the dwarf-5 index.
|
||||
|
||||
The buckets within bucket_hash will always have the same ordering (for
|
||||
a given GDB build with a given executable), and by sorting the chains
|
||||
within each bucket, we can be sure that GDB will see each entry in a
|
||||
deterministic order.
|
||||
|
||||
I've extended the index creation test to cover this case.
|
||||
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
|
||||
--- a/gdb/dwarf2/index-write.c
|
||||
+++ b/gdb/dwarf2/index-write.c
|
||||
@@ -452,6 +452,11 @@ class c_str_view
|
||||
return strcmp (m_cstr, other.m_cstr) == 0;
|
||||
}
|
||||
|
||||
+ bool operator< (const c_str_view &other) const
|
||||
+ {
|
||||
+ return strcmp (m_cstr, other.m_cstr) < 0;
|
||||
+ }
|
||||
+
|
||||
/* Return the underlying C string. Note, the returned string is
|
||||
only a reference with lifetime of this object. */
|
||||
const char *c_str () const
|
||||
@@ -771,10 +776,18 @@ class debug_names
|
||||
}
|
||||
for (size_t bucket_ix = 0; bucket_ix < bucket_hash.size (); ++bucket_ix)
|
||||
{
|
||||
- const std::forward_list<hash_it_pair> &hashitlist
|
||||
- = bucket_hash[bucket_ix];
|
||||
+ std::forward_list<hash_it_pair> &hashitlist = bucket_hash[bucket_ix];
|
||||
if (hashitlist.empty ())
|
||||
continue;
|
||||
+
|
||||
+ /* Sort the items within each bucket. This ensures that the
|
||||
+ generated index files will be the same no matter the order in
|
||||
+ which symbols were added into the index. */
|
||||
+ hashitlist.sort ([] (const hash_it_pair &a, const hash_it_pair &b)
|
||||
+ {
|
||||
+ return a.it->first < b.it->first;
|
||||
+ });
|
||||
+
|
||||
uint32_t &bucket_slot = m_bucket_table[bucket_ix];
|
||||
/* The hashes array is indexed starting at 1. */
|
||||
store_unsigned_integer (reinterpret_cast<gdb_byte *> (&bucket_slot),
|
||||
diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp
|
||||
--- a/gdb/testsuite/gdb.gdb/index-file.exp
|
||||
+++ b/gdb/testsuite/gdb.gdb/index-file.exp
|
||||
@@ -47,6 +47,9 @@ remote_exec host "mkdir -p ${dir1}"
|
||||
with_timeout_factor $timeout_factor {
|
||||
gdb_test_no_output "save gdb-index $dir1" \
|
||||
"create gdb-index file"
|
||||
+
|
||||
+ gdb_test_no_output "save gdb-index -dwarf-5 $dir1" \
|
||||
+ "create dwarf-index files"
|
||||
}
|
||||
|
||||
# Close GDB.
|
||||
@@ -143,13 +146,16 @@ if { $worker_threads > 1 } {
|
||||
with_timeout_factor $timeout_factor {
|
||||
gdb_test_no_output "save gdb-index $dir2" \
|
||||
"create second gdb-index file"
|
||||
+
|
||||
+ gdb_test_no_output "save gdb-index -dwarf-5 $dir2" \
|
||||
+ "create second dwarf-index files"
|
||||
}
|
||||
|
||||
# Close GDB.
|
||||
gdb_exit
|
||||
|
||||
# Now check that the index files are identical.
|
||||
- foreach suffix { gdb-index } {
|
||||
+ foreach suffix { gdb-index debug_names debug_str } {
|
||||
set result \
|
||||
[remote_exec host \
|
||||
"cmp -s \"$dir1/${index_filename_base}.${suffix}\" \"$dir2/${index_filename_base}.${suffix}\""]
|
@ -1,230 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Fri, 24 Nov 2023 12:04:36 +0000
|
||||
Subject: gdb-rhbz-2232086-generate-gdb-index-consistently.patch
|
||||
|
||||
;; Back-port upstream commit aff250145af as part of a fix for
|
||||
;; non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
|
||||
gdb: generate gdb-index identically regardless of work thread count
|
||||
|
||||
It was observed that changing the number of worker threads that GDB
|
||||
uses (maintenance set worker-threads NUM) would have an impact on the
|
||||
layout of the generated gdb-index.
|
||||
|
||||
The cause seems to be how the CU are distributed between threads, and
|
||||
then symbols that appear in multiple CU can be encountered earlier or
|
||||
later depending on whether a particular CU moves between threads.
|
||||
|
||||
I certainly found this behaviour was reproducible when generating an
|
||||
index for GDB itself, like:
|
||||
|
||||
gdb -q -nx -nh -batch \
|
||||
-eiex 'maint set worker-threads NUM' \
|
||||
-ex 'save gdb-index /tmp/'
|
||||
|
||||
And then setting different values for NUM will change the generated
|
||||
index.
|
||||
|
||||
Now, the question is: does this matter?
|
||||
|
||||
I would like to suggest that yes, this does matter. At Red Hat we
|
||||
generate a gdb-index as part of the build process, and we would
|
||||
ideally like to have reproducible builds: for the same source,
|
||||
compiled with the same tool-chain, we should get the exact same output
|
||||
binary. And we do .... except for the index.
|
||||
|
||||
Now we could simply force GDB to only use a single worker thread when
|
||||
we build the index, but, I don't think the idea of reproducible builds
|
||||
is that strange, so I think we should ensure that our generated
|
||||
indexes are always reproducible.
|
||||
|
||||
To achieve this, I propose that we add an extra step when building the
|
||||
gdb-index file. After constructing the initial symbol hash table
|
||||
contents, we will pull all the symbols out of the hash, sort them,
|
||||
then re-insert them in sorted order. This will ensure that the
|
||||
structure of the generated hash will remain consistent (given the same
|
||||
set of symbols).
|
||||
|
||||
I've extended the existing index-file test to check that the generated
|
||||
index doesn't change if we adjust the number of worker threads used.
|
||||
Given that this test is already rather slow, I've only made one change
|
||||
to the worker-thread count. Maybe this test should be changed to use
|
||||
a smaller binary, which is quicker to load, and for which we could
|
||||
then try many different worker thread counts.
|
||||
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
|
||||
--- a/gdb/dwarf2/index-write.c
|
||||
+++ b/gdb/dwarf2/index-write.c
|
||||
@@ -210,6 +210,13 @@ struct mapped_symtab
|
||||
void add_index_entry (const char *name, int is_static,
|
||||
gdb_index_symbol_kind kind, offset_type cu_index);
|
||||
|
||||
+ /* When entries are originally added into the data hash the order will
|
||||
+ vary based on the number of worker threads GDB is configured to use.
|
||||
+ This function will rebuild the hash such that the final layout will be
|
||||
+ deterministic regardless of the number of worker threads used. */
|
||||
+
|
||||
+ void sort ();
|
||||
+
|
||||
/* Access the obstack. */
|
||||
struct obstack *obstack ()
|
||||
{ return &m_string_obstack; }
|
||||
@@ -296,6 +303,65 @@ mapped_symtab::hash_expand ()
|
||||
}
|
||||
}
|
||||
|
||||
+/* See mapped_symtab class declaration. */
|
||||
+
|
||||
+void mapped_symtab::sort ()
|
||||
+{
|
||||
+ /* Move contents out of this->data vector. */
|
||||
+ std::vector<symtab_index_entry> original_data = std::move (m_data);
|
||||
+
|
||||
+ /* Restore the size of m_data, this will avoid having to expand the hash
|
||||
+ table (and rehash all elements) when we reinsert after sorting.
|
||||
+ However, we do reset the element count, this allows for some sanity
|
||||
+ checking asserts during the reinsert phase. */
|
||||
+ gdb_assert (m_data.size () == 0);
|
||||
+ m_data.resize (original_data.size ());
|
||||
+ m_element_count = 0;
|
||||
+
|
||||
+ /* Remove empty entries from ORIGINAL_DATA, this makes sorting quicker. */
|
||||
+ auto it = std::remove_if (original_data.begin (), original_data.end (),
|
||||
+ [] (const symtab_index_entry &entry) -> bool
|
||||
+ {
|
||||
+ return entry.name == nullptr;
|
||||
+ });
|
||||
+ original_data.erase (it, original_data.end ());
|
||||
+
|
||||
+ /* Sort the existing contents. */
|
||||
+ std::sort (original_data.begin (), original_data.end (),
|
||||
+ [] (const symtab_index_entry &a,
|
||||
+ const symtab_index_entry &b) -> bool
|
||||
+ {
|
||||
+ /* Return true if A is before B. */
|
||||
+ gdb_assert (a.name != nullptr);
|
||||
+ gdb_assert (b.name != nullptr);
|
||||
+
|
||||
+ return strcmp (a.name, b.name) < 0;
|
||||
+ });
|
||||
+
|
||||
+ /* Re-insert each item from the sorted list. */
|
||||
+ for (auto &entry : original_data)
|
||||
+ {
|
||||
+ /* We know that ORIGINAL_DATA contains no duplicates, this data was
|
||||
+ taken from a hash table that de-duplicated entries for us, so
|
||||
+ count this as a new item.
|
||||
+
|
||||
+ As we retained the original size of m_data (see above) then we
|
||||
+ should never need to grow m_data_ during this re-insertion phase,
|
||||
+ assert that now. */
|
||||
+ ++m_element_count;
|
||||
+ gdb_assert (!this->hash_needs_expanding ());
|
||||
+
|
||||
+ /* Lookup a slot. */
|
||||
+ symtab_index_entry &slot = this->find_slot (entry.name);
|
||||
+
|
||||
+ /* As discussed above, we should not find duplicates. */
|
||||
+ gdb_assert (slot.name == nullptr);
|
||||
+
|
||||
+ /* Move this item into the slot we found. */
|
||||
+ slot = std::move (entry);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* See class definition. */
|
||||
|
||||
void
|
||||
@@ -1311,6 +1377,9 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table,
|
||||
for (auto map : table->get_addrmaps ())
|
||||
write_address_map (map, addr_vec, cu_index_htab);
|
||||
|
||||
+ /* Ensure symbol hash is built domestically. */
|
||||
+ symtab.sort ();
|
||||
+
|
||||
/* Now that we've processed all symbols we can shrink their cu_indices
|
||||
lists. */
|
||||
symtab.minimize ();
|
||||
diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp
|
||||
--- a/gdb/testsuite/gdb.gdb/index-file.exp
|
||||
+++ b/gdb/testsuite/gdb.gdb/index-file.exp
|
||||
@@ -38,6 +38,9 @@ with_timeout_factor $timeout_factor {
|
||||
clean_restart $filename
|
||||
}
|
||||
|
||||
+# Record how many worker threads GDB is using.
|
||||
+set worker_threads [gdb_get_worker_threads]
|
||||
+
|
||||
# Generate an index file.
|
||||
set dir1 [standard_output_file "index_1"]
|
||||
remote_exec host "mkdir -p ${dir1}"
|
||||
@@ -116,3 +119,41 @@ proc check_symbol_table_usage { filename } {
|
||||
|
||||
set index_filename_base [file tail $filename]
|
||||
check_symbol_table_usage "$dir1/${index_filename_base}.gdb-index"
|
||||
+
|
||||
+# If GDB is using more than 1 worker thread then reduce the number of
|
||||
+# worker threads, regenerate the index, and check that we get the same
|
||||
+# index file back. At one point the layout of the index would vary
|
||||
+# based on the number of worker threads used.
|
||||
+if { $worker_threads > 1 } {
|
||||
+ # Start GDB, but don't load a file yet.
|
||||
+ clean_restart
|
||||
+
|
||||
+ # Adjust the number of threads to use.
|
||||
+ set reduced_threads [expr $worker_threads / 2]
|
||||
+ gdb_test_no_output "maint set worker-threads $reduced_threads"
|
||||
+
|
||||
+ with_timeout_factor $timeout_factor {
|
||||
+ # Now load the test binary.
|
||||
+ gdb_file_cmd $filename
|
||||
+ }
|
||||
+
|
||||
+ # Generate an index file.
|
||||
+ set dir2 [standard_output_file "index_2"]
|
||||
+ remote_exec host "mkdir -p ${dir2}"
|
||||
+ with_timeout_factor $timeout_factor {
|
||||
+ gdb_test_no_output "save gdb-index $dir2" \
|
||||
+ "create second gdb-index file"
|
||||
+ }
|
||||
+
|
||||
+ # Close GDB.
|
||||
+ gdb_exit
|
||||
+
|
||||
+ # Now check that the index files are identical.
|
||||
+ foreach suffix { gdb-index } {
|
||||
+ set result \
|
||||
+ [remote_exec host \
|
||||
+ "cmp -s \"$dir1/${index_filename_base}.${suffix}\" \"$dir2/${index_filename_base}.${suffix}\""]
|
||||
+ gdb_assert { [lindex $result 0] == 0 } \
|
||||
+ "$suffix files are identical"
|
||||
+ }
|
||||
+}
|
||||
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
|
||||
--- a/gdb/testsuite/lib/gdb.exp
|
||||
+++ b/gdb/testsuite/lib/gdb.exp
|
||||
@@ -10033,6 +10033,21 @@ proc is_target_non_stop { {testname ""} } {
|
||||
return $is_non_stop
|
||||
}
|
||||
|
||||
+# Return the number of worker threads that GDB is currently using.
|
||||
+
|
||||
+proc gdb_get_worker_threads { {testname ""} } {
|
||||
+ set worker_threads "UNKNOWN"
|
||||
+ gdb_test_multiple "maintenance show worker-threads" $testname {
|
||||
+ -wrap -re "The number of worker threads GDB can use is unlimited \\(currently ($::decimal)\\)\\." {
|
||||
+ set worker_threads $expect_out(1,string)
|
||||
+ }
|
||||
+ -wrap -re "The number of worker threads GDB can use is ($::decimal)\\." {
|
||||
+ set worker_threads $expect_out(1,string)
|
||||
+ }
|
||||
+ }
|
||||
+ return $worker_threads
|
||||
+}
|
||||
+
|
||||
# Check if the compiler emits epilogue information associated
|
||||
# with the closing brace or with the last statement line.
|
||||
#
|
@ -1,222 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Fri, 24 Nov 2023 11:50:35 +0000
|
||||
Subject: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch
|
||||
|
||||
;; Back-port upstream commit aa19bc1d259 as part of a fix for
|
||||
;; non-deterministic gdb-index generation (RH BZ 2232086).
|
||||
|
||||
gdb: reduce size of generated gdb-index file
|
||||
|
||||
I noticed in passing that out algorithm for generating the gdb-index
|
||||
file is incorrect. When building the hash table in add_index_entry we
|
||||
count every incoming entry rehash when the number of entries gets too
|
||||
large. However, some of the incoming entries will be duplicates,
|
||||
which don't actually result in new items being added to the hash
|
||||
table.
|
||||
|
||||
As a result, we grow the gdb-index hash table far too often.
|
||||
|
||||
With an unmodified GDB, generating a gdb-index for GDB, I see a file
|
||||
size of 90M, with a hash usage (in the generated index file) of just
|
||||
2.6%.
|
||||
|
||||
With a patched GDB, generating a gdb-index for the _same_ GDB binary,
|
||||
I now see a gdb-index file size of 30M, with a hash usage of 41.9%.
|
||||
|
||||
This is a 67% reduction in gdb-index file size.
|
||||
|
||||
Obviously, not every gdb-index file is going to see such big savings,
|
||||
however, the larger a program, and the more symbols that are
|
||||
duplicated between compilation units, the more GDB would over count,
|
||||
and so, over-grow the index.
|
||||
|
||||
The gdb-index hash table we create has a minimum size of 1024, and
|
||||
then we grow the hash when it is 75% full, doubling the hash table at
|
||||
that time. Given this, then we expect that either:
|
||||
|
||||
a. The hash table is size 1024, and less than 75% full, or
|
||||
b. The hash table is between 37.5% and 75% full.
|
||||
|
||||
I've include a test that checks some of these constraints -- I've not
|
||||
bothered to check the upper limit, and over full hash table isn't
|
||||
really a problem here, but if the fill percentage is less than 37.5%
|
||||
then this indicates that we've done something wrong (obviously, I also
|
||||
check for the 1024 minimum size).
|
||||
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
|
||||
--- a/gdb/dwarf2/index-write.c
|
||||
+++ b/gdb/dwarf2/index-write.c
|
||||
@@ -254,20 +254,29 @@ add_index_entry (struct mapped_symtab *symtab, const char *name,
|
||||
int is_static, gdb_index_symbol_kind kind,
|
||||
offset_type cu_index)
|
||||
{
|
||||
- offset_type cu_index_and_attrs;
|
||||
+ symtab_index_entry *slot = &find_slot (symtab, name);
|
||||
+ if (slot->name == NULL)
|
||||
+ {
|
||||
+ /* This is a new element in the hash table. */
|
||||
+ ++symtab->n_elements;
|
||||
|
||||
- ++symtab->n_elements;
|
||||
- if (4 * symtab->n_elements / 3 >= symtab->data.size ())
|
||||
- hash_expand (symtab);
|
||||
+ /* We might need to grow the hash table. */
|
||||
+ if (4 * symtab->n_elements / 3 >= symtab->data.size ())
|
||||
+ {
|
||||
+ hash_expand (symtab);
|
||||
|
||||
- symtab_index_entry &slot = find_slot (symtab, name);
|
||||
- if (slot.name == NULL)
|
||||
- {
|
||||
- slot.name = name;
|
||||
+ /* This element will have a different slot in the new table. */
|
||||
+ slot = &find_slot (symtab, name);
|
||||
+
|
||||
+ /* But it should still be a new element in the hash table. */
|
||||
+ gdb_assert (slot->name == nullptr);
|
||||
+ }
|
||||
+
|
||||
+ slot->name = name;
|
||||
/* index_offset is set later. */
|
||||
}
|
||||
|
||||
- cu_index_and_attrs = 0;
|
||||
+ offset_type cu_index_and_attrs = 0;
|
||||
DW2_GDB_INDEX_CU_SET_VALUE (cu_index_and_attrs, cu_index);
|
||||
DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE (cu_index_and_attrs, is_static);
|
||||
DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE (cu_index_and_attrs, kind);
|
||||
@@ -279,7 +288,7 @@ add_index_entry (struct mapped_symtab *symtab, const char *name,
|
||||
the last entry pushed), but a symbol could have multiple kinds in one CU.
|
||||
To keep things simple we don't worry about the duplication here and
|
||||
sort and uniquify the list after we've processed all symbols. */
|
||||
- slot.cu_indices.push_back (cu_index_and_attrs);
|
||||
+ slot->cu_indices.push_back (cu_index_and_attrs);
|
||||
}
|
||||
|
||||
/* See symtab_index_entry. */
|
||||
diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.gdb/index-file.exp
|
||||
@@ -0,0 +1,118 @@
|
||||
+# Copyright 2023 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Load the GDB executable, and then 'save gdb-index', and make some
|
||||
+# checks of the generated index file.
|
||||
+
|
||||
+load_lib selftest-support.exp
|
||||
+
|
||||
+# Can't save an index with readnow.
|
||||
+if {[readnow]} {
|
||||
+ untested "cannot create an index when readnow is in use"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# A multiplier used to ensure slow tasks are less likely to timeout.
|
||||
+set timeout_factor 20
|
||||
+
|
||||
+set filename [selftest_prepare]
|
||||
+if { $filename eq "" } {
|
||||
+ unsupported "${gdb_test_file_name}.exp"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+with_timeout_factor $timeout_factor {
|
||||
+ # Start GDB, load FILENAME.
|
||||
+ clean_restart $filename
|
||||
+}
|
||||
+
|
||||
+# Generate an index file.
|
||||
+set dir1 [standard_output_file "index_1"]
|
||||
+remote_exec host "mkdir -p ${dir1}"
|
||||
+with_timeout_factor $timeout_factor {
|
||||
+ gdb_test_no_output "save gdb-index $dir1" \
|
||||
+ "create gdb-index file"
|
||||
+}
|
||||
+
|
||||
+# Close GDB.
|
||||
+gdb_exit
|
||||
+
|
||||
+# Validate that the index-file FILENAME has made efficient use of its
|
||||
+# symbol hash table. Calculate the number of symbols in the hash
|
||||
+# table and the total hash table size. The hash table starts with
|
||||
+# 1024 entries, and then doubles each time it is filled to 75%. At
|
||||
+# 75% filled, doubling the size takes it to 37.5% filled.
|
||||
+#
|
||||
+# Thus, the hash table is correctly filled if:
|
||||
+# 1. Its size is 1024 (i.e. it has not yet had its first doubling), or
|
||||
+# 2. Its filled percentage is over 37%
|
||||
+#
|
||||
+# We could check that it is not over filled, but I don't as that's not
|
||||
+# really an issue. But we did once have a bug where the table was
|
||||
+# doubled incorrectly, in which case we'd see a filled percentage of
|
||||
+# around 2% in some cases, which is a huge waste of disk space.
|
||||
+proc check_symbol_table_usage { filename } {
|
||||
+ # Open the file in binary mode and read-only mode.
|
||||
+ set fp [open $filename rb]
|
||||
+
|
||||
+ # Configure the channel to use binary translation.
|
||||
+ fconfigure $fp -translation binary
|
||||
+
|
||||
+ # Read the first 8 bytes of the file, which contain the header of
|
||||
+ # the index section.
|
||||
+ set header [read $fp [expr 7 * 4]]
|
||||
+
|
||||
+ # Scan the header to get the version, the CU list offset, and the
|
||||
+ # types CU list offset.
|
||||
+ binary scan $header iiiiii version \
|
||||
+ _ _ _ symbol_table_offset shortcut_offset
|
||||
+
|
||||
+ # The length of the symbol hash table (in entries).
|
||||
+ set len [expr ($shortcut_offset - $symbol_table_offset) / 8]
|
||||
+
|
||||
+ # Now walk the hash table and count how many entries are in use.
|
||||
+ set offset $symbol_table_offset
|
||||
+ set count 0
|
||||
+ while { $offset < $shortcut_offset } {
|
||||
+ seek $fp $offset
|
||||
+ set entry [read $fp 8]
|
||||
+ binary scan $entry ii name_ptr flags
|
||||
+ if { $name_ptr != 0 } {
|
||||
+ incr count
|
||||
+ }
|
||||
+
|
||||
+ incr offset 8
|
||||
+ }
|
||||
+
|
||||
+ # Close the file.
|
||||
+ close $fp
|
||||
+
|
||||
+ # Calculate how full the cache is.
|
||||
+ set pct [expr (100 * double($count)) / $len]
|
||||
+
|
||||
+ # Write our results out to the gdb.log.
|
||||
+ verbose -log "Hash table size: $len"
|
||||
+ verbose -log "Hash table entries: $count"
|
||||
+ verbose -log "Percentage usage: $pct%"
|
||||
+
|
||||
+ # The minimum fill percentage is actually 37.5%, but we give TCL a
|
||||
+ # little flexibility in case the FP maths give a result a little
|
||||
+ # off.
|
||||
+ gdb_assert { $len == 1024 || $pct > 37 } \
|
||||
+ "symbol hash table usage"
|
||||
+}
|
||||
+
|
||||
+set index_filename_base [file tail $filename]
|
||||
+check_symbol_table_usage "$dir1/${index_filename_base}.gdb-index"
|
@ -1,170 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
|
||||
|
||||
;; Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
|
||||
;;=fedoratest
|
||||
|
||||
Original message by Tom Tromey:
|
||||
|
||||
<https://sourceware.org/ml/gdb-patches/2012-03/msg00955.html>
|
||||
Message-ID: <871uoc1va3.fsf@fleche.redhat.com>
|
||||
|
||||
Comment from Sergio Durigan Junior:
|
||||
|
||||
In order to correctly test this patch, I wrote a testcase based on Jan
|
||||
Kratochvil's <gdb/testsuite/gdb.base/gcore-excessive-memory.exp>. The
|
||||
testcase, which can be seen below, tests GDB in order to see if the
|
||||
amount of memory being leaked is minimal, as requested in the bugzilla.
|
||||
It is hard to define what "minimum" is, so I ran the testcase on all
|
||||
supported RHEL architectures and came up with an average.
|
||||
|
||||
commit cc0265cdda9dc7e8665e8bfcf5b4477489daf27c
|
||||
Author: Tom Tromey <tromey@redhat.com>
|
||||
Date: Wed Mar 28 17:38:08 2012 +0000
|
||||
|
||||
* python/py-inferior.c (infpy_read_memory): Remove cleanups and
|
||||
explicitly free 'buffer' on exit paths. Decref 'membuf_object'
|
||||
before returning.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c
|
||||
@@ -0,0 +1,27 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+static struct x
|
||||
+ {
|
||||
+ char unsigned u[4096];
|
||||
+ } x, *px = &x;
|
||||
+
|
||||
+int
|
||||
+main (int argc, char *argv[])
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp
|
||||
@@ -0,0 +1,68 @@
|
||||
+# Copyright 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if { [skip_python_tests] } { continue }
|
||||
+
|
||||
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
|
||||
+
|
||||
+proc memory_v_pages_get {} {
|
||||
+ global pid_of_gdb
|
||||
+ set fd [open "/proc/$pid_of_gdb/statm"]
|
||||
+ gets $fd line
|
||||
+ close $fd
|
||||
+ # number of pages of virtual memory
|
||||
+ scan $line "%d" drs
|
||||
+ return $drs
|
||||
+}
|
||||
+
|
||||
+if { ![runto_main] } {
|
||||
+ untested $testfile.exp
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
|
||||
+
|
||||
+gdb_test "source ${remote_python_file}" ""
|
||||
+
|
||||
+gdb_test "hello-world" ""
|
||||
+
|
||||
+set kbytes_before [memory_v_pages_get]
|
||||
+verbose -log "kbytes_before = $kbytes_before"
|
||||
+
|
||||
+gdb_test "hello-world" ""
|
||||
+
|
||||
+set kbytes_after [memory_v_pages_get]
|
||||
+verbose -log "kbytes_after = $kbytes_after"
|
||||
+
|
||||
+set kbytes_diff [expr $kbytes_after - $kbytes_before]
|
||||
+verbose -log "kbytes_diff = $kbytes_diff"
|
||||
+
|
||||
+# The value "1000" was calculated by running a few GDB sessions with this
|
||||
+# testcase, and seeing how much (in average) the memory consumption
|
||||
+# increased after the "hello-world" command issued above. The average
|
||||
+# was around 500 bytes, so I chose 1000 as a high estimate.
|
||||
+if { $kbytes_diff > 1000 } {
|
||||
+ fail "there is a memory leak on GDB (RHBZ 1007614)"
|
||||
+} else {
|
||||
+ pass "there is not a memory leak on GDB (RHBZ 1007614)"
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py
|
||||
@@ -0,0 +1,30 @@
|
||||
+# Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+class HelloWorld (gdb.Command):
|
||||
+ """Greet the whole world."""
|
||||
+
|
||||
+ def __init__ (self):
|
||||
+ super (HelloWorld, self).__init__ ("hello-world",
|
||||
+ gdb.COMMAND_OBSCURE)
|
||||
+
|
||||
+ def invoke (self, arg, from_tty):
|
||||
+ px = gdb.parse_and_eval("px")
|
||||
+ core = gdb.inferiors()[0]
|
||||
+ for i in range(256 * 1024):
|
||||
+ chunk = core.read_memory(px, 4096)
|
||||
+ print "Hello, World!"
|
||||
+
|
||||
+HelloWorld ()
|
@ -8,6 +8,7 @@ Subject: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
|
||||
;;=fedoratest
|
||||
|
||||
URL: <https://sourceware.org/ml/gdb-patches/2013-05/msg00364.html>
|
||||
Message-ID: <1368136582.30058.7.camel@soleil>
|
||||
|
||||
From: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
|
||||
To: gdb-patches at sourceware dot org
|
||||
|
@ -1,371 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-rhbz1156192-recursive-dlopen-test.patch
|
||||
|
||||
;; Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to
|
||||
;; crash.' (RH BZ 1156192).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c
|
||||
@@ -0,0 +1,30 @@
|
||||
+/* Testcase for recursive dlopen calls.
|
||||
+
|
||||
+ Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* This test was copied from glibc's testcase called
|
||||
+ <dlfcn/tst-rec-dlopen.c> and related files. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+void
|
||||
+bar (void)
|
||||
+{
|
||||
+ printf ("Called bar.\n");
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c
|
||||
@@ -0,0 +1,30 @@
|
||||
+/* Testcase for recursive dlopen calls.
|
||||
+
|
||||
+ Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* This test was copied from glibc's testcase called
|
||||
+ <dlfcn/tst-rec-dlopen.c> and related files. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+void
|
||||
+foo (void)
|
||||
+{
|
||||
+ printf ("Called foo.\n");
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c
|
||||
@@ -0,0 +1,125 @@
|
||||
+/* Testcase for recursive dlopen calls.
|
||||
+
|
||||
+ Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* This test was copied from glibc's testcase called
|
||||
+ <dlfcn/tst-rec-dlopen.c> and related files. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <malloc.h>
|
||||
+#include <dlfcn.h>
|
||||
+
|
||||
+#define DSO "gdb-rhbz1156192-recursive-dlopen-libfoo.so"
|
||||
+#define FUNC "foo"
|
||||
+
|
||||
+#define DSO1 "gdb-rhbz1156192-recursive-dlopen-libbar.so"
|
||||
+#define FUNC1 "bar"
|
||||
+
|
||||
+/* Prototype for my hook. */
|
||||
+void *custom_malloc_hook (size_t, const void *);
|
||||
+
|
||||
+/* Pointer to old malloc hooks. */
|
||||
+void *(*old_malloc_hook) (size_t, const void *);
|
||||
+
|
||||
+/* Call function func_name in DSO dso_name via dlopen. */
|
||||
+void
|
||||
+call_func (const char *dso_name, const char *func_name)
|
||||
+{
|
||||
+ int ret;
|
||||
+ void *dso;
|
||||
+ void (*func) (void);
|
||||
+ char *err;
|
||||
+
|
||||
+ /* Open the DSO. */
|
||||
+ dso = dlopen (dso_name, RTLD_NOW|RTLD_GLOBAL);
|
||||
+ if (dso == NULL)
|
||||
+ {
|
||||
+ err = dlerror ();
|
||||
+ fprintf (stderr, "%s\n", err);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+ /* Clear any errors. */
|
||||
+ dlerror ();
|
||||
+
|
||||
+ /* Lookup func. */
|
||||
+ *(void **) (&func) = dlsym (dso, func_name);
|
||||
+ if (func == NULL)
|
||||
+ {
|
||||
+ err = dlerror ();
|
||||
+ if (err != NULL)
|
||||
+ {
|
||||
+ fprintf (stderr, "%s\n", err);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+ }
|
||||
+ /* Call func twice. */
|
||||
+ (*func) ();
|
||||
+
|
||||
+ /* Close the library and look for errors too. */
|
||||
+ ret = dlclose (dso);
|
||||
+ if (ret != 0)
|
||||
+ {
|
||||
+ err = dlerror ();
|
||||
+ fprintf (stderr, "%s\n", err);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
+
|
||||
+/* Empty hook that does nothing. */
|
||||
+void *
|
||||
+custom_malloc_hook (size_t size, const void *caller)
|
||||
+{
|
||||
+ void *result;
|
||||
+ /* Restore old hooks. */
|
||||
+ __malloc_hook = old_malloc_hook;
|
||||
+ /* First call a function in another library via dlopen. */
|
||||
+ call_func (DSO1, FUNC1);
|
||||
+ /* Called recursively. */
|
||||
+ result = malloc (size);
|
||||
+ /* Restore new hooks. */
|
||||
+ old_malloc_hook = __malloc_hook;
|
||||
+ __malloc_hook = custom_malloc_hook;
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+
|
||||
+ /* Save old hook. */
|
||||
+ old_malloc_hook = __malloc_hook;
|
||||
+ /* Install new hook. */
|
||||
+ __malloc_hook = custom_malloc_hook;
|
||||
+
|
||||
+ /* Attempt to dlopen a shared library. This dlopen will
|
||||
+ trigger an access to the ld.so.cache, and that in turn
|
||||
+ will require a malloc to duplicate data in the cache.
|
||||
+ The malloc will call our malloc hook which calls dlopen
|
||||
+ recursively, and upon return of this dlopen the non-ref
|
||||
+ counted ld.so.cache mapping will be unmapped. We will
|
||||
+ return to the original dlopen and crash trying to access
|
||||
+ dlopened data. */
|
||||
+ call_func (DSO, FUNC);
|
||||
+
|
||||
+ /* Restore old hook. */
|
||||
+ __malloc_hook = old_malloc_hook;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
|
||||
@@ -0,0 +1,157 @@
|
||||
+# Copyright 2014 Free Software Foundation, Inc.
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+if {[skip_shlib_tests]} {
|
||||
+ untested "skipping shlib tests"
|
||||
+ return 0
|
||||
+} elseif {[use_gdb_stub]} {
|
||||
+ untested "skipping tests because of stub"
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+# Library foo
|
||||
+set libname1 "gdb-rhbz1156192-recursive-dlopen-libfoo"
|
||||
+set srcfile_lib1 ${srcdir}/${subdir}/${libname1}.c
|
||||
+set binfile_lib1 [standard_output_file ${libname1}.so]
|
||||
+# Library bar
|
||||
+set libname2 "gdb-rhbz1156192-recursive-dlopen-libbar"
|
||||
+set srcfile_lib2 ${srcdir}/${subdir}/${libname2}.c
|
||||
+set binfile_lib2 [standard_output_file ${libname2}.so]
|
||||
+
|
||||
+set testfile "gdb-rhbz1156192-recursive-dlopen"
|
||||
+set srcfile ${testfile}.c
|
||||
+set executable ${testfile}
|
||||
+set binfile [standard_output_file ${executable}]
|
||||
+
|
||||
+if { [gdb_compile_shlib ${srcfile_lib1} ${binfile_lib1} \
|
||||
+ { debug "additional_flags=-fPIC" }] != "" } {
|
||||
+ untested "Could not compile ${binfile_lib1}"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if { [gdb_compile_shlib ${srcfile_lib2} ${binfile_lib2} \
|
||||
+ { debug "additional_flags=-fPIC" }] != "" } {
|
||||
+ untested "Could not compile ${binfile_lib2}"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if { [prepare_for_testing ${testfile}.exp ${executable} ${srcfile} \
|
||||
+ [ list debug shlib_load "additional_flags=-Wno-deprecated-declarations" ]] } {
|
||||
+ untested "Could not compile ${executable}"
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set supported 0
|
||||
+gdb_test_multiple "run" "initial trial run" {
|
||||
+ -re -wrap "exited normally.*" {
|
||||
+ set supported 1
|
||||
+ pass $gdb_test_name
|
||||
+ }
|
||||
+ -re -wrap "exited with code.*" {
|
||||
+ untested "failed at $gdb_test_name"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if { $supported == 0 } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+proc do_test { has_libfoo has_libbar } {
|
||||
+ global hex binfile_lib2 binfile_lib1 gdb_prompt
|
||||
+ set libbar_match "[string_to_regexp $binfile_lib2]"
|
||||
+ set libfoo_match "[string_to_regexp $binfile_lib1]"
|
||||
+
|
||||
+ gdb_test_multiple "info shared" "info shared" {
|
||||
+ -re ".*$libfoo_match\r\n.*$libbar_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" {
|
||||
+ if { $has_libfoo && $has_libbar } {
|
||||
+ pass "matched libfoo and libbar"
|
||||
+ } else {
|
||||
+ fail "matched libfoo and libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)"
|
||||
+ }
|
||||
+ }
|
||||
+ -re ".*$libfoo_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" {
|
||||
+ if { $has_libfoo && !$has_libbar } {
|
||||
+ pass "matched libfoo"
|
||||
+ } else {
|
||||
+ fail "matched libfoo (has_libfoo = $has_libfoo, has_libbar = $has_libbar)"
|
||||
+ }
|
||||
+ }
|
||||
+ -re ".*$libbar_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" {
|
||||
+ if { $has_libbar && !$has_libfoo } {
|
||||
+ pass "matched libbar"
|
||||
+ } else {
|
||||
+ fail "matched libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)"
|
||||
+ }
|
||||
+ }
|
||||
+ "\r\n${gdb_prompt} $" {
|
||||
+ if { !$has_libfoo && !$has_libbar } {
|
||||
+ pass "did not match libfoo nor libbar"
|
||||
+ } else {
|
||||
+ fail "did not match libfoo nor libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)"
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+proc test_stop_on_solib_events { } {
|
||||
+ set pass 0
|
||||
+ # This variable holds the information about whether libfoo and
|
||||
+ # libbar (respectively) are expected in the "info shared" output.
|
||||
+ set solib_event_order { { 0 0 } { 0 0 } { 0 0 } { 0 1 } \
|
||||
+ { 0 1 } { 0 0 } { 0 0 } { 0 1 } \
|
||||
+ { 0 1 } { 0 0 } { 0 0 } { 0 1 } \
|
||||
+ { 0 1 } { 0 0 } { 0 0 1 } { 1 1 } \
|
||||
+ { 1 1 } { 1 0 } { 1 0 } { 1 1 } \
|
||||
+ { 1 1 } { 1 0 1 } { 1 0 } { 1 0 } }
|
||||
+
|
||||
+ with_test_prefix "stop-on-solib-events" {
|
||||
+ gdb_test_no_output "set stop-on-solib-events 1" "setting stop-on-solib-events"
|
||||
+
|
||||
+ gdb_run_cmd
|
||||
+ gdb_test "" "Wait for first prompt"
|
||||
+ foreach l $solib_event_order {
|
||||
+ incr pass
|
||||
+ with_test_prefix "pass #$pass" {
|
||||
+ set should_be_corrupted [expr 0+0[lindex $l 2]]
|
||||
+ do_test [lindex $l 0] [lindex $l 1]
|
||||
+ set test "continue"
|
||||
+ global gdb_prompt
|
||||
+ gdb_test_multiple $test $test {
|
||||
+ -re "\r\nwarning: Corrupted shared library list:.*\r\nStopped due to shared library event.*\r\n$gdb_prompt $" {
|
||||
+ set corrupted 1
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "\r\nStopped due to shared library event.*\r\n$gdb_prompt $" {
|
||||
+ set corrupted 0
|
||||
+ pass $test
|
||||
+ }
|
||||
+ }
|
||||
+ set test "corrupted=$corrupted but should_be_corrupted=$should_be_corrupted"
|
||||
+ if {$corrupted == $should_be_corrupted} {
|
||||
+ pass $test
|
||||
+ } else {
|
||||
+ fail $test
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ # In the last pass we do not expect to see libfoo or libbar.
|
||||
+ incr pass
|
||||
+ with_test_prefix "pass #$pass" {
|
||||
+ do_test 0 0
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+test_stop_on_solib_events
|
@ -1,104 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
|
||||
|
||||
;; [aarch64] Fix hardware watchpoints (RH BZ 1261564).
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c
|
||||
@@ -0,0 +1,33 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2016 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+__attribute__((aligned(16))) struct
|
||||
+{
|
||||
+ int var0, var4, var8;
|
||||
+} aligned;
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ aligned.var0 = 1;
|
||||
+ aligned.var4 = 2;
|
||||
+ aligned.var8 = 3;
|
||||
+
|
||||
+ aligned.var4 = aligned.var0;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp
|
||||
@@ -0,0 +1,53 @@
|
||||
+# Copyright (C) 2016 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+if { [prepare_for_testing rhbz1261564-aarch64-watchpoint.exp "rhbz1261564-aarch64-watchpoint"] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+if { ! [ runto main ] } then { return 0 }
|
||||
+
|
||||
+set test "rwatch aligned.var4"
|
||||
+if [istarget "s390*-*-*"] {
|
||||
+ gdb_test $test {Target does not support this type of hardware watchpoint\.}
|
||||
+ untested "s390* does not support hw read watchpoint"
|
||||
+ return
|
||||
+}
|
||||
+gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4"
|
||||
+
|
||||
+proc checkvar { address } {
|
||||
+ global gdb_prompt
|
||||
+
|
||||
+ set test "p &aligned.var$address"
|
||||
+ gdb_test_multiple $test $test {
|
||||
+ -re " = \\(int \\*\\) 0x\[0-9a-f\]+$address <aligned(\\+\[0-9\]+)?>\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re "\r\n$gdb_prompt $" {
|
||||
+ untested "$test (unexpected ELF layout)"
|
||||
+ return 0
|
||||
+ }
|
||||
+ }
|
||||
+ return 1
|
||||
+}
|
||||
+if ![checkvar "0"] { return }
|
||||
+if ![checkvar "4"] { return }
|
||||
+if ![checkvar "8"] { return }
|
||||
+
|
||||
+# Assumes: PPC_PTRACE_GETHWDBGINFO::data_bp_alignment == 8
|
||||
+# 'lwz' does read only 4 bytes but the hw watchpoint is 8 bytes wide.
|
||||
+setup_xfail "powerpc*-*-*"
|
||||
+
|
||||
+gdb_continue_to_end
|
@ -1,77 +0,0 @@
|
||||
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
|
@ -1,48 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= <ahajkova@redhat.com>
|
||||
Date: Mon, 8 Jan 2024 13:24:05 +0100
|
||||
Subject: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch
|
||||
|
||||
gdb/python: avoid use of _PyOS_ReadlineTState
|
||||
|
||||
In python/py-gdb-readline.c we make use of _PyOS_ReadlineTState,
|
||||
however, this variable is no longer public in Python 3.13, and so GDB
|
||||
no longer builds.
|
||||
|
||||
We are making use of _PyOS_ReadlineTState in order to re-acquire the
|
||||
Python Global Interpreter Lock (GIL). The _PyOS_ReadlineTState
|
||||
variable is set in Python's outer readline code prior to calling the
|
||||
user (GDB) supplied readline callback function, which for us is
|
||||
gdbpy_readline_wrapper. The gdbpy_readline_wrapper function is called
|
||||
without the GIL held.
|
||||
|
||||
Instead of using _PyOS_ReadlineTState, I propose that we switch to
|
||||
calling PyGILState_Ensure() and PyGILState_Release(). These functions
|
||||
will acquire the GIL based on the current thread. I think this should
|
||||
be sufficient; I can't imagine why we'd be running
|
||||
gdbpy_readline_wrapper on one thread on behalf of a different Python
|
||||
thread.... that would be unexpected I think.
|
||||
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c
|
||||
--- a/gdb/python/py-gdb-readline.c
|
||||
+++ b/gdb/python/py-gdb-readline.c
|
||||
@@ -56,13 +56,11 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
|
||||
if (except.reason == RETURN_QUIT)
|
||||
return NULL;
|
||||
|
||||
- /* The thread state is nulled during gdbpy_readline_wrapper,
|
||||
- with the original value saved in the following undocumented
|
||||
- variable (see Python's Parser/myreadline.c and
|
||||
- Modules/readline.c). */
|
||||
- PyEval_RestoreThread (_PyOS_ReadlineTState);
|
||||
+
|
||||
+ /* This readline callback is called without the GIL held. */
|
||||
+ gdbpy_gil gil;
|
||||
+
|
||||
gdbpy_convert_exception (except);
|
||||
- PyEval_SaveThread ();
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1,81 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= <ahajkova@redhat.com>
|
||||
Date: Mon, 8 Jan 2024 13:12:15 +0100
|
||||
Subject: gdb-rhbz2250652-gdbpy_gil.patch
|
||||
|
||||
gdb: move gdbpy_gil into python-internal.h
|
||||
|
||||
Move gdbpy_gil class into python-internal.h, the next
|
||||
commit wants to make use of this class from a file other
|
||||
than python.c.
|
||||
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
|
||||
--- a/gdb/python/python-internal.h
|
||||
+++ b/gdb/python/python-internal.h
|
||||
@@ -754,6 +754,30 @@ class gdbpy_allow_threads
|
||||
PyThreadState *m_save;
|
||||
};
|
||||
|
||||
+/* A helper class to save and restore the GIL, but without touching
|
||||
+ the other globals that are handled by gdbpy_enter. */
|
||||
+
|
||||
+class gdbpy_gil
|
||||
+{
|
||||
+public:
|
||||
+
|
||||
+ gdbpy_gil ()
|
||||
+ : m_state (PyGILState_Ensure ())
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ ~gdbpy_gil ()
|
||||
+ {
|
||||
+ PyGILState_Release (m_state);
|
||||
+ }
|
||||
+
|
||||
+ DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
|
||||
+
|
||||
+private:
|
||||
+
|
||||
+ PyGILState_STATE m_state;
|
||||
+};
|
||||
+
|
||||
/* Use this after a TRY_EXCEPT to throw the appropriate Python
|
||||
exception. */
|
||||
#define GDB_PY_HANDLE_EXCEPTION(Exception) \
|
||||
diff --git a/gdb/python/python.c b/gdb/python/python.c
|
||||
--- a/gdb/python/python.c
|
||||
+++ b/gdb/python/python.c
|
||||
@@ -257,30 +257,6 @@ gdbpy_enter::finalize ()
|
||||
python_gdbarch = target_gdbarch ();
|
||||
}
|
||||
|
||||
-/* A helper class to save and restore the GIL, but without touching
|
||||
- the other globals that are handled by gdbpy_enter. */
|
||||
-
|
||||
-class gdbpy_gil
|
||||
-{
|
||||
-public:
|
||||
-
|
||||
- gdbpy_gil ()
|
||||
- : m_state (PyGILState_Ensure ())
|
||||
- {
|
||||
- }
|
||||
-
|
||||
- ~gdbpy_gil ()
|
||||
- {
|
||||
- PyGILState_Release (m_state);
|
||||
- }
|
||||
-
|
||||
- DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
|
||||
-
|
||||
-private:
|
||||
-
|
||||
- PyGILState_STATE m_state;
|
||||
-};
|
||||
-
|
||||
/* Set the quit flag. */
|
||||
|
||||
static void
|
@ -1,55 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 14:51:22 -0700
|
||||
Subject: gdb-rhbz2261580-intrusive_list-assertion-fix.patch
|
||||
|
||||
;; Backport upstream workaround for GCC 14 problem which cause assertion
|
||||
;; failures in GDB.
|
||||
|
||||
[gdb/build] Workaround gcc PR113599
|
||||
|
||||
Since gcc commit d3f48f68227 ("c++: non-dependent .* operand folding
|
||||
[PR112427]"), with gdb we run into PR gcc/113599 [1], a wrong-code bug, as
|
||||
reported in PR build/31281.
|
||||
|
||||
Work around this by flipping inherit order:
|
||||
...
|
||||
-class thread_info : public refcounted_object,
|
||||
- public intrusive_list_node<thread_info>
|
||||
+class thread_info : public intrusive_list_node<thread_info>,
|
||||
+ public refcounted_object
|
||||
...
|
||||
|
||||
An argument could be made that this isn't necessary, because this occurred in
|
||||
an unreleased gcc version.
|
||||
|
||||
However, I think it could be useful when bisecting gcc for other problems in
|
||||
building gdb. Having this workaround means the bisect won't reintroduce the
|
||||
problem. Furthermore, the workaround is harmless.
|
||||
|
||||
Tested on Fedora rawhide x86_64.
|
||||
|
||||
Approved-By: Tom Tromey <tom@tromey.com>
|
||||
|
||||
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31281
|
||||
|
||||
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113599
|
||||
|
||||
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
|
||||
--- a/gdb/gdbthread.h
|
||||
+++ b/gdb/gdbthread.h
|
||||
@@ -242,10 +242,11 @@ using private_thread_info_up = std::unique_ptr<private_thread_info>;
|
||||
strong reference, and is thus not accounted for in the thread's
|
||||
refcount.
|
||||
|
||||
- The intrusive_list_node base links threads in a per-inferior list. */
|
||||
+ The intrusive_list_node base links threads in a per-inferior list.
|
||||
+ We place it first in the inherit order to work around PR gcc/113599. */
|
||||
|
||||
-class thread_info : public refcounted_object,
|
||||
- public intrusive_list_node<thread_info>
|
||||
+class thread_info : public intrusive_list_node<thread_info>,
|
||||
+ public refcounted_object
|
||||
{
|
||||
public:
|
||||
explicit thread_info (inferior *inf, ptid_t ptid);
|
@ -1,147 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
|
||||
|
||||
;; Import regression test for `gdb/findvar.c:417: internal-error:
|
||||
;; read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.cc b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc
|
||||
@@ -0,0 +1,53 @@
|
||||
+#include <iostream>
|
||||
+#include <pthread.h>
|
||||
+
|
||||
+class x
|
||||
+ {
|
||||
+ public:
|
||||
+ int n;
|
||||
+
|
||||
+ x() : n(0) {}
|
||||
+ };
|
||||
+
|
||||
+class y
|
||||
+ {
|
||||
+ public:
|
||||
+ int v;
|
||||
+
|
||||
+ y() : v(0) {}
|
||||
+ static __thread x *xp;
|
||||
+ };
|
||||
+
|
||||
+__thread x *y::xp;
|
||||
+
|
||||
+static void
|
||||
+foo (y *yp)
|
||||
+{
|
||||
+ yp->v = 1; /* foo_marker */
|
||||
+}
|
||||
+
|
||||
+static void *
|
||||
+bar (void *unused)
|
||||
+{
|
||||
+ x xinst;
|
||||
+ y::xp= &xinst;
|
||||
+
|
||||
+ y yy;
|
||||
+ foo(&yy);
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main(int argc, char *argv[])
|
||||
+{
|
||||
+ pthread_t t[2];
|
||||
+
|
||||
+ pthread_create (&t[0], NULL, bar, NULL);
|
||||
+ pthread_create (&t[1], NULL, bar, NULL);
|
||||
+
|
||||
+ pthread_join (t[0], NULL);
|
||||
+ pthread_join (t[1], NULL);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.exp b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp
|
||||
@@ -0,0 +1,75 @@
|
||||
+# Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+set testfile tls-rhbz947564
|
||||
+set srcfile ${testfile}.cc
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if [istarget "*-*-linux"] then {
|
||||
+ set target_cflags "-D_MIT_POSIX_THREADS"
|
||||
+} else {
|
||||
+ set target_cflags ""
|
||||
+}
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list c++ debug]] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+gdb_load ${binfile}
|
||||
+
|
||||
+if { ![runto_main] } {
|
||||
+ fail "Can't run to function main"
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+gdb_breakpoint "foo"
|
||||
+gdb_continue_to_breakpoint "foo" ".* foo_marker .*"
|
||||
+
|
||||
+proc get_xp_val {try} {
|
||||
+ global expect_out
|
||||
+ global gdb_prompt
|
||||
+ global hex
|
||||
+
|
||||
+ set xp_val ""
|
||||
+ gdb_test_multiple "print *yp" "print yp value" {
|
||||
+ -re { = \{v = 0, static xp = (0x[0-9a-f]+)\}.* } {
|
||||
+ pass "print $try value of *yp"
|
||||
+ set xp_val $expect_out(1,string)
|
||||
+ }
|
||||
+ -re "$gdb_prompt $" {
|
||||
+ fail "print $try value of *yp"
|
||||
+ }
|
||||
+ timeout {
|
||||
+ fail "print $try value of *yp (timeout)"
|
||||
+ }
|
||||
+ }
|
||||
+ return $xp_val
|
||||
+}
|
||||
+
|
||||
+set first_run [get_xp_val "first"]
|
||||
+
|
||||
+gdb_test "continue" "Breakpoint \[0-9\]+, foo \\\(yp=$hex\\\) at.*"
|
||||
+
|
||||
+set second_run [get_xp_val "second"]
|
||||
+
|
||||
+if { $first_run != $second_run } {
|
||||
+ pass "different values for TLS variable"
|
||||
+} else {
|
||||
+ fail "different values for TLS variable"
|
||||
+}
|
@ -1,70 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Mon, 9 May 2022 17:51:54 +0100
|
||||
Subject: gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
|
||||
|
||||
;;Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait"
|
||||
;;(Andrew Burgess, RHEL-13298)
|
||||
|
||||
This reverts commit ac0d67ed1dcf470bad6a3bc4800c2ddc9bedecca.
|
||||
|
||||
There was nothing wrong with the commit which I'm reverting here, but
|
||||
it removed some functionality that will be needed for a later commit;
|
||||
that is, the ability for GDB to ask for events from a specific ptid_t
|
||||
via the do_target_wait function.
|
||||
|
||||
In a follow up commit, this functionality will be used to implement
|
||||
inferior function calls in multi-threaded inferiors.
|
||||
|
||||
This is not a straight revert of the above commit. Reverting the
|
||||
above commit replaces a 'nullptr' with 'NULL', I've gone in and
|
||||
changed that, preserving the 'nullptr'.
|
||||
|
||||
Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
||||
Tested-By: Luis Machado <luis.machado@arm.com>
|
||||
Tested-By: Keith Seitz <keiths@redhat.com>
|
||||
|
||||
diff --git a/gdb/infrun.c b/gdb/infrun.c
|
||||
--- a/gdb/infrun.c
|
||||
+++ b/gdb/infrun.c
|
||||
@@ -3946,7 +3946,8 @@ do_target_wait_1 (inferior *inf, ptid_t ptid,
|
||||
more events. Polls for events from all inferiors/targets. */
|
||||
|
||||
static bool
|
||||
-do_target_wait (execution_control_state *ecs, target_wait_flags options)
|
||||
+do_target_wait (ptid_t wait_ptid, execution_control_state *ecs,
|
||||
+ target_wait_flags options)
|
||||
{
|
||||
int num_inferiors = 0;
|
||||
int random_selector;
|
||||
@@ -3956,9 +3957,10 @@ do_target_wait (execution_control_state *ecs, target_wait_flags options)
|
||||
polling the rest of the inferior list starting from that one in a
|
||||
circular fashion until the whole list is polled once. */
|
||||
|
||||
- auto inferior_matches = [] (inferior *inf)
|
||||
+ auto inferior_matches = [&wait_ptid] (inferior *inf)
|
||||
{
|
||||
- return inf->process_target () != nullptr;
|
||||
+ return (inf->process_target () != nullptr
|
||||
+ && ptid_t (inf->pid).matches (wait_ptid));
|
||||
};
|
||||
|
||||
/* First see how many matching inferiors we have. */
|
||||
@@ -3997,7 +3999,7 @@ do_target_wait (execution_control_state *ecs, target_wait_flags options)
|
||||
|
||||
auto do_wait = [&] (inferior *inf)
|
||||
{
|
||||
- ecs->ptid = do_target_wait_1 (inf, minus_one_ptid, &ecs->ws, options);
|
||||
+ ecs->ptid = do_target_wait_1 (inf, wait_ptid, &ecs->ws, options);
|
||||
ecs->target = inf->process_target ();
|
||||
return (ecs->ws.kind () != TARGET_WAITKIND_IGNORE);
|
||||
};
|
||||
@@ -4427,7 +4429,7 @@ fetch_inferior_event ()
|
||||
the event. */
|
||||
scoped_disable_commit_resumed disable_commit_resumed ("handling event");
|
||||
|
||||
- if (!do_target_wait (&ecs, TARGET_WNOHANG))
|
||||
+ if (!do_target_wait (minus_one_ptid, &ecs, TARGET_WNOHANG))
|
||||
{
|
||||
infrun_debug_printf ("do_target_wait returned no event");
|
||||
disable_commit_resumed.reset_and_commit ();
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,413 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Wed, 18 Jan 2023 10:17:57 +0000
|
||||
Subject: gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
|
||||
|
||||
;;gdb: introduce unwind-on-timeout setting
|
||||
;;(Andrew Burgess, RHEL-13298)
|
||||
|
||||
Now that inferior function calls can timeout (see the recent
|
||||
introduction of direct-call-timeout and indirect-call-timeout), this
|
||||
commit adds a new setting unwind-on-timeout.
|
||||
|
||||
This new setting is just like the existing unwindonsignal and
|
||||
unwind-on-terminating-exception, but the new setting will cause GDB to
|
||||
unwind the stack if an inferior function call times out.
|
||||
|
||||
The existing inferior function call timeout tests have been updated to
|
||||
cover the new setting.
|
||||
|
||||
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
|
||||
Tested-By: Luis Machado <luis.machado@arm.com>
|
||||
Tested-By: Keith Seitz <keiths@redhat.com>
|
||||
|
||||
diff --git a/gdb/NEWS b/gdb/NEWS
|
||||
--- a/gdb/NEWS
|
||||
+++ b/gdb/NEWS
|
||||
@@ -72,6 +72,15 @@ show indirect-call-timeout
|
||||
ignored, GDB will wait indefinitely for an inferior function to
|
||||
complete, unless interrupted by the user using Ctrl-C.
|
||||
|
||||
+set unwind-on-timeout on|off
|
||||
+show unwind-on-timeout
|
||||
+ These commands control whether GDB should unwind the stack when a
|
||||
+ timeout occurs during an inferior function call. The default is
|
||||
+ off, in which case the inferior will remain in the frame where the
|
||||
+ timeout occurred. When on, GDB will unwind the stack removing the
|
||||
+ dummy frame that was added for the inferior call, and restoring the
|
||||
+ inferior state to how it was before the inferior call started.
|
||||
+
|
||||
* New features in the GDB remote stub, GDBserver
|
||||
|
||||
** The --remote-debug and --event-loop-debug command line options
|
||||
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
--- a/gdb/doc/gdb.texinfo
|
||||
+++ b/gdb/doc/gdb.texinfo
|
||||
@@ -20932,6 +20932,22 @@ the default C@t{++} exception handler and the inferior terminated.
|
||||
Show the current setting of stack unwinding in the functions called by
|
||||
@value{GDBN}.
|
||||
|
||||
+@anchor{set unwind-on-timeout}
|
||||
+@item set unwind-on-timeout
|
||||
+@kindex set unwind-on-timeout
|
||||
+@cindex unwind stack in called functions when timing out
|
||||
+@cindex call dummy stack unwinding on timeout.
|
||||
+Set unwinding of the stack if a function called from @value{GDBN}
|
||||
+times out. If set to @code{off} (the default), @value{GDBN} stops in
|
||||
+the frame where the timeout occurred. If set to @code{on},
|
||||
+@value{GDBN} unwinds the stack it created for the call and restores
|
||||
+the context to what it was before the call.
|
||||
+
|
||||
+@item show unwind-on-timeout
|
||||
+@kindex show unwind-on-timeout
|
||||
+Show whether @value{GDBN} will unwind the stack if a function called
|
||||
+from @value{GDBN} times out.
|
||||
+
|
||||
@item set may-call-functions
|
||||
@kindex set may-call-functions
|
||||
@cindex disabling calling functions in the program
|
||||
@@ -20963,11 +20979,11 @@ call by typing the interrupt character (often @kbd{Ctrl-c}).
|
||||
|
||||
If a called function is interrupted for any reason, including hitting
|
||||
a breakpoint, or triggering a watchpoint, and the stack is not unwound
|
||||
-due to @code{set unwind-on-terminating-exception on} or @code{set
|
||||
-unwindonsignal on} (@pxref{stack unwind settings}),
|
||||
-then the dummy-frame, created by @value{GDBN} to facilitate the call
|
||||
-to the program function, will be visible in the backtrace, for example
|
||||
-frame @code{#3} in the following backtrace:
|
||||
+due to @code{set unwind-on-terminating-exception on}, @code{set
|
||||
+unwind-on-timeout on}, or @code{set unwindonsignal on} (@pxref{stack
|
||||
+unwind settings}), then the dummy-frame, created by @value{GDBN} to
|
||||
+facilitate the call to the program function, will be visible in the
|
||||
+backtrace, for example frame @code{#3} in the following backtrace:
|
||||
|
||||
@smallexample
|
||||
(@value{GDBP}) backtrace
|
||||
@@ -20992,6 +21008,11 @@ Execution}) @value{GDBN} can place a timeout on any functions called
|
||||
from @value{GDBN}. If the timeout expires and the function call is
|
||||
still ongoing, then @value{GDBN} will interrupt the program.
|
||||
|
||||
+If a function called from @value{GDBN} is interrupted by a timeout,
|
||||
+then by default the inferior is left in the frame where the timeout
|
||||
+occurred, this behaviour can be adjusted with @samp{set
|
||||
+unwind-on-timeout} (@pxref{set unwind-on-timeout}).
|
||||
+
|
||||
For targets that don't support asynchronous execution
|
||||
(@pxref{Background Execution}) then timeouts for functions called from
|
||||
@value{GDBN} are not supported, the timeout settings described below
|
||||
diff --git a/gdb/infcall.c b/gdb/infcall.c
|
||||
--- a/gdb/infcall.c
|
||||
+++ b/gdb/infcall.c
|
||||
@@ -218,6 +218,27 @@ show_unwind_on_terminating_exception_p (struct ui_file *file, int from_tty,
|
||||
value);
|
||||
}
|
||||
|
||||
+/* This boolean tells GDB what to do if an inferior function, called from
|
||||
+ GDB, times out. If true, GDB unwinds the stack and restores the context
|
||||
+ to what it was before the call. When false, GDB leaves the thread as it
|
||||
+ is at the point of the timeout.
|
||||
+
|
||||
+ The default is to stop in the frame where the timeout occurred. */
|
||||
+
|
||||
+static bool unwind_on_timeout_p = false;
|
||||
+
|
||||
+/* Implement 'show unwind-on-timeout'. */
|
||||
+
|
||||
+static void
|
||||
+show_unwind_on_timeout_p (struct ui_file *file, int from_tty,
|
||||
+ struct cmd_list_element *c, const char *value)
|
||||
+{
|
||||
+ gdb_printf (file,
|
||||
+ _("Unwinding of stack if a timeout occurs "
|
||||
+ "while in a call dummy is %s.\n"),
|
||||
+ value);
|
||||
+}
|
||||
+
|
||||
/* Perform the standard coercions that are specified
|
||||
for arguments to be passed to C, Ada or Fortran functions.
|
||||
|
||||
@@ -574,6 +595,16 @@ struct call_thread_fsm : public thread_fsm
|
||||
bool should_stop (struct thread_info *thread) override;
|
||||
|
||||
bool should_notify_stop () override;
|
||||
+
|
||||
+ /* Record that this thread timed out while performing an infcall. */
|
||||
+ void timed_out ()
|
||||
+ {
|
||||
+ m_timed_out = true;
|
||||
+ }
|
||||
+
|
||||
+private:
|
||||
+ /* Set true if the thread timed out while performing an infcall. */
|
||||
+ bool m_timed_out = false;
|
||||
};
|
||||
|
||||
/* Allocate a new call_thread_fsm object. */
|
||||
@@ -649,7 +680,8 @@ call_thread_fsm::should_notify_stop ()
|
||||
|
||||
infcall_debug_printf ("inferior call didn't complete fully");
|
||||
|
||||
- if (stopped_by_random_signal && unwind_on_signal_p)
|
||||
+ if ((stopped_by_random_signal && unwind_on_signal_p)
|
||||
+ || (m_timed_out && unwind_on_timeout_p))
|
||||
{
|
||||
infcall_debug_printf ("unwind-on-signal is on, don't notify");
|
||||
return false;
|
||||
@@ -742,6 +774,9 @@ struct infcall_timer_controller
|
||||
|
||||
infcall_debug_printf ("Stopping thread %s",
|
||||
m_thread->ptid.to_string ().c_str ());
|
||||
+ call_thread_fsm *fsm
|
||||
+ = gdb::checked_static_cast<call_thread_fsm *> (m_thread->thread_fsm ());
|
||||
+ fsm->timed_out ();
|
||||
target_stop (m_thread->ptid);
|
||||
}
|
||||
};
|
||||
@@ -1744,14 +1779,27 @@ When the function is done executing, GDB will silently stop."),
|
||||
/* A timeout results in a signal being sent to the inferior. */
|
||||
gdb_assert (stopped_by_random_signal);
|
||||
|
||||
- /* Indentation is weird here. A later patch is going to move the
|
||||
- following block into an if/else, so I'm leaving the indentation
|
||||
- here to minimise the later patch.
|
||||
+ if (unwind_on_timeout_p)
|
||||
+ {
|
||||
+ /* The user wants the context restored. */
|
||||
+
|
||||
+ /* We must get back to the frame we were before the
|
||||
+ dummy call. */
|
||||
+ dummy_frame_pop (dummy_id, call_thread.get ());
|
||||
|
||||
- Also, the error message used below refers to 'set
|
||||
- unwind-on-timeout' which doesn't exist yet. This will be added
|
||||
- in a later commit, I'm leaving this in for now to minimise the
|
||||
- churn caused by the commit that adds unwind-on-timeout. */
|
||||
+ /* We also need to restore inferior status to that before the
|
||||
+ dummy call. */
|
||||
+ restore_infcall_control_state (inf_status.release ());
|
||||
+
|
||||
+ error (_("\
|
||||
+The program being debugged timed out while in a function called from GDB.\n\
|
||||
+GDB has restored the context to what it was before the call.\n\
|
||||
+To change this behavior use \"set unwind-on-timeout off\".\n\
|
||||
+Evaluation of the expression containing the function\n\
|
||||
+(%s) will be abandoned."),
|
||||
+ name.c_str ());
|
||||
+ }
|
||||
+ else
|
||||
{
|
||||
/* The user wants to stay in the frame where we stopped
|
||||
(default). Discard inferior status, we're not at the same
|
||||
@@ -1877,6 +1925,20 @@ The default is to unwind the frame."),
|
||||
show_unwind_on_terminating_exception_p,
|
||||
&setlist, &showlist);
|
||||
|
||||
+ add_setshow_boolean_cmd ("unwind-on-timeout", no_class,
|
||||
+ &unwind_on_timeout_p, _("\
|
||||
+Set unwinding of stack if a timeout occurs while in a call dummy."), _("\
|
||||
+Show unwinding of stack if a timeout occurs while in a call dummy."),
|
||||
+ _("\
|
||||
+The unwind on timeout flag lets the user determine what gdb should do if\n\
|
||||
+gdb times out while in a function called from gdb. If set, gdb unwinds\n\
|
||||
+the stack and restores the context to what it was before the call. If\n\
|
||||
+unset, gdb leaves the inferior in the frame where the timeout occurred.\n\
|
||||
+The default is to stop in the frame where the timeout occurred."),
|
||||
+ NULL,
|
||||
+ show_unwind_on_timeout_p,
|
||||
+ &setlist, &showlist);
|
||||
+
|
||||
add_setshow_uinteger_cmd ("direct-call-timeout", no_class,
|
||||
&direct_call_timeout, _("\
|
||||
Set the timeout, for direct calls to inferior function calls."), _("\
|
||||
diff --git a/gdb/testsuite/gdb.base/infcall-timeout.exp b/gdb/testsuite/gdb.base/infcall-timeout.exp
|
||||
--- a/gdb/testsuite/gdb.base/infcall-timeout.exp
|
||||
+++ b/gdb/testsuite/gdb.base/infcall-timeout.exp
|
||||
@@ -28,7 +28,11 @@ if { [build_executable "failed to prepare" ${binfile} "${srcfile}" \
|
||||
# then adjust the direct-call-timeout, and make an inferior function
|
||||
# call that will never return. GDB should eventually timeout and stop
|
||||
# the inferior.
|
||||
-proc run_test { target_async target_non_stop non_stop } {
|
||||
+#
|
||||
+# When UNWIND is "off" the inferior wil be left in the frame where the
|
||||
+# timeout occurs, otherwise, when UNWIND is "on", GDB should unwind
|
||||
+# back to the frame where the inferior call was made.
|
||||
+proc run_test { target_async target_non_stop non_stop unwind } {
|
||||
save_vars { ::GDBFLAGS } {
|
||||
append ::GDBFLAGS \
|
||||
" -ex \"maint set target-non-stop $target_non_stop\""
|
||||
@@ -45,28 +49,43 @@ proc run_test { target_async target_non_stop non_stop } {
|
||||
}
|
||||
|
||||
gdb_test_no_output "set direct-call-timeout 5"
|
||||
+ gdb_test_no_output "set unwind-on-timeout $unwind"
|
||||
+
|
||||
+ if { $unwind } {
|
||||
+ gdb_test "print function_that_never_returns ()" \
|
||||
+ [multi_line \
|
||||
+ "The program being debugged timed out while in a function called from GDB\\." \
|
||||
+ "GDB has restored the context to what it was before the call\\." \
|
||||
+ "To change this behavior use \"set unwind-on-timeout off\"\\." \
|
||||
+ "Evaluation of the expression containing the function" \
|
||||
+ "\\(function_that_never_returns\\) will be abandoned\\."]
|
||||
|
||||
- # When non-stop mode is off we get slightly different output from GDB.
|
||||
- if { ([target_info gdb_protocol] == "remote"
|
||||
- || [target_info gdb_protocol] == "extended-remote")
|
||||
- && !$target_non_stop } {
|
||||
- set stopped_line_pattern "Program received signal SIGINT, Interrupt\\."
|
||||
+ gdb_test "bt" \
|
||||
+ "#0\\s+main \\(\\).*"
|
||||
} else {
|
||||
- set stopped_line_pattern "Program stopped\\."
|
||||
- }
|
||||
+ # When non-stop mode is off we get slightly different output from GDB.
|
||||
+ if { ([target_info gdb_protocol] == "remote"
|
||||
+ || [target_info gdb_protocol] == "extended-remote")
|
||||
+ && !$target_non_stop } {
|
||||
+ set stopped_line_pattern "Program received signal SIGINT, Interrupt\\."
|
||||
+ } else {
|
||||
+ set stopped_line_pattern "Program stopped\\."
|
||||
+ }
|
||||
|
||||
- gdb_test "print function_that_never_returns ()" \
|
||||
- [multi_line \
|
||||
- $stopped_line_pattern \
|
||||
- ".*" \
|
||||
- "The program being debugged timed out while in a function called from GDB\\." \
|
||||
- "GDB remains in the frame where the timeout occurred\\." \
|
||||
- "To change this behavior use \"set unwind-on-timeout on\"\\." \
|
||||
- "Evaluation of the expression containing the function" \
|
||||
- "\\(function_that_never_returns\\) will be abandoned\\." \
|
||||
- "When the function is done executing, GDB will silently stop\\."]
|
||||
-
|
||||
- gdb_test "bt" ".* function_that_never_returns .*<function called from gdb>.*"
|
||||
+ gdb_test "print function_that_never_returns ()" \
|
||||
+ [multi_line \
|
||||
+ $stopped_line_pattern \
|
||||
+ ".*" \
|
||||
+ "The program being debugged timed out while in a function called from GDB\\." \
|
||||
+ "GDB remains in the frame where the timeout occurred\\." \
|
||||
+ "To change this behavior use \"set unwind-on-timeout on\"\\." \
|
||||
+ "Evaluation of the expression containing the function" \
|
||||
+ "\\(function_that_never_returns\\) will be abandoned\\." \
|
||||
+ "When the function is done executing, GDB will silently stop\\."]
|
||||
+
|
||||
+ gdb_test "bt" \
|
||||
+ ".* function_that_never_returns .*<function called from gdb>.*"
|
||||
+ }
|
||||
}
|
||||
|
||||
foreach_with_prefix target_async { "on" "off" } {
|
||||
@@ -88,7 +107,9 @@ foreach_with_prefix target_async { "on" "off" } {
|
||||
continue
|
||||
}
|
||||
|
||||
- run_test $target_async $target_non_stop $non_stop
|
||||
+ foreach_with_prefix unwind { "on" "off" } {
|
||||
+ run_test $target_async $target_non_stop $non_stop $unwind
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp
|
||||
--- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-timeout.exp
|
||||
@@ -41,7 +41,12 @@ set segfault_line [gdb_get_line_number "Segfault here"]
|
||||
# thread, on which the inferior call relies, either hits a breakpoint
|
||||
# (when OTHER_THREAD_BP is true), or crashes (when OTHER_THREAD_BP is
|
||||
# false).
|
||||
-proc run_test { target_async target_non_stop non_stop other_thread_bp } {
|
||||
+#
|
||||
+# When UNWIND is "on" GDB will unwind the thread which performed the
|
||||
+# inferior function call back to the state where the inferior call was
|
||||
+# made (when the inferior call times out). Otherwise, when UNWIND is
|
||||
+# "off", the inferior is left in the frame where the timeout occurred.
|
||||
+proc run_test { target_async target_non_stop non_stop other_thread_bp unwind } {
|
||||
save_vars { ::GDBFLAGS } {
|
||||
append ::GDBFLAGS " -ex \"maint set target-non-stop $target_non_stop\""
|
||||
append ::GDBFLAGS " -ex \"maint non-stop $non_stop\""
|
||||
@@ -72,6 +77,7 @@ proc run_test { target_async target_non_stop non_stop other_thread_bp } {
|
||||
# for this timeout. For now though, we just hope 5 seconds is
|
||||
# enough.
|
||||
gdb_test_no_output "set indirect-call-timeout 5"
|
||||
+ gdb_test_no_output "set unwind-on-timeout $unwind"
|
||||
|
||||
gdb_breakpoint \
|
||||
"${::srcfile}:${::cond_bp_line} if (condition_func ())"
|
||||
@@ -92,27 +98,43 @@ proc run_test { target_async target_non_stop non_stop other_thread_bp } {
|
||||
"get number for segfault breakpoint"]
|
||||
}
|
||||
|
||||
- # When non-stop mode is off we get slightly different output from GDB.
|
||||
- if { ([target_info gdb_protocol] == "remote"
|
||||
- || [target_info gdb_protocol] == "extended-remote")
|
||||
- && !$target_non_stop} {
|
||||
- set stopped_line_pattern "Thread ${::decimal} \"\[^\r\n\"\]+\" received signal SIGINT, Interrupt\\."
|
||||
+ if { $unwind } {
|
||||
+ gdb_test "continue" \
|
||||
+ [multi_line \
|
||||
+ "Error in testing condition for breakpoint ${bp_num}:" \
|
||||
+ "The program being debugged timed out while in a function called from GDB\\." \
|
||||
+ "GDB has restored the context to what it was before the call\\." \
|
||||
+ "To change this behavior use \"set unwind-on-timeout off\"\\." \
|
||||
+ "Evaluation of the expression containing the function" \
|
||||
+ "\\(condition_func\\) will be abandoned\\.(\r\n\\\[New Thread \[^\r\n\]+\\\])*" \
|
||||
+ "" \
|
||||
+ "Thread ${::decimal}\[^\r\n\]*hit Breakpoint ${bp_num}, \[^\r\n\]+" \
|
||||
+ "\[^\r\n\]+ Conditional breakpoint here\\. \[^\r\n\]+"] \
|
||||
+ "expected timeout waiting for inferior call to complete"
|
||||
} else {
|
||||
- set stopped_line_pattern "Thread ${::decimal} \"\[^\r\n\"\]+\" stopped\\."
|
||||
- }
|
||||
+ # When non-stop mode is off we get slightly different output from GDB.
|
||||
+ if { ([target_info gdb_protocol] == "remote"
|
||||
+ || [target_info gdb_protocol] == "extended-remote")
|
||||
+ && !$target_non_stop} {
|
||||
+ set stopped_line_pattern \
|
||||
+ "Thread ${::decimal} \"\[^\r\n\"\]+\" received signal SIGINT, Interrupt\\."
|
||||
+ } else {
|
||||
+ set stopped_line_pattern "Thread ${::decimal} \"\[^\r\n\"\]+\" stopped\\."
|
||||
+ }
|
||||
|
||||
- gdb_test "continue" \
|
||||
- [multi_line \
|
||||
- $stopped_line_pattern \
|
||||
- ".*" \
|
||||
- "Error in testing condition for breakpoint ${bp_num}:" \
|
||||
- "The program being debugged timed out while in a function called from GDB\\." \
|
||||
- "GDB remains in the frame where the timeout occurred\\." \
|
||||
- "To change this behavior use \"set unwind-on-timeout on\"\\." \
|
||||
- "Evaluation of the expression containing the function" \
|
||||
- "\\(condition_func\\) will be abandoned\\." \
|
||||
- "When the function is done executing, GDB will silently stop\\."] \
|
||||
- "expected timeout waiting for inferior call to complete"
|
||||
+ gdb_test "continue" \
|
||||
+ [multi_line \
|
||||
+ "$stopped_line_pattern" \
|
||||
+ ".*" \
|
||||
+ "Error in testing condition for breakpoint ${bp_num}:" \
|
||||
+ "The program being debugged timed out while in a function called from GDB\\." \
|
||||
+ "GDB remains in the frame where the timeout occurred\\." \
|
||||
+ "To change this behavior use \"set unwind-on-timeout on\"\\." \
|
||||
+ "Evaluation of the expression containing the function" \
|
||||
+ "\\(condition_func\\) will be abandoned\\." \
|
||||
+ "When the function is done executing, GDB will silently stop\\."] \
|
||||
+ "expected timeout waiting for inferior call to complete"
|
||||
+ }
|
||||
|
||||
# Remember that other thread that either crashed (with a segfault)
|
||||
# or hit a breakpoint? Now that the inferior call has timed out,
|
||||
@@ -158,8 +180,11 @@ foreach_with_prefix target_async {"on" "off" } {
|
||||
# disabled.
|
||||
continue
|
||||
}
|
||||
- foreach_with_prefix other_thread_bp { true false } {
|
||||
- run_test $target_async $target_non_stop $non_stop $other_thread_bp
|
||||
+ foreach_with_prefix unwind {"off" "on"} {
|
||||
+ foreach_with_prefix other_thread_bp { true false } {
|
||||
+ run_test $target_async $target_non_stop $non_stop \
|
||||
+ $other_thread_bp $unwind
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
@ -1,467 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Wed, 18 Jan 2023 12:09:05 +0000
|
||||
Subject: gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
|
||||
|
||||
;;gdb: rename unwindonsignal to unwind-on-signal
|
||||
;;(Andrew Burgess, RHEL-13298)
|
||||
|
||||
We now have unwind-on-timeout and unwind-on-terminating-exception, and
|
||||
then the odd one out unwindonsignal.
|
||||
|
||||
I'm not a great fan of these squashed together command names, so in
|
||||
this commit I propose renaming this to unwind-on-signal.
|
||||
|
||||
Obviously I've added the hidden alias unwindonsignal so any existing
|
||||
GDB scripts will keep working.
|
||||
|
||||
There's one test that I've extended to test the alias works, but in
|
||||
most of the other test scripts I've changed over to use the new name.
|
||||
|
||||
The docs are updated to reference the new name.
|
||||
|
||||
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
|
||||
Tested-By: Luis Machado <luis.machado@arm.com>
|
||||
Tested-By: Keith Seitz <keiths@redhat.com>
|
||||
|
||||
diff --git a/gdb/NEWS b/gdb/NEWS
|
||||
--- a/gdb/NEWS
|
||||
+++ b/gdb/NEWS
|
||||
@@ -32,6 +32,10 @@ maintenance info line-table
|
||||
if the line is considered the start of the epilgoue, and thus a point at
|
||||
which the frame can be considered destroyed.
|
||||
|
||||
+set unwindonsignal on|off
|
||||
+show unwindonsignal
|
||||
+ These commands are now aliases for the new set/show unwind-on-signal.
|
||||
+
|
||||
* New commands
|
||||
|
||||
info missing-debug-handler
|
||||
@@ -81,6 +85,11 @@ show unwind-on-timeout
|
||||
dummy frame that was added for the inferior call, and restoring the
|
||||
inferior state to how it was before the inferior call started.
|
||||
|
||||
+set unwind-on-signal on|off
|
||||
+show unwind-on-signal
|
||||
+ These new commands replaces the existing set/show unwindonsignal. The
|
||||
+ old command is maintained as an alias.
|
||||
+
|
||||
* New features in the GDB remote stub, GDBserver
|
||||
|
||||
** The --remote-debug and --event-loop-debug command line options
|
||||
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
||||
--- a/gdb/doc/gdb.texinfo
|
||||
+++ b/gdb/doc/gdb.texinfo
|
||||
@@ -20886,7 +20886,7 @@ value history.
|
||||
It is possible for the function you call via the @code{print} or
|
||||
@code{call} command to generate a signal (e.g., if there's a bug in
|
||||
the function, or if you passed it incorrect arguments). What happens
|
||||
-in that case is controlled by the @code{set unwindonsignal} command.
|
||||
+in that case is controlled by the @code{set unwind-on-signal} command.
|
||||
|
||||
Similarly, with a C@t{++} program it is possible for the function you
|
||||
call via the @code{print} or @code{call} command to generate an
|
||||
@@ -20900,7 +20900,8 @@ in that case is controlled by the
|
||||
|
||||
@anchor{stack unwind settings}
|
||||
@table @code
|
||||
-@item set unwindonsignal
|
||||
+@item set unwind-on-signal
|
||||
+@kindex set unwind-on-signal
|
||||
@kindex set unwindonsignal
|
||||
@cindex unwind stack in called functions
|
||||
@cindex call dummy stack unwinding
|
||||
@@ -20911,11 +20912,18 @@ the context to what it was before the call. If set to off (the
|
||||
default), @value{GDBN} stops in the frame where the signal was
|
||||
received.
|
||||
|
||||
-@item show unwindonsignal
|
||||
+The command @code{set unwindonsignal} is an alias for this command,
|
||||
+and is maintained for backward compatibility.
|
||||
+
|
||||
+@item show unwind-on-signal
|
||||
+@kindex show unwind-on-signal
|
||||
@kindex show unwindonsignal
|
||||
Show the current setting of stack unwinding in the functions called by
|
||||
@value{GDBN}.
|
||||
|
||||
+The command @code{show unwindonsignal} is an alias for this command,
|
||||
+and is maintained for backward compatibility.
|
||||
+
|
||||
@item set unwind-on-terminating-exception
|
||||
@kindex set unwind-on-terminating-exception
|
||||
@cindex unwind stack in called functions with unhandled exceptions
|
||||
@@ -20980,7 +20988,7 @@ call by typing the interrupt character (often @kbd{Ctrl-c}).
|
||||
If a called function is interrupted for any reason, including hitting
|
||||
a breakpoint, or triggering a watchpoint, and the stack is not unwound
|
||||
due to @code{set unwind-on-terminating-exception on}, @code{set
|
||||
-unwind-on-timeout on}, or @code{set unwindonsignal on} (@pxref{stack
|
||||
+unwind-on-timeout on}, or @code{set unwind-on-signal on} (@pxref{stack
|
||||
unwind settings}), then the dummy-frame, created by @value{GDBN} to
|
||||
facilitate the call to the program function, will be visible in the
|
||||
backtrace, for example frame @code{#3} in the following backtrace:
|
||||
diff --git a/gdb/infcall.c b/gdb/infcall.c
|
||||
--- a/gdb/infcall.c
|
||||
+++ b/gdb/infcall.c
|
||||
@@ -1747,7 +1747,7 @@ When the function is done executing, GDB will silently stop."),
|
||||
The program being debugged received signal %s, %s\n\
|
||||
while in a function called from GDB. GDB has restored the context\n\
|
||||
to what it was before the call. To change this behavior use\n\
|
||||
-\"set unwindonsignal off\". Evaluation of the expression containing\n\
|
||||
+\"set unwind-on-signal off\". Evaluation of the expression containing\n\
|
||||
the function (%s) will be abandoned."),
|
||||
gdb_signal_to_name (stop_signal),
|
||||
gdb_signal_to_string (stop_signal),
|
||||
@@ -1766,7 +1766,7 @@ the function (%s) will be abandoned."),
|
||||
error (_("\
|
||||
The program being debugged was signaled while in a function called from GDB.\n\
|
||||
GDB remains in the frame where the signal was received.\n\
|
||||
-To change this behavior use \"set unwindonsignal on\".\n\
|
||||
+To change this behavior use \"set unwind-on-signal on\".\n\
|
||||
Evaluation of the expression containing the function\n\
|
||||
(%s) will be abandoned.\n\
|
||||
When the function is done executing, GDB will silently stop."),
|
||||
@@ -1898,17 +1898,22 @@ The default is to perform the conversion."),
|
||||
show_coerce_float_to_double_p,
|
||||
&setlist, &showlist);
|
||||
|
||||
- add_setshow_boolean_cmd ("unwindonsignal", no_class,
|
||||
- &unwind_on_signal_p, _("\
|
||||
+ set_show_commands setshow_unwind_on_signal_cmds
|
||||
+ = add_setshow_boolean_cmd ("unwind-on-signal", no_class,
|
||||
+ &unwind_on_signal_p, _("\
|
||||
Set unwinding of stack if a signal is received while in a call dummy."), _("\
|
||||
Show unwinding of stack if a signal is received while in a call dummy."), _("\
|
||||
-The unwindonsignal lets the user determine what gdb should do if a signal\n\
|
||||
+The unwind-on-signal lets the user determine what gdb should do if a signal\n\
|
||||
is received while in a function called from gdb (call dummy). If set, gdb\n\
|
||||
unwinds the stack and restore the context to what as it was before the call.\n\
|
||||
The default is to stop in the frame where the signal was received."),
|
||||
- NULL,
|
||||
- show_unwind_on_signal_p,
|
||||
- &setlist, &showlist);
|
||||
+ NULL,
|
||||
+ show_unwind_on_signal_p,
|
||||
+ &setlist, &showlist);
|
||||
+ add_alias_cmd ("unwindonsignal", setshow_unwind_on_signal_cmds.set,
|
||||
+ no_class, 1, &setlist);
|
||||
+ add_alias_cmd ("unwindonsignal", setshow_unwind_on_signal_cmds.show,
|
||||
+ no_class, 1, &showlist);
|
||||
|
||||
add_setshow_boolean_cmd ("unwind-on-terminating-exception", no_class,
|
||||
&unwind_on_terminating_exception_p, _("\
|
||||
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
|
||||
--- a/gdb/testsuite/gdb.base/callfuncs.exp
|
||||
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
|
||||
@@ -46,7 +46,7 @@ proc do_function_calls {prototypes} {
|
||||
|
||||
# If any of these calls segv we don't want to affect subsequent tests.
|
||||
# E.g., we want to ensure register values are restored.
|
||||
- gdb_test_no_output "set unwindonsignal on"
|
||||
+ gdb_test_no_output "set unwind-on-signal on"
|
||||
|
||||
gdb_test "p t_char_values(0,0)" " = 0"
|
||||
gdb_test "p t_char_values('a','b')" " = 1"
|
||||
@@ -237,7 +237,7 @@ proc do_function_calls {prototypes} {
|
||||
"call inferior func with struct - returns char *"
|
||||
|
||||
# Restore default value.
|
||||
- gdb_test_no_output "set unwindonsignal off"
|
||||
+ gdb_test_no_output "set unwind-on-signal off"
|
||||
}
|
||||
|
||||
# Procedure to get current content of all registers.
|
||||
diff --git a/gdb/testsuite/gdb.base/infcall-failure.exp b/gdb/testsuite/gdb.base/infcall-failure.exp
|
||||
--- a/gdb/testsuite/gdb.base/infcall-failure.exp
|
||||
+++ b/gdb/testsuite/gdb.base/infcall-failure.exp
|
||||
@@ -137,7 +137,7 @@ proc_with_prefix run_cond_hits_segfault_test { async_p non_stop_p } {
|
||||
"Error in testing condition for breakpoint ${bp_1_num}:" \
|
||||
"The program being debugged was signaled while in a function called from GDB\\." \
|
||||
"GDB remains in the frame where the signal was received\\." \
|
||||
- "To change this behavior use \"set unwindonsignal on\"\\." \
|
||||
+ "To change this behavior use \"set unwind-on-signal on\"\\." \
|
||||
"Evaluation of the expression containing the function" \
|
||||
"\\(func_segfault\\) will be abandoned\\." \
|
||||
"When the function is done executing, GDB will silently stop\\."]
|
||||
@@ -166,7 +166,7 @@ proc_with_prefix run_call_hits_segfault_test { async_p non_stop_p } {
|
||||
"${::decimal}\\s+\[^\r\n\]+Segfault here\[^\r\n\]+" \
|
||||
"The program being debugged was signaled while in a function called from GDB\\." \
|
||||
"GDB remains in the frame where the signal was received\\." \
|
||||
- "To change this behavior use \"set unwindonsignal on\"\\." \
|
||||
+ "To change this behavior use \"set unwind-on-signal on\"\\." \
|
||||
"Evaluation of the expression containing the function" \
|
||||
"\\(func_segfault\\) will be abandoned\\." \
|
||||
"When the function is done executing, GDB will silently stop\\."]
|
||||
diff --git a/gdb/testsuite/gdb.base/unwindonsignal.exp b/gdb/testsuite/gdb.base/unwindonsignal.exp
|
||||
--- a/gdb/testsuite/gdb.base/unwindonsignal.exp
|
||||
+++ b/gdb/testsuite/gdb.base/unwindonsignal.exp
|
||||
@@ -34,13 +34,29 @@ gdb_test "break stop_here" "Breakpoint \[0-9\]* at .*"
|
||||
gdb_test "continue" "Continuing.*Breakpoint \[0-9\]*, stop_here.*" \
|
||||
"continue to breakpoint at stop_here"
|
||||
|
||||
-# Turn on unwindonsignal.
|
||||
-gdb_test_no_output "set unwindonsignal on" \
|
||||
- "setting unwindonsignal"
|
||||
+# Turn on unwind-on-signal.
|
||||
+gdb_test_no_output "set unwind-on-signal on" \
|
||||
+ "setting unwind-on-signal"
|
||||
|
||||
-gdb_test "show unwindonsignal" \
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
"Unwinding of stack .* is on." \
|
||||
- "showing unwindonsignal"
|
||||
+ "showing unwind-on-signal"
|
||||
+
|
||||
+# For backward compatibility we maintain a 'unwindonsignal' alias for
|
||||
+# 'unwind-on-signal', check it now.
|
||||
+gdb_test "show unwindonsignal" \
|
||||
+ "Unwinding of stack .* is on\\." \
|
||||
+ "showing unwindonsignal alias"
|
||||
+
|
||||
+gdb_test_no_output "set unwindonsignal off" \
|
||||
+ "setting unwindonsignal alias to off"
|
||||
+
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
+ "Unwinding of stack .* is off\\." \
|
||||
+ "showing unwind-on-signal after setting via alias"
|
||||
+
|
||||
+gdb_test_no_output "set unwindonsignal on" \
|
||||
+ "setting unwindonsignal alias to on"
|
||||
|
||||
# Call function (causing the program to get a signal), and see if gdb handles
|
||||
# it properly.
|
||||
@@ -49,7 +65,7 @@ if {[gdb_test "call gen_signal ()" \
|
||||
"The program being debugged received signal SIGABRT, Aborted" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(gen_signal\\) will be abandoned\\."] \
|
||||
"unwindonsignal, inferior function call signaled"] != 0} {
|
||||
return 0
|
||||
@@ -58,15 +74,15 @@ if {[gdb_test "call gen_signal ()" \
|
||||
# Verify the stack got unwound.
|
||||
gdb_test "bt" \
|
||||
"#0 *\[x0-9a-f in\]*stop_here \\(.*\\) at .*#1 *\[x0-9a-f in\]*main \\(.*\\) at .*" \
|
||||
- "unwindonsignal, stack unwound"
|
||||
+ "stack unwound"
|
||||
|
||||
# Verify the dummy frame got removed from dummy_frame_stack.
|
||||
gdb_test_multiple "maint print dummy-frames" \
|
||||
- "unwindonsignal, dummy frame removed" {
|
||||
+ "unwind-on-signal, dummy frame removed" {
|
||||
-re "\[\r\n\]*.*stack=.*code=.*\[\r\n\]+$gdb_prompt $" {
|
||||
- fail "unwindonsignal, dummy frame removed"
|
||||
+ fail $gdb_test_name
|
||||
}
|
||||
-re "\[\r\n\]+$gdb_prompt $" {
|
||||
- pass "unwindonsignal, dummy frame removed"
|
||||
+ pass $gdb_test_name
|
||||
}
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.compile/compile-cplus.exp b/gdb/testsuite/gdb.compile/compile-cplus.exp
|
||||
--- a/gdb/testsuite/gdb.compile/compile-cplus.exp
|
||||
+++ b/gdb/testsuite/gdb.compile/compile-cplus.exp
|
||||
@@ -131,13 +131,13 @@ gdb_test "return" "\r\n#0 main .*" "return" \
|
||||
"Make _gdb_expr\\(__gdb_regs\\*\\) return now\\? \\(y or n\\) " "y"
|
||||
gdb_test "info sym $infcall_pc" "\r\nNo symbol matches .*" "info sym not found"
|
||||
|
||||
-gdb_test_no_output "set unwindonsignal on"
|
||||
+gdb_test_no_output "set unwind-on-signal on"
|
||||
gdb_test "compile code *(volatile int *) 0 = 0;" \
|
||||
[multi_line \
|
||||
"The program being debugged received signal SIGSEGV, Segmentation fault" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(_gdb_expr\\(__gdb_regs\\*\\)\\) will be abandoned\\."] \
|
||||
"compile code segfault second"
|
||||
|
||||
@@ -313,7 +313,7 @@ gdb_test "compile code static const int readonly = 1; *(int *) &readonly = 2;" \
|
||||
"The program being debugged received signal SIGSEGV, Segmentation fault" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(_gdb_expr\\(__gdb_regs\\*\\)\\) will be abandoned\\."]
|
||||
gdb_test_no_output "set debug compile off"
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
|
||||
--- a/gdb/testsuite/gdb.compile/compile.exp
|
||||
+++ b/gdb/testsuite/gdb.compile/compile.exp
|
||||
@@ -157,13 +157,13 @@ gdb_test "return" "\r\n#0 main .*" "return" \
|
||||
"Make _gdb_expr return now\\? \\(y or n\\) " "y"
|
||||
gdb_test "info sym $infcall_pc" "\r\nNo symbol matches .*" "info sym not found"
|
||||
|
||||
-gdb_test_no_output "set unwindonsignal on"
|
||||
+gdb_test_no_output "set unwind-on-signal on"
|
||||
gdb_test "compile code *(volatile int *) 0 = 0;" \
|
||||
[multi_line \
|
||||
"The program being debugged received signal SIGSEGV, Segmentation fault" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(_gdb_expr\\) will be abandoned\\."] \
|
||||
"compile code segfault second"
|
||||
|
||||
@@ -321,7 +321,7 @@ gdb_test "compile code static const int readonly = 1; *(int *) &readonly = 2;" \
|
||||
"The program being debugged received signal SIGSEGV, Segmentation fault" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(_gdb_expr\\) will be abandoned\\."]
|
||||
gdb_test_no_output "set debug compile off"
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
|
||||
--- a/gdb/testsuite/gdb.cp/gdb2495.exp
|
||||
+++ b/gdb/testsuite/gdb.cp/gdb2495.exp
|
||||
@@ -98,10 +98,10 @@ if {![runto_main]} {
|
||||
# behaviour; it should not. Test both on and off states.
|
||||
|
||||
# Turn on unwind on signal behaviour.
|
||||
-gdb_test_no_output "set unwindonsignal on"
|
||||
+gdb_test_no_output "set unwind-on-signal on"
|
||||
|
||||
# Check that it is turned on.
|
||||
-gdb_test "show unwindonsignal" \
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
"signal is received while in a call dummy is on.*" \
|
||||
"turn on unwind on signal"
|
||||
|
||||
@@ -112,20 +112,20 @@ gdb_test "p exceptions.raise_signal(1)" \
|
||||
"The program being debugged received signal SIGABRT, Aborted" \
|
||||
"while in a function called from GDB\\. GDB has restored the context" \
|
||||
"to what it was before the call\\. To change this behavior use" \
|
||||
- "\"set unwindonsignal off\"\\. Evaluation of the expression containing" \
|
||||
+ "\"set unwind-on-signal off\"\\. Evaluation of the expression containing" \
|
||||
"the function \\(SimpleException::raise_signal\\(int\\)\\) will be abandoned\\."]\
|
||||
- "check for unwindonsignal off message"
|
||||
+ "check for unwind-on-signal off message"
|
||||
|
||||
# And reverse - turn off again.
|
||||
-gdb_test_no_output "set unwindonsignal off"
|
||||
+gdb_test_no_output "set unwind-on-signal off"
|
||||
|
||||
# Check that it is actually turned off.
|
||||
-gdb_test "show unwindonsignal" \
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
"signal is received while in a call dummy is off.*" \
|
||||
"turn off unwind on signal"
|
||||
|
||||
# Check to see if new behaviour interferes with
|
||||
# normal signal handling in inferior function calls.
|
||||
gdb_test "p exceptions.raise_signal(1)" \
|
||||
- "To change this behavior use \"set unwindonsignal on\".*" \
|
||||
- "check for unwindonsignal on message"
|
||||
+ "To change this behavior use \"set unwind-on-signal on\".*" \
|
||||
+ "check for unwind-on-signal on message"
|
||||
diff --git a/gdb/testsuite/gdb.fortran/function-calls.exp b/gdb/testsuite/gdb.fortran/function-calls.exp
|
||||
--- a/gdb/testsuite/gdb.fortran/function-calls.exp
|
||||
+++ b/gdb/testsuite/gdb.fortran/function-calls.exp
|
||||
@@ -44,7 +44,7 @@ if {![runto [gdb_get_line_number "post_init"]]} {
|
||||
}
|
||||
|
||||
# Use inspired by gdb.base/callfuncs.exp.
|
||||
-gdb_test_no_output "set unwindonsignal on"
|
||||
+gdb_test_no_output "set unwind-on-signal on"
|
||||
|
||||
# Baseline: function and subroutine call with no arguments.
|
||||
gdb_test "p no_arg()" " = .TRUE."
|
||||
diff --git a/gdb/testsuite/gdb.mi/mi-condbreak-fail.exp b/gdb/testsuite/gdb.mi/mi-condbreak-fail.exp
|
||||
--- a/gdb/testsuite/gdb.mi/mi-condbreak-fail.exp
|
||||
+++ b/gdb/testsuite/gdb.mi/mi-condbreak-fail.exp
|
||||
@@ -43,7 +43,7 @@ proc run_test { unwind_on_signal } {
|
||||
return
|
||||
}
|
||||
|
||||
- mi_gdb_test "-gdb-set unwindonsignal ${unwind_on_signal}" {\^done} \
|
||||
+ mi_gdb_test "-gdb-set unwind-on-signal ${unwind_on_signal}" {\^done} \
|
||||
"set unwind-on-signal"
|
||||
|
||||
# Create the conditional breakpoint.
|
||||
@@ -70,7 +70,7 @@ proc run_test { unwind_on_signal } {
|
||||
"&\"The program being debugged received signal SIGSEGV, Segmentation fault\\\\n\"" \
|
||||
"&\"while in a function called from GDB\\. GDB has restored the context\\\\n\"" \
|
||||
"&\"to what it was before the call\\. To change this behavior use\\\\n\"" \
|
||||
- "&\"\\\\\"set unwindonsignal off\\\\\"\\. Evaluation of the expression containing\\\\n\"" \
|
||||
+ "&\"\\\\\"set unwind-on-signal off\\\\\"\\. Evaluation of the expression containing\\\\n\"" \
|
||||
"&\"the function \\(cond_fail\\) will be abandoned\\.\\\\n\"" \
|
||||
"=breakpoint-modified,bkpt={number=\"$bpnum\",type=\"breakpoint\",\[^\r\n\]+times=\"1\",\[^\r\n\]+}" \
|
||||
"~\"\\\\n\"" \
|
||||
@@ -92,7 +92,7 @@ proc run_test { unwind_on_signal } {
|
||||
"&\"Error in testing condition for breakpoint $bpnum:\\\\n\"" \
|
||||
"&\"The program being debugged was signaled while in a function called from GDB\\.\\\\n\"" \
|
||||
"&\"GDB remains in the frame where the signal was received\\.\\\\n\"" \
|
||||
- "&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\.\\\\n\"" \
|
||||
+ "&\"To change this behavior use \\\\\"set unwind-on-signal on\\\\\"\\.\\\\n\"" \
|
||||
"&\"Evaluation of the expression containing the function\\\\n\"" \
|
||||
"&\"\\(cond_fail\\) will be abandoned\\.\\\\n\"" \
|
||||
"&\"When the function is done executing, GDB will silently stop\\.\\\\n\"" \
|
||||
diff --git a/gdb/testsuite/gdb.mi/mi-condbreak-throw.exp b/gdb/testsuite/gdb.mi/mi-condbreak-throw.exp
|
||||
--- a/gdb/testsuite/gdb.mi/mi-condbreak-throw.exp
|
||||
+++ b/gdb/testsuite/gdb.mi/mi-condbreak-throw.exp
|
||||
@@ -103,7 +103,7 @@ proc run_test { unwind_on_exception } {
|
||||
"&\"Error in testing condition for breakpoint $bpnum:\\\\n\"" \
|
||||
"&\"The program being debugged was signaled while in a function called from GDB\\.\\\\n\"" \
|
||||
"&\"GDB remains in the frame where the signal was received\\.\\\\n\"" \
|
||||
- "&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\.\\\\n\"" \
|
||||
+ "&\"To change this behavior use \\\\\"set unwind-on-signal on\\\\\"\\.\\\\n\"" \
|
||||
"&\"Evaluation of the expression containing the function\\\\n\"" \
|
||||
"&\"\\(cond_throw\\(\\)\\) will be abandoned\\.\\\\n\"" \
|
||||
"&\"When the function is done executing, GDB will silently stop\\.\\\\n\"" \
|
||||
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
|
||||
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp
|
||||
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
|
||||
@@ -94,7 +94,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
|
||||
#
|
||||
|
||||
mi_gdb_test "410-data-evaluate-expression bar()" \
|
||||
- ".*410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\".\\\\nEvaluation of the expression containing the function\\\\n\\(bar\\) will be abandoned.\\\\nWhen the function is done executing, GDB will silently stop.\"" \
|
||||
+ ".*410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwind-on-signal on\\\\\".\\\\nEvaluation of the expression containing the function\\\\n\\(bar\\) will be abandoned.\\\\nWhen the function is done executing, GDB will silently stop.\"" \
|
||||
"call inferior function which raises exception"
|
||||
|
||||
mi_gdb_test "411-stack-list-frames" "411\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"}.*\\\]" "backtrace from inferior function at exception"
|
||||
diff --git a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp
|
||||
--- a/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/infcall-from-bp-cond-simple.exp
|
||||
@@ -173,7 +173,7 @@ proc_with_prefix run_bp_cond_segfaults { target_async target_non_stop } {
|
||||
"Error in testing condition for breakpoint ${bp_1_num}:" \
|
||||
"The program being debugged was signaled while in a function called from GDB\\." \
|
||||
"GDB remains in the frame where the signal was received\\." \
|
||||
- "To change this behavior use \"set unwindonsignal on\"\\." \
|
||||
+ "To change this behavior use \"set unwind-on-signal on\"\\." \
|
||||
"Evaluation of the expression containing the function" \
|
||||
"\\(function_that_segfaults\\) will be abandoned\\." \
|
||||
"When the function is done executing, GDB will silently stop\\."]
|
||||
diff --git a/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp b/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
|
||||
--- a/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
|
||||
+++ b/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
|
||||
@@ -13,7 +13,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
-# Test use of unwindonsignal when a hand function call that gets interrupted
|
||||
+# Test use of unwind-on-signal when a hand function call that gets interrupted
|
||||
# by a signal in another thread.
|
||||
|
||||
set NR_THREADS 4
|
||||
@@ -49,12 +49,12 @@ gdb_test "continue" \
|
||||
# We want the main thread (hand_call_with_signal) and
|
||||
# thread 1 (sigabrt_handler) to both run.
|
||||
|
||||
-# Do turn on unwindonsignal.
|
||||
+# Do turn on unwind-on-signal.
|
||||
# We want to test gdb handling of the current thread changing when
|
||||
# unwindonsignal is in effect.
|
||||
-gdb_test_no_output "set unwindonsignal on" \
|
||||
+gdb_test_no_output "set unwind-on-signal on" \
|
||||
"setting unwindonsignal"
|
||||
-gdb_test "show unwindonsignal" \
|
||||
+gdb_test "show unwind-on-signal" \
|
||||
"Unwinding of stack .* is on." \
|
||||
"showing unwindonsignal"
|
||||
|
@ -1,379 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Burgess <aburgess@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 13:52:59 +0000
|
||||
Subject: gdb-rhel-19390-pc-not-saved.patch
|
||||
|
||||
;;gdb/unwinders: better support for $pc not saved
|
||||
;;(Andrew Burgess, RHEL-19390)
|
||||
|
||||
This started with a Red Hat bug report which can be seen here:
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1850710
|
||||
|
||||
The problem reported here was using GDB on GNU/Linux for S390, the
|
||||
user stepped into JIT generated code. As they enter the JIT code GDB
|
||||
would report 'PC not saved', and this same message would be reported
|
||||
after each step/stepi.
|
||||
|
||||
Additionally, the user had 'set disassemble-next-line on', and once
|
||||
they entered the JIT code this output was not displayed, nor were any
|
||||
'display' directives displayed.
|
||||
|
||||
The user is not making use of the JIT plugin API to provide debug
|
||||
information. But that's OK, they aren't expecting any source level
|
||||
debug here, they are happy to use 'stepi', but the missing 'display'
|
||||
directives are a problem, as is the constant 'PC not saved' (error)
|
||||
message.
|
||||
|
||||
What is happening here is that as GDB is failing to find any debug
|
||||
information for the JIT generated code, it is falling back on to the
|
||||
S390 prologue unwinder to try and unwind frame #0. Unfortunately,
|
||||
without being able to identify the function boundaries, the S390
|
||||
prologue scanner can't help much, in fact, it doesn't even suggest an
|
||||
arbitrary previous $pc value (some targets that use a link-register
|
||||
will, by default, assume the link-register contains the previous $pc),
|
||||
instead the S390 will just say, "sorry, I have no previous $pc value".
|
||||
|
||||
The result of this is that when GDB tries to find frame #1 we end
|
||||
throwing an error from frame_unwind_pc (the 'PC not saved' error).
|
||||
This error is not caught anywhere except at the top-level interpreter
|
||||
loop, and so we end up skipping all the 'display' directive handling.
|
||||
|
||||
While thinking about this, I wondered, could I trigger the same error
|
||||
using the Python Unwinder API? What happens if a Python unwinder
|
||||
claims a frame, but then fails to provide a previous $pc value?
|
||||
|
||||
Turns out that exactly the same thing happens, which is great, as that
|
||||
means we now have a way to reproduce this bug on any target. And so
|
||||
the test included with this patch does just this. I have a Python
|
||||
unwinder that claims a frame, but doesn't provide any previous
|
||||
register values.
|
||||
|
||||
I then do two tests, first I stop in the claimed frame (i.e. frame #0
|
||||
is the frame that can't be unwound), I perform a few steps, and check
|
||||
the backtrace. And second, I stop in a child of the problem
|
||||
frame (i.e. frame #1 is the frame that can't be unwound), and from
|
||||
here I check the backtrace.
|
||||
|
||||
While all this is going on I have a 'display' directive in place, and
|
||||
each time GDB stops I check that the display directive triggers.
|
||||
|
||||
Additionally, when checking the backtrace, I am checking that the
|
||||
backtrace finishes with the message 'Backtrace stopped: frame did not
|
||||
save the PC'.
|
||||
|
||||
As for the fix I chose to add a call to frame_unwind_pc directly to
|
||||
get_prev_frame_always_1. Calling frame_unwind_pc will cache the
|
||||
unwound $pc value, so this doesn't add much additional work as
|
||||
immediately after the new frame_unwind_pc call, we call
|
||||
get_prev_frame_maybe_check_cycle, which actually generates the
|
||||
previous frame, which will always (I think) require a call to
|
||||
frame_unwind_pc anyway.
|
||||
|
||||
The reason for adding the frame_unwind_pc call into
|
||||
get_prev_frame_always_1, is that if the frame_unwind_pc call fails we
|
||||
want to set the frames 'stop_reason', and get_prev_frame_always_1
|
||||
seems to be the place where this is done, so I wanted to keep the new
|
||||
stop_reason setting code next to all the existing stop_reason setting
|
||||
code.
|
||||
|
||||
Additionally, once we enter get_prev_frame_maybe_check_cycle we
|
||||
actually create the previous frame, then, if it turns out that the
|
||||
previous frame can't be created we need to remove the frame .. this
|
||||
seemed more complex than just making the check in
|
||||
get_prev_frame_always_1.
|
||||
|
||||
With this fix in place the original S390 bug is fixed, and also the
|
||||
test added in this commit, that uses the Python API, is also fixed.
|
||||
|
||||
Reviewed-By: Kevin Buettner <kevinb@redhat.com>
|
||||
|
||||
diff --git a/gdb/frame.c b/gdb/frame.c
|
||||
--- a/gdb/frame.c
|
||||
+++ b/gdb/frame.c
|
||||
@@ -2422,6 +2422,38 @@ get_prev_frame_always_1 (frame_info_ptr this_frame)
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Ensure we can unwind the program counter of THIS_FRAME. */
|
||||
+ try
|
||||
+ {
|
||||
+ /* Calling frame_unwind_pc for the sentinel frame relies on the
|
||||
+ current_frame being set, which at this point it might not be if we
|
||||
+ are in the process of setting the current_frame after a stop (see
|
||||
+ get_current_frame).
|
||||
+
|
||||
+ The point of this check is to ensure that the unwinder for
|
||||
+ THIS_FRAME can actually unwind the $pc, which we assume the
|
||||
+ sentinel frame unwinder can always do (it's just a read from the
|
||||
+ machine state), so we only call frame_unwind_pc for frames other
|
||||
+ than the sentinel (level -1) frame.
|
||||
+
|
||||
+ Additionally, we don't actually care about the value of the
|
||||
+ unwound $pc, just that the call completed successfully. */
|
||||
+ if (this_frame->level >= 0)
|
||||
+ frame_unwind_pc (this_frame);
|
||||
+ }
|
||||
+ catch (const gdb_exception_error &ex)
|
||||
+ {
|
||||
+ if (ex.error == NOT_AVAILABLE_ERROR || ex.error == OPTIMIZED_OUT_ERROR)
|
||||
+ {
|
||||
+ frame_debug_printf (" -> nullptr // no saved PC");
|
||||
+ this_frame->stop_reason = UNWIND_NO_SAVED_PC;
|
||||
+ this_frame->prev = nullptr;
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ throw;
|
||||
+ }
|
||||
+
|
||||
return get_prev_frame_maybe_check_cycle (this_frame);
|
||||
}
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/pc-not-saved.c b/gdb/testsuite/gdb.base/pc-not-saved.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/pc-not-saved.c
|
||||
@@ -0,0 +1,48 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2024 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+volatile int global_var = 0;
|
||||
+
|
||||
+void
|
||||
+other_func (void)
|
||||
+{
|
||||
+ /* Nothing. */
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+break_bt_here (void)
|
||||
+{
|
||||
+ /* This is all nonsense; just filler so this function has a body. */
|
||||
+ if (global_var != 99)
|
||||
+ global_var++;
|
||||
+ if (global_var != 98)
|
||||
+ global_var++;
|
||||
+ if (global_var != 97)
|
||||
+ global_var++;
|
||||
+ if (global_var != 96)
|
||||
+ global_var++;
|
||||
+ other_func ();
|
||||
+ if (global_var != 95)
|
||||
+ global_var++;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ break_bt_here ();
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/pc-not-saved.exp b/gdb/testsuite/gdb.base/pc-not-saved.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/pc-not-saved.exp
|
||||
@@ -0,0 +1,113 @@
|
||||
+# Copyright 2024 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Test how GDB handles a frame in which the previous-pc value is not
|
||||
+# available. Specifically, check that the backtrace correctly reports
|
||||
+# why the backtrace is truncated, and ensure that 'display' directives
|
||||
+# still work when 'stepi'-ing through the frame.
|
||||
+#
|
||||
+# We do this by registering a Python unwinder which doesn't provide
|
||||
+# any previous register values.
|
||||
+
|
||||
+require allow_python_tests
|
||||
+
|
||||
+standard_testfile
|
||||
+
|
||||
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+set remote_python_file \
|
||||
+ [gdb_remote_download host "${srcdir}/${subdir}/${testfile}.py"]
|
||||
+
|
||||
+if { ![runto "break_bt_here"] } {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# Figuring out the correct frame-id from a Python unwinder is hard.
|
||||
+# We need to know the function's start address (not too hard), and the
|
||||
+# stack address on entry to the function, which is much harder to
|
||||
+# figure out in a cross-target way.
|
||||
+#
|
||||
+# So instead we run without any Python unwinder in place and use
|
||||
+# 'maint print frame-id' to record the frame-id. We then restart GDB,
|
||||
+# load the Python unwinder, and tell it to use the frame-id we
|
||||
+# recorded here.
|
||||
+set pc unknown
|
||||
+set cfa unknown
|
||||
+gdb_test_multiple "maintenance print frame-id" "store break_bt_here frame-id" {
|
||||
+ -re -wrap "frame-id for frame #0: \\{stack=($hex),code=($hex),\[^\}\]+\\}" {
|
||||
+ set cfa $expect_out(1,string)
|
||||
+ set pc $expect_out(1,string)
|
||||
+ }
|
||||
+}
|
||||
+gdb_assert { ![string equal $cfa unknown] } \
|
||||
+ "check we read the frame's CFA"
|
||||
+
|
||||
+gdb_assert { ![string equal $pc unknown] } \
|
||||
+ "check we read the frame's PC"
|
||||
+
|
||||
+# Restart and load the Python unwinder script.
|
||||
+clean_restart $binfile
|
||||
+gdb_test_no_output "source ${remote_python_file}" "load python file"
|
||||
+
|
||||
+# Tell the Python unwinder to use the frame-id we cached above.
|
||||
+gdb_test_no_output "python set_break_bt_here_frame_id($pc, $cfa)"
|
||||
+
|
||||
+# Run up to the function which the unwinder will claim.
|
||||
+if { ![runto "break_bt_here"] } {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# Print the backtrace. Check that the reason for stopping the
|
||||
+# backtrace is that the previous $pc is not available.
|
||||
+gdb_test "bt" \
|
||||
+ [multi_line \
|
||||
+ "^#0 break_bt_here \\(\\) at \[^\r\n\]+" \
|
||||
+ "Backtrace stopped: frame did not save the PC"] \
|
||||
+ "backtrace from break_bt_here function"
|
||||
+
|
||||
+# Ensure we can stepi.
|
||||
+gdb_test "stepi" \
|
||||
+ "(:?$hex\\s+)?$decimal\\s+\[^\r\n\]+" \
|
||||
+ "stepi without a display in place"
|
||||
+
|
||||
+# Setup a 'display' directive.
|
||||
+gdb_test "display/i \$pc" \
|
||||
+ [multi_line \
|
||||
+ "^1: x/i \\\$pc" \
|
||||
+ "=> $hex <break_bt_here(:?\\+$decimal)?>:\\s+\[^\r\n\]+"]
|
||||
+
|
||||
+# Step again, check the 'display' directive is shown.
|
||||
+gdb_test "stepi" \
|
||||
+ [multi_line \
|
||||
+ "(:?$hex\\s+)?$decimal\\s+\[^\r\n\]+" \
|
||||
+ "1: x/i \\\$pc" \
|
||||
+ "=> $hex <break_bt_here(:?\\+$decimal)?>:\\s+\[^\r\n\]+"] \
|
||||
+ "stepi with a display in place"
|
||||
+
|
||||
+# Continue to a function that is called from within break_bt_here.
|
||||
+# The Python unwinder will then be claiming frame #1.
|
||||
+gdb_breakpoint other_func
|
||||
+gdb_continue_to_breakpoint "continue to other_func"
|
||||
+
|
||||
+# Print the backtrace and check that the reason for stopping the
|
||||
+# backtrace is that the previous $pc is not available.
|
||||
+gdb_test "bt" \
|
||||
+ [multi_line \
|
||||
+ "#0 other_func \\(\\) at \[^\r\n\]+" \
|
||||
+ "#1 (:?$hex in )?break_bt_here \\(\\) at \[^\r\n\]+" \
|
||||
+ "Backtrace stopped: frame did not save the PC"] \
|
||||
+ "backtrace from other_func function"
|
||||
diff --git a/gdb/testsuite/gdb.base/pc-not-saved.py b/gdb/testsuite/gdb.base/pc-not-saved.py
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/pc-not-saved.py
|
||||
@@ -0,0 +1,71 @@
|
||||
+# Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+import gdb
|
||||
+from gdb.unwinder import Unwinder, FrameId
|
||||
+
|
||||
+# Cached FrameId. See set_break_bt_here_frame_id for details.
|
||||
+break_bt_here_frame_id = None
|
||||
+
|
||||
+
|
||||
+def set_break_bt_here_frame_id(pc, cfa):
|
||||
+ """Call this to pre-calculate the FrameId for the frame our unwinder
|
||||
+ is going to claim, this avoids us having to actually figure out a
|
||||
+ frame-id within the unwinder, something which is going to be hard
|
||||
+ to do in a cross-target way.
|
||||
+
|
||||
+ Instead we first run the test without the Python unwinder in
|
||||
+ place, use 'maint print frame-id' to record the frame-id, then,
|
||||
+ after loading this Python script, we all this function to record
|
||||
+ the frame-id that the unwinder should use."""
|
||||
+ global break_bt_here_frame_id
|
||||
+ break_bt_here_frame_id = FrameId(cfa, pc)
|
||||
+
|
||||
+
|
||||
+class break_unwinding(Unwinder):
|
||||
+
|
||||
+ """An unwinder for the function 'break_bt_here'. This unwinder will
|
||||
+ claim any frame for the function in question, but doesn't provide
|
||||
+ any unwound register values. Importantly, we don't provide a
|
||||
+ previous $pc value, this means that if we are stopped in
|
||||
+ 'break_bt_here' then we should fail to unwind beyond frame #0."""
|
||||
+
|
||||
+ def __init__(self):
|
||||
+ Unwinder.__init__(self, "break unwinding")
|
||||
+
|
||||
+ def __call__(self, pending_frame):
|
||||
+ pc_desc = pending_frame.architecture().registers().find("pc")
|
||||
+ pc = pending_frame.read_register(pc_desc)
|
||||
+
|
||||
+ if pc.is_optimized_out:
|
||||
+ return None
|
||||
+
|
||||
+ block = gdb.block_for_pc(pc)
|
||||
+ if block == None:
|
||||
+ return None
|
||||
+ func = block.function
|
||||
+ if func == None:
|
||||
+ return None
|
||||
+ if str(func) != "break_bt_here":
|
||||
+ return None
|
||||
+
|
||||
+ global break_bt_here_frame_id
|
||||
+ if break_bt_here_frame_id is None:
|
||||
+ return None
|
||||
+
|
||||
+ return pending_frame.create_unwind_info(break_bt_here_frame_id)
|
||||
+
|
||||
+
|
||||
+gdb.unwinder.register_unwinder(None, break_unwinding(), True)
|
@ -1,46 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.ibm.com>
|
||||
Date: Tue, 13 Feb 2024 18:55:29 +0100
|
||||
Subject: gdb-rhel-36225-add-arch14-record.patch
|
||||
|
||||
;; Backport "gdb: s390: Add arch14 record/replay support"
|
||||
;; (Andreas Arnez, RHEL-36225)
|
||||
|
||||
Enable recording of the new "arch14" instructions on z/Architecture
|
||||
targets, except for the specialized-function-assist instruction NNPA.
|
||||
|
||||
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
|
||||
--- a/gdb/s390-tdep.c
|
||||
+++ b/gdb/s390-tdep.c
|
||||
@@ -5534,6 +5534,14 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
case 0xe635: /* VLRL - vector load rightmost with immed. length */
|
||||
case 0xe637: /* VLRLR - vector load rightmost with length */
|
||||
case 0xe649: /* VLIP - vector load immediate decimal */
|
||||
+ case 0xe656: /* VCLFNH - vector fp convert and lengthen from NNP high */
|
||||
+ case 0xe65e: /* VCLFNL - vector fp convert and lengthen from NNP low */
|
||||
+ case 0xe655: /* VCNF - vector fp convert to NNP */
|
||||
+ case 0xe65d: /* VCFN - vector fp convert from NNP */
|
||||
+ case 0xe674: /* VSCHP - decimal scale and convert to HFP */
|
||||
+ case 0xe675: /* VCRNF - vector fp convert and round to NNP */
|
||||
+ case 0xe67c: /* VSCSHP - decimal scale and convert and split to HFP */
|
||||
+ case 0xe67d: /* VCSPH - vector convert HFP to scaled decimal */
|
||||
case 0xe700: /* VLEB - vector load element */
|
||||
case 0xe701: /* VLEH - vector load element */
|
||||
case 0xe702: /* VLEG - vector load element */
|
||||
@@ -5791,11 +5799,16 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
|
||||
/* 0xe747-0xe749 undefined */
|
||||
|
||||
+ case 0xe651: /* VCLZDP - vector count leading zero digits */
|
||||
+ case 0xe654: /* VUPKZH - vector unpack zoned high */
|
||||
case 0xe658: /* VCVD - vector convert to decimal 32 bit */
|
||||
case 0xe659: /* VSRP - vector shift and round decimal */
|
||||
case 0xe65a: /* VCVDG - vector convert to decimal 64 bit*/
|
||||
case 0xe65b: /* VPSOP - vector perform sign operation decimal */
|
||||
+ case 0xe65c: /* VUPKZL - vector unpack zoned low */
|
||||
+ case 0xe670: /* VPKZR - vector pack zoned register */
|
||||
case 0xe671: /* VAP - vector add decimal */
|
||||
+ case 0xe672: /* VSRPR - vector shift and round decimal register */
|
||||
case 0xe673: /* VSP - vector subtract decimal */
|
||||
case 0xe678: /* VMP - vector multiply decimal */
|
||||
case 0xe679: /* VMSP - vector multiply decimal */
|
@ -1,48 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Peter Bergner <bergner@linux.ibm.com>
|
||||
Date: Fri, 9 Feb 2024 10:51:30 -0600
|
||||
Subject: gdb-rhel-36518-add-power11-support.patch
|
||||
|
||||
;; Backport "PowerPC: Add support for Power11 options"
|
||||
;; (Peter Bergner, RHEL-36518)
|
||||
|
||||
opcodes/
|
||||
* ppc-dis.c (ppc_opts): Add "power11" and "pwr11" entries.
|
||||
(powerpc_init_dialect): Default to "power11".
|
||||
|
||||
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
|
||||
--- a/opcodes/ppc-dis.c
|
||||
+++ b/opcodes/ppc-dis.c
|
||||
@@ -208,6 +208,11 @@ struct ppc_mopt ppc_opts[] = {
|
||||
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
| PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
|
||||
0 },
|
||||
+ { "power11", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
|
||||
+ | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
|
||||
+ | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
+ | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
|
||||
+ 0 },
|
||||
{ "libresoc",(PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
|
||||
| PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
|
||||
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
@@ -267,6 +272,11 @@ struct ppc_mopt ppc_opts[] = {
|
||||
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
| PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
|
||||
0 },
|
||||
+ { "pwr11", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
|
||||
+ | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
|
||||
+ | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
|
||||
+ | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
|
||||
+ 0 },
|
||||
{ "pwrx", PPC_OPCODE_POWER | PPC_OPCODE_POWER2,
|
||||
0 },
|
||||
{ "raw", PPC_OPCODE_PPC,
|
||||
@@ -396,7 +406,7 @@ powerpc_init_dialect (struct disassemble_info *info)
|
||||
break;
|
||||
default:
|
||||
if (info->arch == bfd_arch_powerpc)
|
||||
- dialect = ppc_parse_cpu (dialect, &sticky, "power10") | PPC_OPCODE_ANY;
|
||||
+ dialect = ppc_parse_cpu (dialect, &sticky, "power11") | PPC_OPCODE_ANY;
|
||||
else
|
||||
dialect = ppc_parse_cpu (dialect, &sticky, "pwr");
|
||||
break;
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,10 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Wed, 9 Apr 2025 08:59:24 +0200
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-12of12.patch
|
||||
Subject: gdb-rhel-50069-support-z17.patch
|
||||
|
||||
;; Backkport "s390: Add support for z17 as CPU name"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
;; Backport "s390: Add support for z17 as CPU name"
|
||||
;; (Jens Remus, RHEL-50069)
|
||||
|
||||
So far IBM z17 was identified as arch15. Add the real name, as it has
|
||||
been announced. [1]
|
||||
@ -26,7 +26,7 @@ Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c
|
||||
--- a/opcodes/s390-mkopc.c
|
||||
+++ b/opcodes/s390-mkopc.c
|
||||
@@ -384,7 +384,8 @@ main (void)
|
||||
@@ -443,7 +443,8 @@ main (void)
|
||||
else if (strcmp (cpu_string, "z16") == 0
|
||||
|| strcmp (cpu_string, "arch14") == 0)
|
||||
min_cpu = S390_OPCODE_ARCH14;
|
||||
@ -35,4 +35,4 @@ diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c
|
||||
+ || strcmp (cpu_string, "arch15") == 0)
|
||||
min_cpu = S390_OPCODE_ARCH15;
|
||||
else {
|
||||
fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string);
|
||||
print_error ("Mnemonic \"%s\": Couldn't parse CPU string: %s\n",
|
@ -1,103 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-10of12.patch
|
||||
|
||||
;; Backkport "s390: Relax risbg[n]z, risb{h|l}gz, {rns|ros|rxs}bgt operand constraints"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
This leverages commit ("s390: Simplify (dis)assembly of insn operands
|
||||
with const bits") to relax the operand constraints of the immediate
|
||||
operand that contains the constant Z- or T-bit of the following extended
|
||||
mnemonics:
|
||||
risbgz, risbgnz, risbhgz, risblgz, rnsbgt, rosbgt, rxsbgt
|
||||
|
||||
Previously those instructions were the only ones where the assembler
|
||||
on s390 restricted the specification of the subject I3/I4 operand values
|
||||
exactly according to their specification to an unsigned 6- or 5-bit
|
||||
unsigned integer. For any other instructions the assembler allows to
|
||||
specify any operand value allowed by the instruction format, regardless
|
||||
of whether the instruction specification is more restrictive.
|
||||
|
||||
Allow to specify the subject I3/I4 operand as unsigned 8-bit integer
|
||||
with the constant operand bits being ORed during assembly.
|
||||
Relax the instructions subject significant operand bit masks to only
|
||||
consider the Z/T-bit as significant, so that the instructions get
|
||||
disassembled as their *z or *t flavor regardless of whether any reserved
|
||||
bits are set in addition to the Z/T-bit.
|
||||
Adapt the rnsbg, rosbg, and rxsbg test cases not to inadvertently set
|
||||
the T-bit in operand I3, as they otherwise get disassembled as their
|
||||
rnsbgt, rosbgt, and rxsbgt counterpart.
|
||||
|
||||
This aligns GNU Assembler to LLVM Assembler.
|
||||
|
||||
opcodes/
|
||||
* s390-opc.c (U6_18, U5_27, U6_26): Remove.
|
||||
(INSTR_RIE_RRUUU2, INSTR_RIE_RRUUU3, INSTR_RIE_RRUUU4): Define
|
||||
as INSTR_RIE_RRUUU while retaining insn fmt mask.
|
||||
(MASK_RIE_RRUUU2, MASK_RIE_RRUUU3, MASK_RIE_RRUUU4): Treat only
|
||||
Z/T-bit of I3/I4 operand as significant.
|
||||
|
||||
gas/testsuite/
|
||||
* gas/s390/zarch-z10.s (rnsbg, rosbg, rxsbg): Do not set T-bit.
|
||||
|
||||
Reported-by: Dominik Steenken <dost@de.ibm.com>
|
||||
Suggested-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
|
||||
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
|
||||
--- a/opcodes/s390-opc.c
|
||||
+++ b/opcodes/s390-opc.c
|
||||
@@ -216,15 +216,9 @@ const struct s390_operand s390_operands[] =
|
||||
{ 4, 36, 0 },
|
||||
#define U8_8 (U4_36 + 1) /* 8 bit unsigned value starting at 8 */
|
||||
{ 8, 8, 0 },
|
||||
-#define U6_18 (U8_8 + 1) /* 6 bit unsigned value starting at 18 */
|
||||
- { 6, 18, 0 },
|
||||
-#define U8_16 (U6_18 + 1) /* 8 bit unsigned value starting at 16 */
|
||||
+#define U8_16 (U8_8 + 1) /* 8 bit unsigned value starting at 16 */
|
||||
{ 8, 16, 0 },
|
||||
-#define U5_27 (U8_16 + 1) /* 5 bit unsigned value starting at 27 */
|
||||
- { 5, 27, 0 },
|
||||
-#define U6_26 (U5_27 + 1) /* 6 bit unsigned value starting at 26 */
|
||||
- { 6, 26, 0 },
|
||||
-#define U8_24 (U6_26 + 1) /* 8 bit unsigned value starting at 24 */
|
||||
+#define U8_24 (U8_16 + 1) /* 8 bit unsigned value starting at 24 */
|
||||
{ 8, 24, 0 },
|
||||
#define U8_28 (U8_24 + 1) /* 8 bit unsigned value starting at 28 */
|
||||
{ 8, 28, 0 },
|
||||
@@ -288,7 +282,7 @@ unused_s390_operands_static_asserts (void)
|
||||
p - pc relative
|
||||
r - general purpose register
|
||||
re - gpr extended operand, a valid general purpose register pair
|
||||
- u - unsigned integer, 4, 6, 8, 16 or 32 bit
|
||||
+ u - unsigned integer, 4, 8, 16 or 32 bit
|
||||
m - mode field, 4 bit
|
||||
0 - operand skipped.
|
||||
The order of the letters reflects the layout of the format in
|
||||
@@ -324,9 +318,9 @@ unused_s390_operands_static_asserts (void)
|
||||
#define INSTR_RIE_R0U0 6, { R_8,U16_16,0,0,0,0 } /* e.g. clfitne */
|
||||
#define INSTR_RIE_RUI0 6, { R_8,I16_16,U4_12,0,0,0 } /* e.g. lochi */
|
||||
#define INSTR_RIE_RRUUU 6, { R_8,R_12,U8_16,U8_24,U8_32,0 } /* e.g. rnsbg */
|
||||
-#define INSTR_RIE_RRUUU2 6, { R_8,R_12,U8_16,U6_26,U8_32,0 } /* e.g. risbgz */
|
||||
-#define INSTR_RIE_RRUUU3 6, { R_8,R_12,U8_16,U5_27,U8_32,0 } /* e.g. risbhg */
|
||||
-#define INSTR_RIE_RRUUU4 6, { R_8,R_12,U6_18,U8_24,U8_32,0 } /* e.g. rnsbgt */
|
||||
+#define INSTR_RIE_RRUUU2 INSTR_RIE_RRUUU /* e.g. risbgz */
|
||||
+#define INSTR_RIE_RRUUU3 INSTR_RIE_RRUUU /* e.g. risbhg */
|
||||
+#define INSTR_RIE_RRUUU4 INSTR_RIE_RRUUU /* e.g. rnsbgt */
|
||||
#define INSTR_RIL_0P 6, { J32_16,0,0,0,0 } /* e.g. jg */
|
||||
#define INSTR_RIL_RP 6, { R_8,J32_16,0,0,0,0 } /* e.g. brasl */
|
||||
#define INSTR_RIL_UP 6, { U4_8,J32_16,0,0,0,0 } /* e.g. brcl */
|
||||
@@ -551,9 +545,9 @@ unused_s390_operands_static_asserts (void)
|
||||
#define MASK_RIE_R0U0 { 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff }
|
||||
#define MASK_RIE_RUI0 { 0xff, 0x00, 0x00, 0x00, 0xff, 0xff }
|
||||
#define MASK_RIE_RRUUU { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
-#define MASK_RIE_RRUUU2 { 0xff, 0x00, 0x00, 0xc0, 0x00, 0xff }
|
||||
-#define MASK_RIE_RRUUU3 { 0xff, 0x00, 0x00, 0xe0, 0x00, 0xff }
|
||||
-#define MASK_RIE_RRUUU4 { 0xff, 0x00, 0xc0, 0x00, 0x00, 0xff }
|
||||
+#define MASK_RIE_RRUUU2 { 0xff, 0x00, 0x00, 0x80, 0x00, 0xff }
|
||||
+#define MASK_RIE_RRUUU3 { 0xff, 0x00, 0x00, 0x80, 0x00, 0xff }
|
||||
+#define MASK_RIE_RRUUU4 { 0xff, 0x00, 0x80, 0x00, 0x00, 0xff }
|
||||
#define MASK_RIL_0P { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RIL_RP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RIL_UP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
|
@ -1,244 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-11of12.patch
|
||||
|
||||
;; Backkport "s390: Add arch15 instructions"
|
||||
;; (Andreas Krebbel, RHEL-86801)
|
||||
|
||||
opcodes/
|
||||
* s390-mkopc.c (main) Accept arch15 as CPU string.
|
||||
* s390-opc.txt: Add arch15 instructions.
|
||||
|
||||
include/
|
||||
* opcode/s390.h (enum s390_opcode_cpu_val): Add
|
||||
S390_OPCODE_ARCH15.
|
||||
|
||||
gas/
|
||||
* config/tc-s390.c (s390_parse_cpu): New entry for arch15.
|
||||
* doc/c-s390.texi: Document arch15 march option.
|
||||
* doc/as.texi: Likewise.
|
||||
* testsuite/gas/s390/s390.exp: Run the arch15 related tests.
|
||||
* testsuite/gas/s390/zarch-arch15.d: Tests for arch15
|
||||
instructions.
|
||||
* testsuite/gas/s390/zarch-arch15.s: Likewise.
|
||||
|
||||
Signed-off-by: Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
|
||||
|
||||
diff --git a/include/opcode/s390.h b/include/opcode/s390.h
|
||||
--- a/include/opcode/s390.h
|
||||
+++ b/include/opcode/s390.h
|
||||
@@ -45,6 +45,7 @@ enum s390_opcode_cpu_val
|
||||
S390_OPCODE_ARCH12,
|
||||
S390_OPCODE_ARCH13,
|
||||
S390_OPCODE_ARCH14,
|
||||
+ S390_OPCODE_ARCH15,
|
||||
S390_OPCODE_MAXCPU
|
||||
};
|
||||
|
||||
diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c
|
||||
--- a/opcodes/s390-mkopc.c
|
||||
+++ b/opcodes/s390-mkopc.c
|
||||
@@ -384,6 +384,8 @@ main (void)
|
||||
else if (strcmp (cpu_string, "z16") == 0
|
||||
|| strcmp (cpu_string, "arch14") == 0)
|
||||
min_cpu = S390_OPCODE_ARCH14;
|
||||
+ else if (strcmp (cpu_string, "arch15") == 0)
|
||||
+ min_cpu = S390_OPCODE_ARCH15;
|
||||
else {
|
||||
fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string);
|
||||
exit (1);
|
||||
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
|
||||
--- a/opcodes/s390-opc.c
|
||||
+++ b/opcodes/s390-opc.c
|
||||
@@ -228,7 +228,9 @@ const struct s390_operand s390_operands[] =
|
||||
{ 12, 16, 0 },
|
||||
#define U16_16 (U12_16 + 1) /* 16 bit unsigned value starting at 16 */
|
||||
{ 16, 16, 0 },
|
||||
-#define U16_32 (U16_16 + 1) /* 16 bit unsigned value starting at 32 */
|
||||
+#define U16_20 (U16_16 + 1) /* 16 bit unsigned value starting at 20 */
|
||||
+ { 16, 20, 0 },
|
||||
+#define U16_32 (U16_20 + 1) /* 16 bit unsigned value starting at 32 */
|
||||
{ 16, 32, 0 },
|
||||
#define U32_16 (U16_32 + 1) /* 32 bit unsigned value starting at 16 */
|
||||
{ 32, 16, 0 },
|
||||
@@ -484,6 +486,8 @@ unused_s390_operands_static_asserts (void)
|
||||
#define INSTR_VRI_VVUUU 6, { V_8,V_12,U12_16,U4_32,U4_28,0 } /* e.g. vftci */
|
||||
#define INSTR_VRI_VVUUU2 6, { V_8,V_12,U8_28,U8_16,U4_24,0 } /* e.g. vpsop */
|
||||
#define INSTR_VRI_VR0UU 6, { V_8,R_12,U8_28,U4_24,0,0 } /* e.g. vcvd */
|
||||
+#define INSTR_VRI_VV0UU 6, { V_8,V_12,U8_28,U4_24,0,0 } /* e.g. vcvdq */
|
||||
+#define INSTR_VRI_VVV0UV 6, { V_8,V_12,V_16,V_32,U8_24,0 } /* e.g. veval */
|
||||
#define INSTR_VRX_VRRD 6, { V_8,D_20,X_12,B_16,0,0 } /* e.g. vl */
|
||||
#define INSTR_VRX_VV 6, { V_8,V_12,0,0,0,0 } /* e.g. vlr */
|
||||
#define INSTR_VRX_VRRDU 6, { V_8,D_20,X_12,B_16,U4_32,0 } /* e.g. vlrep */
|
||||
@@ -494,10 +498,10 @@ unused_s390_operands_static_asserts (void)
|
||||
#define INSTR_VRS_VRRDU 6, { V_8,R_12,D_20,B_16,U4_32,0 } /* e.g. vlvg */
|
||||
#define INSTR_VRS_VRRD 6, { V_8,R_12,D_20,B_16,0,0 } /* e.g. vlvgb */
|
||||
#define INSTR_VRS_RRDV 6, { V_32,R_12,D_20,B_16,0,0 } /* e.g. vlrlr */
|
||||
-#define INSTR_VRR_0V 6, { V_12,0,0,0,0,0 } /* e.g. vtp */
|
||||
#define INSTR_VRR_VRR 6, { V_8,R_12,R_16,0,0,0 } /* e.g. vlvgp */
|
||||
#define INSTR_VRR_VVV0U 6, { V_8,V_12,V_16,U4_32,0,0 } /* e.g. vmrh */
|
||||
#define INSTR_VRR_VVV0U0 6, { V_8,V_12,V_16,U4_24,0,0 } /* e.g. vfaeb */
|
||||
+#define INSTR_VRR_VVV0U02 6, { V_8,V_12,V_16,U4_28,0,0 } /* e.g. vd */
|
||||
#define INSTR_VRR_VVV0U1 INSTR_VRR_VVV0U0 /* e.g. vfaebs*/
|
||||
#define INSTR_VRR_VVV0U2 INSTR_VRR_VVV0U0 /* e.g. vfaezb*/
|
||||
#define INSTR_VRR_VVV0U3 INSTR_VRR_VVV0U0 /* e.g. vfaezbs*/
|
||||
@@ -523,6 +527,9 @@ unused_s390_operands_static_asserts (void)
|
||||
#define INSTR_VRR_VV0UUU 6, { V_8,V_12,U4_32,U4_28,U4_24,0 } /* e.g. vcdg */
|
||||
#define INSTR_VRR_VVVU0UV 6, { V_8,V_12,V_16,V_32,U4_28,U4_20 } /* e.g. vfma */
|
||||
#define INSTR_VRR_VV0U0U 6, { V_8,V_12,U4_32,U4_24,0,0 } /* e.g. vistr */
|
||||
+#define INSTR_VRR_0V 6, { V_12,0,0,0,0,0 } /* e.g. vtp */
|
||||
+#define INSTR_VRR_0V0U 6, { V_12,U16_20,0,0,0,0 } /* e.g. vtp */
|
||||
+#define INSTR_VRR_0VVU 6, { V_12,V_16,U16_20,0,0,0 } /* e.g. vtz */
|
||||
#define INSTR_VRR_0VV0U 6, { V_12,V_16,U4_24,0,0,0 } /* e.g. vcp */
|
||||
#define INSTR_VRR_RV0U 6, { R_8,V_12,U4_24,0,0,0 } /* e.g. vcvb */
|
||||
#define INSTR_VRR_RV0UU 6, { R_8,V_12,U4_24,U4_28,0,0 } /* e.g. vcvb */
|
||||
@@ -711,6 +718,8 @@ unused_s390_operands_static_asserts (void)
|
||||
#define MASK_VRI_VVUUU { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
#define MASK_VRI_VVUUU2 { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
#define MASK_VRI_VR0UU { 0xff, 0x00, 0xff, 0x00, 0x00, 0xff }
|
||||
+#define MASK_VRI_VV0UU { 0xff, 0x00, 0xff, 0x00, 0x00, 0xff }
|
||||
+#define MASK_VRI_VVV0UV { 0xff, 0x00, 0x0f, 0x00, 0x00, 0xff }
|
||||
#define MASK_VRX_VRRD { 0xff, 0x00, 0x00, 0x00, 0xf0, 0xff }
|
||||
#define MASK_VRX_VV { 0xff, 0x00, 0xff, 0xff, 0xf0, 0xff }
|
||||
#define MASK_VRX_VRRDU { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
@@ -721,10 +730,10 @@ unused_s390_operands_static_asserts (void)
|
||||
#define MASK_VRS_VRRDU { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
#define MASK_VRS_VRRD { 0xff, 0x00, 0x00, 0x00, 0xf0, 0xff }
|
||||
#define MASK_VRS_RRDV { 0xff, 0xf0, 0x00, 0x00, 0x00, 0xff }
|
||||
-#define MASK_VRR_0V { 0xff, 0xf0, 0xff, 0xff, 0xf0, 0xff }
|
||||
#define MASK_VRR_VRR { 0xff, 0x00, 0x0f, 0xff, 0xf0, 0xff }
|
||||
#define MASK_VRR_VVV0U { 0xff, 0x00, 0x0f, 0xff, 0x00, 0xff }
|
||||
#define MASK_VRR_VVV0U0 { 0xff, 0x00, 0x0f, 0x0f, 0xf0, 0xff }
|
||||
+#define MASK_VRR_VVV0U02 { 0xff, 0x00, 0x0f, 0xf0, 0xf0, 0xff }
|
||||
#define MASK_VRR_VVV0U1 { 0xff, 0x00, 0x0f, 0x1f, 0xf0, 0xff }
|
||||
#define MASK_VRR_VVV0U2 { 0xff, 0x00, 0x0f, 0x2f, 0xf0, 0xff }
|
||||
#define MASK_VRR_VVV0U3 { 0xff, 0x00, 0x0f, 0x3f, 0xf0, 0xff }
|
||||
@@ -750,6 +759,9 @@ unused_s390_operands_static_asserts (void)
|
||||
#define MASK_VRR_VV0UUU { 0xff, 0x00, 0xff, 0x00, 0x00, 0xff }
|
||||
#define MASK_VRR_VVVU0UV { 0xff, 0x00, 0x00, 0xf0, 0x00, 0xff }
|
||||
#define MASK_VRR_VV0U0U { 0xff, 0x00, 0xff, 0x0f, 0x00, 0xff }
|
||||
+#define MASK_VRR_0V { 0xff, 0xf0, 0xff, 0xff, 0xf0, 0xff }
|
||||
+#define MASK_VRR_0V0U { 0xff, 0xf0, 0xf0, 0x00, 0x00, 0xff }
|
||||
+#define MASK_VRR_0VVU { 0xff, 0xf0, 0x00, 0x00, 0x00, 0xff }
|
||||
#define MASK_VRR_0VV0U { 0xff, 0xf0, 0x0f, 0x0f, 0xf0, 0xff }
|
||||
#define MASK_VRR_RV0U { 0xff, 0x00, 0xff, 0x0f, 0xf0, 0xff }
|
||||
#define MASK_VRR_RV0UU { 0xff, 0x00, 0xff, 0x00, 0xf0, 0xff }
|
||||
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
|
||||
--- a/opcodes/s390-opc.txt
|
||||
+++ b/opcodes/s390-opc.txt
|
||||
@@ -2072,3 +2072,113 @@ b201 stbear S_RD "store bear" arch14 zarch
|
||||
# Processor-Activity-Instrumentation Facility
|
||||
|
||||
b28f qpaci S_RD "query processor activity counter information" arch14 zarch
|
||||
+
|
||||
+
|
||||
+# arch15 instructions
|
||||
+
|
||||
+e70000000089 vblend VRR_VVVU0V " " arch15 zarch
|
||||
+e70000000089 vblendb VRR_VVV0V " " arch15 zarch
|
||||
+e70001000089 vblendh VRR_VVV0V " " arch15 zarch
|
||||
+e70002000089 vblendf VRR_VVV0V " " arch15 zarch
|
||||
+e70003000089 vblendg VRR_VVV0V " " arch15 zarch
|
||||
+e70004000089 vblendq VRR_VVV0V " " arch15 zarch
|
||||
+
|
||||
+e70000000088 veval VRI_VVV0UV " " arch15 zarch
|
||||
+
|
||||
+e70000000054 vgem VRR_VV0U " " arch15 zarch
|
||||
+e70000000054 vgemb VRR_VV " " arch15 zarch
|
||||
+e70000001054 vgemh VRR_VV " " arch15 zarch
|
||||
+e70000002054 vgemf VRR_VV " " arch15 zarch
|
||||
+e70000003054 vgemg VRR_VV " " arch15 zarch
|
||||
+e70000004054 vgemq VRR_VV " " arch15 zarch
|
||||
+
|
||||
+e700000030d7 vuphg VRR_VV " " arch15 zarch
|
||||
+e700000030d5 vuplhg VRR_VV " " arch15 zarch
|
||||
+e700000030d6 vuplg VRR_VV " " arch15 zarch
|
||||
+e700000030d4 vupllg VRR_VV " " arch15 zarch
|
||||
+
|
||||
+e700000040f2 vavgq VRR_VVV " " arch15 zarch
|
||||
+e700000040f0 vavglq VRR_VVV " " arch15 zarch
|
||||
+e700000040db vecq VRR_VV " " arch15 zarch
|
||||
+e700000040d9 veclq VRR_VV " " arch15 zarch
|
||||
+e700000040f8 vceqq VRR_VVV " " arch15 zarch
|
||||
+e700001040f8 vceqqs VRR_VVV " " arch15 zarch
|
||||
+e700000040fb vchq VRR_VVV " " arch15 zarch
|
||||
+e700001040fb vchqs VRR_VVV " " arch15 zarch
|
||||
+e700000040f9 vchlq VRR_VVV " " arch15 zarch
|
||||
+e700001040f9 vchlqs VRR_VVV " " arch15 zarch
|
||||
+e70000004053 vclzq VRR_VV " " arch15 zarch
|
||||
+e70000004052 vctzq VRR_VV " " arch15 zarch
|
||||
+e700000040de vlcq VRR_VV " " arch15 zarch
|
||||
+e700000040df vlpq VRR_VV " " arch15 zarch
|
||||
+e700000040ff vmxq VRR_VVV " " arch15 zarch
|
||||
+e700000040fd vmxlq VRR_VVV " " arch15 zarch
|
||||
+e700000040fe vmnq VRR_VVV " " arch15 zarch
|
||||
+e700000040fc vmnlq VRR_VVV " " arch15 zarch
|
||||
+e700030000aa vmalg VRR_VVV0V " " arch15 zarch
|
||||
+e700040000aa vmalq VRR_VVV0V " " arch15 zarch
|
||||
+e700030000ab vmahg VRR_VVV0V " " arch15 zarch
|
||||
+e700040000ab vmahq VRR_VVV0V " " arch15 zarch
|
||||
+e700030000a9 vmalhg VRR_VVV0V " " arch15 zarch
|
||||
+e700040000a9 vmalhq VRR_VVV0V " " arch15 zarch
|
||||
+e700030000ae vmaeg VRR_VVV0V " " arch15 zarch
|
||||
+e700030000ac vmaleg VRR_VVV0V " " arch15 zarch
|
||||
+e700030000af vmaog VRR_VVV0V " " arch15 zarch
|
||||
+e700030000ad vmalog VRR_VVV0V " " arch15 zarch
|
||||
+e700000030a3 vmhg VRR_VVV " " arch15 zarch
|
||||
+e700000040a3 vmhq VRR_VVV " " arch15 zarch
|
||||
+e700000030a1 vmlhg VRR_VVV " " arch15 zarch
|
||||
+e700000040a1 vmlhq VRR_VVV " " arch15 zarch
|
||||
+e700000030a2 vmlg VRR_VVV " " arch15 zarch
|
||||
+e700000040a2 vmlq VRR_VVV " " arch15 zarch
|
||||
+e700000030a6 vmeg VRR_VVV " " arch15 zarch
|
||||
+e700000030a4 vmleg VRR_VVV " " arch15 zarch
|
||||
+e700000030a7 vmog VRR_VVV " " arch15 zarch
|
||||
+e700000030a5 vmlog VRR_VVV " " arch15 zarch
|
||||
+
|
||||
+e700000000b2 vd VRR_VVV0UU " " arch15 zarch
|
||||
+e700000020b2 vdf VRR_VVV0U02 " " arch15 zarch
|
||||
+e700000030b2 vdg VRR_VVV0U02 " " arch15 zarch
|
||||
+e700000040b2 vdq VRR_VVV0U02 " " arch15 zarch
|
||||
+
|
||||
+e700000000b0 vdl VRR_VVV0UU " " arch15 zarch
|
||||
+e700000020b0 vdlf VRR_VVV0U02 " " arch15 zarch
|
||||
+e700000030b0 vdlg VRR_VVV0U02 " " arch15 zarch
|
||||
+e700000040b0 vdlq VRR_VVV0U02 " " arch15 zarch
|
||||
+
|
||||
+e700000000b3 vr VRR_VVV0UU " " arch15 zarch
|
||||
+e700000020b3 vrf VRR_VVV0U02 " " arch15 zarch
|
||||
+e700000030b3 vrg VRR_VVV0U02 " " arch15 zarch
|
||||
+e700000040b3 vrq VRR_VVV0U02 " " arch15 zarch
|
||||
+
|
||||
+e700000000b1 vrl VRR_VVV0UU " " arch15 zarch
|
||||
+e700000020b1 vrlf VRR_VVV0U02 " " arch15 zarch
|
||||
+e700000030b1 vrlg VRR_VVV0U02 " " arch15 zarch
|
||||
+e700000040b1 vrlq VRR_VVV0U02 " " arch15 zarch
|
||||
+
|
||||
+b968 clzg RRE_RR " " arch15 zarch
|
||||
+b969 ctzg RRE_RR " " arch15 zarch
|
||||
+
|
||||
+e30000000060 lxab RXY_RRRD " " arch15 zarch
|
||||
+e30000000062 lxah RXY_RRRD " " arch15 zarch
|
||||
+e30000000064 lxaf RXY_RRRD " " arch15 zarch
|
||||
+e30000000066 lxag RXY_RRRD " " arch15 zarch
|
||||
+e30000000068 lxaq RXY_RRRD " " arch15 zarch
|
||||
+
|
||||
+e30000000061 llxab RXY_RRRD " " arch15 zarch
|
||||
+e30000000063 llxah RXY_RRRD " " arch15 zarch
|
||||
+e30000000065 llxaf RXY_RRRD " " arch15 zarch
|
||||
+e30000000067 llxag RXY_RRRD " " arch15 zarch
|
||||
+e30000000069 llxaq RXY_RRRD " " arch15 zarch
|
||||
+
|
||||
+b96c bextg RRF_R0RR2 " " arch15 zarch
|
||||
+b96d bdepg RRF_R0RR2 " " arch15 zarch
|
||||
+
|
||||
+b93e kimd RRF_U0RR " " arch15 zarch optparm
|
||||
+b93f klmd RRF_U0RR " " arch15 zarch optparm
|
||||
+
|
||||
+e6000000004e vcvbq VRR_VV0U2 " " arch15 zarch
|
||||
+e6000000004a vcvdq VRI_VV0UU " " arch15 zarch
|
||||
+
|
||||
+e6000000005f vtp VRR_0V0U " " arch15 zarch optparm
|
||||
+e6000000007f vtz VRR_0VVU " " arch15 zarch
|
@ -1,343 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:21 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-1of12.patch
|
||||
|
||||
;; Backkport "s390: Make operand table indices relative to each other"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
This is a purely mechanical change. It allows subsequent insertions into
|
||||
the operands table without having to renumber all operand indices.
|
||||
|
||||
The only differences in the resulting ELF object are in the .debug_info
|
||||
section. This has been confirmed by diffing the following xxd and readelf
|
||||
output:
|
||||
|
||||
xxd s390-opc.o
|
||||
readelf -aW -x .text -x .data -x .bss -x .rodata -x .debug_info \
|
||||
-x .symtab -x .strtab -x .shstrtab --debug-dump s390-opc.o
|
||||
|
||||
opcodes/
|
||||
* s390-opc.c: Make operand table indices relative to each other.
|
||||
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
|
||||
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
|
||||
--- a/opcodes/s390-opc.c
|
||||
+++ b/opcodes/s390-opc.c
|
||||
@@ -34,76 +34,82 @@
|
||||
inserting operands into instructions and vice-versa is kept in this
|
||||
file. */
|
||||
|
||||
+/* Build-time checks are preferrable over runtime ones. Use this construct
|
||||
+ in preference where possible. */
|
||||
+#define static_assert(e) ((void)sizeof (struct { int _:1 - 2 * !(e); }))
|
||||
+
|
||||
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
+
|
||||
/* The operands table.
|
||||
The fields are bits, shift, insert, extract, flags. */
|
||||
|
||||
const struct s390_operand s390_operands[] =
|
||||
{
|
||||
-#define UNUSED 0
|
||||
+#define UNUSED 0
|
||||
{ 0, 0, 0 }, /* Indicates the end of the operand list */
|
||||
|
||||
/* General purpose register operands. */
|
||||
|
||||
-#define R_8 1 /* GPR starting at position 8 */
|
||||
+#define R_8 (UNUSED + 1) /* GPR starting at position 8 */
|
||||
{ 4, 8, S390_OPERAND_GPR },
|
||||
-#define R_12 2 /* GPR starting at position 12 */
|
||||
+#define R_12 (R_8 + 1) /* GPR starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_GPR },
|
||||
-#define R_16 3 /* GPR starting at position 16 */
|
||||
+#define R_16 (R_12 + 1) /* GPR starting at position 16 */
|
||||
{ 4, 16, S390_OPERAND_GPR },
|
||||
-#define R_20 4 /* GPR starting at position 20 */
|
||||
+#define R_20 (R_16 + 1) /* GPR starting at position 20 */
|
||||
{ 4, 20, S390_OPERAND_GPR },
|
||||
-#define R_24 5 /* GPR starting at position 24 */
|
||||
+#define R_24 (R_20 + 1) /* GPR starting at position 24 */
|
||||
{ 4, 24, S390_OPERAND_GPR },
|
||||
-#define R_28 6 /* GPR starting at position 28 */
|
||||
+#define R_28 (R_24 + 1) /* GPR starting at position 28 */
|
||||
{ 4, 28, S390_OPERAND_GPR },
|
||||
-#define R_32 7 /* GPR starting at position 32 */
|
||||
+#define R_32 (R_28 + 1) /* GPR starting at position 32 */
|
||||
{ 4, 32, S390_OPERAND_GPR },
|
||||
|
||||
/* General purpose register pair operands. */
|
||||
|
||||
-#define RE_8 8 /* GPR starting at position 8 */
|
||||
+#define RE_8 (R_32 + 1) /* GPR starting at position 8 */
|
||||
{ 4, 8, S390_OPERAND_GPR | S390_OPERAND_REG_PAIR },
|
||||
-#define RE_12 9 /* GPR starting at position 12 */
|
||||
+#define RE_12 (RE_8 + 1) /* GPR starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_GPR | S390_OPERAND_REG_PAIR },
|
||||
-#define RE_16 10 /* GPR starting at position 16 */
|
||||
+#define RE_16 (RE_12 + 1) /* GPR starting at position 16 */
|
||||
{ 4, 16, S390_OPERAND_GPR | S390_OPERAND_REG_PAIR },
|
||||
-#define RE_20 11 /* GPR starting at position 20 */
|
||||
+#define RE_20 (RE_16 + 1) /* GPR starting at position 20 */
|
||||
{ 4, 20, S390_OPERAND_GPR | S390_OPERAND_REG_PAIR },
|
||||
-#define RE_24 12 /* GPR starting at position 24 */
|
||||
+#define RE_24 (RE_20 + 1) /* GPR starting at position 24 */
|
||||
{ 4, 24, S390_OPERAND_GPR | S390_OPERAND_REG_PAIR },
|
||||
-#define RE_28 13 /* GPR starting at position 28 */
|
||||
+#define RE_28 (RE_24 + 1) /* GPR starting at position 28 */
|
||||
{ 4, 28, S390_OPERAND_GPR | S390_OPERAND_REG_PAIR },
|
||||
-#define RE_32 14 /* GPR starting at position 32 */
|
||||
+#define RE_32 (RE_28 + 1) /* GPR starting at position 32 */
|
||||
{ 4, 32, S390_OPERAND_GPR | S390_OPERAND_REG_PAIR },
|
||||
|
||||
/* Floating point register operands. */
|
||||
|
||||
-#define F_8 15 /* FPR starting at position 8 */
|
||||
+#define F_8 (RE_32 + 1) /* FPR starting at position 8 */
|
||||
{ 4, 8, S390_OPERAND_FPR },
|
||||
-#define F_12 16 /* FPR starting at position 12 */
|
||||
+#define F_12 (F_8 + 1) /* FPR starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_FPR },
|
||||
-#define F_16 17 /* FPR starting at position 16 */
|
||||
+#define F_16 (F_12 + 1) /* FPR starting at position 16 */
|
||||
{ 4, 16, S390_OPERAND_FPR },
|
||||
-#define F_24 18 /* FPR starting at position 24 */
|
||||
+#define F_24 (F_16 + 1) /* FPR starting at position 24 */
|
||||
{ 4, 24, S390_OPERAND_FPR },
|
||||
-#define F_28 19 /* FPR starting at position 28 */
|
||||
+#define F_28 (F_24 + 1) /* FPR starting at position 28 */
|
||||
{ 4, 28, S390_OPERAND_FPR },
|
||||
-#define F_32 20 /* FPR starting at position 32 */
|
||||
+#define F_32 (F_28 + 1) /* FPR starting at position 32 */
|
||||
{ 4, 32, S390_OPERAND_FPR },
|
||||
|
||||
/* Floating point register pair operands. */
|
||||
|
||||
-#define FE_8 21 /* FPR starting at position 8 */
|
||||
+#define FE_8 (F_32 + 1) /* FPR starting at position 8 */
|
||||
{ 4, 8, S390_OPERAND_FPR | S390_OPERAND_REG_PAIR },
|
||||
-#define FE_12 22 /* FPR starting at position 12 */
|
||||
+#define FE_12 (FE_8 + 1) /* FPR starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_FPR | S390_OPERAND_REG_PAIR },
|
||||
-#define FE_16 23 /* FPR starting at position 16 */
|
||||
+#define FE_16 (FE_12 + 1) /* FPR starting at position 16 */
|
||||
{ 4, 16, S390_OPERAND_FPR | S390_OPERAND_REG_PAIR },
|
||||
-#define FE_24 24 /* FPR starting at position 24 */
|
||||
+#define FE_24 (FE_16 + 1) /* FPR starting at position 24 */
|
||||
{ 4, 24, S390_OPERAND_FPR | S390_OPERAND_REG_PAIR },
|
||||
-#define FE_28 25 /* FPR starting at position 28 */
|
||||
+#define FE_28 (FE_24 + 1) /* FPR starting at position 28 */
|
||||
{ 4, 28, S390_OPERAND_FPR | S390_OPERAND_REG_PAIR },
|
||||
-#define FE_32 26 /* FPR starting at position 32 */
|
||||
+#define FE_32 (FE_28 + 1) /* FPR starting at position 32 */
|
||||
{ 4, 32, S390_OPERAND_FPR | S390_OPERAND_REG_PAIR },
|
||||
|
||||
/* Vector register operands. */
|
||||
@@ -111,145 +117,149 @@ const struct s390_operand s390_operands[] =
|
||||
/* For each of these operands and additional bit in the RXB operand is
|
||||
needed. */
|
||||
|
||||
-#define V_8 27 /* Vector reg. starting at position 8 */
|
||||
+#define V_8 (FE_32 + 1) /* Vector reg. starting at position 8 */
|
||||
{ 4, 8, S390_OPERAND_VR },
|
||||
-#define V_12 28 /* Vector reg. starting at position 12 */
|
||||
+#define V_12 (V_8 + 1) /* Vector reg. starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_VR },
|
||||
-#define V_CP16_12 29 /* Vector reg. starting at position 12 */
|
||||
+#define V_CP16_12 (V_12 + 1) /* Vector reg. starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_VR | S390_OPERAND_CP16 }, /* with a copy at pos 16 */
|
||||
-#define V_16 30 /* Vector reg. starting at position 16 */
|
||||
+#define V_16 (V_CP16_12+1) /* Vector reg. starting at position 16 */
|
||||
{ 4, 16, S390_OPERAND_VR },
|
||||
-#define V_32 31 /* Vector reg. starting at position 32 */
|
||||
+#define V_32 (V_16 + 1) /* Vector reg. starting at position 32 */
|
||||
{ 4, 32, S390_OPERAND_VR },
|
||||
|
||||
/* Access register operands. */
|
||||
|
||||
-#define A_8 32 /* Access reg. starting at position 8 */
|
||||
+#define A_8 (V_32 + 1) /* Access reg. starting at position 8 */
|
||||
{ 4, 8, S390_OPERAND_AR },
|
||||
-#define A_12 33 /* Access reg. starting at position 12 */
|
||||
+#define A_12 (A_8 + 1) /* Access reg. starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_AR },
|
||||
-#define A_24 34 /* Access reg. starting at position 24 */
|
||||
+#define A_24 (A_12 + 1) /* Access reg. starting at position 24 */
|
||||
{ 4, 24, S390_OPERAND_AR },
|
||||
-#define A_28 35 /* Access reg. starting at position 28 */
|
||||
+#define A_28 (A_24 + 1) /* Access reg. starting at position 28 */
|
||||
{ 4, 28, S390_OPERAND_AR },
|
||||
|
||||
/* Control register operands. */
|
||||
|
||||
-#define C_8 36 /* Control reg. starting at position 8 */
|
||||
+#define C_8 (A_28 + 1) /* Control reg. starting at position 8 */
|
||||
{ 4, 8, S390_OPERAND_CR },
|
||||
-#define C_12 37 /* Control reg. starting at position 12 */
|
||||
+#define C_12 (C_8 + 1) /* Control reg. starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_CR },
|
||||
|
||||
/* Base register operands. */
|
||||
|
||||
-#define B_16 38 /* Base register starting at position 16 */
|
||||
+#define B_16 (C_12 + 1) /* Base register starting at position 16 */
|
||||
{ 4, 16, S390_OPERAND_BASE | S390_OPERAND_GPR },
|
||||
-#define B_32 39 /* Base register starting at position 32 */
|
||||
+#define B_32 (B_16 + 1) /* Base register starting at position 32 */
|
||||
{ 4, 32, S390_OPERAND_BASE | S390_OPERAND_GPR },
|
||||
|
||||
-#define X_12 40 /* Index register starting at position 12 */
|
||||
+#define X_12 (B_32 + 1) /* Index register starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_INDEX | S390_OPERAND_GPR },
|
||||
|
||||
-#define VX_12 41 /* Vector index register starting at position 12 */
|
||||
+#define VX_12 (X_12+1) /* Vector index register starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_INDEX | S390_OPERAND_VR },
|
||||
|
||||
/* Address displacement operands. */
|
||||
|
||||
-#define D_20 42 /* Displacement starting at position 20 */
|
||||
+#define D_20 (VX_12 + 1) /* Displacement starting at position 20 */
|
||||
{ 12, 20, S390_OPERAND_DISP },
|
||||
-#define D_36 43 /* Displacement starting at position 36 */
|
||||
+#define D_36 (D_20 + 1) /* Displacement starting at position 36 */
|
||||
{ 12, 36, S390_OPERAND_DISP },
|
||||
-#define D20_20 44 /* 20 bit displacement starting at 20 */
|
||||
+#define D20_20 (D_36 + 1) /* 20 bit displacement starting at 20 */
|
||||
{ 20, 20, S390_OPERAND_DISP | S390_OPERAND_SIGNED },
|
||||
|
||||
/* Length operands. */
|
||||
|
||||
-#define L4_8 45 /* 4 bit length starting at position 8 */
|
||||
+#define L4_8 (D20_20 + 1) /* 4 bit length starting at position 8 */
|
||||
{ 4, 8, S390_OPERAND_LENGTH },
|
||||
-#define L4_12 46 /* 4 bit length starting at position 12 */
|
||||
+#define L4_12 (L4_8 + 1) /* 4 bit length starting at position 12 */
|
||||
{ 4, 12, S390_OPERAND_LENGTH },
|
||||
-#define L8_8 47 /* 8 bit length starting at position 8 */
|
||||
+#define L8_8 (L4_12 + 1) /* 8 bit length starting at position 8 */
|
||||
{ 8, 8, S390_OPERAND_LENGTH },
|
||||
|
||||
/* Signed immediate operands. */
|
||||
|
||||
-#define I8_8 48 /* 8 bit signed value starting at 8 */
|
||||
+#define I8_8 (L8_8 + 1) /* 8 bit signed value starting at 8 */
|
||||
{ 8, 8, S390_OPERAND_SIGNED },
|
||||
-#define I8_32 49 /* 8 bit signed value starting at 32 */
|
||||
+#define I8_32 (I8_8 + 1) /* 8 bit signed value starting at 32 */
|
||||
{ 8, 32, S390_OPERAND_SIGNED },
|
||||
-#define I12_12 50 /* 12 bit signed value starting at 12 */
|
||||
+#define I12_12 (I8_32 + 1) /* 12 bit signed value starting at 12 */
|
||||
{ 12, 12, S390_OPERAND_SIGNED },
|
||||
-#define I16_16 51 /* 16 bit signed value starting at 16 */
|
||||
+#define I16_16 (I12_12 + 1) /* 16 bit signed value starting at 16 */
|
||||
{ 16, 16, S390_OPERAND_SIGNED },
|
||||
-#define I16_32 52 /* 16 bit signed value starting at 32 */
|
||||
+#define I16_32 (I16_16 + 1) /* 16 bit signed value starting at 32 */
|
||||
{ 16, 32, S390_OPERAND_SIGNED },
|
||||
-#define I24_24 53 /* 24 bit signed value starting at 24 */
|
||||
+#define I24_24 (I16_32 + 1) /* 24 bit signed value starting at 24 */
|
||||
{ 24, 24, S390_OPERAND_SIGNED },
|
||||
-#define I32_16 54 /* 32 bit signed value starting at 16 */
|
||||
+#define I32_16 (I24_24 + 1) /* 32 bit signed value starting at 16 */
|
||||
{ 32, 16, S390_OPERAND_SIGNED },
|
||||
|
||||
/* Unsigned immediate operands. */
|
||||
|
||||
-#define U4_8 55 /* 4 bit unsigned value starting at 8 */
|
||||
+#define U4_8 (I32_16 + 1) /* 4 bit unsigned value starting at 8 */
|
||||
{ 4, 8, 0 },
|
||||
-#define U4_12 56 /* 4 bit unsigned value starting at 12 */
|
||||
+#define U4_12 (U4_8 + 1) /* 4 bit unsigned value starting at 12 */
|
||||
{ 4, 12, 0 },
|
||||
-#define U4_16 57 /* 4 bit unsigned value starting at 16 */
|
||||
+#define U4_16 (U4_12 + 1) /* 4 bit unsigned value starting at 16 */
|
||||
{ 4, 16, 0 },
|
||||
-#define U4_20 58 /* 4 bit unsigned value starting at 20 */
|
||||
+#define U4_20 (U4_16 + 1) /* 4 bit unsigned value starting at 20 */
|
||||
{ 4, 20, 0 },
|
||||
-#define U4_24 59 /* 4 bit unsigned value starting at 24 */
|
||||
+#define U4_24 (U4_20 + 1) /* 4 bit unsigned value starting at 24 */
|
||||
{ 4, 24, 0 },
|
||||
-#define U4_OR1_24 60 /* 4 bit unsigned value ORed with 1 */
|
||||
+#define U4_OR1_24 (U4_24 + 1) /* 4 bit unsigned value ORed with 1 */
|
||||
{ 4, 24, S390_OPERAND_OR1 }, /* starting at 24 */
|
||||
-#define U4_OR2_24 61 /* 4 bit unsigned value ORed with 2 */
|
||||
+#define U4_OR2_24 (U4_OR1_24+1) /* 4 bit unsigned value ORed with 2 */
|
||||
{ 4, 24, S390_OPERAND_OR2 }, /* starting at 24 */
|
||||
-#define U4_OR3_24 62 /* 4 bit unsigned value ORed with 3 */
|
||||
+#define U4_OR3_24 (U4_OR2_24+1) /* 4 bit unsigned value ORed with 3 */
|
||||
{ 4, 24, S390_OPERAND_OR1 | S390_OPERAND_OR2 }, /* starting at 24 */
|
||||
-#define U4_28 63 /* 4 bit unsigned value starting at 28 */
|
||||
+#define U4_28 (U4_OR3_24+1) /* 4 bit unsigned value starting at 28 */
|
||||
{ 4, 28, 0 },
|
||||
-#define U4_OR8_28 64 /* 4 bit unsigned value ORed with 8 */
|
||||
+#define U4_OR8_28 (U4_28 + 1) /* 4 bit unsigned value ORed with 8 */
|
||||
{ 4, 28, S390_OPERAND_OR8 }, /* starting at 28 */
|
||||
-#define U4_32 65 /* 4 bit unsigned value starting at 32 */
|
||||
+#define U4_32 (U4_OR8_28+1) /* 4 bit unsigned value starting at 32 */
|
||||
{ 4, 32, 0 },
|
||||
-#define U4_36 66 /* 4 bit unsigned value starting at 36 */
|
||||
+#define U4_36 (U4_32 + 1) /* 4 bit unsigned value starting at 36 */
|
||||
{ 4, 36, 0 },
|
||||
-#define U8_8 67 /* 8 bit unsigned value starting at 8 */
|
||||
+#define U8_8 (U4_36 + 1) /* 8 bit unsigned value starting at 8 */
|
||||
{ 8, 8, 0 },
|
||||
-#define U8_16 68 /* 8 bit unsigned value starting at 16 */
|
||||
+#define U8_16 (U8_8 + 1) /* 8 bit unsigned value starting at 16 */
|
||||
{ 8, 16, 0 },
|
||||
-#define U6_26 69 /* 6 bit unsigned value starting at 26 */
|
||||
+#define U6_26 (U8_16 + 1) /* 6 bit unsigned value starting at 26 */
|
||||
{ 6, 26, 0 },
|
||||
-#define U8_24 70 /* 8 bit unsigned value starting at 24 */
|
||||
+#define U8_24 (U6_26 + 1) /* 8 bit unsigned value starting at 24 */
|
||||
{ 8, 24, 0 },
|
||||
-#define U8_28 71 /* 8 bit unsigned value starting at 28 */
|
||||
+#define U8_28 (U8_24 + 1) /* 8 bit unsigned value starting at 28 */
|
||||
{ 8, 28, 0 },
|
||||
-#define U8_32 72 /* 8 bit unsigned value starting at 32 */
|
||||
+#define U8_32 (U8_28 + 1) /* 8 bit unsigned value starting at 32 */
|
||||
{ 8, 32, 0 },
|
||||
-#define U12_16 73 /* 12 bit unsigned value starting at 16 */
|
||||
+#define U12_16 (U8_32 + 1) /* 12 bit unsigned value starting at 16 */
|
||||
{ 12, 16, 0 },
|
||||
-#define U16_16 74 /* 16 bit unsigned value starting at 16 */
|
||||
+#define U16_16 (U12_16 + 1) /* 16 bit unsigned value starting at 16 */
|
||||
{ 16, 16, 0 },
|
||||
-#define U16_32 75 /* 16 bit unsigned value starting at 32 */
|
||||
+#define U16_32 (U16_16 + 1) /* 16 bit unsigned value starting at 32 */
|
||||
{ 16, 32, 0 },
|
||||
-#define U32_16 76 /* 32 bit unsigned value starting at 16 */
|
||||
+#define U32_16 (U16_32 + 1) /* 32 bit unsigned value starting at 16 */
|
||||
{ 32, 16, 0 },
|
||||
|
||||
/* PC-relative address operands. */
|
||||
|
||||
-#define J12_12 77 /* 12 bit PC relative offset at 12 */
|
||||
+#define J12_12 (U32_16 + 1) /* 12 bit PC relative offset at 12 */
|
||||
{ 12, 12, S390_OPERAND_PCREL },
|
||||
-#define J16_16 78 /* 16 bit PC relative offset at 16 */
|
||||
+#define J16_16 (J12_12 + 1) /* 16 bit PC relative offset at 16 */
|
||||
{ 16, 16, S390_OPERAND_PCREL },
|
||||
-#define J16_32 79 /* 16 bit PC relative offset at 32 */
|
||||
+#define J16_32 (J16_16 + 1) /* 16 bit PC relative offset at 32 */
|
||||
{ 16, 32, S390_OPERAND_PCREL },
|
||||
-#define J24_24 80 /* 24 bit PC relative offset at 24 */
|
||||
+#define J24_24 (J16_32 + 1) /* 24 bit PC relative offset at 24 */
|
||||
{ 24, 24, S390_OPERAND_PCREL },
|
||||
-#define J32_16 81 /* 32 bit PC relative offset at 16 */
|
||||
+#define J32_16 (J24_24 + 1) /* 32 bit PC relative offset at 16 */
|
||||
{ 32, 16, S390_OPERAND_PCREL },
|
||||
|
||||
};
|
||||
|
||||
+static inline void unused_s390_operands_static_asserts(void)
|
||||
+{
|
||||
+ static_assert(ARRAY_SIZE(s390_operands) - 1 == J32_16);
|
||||
+}
|
||||
|
||||
/* Macros used to form opcodes. */
|
||||
|
@ -1,99 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:21 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-2of12.patch
|
||||
|
||||
;; Backkport "s390: Align optional operand definition to specs"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
The IBM z/Architecture Principle of Operation [1] specifies the last
|
||||
operand(s) of some (extended) mnemonics to be optional. Align the
|
||||
mnemonic definitions in the opcode table according to specification.
|
||||
|
||||
This changes the last operand of the following (extended) mnemonics to
|
||||
be optional:
|
||||
risbg, risbgz, risbgn, risbgnz, risbhg, risblg, rnsbg, rosbg, rxsbg
|
||||
|
||||
Note that efpc and sfpc actually have only one operand, but had
|
||||
erroneously been defined to have two. For backwards compatibility the
|
||||
wrong RR register format must be retained. Since the superfluous second
|
||||
operand is defined as optional the instruction can still be coded as
|
||||
specified.
|
||||
|
||||
[1]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16,
|
||||
https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf
|
||||
|
||||
opcodes/
|
||||
* s390-opc.txt: Align optional operand definition to
|
||||
specification.
|
||||
|
||||
testsuite/
|
||||
* zarch-z10.s: Add test cases for risbg, risbgz, rnsbg, rosbg,
|
||||
and rxsbg.
|
||||
* zarch-z10.d: Likewise.
|
||||
* zarch-z196.s: Add test cases for risbhg and risblg.
|
||||
* zarch-z196.d: Likewise.
|
||||
* zarch-zEC12.s: Add test cases for risbgn and risbgnz.
|
||||
* zarch-zEC12.d: Likewise.
|
||||
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
|
||||
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
|
||||
--- a/opcodes/s390-opc.txt
|
||||
+++ b/opcodes/s390-opc.txt
|
||||
@@ -305,6 +305,7 @@ b30d debr RRE_FF "divide short bfp" g5 esa,zarch
|
||||
ed000000000d deb RXE_FRRD "divide short bfp" g5 esa,zarch
|
||||
b35b didbr RRF_FUFF "divide to integer long bfp" g5 esa,zarch
|
||||
b353 diebr RRF_FUFF "divide to integer short bfp" g5 esa,zarch
|
||||
+# efpc and sfpc have only one operand; retain RR register format for compatibility
|
||||
b38c efpc RRE_RR "extract fpc" g5 esa,zarch optparm
|
||||
b342 ltxbr RRE_FEFE "load and test extended bfp" g5 esa,zarch
|
||||
b312 ltdbr RRE_FF "load and test long bfp" g5 esa,zarch
|
||||
@@ -348,6 +349,7 @@ b31f msdbr RRF_F0FF "multiply and subtract long bfp" g5 esa,zarch
|
||||
ed000000001f msdb RXF_FRRDF "multiply and subtract long bfp" g5 esa,zarch
|
||||
b30f msebr RRF_F0FF "multiply and subtract short bfp" g5 esa,zarch
|
||||
ed000000000f mseb RXF_FRRDF "multiply and subtract short bfp" g5 esa,zarch
|
||||
+# efpc and sfpc have only one operand; retain RR register format for compatibility
|
||||
b384 sfpc RRE_RR "set fpc" g5 esa,zarch optparm
|
||||
b299 srnm S_RD "set rounding mode" g5 esa,zarch
|
||||
b316 sqxbr RRE_FEFE "square root extended bfp" g5 esa,zarch
|
||||
@@ -966,11 +968,11 @@ c201 msfi RIL_RI "multiply single immediate (32)" z10 zarch
|
||||
c200 msgfi RIL_RI "multiply single immediate (64)" z10 zarch
|
||||
e30000000036 pfd RXY_URRD "prefetch data" z10 zarch
|
||||
c602 pfdrl RIL_UP "prefetch data relative long" z10 zarch
|
||||
-ec0000000054 rnsbg RIE_RRUUU "rotate then and selected bits" z10 zarch
|
||||
-ec0000000057 rxsbg RIE_RRUUU "rotate then exclusive or selected bits" z10 zarch
|
||||
-ec0000000056 rosbg RIE_RRUUU "rotate then or selected bits" z10 zarch
|
||||
-ec0000000055 risbg RIE_RRUUU "rotate then insert selected bits" z10 zarch
|
||||
-ec0000800055 risbgz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits" z10 zarch
|
||||
+ec0000000054 rnsbg RIE_RRUUU "rotate then and selected bits" z10 zarch optparm
|
||||
+ec0000000057 rxsbg RIE_RRUUU "rotate then exclusive or selected bits" z10 zarch optparm
|
||||
+ec0000000056 rosbg RIE_RRUUU "rotate then or selected bits" z10 zarch optparm
|
||||
+ec0000000055 risbg RIE_RRUUU "rotate then insert selected bits" z10 zarch optparm
|
||||
+ec0000800055 risbgz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits" z10 zarch optparm
|
||||
c40f strl RIL_RP "store relative long (32)" z10 zarch
|
||||
c40b stgrl RIL_RP "store relative long (64)" z10 zarch
|
||||
c407 sthrl RIL_RP "store halfword relative long" z10 zarch
|
||||
@@ -1014,8 +1016,8 @@ e300000000c4 lhh RXY_RRRD "load halfword high" z196 zarch
|
||||
e300000000ca lfh RXY_RRRD "load high" z196 zarch
|
||||
e300000000c2 llch RXY_RRRD "load logical character high" z196 zarch
|
||||
e300000000c6 llhh RXY_RRRD "load logical halfword high" z196 zarch
|
||||
-ec000000005d risbhg RIE_RRUUU "rotate then insert selected bits high" z196 zarch
|
||||
-ec0000000051 risblg RIE_RRUUU "rotate then insert selected bits low" z196 zarch
|
||||
+ec000000005d risbhg RIE_RRUUU "rotate then insert selected bits high" z196 zarch optparm
|
||||
+ec0000000051 risblg RIE_RRUUU "rotate then insert selected bits low" z196 zarch optparm
|
||||
e300000000c3 stch RXY_RRRD "store character high" z196 zarch
|
||||
e300000000c7 sthh RXY_RRRD "store halfword high" z196 zarch
|
||||
e300000000cb stfh RXY_RRRD "store high" z196 zarch
|
||||
@@ -1153,8 +1155,8 @@ eb0000000023 clt RSY_RURD "compare logical and trap 32 bit reg-mem" zEC12 zarch
|
||||
eb0000000023 clt$12 RSY_R0RD "compare logical and trap 32 bit reg-mem" zEC12 zarch
|
||||
eb000000002b clgt RSY_RURD "compare logical and trap 64 bit reg-mem" zEC12 zarch
|
||||
eb000000002b clgt$12 RSY_R0RD "compare logical and trap 64 bit reg-mem" zEC12 zarch
|
||||
-ec0000000059 risbgn RIE_RRUUU "rotate then insert selected bits nocc" zEC12 zarch
|
||||
-ec0000800059 risbgnz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits nocc" zEC12 zarch
|
||||
+ec0000000059 risbgn RIE_RRUUU "rotate then insert selected bits nocc" zEC12 zarch optparm
|
||||
+ec0000800059 risbgnz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits nocc" zEC12 zarch optparm
|
||||
ed00000000aa cdzt RSL_LRDFU "convert from zoned long" zEC12 zarch
|
||||
ed00000000ab cxzt RSL_LRDFEU "convert from zoned extended" zEC12 zarch
|
||||
ed00000000a8 czdt RSL_LRDFU "convert to zoned long" zEC12 zarch
|
@ -1,244 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-3of12.patch
|
||||
|
||||
;; Backkport "s390: Add missing extended mnemonics"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
Add extended mnemonics specified in the z/Architecture Principles of
|
||||
Operation [1] and z/Architecture Reference Summary [2], that were
|
||||
previously missing from the opcode table.
|
||||
|
||||
The following added extended mnemonics are synonyms to a base mnemonic
|
||||
and therefore disassemble into their base mnemonic:
|
||||
jc, jcth, lfi, llgfi, llghi
|
||||
|
||||
The following added extended mnemonics are more specific than their base
|
||||
mnemonic and therefore disassemble into the added extended mnemonic:
|
||||
risbhgz, risblgz, rnsbgt, rosbgt, rxsbgt
|
||||
|
||||
The following added extended mnemonics are more specific than their base
|
||||
mnemonic, but disassemble into their base mnemonic due to design
|
||||
constraints:
|
||||
notr, notgr
|
||||
|
||||
The missing extended mnemonic jl* conditional jump long flavors cannot
|
||||
be added, as they would clash with the existing non-standard extended
|
||||
mnemonic j* conditional jump flavors jle and jlh. The missing extended
|
||||
mnemonic jlc jump long conditional is not added, as the related jl*
|
||||
flavors cannot be added.
|
||||
Note that these missing jl* conditional jump long flavors are already
|
||||
defined as non-standard jg* flavors instead. While the related missing
|
||||
extended mnemonic jlc could be added as non-standard jgc instead it is
|
||||
forgone in favor of not adding further non-standard mnemonics.
|
||||
|
||||
The missing extended mnemonics sllhh, sllhl, slllh, srlhh, srlhl, and
|
||||
srllh cannot be implemented using the current design, as they require
|
||||
computed operands. For that reason the following missing extended
|
||||
mnemonics are not added as well, as they fall into the same category of
|
||||
instructions that operate on high and low words of registers. They
|
||||
should better be added together, not to confuse the user, which of those
|
||||
instructions are currently implemented or not.
|
||||
lhhr, lhlr, llhfr, llchhr, llchlr, llclhr, llhhhr, llhhlr, llhlhr,
|
||||
nhhr, nhlr, nlhr, ohhr, ohlr, olhr, xhhr, xhlr, xlhr
|
||||
|
||||
[1] IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16,
|
||||
https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf
|
||||
[2] IBM z/Architecture Reference Summary, SA22-7871-11,
|
||||
https://www.ibm.com/support/pages/sites/default/files/2022-09/SA22-7871-11.pdf
|
||||
|
||||
opcodes/
|
||||
* s390-opc.c: Define operand formats R_CP16_28, U6_18, and
|
||||
U5_27. Define instruction formats RIE_RRUUU3, RIE_RRUUU4,
|
||||
and RRF_R0RR4.
|
||||
* s390-opc.txt: Add extended mnemonics jc, jcth, lfi, llgfi,
|
||||
llghi, notgr, notr, risbhgz, risblgz, rnsbgt, rosbgt, and
|
||||
rxsbgt.
|
||||
|
||||
gas/
|
||||
* config/tc-s390.c: Add support to insert operand for format
|
||||
R_CP16_28, reusing existing logic for format V_CP16_12.
|
||||
* testsuite/gas/s390/esa-g5.s: Add test for extended mnemonic
|
||||
jc.
|
||||
* testsuite/gas/s390/esa-g5.d: Likewise.
|
||||
* testsuite/gas/s390/zarch-z900.s: Add test for extended
|
||||
mnemonic llghi.
|
||||
* testsuite/gas/s390/zarch-z900.d: Likewise.
|
||||
* testsuite/gas/s390/zarch-z9-109.s: Add tests for extended
|
||||
mnemonics lfi and llgfi.
|
||||
* testsuite/gas/s390/zarch-z9-109.d: Likewise.
|
||||
* testsuite/gas/s390/zarch-z10.s: Add tests for extended
|
||||
mnemonics rnsbgt, rosbgt, and rxsbgt.
|
||||
* testsuite/gas/s390/zarch-z10.d: Likewise.
|
||||
* testsuite/gas/s390/zarch-z196.s: Add tests for extended
|
||||
mnemonics jcth, risbhgz, and risblgz.
|
||||
* testsuite/gas/s390/zarch-z196.d: Likewise.
|
||||
* testsuite/gas/s390/zarch-arch13.s: Add tests for extended
|
||||
mnemonics notr and notgr.
|
||||
* testsuite/gas/s390/zarch-arch13.d: Likewise.
|
||||
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
|
||||
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
|
||||
--- a/opcodes/s390-opc.c
|
||||
+++ b/opcodes/s390-opc.c
|
||||
@@ -62,7 +62,9 @@ const struct s390_operand s390_operands[] =
|
||||
{ 4, 24, S390_OPERAND_GPR },
|
||||
#define R_28 (R_24 + 1) /* GPR starting at position 28 */
|
||||
{ 4, 28, S390_OPERAND_GPR },
|
||||
-#define R_32 (R_28 + 1) /* GPR starting at position 32 */
|
||||
+#define R_CP16_28 (R_28 + 1) /* GPR starting at position 28 */
|
||||
+ { 4, 28, S390_OPERAND_GPR | S390_OPERAND_CP16 }, /* with a copy at pos 16 */
|
||||
+#define R_32 (R_CP16_28+1) /* GPR starting at position 32 */
|
||||
{ 4, 32, S390_OPERAND_GPR },
|
||||
|
||||
/* General purpose register pair operands. */
|
||||
@@ -222,9 +224,13 @@ const struct s390_operand s390_operands[] =
|
||||
{ 4, 36, 0 },
|
||||
#define U8_8 (U4_36 + 1) /* 8 bit unsigned value starting at 8 */
|
||||
{ 8, 8, 0 },
|
||||
-#define U8_16 (U8_8 + 1) /* 8 bit unsigned value starting at 16 */
|
||||
+#define U6_18 (U8_8 + 1) /* 6 bit unsigned value starting at 18 */
|
||||
+ { 6, 18, 0 },
|
||||
+#define U8_16 (U6_18 + 1) /* 8 bit unsigned value starting at 16 */
|
||||
{ 8, 16, 0 },
|
||||
-#define U6_26 (U8_16 + 1) /* 6 bit unsigned value starting at 26 */
|
||||
+#define U5_27 (U8_16 + 1) /* 5 bit unsigned value starting at 27 */
|
||||
+ { 5, 27, 0 },
|
||||
+#define U6_26 (U5_27 + 1) /* 6 bit unsigned value starting at 26 */
|
||||
{ 6, 26, 0 },
|
||||
#define U8_24 (U6_26 + 1) /* 8 bit unsigned value starting at 24 */
|
||||
{ 8, 24, 0 },
|
||||
@@ -289,7 +295,7 @@ static inline void unused_s390_operands_static_asserts(void)
|
||||
p - pc relative
|
||||
r - general purpose register
|
||||
re - gpr extended operand, a valid general purpose register pair
|
||||
- u - unsigned integer, 4, 8, 16 or 32 bit
|
||||
+ u - unsigned integer, 4, 6, 8, 16 or 32 bit
|
||||
m - mode field, 4 bit
|
||||
0 - operand skipped.
|
||||
The order of the letters reflects the layout of the format in
|
||||
@@ -325,7 +331,9 @@ static inline void unused_s390_operands_static_asserts(void)
|
||||
#define INSTR_RIE_R0U0 6, { R_8,U16_16,0,0,0,0 } /* e.g. clfitne */
|
||||
#define INSTR_RIE_RUI0 6, { R_8,I16_16,U4_12,0,0,0 } /* e.g. lochi */
|
||||
#define INSTR_RIE_RRUUU 6, { R_8,R_12,U8_16,U8_24,U8_32,0 } /* e.g. rnsbg */
|
||||
-#define INSTR_RIE_RRUUU2 6, { R_8,R_12,U8_16,U6_26,U8_32,0 } /* e.g. rnsbg */
|
||||
+#define INSTR_RIE_RRUUU2 6, { R_8,R_12,U8_16,U6_26,U8_32,0 } /* e.g. risbgz */
|
||||
+#define INSTR_RIE_RRUUU3 6, { R_8,R_12,U8_16,U5_27,U8_32,0 } /* e.g. risbhg */
|
||||
+#define INSTR_RIE_RRUUU4 6, { R_8,R_12,U6_18,U8_24,U8_32,0 } /* e.g. rnsbgt */
|
||||
#define INSTR_RIL_0P 6, { J32_16,0,0,0,0 } /* e.g. jg */
|
||||
#define INSTR_RIL_RP 6, { R_8,J32_16,0,0,0,0 } /* e.g. brasl */
|
||||
#define INSTR_RIL_UP 6, { U4_8,J32_16,0,0,0,0 } /* e.g. brcl */
|
||||
@@ -374,6 +382,7 @@ static inline void unused_s390_operands_static_asserts(void)
|
||||
#define INSTR_RRF_R0RR2 4, { R_24,R_28,R_16,0,0,0 } /* e.g. ark */
|
||||
#define INSTR_RRF_R0RER 4, { RE_24,R_28,R_16,0,0,0 } /* e.g. mgrk */
|
||||
#define INSTR_RRF_R0RR3 4, { R_24,R_28,R_16,0,0,0 } /* e.g. selrz */
|
||||
+#define INSTR_RRF_R0RR4 4, { R_24,R_CP16_28,0,0,0,0 } /* e.g. notr */
|
||||
#define INSTR_RRF_U0FF 4, { F_24,U4_16,F_28,0,0,0 } /* e.g. fidbr */
|
||||
#define INSTR_RRF_U0FEFE 4, { FE_24,U4_16,FE_28,0,0,0 } /* e.g. fixbr */
|
||||
#define INSTR_RRF_U0RF 4, { R_24,U4_16,F_28,0,0,0 } /* e.g. cfebr */
|
||||
@@ -550,6 +559,8 @@ static inline void unused_s390_operands_static_asserts(void)
|
||||
#define MASK_RIE_RUI0 { 0xff, 0x00, 0x00, 0x00, 0xff, 0xff }
|
||||
#define MASK_RIE_RRUUU { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
#define MASK_RIE_RRUUU2 { 0xff, 0x00, 0x00, 0xc0, 0x00, 0xff }
|
||||
+#define MASK_RIE_RRUUU3 { 0xff, 0x00, 0x00, 0xe0, 0x00, 0xff }
|
||||
+#define MASK_RIE_RRUUU4 { 0xff, 0x00, 0xc0, 0x00, 0x00, 0xff }
|
||||
#define MASK_RIL_0P { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RIL_RP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RIL_UP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
|
||||
@@ -598,6 +609,7 @@ static inline void unused_s390_operands_static_asserts(void)
|
||||
#define MASK_RRF_R0RR2 { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RRF_R0RER { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RRF_R0RR3 { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
|
||||
+#define MASK_RRF_R0RR4 { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RRF_U0FF { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RRF_U0FEFE { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RRF_U0RF { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
|
||||
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
|
||||
--- a/opcodes/s390-opc.txt
|
||||
+++ b/opcodes/s390-opc.txt
|
||||
@@ -272,6 +272,7 @@ a701 tml RI_RU "test under mask low" g5 esa,zarch
|
||||
4700 nop RX_0RRD "no operation" g5 esa,zarch optparm
|
||||
4700 b*8 RX_0RRD "conditional branch" g5 esa,zarch
|
||||
47f0 b RX_0RRD "unconditional branch" g5 esa,zarch
|
||||
+a704 jc RI_UP "conditional jump" g5 esa,zarch
|
||||
a704 jnop RI_0P "nop jump" g5 esa,zarch
|
||||
a704 j*8 RI_0P "conditional jump" g5 esa,zarch
|
||||
a704 br*8 RI_0P "conditional jump" g5 esa,zarch
|
||||
@@ -473,8 +474,10 @@ eb0000000080 icmh RSE_RURD "insert characters under mask high" z900 zarch
|
||||
a702 tmhh RI_RU "test under mask high high" z900 zarch
|
||||
a703 tmhl RI_RU "test under mask high low" z900 zarch
|
||||
c004 brcl RIL_UP "branch relative on condition long" z900 esa,zarch
|
||||
+# jlc omitted due to missing jl* (see jl*8) and not added as non-standard jgc
|
||||
c004 jgnop RIL_0P "nop jump long" z900 esa,zarch
|
||||
c004 jg*8 RIL_0P "conditional jump long" z900 esa,zarch
|
||||
+# jl*8 omitted due to clash with non-standard j*8 flavors jle and jlh; exists as non-standard jg*8 instead
|
||||
c004 br*8l RIL_0P "conditional jump long" z900 esa,zarch
|
||||
c0f4 jg RIL_0P "unconditional jump long" z900 esa,zarch
|
||||
c0f4 brul RIL_0P "unconditional jump long" z900 esa,zarch
|
||||
@@ -523,6 +526,7 @@ a50c llihh RI_RU "load logical immediate high high" z900 zarch
|
||||
a50d llihl RI_RU "load logical immediate high low" z900 zarch
|
||||
a50e llilh RI_RU "load logical immediate low high" z900 zarch
|
||||
a50f llill RI_RU "load logical immediate low low" z900 zarch
|
||||
+a50f llghi RI_RU "load logical immediate" z900 zarch
|
||||
b2b1 stfl S_RD "store facility list" z900 esa,zarch
|
||||
b2b2 lpswe S_RD "load psw extended" z900 zarch
|
||||
b90d dsgr RRE_RER "divide single 64" z900 zarch
|
||||
@@ -750,6 +754,7 @@ c006 xihf RIL_RU "exclusive or immediate high" z9-109 zarch
|
||||
c007 xilf RIL_RU "exclusive or immediate low" z9-109 zarch
|
||||
c008 iihf RIL_RU "insert immediate high" z9-109 zarch
|
||||
c009 iilf RIL_RU "insert immediate low" z9-109 zarch
|
||||
+c009 lfi RIL_RU "insert immediate 32" z9-109 zarch
|
||||
# z9-109 misc instruction
|
||||
b983 flogr RRE_RER "find leftmost one" z9-109 zarch
|
||||
e30000000012 lt RXY_RRRD "load and test 32" z9-109 zarch
|
||||
@@ -767,6 +772,7 @@ b995 llhr RRE_RR "load logical halfword 32" z9-109 zarch
|
||||
b985 llghr RRE_RR "load logical halfword 64" z9-109 zarch
|
||||
c00e llihf RIL_RU "load logical immediate high" z9-109 zarch
|
||||
c00f llilf RIL_RU "load logical immediate low" z9-109 zarch
|
||||
+c00f llgfi RIL_RU "load logical immediate" z9-109 zarch
|
||||
c00c oihf RIL_RU "or immediate high" z9-109 zarch
|
||||
c00d oilf RIL_RU "or immediate low" z9-109 zarch
|
||||
c205 slfi RIL_RU "subtract logical immediate 32" z9-109 zarch
|
||||
@@ -969,8 +975,11 @@ c200 msgfi RIL_RI "multiply single immediate (64)" z10 zarch
|
||||
e30000000036 pfd RXY_URRD "prefetch data" z10 zarch
|
||||
c602 pfdrl RIL_UP "prefetch data relative long" z10 zarch
|
||||
ec0000000054 rnsbg RIE_RRUUU "rotate then and selected bits" z10 zarch optparm
|
||||
+ec0080000054 rnsbgt RIE_RRUUU4 "rotate then and selected bits and test results" z10 zarch optparm
|
||||
ec0000000057 rxsbg RIE_RRUUU "rotate then exclusive or selected bits" z10 zarch optparm
|
||||
+ec0080000057 rxsbgt RIE_RRUUU4 "rotate then exclusive or selected bits and test results" z10 zarch optparm
|
||||
ec0000000056 rosbg RIE_RRUUU "rotate then or selected bits" z10 zarch optparm
|
||||
+ec0080000056 rosbgt RIE_RRUUU4 "rotate then or selected bits and test results" z10 zarch optparm
|
||||
ec0000000055 risbg RIE_RRUUU "rotate then insert selected bits" z10 zarch optparm
|
||||
ec0000800055 risbgz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits" z10 zarch optparm
|
||||
c40f strl RIL_RP "store relative long (32)" z10 zarch
|
||||
@@ -1003,6 +1012,7 @@ b9da alhhlr RRF_R0RR2 "add logical high low" z196 zarch
|
||||
cc0a alsih RIL_RI "add logical with signed immediate high with cc" z196 zarch
|
||||
cc0b alsihn RIL_RI "add logical with signed immediate high no cc" z196 zarch
|
||||
cc06 brcth RIL_RP "branch relative on count high" z196 zarch
|
||||
+cc06 jcth RIL_RP "jump on count high" z196 zarch
|
||||
b9cd chhr RRE_RR "compare high high" z196 zarch
|
||||
b9dd chlr RRE_RR "compare high low" z196 zarch
|
||||
e300000000cd chf RXY_RRRD "compare high" z196 zarch
|
||||
@@ -1017,7 +1027,9 @@ e300000000ca lfh RXY_RRRD "load high" z196 zarch
|
||||
e300000000c2 llch RXY_RRRD "load logical character high" z196 zarch
|
||||
e300000000c6 llhh RXY_RRRD "load logical halfword high" z196 zarch
|
||||
ec000000005d risbhg RIE_RRUUU "rotate then insert selected bits high" z196 zarch optparm
|
||||
+ec000080005d risbhgz RIE_RRUUU3 "rotate then insert selected bits high and zero remaining bits" z196 zarch optparm
|
||||
ec0000000051 risblg RIE_RRUUU "rotate then insert selected bits low" z196 zarch optparm
|
||||
+ec0000800051 risblgz RIE_RRUUU3 "rotate then insert selected bits low and zero remaining bits" z196 zarch optparm
|
||||
e300000000c3 stch RXY_RRRD "store character high" z196 zarch
|
||||
e300000000c7 sthh RXY_RRRD "store halfword high" z196 zarch
|
||||
e300000000cb stfh RXY_RRRD "store high" z196 zarch
|
||||
@@ -1913,7 +1925,9 @@ e50a mvcrl SSE_RDRD "move right to left" arch13 zarch
|
||||
b974 nnrk RRF_R0RR2 "nand 32 bit" arch13 zarch
|
||||
b964 nngrk RRF_R0RR2 "nand 64 bit" arch13 zarch
|
||||
b976 nork RRF_R0RR2 "nor 32 bit" arch13 zarch
|
||||
+b976 notr RRF_R0RR4 "not 32 bit" arch13 zarch
|
||||
b966 nogrk RRF_R0RR2 "nor 64 bit" arch13 zarch
|
||||
+b966 notgr RRF_R0RR4 "not 64 bit" arch13 zarch
|
||||
b977 nxrk RRF_R0RR2 "not exclusive or 32 bit" arch13 zarch
|
||||
b967 nxgrk RRF_R0RR2 "not exclusive or 64 bit" arch13 zarch
|
||||
b975 ocrk RRF_R0RR2 "or with complement 32 bit" arch13 zarch
|
@ -1,30 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-4of12.patch
|
||||
|
||||
;; Backkport "s390: Correct prno instruction name"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
IBM z13 (arch11) introduced ppno (Perform Pseudorandom Number Operation).
|
||||
IBM z14 (arch12) introduced prno (Perform Random Number Operation) and
|
||||
deprecated ppno.
|
||||
|
||||
opcodes/
|
||||
* s390-opc.txt: Correct prno instruction name.
|
||||
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
|
||||
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
|
||||
--- a/opcodes/s390-opc.txt
|
||||
+++ b/opcodes/s390-opc.txt
|
||||
@@ -1910,7 +1910,7 @@ e30000000049 stgsc RXY_RRRD "store guarded storage controls" arch12 zarch
|
||||
|
||||
b929 kma RRF_R0RR "cipher message with galois counter mode" arch12 zarch
|
||||
|
||||
-b93c prno RRE_RR "perform pseudorandom number operation" arch12 zarch
|
||||
+b93c prno RRE_RR "perform random number operation" arch12 zarch
|
||||
b9a1 tpei RRE_RR "test pending external interruption" arch12 zarch
|
||||
b9ac irbm RRE_RR "insert reference bits multiple" arch12 zarch
|
||||
|
@ -1,24 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Nick Clifton <nickc@redhat.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-5of12.patch
|
||||
|
||||
;; Backkport "Fix building for the s390 target with clang"
|
||||
;; (Nick Clifton, RHEL-86801)
|
||||
|
||||
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
|
||||
--- a/opcodes/s390-opc.c
|
||||
+++ b/opcodes/s390-opc.c
|
||||
@@ -262,9 +262,10 @@ const struct s390_operand s390_operands[] =
|
||||
|
||||
};
|
||||
|
||||
-static inline void unused_s390_operands_static_asserts(void)
|
||||
+static inline void ATTRIBUTE_UNUSED
|
||||
+unused_s390_operands_static_asserts (void)
|
||||
{
|
||||
- static_assert(ARRAY_SIZE(s390_operands) - 1 == J32_16);
|
||||
+ static_assert (ARRAY_SIZE (s390_operands) - 1 == J32_16);
|
||||
}
|
||||
|
||||
/* Macros used to form opcodes. */
|
@ -1,97 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-6of12.patch
|
||||
|
||||
;; Backkport "s390: Align letter case of instruction descriptions"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
Change the bitwise operations names "and" and "or" to lower case. Change
|
||||
the register name abbreviations "FPR", "GR", and "VR" to upper case.
|
||||
|
||||
opcodes/
|
||||
* s390-opc.txt: Align letter case of instruction descriptions.
|
||||
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
|
||||
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
|
||||
--- a/opcodes/s390-opc.txt
|
||||
+++ b/opcodes/s390-opc.txt
|
||||
@@ -144,14 +144,14 @@ d3 mvz SS_L0RDRD "move zones" g5 esa,zarch
|
||||
67 mxd RX_FERRD "multiply (long to ext.)" g5 esa,zarch
|
||||
27 mxdr RR_FEF "multiply (long to ext.)" g5 esa,zarch
|
||||
26 mxr RR_FEFE "multiply (ext.)" g5 esa,zarch
|
||||
-54 n RX_RRRD "AND" g5 esa,zarch
|
||||
-d4 nc SS_L0RDRD "AND" g5 esa,zarch
|
||||
-94 ni SI_URD "AND" g5 esa,zarch
|
||||
-14 nr RR_RR "AND" g5 esa,zarch
|
||||
-56 o RX_RRRD "OR" g5 esa,zarch
|
||||
-d6 oc SS_L0RDRD "OR" g5 esa,zarch
|
||||
-96 oi SI_URD "OR" g5 esa,zarch
|
||||
-16 or RR_RR "OR" g5 esa,zarch
|
||||
+54 n RX_RRRD "and" g5 esa,zarch
|
||||
+d4 nc SS_L0RDRD "and" g5 esa,zarch
|
||||
+94 ni SI_URD "and" g5 esa,zarch
|
||||
+14 nr RR_RR "and" g5 esa,zarch
|
||||
+56 o RX_RRRD "or" g5 esa,zarch
|
||||
+d6 oc SS_L0RDRD "or" g5 esa,zarch
|
||||
+96 oi SI_URD "or" g5 esa,zarch
|
||||
+16 or RR_RR "or" g5 esa,zarch
|
||||
f2 pack SS_LLRDRD "pack" g5 esa,zarch
|
||||
b248 palb RRE_00 "purge ALB" g5 esa,zarch
|
||||
b218 pc S_RD "program call" g5 esa,zarch
|
||||
@@ -215,8 +215,8 @@ b6 stctl RS_CCRD "store control" g5 esa,zarch
|
||||
40 sth RX_RRRD "store halfword" g5 esa,zarch
|
||||
b202 stidp S_RD "store CPU id" g5 esa,zarch
|
||||
90 stm RS_RRRD "store multiple" g5 esa,zarch
|
||||
-ac stnsm SI_URD "store then AND system mask" g5 esa,zarch
|
||||
-ad stosm SI_URD "store then OR system mask" g5 esa,zarch
|
||||
+ac stnsm SI_URD "store then and system mask" g5 esa,zarch
|
||||
+ad stosm SI_URD "store then or system mask" g5 esa,zarch
|
||||
b209 stpt S_RD "store CPU timer" g5 esa,zarch
|
||||
b211 stpx S_RD "store prefix" g5 esa,zarch
|
||||
b234 stsch S_RD "store subchannel" g5 esa,zarch
|
||||
@@ -239,10 +239,10 @@ dd trt SS_L0RDRD "translate and test" g5 esa,zarch
|
||||
b235 tsch S_RD "test subchannel" g5 esa,zarch
|
||||
f3 unpk SS_LLRDRD "unpack" g5 esa,zarch
|
||||
0102 upt E "update tree" g5 esa,zarch
|
||||
-57 x RX_RRRD "exclusive OR" g5 esa,zarch
|
||||
-d7 xc SS_L0RDRD "exclusive OR" g5 esa,zarch
|
||||
-97 xi SI_URD "exclusive OR" g5 esa,zarch
|
||||
-17 xr RR_RR "exclusive OR" g5 esa,zarch
|
||||
+57 x RX_RRRD "exclusive or" g5 esa,zarch
|
||||
+d7 xc SS_L0RDRD "exclusive or" g5 esa,zarch
|
||||
+97 xi SI_URD "exclusive or" g5 esa,zarch
|
||||
+17 xr RR_RR "exclusive or" g5 esa,zarch
|
||||
f8 zap SS_LLRDRD "zero and add" g5 esa,zarch
|
||||
a70a ahi RI_RI "add halfword immediate" g5 esa,zarch
|
||||
84 brxh RSI_RRP "branch relative on index high" g5 esa,zarch
|
||||
@@ -821,8 +821,8 @@ b370 lpdfr RRE_FF "load positive no cc" z9-ec zarch
|
||||
b371 lndfr RRE_FF "load negative no cc" z9-ec zarch
|
||||
b372 cpsdr RRF_F0FF2 "copy sign" z9-ec zarch
|
||||
b373 lcdfr RRE_FF "load complement no cc" z9-ec zarch
|
||||
-b3c1 ldgr RRE_FR "load fpr from gr" z9-ec zarch
|
||||
-b3cd lgdr RRE_RF "load gr from fpr" z9-ec zarch
|
||||
+b3c1 ldgr RRE_FR "load FPR from GR" z9-ec zarch
|
||||
+b3cd lgdr RRE_RF "load GR from FPR" z9-ec zarch
|
||||
b3d2 adtr RRR_F0FF "add long dfp" z9-ec zarch
|
||||
b3da axtr RRR_FE0FEFE "add extended dfp" z9-ec zarch
|
||||
b3e4 cdtr RRE_FF "compare long dfp" z9-ec zarch
|
||||
@@ -1203,11 +1203,11 @@ e70000000040 vleib VRI_V0IU "vector load byte element immediate" z13 zarch vx
|
||||
e70000000041 vleih VRI_V0IU "vector load halfword element immediate" z13 zarch vx
|
||||
e70000000043 vleif VRI_V0IU "vector load word element immediate" z13 zarch vx
|
||||
e70000000042 vleig VRI_V0IU "vector load double word element immediate" z13 zarch vx
|
||||
-e70000000021 vlgv VRS_RVRDU "vector load gr from vr element" z13 zarch vx
|
||||
-e70000000021 vlgvb VRS_RVRD "vector load gr from vr byte element" z13 zarch vx
|
||||
-e70000001021 vlgvh VRS_RVRD "vector load gr from vr halfword element" z13 zarch vx
|
||||
-e70000002021 vlgvf VRS_RVRD "vector load gr from vr word element" z13 zarch vx
|
||||
-e70000003021 vlgvg VRS_RVRD "vector load gr from vr double word element" z13 zarch vx
|
||||
+e70000000021 vlgv VRS_RVRDU "vector load GR from VR element" z13 zarch vx
|
||||
+e70000000021 vlgvb VRS_RVRD "vector load GR from VR byte element" z13 zarch vx
|
||||
+e70000001021 vlgvh VRS_RVRD "vector load GR from VR halfword element" z13 zarch vx
|
||||
+e70000002021 vlgvf VRS_RVRD "vector load GR from VR word element" z13 zarch vx
|
||||
+e70000003021 vlgvg VRS_RVRD "vector load GR from VR double word element" z13 zarch vx
|
||||
e70000000004 vllez VRX_VRRDU "vector load logical element and zero" z13 zarch vx
|
||||
e70000000004 vllezb VRX_VRRD "vector load logical byte element and zero" z13 zarch vx
|
||||
e70000001004 vllezh VRX_VRRD "vector load logical halfword element and zero" z13 zarch vx
|
@ -1,97 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-7of12.patch
|
||||
|
||||
;; Backkport "s390: Provide IBM z16 (arch14) instruction descriptions"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
Provide descriptions for instructions introduced with commit ba2b480f103
|
||||
("IBM Z: Implement instruction set extensions"). This complements commit
|
||||
69341966def ("IBM zSystems: Add support for z16 as CPU name."). Use
|
||||
instruction names from IBM z/Architecture Principles of Operation [1] as
|
||||
instruction description.
|
||||
|
||||
[1]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16,
|
||||
https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf
|
||||
|
||||
opcodes/
|
||||
* s390-opc.txt: Add descriptions for IBM z16 (arch14)
|
||||
instructions.
|
||||
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
|
||||
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
|
||||
--- a/opcodes/s390-opc.txt
|
||||
+++ b/opcodes/s390-opc.txt
|
||||
@@ -2034,31 +2034,41 @@ e60000000052 vcvbg VRR_RV0UU "vector convert to binary 64 bit" arch13 zarch optp
|
||||
b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch
|
||||
|
||||
|
||||
-# arch14 instructions
|
||||
-
|
||||
-e60000000074 vschp VRR_VVV0U0U " " arch14 zarch
|
||||
-e60000002074 vschsp VRR_VVV0U0 " " arch14 zarch
|
||||
-e60000003074 vschdp VRR_VVV0U0 " " arch14 zarch
|
||||
-e60000004074 vschxp VRR_VVV0U0 " " arch14 zarch
|
||||
-e6000000007c vscshp VRR_VVV " " arch14 zarch
|
||||
-e6000000007d vcsph VRR_VVV0U0 " " arch14 zarch
|
||||
-e60000000051 vclzdp VRR_VV0U2 " " arch14 zarch
|
||||
-e60000000070 vpkzr VRI_VVV0UU2 " " arch14 zarch
|
||||
-e60000000072 vsrpr VRI_VVV0UU2 " " arch14 zarch
|
||||
-e60000000054 vupkzh VRR_VV0U2 " " arch14 zarch
|
||||
-e6000000005c vupkzl VRR_VV0U2 " " arch14 zarch
|
||||
-
|
||||
-b93b nnpa RRE_00 " " arch14 zarch
|
||||
-e60000000056 vclfnh VRR_VV0UU2 " " arch14 zarch
|
||||
-e6000000005e vclfnl VRR_VV0UU2 " " arch14 zarch
|
||||
-e60000000075 vcrnf VRR_VVV0UU " " arch14 zarch
|
||||
-e6000000005d vcfn VRR_VV0UU2 " " arch14 zarch
|
||||
-e60000000055 vcnf VRR_VV0UU2 " " arch14 zarch
|
||||
-
|
||||
-b98B rdp RRF_RURR2 " " arch14 zarch optparm
|
||||
-
|
||||
-eb0000000071 lpswey SIY_RD " " arch14 zarch
|
||||
-b200 lbear S_RD " " arch14 zarch
|
||||
-b201 stbear S_RD " " arch14 zarch
|
||||
-
|
||||
-b28f qpaci S_RD " " arch14 zarch
|
||||
+# arch14 (z16) instructions
|
||||
+
|
||||
+# Vector-Packed-Decimal-Enhancement Facility 2
|
||||
+
|
||||
+e60000000074 vschp VRR_VVV0U0U "decimal scale and convert to hfp" arch14 zarch
|
||||
+e60000002074 vschsp VRR_VVV0U0 "decimal scale and convert to short hfp" arch14 zarch
|
||||
+e60000003074 vschdp VRR_VVV0U0 "decimal scale and convert to long hfp" arch14 zarch
|
||||
+e60000004074 vschxp VRR_VVV0U0 "decimal scale and convert to extended hfp" arch14 zarch
|
||||
+e6000000007c vscshp VRR_VVV "decimal scale and convert and split to hfp" arch14 zarch
|
||||
+e6000000007d vcsph VRR_VVV0U0 "vector convert hfp to scaled decimal" arch14 zarch
|
||||
+e60000000051 vclzdp VRR_VV0U2 "vector count leading zero digits" arch14 zarch
|
||||
+e60000000070 vpkzr VRI_VVV0UU2 "vector pack zoned register" arch14 zarch
|
||||
+e60000000072 vsrpr VRI_VVV0UU2 "vector shift and round decimal register" arch14 zarch
|
||||
+e60000000054 vupkzh VRR_VV0U2 "vector unpack zoned high" arch14 zarch
|
||||
+e6000000005c vupkzl VRR_VV0U2 "vector unpack zoned low" arch14 zarch
|
||||
+
|
||||
+# Neural-Network-Processing-Assist Facility
|
||||
+
|
||||
+b93b nnpa RRE_00 "neural network processing assist" arch14 zarch
|
||||
+e60000000056 vclfnh VRR_VV0UU2 "vector fp convert and lengthen from nnp high" arch14 zarch
|
||||
+e6000000005e vclfnl VRR_VV0UU2 "vector fp convert and lengthen from nnp low" arch14 zarch
|
||||
+e60000000075 vcrnf VRR_VVV0UU "vector fp convert and round to nnp" arch14 zarch
|
||||
+e6000000005d vcfn VRR_VV0UU2 "vector fp convert from nnp" arch14 zarch
|
||||
+e60000000055 vcnf VRR_VV0UU2 "vector fp convert to nnp" arch14 zarch
|
||||
+
|
||||
+# Reset-DAT-Protection Facility
|
||||
+
|
||||
+b98B rdp RRF_RURR2 "reset dat protection" arch14 zarch optparm
|
||||
+
|
||||
+# BEAR-Enhancement Facility
|
||||
+
|
||||
+eb0000000071 lpswey SIY_RD "load PSW extended" arch14 zarch
|
||||
+b200 lbear S_RD "load bear" arch14 zarch
|
||||
+b201 stbear S_RD "store bear" arch14 zarch
|
||||
+
|
||||
+# Processor-Activity-Instrumentation Facility
|
||||
+
|
||||
+b28f qpaci S_RD "query processor activity counter information" arch14 zarch
|
@ -1,25 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-8of12.patch
|
||||
|
||||
;; Backkport "s390: Align opcodes to lower-case"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
opcodes/
|
||||
* s390-opc.txt (rdp): Change opcode to lower-case.
|
||||
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
|
||||
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
|
||||
--- a/opcodes/s390-opc.txt
|
||||
+++ b/opcodes/s390-opc.txt
|
||||
@@ -2061,7 +2061,7 @@ e60000000055 vcnf VRR_VV0UU2 "vector fp convert to nnp" arch14 zarch
|
||||
|
||||
# Reset-DAT-Protection Facility
|
||||
|
||||
-b98B rdp RRF_RURR2 "reset dat protection" arch14 zarch optparm
|
||||
+b98b rdp RRF_RURR2 "reset dat protection" arch14 zarch optparm
|
||||
|
||||
# BEAR-Enhancement Facility
|
||||
|
@ -1,151 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Jens Remus <jremus@linux.ibm.com>
|
||||
Date: Mon, 28 Apr 2025 11:23:22 -0700
|
||||
Subject: gdb-rhel-86801-binutils-z17-update-9of12.patch
|
||||
|
||||
;; Backkport "s390: Simplify (dis)assembly of insn operands with const bits"
|
||||
;; (Jens Remus, RHEL-86801)
|
||||
|
||||
Simplify assembly and disassembly of extended mnemonics with operands
|
||||
with constant ORed bits:
|
||||
Their instruction template already contains the respective constant
|
||||
operand bits, as they are significant to distinguish the extended from
|
||||
their base mnemonic. Operands are ORed into the instruction template.
|
||||
Therefore it is not necessary to OR the constant bits into the operand
|
||||
value during assembly in s390_insert_operand.
|
||||
Additionally the constant operand bits from the instruction template
|
||||
can be used to mask them from the operand value during disassembly in
|
||||
s390_print_insn_with_opcode. For now do so for non-length unsigned
|
||||
integer operands only.
|
||||
|
||||
The separate instruction formats need to be retained, as their masks
|
||||
differ, which is relevant during disassembly to distinguish the base
|
||||
and extended mnemonics from each other.
|
||||
|
||||
This affects the following extended mnemonics:
|
||||
- vfaebs, vfaehs, vfaefs
|
||||
- vfaezb, vfaezh, vfaezf
|
||||
- vfaezbs, vfaezhs, vfaezfs
|
||||
- vstrcbs, vstrchs, vstrcfs
|
||||
- vstrczb, vstrczh, vstrczf
|
||||
- vstrczbs, vstrczhs, vstrczfs
|
||||
- wcefb, wcdgb
|
||||
- wcelfb, wcdlgb
|
||||
- wcfeb, wcgdb
|
||||
- wclfeb, wclgdb
|
||||
- wfisb, wfidb, wfixb
|
||||
- wledb, wflrd, wflrx
|
||||
|
||||
include/
|
||||
* opcode/s390.h (S390_OPERAND_OR1, S390_OPERAND_OR2,
|
||||
S390_OPERAND_OR8): Remove.
|
||||
|
||||
opcodes/
|
||||
* s390-opc.c (U4_OR1_24, U4_OR2_24, U4_OR8_28): Remove.
|
||||
(INSTR_VRR_VVV0U1, INSTR_VRR_VVV0U2, INSTR_VRR_VVV0U3): Define
|
||||
as INSTR_VRR_VVV0U0 while retaining respective insn fmt mask.
|
||||
(INSTR_VRR_VV0UU8): Define as INSTR_VRR_VV0UU while retaining
|
||||
respective insn fmt mask.
|
||||
(INSTR_VRR_VVVU0VB1, INSTR_VRR_VVVU0VB2, INSTR_VRR_VVVU0VB3):
|
||||
Define as INSTR_VRR_VVVU0VB while retaining respective insn fmt
|
||||
mask.
|
||||
* s390-dis.c (s390_print_insn_with_opcode): Mask constant
|
||||
operand bits set in insn template of non-length unsigned
|
||||
integer operands.
|
||||
|
||||
gas/
|
||||
* config/tc-s390.c (s390_insert_operand): Do not OR constant
|
||||
operand value bits.
|
||||
|
||||
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
||||
|
||||
diff --git a/include/opcode/s390.h b/include/opcode/s390.h
|
||||
--- a/include/opcode/s390.h
|
||||
+++ b/include/opcode/s390.h
|
||||
@@ -168,8 +168,4 @@ extern const struct s390_operand s390_operands[];
|
||||
|
||||
#define S390_OPERAND_CP16 0x1000
|
||||
|
||||
-#define S390_OPERAND_OR1 0x2000
|
||||
-#define S390_OPERAND_OR2 0x4000
|
||||
-#define S390_OPERAND_OR8 0x8000
|
||||
-
|
||||
#endif /* S390_H */
|
||||
diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c
|
||||
--- a/opcodes/s390-dis.c
|
||||
+++ b/opcodes/s390-dis.c
|
||||
@@ -277,12 +277,14 @@ s390_print_insn_with_opcode (bfd_vma memaddr,
|
||||
{
|
||||
enum disassembler_style style;
|
||||
|
||||
- if (flags & S390_OPERAND_OR1)
|
||||
- val.u &= ~1;
|
||||
- if (flags & S390_OPERAND_OR2)
|
||||
- val.u &= ~2;
|
||||
- if (flags & S390_OPERAND_OR8)
|
||||
- val.u &= ~8;
|
||||
+ if (!(flags & S390_OPERAND_LENGTH))
|
||||
+ {
|
||||
+ union operand_value insn_opval;
|
||||
+
|
||||
+ /* Mask any constant operand bits set in insn template. */
|
||||
+ insn_opval = s390_extract_operand (opcode->opcode, operand);
|
||||
+ val.u &= ~insn_opval.u;
|
||||
+ }
|
||||
|
||||
if ((opcode->flags & S390_INSTR_FLAG_OPTPARM)
|
||||
&& val.u == 0
|
||||
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
|
||||
--- a/opcodes/s390-opc.c
|
||||
+++ b/opcodes/s390-opc.c
|
||||
@@ -208,17 +208,9 @@ const struct s390_operand s390_operands[] =
|
||||
{ 4, 20, 0 },
|
||||
#define U4_24 (U4_20 + 1) /* 4 bit unsigned value starting at 24 */
|
||||
{ 4, 24, 0 },
|
||||
-#define U4_OR1_24 (U4_24 + 1) /* 4 bit unsigned value ORed with 1 */
|
||||
- { 4, 24, S390_OPERAND_OR1 }, /* starting at 24 */
|
||||
-#define U4_OR2_24 (U4_OR1_24+1) /* 4 bit unsigned value ORed with 2 */
|
||||
- { 4, 24, S390_OPERAND_OR2 }, /* starting at 24 */
|
||||
-#define U4_OR3_24 (U4_OR2_24+1) /* 4 bit unsigned value ORed with 3 */
|
||||
- { 4, 24, S390_OPERAND_OR1 | S390_OPERAND_OR2 }, /* starting at 24 */
|
||||
-#define U4_28 (U4_OR3_24+1) /* 4 bit unsigned value starting at 28 */
|
||||
+#define U4_28 (U4_24+1) /* 4 bit unsigned value starting at 28 */
|
||||
{ 4, 28, 0 },
|
||||
-#define U4_OR8_28 (U4_28 + 1) /* 4 bit unsigned value ORed with 8 */
|
||||
- { 4, 28, S390_OPERAND_OR8 }, /* starting at 28 */
|
||||
-#define U4_32 (U4_OR8_28+1) /* 4 bit unsigned value starting at 32 */
|
||||
+#define U4_32 (U4_28+1) /* 4 bit unsigned value starting at 32 */
|
||||
{ 4, 32, 0 },
|
||||
#define U4_36 (U4_32 + 1) /* 4 bit unsigned value starting at 36 */
|
||||
{ 4, 36, 0 },
|
||||
@@ -512,23 +504,23 @@ unused_s390_operands_static_asserts (void)
|
||||
#define INSTR_VRR_VRR 6, { V_8,R_12,R_16,0,0,0 } /* e.g. vlvgp */
|
||||
#define INSTR_VRR_VVV0U 6, { V_8,V_12,V_16,U4_32,0,0 } /* e.g. vmrh */
|
||||
#define INSTR_VRR_VVV0U0 6, { V_8,V_12,V_16,U4_24,0,0 } /* e.g. vfaeb */
|
||||
-#define INSTR_VRR_VVV0U1 6, { V_8,V_12,V_16,U4_OR1_24,0,0 } /* e.g. vfaebs*/
|
||||
-#define INSTR_VRR_VVV0U2 6, { V_8,V_12,V_16,U4_OR2_24,0,0 } /* e.g. vfaezb*/
|
||||
-#define INSTR_VRR_VVV0U3 6, { V_8,V_12,V_16,U4_OR3_24,0,0 } /* e.g. vfaezbs*/
|
||||
+#define INSTR_VRR_VVV0U1 INSTR_VRR_VVV0U0 /* e.g. vfaebs*/
|
||||
+#define INSTR_VRR_VVV0U2 INSTR_VRR_VVV0U0 /* e.g. vfaezb*/
|
||||
+#define INSTR_VRR_VVV0U3 INSTR_VRR_VVV0U0 /* e.g. vfaezbs*/
|
||||
#define INSTR_VRR_VVV 6, { V_8,V_12,V_16,0,0,0 } /* e.g. vmrhb */
|
||||
#define INSTR_VRR_VVV2 6, { V_8,V_CP16_12,0,0,0,0 } /* e.g. vnot */
|
||||
#define INSTR_VRR_VV0U 6, { V_8,V_12,U4_32,0,0,0 } /* e.g. vseg */
|
||||
#define INSTR_VRR_VV0U2 6, { V_8,V_12,U4_24,0,0,0 } /* e.g. vistrb*/
|
||||
#define INSTR_VRR_VV0UU 6, { V_8,V_12,U4_28,U4_24,0,0 } /* e.g. vcdgb */
|
||||
#define INSTR_VRR_VV0UU2 6, { V_8,V_12,U4_32,U4_28,0,0 } /* e.g. wfc */
|
||||
-#define INSTR_VRR_VV0UU8 6, { V_8,V_12,U4_OR8_28,U4_24,0,0 } /* e.g. wcdgb */
|
||||
+#define INSTR_VRR_VV0UU8 INSTR_VRR_VV0UU /* e.g. wcdgb */
|
||||
#define INSTR_VRR_VV 6, { V_8,V_12,0,0,0,0 } /* e.g. vsegb */
|
||||
#define INSTR_VRR_VVVUU0V 6, { V_8,V_12,V_16,V_32,U4_20,U4_24 } /* e.g. vstrc */
|
||||
#define INSTR_VRR_VVVU0V 6, { V_8,V_12,V_16,V_32,U4_20,0 } /* e.g. vac */
|
||||
#define INSTR_VRR_VVVU0VB 6, { V_8,V_12,V_16,V_32,U4_24,0 } /* e.g. vstrcb*/
|
||||
-#define INSTR_VRR_VVVU0VB1 6, { V_8,V_12,V_16,V_32,U4_OR1_24,0 } /* e.g. vstrcbs*/
|
||||
-#define INSTR_VRR_VVVU0VB2 6, { V_8,V_12,V_16,V_32,U4_OR2_24,0 } /* e.g. vstrczb*/
|
||||
-#define INSTR_VRR_VVVU0VB3 6, { V_8,V_12,V_16,V_32,U4_OR3_24,0 } /* e.g. vstrczbs*/
|
||||
+#define INSTR_VRR_VVVU0VB1 INSTR_VRR_VVVU0VB /* e.g. vstrcbs*/
|
||||
+#define INSTR_VRR_VVVU0VB2 INSTR_VRR_VVVU0VB /* e.g. vstrczb*/
|
||||
+#define INSTR_VRR_VVVU0VB3 INSTR_VRR_VVVU0VB /* e.g. vstrczbs*/
|
||||
#define INSTR_VRR_VVV0V 6, { V_8,V_12,V_16,V_32,0,0 } /* e.g. vacq */
|
||||
#define INSTR_VRR_VVV0U0U 6, { V_8,V_12,V_16,U4_32,U4_24,0 } /* e.g. vfae */
|
||||
#define INSTR_VRR_VVVV 6, { V_8,V_12,V_16,V_32,0,0 } /* e.g. vfmadb*/
|
@ -1,162 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-simultaneous-step-resume-breakpoint-test.patch
|
||||
|
||||
;; New test for step-resume breakpoint placed in multiple threads at once.
|
||||
;;=fedoratest
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c
|
||||
@@ -0,0 +1,79 @@
|
||||
+/* Copyright 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
+ Written by Fred Fish of Cygnus Support
|
||||
+ Contributed by Cygnus Support
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* Test multiple threads stepping into a .debug_line-less function with
|
||||
+ a breakpoint placed on its return-to-caller point. */
|
||||
+
|
||||
+#include <pthread.h>
|
||||
+#include <assert.h>
|
||||
+#include <unistd.h>
|
||||
+#include <errno.h>
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+#define THREADS 3
|
||||
+
|
||||
+static void *
|
||||
+func (void *unused)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ errno = 0;
|
||||
+ i = 0xdeadf00d;
|
||||
+ i = sleep (THREADS); /* sleep-call */
|
||||
+ if (errno != 0) /* sleep-after */
|
||||
+ perror ("sleep");
|
||||
+
|
||||
+ /* The GDB bug with forgotten step-resume breakpoint could leave stale
|
||||
+ breakpoint on the I assignment making it a nop. */
|
||||
+ if (i == 0xdeadf00d)
|
||||
+ assert (0);
|
||||
+
|
||||
+ assert (i == 0);
|
||||
+
|
||||
+ pthread_exit (NULL);
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ pthread_t threads[THREADS];
|
||||
+ int threadi;
|
||||
+
|
||||
+ for (threadi = 0; threadi < THREADS; threadi++)
|
||||
+ {
|
||||
+ int i;
|
||||
+
|
||||
+ i = pthread_create (&threads[threadi], NULL, func, NULL);
|
||||
+ assert (i == 0);
|
||||
+
|
||||
+ i = sleep (1);
|
||||
+ assert (i == 0);
|
||||
+ }
|
||||
+
|
||||
+ for (threadi = 0; threadi < THREADS; threadi++)
|
||||
+ {
|
||||
+ int i;
|
||||
+
|
||||
+ i = pthread_join (threads[threadi], NULL);
|
||||
+ assert (i == 0);
|
||||
+ }
|
||||
+
|
||||
+ return 0; /* final-exit */
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp
|
||||
@@ -0,0 +1,65 @@
|
||||
+# Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+# Test multiple threads stepping into a .debug_line-less function with
|
||||
+# a breakpoint placed on its return-to-caller point.
|
||||
+
|
||||
+set testfile simultaneous-step-resume-breakpoint
|
||||
+set srcfile ${testfile}.c
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+
|
||||
+# Ensure we have no debuginfo for the `sleep' call itself (=for libc).
|
||||
+gdb_test "set debug-file-directory /DoesNotExist"
|
||||
+
|
||||
+gdb_load ${binfile}
|
||||
+if ![runto_main] {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Red Hat vendor patch does set it to "step" by default.
|
||||
+gdb_test "set scheduler-locking off"
|
||||
+
|
||||
+gdb_breakpoint [gdb_get_line_number "final-exit"]
|
||||
+
|
||||
+gdb_breakpoint [gdb_get_line_number "sleep-call"]
|
||||
+gdb_continue_to_breakpoint "sleep-call"
|
||||
+
|
||||
+gdb_test "step" "sleep-call.*" "step thread 1"
|
||||
+gdb_test "step" "sleep-call.*" "step thread 2"
|
||||
+gdb_test "step" "sleep-after.*" "step thread 3"
|
||||
+
|
||||
+set test "first continue"
|
||||
+gdb_test_multiple "continue" $test {
|
||||
+ -re "final-exit.*$gdb_prompt $" {
|
||||
+ # gdb-7.0.
|
||||
+ pass $test
|
||||
+ return
|
||||
+ }
|
||||
+ -re "sleep-after.*$gdb_prompt $" {
|
||||
+ # Fedora/RHEL branch.
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+gdb_test "continue" "sleep-after.*" "second continue"
|
||||
+gdb_test "continue" "final-exit.*" "third continue"
|
@ -1,214 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-test-bt-cfi-without-die.patch
|
||||
|
||||
;; [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604).
|
||||
;;=fedoratest
|
||||
|
||||
http://sourceware.org/ml/archer/2010-q3/msg00028.html
|
||||
|
||||
On Wed, 25 Feb 2009 00:14:29 +0100, Jan Kratochvil wrote:
|
||||
> commit 6a37c2b9962258ecf9299cc34a650e64a06acaa5
|
||||
>
|
||||
> There was a regression on gdb.base/savedregs.exp.
|
||||
>
|
||||
> quick_addrmap/require_partial_symbols should be used even for the unwind debug
|
||||
> info checking as its load has been also delayed by this branch.
|
||||
[...]
|
||||
> --- a/gdb/dwarf2-frame.c
|
||||
> +++ b/gdb/dwarf2-frame.c
|
||||
[...]
|
||||
> @@ -1499,6 +1500,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
|
||||
> struct dwarf2_fde *fde;
|
||||
> CORE_ADDR offset;
|
||||
>
|
||||
> + if (objfile->quick_addrmap)
|
||||
> + {
|
||||
> + if (!addrmap_find (objfile->quick_addrmap, *pc))
|
||||
> + continue;
|
||||
> + }
|
||||
> + /* FIXME: Read-in only .debug_frame/.eh_frame without .debug_info? */
|
||||
> + require_partial_symbols (objfile);
|
||||
> +
|
||||
|
||||
but this has caused a different regression (as discussed in the confcall).
|
||||
|
||||
QUICK_ADDRMAP is built only from .debug_aranges. But we can have existing
|
||||
built .debug_aranges for CUs in OBJFILE but still some CUs do not need to have
|
||||
DWARF at all while they can feature CFIs (.eh_frame or .debug_frame).
|
||||
It has been described by Daniel Jacobowitz at:
|
||||
Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs
|
||||
http://sourceware.org/ml/gdb-patches/2010-07/msg00012.html
|
||||
|
||||
Sorry for this regression by me (in that fix of a different regression).
|
||||
|
||||
Fixed it the "slow way" as this branch is now obsoleted by .gdb-index.
|
||||
|
||||
No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
|
||||
|
||||
Checked-in.
|
||||
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
eb8df8566acc1ed963e3e9b77c13b9c2c3db03fb
|
||||
|
||||
Test CFI is parsed even for range (function) not described by any DIE.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=614028
|
||||
|
||||
gdb/
|
||||
* dwarf2-frame.c (dwarf2_frame_find_fde): Remove the
|
||||
OBJFILE->QUICK_ADDRMAP check. New comment why.
|
||||
|
||||
gdb/testsuite/
|
||||
* gdb.base/cfi-without-die.exp, gdb.base/cfi-without-die-main.c,
|
||||
gdb.base/cfi-without-die-caller.c: New files.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.base/cfi-without-die-caller.c b/gdb/testsuite/gdb.base/cfi-without-die-caller.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/cfi-without-die-caller.c
|
||||
@@ -0,0 +1,28 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+typedef int (*callback_t) (void);
|
||||
+
|
||||
+int
|
||||
+caller (callback_t callback)
|
||||
+{
|
||||
+ /* Ensure some frame content to push away the return address. */
|
||||
+ volatile const long one = 1;
|
||||
+
|
||||
+ /* Modify the return value to prevent any tail-call optimization. */
|
||||
+ return (*callback) () - one;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/cfi-without-die-main.c b/gdb/testsuite/gdb.base/cfi-without-die-main.c
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/cfi-without-die-main.c
|
||||
@@ -0,0 +1,32 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+typedef int (*callback_t) (void);
|
||||
+
|
||||
+extern int caller (callback_t callback);
|
||||
+
|
||||
+int
|
||||
+callback (void)
|
||||
+{
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ return caller (callback);
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/cfi-without-die.exp
|
||||
@@ -0,0 +1,71 @@
|
||||
+# Copyright 2010 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Test CFI is parsed even for range (function) not described by any DIE.
|
||||
+
|
||||
+set testfile cfi-without-die
|
||||
+set srcmainfile ${testfile}-main.c
|
||||
+set srccallerfile ${testfile}-caller.c
|
||||
+set executable ${testfile}
|
||||
+set objmainfile [standard_output_file ${testfile}-main.o]
|
||||
+set objcallerfile [standard_output_file ${testfile}-caller.o]
|
||||
+set binfile [standard_output_file ${executable}]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \
|
||||
+ object [list {additional_flags=-fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables}]] != ""
|
||||
+ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != ""
|
||||
+ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } {
|
||||
+ untested ${testfile}.exp
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+clean_restart $executable
|
||||
+
|
||||
+if ![runto callback] then {
|
||||
+ fail "verify unwinding: Can't run to callback"
|
||||
+ return 0
|
||||
+}
|
||||
+set test "verify unwinding breaks without CFI"
|
||||
+gdb_test_multiple "bt" $test {
|
||||
+ -re " in \[?\]\[?\] .*\r\n$gdb_prompt $" {
|
||||
+ # It may backtrace through some random frames even to main().
|
||||
+ pass $test
|
||||
+ }
|
||||
+ -re " in main .*\r\n$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+ -re "\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \
|
||||
+ object [list {additional_flags=-fomit-frame-pointer -funwind-tables -fasynchronous-unwind-tables}]] != ""
|
||||
+ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != ""
|
||||
+ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } {
|
||||
+ untested ${testfile}.exp
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+clean_restart $executable
|
||||
+
|
||||
+if ![runto callback] then {
|
||||
+ fail "test CFI without DIEs: Can't run to callback"
|
||||
+ return 0
|
||||
+}
|
||||
+# #0 callback () at ...
|
||||
+# #1 0x00000000004004e9 in caller ()
|
||||
+# #2 0x00000000004004cd in main () at ...
|
||||
+gdb_test "bt" "#0 +callback \[^\r\n\]+\r\n#1 \[^\r\n\]+ in caller \[^\r\n\]+\r\n#2 \[^\r\n\]+ in main \[^\r\n\]+" "verify unwindin works for CFI without DIEs"
|
@ -1,220 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Fedora GDB patches <invalid@email.com>
|
||||
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
||||
Subject: gdb-test-dw2-aranges.patch
|
||||
|
||||
;; [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp.
|
||||
;;=fedoratest
|
||||
|
||||
[archer-tromey-delayed-symfile]
|
||||
|
||||
commit 77fa7778a37b0d28a7e4e5235f074a10ecf1815d
|
||||
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
|
||||
Date: Sat Aug 15 15:05:54 2009 +0200
|
||||
|
||||
Test for "handle incorrect aranges".
|
||||
|
||||
readelf:
|
||||
Contents of the .debug_aranges section:
|
||||
|
||||
Length: 8
|
||||
Version: 2
|
||||
Offset into .debug_info: 0x0
|
||||
Pointer Size: 0
|
||||
Segment Size: 0
|
||||
|
||||
Address Length
|
||||
Floating point exception
|
||||
|
||||
* gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files.
|
||||
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
|
||||
@@ -0,0 +1,140 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* Test .debug_aranges containing zero address_size. */
|
||||
+
|
||||
+/* Dummy function to provide debug information for. */
|
||||
+
|
||||
+ .text
|
||||
+.Lbegin_text1:
|
||||
+ .globl main
|
||||
+ .type main, %function
|
||||
+main:
|
||||
+.Lbegin_main:
|
||||
+ .int 0
|
||||
+.Lend_main:
|
||||
+ .size main, .-main
|
||||
+.Lend_text1:
|
||||
+
|
||||
+/* Debug information */
|
||||
+
|
||||
+ .section .debug_info
|
||||
+.Lcu1_begin:
|
||||
+ /* CU header */
|
||||
+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
|
||||
+.Lcu1_start:
|
||||
+ .2byte 2 /* DWARF Version */
|
||||
+ .4byte .Labbrev1_begin /* Offset into abbrev section */
|
||||
+ .byte 4 /* Pointer size */
|
||||
+
|
||||
+ /* CU die */
|
||||
+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
|
||||
+ .4byte .Lend_text1 /* DW_AT_high_pc */
|
||||
+ .4byte .Lbegin_text1 /* DW_AT_low_pc */
|
||||
+ .ascii "file1.txt\0" /* DW_AT_name */
|
||||
+ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
|
||||
+ .byte 1 /* DW_AT_language (C) */
|
||||
+
|
||||
+ /* main */
|
||||
+ .uleb128 2 /* Abbrev: DW_TAG_subprogram */
|
||||
+ .byte 1 /* DW_AT_external */
|
||||
+ .byte 1 /* DW_AT_decl_file */
|
||||
+ .byte 2 /* DW_AT_decl_line */
|
||||
+ .ascii "main\0" /* DW_AT_name */
|
||||
+ .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
|
||||
+ .4byte .Lbegin_main /* DW_AT_low_pc */
|
||||
+ .4byte .Lend_main /* DW_AT_high_pc */
|
||||
+ .byte 1 /* DW_AT_frame_base: length */
|
||||
+ .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */
|
||||
+
|
||||
+.Ltype_int:
|
||||
+ .uleb128 3 /* Abbrev: DW_TAG_base_type */
|
||||
+ .ascii "int\0" /* DW_AT_name */
|
||||
+ .byte 4 /* DW_AT_byte_size */
|
||||
+ .byte 5 /* DW_AT_encoding */
|
||||
+
|
||||
+ .byte 0 /* End of children of CU */
|
||||
+
|
||||
+.Lcu1_end:
|
||||
+
|
||||
+/* Abbrev table */
|
||||
+ .section .debug_abbrev
|
||||
+.Labbrev1_begin:
|
||||
+ .uleb128 1 /* Abbrev code */
|
||||
+ .uleb128 0x11 /* DW_TAG_compile_unit */
|
||||
+ .byte 1 /* has_children */
|
||||
+ .uleb128 0x12 /* DW_AT_high_pc */
|
||||
+ .uleb128 0x1 /* DW_FORM_addr */
|
||||
+ .uleb128 0x11 /* DW_AT_low_pc */
|
||||
+ .uleb128 0x1 /* DW_FORM_addr */
|
||||
+ .uleb128 0x3 /* DW_AT_name */
|
||||
+ .uleb128 0x8 /* DW_FORM_string */
|
||||
+ .uleb128 0x25 /* DW_AT_producer */
|
||||
+ .uleb128 0x8 /* DW_FORM_string */
|
||||
+ .uleb128 0x13 /* DW_AT_language */
|
||||
+ .uleb128 0xb /* DW_FORM_data1 */
|
||||
+ .byte 0x0 /* Terminator */
|
||||
+ .byte 0x0 /* Terminator */
|
||||
+
|
||||
+ .uleb128 2 /* Abbrev code */
|
||||
+ .uleb128 0x2e /* DW_TAG_subprogram */
|
||||
+ .byte 0 /* has_children */
|
||||
+ .uleb128 0x3f /* DW_AT_external */
|
||||
+ .uleb128 0xc /* DW_FORM_flag */
|
||||
+ .uleb128 0x3a /* DW_AT_decl_file */
|
||||
+ .uleb128 0xb /* DW_FORM_data1 */
|
||||
+ .uleb128 0x3b /* DW_AT_decl_line */
|
||||
+ .uleb128 0xb /* DW_FORM_data1 */
|
||||
+ .uleb128 0x3 /* DW_AT_name */
|
||||
+ .uleb128 0x8 /* DW_FORM_string */
|
||||
+ .uleb128 0x49 /* DW_AT_type */
|
||||
+ .uleb128 0x13 /* DW_FORM_ref4 */
|
||||
+ .uleb128 0x11 /* DW_AT_low_pc */
|
||||
+ .uleb128 0x1 /* DW_FORM_addr */
|
||||
+ .uleb128 0x12 /* DW_AT_high_pc */
|
||||
+ .uleb128 0x1 /* DW_FORM_addr */
|
||||
+ .uleb128 0x40 /* DW_AT_frame_base */
|
||||
+ .uleb128 0xa /* DW_FORM_block1 */
|
||||
+ .byte 0x0 /* Terminator */
|
||||
+ .byte 0x0 /* Terminator */
|
||||
+
|
||||
+ .uleb128 3 /* Abbrev code */
|
||||
+ .uleb128 0x24 /* DW_TAG_base_type */
|
||||
+ .byte 0 /* has_children */
|
||||
+ .uleb128 0x3 /* DW_AT_name */
|
||||
+ .uleb128 0x8 /* DW_FORM_string */
|
||||
+ .uleb128 0xb /* DW_AT_byte_size */
|
||||
+ .uleb128 0xb /* DW_FORM_data1 */
|
||||
+ .uleb128 0x3e /* DW_AT_encoding */
|
||||
+ .uleb128 0xb /* DW_FORM_data1 */
|
||||
+ .byte 0x0 /* Terminator */
|
||||
+ .byte 0x0 /* Terminator */
|
||||
+
|
||||
+ .byte 0x0 /* Terminator */
|
||||
+ .byte 0x0 /* Terminator */
|
||||
+
|
||||
+/* aranges table */
|
||||
+ .section .debug_aranges
|
||||
+ .long .Laranges_end - 1f
|
||||
+1:
|
||||
+ .2byte 2 /* aranges Version */
|
||||
+ .4byte .Lcu1_begin - .debug_info /* Offset into .debug_info section */
|
||||
+ /* The GDB crasher is this zero value. */
|
||||
+ .byte 0 /* aranges address_size */
|
||||
+ .byte 0 /* aranges segment_size */
|
||||
+
|
||||
+.Laranges_end:
|
||||
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
|
||||
@@ -0,0 +1,40 @@
|
||||
+# Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Test .debug_aranges containing zero address_size.
|
||||
+
|
||||
+# This test can only be run on targets which support DWARF-2 and use gas.
|
||||
+# For now pick a sampling of likely targets.
|
||||
+if {![istarget *-*-linux*]
|
||||
+ && ![istarget *-*-gnu*]
|
||||
+ && ![istarget *-*-elf*]
|
||||
+ && ![istarget *-*-openbsd*]
|
||||
+ && ![istarget arm-*-eabi*]
|
||||
+ && ![istarget powerpc-*-eabi*]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile "dw2-aranges"
|
||||
+set srcfile ${testfile}.S
|
||||
+set binfile [standard_output_file ${testfile}]
|
||||
+
|
||||
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {nodebug}] != "" } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+clean_restart $testfile
|
||||
+
|
||||
+# Failed gdb_load would abort the testcase execution earlier.
|
||||
+pass "file loaded"
|
@ -51,12 +51,12 @@ test -f _patch_order || die "Cannot find _patch_order file."
|
||||
|
||||
last_ancestor_commit=`cat _git_upstream_commit`
|
||||
|
||||
f=`pwd`
|
||||
cd $1
|
||||
|
||||
git name-rev $last_ancestor_commit
|
||||
test $? -eq 0 || die "Could not find $last_ancestor_commit in the repository $1. Did you run 'git fetch'?"
|
||||
|
||||
f=`cd .. && pwd`
|
||||
|
||||
# Create a branch for the checkout if using stgit; use the distro name in
|
||||
# the name of this branch.
|
||||
@ -69,8 +69,8 @@ fi
|
||||
git checkout $branch $last_ancestor_commit
|
||||
|
||||
echo "Applying patches..."
|
||||
for p in `cat ../_patch_order` ; do
|
||||
git am ../$p
|
||||
for p in `cat $f/_patch_order` ; do
|
||||
git am $f/$p
|
||||
test $? -eq 0 || die "Could not apply patch '$p'."
|
||||
done
|
||||
|
||||
|
@ -50,6 +50,7 @@ for f in `cat _patch_order` ; do
|
||||
git rm -f $f
|
||||
done
|
||||
|
||||
orig_dir=`pwd`
|
||||
cd $1
|
||||
|
||||
# If patches were uncommitted when the patches were applied,
|
||||
@ -82,8 +83,18 @@ for c in `git rev-list --reverse ${common_ancestor}..HEAD` ; do
|
||||
# before, even if nothing has changed. This is bad, so we replace
|
||||
# the commit hash by something constant (the string
|
||||
# "FEDORA_PATCHES").
|
||||
git format-patch --no-signature --no-stat --keep-subject -1 --stdout --no-base $c | sed -e '1 s/^From [0-9a-f]\+ \(.*\)/From FEDORA_PATCHES \1/' -e '/^index [0-9a-f]\+\.\.[0-9a-f]\+.*$/d' -e '/^Message-ID:.*$/d' > ../$fname
|
||||
(cd .. && git add $fname)
|
||||
#
|
||||
# Also, different users, or systems, might configure git in
|
||||
# different ways (e.g. the diff.*.xfuncname setting), which can
|
||||
# mean the generated diff files will change from system to system.
|
||||
# Avoid this by disabling all config file reading, this relies on
|
||||
# git 2.32 or later.
|
||||
GIT_CONFIG_SYSTEM=/dev/null GIT_CONFIG_GLOBAL=/dev/null \
|
||||
git format-patch --no-base --no-thread --no-signature --no-stat \
|
||||
--keep-subject -1 --stdout $c \
|
||||
| sed -e '1 s/^From [0-9a-f]\+ \(.*\)/From FEDORA_PATCHES \1/' \
|
||||
-e '/^index [0-9a-f]\+\.\.[0-9a-f]\+.*$/d' > $orig_dir/$fname
|
||||
(cd $orig_dir && git add $fname)
|
||||
|
||||
cat >> $temp_PATCH_file <<EOF
|
||||
`git log -1 --pretty='format:%b' $c | sed -n 's/^;;/#/p'`
|
||||
@ -94,7 +105,7 @@ EOF
|
||||
idx=`expr $idx + 1`
|
||||
done
|
||||
|
||||
cd ..
|
||||
cd $orig_dir
|
||||
mv $temp_PATCH_file _gdb.spec.Patch.include
|
||||
mv $temp_patch_file _gdb.spec.patch.include
|
||||
mv $temp_patch_order_file _patch_order
|
||||
|
4
sources
4
sources
@ -1,3 +1 @@
|
||||
SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8
|
||||
SHA512 (gdb-14.2.tar.xz) = 7e07941f1fe661288cc571b4964012ceabc1760624fce20320db2f470c01439b2386f859b5288da13204b758e2e3b22a74c68c012178db93b9529b06f1e22ede
|
||||
SHA512 (v2.0.5.tar.gz) = 2e7ac2aede84671b15597d9c56dbe077a81357bbf44b6684802592246fb7729b4a5743238ddf02f6ea143b4d29872f581408135f9c1ea1ccc99dab905916d98d
|
||||
SHA512 (gdb-16.3.tar.xz) = fffd6689c3405466a179670b04720dc825e4f210a761f63dd2b33027432f8cd5d1c059c431a5ec9e165eedd1901220b5329d73c522f9a444788888c731b29e9c
|
||||
|
Loading…
Reference in New Issue
Block a user