Compare commits

...

50 Commits
master ... f35

Author SHA1 Message Date
Kevin Buettner 59e24d72dd Rebase to FSF GDB 12.1.
Update gdb-6.6-buildid-locate.patch.
Update gdb-6.6-buildid-locate-rpm.patch.
Dropped backported patches from GDB 11.1 and 11.2.
2022-05-05 10:39:10 -07:00
Kevin Buettner 9320c99e53 Backport upstream patch for RHBZ 2068280. 2022-03-25 20:43:29 -07:00
Kevin Buettner 3d9ef83cc6 Rebase to FSF GDB 11.2. 2022-02-08 15:46:24 -07:00
Alexandra Hájková 3d4c9c3eff Backport upstream patch "[PR gdb/27026] CTRL-C is ignored
when debug info is downloaded" (RHBZ 2024875, Aaron Merey).
2022-01-05 22:45:54 +01:00
Alexandra Hájková 489f452205 Backport upstream patch "rework "set debuginfod" commands"
(RHBZ 2024875, Simon Marchi).
2022-01-05 22:30:43 +01:00
Alexandra Hájková 7ea06aaec3 Backport upstream patch "Fix unittest.exp failure
due to 'set debuginfod' addition" (RHBZ 2024875, Tom Tromey).
2022-01-05 19:03:07 +01:00
Alexandra Hájková 663b51c695 Backport upstream patch "gdb: add set/show commands for managing debuginfod"
(RHBZ 2024875, Aaron Merey).
2022-01-05 17:59:40 +01:00
Alexandra Hájková 679349bd6b Backport upstream patch "gdb.texinfo: Expand documentation for debuginfod
(RHBZ 2024875, Aaron Merey).
2022-01-05 17:12:08 +01:00
Kevin Buettner 344f82b5d1 Backport upstream fix and test case for a dprintf bug (RHBZ 2022177) 2021-11-11 08:50:19 -07:00
Bruno Larsen b2974415a4 Backport manpage updates to be inline with -help
Resolves: 853071
2021-11-09 13:42:40 -03:00
Kevin Buettner 712c760390 Make adjustments to gdb-6.6-buildid-locate.patch, provided by Tom de Vries. 2021-11-04 17:57:11 -07:00
Kevin Buettner 9cd9368e86 Rebase to FSF GDB 11.1.
Adjust build-id related patches.
Drop backported patches which are no longer relevant.
Bump 'snapgnulib' date.
Backport upstream patch which papers over Fortran lexical analyzer
bug (RHBZ 2012976, Tom de Vries).
2021-10-11 20:56:29 -07:00
Alexandra Hájková e625e4584d Backport test for RHBZ 1976887 (Kevin Buettner). 2021-09-29 11:20:53 +02:00
Alexandra Hájková 9617ab61dc Backport upstream patch which fixes internal-error: Unexpected
type field location kind (RHBZ 1976887, Alexandra Hájková).
2021-09-29 11:04:54 +02:00
Bruno Larsen 0805b268f7 Backport [gdb] Improve early exits for env var in debuginfod-support.c
(Tom de Vries)

Resolves: RHBZ 1970741
2021-09-23 15:19:02 -03:00
Bruno Larsen 091242b5dc Backport [gdb/cli] Don't assert on empty string for core-file
(Tom de Vries)

Resolves: RHBZ 1916516
2021-09-23 15:18:13 -03:00
Peter Robinson dedb76cf02 Use guile 2.2 (rhbz #1901353) 2021-09-21 23:07:18 +01:00
Michal Kolar 8e2afa6b29 drop unwanted scratch build rule for gating 2021-08-12 17:12:21 +00:00
Michal Kolar 96774cfcb2 init FMF CI gating 2021-08-12 17:12:21 +00:00
Fedora Release Engineering 8a5c84de70 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 23:54:12 +00:00
Kevin Buettner 0459b344e6 Remove autoconf invocations from spec file.
Remove BuildRequires: autoconf.
2021-07-20 21:57:59 -04:00
Kevin Buettner 71264766c5 Backport upstream patches which fix multi-threaded debugging for
glibc-2.34 (RHBZ 1971096, Simon Marchi, Kevin Buettner).
2021-06-14 23:24:14 -07:00
Kevin Buettner 8f22c5cbd3 Backport "Exclude debuginfo files from 'outside ELF segments' warning".
(Keith Seitz, RH BZ 1898252)
Backport "Fix crash when expanding partial symtab..."
  (Tom Tromey. gdb/27743)
Backport "[gdb/server] Don't overwrite fs/gs_base with -m32"
(Tom de Vries)
2021-06-14 14:51:25 -07:00
Python Maint 506c836503 Rebuilt for Python 3.10 2021-06-07 00:46:57 +02:00
Kevin Buettner ca26ddfa99 Rebase to FSF GDB 10.2.
Drop gdb-6.3-test-pie-20050107.patch.
Drop gdb-6.3-test-self-20050110.patch.
Drop gdb-6.5-bz218379-ppc-solib-trampoline-test.patch.
Drop gdb-6.6-buildid-locate-core-as-arg.patch.
Drop gdb-6.8-quit-never-aborts.patch.
Drop gdb-archer-pie-addons-keep-disabled.patch.
Drop gdb-archer-pie-addons.patch.
Drop gdb-archer-vla-tests.patch.
Drop gdb-archer.patch.
Drop gdb-attach-fail-reasons-5of5.patch.
Drop gdb-btrobust.patch.
Drop gdb-bz1219747-attach-kills.patch.
Drop gdb-bz533176-fortran-omp-step.patch.
Drop gdb-dts-rhel6-python-compat.patch.
Drop gdb-gnat-dwarf-crash-3of3.patch.
Drop gdb-jit-reader-multilib.patch.
Drop gdb-moribund-utrace-workaround.patch.
Drop gdb-rhbz1930528-fix-gnulib-build-error.patch.
Drop gdb-rhbz1932645-aarch64-ptrace-header-order.patch.
Drop gdb-vla-intel-fix-print-char-array.patch.
Drop gdb-vla-intel-fortran-strides.patch.
Drop gdb-vla-intel-stringbt-fix.patch.
Drop gdb-vla-intel-tests.patch.
Drop process_psymtab_comp_unit-type-unit.patch.
Drop gdb-testsuite-readline63-sigint-revert.patch.
Drop gdb-config.patch.
Add following upstream patches for Fortran stride / slice support:
  gdb-rhbz1964167-convert-enum-range_type.patch
  gdb-rhbz1964167-fortran-array-slices-at-prompt.patch
  gdb-rhbz1964167-fortran-array-strides-in-expressions.patch
  gdb-rhbz1964167-fortran-clean-up-array-expression-evaluation.patch
  gdb-rhbz1964167-fortran-range_type-to-range_flag.patch
  gdb-rhbz1964167-fortran-whitespace_array.patch
  gdb-rhbz1964167-move-fortran-expr-handling.patch
2021-06-06 14:54:47 -07:00
Python Maint 6b2d2db242 Bootstrap for Python 3.10 2021-06-01 16:30:44 +02:00
Keith Seitz 0a3a5ea5a6 Backport "Save/restore file offset while reading notes in core file"
(Keith Seitz, RHBZ 1931344)

Resolves: RHBZ 1931344
2021-03-31 14:49:14 -07:00
Jonathan Wakely 9a3fa11c4d Rebuilt for removed libstdc++ symbols (#1937698) 2021-03-31 17:31:59 +01:00
Keith Seitz 2f55d67d0a - Don't check for stgit unless needed w/generate-git-repo-from-patches.sh.
- Fix all patches wrt git diff --check.
- Update some tests (Tom de Vries)
- Fix ERRORs w/unsupported tests on native-gdbserver targets.
- Backport "Disable bracketed paste mode in GDB tests" (Tom Tromey)
- Backport "Handle DW_TAG_type_unit in process_symtab_unit" (Tom de Vries)
2021-03-26 11:40:18 -07:00
Kevin Buettner db92bd60db Remove spec file workaround for RHBZ 1912913. 2021-03-23 10:14:06 -07:00
Kevin Buettner f293e66ec1 Fix potential hang during gdbserver testing (RHBZ 1941080, Kevin Buettner). 2021-03-19 15:25:12 -07:00
Keith Seitz c7fa157806 Disable libctf on RHEL (RHBZ 1935517, Keith Seitz) 2021-03-18 15:12:01 -07:00
Kevin Buettner 5e056f9db9 Update libipt to version 2.0.4. 2021-03-11 10:15:26 -07:00
Kevin Buettner cd8eacd152 Backport patches which fix frame_id_p assertion failure (RHBZ 1909902,
Pedro Alves).
2021-03-05 18:18:40 -07:00
Jan Kratochvil 6c6f63f3a8 Drop gdb-vla-intel-fortran-vla-strings.patch as it was still regressing the
testsuite.
2021-03-05 13:04:56 +01:00
Jan Kratochvil 0ba7f47499 Fix gdb-vla-intel-fortran-vla-strings.patch to no longer modify cached
inferior types.
2021-03-04 20:45:01 +01:00
Jan Kratochvil de24db0eb7 Align gdb-vla-intel-fortran-vla-strings.patch more to upstream,
particularly whitespaces in Fortran types printing.
2021-03-04 20:43:11 +01:00
Jan Kratochvil 443e2a0c34 Reapply 10.1-8 after it has been accidentally reverted by 10.1-9. 2021-03-04 20:36:01 +01:00
Kevin Buettner f923d71406 Fix aarch64 build problem (RHBZ 1932645, Kevin Buettner). 2021-02-24 14:25:14 -07:00
Jan Kratochvil a1361a0b59 Fix gdb-vla-intel-fortran-vla-strings.patch for compatiblity with GraalVM. 2021-02-19 22:37:40 +01:00
Kevin Buettner 23564f9afb Fix gnulib related build problem (RHBZ 1930528, Kevin Buettner). 2021-02-18 23:16:16 -07:00
Kevin Buettner ce991fb7c0 Fix libstdc++ assert when performing tab completion; build must be made
with -D_GLIBCXX_DEBUG flag in order to trigger assert (RHBZ 1912985,
  Kevin Buettner).
2021-02-17 18:28:52 -07:00
Keith Seitz ff1b575a1d Disable Guile support for RHEL9+. 2021-02-11 12:21:44 -08:00
Stephen Gallagher 9cdc7613c9
Build gdb-minimal for ELN
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2021-01-26 10:57:06 -05:00
Fedora Release Engineering 048587f69b - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 06:27:43 +00:00
Kevin Buettner 0d98e10811 Add -Wno-stringop-overread to CFLAGS to work around gcc
bug (RH BZ 1912913)
2021-01-23 00:31:03 -05:00
Keith Seitz 04fc1c001a Disable xxhash support for RHEL. 2021-01-12 13:38:24 -08:00
Tom Stellard 4f6865e66b Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-05 00:50:30 +00:00
Kevin Buettner 61d59b7323 Fix off-by-one error in ada_fold_name. (RHBZ 1905996, Kevin Buettner) 2020-12-09 16:25:05 -07:00
Kevin Buettner a8884a5be0 Bump release number to avoid lower NVR (for rawhide) than that of F33.
(RHBZ 1894912)
2020-12-07 16:03:37 -07:00
96 changed files with 909 additions and 12000 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

6
.gitignore vendored
View File

@ -1,4 +1,4 @@
/binutils-gdb
/new-fedora-release
/gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz
/v2.0.2.tar.gz
/gdb-10.1.tar.xz
/v2.0.4.tar.gz
/gdb-12.1.tar.xz

View File

@ -2,361 +2,300 @@
#=fedora
Patch001: gdb-6.3-rh-testversion-20041202.patch
# VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests.
#=push
Patch002: gdb-vla-intel-fortran-strides.patch
#=push
Patch003: gdb-vla-intel-fortran-vla-strings.patch
#=push+jan
Patch004: gdb-vla-intel-stringbt-fix.patch
# Add a wrapper script to GDB that implements pstack using the
# --readnever option.
#=push
Patch005: gdb-6.3-gstack-20050411.patch
# VSYSCALL and PIE
#=fedoratest
Patch006: gdb-6.3-test-pie-20050107.patch
# Get selftest working with sep-debug-info
#=fedoratest
Patch007: gdb-6.3-test-self-20050110.patch
Patch002: gdb-6.3-gstack-20050411.patch
# Test support of multiple destructors just like multiple constructors
#=fedoratest
Patch008: gdb-6.3-test-dtorfix-20050121.patch
Patch003: gdb-6.3-test-dtorfix-20050121.patch
# Fix to support executable moving
#=fedoratest
Patch009: gdb-6.3-test-movedir-20050125.patch
Patch004: gdb-6.3-test-movedir-20050125.patch
# Test sibling threads to set threaded watchpoints for x86 and x86-64
#=fedoratest
Patch010: gdb-6.3-threaded-watchpoints2-20050225.patch
Patch005: gdb-6.3-threaded-watchpoints2-20050225.patch
# Notify observers that the inferior has been created
#=fedoratest
Patch006: gdb-6.3-inferior-notification-20050721.patch
# Verify printing of inherited members test
#=fedoratest
Patch012: gdb-6.3-inheritancetest-20050726.patch
Patch007: gdb-6.3-inheritancetest-20050726.patch
# Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
#=push+jan: It should be replaced by Infinity project.
Patch013: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
Patch008: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
# Fix TLS symbols resolving for shared libraries with a relative pathname.
# The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
#=fedoratest: One should recheck if it is really fixed upstream.
Patch014: gdb-6.5-sharedlibrary-path.patch
Patch009: gdb-6.5-sharedlibrary-path.patch
# Improved testsuite results by the testsuite provided by the courtesy of BEA.
#=fedoratest: For upstream it should be rewritten as a dejagnu test, the test of no "??" was useful.
Patch015: gdb-6.5-BEA-testsuite.patch
Patch010: gdb-6.5-BEA-testsuite.patch
# Testcase for deadlocking on last address space byte; for corrupted backtraces.
#=fedoratest
Patch016: gdb-6.5-last-address-space-byte-test.patch
Patch011: gdb-6.5-last-address-space-byte-test.patch
# Fix readline segfault on excessively long hand-typed lines.
#=fedoratest
Patch017: gdb-6.5-readline-long-line-crash-test.patch
Patch012: gdb-6.5-readline-long-line-crash-test.patch
# Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
#=fedoratest
Patch018: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
# Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
#=fedora
Patch019: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
Patch013: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
# Find symbols properly at their original (included) file (BZ 109921).
#=fedoratest
Patch020: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
Patch014: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
# Update PPC unwinding patches to their upstream variants (BZ 140532).
#=fedoratest
Patch021: gdb-6.3-bz140532-ppc-unwinding-test.patch
Patch015: gdb-6.3-bz140532-ppc-unwinding-test.patch
# Testcase for exec() from threaded program (BZ 202689).
#=fedoratest
Patch022: gdb-6.3-bz202689-exec-from-pthread-test.patch
Patch016: gdb-6.3-bz202689-exec-from-pthread-test.patch
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
#=fedoratest
Patch023: gdb-6.6-bz230000-power6-disassembly-test.patch
Patch017: gdb-6.6-bz230000-power6-disassembly-test.patch
# Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
#=fedoratest
Patch024: gdb-6.6-bz229517-gcore-without-terminal.patch
Patch018: gdb-6.6-bz229517-gcore-without-terminal.patch
# Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
#=fedoratest
Patch025: gdb-6.6-testsuite-timeouts.patch
Patch019: gdb-6.6-testsuite-timeouts.patch
# Support for stepping over PPC atomic instruction sequences (BZ 237572).
#=fedoratest
Patch026: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
Patch020: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
# Test kernel VDSO decoding while attaching to an i386 process.
#=fedoratest
Patch021: gdb-6.3-attach-see-vdso-test.patch
# Test leftover zombie process (BZ 243845).
#=fedoratest
Patch028: gdb-6.5-bz243845-stale-testing-zombie-test.patch
Patch022: gdb-6.5-bz243845-stale-testing-zombie-test.patch
# New locating of the matching binaries from the pure core file (build-id).
#=push+jan
Patch029: gdb-6.6-buildid-locate.patch
Patch023: 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
Patch030: gdb-6.6-buildid-locate-solib-missing-ids.patch
Patch024: gdb-6.6-buildid-locate-solib-missing-ids.patch
#=push+jan
Patch031: gdb-6.6-buildid-locate-rpm.patch
Patch025: gdb-6.6-buildid-locate-rpm.patch
# Fix displaying of numeric char arrays as strings (BZ 224128).
#=fedoratest: But it is failing anyway, one should check the behavior more.
Patch032: gdb-6.7-charsign-test.patch
Patch026: gdb-6.7-charsign-test.patch
# Test PPC hiding of call-volatile parameter register.
#=fedoratest
Patch033: gdb-6.7-ppc-clobbered-registers-O2-test.patch
Patch027: gdb-6.7-ppc-clobbered-registers-O2-test.patch
# Testsuite fixes for more stable/comparable results.
#=fedoratest
Patch034: gdb-6.7-testsuite-stable-results.patch
Patch028: gdb-6.7-testsuite-stable-results.patch
# Test ia64 memory leaks of the code using libunwind.
#=fedoratest
Patch035: gdb-6.5-ia64-libunwind-leak-test.patch
Patch029: gdb-6.5-ia64-libunwind-leak-test.patch
# Test hiding unexpected breakpoints on intentional step commands.
#=fedoratest
Patch036: gdb-6.5-missed-trap-on-step-test.patch
Patch030: gdb-6.5-missed-trap-on-step-test.patch
# Test gcore memory and time requirements for large inferiors.
#=fedoratest
Patch031: 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.
Patch038: gdb-6.3-mapping-zero-inode-test.patch
Patch032: gdb-6.3-mapping-zero-inode-test.patch
# Test a crash on `focus cmd', `focus prev' commands.
#=fedoratest
Patch039: gdb-6.3-focus-cmd-prev-test.patch
Patch033: gdb-6.3-focus-cmd-prev-test.patch
# Test various forms of threads tracking across exec() (BZ 442765).
#=fedoratest
Patch040: gdb-6.8-bz442765-threaded-exec-test.patch
Patch034: gdb-6.8-bz442765-threaded-exec-test.patch
# Test a crash on libraries missing the .text section.
#=fedoratest
Patch041: gdb-6.5-section-num-fixup-test.patch
Patch035: gdb-6.5-section-num-fixup-test.patch
# Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
#=fedoratest
Patch042: gdb-6.8-bz466901-backtrace-full-prelinked.patch
Patch036: gdb-6.8-bz466901-backtrace-full-prelinked.patch
# New test for step-resume breakpoint placed in multiple threads at once.
#=fedoratest
Patch043: gdb-simultaneous-step-resume-breakpoint-test.patch
Patch037: 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@.*>
Patch044: gdb-core-open-vdso-warning.patch
# Fix stepping with OMP parallel Fortran sections (BZ 533176).
#=push+jan: It requires some better DWARF annotations.
Patch045: gdb-bz533176-fortran-omp-step.patch
Patch038: gdb-core-open-vdso-warning.patch
# Workaround ccache making lineno non-zero for command-line definitions.
#=fedoratest: ccache is rarely used and it is even fixed now.
Patch046: gdb-ccache-workaround.patch
#=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
Patch047: gdb-archer-pie-addons.patch
#=push+jan: Breakpoints disabling matching should not be based on address.
Patch048: gdb-archer-pie-addons-keep-disabled.patch
Patch039: gdb-ccache-workaround.patch
# Testcase for "Do not make up line information" fix by Daniel Jacobowitz.
#=fedoratest
Patch049: gdb-lineno-makeup-test.patch
Patch040: gdb-lineno-makeup-test.patch
# Test power7 ppc disassembly.
#=fedoratest
Patch050: gdb-ppc-power7-test.patch
# Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623).
#=push+jan: Currently it is still not fully safe.
Patch051: gdb-moribund-utrace-workaround.patch
Patch041: gdb-ppc-power7-test.patch
# Fix follow-exec for C++ programs (bugreported by Martin Stransky).
#=fedoratest
Patch052: gdb-archer-next-over-throw-cxx-exec.patch
Patch042: gdb-archer-next-over-throw-cxx-exec.patch
# Backport DWARF-4 support (BZ 601887, Tom Tromey).
#=fedoratest
Patch053: gdb-bz601887-dwarf4-rh-test.patch
#=push+jan
Patch054: gdb-6.6-buildid-locate-core-as-arg.patch
Patch043: gdb-bz601887-dwarf4-rh-test.patch
# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
#=push+jan
Patch055: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
Patch044: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
# [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604).
#=fedoratest
Patch056: gdb-test-bt-cfi-without-die.patch
Patch045: gdb-test-bt-cfi-without-die.patch
# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
#=fedoratest
Patch057: gdb-bz634108-solib_address.patch
Patch046: gdb-bz634108-solib_address.patch
# New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435).
#=fedoratest
Patch058: gdb-test-pid0-core.patch
Patch047: gdb-test-pid0-core.patch
# [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp.
#=fedoratest
Patch059: gdb-test-dw2-aranges.patch
Patch048: gdb-test-dw2-aranges.patch
# [archer-keiths-expr-cumulative+upstream] Import C++ testcases.
#=fedoratest
Patch060: gdb-test-expr-cumulative-archer.patch
Patch049: gdb-test-expr-cumulative-archer.patch
# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
#=fedoratest
Patch061: gdb-physname-pr11734-test.patch
Patch050: gdb-physname-pr11734-test.patch
# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
#=fedoratest
Patch062: gdb-physname-pr12273-test.patch
Patch051: gdb-physname-pr12273-test.patch
# Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890).
#=fedoratest
Patch063: gdb-test-ivy-bridge.patch
Patch052: gdb-test-ivy-bridge.patch
# Hack for proper PIE run of the testsuite.
#=fedoratest
Patch064: gdb-runtest-pie-override.patch
# Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878).
#=push+jan
Patch065: gdb-attach-fail-reasons-5of5.patch
Patch053: gdb-runtest-pie-override.patch
# Workaround PR libc/14166 for inferior calls of strstr.
#=fedoratest: Compatibility with RHELs (unchecked which ones).
Patch066: gdb-glibc-strstr-workaround.patch
Patch054: gdb-glibc-strstr-workaround.patch
# Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789).
#=fedoratest
Patch067: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
Patch055: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
# Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343).
#=fedoratest
Patch068: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
Patch056: 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
Patch069: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
# Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211).
#=push+jan
Patch070: gdb-gnat-dwarf-crash-3of3.patch
Patch057: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
#=fedoratest
Patch071: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
Patch058: 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
Patch072: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
#=fedoratest
Patch073: gdb-archer-vla-tests.patch
#=fedoratest
Patch074: gdb-vla-intel-tests.patch
# Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
#=push
Patch075: gdb-btrobust.patch
Patch059: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
# Display Fortran strings in backtraces.
#=fedoratest
Patch076: gdb-fortran-frame-string.patch
Patch060: gdb-fortran-frame-string.patch
# Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to
# crash.' (RH BZ 1156192).
#=fedoratest
Patch077: gdb-rhbz1156192-recursive-dlopen-test.patch
# Fix jit-reader.h for multi-lib.
#=push+jan
Patch078: gdb-jit-reader-multilib.patch
Patch061: gdb-rhbz1156192-recursive-dlopen-test.patch
# Fix '`catch syscall' doesn't work for parent after `fork' is called'
# (Philippe Waroquiers, RH BZ 1149205).
#=fedoratest
Patch079: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
Patch062: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
# Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug
# description: 'C++ (and objc): Internal error on unqualified name
# re-set', PR 11657] (RH BZ 1186476).
#=fedoratest
Patch080: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
Patch063: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
# Test 'info type-printers' Python error (RH BZ 1350436).
#=fedoratest
Patch081: gdb-rhbz1350436-type-printers-error.patch
Patch064: gdb-rhbz1350436-type-printers-error.patch
# Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan
# Kratochvil, RH BZ 1084404).
#=fedoratest
Patch082: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
# Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747).
#=push+jan
Patch083: gdb-bz1219747-attach-kills.patch
Patch065: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
# Force libncursesw over libncurses to match the includes (RH BZ 1270534).
#=push+jan
Patch084: gdb-fedora-libncursesw.patch
Patch066: gdb-fedora-libncursesw.patch
# Test clflushopt instruction decode (for RH BZ 1262471).
#=fedoratest
Patch085: gdb-opcodes-clflushopt-test.patch
# [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon).
#=fedora
Patch086: gdb-dts-rhel6-python-compat.patch
Patch067: gdb-opcodes-clflushopt-test.patch
# [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
#=push+jan
Patch087: gdb-6.6-buildid-locate-rpm-scl.patch
# Make the GDB quit processing non-abortable to cleanup everything properly.
#=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch .
Patch088: gdb-6.8-quit-never-aborts.patch
Patch068: gdb-6.6-buildid-locate-rpm-scl.patch
# [aarch64] Fix hardware watchpoints (RH BZ 1261564).
#=fedoratest
Patch089: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
Patch069: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
# Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
#=fedora
Patch090: gdb-container-rh-pkg.patch
Patch070: gdb-container-rh-pkg.patch
# New test for Python "Cannot locate object file for block" (for RH BZ 1325795).
#=fedoratest
Patch091: gdb-rhbz1325795-framefilters-test.patch
Patch071: gdb-rhbz1325795-framefilters-test.patch
# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
#=fedora
Patch092: gdb-linux_perf-bundle.patch
Patch072: gdb-linux_perf-bundle.patch
# Fix gdb-headless /usr/bin/ executables (BZ 1390251).
#
@ -365,20 +304,13 @@ Patch092: gdb-linux_perf-bundle.patch
#
# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
#=fedora
Patch093: gdb-libexec-add-index.patch
Patch073: gdb-libexec-add-index.patch
# New testcase for: Fix <tab>-completion crash (Gary Benson, RH BZ 1398387).
#=fedoratest
Patch094: gdb-rhbz1398387-tab-crash-test.patch
# Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher
#=push
Patch095: gdb-archer.patch
# Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd
Patch096: gdb-vla-intel-fix-print-char-array.patch
Patch074: gdb-rhbz1398387-tab-crash-test.patch
# [s390x] Backport arch12 instructions decoding (RH BZ 1553104).
# =fedoratest
Patch097: gdb-rhbz1553104-s390x-arch12-test.patch
Patch075: gdb-rhbz1553104-s390x-arch12-test.patch

View File

@ -8,6 +8,7 @@
%patch008 -p1
%patch009 -p1
%patch010 -p1
%patch011 -p1
%patch012 -p1
%patch013 -p1
%patch014 -p1
@ -23,6 +24,7 @@
%patch024 -p1
%patch025 -p1
%patch026 -p1
%patch027 -p1
%patch028 -p1
%patch029 -p1
%patch030 -p1
@ -32,6 +34,7 @@
%patch034 -p1
%patch035 -p1
%patch036 -p1
%patch037 -p1
%patch038 -p1
%patch039 -p1
%patch040 -p1
@ -70,25 +73,3 @@
%patch073 -p1
%patch074 -p1
%patch075 -p1
%patch076 -p1
%patch077 -p1
%patch078 -p1
%patch079 -p1
%patch080 -p1
%patch081 -p1
%patch082 -p1
%patch083 -p1
%patch084 -p1
%patch085 -p1
%patch086 -p1
%patch087 -p1
%patch088 -p1
%patch089 -p1
%patch090 -p1
%patch091 -p1
%patch092 -p1
%patch093 -p1
%patch094 -p1
%patch095 -p1
%patch096 -p1
%patch097 -p1

View File

@ -1 +1 @@
606e3fd147ed9a00df165e46f30fe5c46dcda345
e53a8e8685685c97588f8319d993ea6cd5635e47

View File

@ -1,10 +1,5 @@
gdb-6.3-rh-testversion-20041202.patch
gdb-vla-intel-fortran-strides.patch
gdb-vla-intel-fortran-vla-strings.patch
gdb-vla-intel-stringbt-fix.patch
gdb-6.3-gstack-20050411.patch
gdb-6.3-test-pie-20050107.patch
gdb-6.3-test-self-20050110.patch
gdb-6.3-test-dtorfix-20050121.patch
gdb-6.3-test-movedir-20050125.patch
gdb-6.3-threaded-watchpoints2-20050225.patch
@ -16,7 +11,6 @@ gdb-6.5-BEA-testsuite.patch
gdb-6.5-last-address-space-byte-test.patch
gdb-6.5-readline-long-line-crash-test.patch
gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
gdb-6.5-bz109921-DW_AT_decl_file-test.patch
gdb-6.3-bz140532-ppc-unwinding-test.patch
gdb-6.3-bz202689-exec-from-pthread-test.patch
@ -42,16 +36,11 @@ 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-bz533176-fortran-omp-step.patch
gdb-ccache-workaround.patch
gdb-archer-pie-addons.patch
gdb-archer-pie-addons-keep-disabled.patch
gdb-lineno-makeup-test.patch
gdb-ppc-power7-test.patch
gdb-moribund-utrace-workaround.patch
gdb-archer-next-over-throw-cxx-exec.patch
gdb-bz601887-dwarf4-rh-test.patch
gdb-6.6-buildid-locate-core-as-arg.patch
gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
gdb-test-bt-cfi-without-die.patch
gdb-bz634108-solib_address.patch
@ -62,36 +51,25 @@ gdb-physname-pr11734-test.patch
gdb-physname-pr12273-test.patch
gdb-test-ivy-bridge.patch
gdb-runtest-pie-override.patch
gdb-attach-fail-reasons-5of5.patch
gdb-glibc-strstr-workaround.patch
gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
gdb-gnat-dwarf-crash-3of3.patch
gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
gdb-archer-vla-tests.patch
gdb-vla-intel-tests.patch
gdb-btrobust.patch
gdb-fortran-frame-string.patch
gdb-rhbz1156192-recursive-dlopen-test.patch
gdb-jit-reader-multilib.patch
gdb-rhbz1149205-catch-syscall-after-fork-test.patch
gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
gdb-rhbz1350436-type-printers-error.patch
gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
gdb-bz1219747-attach-kills.patch
gdb-fedora-libncursesw.patch
gdb-opcodes-clflushopt-test.patch
gdb-dts-rhel6-python-compat.patch
gdb-6.6-buildid-locate-rpm-scl.patch
gdb-6.8-quit-never-aborts.patch
gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
gdb-container-rh-pkg.patch
gdb-rhbz1325795-framefilters-test.patch
gdb-linux_perf-bundle.patch
gdb-libexec-add-index.patch
gdb-rhbz1398387-tab-crash-test.patch
gdb-archer.patch
gdb-vla-intel-fix-print-char-array.patch
gdb-rhbz1553104-s390x-arch12-test.patch

19
gating.yaml Normal file
View File

@ -0,0 +1,19 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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. */
@ -40,19 +40,19 @@ diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp
@@ -0,0 +1,72 @@
@@ -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.
@ -64,6 +64,11 @@ new file mode 100644
+ 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}]
@ -104,12 +109,12 @@ new file mode 100644
+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}"

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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. */
@ -107,7 +107,7 @@ new file mode 100644
+ 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. */
@ -210,7 +210,7 @@ new file mode 100644
+ 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. */
@ -237,15 +237,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test unwinding fixes of the PPC platform, specifically on the coping with BCL
+# jump of the PIE code.

View File

@ -73,15 +73,15 @@ new file mode 100644
+# 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. */
+# 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

View File

@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1726,7 +1726,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
@@ -1767,7 +1767,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \
@@ -1775,7 +1775,25 @@ install-guile:
@@ -1816,7 +1816,25 @@ install-guile:
install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
@ -52,8 +52,8 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
@@ -1798,6 +1816,18 @@ uninstall: force $(CONFIG_UNINSTALL)
fi
@@ -1847,6 +1865,18 @@ uninstall: force $(CONFIG_UNINSTALL)
rm -f $(DESTDIR)$(bindir)/$$transformed_name
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
+.PHONY: uninstall-gstack
@ -67,7 +67,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+ 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
@ -109,7 +109,7 @@ new file mode 100644
+
+# 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 |
+$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 |
+set width 0
+set height 0
+set pagination no
@ -153,7 +153,7 @@ new file mode 100644
+ /* Use the most simple notification not to get caught by attach on exiting
+ the function. */
+ write (1, msg, strlen (msg));
+
+
+ for (;;);
+}
+

View File

@ -46,19 +46,19 @@ diff --git a/gdb/testsuite/gdb.base/attach-32.exp b/gdb/testsuite/gdb.base/attac
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-32.exp
@@ -0,0 +1,245 @@
@@ -0,0 +1,246 @@
+# Copyright 2005 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.
@ -72,14 +72,15 @@ new file mode 100644
+#
+# Setting the magic bit in the target app should work. I added a
+# "kill", and also a test for the R3 register warning. JB
+if { ![istarget "x86_64*-*linux*"]
+if { ![istarget "x86_64*-*linux*"]
+ && ![istarget "powerpc64*-*linux*"]} {
+ return 0
+}
+
+# are we on a target board
+if [is_remote target] then {
+ return 0
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile "attach-32"
@ -121,10 +122,10 @@ new file mode 100644
+ global subdir
+ global timeout
+ global testpid
+
+
+ # Verify that we can "see" the variable "should_exit" in the
+ # program, and that it is zero.
+
+
+ gdb_test "print should_exit" " = 0" "after attach-32, print should_exit"
+
+ # Verify that we can modify the variable "should_exit" in the
@ -167,12 +168,12 @@ new file mode 100644
+ # 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}"
+
+ # Start the program running and then wait for a bit, to be sure
+ # that it can be attached to.
+
+
+ set testpid [eval exec $binfile &]
+ exec sleep 2
+ if { [istarget "*-*-cygwin*"] } {
@ -184,7 +185,7 @@ new file mode 100644
+ # Verify that we can attach to the process, and find its a.out
+ # when we're cd'd to some directory that doesn't contain the
+ # a.out. (We use the source path set by the "dir" command.)
+
+
+ gdb_test "dir ${objdir}/${subdir}" "Source directories searched: .*" \
+ "set source path"
+
@ -217,7 +218,7 @@ new file mode 100644
+ gdb_test "y" "" "$test"
+ }
+ }
+
+
+ # Another "don't leave a process around"
+ remote_exec build "kill -9 ${testpid}"
+}
@ -226,9 +227,9 @@ new file mode 100644
+ global gdb_prompt
+ global binfile2
+ global testpid
+
+
+ # See if other registers are problems
+
+
+ set test "info other register"
+ gdb_test_multiple "i r r3" "$test" {
+ -re "warning: reading register.*$gdb_prompt $" {
@ -240,12 +241,12 @@ new file mode 100644
+ }
+
+ # Get rid of the process
+
+
+ gdb_test "p should_exit = 1"
+ gdb_test "c" {\[Inferior .* exited normally\]}
+
+
+ # Be paranoid
+
+
+ remote_exec build "kill -9 ${testpid}"
+}
+

View File

@ -17,7 +17,7 @@ diff --git a/gdb/testsuite/gdb.cp/b146835.cc b/gdb/testsuite/gdb.cp/b146835.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/b146835.cc
@@ -0,0 +1,32 @@
@@ -0,0 +1,31 @@
+#include "b146835.h"
+#include <iostream>
+
@ -49,7 +49,6 @@ new file mode 100644
+ F f;
+ f.foo();
+}
+
diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp
new file mode 100644
--- /dev/null
@ -71,7 +70,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Check that GDB can properly print an inherited member variable
+# (Bugzilla 146835)

View File

@ -150,15 +150,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test GDB's handling of gcore for mapping with a name but zero inode.
+

View File

@ -27,7 +27,7 @@ diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest
diff --git a/gdb/top.c b/gdb/top.c
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2163,7 +2163,7 @@ init_gdb_version_vars (void)
@@ -2234,7 +2234,7 @@ init_gdb_version_vars (void)
struct internalvar *major_version_var = create_internalvar ("_gdb_major");
struct internalvar *minor_version_var = create_internalvar ("_gdb_minor");
int vmajor = 0, vminor = 0, vrevision = 0;

View File

@ -131,7 +131,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Check that GDB can break at multiple forms of constructors.
+
@ -160,7 +160,7 @@ new file mode 100644
+# Break on the various forms of the A::A constructor.
+# " (2 locations)" is displayed depending on G++ version.
+gdb_test "break A\:\:A" "Breakpoint 2 at .*" "breaking on A::A"
+
+
+# Verify that we break for the A constructor two times
+# Once for new A and once for new B
+gdb_continue_to_breakpoint "First line A"

View File

@ -16,7 +16,7 @@ diff --git a/gdb/testsuite/gdb.base/move-dir.c b/gdb/testsuite/gdb.base/move-dir
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/move-dir.c
@@ -0,0 +1,10 @@
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "move-dir.h"
@ -26,7 +26,6 @@ new file mode 100644
+ printf ("%s\n", hw);;
+ other();
+}
+
diff --git a/gdb/testsuite/gdb.base/move-dir.exp b/gdb/testsuite/gdb.base/move-dir.exp
new file mode 100644
--- /dev/null
@ -39,15 +38,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile "move-dir"
+set srcfile ${testfile}.c
@ -93,11 +92,10 @@ diff --git a/gdb/testsuite/gdb.base/move-dir.h b/gdb/testsuite/gdb.base/move-dir
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/move-dir.h
@@ -0,0 +1,7 @@
@@ -0,0 +1,6 @@
+#include <stdlib.h>
+
+void other() {
+ const char* ostring = "other";
+ printf ("%s\n", ostring);;
+}
+

File diff suppressed because it is too large Load Diff

View File

@ -1,42 +0,0 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Elena Zannoni <ezannoni@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-test-self-20050110.patch
;; Get selftest working with sep-debug-info
;;=fedoratest
2004-02-23 Elena Zannoni <ezannoni@redhat.com>
* gdb.gdb/selftest.exp: Make sure that the debug directory is
set up properly.
* gdb.gdb/complaints.exp: Ditto.
* gdb.gdb/xfullpath.exp: Ditto.
* gdb.gdb/observer.exp: Ditto.
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
@@ -152,18 +152,18 @@ proc do_self_tests {function body} {
}
# Remove any old copy lying around.
- remote_file host delete $xgdb
+ #remote_file host delete $xgdb
gdb_start
- set file [remote_download host $GDB_FULLPATH $xgdb]
+ #set file [remote_download host $GDB_FULLPATH $xgdb]
- set result [selftest_setup $file $function]
+ set result [selftest_setup $GDB_FULLPATH $function]
if {$result == 0} then {
set result [uplevel $body]
}
gdb_exit
- catch "remote_file host delete $file"
+ #catch "remote_file host delete $file"
if {$result < 0} then {
warning "Couldn't test self"

View File

@ -54,7 +54,7 @@ diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.c b/gdb/testsuite/g
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.c
@@ -0,0 +1,66 @@
@@ -0,0 +1,65 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
@ -72,8 +72,8 @@ new file mode 100644
+ 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.
+
+ Boston, MA 02111-1307, USA.
+
+ This file is copied from schedlock.c. */
+
+#include <stdio.h>
@ -120,7 +120,6 @@ new file mode 100644
+
+ pthread_exit(NULL);
+}
+
diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
new file mode 100644
--- /dev/null
@ -142,7 +141,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Check that GDB can support multiple watchpoints across threads.
+
@ -213,9 +212,9 @@ new file mode 100644
+ { set args_2 1; set test_flag 1 }
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $"
+ { set args_3 1; set test_flag 1 }
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*in thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
+ { set args_2 [expr $args_2+1]; set test_flag 1 }
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*in thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
+ { set args_3 [expr $args_3+1]; set test_flag 1 }
+ }
+ # If we fail above, don't bother continuing loop
@ -232,7 +231,7 @@ new file mode 100644
+# Verify that we hit first watchpoint in child thread.
+set message "watchpoint on args\[2\] hit in thread"
+if { $args_2 > 1 } {
+ pass $message
+ pass $message
+} else {
+ fail $message
+}
@ -240,15 +239,15 @@ new file mode 100644
+# Verify that we hit second watchpoint in child thread.
+set message "watchpoint on args\[3\] hit in thread"
+if { $args_3 > 1 } {
+ pass $message
+ pass $message
+} else {
+ fail $message
+ fail $message
+}
+
+# Verify that all watchpoint hits are accounted for.
+set message "combination of threaded watchpoints = 30 + initial values"
+if { [expr $args_2+$args_3] == [expr [expr 30+$init_args_2]+$init_args_3] } {
+ pass $message
+ pass $message
+} else {
+ fail $message
+ fail $message
+}

View File

@ -30,14 +30,14 @@ new file mode 100644
+ * gdb. Inside gdb, you should be able to do something like this:
+ *
+ * (gdb) t a a bt
+ *
+ *
+ * Thread 7 (process 4352):
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
+ * #2 0x080488a2 in makeSyscall (ignored=0x0) at threadcrash.c:118
+ * #3 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #4 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 6 (process 4353):
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
@ -48,7 +48,7 @@ new file mode 100644
+ * #5 0x08048a51 in makeSyscallFromSighandler (ignored=0x0) at threadcrash.c:204
+ * #6 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #7 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 5 (process 4354):
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
@ -59,12 +59,12 @@ new file mode 100644
+ * #5 0x080489e2 in makeSyscallFromAltSighandler (ignored=0x0) at threadcrash.c:190
+ * #6 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #7 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 4 (process 4355):
+ * #0 spin (ignored=0x0) at threadcrash.c:242
+ * #1 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #2 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 3 (process 4356):
+ * #0 spinningSighandler (signo=12, info=0xb4de46f0, context=0xb4de4770) at threadcrash.c:180
+ * #1 <signal handler called>
@ -72,7 +72,7 @@ new file mode 100644
+ * #3 0x08048b2f in spinFromSighandler (ignored=0x0) at threadcrash.c:232
+ * #4 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #5 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 2 (process 4357):
+ * #0 spinningAltSighandler (signo=14, info=0x959ee50, context=0x959eed0) at threadcrash.c:156
+ * #1 <signal handler called>
@ -80,7 +80,7 @@ new file mode 100644
+ * #3 0x08048ac0 in spinFromAltSighandler (ignored=0x0) at threadcrash.c:218
+ * #4 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #5 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 1 (process 4351):
+ * #0 0x08048cf3 in main (argc=1, argv=0xbfff9d74) at threadcrash.c:273
+ * (gdb)
@ -107,11 +107,11 @@ new file mode 100644
+ int result;
+ stack_t altstack;
+ stack_t oldaltstack;
+
+
+ memset(&action, 0, sizeof(action));
+ memset(&altstack, 0, sizeof(altstack));
+ memset(&oldaltstack, 0, sizeof(oldaltstack));
+
+
+ if (onAltstack) {
+ altstack.ss_sp = malloc(SIGSTKSZ);
+ assert(altstack.ss_sp != NULL);
@ -121,9 +121,9 @@ new file mode 100644
+ assert(result == 0);
+ assert(oldaltstack.ss_flags == SS_DISABLE);
+ }
+
+
+ sigemptyset(&sigset);
+
+
+ action.sa_handler = NULL;
+ action.sa_sigaction = handler;
+ action.sa_mask = sigset;
@ -131,7 +131,7 @@ new file mode 100644
+ if (onAltstack) {
+ action.sa_flags |= SA_ONSTACK;
+ }
+
+
+ result = sigaction(signo, &action, NULL);
+ assert(result == 0);
+}
@ -157,10 +157,10 @@ new file mode 100644
+static int onAltstack(void) {
+ stack_t stack;
+ int result;
+
+
+ result = sigaltstack(NULL, &stack);
+ assert(result == 0);
+
+
+ return stack.ss_flags & SS_ONSTACK;
+}
+
@ -168,11 +168,11 @@ new file mode 100644
+ (void)signo;
+ (void)info;
+ (void)context;
+
+
+ if (!onAltstack()) {
+ printf("%s() not running on altstack!\n", __FUNCTION__);
+ }
+
+
+ sleep(42);
+}
+
@ -180,11 +180,11 @@ new file mode 100644
+ (void)signo;
+ (void)info;
+ (void)context;
+
+
+ if (!onAltstack()) {
+ printf("%s() not running on altstack!\n", __FUNCTION__);
+ }
+
+
+ while (1);
+}
+
@ -192,11 +192,11 @@ new file mode 100644
+ (void)signo;
+ (void)info;
+ (void)context;
+
+
+ if (onAltstack()) {
+ printf("%s() running on altstack!\n", __FUNCTION__);
+ }
+
+
+ sleep(42);
+}
+
@ -204,73 +204,73 @@ new file mode 100644
+ (void)signo;
+ (void)info;
+ (void)context;
+
+
+ if (onAltstack()) {
+ printf("%s() running on altstack!\n", __FUNCTION__);
+ }
+
+
+ while (1);
+}
+
+static void *makeSyscallFromAltSighandler(void *ignored) {
+ (void)ignored;
+
+
+ int result;
+
+
+ installAlthandler(SIGSYSCALL_ALT, syscallingAltSighandler);
+
+
+ result = pthread_kill(pthread_self(), SIGSYSCALL_ALT);
+ assert(result == 0);
+
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
+ return NULL;
+}
+
+static void *makeSyscallFromSighandler(void *ignored) {
+ (void)ignored;
+
+
+ int result;
+
+
+ installNormalHandler(SIGSYSCALL, syscallingSighandler);
+
+
+ result = pthread_kill(pthread_self(), SIGSYSCALL);
+ assert(result == 0);
+
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
+ return NULL;
+}
+
+static void *spinFromAltSighandler(void *ignored) {
+ (void)ignored;
+
+
+ int result;
+
+
+ installAlthandler(SIGSPIN_ALT, spinningAltSighandler);
+
+
+ result = pthread_kill(pthread_self(), SIGSPIN_ALT);
+ assert(result == 0);
+
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
+ return NULL;
+}
+
+static void *spinFromSighandler(void *ignored) {
+ (void)ignored;
+
+
+ int result;
+
+
+ installNormalHandler(SIGSPIN, spinningSighandler);
+
+
+ result = pthread_kill(pthread_self(), SIGSPIN);
+ assert(result == 0);
+
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
+ return NULL;
+}
+
+static void *spin(void *ignored) {
+ (void)ignored;
+
+
+ while (1);
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
@ -281,7 +281,7 @@ new file mode 100644
+ int result;
+ pthread_t thread;
+ volatile int bad;
+
+
+ result = pthread_create(&thread, NULL, makeSyscall, NULL);
+ assert(result == 0);
+ result = pthread_create(&thread, NULL, makeSyscallFromSighandler, NULL);
@ -294,10 +294,10 @@ new file mode 100644
+ assert(result == 0);
+ result = pthread_create(&thread, NULL, spinFromAltSighandler, NULL);
+ assert(result == 0);
+
+
+ // Give threads some time to get going
+ sleep(3);
+
+
+ // Crash
+ bad = *(int*)7;
+
@ -309,7 +309,7 @@ new file mode 100644
+ Keep it late to ensure persistency in the registers. */
+ bad = (int) argc;
+ bad = (unsigned long) argv;
+
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
@ -480,27 +480,27 @@ new file mode 100644
+# Verify that $LOG contains all information we want
+function verifyLog() {
+ local FAILURES=0
+
+
+ mustNotHave '??' || ((FAILURES++))
+ mustHaveCorrectAmount 11 threadcrash.c: || ((FAILURES++))
+
+
+ mustHaveSevenThreads || ((FAILURES++))
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
+
+ return $FAILURES
@ -577,7 +577,7 @@ new file mode 100644
+ fail
+ fi
+ pass
+
+
+ # Verify that we got a core file from gcore
+ set_test gdb gcore did not create a core file
+ if [ ! -r core* ] ; then
@ -762,27 +762,27 @@ new file mode 100644
+# Verify that $LOG contains all information we want
+function verifyLog() {
+ local FAILURES=0
+
+
+ mustNotHave '??' || ((FAILURES++))
+ mustHaveCorrectAmount 12 threadcrash.c: || ((FAILURES++))
+
+
+ mustHaveSevenThreads || ((FAILURES++))
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
+
+ return $FAILURES
@ -844,7 +844,7 @@ new file mode 100644
+ ((FAILURES++))
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE when creating gcore file
+ fi
+
+
+ # Verify that we got a core file from gcore
+ if [ ! -r core* ] ; then
+ echo >> /dev/stderr ERROR: gdb gcore did not create a core file

View File

@ -42,7 +42,7 @@ new file mode 100644
+ 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,
@ -66,12 +66,12 @@ new file mode 100644
+# 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.
@ -86,7 +86,7 @@ new file mode 100644
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+ return 0
+}
+
+set testfile "dw2-included"
@ -125,7 +125,7 @@ new file mode 100644
+ 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,

View File

@ -44,17 +44,17 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1210,6 +1210,10 @@ print_command_1 (const char *args, int voidprint)
@@ -1301,6 +1301,10 @@ 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)
+ if (target_has_execution () && strcmp (exp, "errno") == 0)
+ exp = "*(*(int *(*)(void)) __errno_location) ()";
expression_up expr = parse_expression (exp);
val = evaluate_expression (expr.get ());
}
/* VOIDPRINT is true to indicate that we do want to print a void
value, so invert it for parse_expression. */
expression_up expr = parse_expression (exp, nullptr, !voidprint);
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
new file mode 100644
--- /dev/null

View File

@ -26,7 +26,7 @@ new file mode 100644
+ 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.
@ -45,22 +45,27 @@ diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp
@@ -0,0 +1,54 @@
@@ -0,0 +1,59 @@
+# 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.
+# 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
+}
+
+if $tracelevel then {
+ strace $tracelevel

View File

@ -1,27 +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-bz218379-solib-trampoline-lookup-lock-fix.patch
;; Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
;;=fedora
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
diff --git a/gdb/symtab.c b/gdb/symtab.c
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3169,6 +3169,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
msymbol->linkage_name ()); */
;
/* fall through */
+ /* `msymbol' trampoline may be located before its .text symbol
+ but this text symbol may be the address we were looking for.
+ Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop.
+ Red Hat Bug 218379. */
+ else if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc)
+ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", msymbol.minsym->linkage_name (), paddress (target_gdbarch (), pc));
+ /* fall through */
else
{
/* Detect an obvious case of infinite recursion. If this

View File

@ -10,26 +10,27 @@ diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.bas
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp
@@ -0,0 +1,75 @@
@@ -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 [is_remote target] then {
+ return 0
+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

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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.
@ -40,7 +40,7 @@ new file mode 100644
+int main()
+{
+ void *mem;
+
+
+ mem = malloc (MEGS * 1024ULL * 1024ULL);
+
+ for (;;)
@ -52,22 +52,27 @@ diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/g
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
@@ -0,0 +1,94 @@
@@ -0,0 +1,99 @@
+# 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.
+# 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 gcore-excessive-memory
+set srcfile ${testfile}.c

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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.
@ -44,22 +44,27 @@ diff --git a/gdb/testsuite/gdb.base/unwind-leak.exp b/gdb/testsuite/gdb.base/unw
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/unwind-leak.exp
@@ -0,0 +1,83 @@
@@ -0,0 +1,88 @@
+# 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.
+# 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 unwind-leak
+set srcfile ${testfile}.c
@ -104,7 +109,7 @@ new file mode 100644
+verbose -log "cycles = $cycles, permit_kb = $permit_kb"
+
+set fail 0
+set test "breakpoint stop/continue cycles"
+set test "breakpoint stop/continue cycles"
+for {set i $cycles} {$i > 0} {set i [expr {$i - 1}]} {
+ gdb_test_multiple "continue" $test {
+ -re "Breakpoint 2, main .*alarm .*.*${gdb_prompt} $" {

View File

@ -17,15 +17,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if $tracelevel then {
+ strace $tracelevel

View File

@ -27,7 +27,7 @@ new file mode 100644
+ 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.
@ -55,15 +55,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile watchpoint-during-step
+set srcfile ${testfile}.c

View File

@ -12,22 +12,22 @@ diff --git a/gdb/testsuite/gdb.base/readline-overflow.exp b/gdb/testsuite/gdb.ba
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/readline-overflow.exp
@@ -0,0 +1,104 @@
@@ -0,0 +1,96 @@
+# 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.
+# 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
@ -46,20 +46,12 @@ new file mode 100644
+
+global env
+
+save_vars { env(INPUTRC) env(GDBHISTFILE) env(HISTSIZE) TERM timeout } {
+save_vars { env(GDBHISTFILE) env(HISTSIZE) TERM timeout } {
+ # The arrow key test relies on the standard VT100 bindings, so
+ # make sure that an appropriate terminal is selected. The same
+ # bug doesn't show up if we use ^P / ^N instead.
+ setenv TERM vt100
+
+ # Don't let a .inputrc file or an existing setting of INPUTRC mess up
+ # the test results. Even if /dev/null doesn't exist on the particular
+ # platform, the readline library will use the default setting just by
+ # failing to open the file. OTOH, opening /dev/null successfully will
+ # also result in the default settings being used since nothing will be
+ # read from this file.
+ set env(INPUTRC) "/dev/null"
+
+ set timeout 600
+
+ set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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.
@ -51,7 +51,7 @@ new file mode 100644
+ 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.
@ -68,22 +68,27 @@ diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/datalib.exp
@@ -0,0 +1,51 @@
@@ -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.
+# 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

View File

@ -33,7 +33,7 @@ diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-main.c b/gdb/testsuite/gdb.t
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
@@ -0,0 +1,25 @@
@@ -0,0 +1,31 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2006 Free Software Foundation, Inc.
@ -47,7 +47,7 @@ new file mode 100644
+ 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.
@ -55,9 +55,15 @@ new file mode 100644
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <pthread.h>
+
+extern __thread int var;
+
+int main()
+{
+ return 0;
+ /* Ensure we link against pthreads even with --as-needed. */
+ pthread_testcancel();
+ return var;
+}
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
new file mode 100644
@ -77,7 +83,7 @@ new file mode 100644
+ 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.
@ -90,22 +96,29 @@ diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug.exp b/gdb/testsuite/gdb.thre
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug.exp
@@ -0,0 +1,87 @@
@@ -0,0 +1,94 @@
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This test uses gdb_exit and gdb_start, which are not supported
+# on non-extended-remote sessions.
+if {[use_gdb_stub]} {
+ untested "skipping test because of stub"
+ return 0
+}
+
+if $tracelevel then {
+ strace $tracelevel
@ -158,22 +171,22 @@ new file mode 100644
+ gdb_exit
+ gdb_start
+ ###gdb_reinitialize_dir $srcdir/$subdir
+
+
+ gdb_test "set env LD_LIBRARY_PATH=$ld_library_path" \
+ "" \
+ "set env LD_LIBRARY_PATH is $name"
+
+
+ gdb_load ${binmainfile}
+
+
+ # For C programs, "start" should stop in main().
+
+
+ gdb_test "start" \
+ "main \\(\\) at .*${srcmainfile}.*" \
+ "start"
+
+
+ # Check for: Cannot find shared library `/usr/lib/debug/lib/libc-2.4.90.so.debug' in dynamic linker's load module list
+ # as happens with TLS variables and `separate_debug_objfile_backlink'.
+
+
+ gdb_test "print var" \
+ "\\\$1 = \[0-9\].*" \
+ "print TLS variable from a shared library with $name-directory separate debug info file"

View File

@ -1,196 +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-core-as-arg.patch
;;=push+jan
http://sourceware.org/ml/gdb-patches/2010-01/msg00558.html
[ Fixed up since the mail. ]
On Thu, 21 Jan 2010 18:17:15 +0100, Doug Evans wrote:
> Not an exhaustive list, but if we go down the path of converting "gdb
> corefile" to "gdb -c corefile", then we also need to think about "file
> corefile" being converted to "core corefile" [or "target core
> corefile", "core" is apparently deprecated in favor of "target core"]
> and "target exec corefile" -> "target core corefile". Presumably
> "file corefile" (and "target exec corefile") would discard the
> currently selected executable. But maybe not. Will that be confusing
> for users? I don't know.
While thinking about it overriding some GDB _commands_ was not my intention.
There is a general assumption if I have a shell COMMAND and some FILE I can do
$ COMMAND FILE
and COMMAND will appropriately load the FILE.
FSF GDB currently needs to specify also the executable file for core files
which already inhibits this intuitive expectation. OTOH with the build-id
locating patch which could allow such intuitive start notneeding the
executable file. Still it currently did not work due to the required "-c":
$ COMMAND -c COREFILE
Entering "file", "core-file" or "attach" commands is already explicit enough
so that it IMO should do what the command name says without any
autodetections. The second command line argument
(captured_main->pid_or_core_arg) is also autodetected (for PID or CORE) but
neither "attach" accepts a core file nor "core-file" accepts a PID.
The patch makes sense only with the build-id patchset so this is not submit
for FSF GDB inclusion yet. I am fine with your patch (+/- Hui Zhu's pending
bfd_check_format_matches) as the patch below is its natural extension.
Sorry for the delay,
Jan
2010-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* exceptions.h (enum errors <IS_CORE_ERROR>): New.
* exec.c: Include exceptions.h.
(exec_file_attach <bfd_core>): Call throw_error (IS_CORE_ERROR, ...).
* main.c (exec_or_core_file_attach): New.
(captured_main <optind < argc>): Set also corearg.
(captured_main <strcmp (execarg, symarg) == 0>): New variable func.
Call exec_or_core_file_attach if COREARG matches EXECARG. Call
symbol_file_add_main only if CORE_BFD remained NULL.
Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
2010-01-20 Doug Evans <dje@google.com>
* exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core".
diff --git a/gdb/exec.c b/gdb/exec.c
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arch-utils.h"
+#include "exceptions.h"
#include "frame.h"
#include "inferior.h"
#include "target.h"
@@ -495,12 +497,27 @@ exec_file_attach (const char *filename, int from_tty)
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{
+ int is_core;
+
+ /* If the user accidentally did "gdb core", print a useful
+ error message. Check it only after bfd_object has been checked as
+ a valid executable may get recognized for example also as
+ "trad-core". */
+ is_core = bfd_check_format (exec_bfd, bfd_core);
+
/* Make sure to close exec_bfd, or else "run" might try to use
it. */
exec_close ();
- error (_("\"%ps\": not in executable format: %s"),
- styled_string (file_name_style.style (), scratch_pathname),
- gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
+
+ if (is_core != 0)
+ throw_error (IS_CORE_ERROR,
+ _("\"%s\" is a core file.\n"
+ "Please specify an executable to debug."),
+ scratch_pathname);
+ else
+ error (_("\"%ps\": not in executable format: %s"),
+ styled_string (file_name_style.style (), scratch_pathname),
+ gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
}
if (build_section_table (exec_bfd, &sections, &sections_end))
diff --git a/gdb/main.c b/gdb/main.c
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -524,6 +524,34 @@ struct cmdarg
char *string;
};
+/* Call exec_file_attach. If it detected FILENAME is a core file call
+ core_file_command. Print the original exec_file_attach error only if
+ core_file_command failed to find a matching executable. */
+
+static void
+exec_or_core_file_attach (const char *filename, int from_tty)
+{
+ gdb_assert (exec_bfd == NULL);
+
+ try
+ {
+ exec_file_attach (filename, from_tty);
+ }
+ catch (gdb_exception_error &e)
+ {
+ if (e.error == IS_CORE_ERROR)
+ {
+ core_file_command ((char *) filename, from_tty);
+
+ /* Iff the core file found its executable suppress the error message
+ from exec_file_attach. */
+ if (exec_bfd != NULL)
+ return;
+ }
+ throw_exception (std::move (e));
+ }
+}
+
static void
captured_main_1 (struct captured_main_args *context)
{
@@ -959,6 +987,8 @@ captured_main_1 (struct captured_main_args *context)
{
symarg = argv[optind];
execarg = argv[optind];
+ if (optind + 1 == argc && corearg == NULL)
+ corearg = argv[optind];
optind++;
}
@@ -1114,12 +1144,25 @@ captured_main_1 (struct captured_main_args *context)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
+ catch_command_errors_const_ftype *func;
+
+ /* Call exec_or_core_file_attach only if the file was specified as
+ a command line argument (and not an a command line option). */
+ if (corearg != NULL && strcmp (corearg, execarg) == 0)
+ {
+ func = exec_or_core_file_attach;
+ corearg = NULL;
+ }
+ else
+ func = exec_file_attach;
+
/* The exec file and the symbol-file are the same. If we can't
open it, better only print one error message.
- catch_command_errors returns non-zero on success! */
- ret = catch_command_errors (exec_file_attach, execarg,
- !batch_flag);
- if (ret != 0)
+ catch_command_errors returns non-zero on success!
+ Do not load EXECARG as a symbol file if it has been already processed
+ as a core file. */
+ ret = catch_command_errors (func, execarg, !batch_flag);
+ if (ret != 0 && core_bfd == NULL)
ret = catch_command_errors (symbol_file_add_main_adapter,
symarg, !batch_flag);
}
diff --git a/gdbsupport/common-exceptions.h b/gdbsupport/common-exceptions.h
--- a/gdbsupport/common-exceptions.h
+++ b/gdbsupport/common-exceptions.h
@@ -106,6 +106,9 @@ enum errors {
"_ERROR" is appended to the name. */
MAX_COMPLETIONS_REACHED_ERROR,
+ /* Attempt to load a core file as executable. */
+ IS_CORE_ERROR,
+
/* Add more errors here. */
NR_ERRORS
};

View File

@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -708,6 +708,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
@@ -712,6 +712,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
#include <dlfcn.h>
#endif

View File

@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=953585
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -742,7 +742,11 @@ static int missing_rpm_list_entries;
@@ -746,7 +746,11 @@ static int missing_rpm_list_entries;
/* Returns the count of newly added rpms. */
static int
@ -24,7 +24,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
static int rpm_init_done = 0;
rpmts ts;
@@ -849,7 +853,11 @@ missing_rpm_enlist (const char *filename)
@@ -853,7 +857,11 @@ missing_rpm_enlist (const char *filename)
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
if (mi != NULL)
{
@ -36,7 +36,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
Header h;
char *debuginfo, **slot, *s, *s2;
@@ -967,6 +975,37 @@ missing_rpm_enlist (const char *filename)
@@ -971,6 +979,37 @@ missing_rpm_enlist (const char *filename)
xfree (debuginfo);
count++;
}
@ -74,7 +74,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
rpmdbFreeIterator_p (mi);
}
@@ -976,6 +1015,20 @@ missing_rpm_enlist (const char *filename)
@@ -980,6 +1019,20 @@ missing_rpm_enlist (const char *filename)
return count;
}
@ -98,7 +98,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -3025,6 +3025,16 @@ read_gdb_index_from_buffer (const char *filename,
@@ -2797,6 +2797,16 @@ read_gdb_index_from_buffer (const char *filename,
"set use-deprecated-index-sections on". */
if (version < 6 && !deprecated_ok)
{
@ -115,7 +115,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
static int warning_printed = 0;
if (!warning_printed)
{
@@ -3036,6 +3046,10 @@ to use the section anyway."),
@@ -2808,6 +2818,10 @@ to use the section anyway."),
warning_printed = 1;
}
return 0;

View File

@ -14,7 +14,7 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
@ -133,11 +133,11 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
@ -154,7 +154,7 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
@ -243,7 +243,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
#include "objfiles.h"
#include "observable.h"
#include "symfile.h"
@@ -697,8 +698,374 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
@@ -701,8 +702,374 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
return result;
}
@ -336,7 +336,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
+ /* Already failed the initialization before? */
+ if (init_tried)
+ return 0;
+ return 0;
+ init_tried = 1;
+
+#ifdef DLOPEN_LIBRPM
@ -619,7 +619,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
avoidance. */
struct missing_filepair
@@ -752,11 +1119,17 @@ missing_filepair_change (void)
@@ -756,11 +1123,17 @@ missing_filepair_change (void)
/* All their memory came just from missing_filepair_OBSTACK. */
missing_filepair_hash = NULL;
}
@ -637,7 +637,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
missing_filepair_change ();
}
@@ -823,14 +1196,38 @@ debug_print_missing (const char *binary, const char *debug)
@@ -827,14 +1200,38 @@ debug_print_missing (const char *binary, const char *debug)
*slot = missing_filepair;
@ -696,7 +696,7 @@ diff --git a/gdb/config.in b/gdb/config.in
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
@@ -247,6 +250,9 @@
@@ -259,6 +262,9 @@
/* Define if you have the mpfr library. */
#undef HAVE_LIBMPFR
@ -709,9 +709,9 @@ diff --git a/gdb/config.in b/gdb/config.in
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
@@ -769,6 +769,11 @@ PKG_CONFIG
HAVE_NATIVE_GCORE_TARGET
TARGET_OBS
@@ -775,6 +775,11 @@ TARGET_OBS
ENABLE_BFD_64_BIT_FALSE
ENABLE_BFD_64_BIT_TRUE
subdirs
+RPM_LIBS
+RPM_CFLAGS
@ -721,7 +721,7 @@ diff --git a/gdb/configure b/gdb/configure
GDB_DATADIR
DEBUGDIR
MAKEINFO_EXTRA_FLAGS
@@ -873,6 +878,7 @@ with_gdb_datadir
@@ -880,6 +885,7 @@ with_gdb_datadir
with_relocated_sources
with_auto_load_dir
with_auto_load_safe_path
@ -729,7 +729,7 @@ diff --git a/gdb/configure b/gdb/configure
enable_targets
enable_64_bit_bfd
enable_gdbmi
@@ -949,6 +955,8 @@ PKG_CONFIG_PATH
@@ -959,6 +965,8 @@ PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
DEBUGINFOD_CFLAGS
DEBUGINFOD_LIBS
@ -738,7 +738,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC
YFLAGS
XMKMF'
@@ -1621,6 +1629,8 @@ Optional Packages:
@@ -1635,6 +1643,8 @@ Optional Packages:
do not restrict auto-loaded files locations
--with-debuginfod Enable debuginfo lookups with debuginfod
(auto/yes/no)
@ -747,7 +747,7 @@ diff --git a/gdb/configure b/gdb/configure
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
--with-curses use the curses library instead of the termcap
library
@@ -1702,6 +1712,8 @@ Some influential environment variables:
@@ -1715,6 +1725,8 @@ Some influential environment variables:
C compiler flags for DEBUGINFOD, overriding pkg-config
DEBUGINFOD_LIBS
linker flags for DEBUGINFOD, overriding pkg-config
@ -756,7 +756,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC The `Yet Another Compiler Compiler' implementation to use.
Defaults to the first program found out of: `bison -y', `byacc',
`yacc'.
@@ -6666,6 +6678,494 @@ _ACEOF
@@ -6634,6 +6646,494 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
$as_echo "$with_auto_load_safe_path" >&6; }
@ -1148,7 +1148,7 @@ diff --git a/gdb/configure b/gdb/configure
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@ -1166,7 +1166,7 @@ diff --git a/gdb/configure b/gdb/configure
+
+ HAVE_LIBRPM=false
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ HAVE_LIBRPM=false
+else
@ -1254,7 +1254,7 @@ diff --git a/gdb/configure b/gdb/configure
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -143,6 +143,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
@@ -153,6 +153,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
[Directories safe to hold auto-loaded files.])
AC_MSG_RESULT([$with_auto_load_safe_path])
@ -1450,7 +1450,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
+ fi
+ fi
+fi
+
+
AC_CONFIG_SUBDIRS(testsuite)
# Check whether to support alternative target configurations
@ -1458,14 +1458,14 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -42,6 +42,7 @@
#include "gdbsupport/gdb_select.h"
#include "gdbsupport/gdb-sigmask.h"
#include "async-event.h"
#include "bt-utils.h"
+#include "symfile.h"
/* readline include files. */
#include "readline/readline.h"
@@ -364,6 +365,8 @@ display_gdb_prompt (const char *new_prompt)
@@ -374,6 +375,8 @@ display_gdb_prompt (const char *new_prompt)
/* Reset the nesting depth used when trace-commands is set. */
reset_command_nest_depth ();
@ -1474,7 +1474,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
/* Do not call the python hook on an explicit prompt change as
passed to this function, as this forms a secondary/local prompt,
IE, displayed but not set. */
@@ -773,7 +776,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
@@ -800,7 +803,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
command_handler (cmd);
if (ui->prompt_state != PROMPTED)
@ -1489,11 +1489,11 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
diff --git a/gdb/symfile.h b/gdb/symfile.h
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -560,6 +560,7 @@ extern void generic_load (const char *args, int from_tty);
@@ -342,6 +342,7 @@ extern void generic_load (const char *args, int from_tty);
/* build-id support. */
extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
extern void debug_print_missing (const char *binary, const char *debug);
+extern void debug_flush_missing (void);
#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
/* From dwarf2read.c */
/* From minidebug.c. */

View File

@ -14,7 +14,7 @@ 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
@@ -1340,14 +1340,27 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
@@ -1250,14 +1250,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
}
{
@ -38,13 +38,14 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
+ 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 (symfile_objfile != NULL
+ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
+ 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;
@@ -1362,23 +1375,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
@@ -1272,23 +1286,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
xfree (name);
}
else
@ -60,8 +61,8 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
- instead) if the on-disk files no longer match the
- running program version. */
-
- if (symfile_objfile != NULL
- && (symfile_objfile->flags
- 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;
- }

View File

@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate.patch
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -121,7 +121,7 @@ static inline char *
@@ -115,7 +115,7 @@ static inline char *
bfd_strdup (const char *str)
{
size_t len = strlen (str) + 1;
@ -21,7 +21,7 @@ diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -126,7 +126,7 @@ static inline char *
@@ -120,7 +120,7 @@ static inline char *
bfd_strdup (const char *str)
{
size_t len = strlen (str) + 1;
@ -463,14 +463,15 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
@@ -66,56 +465,159 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
@@ -66,63 +465,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
return retval;
}
+static char *
+link_resolve (const char *symlink, int level)
+{
+ char buf[PATH_MAX + 1], *target, *retval;
+ char buf[PATH_MAX + 1], *retval;
+ gdb::unique_xmalloc_ptr<char> target;
+ ssize_t got;
+
+ if (level > 10)
@ -482,7 +483,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ buf[got] = '\0';
+
+ if (IS_ABSOLUTE_PATH (buf))
+ target = xstrdup (buf);
+ target = make_unique_xstrdup (buf);
+ else
+ {
+ const std::string dir (ldirname (symlink));
@ -496,8 +497,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ "%s", dir.c_str(), buf);
+ }
+
+ retval = link_resolve (target, level + 1);
+ xfree (target);
+ retval = link_resolve (target.get (), level + 1);
+ return retval;
+}
+
@ -516,42 +516,49 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
if (separate_debug_file_debug)
{
- printf_unfiltered (_(" Trying %s..."), link.c_str ());
+ printf_unfiltered (_(" Trying %s..."), orig_link.c_str ());
gdb_flush (gdb_stdout);
- fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), link.c_str ());
- gdb_flush (gdb_stdlog);
+ fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), orig_link.c_str ());
+ gdb_flush (gdb_stdout);
}
- /* lrealpath() is expensive even for the usually non-existent files. */
- gdb::unique_xmalloc_ptr<char> filename;
- if (access (link.c_str (), F_OK) == 0)
- filename.reset (lrealpath (link.c_str ()));
-
- if (filename == NULL)
- gdb::unique_xmalloc_ptr<char> filename_holder;
- const char *filename = nullptr;
- if (startswith (link, TARGET_SYSROOT_PREFIX))
- filename = link.c_str ();
- else if (access (link.c_str (), F_OK) == 0)
+ for (unsigned seqno = 0;; seqno++)
{
- if (separate_debug_file_debug)
- printf_unfiltered (_(" no, unable to compute real path\n"));
- filename_holder.reset (lrealpath (link.c_str ()));
- filename = filename_holder.get ();
- }
+ std::string link = orig_link;
- return {};
- }
- if (filename == NULL)
- {
- if (separate_debug_file_debug)
- fprintf_unfiltered (gdb_stdlog,
- _(" no, unable to compute real path\n"));
+ if (seqno > 0)
+ {
+ /* There can be multiple build-id symlinks pointing to real files
+ with the same build-id (such as hard links). Some of the real
+ files may not be installed. */
- /* We expect to be silent on the non-existing files. */
- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget);
- return {};
- }
+ string_appendf (link, ".%u", seqno);
+ }
- /* We expect to be silent on the non-existing files. */
- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename, gnutarget);
+ ret_link = link;
- if (debug_bfd == NULL)
- {
- if (separate_debug_file_debug)
- printf_unfiltered (_(" no, unable to open.\n"));
+ ret_link = link;
+
- fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n"));
+ struct stat statbuf_trash;
+
+ /* `access' automatically dereferences LINK. */
@ -562,27 +569,33 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ }
+
+ /* lrealpath() is expensive even for the usually non-existent files. */
+ gdb::unique_xmalloc_ptr<char> filename;
+
+ if (access (link.c_str (), F_OK) == 0)
+ filename.reset (lrealpath (link.c_str ()));
+ gdb::unique_xmalloc_ptr<char> filename_holder;
+ const char *filename = nullptr;
+ if (startswith (link, TARGET_SYSROOT_PREFIX))
+ filename = link.c_str ();
+ else if (access (link.c_str (), F_OK) == 0)
+ {
+ filename_holder.reset (lrealpath (link.c_str ()));
+ filename = filename_holder.get ();
+ }
+
+ if (filename == NULL)
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" no, unable to compute real path\n"));
+ fprintf_unfiltered (gdb_stdlog,
+ _(" no, unable to compute real path\n"));
+
+ continue;
+ }
+
+ /* We expect to be silent on the non-existing files. */
+ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename, gnutarget);
- return {};
+ /* We expect to be silent on the non-existing files. */
+ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
+
+ if (debug_bfd == NULL)
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" no, unable to open.\n"));
+ fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n"));
+
+ continue;
+ }
@ -590,7 +603,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ if (!build_id_verify (debug_bfd.get(), build_id_len, build_id))
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" no, build-id does not match.\n"));
+ fprintf_unfiltered (gdb_stdlog,
+ _(" no, build-id does not match.\n"));
+
+ continue;
+ }
@ -605,10 +619,10 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ if (ret_bfd != NULL)
{
if (separate_debug_file_debug)
- printf_unfiltered (_(" no, build-id does not match.\n"));
- fprintf_unfiltered (gdb_stdlog, _(" no, build-id does not match.\n"));
-
- return {};
+ printf_unfiltered (_(" yes!\n"));
+ fprintf_unfiltered (gdb_stdlog, _(" yes!\n"));
+ }
+ else
+ {
@ -632,7 +646,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
}
- if (separate_debug_file_debug)
- printf_unfiltered (_(" yes!\n"));
- fprintf_unfiltered (gdb_stdlog, _(" yes!\n"));
+ if (link_return != NULL)
+ {
+ if (ret_bfd != NULL)
@ -650,7 +664,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
}
/* Common code for finding BFDs of a given build-id. This function
@@ -124,7 +626,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
@@ -131,7 +633,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
static gdb_bfd_ref_ptr
build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
@ -659,7 +673,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
@@ -147,16 +649,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
@@ -154,16 +656,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
if (size > 0)
{
size--;
@ -680,8 +694,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (debug_bfd != NULL)
return debug_bfd;
@@ -170,7 +673,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
@@ -174,7 +677,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
if (!gdb_sysroot.empty ())
{
link = gdb_sysroot + link;
- debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id);
@ -690,7 +704,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (debug_bfd != NULL)
return debug_bfd;
}
@@ -179,38 +683,208 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
@@ -183,30 +687,187 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
return {};
}
@ -699,7 +713,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+{
+ gdb_bfd_ref_ptr abfd;
+ char *result;
+
+
+ abfd = build_id_to_exec_bfd (build_id->size, build_id->data, link_return);
+ if (abfd == NULL)
+ return NULL;
@ -884,13 +898,14 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (build_id != NULL)
{
if (separate_debug_file_debug)
printf_unfiltered (_("\nLooking for separate debug info (build-id) for "
"%s\n"), objfile_name (objfile));
@@ -214,8 +875,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
_("\nLooking for separate debug info (build-id) for "
"%s\n"), objfile_name (objfile));
+ char *build_id_filename_cstr = NULL;
gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size,
- build_id->data));
+ build_id->data,
+ build_id->data,
+ (!build_id_filename_return ? NULL : &build_id_filename_cstr)));
+ if (build_id_filename_return)
+ {
@ -906,15 +921,15 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd.get ()),
@@ -223,3 +897,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
@@ -228,3 +902,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
return std::string ();
}
+
+extern void _initialize_build_id (void);
+void _initialize_build_id ();
+
+void
+_initialize_build_id (void)
+_initialize_build_id ()
+{
+ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
+ _("\
@ -926,7 +941,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ show_build_id_verbose,
+ &setlist, &showlist);
+
+ gdb::observers::executable_changed.attach (debug_print_executable_changed);
+ gdb::observers::executable_changed.attach (debug_print_executable_changed,
+ "build-id");
+}
diff --git a/gdb/build-id.h b/gdb/build-id.h
--- a/gdb/build-id.h
@ -950,7 +966,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len,
- const bfd_byte *build_id);
+ const bfd_byte *build_id,
+ char **link_return);
+ char **link_return = NULL);
+
+extern char *build_id_to_filename (const struct bfd_build_id *build_id,
+ char **link_return);
@ -978,9 +994,9 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
diff --git a/gdb/coffread.c b/gdb/coffread.c
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -709,7 +709,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
@@ -710,7 +710,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
/* Try to add separate debug file if no symbols table found. */
if (!objfile_has_partial_symbols (objfile))
if (!objfile->has_partial_symbols ())
{
- std::string debugfile = find_separate_debug_file_by_buildid (objfile);
+ std::string debugfile = find_separate_debug_file_by_buildid (objfile,
@ -1002,7 +1018,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
#include "inferior.h"
#include "infrun.h"
#include "symtab.h"
@@ -362,6 +366,8 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
@@ -356,6 +360,8 @@ add_to_thread_list (asection *asect, asection *reg_sect)
switch_to_thread (thr); /* Yes, make it current. */
}
@ -1011,7 +1027,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
/* Issue a message saying we have no core to debug, if FROM_TTY. */
static void
@@ -398,19 +404,25 @@ core_file_command (const char *filename, int from_tty)
@@ -392,19 +398,26 @@ core_file_command (const char *filename, int from_tty)
static void
locate_exec_from_corefile_build_id (bfd *abfd, int from_tty)
{
@ -1031,16 +1047,17 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
exec_file_attach (bfd_get_filename (execbfd.get ()), from_tty);
symbol_file_add_main (bfd_get_filename (execbfd.get ()),
symfile_add_flag (from_tty ? SYMFILE_VERBOSE : 0));
+ if (symfile_objfile != NULL)
+ symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
+ if (current_program_space->symfile_object_file != NULL)
+ current_program_space->symfile_object_file->flags |=
+ OBJF_BUILD_ID_CORE_LOADED;
}
+ else
+ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename);
}
/* See gdbcore.h. */
@@ -1189,4 +1201,11 @@ _initialize_corelow ()
maintenance_print_core_file_backed_mappings,
@@ -1209,4 +1222,11 @@ _initialize_corelow ()
maintenance_print_core_file_backed_mappings,
_("Print core file's file-backed mappings."),
&maintenanceprintlist);
+
@ -1054,7 +1071,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -21074,6 +21074,27 @@ information files.
@@ -21524,6 +21524,27 @@ information files.
@end table
@ -1085,7 +1102,7 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
--- a/gdb/dwarf2/index-cache.c
+++ b/gdb/dwarf2/index-cache.c
@@ -95,7 +95,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
@@ -97,7 +97,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
return;
/* Get build id of objfile. */
@ -1093,8 +1110,8 @@ diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd);
if (build_id == nullptr)
{
if (debug_index_cache)
@@ -113,7 +113,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
index_cache_debug ("objfile %s has no build id",
@@ -114,7 +114,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
if (dwz != nullptr)
{
@ -1107,16 +1124,7 @@ diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2218,7 +2218,7 @@ dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd)
}
if (dwz_bfd == NULL)
- dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid);
+ dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid, NULL);
if (dwz_bfd == nullptr)
{
@@ -5980,7 +5980,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
@@ -5476,7 +5476,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
static gdb::array_view<const gdb_byte>
get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
{
@ -1125,7 +1133,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
if (build_id == nullptr)
return {};
@@ -5993,7 +5993,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
@@ -5489,7 +5489,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
static gdb::array_view<const gdb_byte>
get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz)
{
@ -1137,7 +1145,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
diff --git a/gdb/elfread.c b/gdb/elfread.c
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1298,7 +1298,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
@@ -1270,7 +1270,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@ -1148,7 +1156,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
if (debugfile.empty ())
debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1313,7 +1315,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
@@ -1285,7 +1287,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
else
{
has_dwarf2 = false;
@ -1157,7 +1165,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
if (build_id != nullptr)
{
@@ -1338,6 +1340,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
@@ -1310,6 +1312,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
has_dwarf2 = true;
}
}
@ -1171,16 +1179,16 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
diff --git a/gdb/exec.c b/gdb/exec.c
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -264,7 +264,7 @@ validate_exec_file (int from_tty)
reopen_exec_file ();
@@ -238,7 +238,7 @@ validate_exec_file (int from_tty)
current_exec_file = get_exec_file (0);
- const bfd_build_id *exec_file_build_id = build_id_bfd_get (exec_bfd);
+ const bfd_build_id *exec_file_build_id = build_id_bfd_shdr_get (exec_bfd);
const bfd_build_id *exec_file_build_id
- = build_id_bfd_get (current_program_space->exec_bfd ());
+ = build_id_bfd_shdr_get (current_program_space->exec_bfd ());
if (exec_file_build_id != nullptr)
{
/* Prepend the target prefix, to force gdb_bfd_open to open the
@@ -277,7 +277,7 @@ validate_exec_file (int from_tty)
@@ -251,7 +251,7 @@ validate_exec_file (int from_tty)
if (abfd != nullptr)
{
const bfd_build_id *target_exec_file_build_id
@ -1192,7 +1200,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -714,6 +714,10 @@ struct objfile
@@ -769,6 +769,10 @@ struct objfile
bool skip_jit_symbol_lookup = false;
};
@ -1235,7 +1243,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
@@ -1338,9 +1339,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
@@ -1248,9 +1249,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
continue;
}
@ -1277,8 +1285,8 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
+ instead) if the on-disk files no longer match the
+ running program version. */
+
+ if (symfile_objfile != NULL
+ && (symfile_objfile->flags
+ 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;
+ }
@ -1293,7 +1301,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
diff --git a/gdb/source.c b/gdb/source.c
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1165,7 +1165,7 @@ open_source_file (struct symtab *s)
@@ -1199,7 +1199,7 @@ open_source_file (struct symtab *s)
srcpath += s->filename;
}
@ -1305,9 +1313,9 @@ diff --git a/gdb/source.c b/gdb/source.c
diff --git a/gdb/symfile.h b/gdb/symfile.h
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -550,12 +550,18 @@ void expand_symtabs_matching
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
@@ -332,12 +332,18 @@ bool expand_symtabs_matching
void map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun,
bool need_fullname);
+
/* Target-agnostic function to load the sections of an executable into memory.
@ -1321,9 +1329,9 @@ diff --git a/gdb/symfile.h b/gdb/symfile.h
+extern void debug_print_missing (const char *binary, const char *debug);
+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
+
/* From dwarf2read.c */
/* From minidebug.c. */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal
extern gdb_bfd_ref_ptr find_separate_debug_file_in_section (struct objfile *);
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@ -1361,6 +1369,19 @@ diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefi
+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
+ pass $wholetest
+}
diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp
--- a/gdb/testsuite/gdb.base/gdbinit-history.exp
+++ b/gdb/testsuite/gdb.base/gdbinit-history.exp
@@ -185,7 +185,8 @@ proc test_empty_history_filename { } {
global env
global gdb_prompt
- set common_history [list "set height 0" "set width 0"]
+ set common_history [list "set height 0" "set width 0" \
+ "set build-id-verbose 0"]
set test_dir [standard_output_file history_test]
remote_exec host "mkdir -p $test_dir"
diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb.base/new-ui-pending-input.exp
--- a/gdb/testsuite/gdb.base/new-ui-pending-input.exp
+++ b/gdb/testsuite/gdb.base/new-ui-pending-input.exp
@ -1375,7 +1396,17 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb
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
@@ -2011,6 +2011,17 @@ proc default_gdb_start { } {
@@ -141,7 +141,8 @@ if ![info exists INTERNAL_GDBFLAGS] {
"-nx" \
"-data-directory $BUILD_DATA_DIRECTORY" \
{-iex "set height 0"} \
- {-iex "set width 0"}]]
+ {-iex "set width 0"} \
+ {-iex "set build-id-verbose 0"}]]
}
# The variable gdb_prompt is a regexp which matches the gdb prompt.
@@ -2200,6 +2201,17 @@ proc default_gdb_start { } {
}
}
@ -1396,7 +1427,7 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -308,6 +308,16 @@ proc default_mi_gdb_start { args } {
@@ -322,6 +322,16 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
}

View File

@ -79,15 +79,15 @@ new file mode 100644
+# 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.
+# 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

View File

@ -31,7 +31,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test PowerPC Power6 instructions disassembly.
+

View File

@ -29,7 +29,7 @@ new file mode 100644
+ 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., 51 Franklin Street, Fifth Floor, Boston,
@ -202,12 +202,12 @@ new file mode 100644
+# 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. */

View File

@ -36,7 +36,7 @@ new file mode 100644
+ 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.
@ -71,15 +71,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile charsign
+set srcfile ${testfile}.c

View File

@ -175,7 +175,7 @@ diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.thr
+gdb_load ${binfile_nothreads}
-gdb_run_cmd
+gdb_run_cmd ${binfile_nothreads} ${binfile_threads} 0
+gdb_run_cmd [list ${binfile_nothreads} ${binfile_threads} 0]
gdb_test_multiple {} "Program exited" {
-re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {

View File

@ -383,12 +383,12 @@ new file mode 100644
+# 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.
@ -402,7 +402,7 @@ new file mode 100644
+ && ![istarget *-*-elf*]
+ && ![istarget *-*-openbsd*])
+ || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} {
+ return 0
+ return 0
+}
+
+set testfile "dw2-loclist-prelinked"

View File

@ -1,78 +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.8-quit-never-aborts.patch
;; Make the GDB quit processing non-abortable to cleanup everything properly.
;;=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch .
We may abort the process of detaching threads with multiple SIGINTs - which are
being sent during a testcase terminating its child GDB.
Some of the threads may not be properly PTRACE_DETACHed which hurts if they
should have been detached with SIGSTOP (as they are accidentally left running
on the debugger termination).
diff --git a/gdb/defs.h b/gdb/defs.h
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -177,6 +177,10 @@ extern void default_quit_handler (void);
/* Flag that function quit should call quit_force. */
extern volatile int sync_quit_force_run;
+#ifdef NEED_DETACH_SIGSTOP
+extern int quit_flag_cleanup;
+#endif
+
extern void quit (void);
/* Helper for the QUIT macro. */
diff --git a/gdb/extension.c b/gdb/extension.c
--- a/gdb/extension.c
+++ b/gdb/extension.c
@@ -769,6 +769,11 @@ check_quit_flag (void)
{
int result = 0;
+#ifdef NEED_DETACH_SIGSTOP
+ if (quit_flag_cleanup)
+ return 0;
+#endif
+
for (const struct extension_language_defn *extlang : extension_languages)
{
if (extlang->ops != nullptr
diff --git a/gdb/top.c b/gdb/top.c
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1770,7 +1770,13 @@ quit_force (int *exit_arg, int from_tty)
else if (return_child_result)
exit_code = return_child_result_value;
+#ifndef NEED_DETACH_SIGSTOP
/* We want to handle any quit errors and exit regardless. */
+#else
+ /* We want to handle any quit errors and exit regardless but we should never
+ get user-interrupted to properly detach the inferior. */
+ quit_flag_cleanup = 1;
+#endif
/* Get out of tfind mode, and kill or detach all inferiors. */
try
diff --git a/gdb/utils.c b/gdb/utils.c
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -103,6 +103,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time;
static bool debug_timestamp = false;
+#ifdef NEED_DETACH_SIGSTOP
+/* Nonzero means we are already processing the quitting cleanups and we should
+ no longer get aborted. */
+
+int quit_flag_cleanup;
+#endif
+
/* True means that strings with character values >0x7F should be printed
as octal escapes. False means just print the value (e.g. it's an
international character, and the terminal or window can cope.) */

View File

@ -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-archer-pie-addons-keep-disabled.patch
;;=push+jan: Breakpoints disabling matching should not be based on address.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -15431,6 +15431,50 @@ static struct cmd_list_element *enablebreaklist = NULL;
cmd_list_element *commands_cmd_element = nullptr;
+void
+breakpoints_relocate (struct objfile *objfile, section_offsets &delta)
+{
+ struct bp_location *bl, **blp_tmp;
+ int changed = 0;
+
+ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
+
+ ALL_BP_LOCATIONS (bl, blp_tmp)
+ {
+ struct obj_section *osect;
+
+ /* BL->SECTION can be correctly NULL for breakpoints with multiple
+ locations expanded through symtab. */
+
+ ALL_OBJFILE_OSECTIONS (objfile, osect)
+ {
+ CORE_ADDR relocated_address;
+ CORE_ADDR delta_offset;
+
+ delta_offset = delta[osect->the_bfd_section->index];
+ if (delta_offset == 0)
+ continue;
+ relocated_address = bl->address + delta_offset;
+
+ if (obj_section_addr (osect) <= relocated_address
+ && relocated_address < obj_section_endaddr (osect))
+ {
+ if (bl->inserted)
+ remove_breakpoint (bl);
+
+ bl->address += delta_offset;
+ bl->requested_address += delta_offset;
+
+ changed = 1;
+ }
+ }
+ }
+
+ if (changed)
+ std::sort (bp_locations, bp_locations + bp_locations_count,
+ bp_location_is_less_than);
+}
+
void _initialize_breakpoint ();
void
_initialize_breakpoint ()
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -1691,6 +1691,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg);
UIOUT iff debugging multiple threads. */
extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout);
+extern void breakpoints_relocate (struct objfile *objfile,
+ section_offsets &delta);
+
/* Print the specified breakpoint. */
extern void print_breakpoint (breakpoint *bp);
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -742,6 +742,11 @@ objfile_relocate1 (struct objfile *objfile,
obj_section_addr (s));
}
+ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
+ their addresses match. */
+ if (objfile->separate_debug_objfile_backlink == NULL)
+ breakpoints_relocate (objfile, delta);
+
/* Data changed. */
return 1;
}

View File

@ -1,39 +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-archer-pie-addons.patch
;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -649,6 +649,7 @@ enum field_loc_kind
{
FIELD_LOC_KIND_BITPOS, /**< bitpos */
FIELD_LOC_KIND_ENUMVAL, /**< enumval */
+ /* This address is unrelocated by the objfile's ANOFFSET. */
FIELD_LOC_KIND_PHYSADDR, /**< physaddr */
FIELD_LOC_KIND_PHYSNAME, /**< physname */
FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */
@@ -699,6 +700,7 @@ union field_location
field. Otherwise, physname is the mangled label of the
static field. */
+ /* This address is unrelocated by the objfile's ANOFFSET. */
CORE_ADDR physaddr;
const char *physname;
diff --git a/gdb/value.c b/gdb/value.c
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -2850,7 +2850,8 @@ value_static_field (struct type *type, int fieldno)
{
case FIELD_LOC_KIND_PHYSADDR:
retval = value_at_lazy (type->field (fieldno).type (),
- TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
+ TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)
+ + (TYPE_OBJFILE (type) == NULL ? 0 : TYPE_OBJFILE (type)->section_offsets[SECT_OFF_TEXT (TYPE_OBJFILE (type))]));
break;
case FIELD_LOC_KIND_PHYSNAME:
{

File diff suppressed because it is too large Load Diff

View File

@ -1,187 +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-archer.patch
;; Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher
;;=push
http://sourceware.org/gdb/wiki/ProjectArcher
http://sourceware.org/gdb/wiki/ArcherBranchManagement
GIT snapshot:
commit 718a1618b2f691a7f407213bb50f100ac59f91c3
tromey/python
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -80,6 +80,7 @@ PYTHON_FILE_LIST = \
gdb/unwinder.py \
gdb/xmethod.py \
gdb/command/__init__.py \
+ gdb/command/ignore_errors.py \
gdb/command/explore.py \
gdb/command/backtrace.py \
gdb/command/frame_filters.py \
@@ -92,6 +93,7 @@ PYTHON_FILE_LIST = \
gdb/function/as_string.py \
gdb/function/caller_is.py \
gdb/function/strfns.py \
+ gdb/function/in_scope.py \
gdb/printer/__init__.py \
gdb/printer/bound_registers.py
diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
--- a/gdb/gdb-gdb.gdb.in
+++ b/gdb/gdb-gdb.gdb.in
@@ -1,5 +1,15 @@
echo Setting up the environment for debugging gdb.\n
+# Set up the Python library and "require" command.
+python
+from os.path import abspath
+gdb.datadir = abspath ('@srcdir@/python/lib')
+gdb.pythonlibdir = gdb.datadir
+gdb.__path__ = [gdb.datadir + '/gdb']
+sys.path.insert(0, gdb.datadir)
+end
+source @srcdir@/python/lib/gdb/__init__.py
+
if !$gdb_init_done
set variable $gdb_init_done = 1
diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/command/ignore_errors.py
@@ -0,0 +1,37 @@
+# Ignore errors in user commands.
+
+# Copyright (C) 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 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
+
+class IgnoreErrorsCommand (gdb.Command):
+ """Execute a single command, ignoring all errors.
+Only one-line commands are supported.
+This is primarily useful in scripts."""
+
+ def __init__ (self):
+ super (IgnoreErrorsCommand, self).__init__ ("ignore-errors",
+ gdb.COMMAND_OBSCURE,
+ # FIXME...
+ gdb.COMPLETE_COMMAND)
+
+ def invoke (self, arg, from_tty):
+ try:
+ gdb.execute (arg, from_tty)
+ except:
+ pass
+
+IgnoreErrorsCommand ()
diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/function/in_scope.py
@@ -0,0 +1,47 @@
+# In-scope function.
+
+# Copyright (C) 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 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
+
+class InScope (gdb.Function):
+ """Return True if all the given variables or macros are in scope.
+Takes one argument for each variable name to be checked."""
+
+ def __init__ (self):
+ super (InScope, self).__init__ ("in_scope")
+
+ def invoke (self, *vars):
+ if len (vars) == 0:
+ raise (TypeError, "in_scope takes at least one argument")
+
+ # gdb.Value isn't hashable so it can't be put in a map.
+ # Convert to string first.
+ wanted = set (map (lambda x: x.string (), vars))
+ found = set ()
+ block = gdb.selected_frame ().block ()
+ while block:
+ for sym in block:
+ if (sym.is_argument or sym.is_constant
+ or sym.is_function or sym.is_variable):
+ if sym.name in wanted:
+ found.add (sym.name)
+
+ block = block.superblock
+
+ return wanted == found
+
+InScope ()
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r
gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame"
+gdb_test "python print ('result = %s' % (f0.block ()))" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
+
# Can read SP register.
gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
" = True" \
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -419,6 +419,15 @@ proc test_value_after_death {} {
"print value's type"
}
+# Regression test for a cast failure. The bug was that if we cast a
+# value to its own type, gdb could crash. This happened because we
+# could end up double-freeing a struct value.
+proc test_cast_regression {} {
+ gdb_test "python v = gdb.Value(5)" "" "create value for cast test"
+ gdb_test "python v = v.cast(v.type)" "" "cast value for cast test"
+ gdb_test "python print(v)" "5" "print value for cast test"
+}
+
# Regression test for invalid subscript operations. The bug was that
# the type of the value was not being checked before allowing a
# subscript operation to proceed.
@@ -606,6 +615,7 @@ test_value_in_inferior
test_value_from_buffer
test_inferior_function_call
test_value_after_death
+test_cast_regression
# Test either C or C++ values.

View File

@ -1,356 +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-attach-fail-reasons-5of5.patch
;; Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878).
;;=push+jan
http://sourceware.org/ml/gdb-patches/2012-03/msg00171.html
Hi,
and here is the last bit for new SELinux 'deny_ptrace':
https://bugzilla.redhat.com/show_bug.cgi?id=786878
As even PTRACE_TRACEME fails in such case it needs to install hook for even
that event.
Thanks,
Jan
gdb/
2012-03-06 Jan Kratochvil <jan.kratochvil@redhat.com>
* common/linux-ptrace.c [HAVE_SELINUX_SELINUX_H]: include
selinux/selinux.h.
(linux_ptrace_attach_warnings): Call linux_ptrace_create_warnings.
(linux_ptrace_create_warnings): New.
* common/linux-ptrace.h (linux_ptrace_create_warnings): New declaration.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check selinux/selinux.h and the selinux library.
* inf-ptrace.c (inf_ptrace_me): Check the ptrace result.
* linux-nat.c (linux_nat_create_inferior): New variable ex. Wrap
to_create_inferior into TRY_CATCH, call linux_ptrace_create_warnings.
gdb/gdbserver/
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check selinux/selinux.h and the selinux library.
* linux-low.c (linux_traceme): New function.
(linux_create_inferior, linux_tracefork_child): Call it instead of
direct ptrace.
diff --git a/gdb/config.in b/gdb/config.in
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -253,6 +253,9 @@
/* Define if librpm library is being used. */
#undef HAVE_LIBRPM
+/* Define to 1 if you have the `selinux' library (-lselinux). */
+#undef HAVE_LIBSELINUX
+
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
@@ -388,6 +391,9 @@
/* Define to 1 if you have the `scm_new_smob' function. */
#undef HAVE_SCM_NEW_SMOB
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
+#undef HAVE_SELINUX_SELINUX_H
+
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
@@ -16861,6 +16861,64 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+for ac_header in selinux/selinux.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SELINUX_SELINUX_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lselinux $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char security_get_boolean_active ();
+int
+main ()
+{
+return security_get_boolean_active ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_selinux_security_get_boolean_active=yes
+else
+ ac_cv_lib_selinux_security_get_boolean_active=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSELINUX 1
+_ACEOF
+
+ LIBS="-lselinux $LIBS"
+
+fi
+
+
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
# except that the argument to --with-sysroot is optional.
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1900,6 +1900,10 @@ case $host_os in
esac
AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
+dnl Check security_get_boolean_active availability.
+AC_CHECK_HEADERS(selinux/selinux.h)
+AC_CHECK_LIB(selinux, security_get_boolean_active)
+
dnl Handle optional features that can be enabled.
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1103,7 +1103,16 @@ linux_nat_target::create_inferior (const char *exec_file,
/* Make sure we report all signals during startup. */
pass_signals ({});
- inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty);
+ try
+ {
+ inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty);
+ }
+ catch (const gdb_exception_error &ex)
+ {
+ std::string result = linux_ptrace_create_warnings ();
+
+ throw_error (ex.error, "%s%s", result.c_str (), ex.message->c_str ());
+ }
}
/* Callback for linux_proc_attach_tgid_threads. Attach to PTID if not
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -25,6 +25,10 @@
#include <sys/procfs.h>
#endif
+#ifdef HAVE_SELINUX_SELINUX_H
+# include <selinux/selinux.h>
+#endif /* HAVE_SELINUX_SELINUX_H */
+
/* Stores the ptrace options supported by the running kernel.
A value of -1 means we did not check for features yet. A value
of 0 means there are no supported features. */
@@ -50,6 +54,8 @@ linux_ptrace_attach_fail_reason (pid_t pid)
"terminated"),
(int) pid);
+ result += linux_ptrace_create_warnings ();
+
return result;
}
@@ -586,6 +592,25 @@ linux_ptrace_init_warnings (void)
linux_ptrace_test_ret_to_nx ();
}
+/* Print all possible reasons we could fail to create a traced process. */
+
+std::string
+linux_ptrace_create_warnings ()
+{
+ std::string result;
+
+#ifdef HAVE_LIBSELINUX
+ /* -1 is returned for errors, 0 if it has no effect, 1 if PTRACE_ATTACH is
+ forbidden. */
+ if (security_get_boolean_active ("deny_ptrace") == 1)
+ string_appendf (result,
+ _("the SELinux boolean 'deny_ptrace' is enabled, "
+ "you can disable this process attach protection by: "
+ "(gdb) shell sudo setsebool deny_ptrace=0\n"));
+#endif /* HAVE_LIBSELINUX */
+ return result;
+}
+
/* Extract extended ptrace event from wait status. */
int
diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
--- a/gdb/nat/linux-ptrace.h
+++ b/gdb/nat/linux-ptrace.h
@@ -184,6 +184,7 @@ extern std::string linux_ptrace_attach_fail_reason (pid_t pid);
extern std::string linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
extern void linux_ptrace_init_warnings (void);
+extern std::string linux_ptrace_create_warnings ();
extern void linux_check_ptrace_features (void);
extern void linux_enable_event_reporting (pid_t pid, int attached);
extern void linux_disable_event_reporting (pid_t pid);
diff --git a/gdbserver/config.in b/gdbserver/config.in
--- a/gdbserver/config.in
+++ b/gdbserver/config.in
@@ -143,6 +143,9 @@
/* Define if you have the ipt library. */
#undef HAVE_LIBIPT
+/* Define to 1 if you have the `selinux' library (-lselinux). */
+#undef HAVE_LIBSELINUX
+
/* Define if the target supports branch tracing. */
#undef HAVE_LINUX_BTRACE
@@ -249,6 +252,9 @@
/* Define to 1 if you have the `sbrk' function. */
#undef HAVE_SBRK
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
+#undef HAVE_SELINUX_SELINUX_H
+
/* Define to 1 if you have the `setns' function. */
#undef HAVE_SETNS
diff --git a/gdbserver/configure b/gdbserver/configure
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -10683,6 +10683,64 @@ if $want_ipa ; then
fi
fi
+for ac_header in selinux/selinux.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SELINUX_SELINUX_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lselinux $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char security_get_boolean_active ();
+int
+main ()
+{
+return security_get_boolean_active ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_selinux_security_get_boolean_active=yes
+else
+ ac_cv_lib_selinux_security_get_boolean_active=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSELINUX 1
+_ACEOF
+
+ LIBS="-lselinux $LIBS"
+
+fi
+
+
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -401,6 +401,10 @@ if $want_ipa ; then
fi
fi
+dnl Check security_get_boolean_active availability.
+AC_CHECK_HEADERS(selinux/selinux.h)
+AC_CHECK_LIB(selinux, security_get_boolean_active)
+
AC_SUBST(GDBSERVER_DEPFILES)
AC_SUBST(GDBSERVER_LIBS)
AC_SUBST(srv_xmlbuiltin)
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -932,7 +932,16 @@ linux_ptrace_fun ()
{
if (ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0,
(PTRACE_TYPE_ARG4) 0) < 0)
- trace_start_error_with_name ("ptrace");
+ {
+ int save_errno = errno;
+
+ std::string msg (linux_ptrace_create_warnings ());
+
+ msg += _("Cannot trace created process");
+
+ errno = save_errno;
+ trace_start_error_with_name (msg.c_str ());
+ }
if (setpgid (0, 0) < 0)
trace_start_error_with_name ("setpgid");

View File

@ -1,45 +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-btrobust.patch
;; Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
;;=push
This should fix the error with glib. An error message will still be
printed, but a default backtrace will occur in this case.
--
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -1204,6 +1204,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
htab_eq_pointer,
NULL));
+ int count_printed = 0;
while (true)
{
gdbpy_ref<> item (PyIter_Next (iterable.get ()));
@@ -1212,8 +1213,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
{
if (PyErr_Occurred ())
{
- gdbpy_print_stack_or_quit ();
- return EXT_LANG_BT_ERROR;
+ gdbpy_print_stack ();
+ return count_printed > 0 ? EXT_LANG_BT_ERROR : EXT_LANG_BT_NO_FILTERS;
}
break;
}
@@ -1245,7 +1246,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
/* Do not exit on error printing a single frame. Print the
error and continue with other frames. */
if (success == EXT_LANG_BT_ERROR)
- gdbpy_print_stack_or_quit ();
+ gdbpy_print_stack ();
+ count_printed++;
}
return success;

View File

@ -1,178 +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-bz1219747-attach-kills.patch
;; Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747).
;;=push+jan
http://sourceware.org/ml/gdb-patches/2015-10/msg00301.html
Hi,
in some cases with deleted main executable GDB will want to kill the inferior.
$ cp /bin/sleep /tmp/sleep;/tmp/sleep 1h&p=$!
$ rm /tmp/sleep
$ gdb /tmp/sleep $p
GNU gdb (GDB) 7.10.50.20151016-cvs
/tmp/sleep: No such file or directory.
Attaching to process 9694
/tmp/sleep (deleted): No such file or directory.
A program is being debugged already. Kill it? (y or n) _
The first attachment of "/tmp/sleep" commandline argument errors at:
267 if (scratch_chan < 0)
268 perror_with_name (filename);
1051 if (catch_command_errors_const (exec_file_attach, execarg,
1052 !batch_flag))
Then GDB tries to attach to the process $p:
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
This succeeds and since this moment GDB has a valid inferior. But despite that
the lines
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
still fail because consequently attach_command() fails to find the associated
executable file:
267 if (scratch_chan < 0)
268 perror_with_name (filename);
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
and therefore GDB executes the following:
(gdb) bt
2179 if (have_inferiors ())
2180 {
2181 if (!from_tty
2182 || !have_live_inferiors ()
2183 || query (_("A program is being debugged already. Kill it? ")))
2184 iterate_over_inferiors (dispose_inferior, NULL);
2185 else
2186 error (_("Program not killed."));
2187 }
1084 catch_command_errors (core_file_command, pid_or_core_arg,
1085 !batch_flag);
No regressions on {x86_64,x86_64-m32,i686}-fedora24pre-linux-gnu.
Thanks,
Jan
gdb/ChangeLog
2015-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
* main.c (captured_main): Run core_file_command for pid_or_core_arg
only if not have_inferiors ().
gdb/testsuite/ChangeLog
2015-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/attach-kills.c: New.
* gdb.base/attach-kills.exp: New.
diff --git a/gdb/main.c b/gdb/main.c
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1199,7 +1199,10 @@ captured_main_1 (struct captured_main_args *context)
{
ret = catch_command_errors (attach_command, pid_or_core_arg,
!batch_flag);
- if (ret == 0)
+ if (ret == 0
+ /* attach_command could succeed partially and core_file_command
+ would try to kill it. */
+ && !have_inferiors ())
ret = catch_command_errors (core_file_command,
pid_or_core_arg,
!batch_flag);
diff --git a/gdb/testsuite/gdb.base/attach-kills.c b/gdb/testsuite/gdb.base/attach-kills.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-kills.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2015 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 <unistd.h>
+
+int
+main (void)
+{
+ sleep (600);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/attach-kills.exp b/gdb/testsuite/gdb.base/attach-kills.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-kills.exp
@@ -0,0 +1,49 @@
+# Copyright (C) 2015 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 { ![can_spawn_for_attach] } {
+ return 0
+}
+
+standard_testfile
+
+if { [build_executable ${testfile}.exp $testfile] == -1 } {
+ return -1
+}
+
+# Start the program running and then wait for a bit, to be sure
+# that it can be attached to.
+
+set test_spawn_id [spawn_wait_for_attach $binfile]
+set testpid [spawn_id_get_pid $test_spawn_id]
+
+remote_exec target "cp -pf -- $binfile $binfile-copy"
+remote_exec target "rm -f -- $binfile"
+
+set test "start gdb"
+set res [gdb_spawn_with_cmdline_opts \
+ "-iex \"set height 0\" -iex \"set width 0\" /DoEsNoTeXySt $testpid"]
+if { $res != 0} {
+ fail "$test (spawn)"
+ kill_wait_spawned_process $test_spawn_id
+ return -1
+}
+gdb_test_multiple "" $test {
+ -re "\r\nAttaching to .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
+kill_wait_spawned_process $test_spawn_id

View File

@ -1,130 +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-bz533176-fortran-omp-step.patch
;; Fix stepping with OMP parallel Fortran sections (BZ 533176).
;;=push+jan: It requires some better DWARF annotations.
https://bugzilla.redhat.com/show_bug.cgi?id=533176#c4
I find it a bug in DWARF and gdb behaves correctly according to it. From the
current DWARF's point of view the is a function call which you skip by "next".
If you hide any /usr/lib/debug such as using:
gdb -nx -ex 'set debug-file-directory /qwe' -ex 'file ./tpcommon_gfortran44'
and use "step" command instead of "next" there it will work.
(You need to hide debuginfo from libgomp as you would step into libgomp sources
to maintain the threads for execution.)
There should be some DWARF extension for it, currently tried to detect
substring ".omp_fn." as this function is called "MAIN__.omp_fn.0" and do not
consider such sub-function as a skippable by "next".
Another problem is that with "set scheduler-locking" being "off" (default
upstream) or "step" (default in F/RHEL) the simultaneous execution of the
threads is inconvenient. Setting it to "on" will lockup the debugging as the
threads need to get synchronized at some point. This is a more general
debugging problem of GOMP outside of the scope of this Bug.
diff --git a/gdb/infrun.c b/gdb/infrun.c
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -6788,6 +6788,16 @@ process_event_stop_test (struct execution_control_state *ecs)
if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
{
+ struct symbol *stop_fn = find_pc_function (stop_pc);
+ struct minimal_symbol *stopf = lookup_minimal_symbol_by_pc (stop_pc).minsym;
+
+ if ((stop_fn == NULL
+ || strstr (stop_fn->linkage_name (), ".omp_fn.") == NULL)
+ /* gcc-4.7.2-9.fc19.x86_64 uses a new format. */
+ && (stopf == NULL
+ || strstr (stopf->linkage_name (), "._omp_fn.") == NULL))
+{ /* ".omp_fn." */
+
/* We're doing a "next".
Normal (forward) execution: set a breakpoint at the
@@ -6821,6 +6831,7 @@ process_event_stop_test (struct execution_control_state *ecs)
keep_going (ecs);
return;
+} /* ".omp_fn." */
}
/* If we are in a function call trampoline (a stub between the
diff --git a/gdb/testsuite/gdb.fortran/omp-step.exp b/gdb/testsuite/gdb.fortran/omp-step.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/omp-step.exp
@@ -0,0 +1,31 @@
+# Copyright 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/>.
+
+set testfile "omp-step"
+set srcfile ${testfile}.f90
+if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90 additional_flags=-fopenmp}] } {
+ return -1
+}
+
+if ![runto [gdb_get_line_number "start-here"]] {
+ perror "Couldn't run to start-here"
+ return 0
+}
+
+gdb_test "next" {!\$omp parallel} "step closer"
+gdb_test "next" {a\(omp_get_thread_num\(\) \+ 1\) = 1} "step into omp"
+
+gdb_breakpoint [gdb_get_line_number "success"]
+gdb_continue_to_breakpoint "success" ".*success.*"
diff --git a/gdb/testsuite/gdb.fortran/omp-step.f90 b/gdb/testsuite/gdb.fortran/omp-step.f90
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/omp-step.f90
@@ -0,0 +1,32 @@
+! Copyright 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/>.
+
+ use omp_lib
+ integer nthreads, i, a(1000)
+ nthreads = omp_get_num_threads()
+ if (nthreads .gt. 1000) call abort
+
+ do i = 1, nthreads
+ a(i) = 0
+ end do
+ print *, "start-here"
+!$omp parallel
+ a(omp_get_thread_num() + 1) = 1
+!$omp end parallel
+ do i = 1, nthreads
+ if (a(i) .ne. 1) call abort
+ end do
+ print *, "success"
+ end

View File

@ -233,11 +233,11 @@ new file mode 100644
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+ return 0
+}
+
+if {![istarget x86_64-*]} {
+ return 0
+ return 0
+}
+
+set testfile "rh-dwarf4-x86_64"

View File

@ -38,4 +38,4 @@ new file mode 100644
+# 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"
+gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists"

View File

@ -9,8 +9,8 @@ Subject: gdb-ccache-workaround.patch
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
--- a/gdb/testsuite/gdb.base/macscp.exp
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -25,6 +25,14 @@ if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
lappend options additional_flags=-g3
@@ -27,6 +27,14 @@ if { [test_compiler_info "gcc-*"] } {
lappend options additional_flags=-fdebug-macro
}
+# Workaround ccache making lineno non-zero for command-line definitions.

View File

@ -1,56 +0,0 @@
diff -Nrup a/gnulib/import/m4/alloca.m4 b/gnulib/import/m4/alloca.m4
--- a/gnulib/import/m4/alloca.m4 2019-11-18 18:49:20.000000000 -0700
+++ b/gnulib/import/m4/alloca.m4 2020-01-11 01:07:36.200483085 -0700
@@ -89,7 +89,7 @@ AC_CACHE_CHECK([stack direction for C al
[ac_cv_c_stack_direction],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[AC_INCLUDES_DEFAULT
-int
+__attribute__ (noinline,noclone)) int
find_stack_direction (int *addr, int depth)
{
int dir, dummy = 0;
diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
--- a/libiberty/aclocal.m4 2019-01-19 09:01:34.000000000 -0700
+++ b/libiberty/aclocal.m4 2020-01-09 22:00:27.183312982 -0700
@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then
fi
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
-[AC_TRY_RUN([find_stack_direction ()
+[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction ()
{
static char *addr = 0;
auto char dummy;
diff --git a/config/intdiv0.m4 b/config/intdiv0.m4
index 55dddcf1..ba906efc 100644
--- a/config/intdiv0.m4
+++ b/config/intdiv0.m4
@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig;
exit (sig != SIGFPE);
}
-int x = 1;
-int y = 0;
-int z;
-int nan;
+volatile int x = 1;
+volatile int y = 0;
+volatile int z;
+volatile int nan;
int main ()
{
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index f1ce7601..fc20d228 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then
for v in $vars; do
AC_MSG_CHECKING([for $v])
AC_CACHE_VAL(libiberty_cv_var_$v,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])],
[eval "libiberty_cv_var_$v=yes"],
[eval "libiberty_cv_var_$v=no"])])
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then

View File

@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch
diff --git a/gdb/remote.c b/gdb/remote.c
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -14031,7 +14031,17 @@ remote_target::pid_to_exec_file (int pid)
@@ -14343,7 +14343,17 @@ remote_target::pid_to_exec_file (int pid)
char *annex = NULL;
if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE)

View File

@ -27,7 +27,7 @@ diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/so
if [get_compiler_info] {
return -1
@@ -71,8 +72,26 @@ gdb_test "br foo2" \
@@ -70,8 +71,26 @@ gdb_test "br foo2" \
"Breakpoint.*: foo2. .2 locations..*" \
"foo2 in mdlib"

View File

@ -1,315 +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-dts-rhel6-python-compat.patch
;; [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon).
;;=fedora
https://bugzilla.redhat.com/show_bug.cgi?id=1020004
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -71,6 +71,8 @@ PYTHON_FILE_LIST = \
gdb/__init__.py \
gdb/FrameDecorator.py \
gdb/FrameIterator.py \
+ gdb/FrameWrapper.py \
+ gdb/backtrace.py \
gdb/frames.py \
gdb/printing.py \
gdb/prompt.py \
@@ -79,6 +81,7 @@ PYTHON_FILE_LIST = \
gdb/xmethod.py \
gdb/command/__init__.py \
gdb/command/explore.py \
+ gdb/command/backtrace.py \
gdb/command/frame_filters.py \
gdb/command/pretty_printers.py \
gdb/command/prompt.py \
diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/FrameWrapper.py
@@ -0,0 +1,122 @@
+# Wrapper API for frames.
+
+# Copyright (C) 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/>.
+
+import gdb
+
+# FIXME: arguably all this should be on Frame somehow.
+class FrameWrapper:
+ def __init__ (self, frame):
+ self.frame = frame;
+
+ def write_symbol (self, stream, sym, block):
+ if len (sym.linkage_name):
+ nsym, is_field_of_this = gdb.lookup_symbol (sym.linkage_name, block)
+ if nsym.addr_class != gdb.SYMBOL_LOC_REGISTER:
+ sym = nsym
+
+ stream.write (sym.print_name + "=")
+ try:
+ val = self.read_var (sym)
+ if val != None:
+ val = str (val)
+ # FIXME: would be nice to have a more precise exception here.
+ except RuntimeError as text:
+ val = text
+ if val == None:
+ stream.write ("???")
+ else:
+ stream.write (str (val))
+
+ def print_frame_locals (self, stream, func):
+
+ try:
+ block = self.frame.block()
+ except RuntimeError:
+ block = None
+
+ while block != None:
+ if block.is_global or block.is_static:
+ break
+
+ for sym in block:
+ if sym.is_argument:
+ continue;
+
+ self.write_symbol (stream, sym, block)
+ stream.write ('\n')
+
+ def print_frame_args (self, stream, func):
+
+ try:
+ block = self.frame.block()
+ except RuntimeError:
+ block = None
+
+ while block != None:
+ if block.function != None:
+ break
+ block = block.superblock
+
+ first = True
+ for sym in block:
+ if not sym.is_argument:
+ continue;
+
+ if not first:
+ stream.write (", ")
+
+ self.write_symbol (stream, sym, block)
+ first = False
+
+ # FIXME: this should probably just be a method on gdb.Frame.
+ # But then we need stream wrappers.
+ def describe (self, stream, full):
+ if self.type () == gdb.DUMMY_FRAME:
+ stream.write (" <function called from gdb>\n")
+ elif self.type () == gdb.SIGTRAMP_FRAME:
+ stream.write (" <signal handler called>\n")
+ else:
+ sal = self.find_sal ()
+ pc = self.pc ()
+ name = self.name ()
+ if not name:
+ name = "??"
+ if pc != sal.pc or not sal.symtab:
+ stream.write (" 0x%08x in" % pc)
+ stream.write (" " + name + " (")
+
+ func = self.function ()
+ self.print_frame_args (stream, func)
+
+ stream.write (")")
+
+ if sal.symtab and sal.symtab.filename:
+ stream.write (" at " + sal.symtab.filename)
+ stream.write (":" + str (sal.line))
+
+ if not self.name () or (not sal.symtab or not sal.symtab.filename):
+ lib = gdb.solib_name (pc)
+ if lib:
+ stream.write (" from " + lib)
+
+ stream.write ("\n")
+
+ if full:
+ self.print_frame_locals (stream, func)
+
+ def __getattr__ (self, name):
+ return getattr (self.frame, name)
diff --git a/gdb/python/lib/gdb/backtrace.py b/gdb/python/lib/gdb/backtrace.py
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/backtrace.py
@@ -0,0 +1,42 @@
+# Filtering backtrace.
+
+# Copyright (C) 2008, 2011 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
+import itertools
+
+# Our only exports.
+__all__ = ['push_frame_filter', 'create_frame_filter']
+
+old_frame_filter = None
+
+def push_frame_filter (constructor):
+ """Register a new backtrace filter class with the 'backtrace' command.
+The filter will be passed an iterator as an argument. The iterator
+will return gdb.Frame-like objects. The filter should in turn act as
+an iterator returning such objects."""
+ global old_frame_filter
+ if old_frame_filter == None:
+ old_frame_filter = constructor
+ else:
+ old_frame_filter = lambda iterator, filter = frame_filter: constructor (filter(iterator))
+
+def create_frame_filter (iter):
+ global old_frame_filter
+ if old_frame_filter is None:
+ return iter
+ return old_frame_filter (iter)
+
diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/command/backtrace.py
@@ -0,0 +1,106 @@
+# New backtrace command.
+
+# Copyright (C) 2008, 2009, 2011 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
+import gdb.backtrace
+import itertools
+from gdb.FrameIterator import FrameIterator
+from gdb.FrameWrapper import FrameWrapper
+import sys
+
+class ReverseBacktraceParameter (gdb.Parameter):
+ """The new-backtrace command can show backtraces in 'reverse' order.
+This means that the innermost frame will be printed last.
+Note that reverse backtraces are more expensive to compute."""
+
+ set_doc = "Enable or disable reverse backtraces."
+ show_doc = "Show whether backtraces will be printed in reverse order."
+
+ def __init__(self):
+ gdb.Parameter.__init__ (self, "reverse-backtrace",
+ gdb.COMMAND_STACK, gdb.PARAM_BOOLEAN)
+ # Default to compatibility with gdb.
+ self.value = False
+
+class FilteringBacktrace (gdb.Command):
+ """Print backtrace of all stack frames, or innermost COUNT frames.
+With a negative argument, print outermost -COUNT frames.
+Use of the 'full' qualifier also prints the values of the local variables.
+Use of the 'raw' qualifier avoids any filtering by loadable modules.
+"""
+
+ def __init__ (self):
+ # FIXME: this is not working quite well enough to replace
+ # "backtrace" yet.
+ gdb.Command.__init__ (self, "new-backtrace", gdb.COMMAND_STACK)
+ self.reverse = ReverseBacktraceParameter()
+
+ def reverse_iter (self, iter):
+ result = []
+ for item in iter:
+ result.append (item)
+ result.reverse()
+ return result
+
+ def final_n (self, iter, x):
+ result = []
+ for item in iter:
+ result.append (item)
+ return result[x:]
+
+ def invoke (self, arg, from_tty):
+ i = 0
+ count = 0
+ filter = True
+ full = False
+
+ for word in arg.split (" "):
+ if word == '':
+ continue
+ elif word == 'raw':
+ filter = False
+ elif word == 'full':
+ full = True
+ else:
+ count = int (word)
+
+ # FIXME: provide option to start at selected frame
+ # However, should still number as if starting from newest
+ newest_frame = gdb.newest_frame()
+ iter = itertools.imap (FrameWrapper,
+ FrameIterator (newest_frame))
+ if filter:
+ iter = gdb.backtrace.create_frame_filter (iter)
+
+ # Now wrap in an iterator that numbers the frames.
+ iter = itertools.izip (itertools.count (0), iter)
+
+ # Reverse if the user wanted that.
+ if self.reverse.value:
+ iter = self.reverse_iter (iter)
+
+ # Extract sub-range user wants.
+ if count < 0:
+ iter = self.final_n (iter, count)
+ elif count > 0:
+ iter = itertools.islice (iter, 0, count)
+
+ for pair in iter:
+ sys.stdout.write ("#%-2d" % pair[0])
+ pair[1].describe (sys.stdout, full)
+
+FilteringBacktrace()

View File

@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
@@ -9649,6 +9649,7 @@ if test x"$prefer_curses" = xyes; then
@@ -9567,6 +9567,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.
@ -20,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure
{ $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 :
@@ -9673,7 +9674,7 @@ return waddstr ();
@@ -9591,7 +9592,7 @@ return waddstr ();
return 0;
}
_ACEOF
@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -9747,6 +9748,7 @@ case $host_os in
@@ -9665,6 +9666,7 @@ case $host_os in
esac
# These are the libraries checked by Readline.
@ -37,7 +37,7 @@ diff --git a/gdb/configure b/gdb/configure
{ $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 :
@@ -9771,7 +9773,7 @@ return tgetent ();
@@ -9689,7 +9691,7 @@ return tgetent ();
return 0;
}
_ACEOF
@ -49,7 +49,7 @@ diff --git a/gdb/configure b/gdb/configure
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -712,7 +712,8 @@ if test x"$prefer_curses" = xyes; then
@@ -713,7 +713,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.
@ -59,7 +59,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
if test "$ac_cv_search_waddstr" != no; then
curses_found=yes
@@ -754,7 +755,8 @@ case $host_os in
@@ -755,7 +756,8 @@ case $host_os in
esac
# These are the libraries checked by Readline.

View File

@ -39,15 +39,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+standard_testfile .f90
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
@ -67,7 +67,7 @@ new file mode 100644
+
+# Fix rejected upstream:
+# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html
+setup_kfail "rejected" *-*-*
+setup_kfail "rejected" *-*-*
+gdb_test "frame" { \(s='foo', .*}
diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
new file mode 100644

View File

@ -10,7 +10,7 @@ diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsu
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
@@ -0,0 +1,115 @@
@@ -0,0 +1,119 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -56,6 +56,10 @@ new file mode 100644
+ untested "$test (no DWARF)"
+ return 0
+ }
+ -re "type = <unknown return type> \\(\\)\r\n$gdb_prompt $" {
+ untested "$test (no DWARF)"
+ return 0
+ }
+}
+
+set addr ""
@ -124,5 +128,5 @@ new file mode 100644
+ }
+}
+
+gdb_test {print strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
+gdb_test {print strstr("def","e")} { = 0x[0-9a-f]+ "ef"}
+gdb_test {print (char *)strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
+gdb_test {print (char *)strstr("def","e")} { = 0x[0-9a-f]+ "ef"}

View File

@ -1,219 +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-gnat-dwarf-crash-3of3.patch
;; Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211).
;;=push+jan
http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
PR 16581:
GDB crash on inherit_abstract_dies infinite recursion
https://sourceware.org/bugzilla/show_bug.cgi?id=16581
fixed crash from an infinite recursion. But in rare cases the new code can
now gdb_assert() due to weird DWARF file.
I do not yet fully understand why the DWARF is as it is but just GDB should
never crash due to invalid DWARF anyway. The "invalid" DWARF I see only in
Fedora GCC build, not in FSF GCC build, more info at:
https://bugzilla.redhat.com/show_bug.cgi?id=1069382
http://people.redhat.com/jkratoch/gcc-debuginfo-4.8.2-7.fc20.x86_64-gnatbind.debug
Thanks,
Jan
--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="complaint.patch"
gdb/
2014-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2read.c (process_die): Change gdb_assert to complaint.
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -10162,6 +10162,13 @@ class process_die_scope
static void
process_die (struct die_info *die, struct dwarf2_cu *cu)
{
+ if (die->in_process)
+ {
+ complaint (_("DIE at 0x%s attempted to be processed twice"),
+ sect_offset_str (die->sect_off));
+ return;
+ }
+
process_die_scope scope (die, cu);
switch (die->tag)
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -190,6 +190,12 @@ struct linux_nat_target *linux_target;
/* Does the current host support PTRACE_GETREGSET? */
enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN;
+#ifdef NEED_DETACH_SIGSTOP
+/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */
+static pid_t pid_was_stopped;
+
+#endif
+
static unsigned int debug_linux_nat;
static void
show_debug_linux_nat (struct ui_file *file, int from_tty,
@@ -1044,6 +1050,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled)
if (linux_proc_pid_is_stopped (pid))
{
linux_nat_debug_printf ("Attaching to a stopped process");
+#ifdef NEED_DETACH_SIGSTOP
+ pid_was_stopped = ptid.pid ();
+#endif
/* The process is definitely stopped. It is in a job control
stop, unless the kernel predates the TASK_STOPPED /
@@ -1359,6 +1368,25 @@ get_detach_signal (struct lwp_info *lp)
return gdb_signal_to_host (signo);
}
+#ifdef NEED_DETACH_SIGSTOP
+ /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
+ many TIDs are left unstopped). See RH Bug 496732. */
+ if (lp->ptid.pid () == pid_was_stopped)
+ {
+ int err;
+
+ errno = 0;
+ err = kill_lwp (lp->ptid.lwp (), SIGSTOP);
+ if (debug_linux_nat)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "SC: lwp kill %d %s\n",
+ err,
+ errno ? safe_strerror (errno) : "ERRNO-OK");
+ }
+ }
+
+#endif
return 0;
}
@@ -1502,6 +1530,10 @@ linux_nat_target::detach (inferior *inf, int from_tty)
detach_one_lwp (main_lwp, &signo);
detach_success (inf);
+
+#ifdef NEED_DETACH_SIGSTOP
+ pid_was_stopped = 0;
+#endif
}
}
@@ -1744,6 +1776,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
return;
}
+#ifdef NEED_DETACH_SIGSTOP
+ /* At this point, we are going to resume the inferior and if we
+ have attached to a stopped process, we no longer should leave
+ it as stopped if the user detaches. PTID variable has PID set to LWP
+ while we need to check the real PID here. */
+
+ if (!step && lp && pid_was_stopped == lp->ptid.pid ())
+ pid_was_stopped = 0;
+
+#endif
if (resume_many)
iterate_over_lwps (ptid, [=] (struct lwp_info *info)
{
@@ -3617,6 +3659,10 @@ linux_nat_target::mourn_inferior ()
/* Let the arch-specific native code know this process is gone. */
linux_target->low_forget_process (pid);
+#ifdef NEED_DETACH_SIGSTOP
+
+ pid_was_stopped = 0;
+#endif
}
/* Convert a native/host siginfo object, into/from the siginfo in the
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp
--- a/gdb/testsuite/gdb.threads/attach-stopped.exp
+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp
@@ -56,7 +56,65 @@ proc corefunc { threadtype } {
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
- # Verify that we can attach to the stopped process.
+ # Verify that we can attach to the process by first giving its
+ # executable name via the file command, and using attach with the
+ # process ID.
+
+ set test "$threadtype: set file, before attach1 to stopped process"
+ gdb_test_multiple "file $binfile" "$test" {
+ -re "Load new symbol table from.*y or n. $" {
+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
+ "$test (re-read)"
+ }
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
+ pass "$test"
+ }
+ }
+
+ set test "$threadtype: attach1 to stopped, after setting file"
+ gdb_test_multiple "attach $testpid" "$test" {
+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
+ pass "$test"
+ }
+ }
+
+ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there.
+ if {[string equal $threadtype threaded]} {
+ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt"
+ } else {
+ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt"
+ }
+
+ # Exit and detach the process.
+
+ gdb_exit
+
+ # Avoid some race:
+ sleep 2
+
+ if [catch {open /proc/${testpid}/status r} fileid] {
+ set line2 "NOTFOUND"
+ } else {
+ gets $fileid line1;
+ gets $fileid line2;
+ close $fileid;
+ }
+
+ set test "$threadtype: attach1, exit leaves process stopped"
+ if {[string match "*(stopped)*" $line2]} {
+ pass $test
+ } else {
+ fail $test
+ }
+
+ # At this point, the process should still be stopped
+
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ # Verify that we can attach to the process just by giving the
+ # process ID.
set test "$threadtype: attach2 to stopped, after setting file"
gdb_test_multiple "attach $testpid" "$test" {

View File

@ -1,46 +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-jit-reader-multilib.patch
;; Fix jit-reader.h for multi-lib.
;;=push+jan
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
@@ -9968,10 +9968,12 @@ _ACEOF
-if test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
- TARGET_PTR="unsigned long"
-elif test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
+# Try to keep TARGET_PTR the same across archs so that jit-reader.h file
+# content is the same for multilib distributions.
+if test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
TARGET_PTR="unsigned long long"
+elif test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
+ TARGET_PTR="unsigned long"
elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
TARGET_PTR="unsigned __int128"
else
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -803,10 +803,12 @@ AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(unsigned __int128)
-if test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
- TARGET_PTR="unsigned long"
-elif test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
+# Try to keep TARGET_PTR the same across archs so that jit-reader.h file
+# content is the same for multilib distributions.
+if test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
TARGET_PTR="unsigned long long"
+elif test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
+ TARGET_PTR="unsigned long"
elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
TARGET_PTR="unsigned __int128"
else

View File

@ -64,10 +64,10 @@ new file mode 100644
+
+/* DW_AT_low_pc-DW_AT_high_pc should cover the function without line number
+ information (.debug_line) so we cannot use an external object file.
+
+
+ It must not be just a label as it would alias on the next function even for
+ correct GDB. Therefore some stub data must be placed there.
+
+
+ We need to provide a real stub function body as at least s390
+ (s390_analyze_prologue) would skip the whole body till reaching `main'. */
+

View File

@ -213,7 +213,7 @@ diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
--- a/gdbsupport/common.m4
+++ b/gdbsupport/common.m4
@@ -145,7 +145,7 @@ AC_DEFUN([GDB_AC_COMMON], [
@@ -156,7 +156,7 @@ AC_DEFUN([GDB_AC_COMMON], [
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
#include <linux/perf_event.h>
#ifndef PERF_ATTR_SIZE_VER5

View File

@ -1,25 +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-moribund-utrace-workaround.patch
;; Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623).
;;=push+jan: Currently it is still not fully safe.
https://bugzilla.redhat.com/show_bug.cgi?id=590623
http://sources.redhat.com/bugzilla/show_bug.cgi?id=11593
Bug in FSF GDB exploited by the ptrace-on-utrace interaction.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -11948,6 +11948,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
= 3 * (thread_count (proc_target) + 1);
else
old_loc->events_till_retirement = 1;
+ /* Red Hat Bug 590623. */
+ old_loc->events_till_retirement *= 10;
old_loc->owner = NULL;
moribund_locations.push_back (old_loc);

View File

@ -12,7 +12,7 @@ diff --git a/gdb/testsuite/gdb.cp/pr11734-1.cc b/gdb/testsuite/gdb.cp/pr11734-1.
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734-1.cc
@@ -0,0 +1,30 @@
@@ -0,0 +1,29 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -42,12 +42,11 @@ new file mode 100644
+ p->foo ();
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.cp/pr11734-2.cc b/gdb/testsuite/gdb.cp/pr11734-2.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734-2.cc
@@ -0,0 +1,27 @@
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -74,12 +73,11 @@ new file mode 100644
+pr11734::foo(void)
+{
+}
+
diff --git a/gdb/testsuite/gdb.cp/pr11734-3.cc b/gdb/testsuite/gdb.cp/pr11734-3.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734-3.cc
@@ -0,0 +1,27 @@
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -106,12 +104,11 @@ new file mode 100644
+pr11734::foo (int a)
+{
+}
+
diff --git a/gdb/testsuite/gdb.cp/pr11734-4.cc b/gdb/testsuite/gdb.cp/pr11734-4.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734-4.cc
@@ -0,0 +1,27 @@
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -138,7 +135,6 @@ new file mode 100644
+pr11734::foo (char *a)
+{
+}
+
diff --git a/gdb/testsuite/gdb.cp/pr11734.exp b/gdb/testsuite/gdb.cp/pr11734.exp
new file mode 100644
--- /dev/null
@ -203,7 +199,7 @@ diff --git a/gdb/testsuite/gdb.cp/pr11734.h b/gdb/testsuite/gdb.cp/pr11734.h
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734.h
@@ -0,0 +1,28 @@
@@ -0,0 +1,27 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -231,4 +227,3 @@ new file mode 100644
+ void foo (int);
+ void foo (char *);
+};
+

View File

@ -25,7 +25,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test PowerPC Power7 instructions disassembly.
+
@ -48,7 +48,7 @@ new file mode 100644
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${objfile}
+
+
+
+# Disassemble the function.
+

View File

@ -81,7 +81,7 @@ diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c b/gdb/tes
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c
@@ -0,0 +1,124 @@
@@ -0,0 +1,125 @@
+/* Testcase for recursive dlopen calls.
+
+ Copyright (C) 2014 Free Software Foundation, Inc.
@ -178,6 +178,7 @@ new file mode 100644
+ /* Called recursively. */
+ result = malloc (size);
+ /* Restore new hooks. */
+ old_malloc_hook = __malloc_hook;
+ __malloc_hook = custom_malloc_hook;
+ return result;
+}
@ -210,7 +211,7 @@ diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp b/gdb/t
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
@@ -0,0 +1,137 @@
@@ -0,0 +1,157 @@
+# Copyright 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
@ -226,8 +227,12 @@ 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_shlib_tests] } {
+ return 0
+if {[skip_shlib_tests]} {
+ untested "skipping shlib tests"
+ return 0
+} elseif {[use_gdb_stub]} {
+ untested "skipping tests because of stub"
+ return 0
+}
+
+# Library foo
@ -262,6 +267,21 @@ new file mode 100644
+ 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]"
@ -314,6 +334,7 @@ new file mode 100644
+ 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" {

View File

@ -73,7 +73,7 @@ new file mode 100644
+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"
+ untested "s390* does not support hw read watchpoint"
+ return
+}
+gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4"

View File

@ -42,22 +42,24 @@ diff --git a/gdb/testsuite/gdb.python/py-typeprint.exp b/gdb/testsuite/gdb.pytho
diff --git a/gdb/testsuite/gdb.python/py-typeprint.py b/gdb/testsuite/gdb.python/py-typeprint.py
--- a/gdb/testsuite/gdb.python/py-typeprint.py
+++ b/gdb/testsuite/gdb.python/py-typeprint.py
@@ -15,7 +15,7 @@
@@ -15,8 +15,7 @@
import gdb
-
-class Recognizer(object):
+class StringRecognizer(object):
def __init__(self):
self.enabled = True
@@ -30,6 +30,26 @@ class StringTypePrinter(object):
@@ -32,7 +31,27 @@ class StringTypePrinter(object):
self.enabled = True
def instantiate(self):
- return Recognizer()
+ return StringRecognizer()
gdb.type_printers.append(StringTypePrinter())
+
+class OtherRecognizer(object):

View File

@ -428,7 +428,7 @@ new file mode 100644
+
+if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
+ return
+}
+}
+
+standard_testfile
+

View File

@ -203,7 +203,7 @@ new file mode 100644
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+ return 0
+}
+
+set testfile "dw2-aranges"

View File

@ -57,21 +57,21 @@ new file mode 100644
+ vcvtps2ph $0x2,%ymm4,%xmm4
+ vcvtps2ph $0x2,%ymm8,(%r8)
+ vcvtps2ph $0x2,%xmm4,%xmm4
+ vcvtps2ph $0x2,%xmm4,(%rcx)
+ vcvtps2ph $0x2,%xmm4,(%rcx)
+
+ .intel_syntax noprefix
+ vcvtph2ps ymm4,xmm4
+ vcvtph2ps ymm8,XMMWORD PTR [r8]
+ vcvtph2ps ymm4,[rcx]
+ vcvtph2ps xmm6,xmm4
+ vcvtph2ps xmm4,QWORD PTR [rcx]
+ vcvtph2ps xmm4,QWORD PTR [rcx]
+ vcvtph2ps xmm4,[rcx]
+ vcvtps2ph xmm4,ymm4,0x2
+ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2
+ vcvtps2ph [rcx],ymm4,0x2
+ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2
+ vcvtps2ph [rcx],ymm4,0x2
+ vcvtps2ph xmm4,xmm4,0x2
+ vcvtps2ph QWORD PTR [r8],xmm8,0x2
+ vcvtps2ph [rcx],xmm4,0x2
+ vcvtps2ph QWORD PTR [r8],xmm8,0x2
+ vcvtps2ph [rcx],xmm4,0x2
+
+/* gas/i386/x86-64-fsgs.s */
+ .att_syntax prefix
@ -80,34 +80,34 @@ new file mode 100644
+ rdfsbase %r8d
+ rdfsbase %r8
+ rdgsbase %ebx
+ rdgsbase %rbx
+ rdgsbase %r8d
+ rdgsbase %r8
+ wrfsbase %ebx
+ wrfsbase %rbx
+ wrfsbase %r8d
+ wrfsbase %r8
+ wrgsbase %ebx
+ wrgsbase %rbx
+ wrgsbase %r8d
+ wrgsbase %r8
+ rdgsbase %rbx
+ rdgsbase %r8d
+ rdgsbase %r8
+ wrfsbase %ebx
+ wrfsbase %rbx
+ wrfsbase %r8d
+ wrfsbase %r8
+ wrgsbase %ebx
+ wrgsbase %rbx
+ wrgsbase %r8d
+ wrgsbase %r8
+
+ .intel_syntax noprefix
+ rdfsbase ebx
+ rdfsbase rbx
+ rdfsbase r8d
+ rdfsbase ebx
+ rdfsbase rbx
+ rdfsbase r8d
+ rdfsbase r8
+ rdgsbase ebx
+ rdgsbase rbx
+ rdgsbase r8d
+ rdgsbase ebx
+ rdgsbase rbx
+ rdgsbase r8d
+ rdgsbase r8
+ wrfsbase ebx
+ wrfsbase rbx
+ wrfsbase r8d
+ wrfsbase ebx
+ wrfsbase rbx
+ wrfsbase r8d
+ wrfsbase r8
+ wrgsbase ebx
+ wrgsbase rbx
+ wrgsbase r8d
+ wrgsbase ebx
+ wrgsbase rbx
+ wrgsbase r8d
+ wrgsbase r8
diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp
new file mode 100644
@ -136,7 +136,7 @@ new file mode 100644
+set testfile amd64-ivy-bridge
+set test compilation
+if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m64 -nostdlib"]] {
+ fail $test
+ unsupported $test
+ return -1
+}
+pass $test
@ -288,7 +288,7 @@ diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.S b/gdb/testsuite/gdb.arch/i
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/i386-ivy-bridge.S
@@ -0,0 +1,67 @@
@@ -0,0 +1,66 @@
+/* Copyright 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
@ -325,23 +325,23 @@ new file mode 100644
+ vcvtph2ps %xmm4,%xmm6
+ vcvtph2ps (%ecx),%xmm4
+ vcvtps2ph $0x2,%ymm4,%xmm4
+ vcvtps2ph $0x2,%ymm4,(%ecx)
+ vcvtps2ph $0x2,%ymm4,(%ecx)
+ vcvtps2ph $0x2,%xmm4,%xmm4
+ vcvtps2ph $0x2,%xmm4,(%ecx)
+ vcvtps2ph $0x2,%xmm4,(%ecx)
+
+ .intel_syntax noprefix
+ vcvtph2ps ymm4,xmm4
+ vcvtph2ps ymm4,XMMWORD PTR [ecx]
+ vcvtph2ps ymm4,[ecx]
+ vcvtph2ps xmm6,xmm4
+ vcvtph2ps xmm4,QWORD PTR [ecx]
+ vcvtph2ps xmm4,QWORD PTR [ecx]
+ vcvtph2ps xmm4,[ecx]
+ vcvtps2ph xmm4,ymm4,0x2
+ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2
+ vcvtps2ph [ecx],ymm4,0x2
+ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2
+ vcvtps2ph [ecx],ymm4,0x2
+ vcvtps2ph xmm4,xmm4,0x2
+ vcvtps2ph QWORD PTR [ecx],xmm4,0x2
+ vcvtps2ph [ecx],xmm4,0x2
+ vcvtps2ph QWORD PTR [ecx],xmm4,0x2
+ vcvtps2ph [ecx],xmm4,0x2
+
+/* gas/i386/fsgs.s */
+ .att_syntax prefix
@ -351,11 +351,10 @@ new file mode 100644
+ wrgsbase %ebx
+
+ .intel_syntax noprefix
+ rdfsbase ebx
+ rdgsbase ebx
+ wrfsbase ebx
+ wrgsbase ebx
+
+ rdfsbase ebx
+ rdgsbase ebx
+ wrfsbase ebx
+ wrgsbase ebx
diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp b/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp
new file mode 100644
--- /dev/null

View File

@ -45,22 +45,22 @@ new file mode 100644
+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp
@@ -0,0 +1,46 @@
+# This testcase is part of GDB, the GNU debugger.
+#
+#
+# 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 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Some kernel core files have PID 0 - for the idle task.
+

View File

@ -1,59 +0,0 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Thu, 7 Dec 2017 16:20:31 -0500
Subject: gdb-vla-intel-fix-print-char-array.patch
;; Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd
Revert commit (only the part touching gdb/f-valprint.c):
commit 469412dd9ccc4de5874fd3299b105833f36b34cd
Author: Christoph Weinmann <christoph.t.weinmann@intel.com>
Date: Fri Sep 8 15:11:47 2017 +0200
Remove C/C++ relevant code in Fortran specific file.
Remove code relevant for printing C/C++ Integer values in a
Fortran specific file to unify printing of Fortran values.
This does not change the output.
And adjust its testcase.
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -310,7 +310,21 @@ f_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
value_print_scalar_formatted (val, &opts, 0, stream);
}
else
- value_print_scalar_formatted (val, options, 0, stream);
+ {
+ value_print_scalar_formatted (val, options, 0, stream);
+ /* C and C++ has no single byte int type, char is used instead.
+ Since we don't know whether the value is really intended to
+ be used as an integer or a character, print the character
+ equivalent as well. */
+ if (TYPE_LENGTH (type) == 1)
+ {
+ LONGEST c;
+
+ fputs_filtered (" ", stream);
+ c = unpack_long (type, valaddr);
+ LA_PRINT_CHAR ((unsigned char) c, type, stream);
+ }
+ }
break;
case TYPE_CODE_STRUCT:
diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp
--- a/gdb/testsuite/gdb.fortran/printing-types.exp
+++ b/gdb/testsuite/gdb.fortran/printing-types.exp
@@ -30,7 +30,7 @@ if {![fortran_runto_main]} then {
gdb_breakpoint [gdb_get_line_number "write"]
gdb_continue_to_breakpoint "write"
-gdb_test "print oneByte" " = 1"
+gdb_test "print oneByte" " = 1 \'\\\\001\'"
gdb_test "print twobytes" " = 2"
gdb_test "print chvalue" " = \'a\'"
gdb_test "print logvalue" " = \.TRUE\."

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,167 +0,0 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 1 Aug 2014 23:02:17 +0200
Subject: gdb-vla-intel-stringbt-fix.patch
;;=push+jan
http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote:
> I just tried it on Fedora 20 i686. Applied the patch, you mentioned, on top of
> the Fortran VLA series and executed your dynamic-other-frame test. Everything
> is working fine here, I cannot reproduce the crash.
I have it reproducible on Fedora 20 i686 with plain
CFLAGS=-g ./configure;make;cd gdb/testsuite;make site.exp;runtest gdb.fortran/dynamic-other-frame.exp
Besides that I have updated the testcase with
gdb_test_no_output "set print frame-arguments all"
so that there is no longer needed the patch:
[patch] Display Fortran strings in backtraces
https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
The fix below has no regressions for me. Unfortunately I do not see why you
cannot reproduce it.
Thanks,
Jan
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -2249,6 +2249,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
ctx.per_cu = per_cu;
ctx.obj_address = 0;
+frame_id old_frame_id (get_frame_id (deprecated_safe_get_selected_frame ()));
+class RestoreCall {
+private:
+ const std::function<void ()> func;
+public:
+ RestoreCall(std::function<void ()> func_):func(func_) {}
+ ~RestoreCall() { func(); }
+} restore_frame([=]() {
+ frame_info *old_frame (frame_find_by_id (old_frame_id));
+ if (old_frame != NULL)
+ select_frame (old_frame);
+});
+if (frame != NULL) select_frame (frame);
+
scoped_value_mark free_values;
ctx.gdbarch = per_objfile->objfile->arch ();
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
@@ -0,0 +1,24 @@
+! 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 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.
+!
+! Ihis file is the Fortran source file for dynamic.exp.
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+subroutine bar
+ real :: dummy
+ dummy = 1
+end subroutine bar
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
@@ -0,0 +1,39 @@
+# 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 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.
+
+set testfile "dynamic-other-frame"
+set srcfile1 ${testfile}.f90
+set srcfile2 ${testfile}-stub.f90
+set objfile2 [standard_output_file ${testfile}-stub.o]
+set executable ${testfile}
+set binfile [standard_output_file ${executable}]
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
+ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
+ untested "Couldn't compile ${srcfile1} or ${srcfile2}"
+ return -1
+}
+
+clean_restart ${executable}
+
+gdb_test_no_output "set print frame-arguments all"
+
+if ![runto bar_] then {
+ perror "couldn't run to bar_"
+ continue
+}
+
+gdb_test "bt" {foo \(string='hello'.*}
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
@@ -0,0 +1,36 @@
+! 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 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.
+!
+! Ihis file is the Fortran source file for dynamic.exp.
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+subroutine foo (string)
+ interface
+ subroutine bar
+ end subroutine
+ end interface
+ character string*(*)
+ call bar ! stop-here
+end subroutine foo
+program test
+ interface
+ subroutine foo (string)
+ character string*(*)
+ end subroutine
+ end interface
+ call foo ('hello')
+end

View File

@ -1,350 +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-vla-intel-tests.patch
;;=fedoratest
diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
--- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp
+++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
@@ -37,5 +37,5 @@ gdb_continue_to_breakpoint "BP1"
gdb_test "ptype tinsta" \
[multi_line "type = Type tuserdef" \
" $int :: i" \
- " PTR TO -> \\( $real :: ptr \\)" \
+ " PTR TO -> \\( $real :: ptr\\)" \
"End Type tuserdef"]
diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
--- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
+++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
@@ -42,7 +42,7 @@ gdb_test "ptype say_numbers" \
"type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)"
gdb_test "ptype fun_ptr" \
- "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)"
+ "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\)\\)\\)\\)"
gdb_test "ptype say_string" \
"type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)"
diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/vla-func.exp
@@ -0,0 +1,61 @@
+# 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/>.
+
+standard_testfile ".f90"
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
+ {debug f90 quiet}] } {
+ return -1
+}
+
+if ![runto MAIN__] then {
+ perror "couldn't run to breakpoint MAIN__"
+ continue
+}
+
+# Check VLA passed to first Fortran function.
+gdb_breakpoint [gdb_get_line_number "func1-vla-passed"]
+gdb_continue_to_breakpoint "func1-vla-passed"
+gdb_test "print vla" " = \\( *\\( *22, *22, *22,\[()22, .\]*\\)" \
+ "print vla (func1)"
+gdb_test "ptype vla" "type = integer\\\(kind=4\\\), allocatable \\\(10,10\\\)" \
+ "ptype vla (func1)"
+
+gdb_breakpoint [gdb_get_line_number "func1-vla-modified"]
+gdb_continue_to_breakpoint "func1-vla-modified"
+gdb_test "print vla(5,5)" " = 55" "print vla(5,5) (func1)"
+gdb_test "print vla(7,7)" " = 77" "print vla(5,5) (func1)"
+
+# Check if the values are correct after returning from func1
+gdb_breakpoint [gdb_get_line_number "func1-returned"]
+gdb_continue_to_breakpoint "func1-returned"
+gdb_test "print ret" " = .TRUE." "print ret after func1 returned"
+
+# Check VLA passed to second Fortran function
+gdb_breakpoint [gdb_get_line_number "func2-vla-passed"]
+gdb_continue_to_breakpoint "func2-vla-passed"
+gdb_test "print vla" \
+ " = \\\(44, 44, 44, 44, 44, 44, 44, 44, 44, 44\\\)" \
+ "print vla (func2)"
+gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10\\\)" \
+ "ptype vla (func2)"
+
+# Check if the returned VLA has the correct values and ptype.
+gdb_breakpoint [gdb_get_line_number "func2-returned"]
+gdb_continue_to_breakpoint "func2-returned"
+gdb_test "print vla3" " = \\\(1, 2, 44, 4, 44, 44, 44, 8, 44, 44\\\)" \
+ "print vla3 (after func2)"
+gdb_test "ptype vla3" "type = integer\\\(kind=4\\\), allocatable \\\(10\\\)" \
+ "ptype vla3 (after func2)"
diff --git a/gdb/testsuite/gdb.fortran/vla-func.f90 b/gdb/testsuite/gdb.fortran/vla-func.f90
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/vla-func.f90
@@ -0,0 +1,71 @@
+! 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 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.
+
+logical function func1 (vla)
+ implicit none
+ integer, allocatable :: vla (:, :)
+ func1 = allocated(vla)
+ vla(5,5) = 55 ! func1-vla-passed
+ vla(7,7) = 77
+ return ! func1-vla-modified
+end function func1
+
+function func2(vla)
+ implicit none
+ integer :: vla (:)
+ integer :: func2(size(vla))
+ integer :: k
+
+ vla(1) = 1 ! func2-vla-passed
+ vla(2) = 2
+ vla(4) = 4
+ vla(8) = 8
+
+ func2 = vla
+end function func2
+
+program vla_func
+ implicit none
+ interface
+ logical function func1 (vla)
+ integer, allocatable :: vla (:, :)
+ end function
+ end interface
+ interface
+ function func2 (vla)
+ integer :: vla (:)
+ integer func2(size(vla))
+ end function
+ end interface
+
+ logical :: ret
+ integer, allocatable :: vla1 (:, :)
+ integer, allocatable :: vla2 (:)
+ integer, allocatable :: vla3 (:)
+
+ ret = .FALSE.
+
+ allocate (vla1 (10,10))
+ vla1(:,:) = 22
+
+ allocate (vla2 (10))
+ vla2(:) = 44
+
+ ret = func1(vla1)
+ vla3 = func2(vla2) ! func1-returned
+
+ ret = .TRUE. ! func2-returned
+end program vla_func
diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
--- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
+++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
@@ -33,5 +33,5 @@ set real4 [fortran_real4]
# Check the status of a pointer to a dynamic array.
gdb_breakpoint [gdb_get_line_number "pvla-associated"]
gdb_continue_to_breakpoint "pvla-associated"
-gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\) \\)\\) ${hex}" \
+gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\)\\)\\) ${hex}" \
"print pvla pointer information"
diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/vla-stringsold.exp
@@ -0,0 +1,101 @@
+# 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/>.
+
+standard_testfile ".f90"
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
+ {debug f90 quiet}] } {
+ return -1
+}
+
+# check that all fortran standard datatypes will be
+# handled correctly when using as VLA's
+
+if ![runto MAIN__] then {
+ perror "couldn't run to breakpoint MAIN__"
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
+gdb_continue_to_breakpoint "var_char-allocated-1"
+gdb_test "print var_char" \
+ " = \\(PTR TO -> \\( character\\*10\\)\\) ${hex}" \
+ "print var_char after allocated first time"
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10\\)" \
+ "whatis var_char first time"
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10\\)" \
+ "ptype var_char first time"
+gdb_test "next" "\\d+.*var_char = 'foo'.*" \
+ "next to allocation status of var_char"
+gdb_test "print l" " = .TRUE." "print allocation status first time"
+
+gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
+gdb_continue_to_breakpoint "var_char-filled-1"
+gdb_test "print var_char" \
+ " = \\(PTR TO -> \\( character\\*3\\)\\) ${hex}" \
+ "print var_char after filled first time"
+gdb_test "print *var_char" " = 'foo'" \
+ "print *var_char after filled first time"
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3\\)" \
+ "whatis var_char after filled first time"
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3\\)" \
+ "ptype var_char after filled first time"
+gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
+gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
+
+gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
+gdb_continue_to_breakpoint "var_char-filled-2"
+gdb_test "print var_char" \
+ " = \\(PTR TO -> \\( character\\*6\\)\\) ${hex}" \
+ "print var_char after allocated second time"
+gdb_test "print *var_char" " = 'foobar'" \
+ "print *var_char after allocated second time"
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6\\)" \
+ "whatis var_char second time"
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6\\)" \
+ "ptype var_char second time"
+
+gdb_breakpoint [gdb_get_line_number "var_char-empty"]
+gdb_continue_to_breakpoint "var_char-empty"
+gdb_test "print var_char" \
+ " = \\(PTR TO -> \\( character\\*0\\)\\) ${hex}" \
+ "print var_char after set empty"
+gdb_test "print *var_char" " = \"\"" "print *var_char after set empty"
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0\\)" \
+ "whatis var_char after set empty"
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0\\)" \
+ "ptype var_char after set empty"
+
+gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"]
+gdb_continue_to_breakpoint "var_char-allocated-3"
+gdb_test "print var_char" \
+ " = \\(PTR TO -> \\( character\\*21\\)\\) ${hex}" \
+ "print var_char after allocated third time"
+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21\\)" \
+ "whatis var_char after allocated third time"
+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21\\)" \
+ "ptype var_char after allocated third time"
+
+gdb_breakpoint [gdb_get_line_number "var_char_p-associated"]
+gdb_continue_to_breakpoint "var_char_p-associated"
+gdb_test "print var_char_p" \
+ " = \\(PTR TO -> \\( character\\*7\\)\\) ${hex}" \
+ "print var_char_p after associated"
+gdb_test "print *var_char_p" " = 'johndoe'" \
+ "print *var_char_ after associated"
+gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7\\)" \
+ "whatis var_char_p after associated"
+gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7\\)" \
+ "ptype var_char_p after associated"
diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.f90 b/gdb/testsuite/gdb.fortran/vla-stringsold.f90
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/vla-stringsold.f90
@@ -0,0 +1,40 @@
+! 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 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.
+
+program vla_strings
+ character(len=:), target, allocatable :: var_char
+ character(len=:), pointer :: var_char_p
+ logical :: l
+
+ allocate(character(len=10) :: var_char)
+ l = allocated(var_char) ! var_char-allocated-1
+ var_char = 'foo'
+ deallocate(var_char) ! var_char-filled-1
+ l = allocated(var_char) ! var_char-deallocated
+ allocate(character(len=42) :: var_char)
+ l = allocated(var_char)
+ var_char = 'foobar'
+ var_char = '' ! var_char-filled-2
+ var_char = 'bar' ! var_char-empty
+ deallocate(var_char)
+ allocate(character(len=21) :: var_char)
+ l = allocated(var_char) ! var_char-allocated-3
+ var_char = 'johndoe'
+ var_char_p => var_char
+ l = associated(var_char_p) ! var_char_p-associated
+ var_char_p => null()
+ l = associated(var_char_p) ! var_char_p-not-associated
+end program vla_strings
diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
@@ -44,7 +44,7 @@ gdb_test "whatis t2" "type = Type t2"
gdb_test "whatis t2v" "type = Type t2"
gdb_test "whatis t3" "type = Type t3"
gdb_test "whatis t3v" "type = Type t3"
-gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)"
+gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3\\)"
gdb_test "ptype t1" \
[multi_line "type = Type t1" \
@@ -73,4 +73,4 @@ gdb_test "ptype t3p" \
[multi_line "type = PTR TO -> \\( Type t3" \
" $int :: t3_i" \
" Type t2 :: t2_n" \
- "End Type t3 \\)"]
+ "End Type t3\\)"]

288
gdb.spec
View File

@ -21,19 +21,19 @@
%global _root_libdir %{_libdir}
}
# If we're on Fedora, we will build the gdb-minimal package.
%if 0%{?fedora}
# If we're on Fedora or RHEL 9+, we will build the gdb-minimal package.
%if 0%{?fedora} || 0%{?rhel} > 8
%global _build_minimal 1
%endif
Name: %{?scl_prefix}gdb
# Freeze it when GDB gets branched
%global snapsrc 20200208
%global snapsrc 20220501
# See timestamp of source gnulib installed into gnulib/ .
%global snapgnulib 20200630
%global snapgnulib 20210105
%global tarname gdb-%{version}
Version: 10.1
Version: 12.1
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
@ -157,8 +157,6 @@ Recommends: %{librpmname}
BuildRequires: %{?scl_prefix}gcc-c++
%endif
BuildRequires: autoconf
# GDB patches have the format `gdb-<version>-bz<red-hat-bz-#>-<desc>.patch'.
# They should be created using patch level 1: diff -up ./gdb (or gdb-6.3/gdb).
@ -189,22 +187,12 @@ Source5: %{libstdcxxpython}.tar.xz
Source6: gdbtui
# libipt: Intel Processor Trace Decoder Library
%global libipt_version 2.0.2
%global libipt_version 2.0.4
#=fedora
Source7: v%{libipt_version}.tar.gz
#=fedora
Patch1142: v1.5-libipt-static.patch
## [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka).
##=fedoratest
#Patch1075: gdb-testsuite-readline63-sigint.patch
##=fedoratest
Patch1119: gdb-testsuite-readline63-sigint-revert.patch
# Fix broken configure tests compromised by LTO
#push=Should be pushed upstream.
Patch2000: gdb-config.patch
# Include the auto-generated file containing the "Patch:" directives.
# See README.local-patches for more details.
Patch9998: _gdb.spec.Patch.include
@ -249,7 +237,9 @@ BuildRequires: texlive-collection-latexrecommended
BuildRequires: /usr/bin/pod2man
%if 0%{!?rhel:1} || 0%{?rhel} > 7
BuildRequires: libbabeltrace-devel%{buildisa}
BuildRequires: guile-devel%{buildisa}
%if 0%{?rhel} < 9
BuildRequires: guile22-devel%{buildisa}
%endif
%endif
%global have_libipt 0
%if 0%{!?rhel:1} || 0%{?rhel} > 7 || (0%{?rhel} == 7 && 0%{?scl:1})
@ -269,7 +259,7 @@ BuildRequires: libipt-devel%{buildisa}
BuildRequires: mpfr-devel%{buildisa}
%endif
BuildRequires: source-highlight-devel
%if 0%{!?rhel:1} || 0%{?rhel} > 8
%if 0%{!?rhel:1}
BuildRequires: xxhash-devel
%endif
BuildRequires: elfutils-debuginfod-client-devel
@ -336,7 +326,7 @@ BuildRequires: opencl-headers ocl-icd-devel%{bits_local} ocl-icd-devel%{bits_oth
%endif
%if 0%{!?rhel:1}
# Fedora arm+ppc64le do not yet have fpc built.
%ifnarch %{arm} ppc64le
%ifnarch s390x
BuildRequires: fpc
%endif
%endif
@ -386,6 +376,7 @@ BuildRequires: rust
BuildRequires: %{?scl_prefix}elfutils-debuginfod
%endif # 0%{?_with_testsuite:1}
BuildRequires: make
%{?scl:Requires:%scl_runtime}
@ -477,32 +468,6 @@ find -name "*.info*"|xargs rm -f
# See README.local-patches for more details.
%include %{PATCH9999}
%if 0%{!?el6:1}
for i in \
gdb/python/lib/gdb/FrameWrapper.py \
gdb/python/lib/gdb/backtrace.py \
gdb/python/lib/gdb/command/backtrace.py \
;do
test -e $i
: >$i
done
%endif
%if 0%{?rhel:1} && 0%{?rhel} <= 7
%patch1119 -p1
%endif
%patch2000 -p1
# The above patches twiddle a .m4 file for configure, so update the affected
# configure files
pushd libiberty
autoconf -f
popd
pushd intl
autoconf -f
popd
find -name "*.orig" | xargs rm -f
! find -name "*.rej" # Should not happen.
@ -585,8 +550,11 @@ COMMON_GDB_CONFIGURE_FLAGS="\
--with-lzma \
%else
--without-lzma \
%endif \
--with-debuginfod
%endif
--with-debuginfod \
%if 0%{?rhel:1}
--disable-libctf
%endif
"
# Identify the build directory with the version of gdb as well as the
@ -715,7 +683,7 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \
%else
--without-python \
%endif
%if 0%{!?rhel:1} || 0%{?rhel} > 7
%if 0%{!?rhel:1} || 0%{?rhel} == 8
--with-guile \
%else
--without-guile \
@ -730,7 +698,7 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \
%else
--without-intel-pt \
%endif
%if 0%{!?rhel:1} || 0%{?rhel} > 8
%if 0%{!?rhel:1}
--with-xxhash \
%endif
--with-rpm=librpm.so.%{librpmver} \
@ -788,8 +756,6 @@ perl -i.relocatable -pe 's/^(D\[".*_RELOCATABLE"\]=" )1(")$/${1}0$2/' gdb/config
%make_build CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1
! grep '_RELOCATABLE.*1' gdb/config.h
grep '^#define HAVE_LIBSELINUX 1$' gdb/config.h
grep '^#define HAVE_SELINUX_SELINUX_H 1$' gdb/config.h
if [ "$fprofile" = "-fprofile" ]
then
@ -962,7 +928,7 @@ touch -r %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit
for i in `find $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb -name "*.py"`
do
# Files could be also patched getting the current time.
touch -r $RPM_BUILD_DIR/%{gdb_src}/gdb/ChangeLog $i
touch -r $RPM_BUILD_DIR/%{gdb_src}/gdb/version.in $i
done
%if 0%{?_enable_debug_packages:1} && 0%{!?_without_python:1}
@ -1008,7 +974,7 @@ cp -a $RPM_BUILD_DIR/%{gdb_src}/%{libstdcxxpython}/libstdcxx \
%endif # 0%{?rhel:1} && 0%{?rhel} <= 7
for i in `find $RPM_BUILD_ROOT%{_datadir}/gdb -name "*.py"`; do
# Files are installed by install(1) not preserving the timestamps.
touch -r $RPM_BUILD_DIR/%{gdb_src}/gdb/ChangeLog $i
touch -r $RPM_BUILD_DIR/%{gdb_src}/gdb/version.in $i
done
%endif # 0%{!?_without_python:1}
@ -1054,6 +1020,7 @@ ln -s gstack $RPM_BUILD_ROOT%{_bindir}/pstack
# Documentation only for development.
rm -f $RPM_BUILD_ROOT%{_infodir}/gdbint*
rm -f $RPM_BUILD_ROOT%{_infodir}/stabs*
rm -f $RPM_BUILD_ROOT%{_infodir}/ctf-spec*
# Delete this too because the dir file will be updated at rpm install time.
# We don't want a gdb specific one overwriting the system wide one.
@ -1071,13 +1038,6 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/system-gdbinit/elinos.py
rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/system-gdbinit/wrs-linux.py
rmdir $RPM_BUILD_ROOT%{_datadir}/gdb/system-gdbinit
# Patch848: gdb-dts-rhel6-python-compat.patch
%if 0%{!?el6:1}
rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/FrameWrapper.py
rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/backtrace.py
rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/command/backtrace.py
%endif
%files
# File must begin with "/": {GFDL,COPYING3,COPYING,COPYING.LIB,COPYING3.LIB}
%if 0%{!?el6:1}
@ -1184,6 +1144,210 @@ fi
%endif
%changelog
* Wed May 4 2022 Kevin Buettner - 12.1-1
- Rebase to FSF GDB 12.1.
- Update gdb-6.6-buildid-locate.patch.
- Update gdb-6.6-buildid-locate-rpm.patch.
- Dropped backported patches from GDB 11.1 and 11.2.
* Fri Mar 25 2022 Kevin Buettner - 11.2-2
- Backport upstream patch which removes sizes from debuginfod download
messages when the size is not available (RHBZ 2068280, Aaron Merey).
* Tue Feb 8 2022 Kevin Buettner - 11.2-1
- Rebase to FSF GDB 11.2.
* Wed Jan 5 2022 Alexandra Hájková - 11.1-6
-Backport upstream patch "[PR gdb/27026] CTRL-C is ignored
when debug info is downloaded" (RHBZ 2024875, Aaron Merey).
* Wed Jan 5 2022 Alexandra Hájková - 11.1-6
- Backport upstream patch "rework "set debuginfod" commands"
(RHBZ 2024875, Simon Marchi).
* Wed Jan 5 2022 Alexandra Hájková - 11.1-6
- Backport upstream patch "Fix unittest.exp failure due to 'set debuginfod' addition"
(RHBZ 2024875, Tom Tromey).
* Wed Jan 5 2022 Alexandra Hájková - 11.1-6
- Backport upstream patch "gdb: add set/show commands for managing debuginfod"
(RHBZ 2024875, Aaron Merey).
* Wed Jan 5 2022 Alexandra Hájková - 11.1-6
- Backport upstream patch "gdb.texinfo: Expand documentation for debuginfod"
(RHBZ 2024875, Aaron Merey).
* Wed Nov 10 2021 Kevin Buettner - 11.1-5
- Backport upstream fix and test case for a dprintf bug (RHBZ 2022177, Kevin
Buettner).
* Tue Nov 9 2021 Bruno Larsen - 11.1-4
- Backport manpage update to be closer to -help (RHBZ 853071)
* Thu Nov 4 2021 Kevin Buettner - 11.1-3
- Make adjustments to gdb-6.6-buildid-locate.patch, provided by Tom de Vries.
* Mon Oct 11 2021 Kevin Buettner - 11.1-2
- Backport upstream patch which papers over Fortran lexical analyzer
bug (RHBZ 2012976, Tom de Vries).
* Mon Oct 04 2021 Kevin Buettner - 11.1-1
- Rebase to FSF GDB 11.1.
- Adjust build-id related patches.
- Drop backported patches which are no longer relevant.
- Bump 'snapgnulib' date.
* Wed Sep 29 2021 Alexandra Hájková <ahajkova@redhat.com> - 10.2-9
- Backport test for RHBZ 1976887 (Kevin Buettner).
* Wed Sep 29 2021 Alexandra Hájková <ahajkova@redhat.com> - 10.2-9
- Backport upstream patch which fixes internal-error: Unexpected
type field location kind (RHBZ 1976887, Alexandra Hájková).
* Wed Sep 22 2021 Bruno Larsen <blarsen@redhat.com> - 10.2-8
- Backport "[gdb] Improve early exits for env var in debuginfod-support.c"
(Tom de Vries)
* Wed Sep 22 2021 Bruno Larsen <blarsen@redhat.com> - 10.2-8
- Backport "[gdb/cli] Don't assert on empty string for core-file"
(Tom de Vries)
* Tue Sep 21 2021 Peter Robinson <pbrobinson@fedoraproject.org> 10.2-7
- Use guile 2.2 (rhbz #1901353)
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jul 20 2021 Kevin Buettner <kevinb@redhat.com> - 10.2-5
- Remove autoconf invocations from spec file.
- Remove BuildRequires: autoconf.
* Mon Jun 14 2021 Kevin Buettner <kevinb@redhat.com> - 10.2-4
- Backport upstream patches which fix multi-threaded debugging for
glibc-2.34 (RHBZ 1971096, Simon Marchi, Kevin Buettner).
* Fri Jun 11 2021 Keith Seitz <keiths@redhat.com> - 10.2-3
- Backport "Exclude debuginfo files from 'outside ELF segments' warning".
(Keith Seitz, RH BZ 1898252)
- Backport "Fix crash when expanding partial symtab..."
(Tom Tromey. gdb/27743)
- Backport "[gdb/server] Don't overwrite fs/gs_base with -m32"
- (Tom de Vries)
* Sun Jun 06 2021 Python Maint <python-maint@redhat.com>
- Rebuilt for Python 3.10
* Thu Jun 03 2021 Kevin Buettner <kevinb@redhat.com> - 10.2-1
- Rebase to FSF GDB 10.2.
- Drop gdb-6.3-test-pie-20050107.patch.
- Drop gdb-6.3-test-self-20050110.patch.
- Drop gdb-6.5-bz218379-ppc-solib-trampoline-test.patch.
- Drop gdb-6.6-buildid-locate-core-as-arg.patch.
- Drop gdb-6.8-quit-never-aborts.patch.
- Drop gdb-archer-pie-addons-keep-disabled.patch.
- Drop gdb-archer-pie-addons.patch.
- Drop gdb-archer-vla-tests.patch.
- Drop gdb-archer.patch.
- Drop gdb-attach-fail-reasons-5of5.patch.
- Drop gdb-btrobust.patch.
- Drop gdb-bz1219747-attach-kills.patch.
- Drop gdb-bz533176-fortran-omp-step.patch.
- Drop gdb-dts-rhel6-python-compat.patch.
- Drop gdb-gnat-dwarf-crash-3of3.patch.
- Drop gdb-jit-reader-multilib.patch.
- Drop gdb-moribund-utrace-workaround.patch.
- Drop gdb-rhbz1930528-fix-gnulib-build-error.patch.
- Drop gdb-rhbz1932645-aarch64-ptrace-header-order.patch.
- Drop gdb-vla-intel-fix-print-char-array.patch.
- Drop gdb-vla-intel-fortran-strides.patch.
- Drop gdb-vla-intel-stringbt-fix.patch.
- Drop gdb-vla-intel-tests.patch.
- Drop process_psymtab_comp_unit-type-unit.patch.
- Drop gdb-testsuite-readline63-sigint-revert.patch.
- Drop gdb-config.patch.
- Add following upstream patches for Fortran stride / slice support:
gdb-rhbz1964167-convert-enum-range_type.patch
gdb-rhbz1964167-fortran-array-slices-at-prompt.patch
gdb-rhbz1964167-fortran-array-strides-in-expressions.patch
gdb-rhbz1964167-fortran-clean-up-array-expression-evaluation.patch
gdb-rhbz1964167-fortran-range_type-to-range_flag.patch
gdb-rhbz1964167-fortran-whitespace_array.patch
gdb-rhbz1964167-move-fortran-expr-handling.patch
* Tue Jun 01 2021 Python Maint <python-maint@redhat.com>
- Bootstrap for Python 3.10
* Wed Mar 31 2021 Keith Seitz <keiths@redhat.com> - 10.1-18
- Backport "Save/restore file offset while reading notes in core file"
(Keith Seitz, RHBZ 1931344)
* Wed Mar 31 2021 Jonathan Wakely <jwakely@redhat.com> - 10.1-17
- Rebuilt for removed libstdc++ symbols (#1937698)
* Tue Mar 23 2021 Kevin Buettner <kevinb@redhat.com>
- Remove spec file workaround for RHBZ 1912913.
* Fri Mar 19 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-16
- Fix potential hang during gdbserver testing (RHBZ 1941080, Kevin Buettner).
* Thu Mar 18 2021 Keith Seitz <keiths@redhat.com>
- Disable libctf on RHEL (RHBZ 1935517).
* Thu Mar 11 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-15
- Update libipt to version 2.0.4.
* Fri Mar 05 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-14
- Backport patches which fix frame_id_p assertion failure (RHBZ 1909902,
Pedro Alves).
* Fri Mar 5 2021 Jan Kratochvil <jan.kratochvil@redhat.com> - 10.1-13
- Drop gdb-vla-intel-fortran-vla-strings.patch as it was still regressing the
testsuite.
* Thu Mar 4 2021 Jan Kratochvil <jan.kratochvil@redhat.com> - 10.1-12
- Fix gdb-vla-intel-fortran-vla-strings.patch to no longer modify cached
inferior types.
* Thu Mar 4 2021 Jan Kratochvil <jan.kratochvil@redhat.com> - 10.1-11
- Align gdb-vla-intel-fortran-vla-strings.patch more to upstream
fixing whitespaces in Fortran types printing.
* Thu Mar 4 2021 Jan Kratochvil <jan.kratochvil@redhat.com> - 10.1-10
- Reapply 10.1-8 after it has been accidentally reverted by 10.1-9.
* Wed Feb 24 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-9
- Fix aarch64 build problem (RHBZ 1932645, Kevin Buettner).
* Fri Feb 19 2021 Jan Kratochvil <jan.kratochvil@redhat.com> - 10.1-8
- Fix gdb-vla-intel-fortran-vla-strings.patch for compatiblity with GraalVM.
* Thu Feb 18 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-7
- Fix gnulib related build problem (RHBZ 1930528, Kevin Buettner).
* Wed Feb 17 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-6
- Fix libstdc++ assert when performing tab completion; build must be made
with -D_GLIBCXX_DEBUG flag in order to trigger assert (RHBZ 1912985,
Kevin Buettner).
* Thu Feb 11 2021 Keith Seitz
- Disable Guile support for RHEL9+.
* Tue Jan 26 2021 Stephen Gallagher <sgallagh@redhat.com> - 10.1-5
- Build gdb-minimal for ELN
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Jan 23 2021 Kevin Buettner <kevinb@redhat.com>
- Add -Wno-stringop-overread to CFLAGS to work around gcc
bug (RH BZ 1912913)
* Tue Jan 12 2021 Keith Seitz <keiths@redhat.com> - 10.1-3
- Disable xxhash support for RHEL.
* Wed Dec 09 2020 Kevin Buettner <kevinb@redhat.com> - 10.1-2
- Fix off-by-one error in ada_fold_name. (RHBZ 1905996, Kevin Buettner)
* Wed Nov 04 2020 Kevin Buettner <kevinb@redhat.com> - 10.1-1
- Rebase to FSF GDB 10.1.
- Bump 'snapgnulib' date.

View File

@ -34,6 +34,8 @@ test "$1" = "-h" && usage
uncommit=0
if [ "$1" = "-u" ]; then
command -v stg > /dev/null 2>&1 \
|| die "Cannot find stg. Is stgit installed?"
uncommit=1
shift
fi
@ -46,7 +48,6 @@ fi
test -f _git_upstream_commit || die "Cannot find _git_upstream_commit file."
test -f _patch_order || die "Cannot find _patch_order file."
command -v stg > /dev/null 2>&1 || die "Cannot find stg. Is stgit installed?"
last_ancestor_commit=`cat _git_upstream_commit`

6
plans/ci.fmf Normal file
View File

@ -0,0 +1,6 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib

View File

@ -1,3 +1,3 @@
SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8
SHA512 (v2.0.2.tar.gz) = bc256a57a8481e0be8220624da3ccf1fe4bf0ea83e9808fdf0aad6db865aee402a36e78285efb0316c016f57e0d6fc56b647ee8e9a2ad4b05bfc1ad68ddde535
SHA512 (gdb-10.1.tar.xz) = 0dc54380435c6853db60f1e388b94836d294dfa9ad7f518385a27db4edd03cb970f8717d5f1e9c9a0d4a33d7fcf91bc2e5d6c9cf9e4b561dcc74e65b806c1537
SHA512 (v2.0.4.tar.gz) = 596d2dac25fdbd3e5660d7e1feeb7e8d5d359d1d0e19b62ef593449037df236db1d4d98820f0031061b5573ed67797a85a77fb9991e215abaabc4bfe16ceaec8
SHA512 (gdb-12.1.tar.xz) = 425568d2e84672177d0fb87b1ad7daafdde097648d605e30cf0656970f66adc6a82ca2d83375ea4be583e9683a340e5bfdf5819668ddf66728200141ae50ff2d

View File

@ -1,31 +0,0 @@
Justification
Adds tests according to the CI wiki specifically the standard test
interface in the spec.
The playbook includes Tier1 level test cases that have been tested in
the following contexts and is passing reliably: Classic and
Container. Test logs are stored in the artifacts directory.
The following steps are used to execute the tests using the standard
test interface: Test environment
Make sure you have installed packages from the spec
# rpm -q ansible python2-dnf libselinux-python standard-test-roles
ansible-2.3.2.0-1.fc26.noarch
python2-dnf-2.6.3-11.fc26.noarch
libselinux-python-2.6-7.fc26.x86_64
standard-test-roles-2.4-1.fc26.noarch
Run tests for Classic (must be run as root)
# export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)
# ansible-playbook --tags=classic tests.yml
Run tests for Container (must be run as root)
# export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)
# export TEST_SUBJECTS=docker:docker.io/library/fedora:26
# ansible-playbook --tags=container tests.yml

View File

@ -1,4 +1,4 @@
sta
start
si 30
n 10
up

View File

@ -0,0 +1,17 @@
summary: Debug a system binary.
description: ''
contact:
- Marek Polacek <mpolacek@redhat.com>
component:
- gdb
test: ./runtest.sh
framework: beakerlib
recommend:
- gdb
- coreutils
- coreutils-debuginfo
- glibc
- glibc-debuginfo
duration: 5m
extra-summary: /tools/gdb/Sanity/debug-system-binary
extra-task: /tools/gdb/Sanity/debug-system-binary

View File

@ -27,8 +27,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/lib/beakerlib/beakerlib.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
CMD="gdb"
BIN="$(which $CMD)"

View File

@ -14,5 +14,4 @@ frame 1
b xexit
c
c
c
q

View File

@ -0,0 +1,22 @@
summary: We debug a binary that is delivered via the Toolset.
description: ''
contact:
- Marek Polacek <mpolacek@redhat.com>
component:
- gdb
test: ./runtest.sh
framework: beakerlib
recommend:
- gdb
- coreutils
- binutils
- binutils-debuginfo
- glibc
- glibc-debuginfo
- gcc
- gcc-debuginfo
- zlib
- zlib-debuginfo
duration: 5m
extra-summary: /tools/gdb/Sanity/debug-toolset-binary
extra-task: /tools/gdb/Sanity/debug-toolset-binary

View File

@ -32,8 +32,7 @@
# but in fact, it doesn't have to. It should not fail either way.
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/lib/beakerlib/beakerlib.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
CMD="gdb"
BIN="$(which $CMD)"

View File

@ -1,3 +0,0 @@
#!/bin/bash
export TEST_DOCKER_EXTRA_ARGS="--privileged"
exec merge-standard-inventory "$@"

View File

@ -1,24 +0,0 @@
---
# This first play always runs on the local staging system
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
tests:
- debug-toolset-binary
- debug-system-binary
required_packages:
- gdb
- coreutils
- binutils
- binutils-debuginfo
- glibc
- glibc-debuginfo
- gcc
- gcc-debuginfo
- zlib
- zlib-debuginfo
- coreutils-debuginfo
- which