Compare commits

...

235 Commits
f24 ... master

Author SHA1 Message Date
Kevin Buettner ed8730b4d9 Rebase to FSF GDB 10.1.
Bump 'snapgnulib' date.
Drop gdb-rhbz1818011-bfd-gcc10-error.patch.
Drop gdb-rhbz1822715-fix-python-deprecation.patch.
Drop gdb-rhbz1829702-fix-python39.patch.
Drop gdb-rhbz1838777-debuginfod.patch.
Drop gdb-rhbz1844458-use-fputX_unfiltered.patch.
Drop gdb-rhbz1869484-deleted-working-directory.
Adjust build-id related patches.
Ajust VLA patches.
2020-11-05 14:17:24 -07:00
Keith Seitz d7b61266b7 Sync w/Fedora 33 -- add missing patch:
gdb-rhbz1869484-deleted-working-directory
2020-11-02 12:38:45 -08:00
Keith Seitz 3ab415fc4a Fix "missing debuginfo" messages
Resolves: RHBZ 1887025
2020-11-02 11:05:13 -08:00
Keith Seitz 6aff62077b Disable LTO until upstream sorts out ODR problems. 2020-08-10 14:54:31 -07:00
Keith Seitz ab7962ace7 Update libipt to v2.0.2. 2020-08-04 10:45:45 -07:00
Fedora Release Engineering 3c0f61139e - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-08-01 01:07:52 +00:00
Fedora Release Engineering 578aa401ab - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 18:22:27 +00:00
Tom Stellard 12a215835b Use make macros
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
2020-07-22 00:54:13 +00:00
Jeff Law 51337c28d9 Fix more broken configure files 2020-07-21 00:58:44 -06:00
Jeff Law 50ea6a9154 - Fix broken configure tests compromised by LTO
- Add BuildRequires: autoconf
2020-07-21 00:15:20 -06:00
Troy Dawson f9a00bf2a5 Minor conditional tweak for ELN
Signed-off-by: Troy Dawson tdawson@redhat.com
2020-07-08 16:27:20 +00:00
Keith Seitz db493ec1a2 Add debuginfod support. 2020-06-17 10:35:49 -07:00
Keith Seitz b2003eae67 Rebase to FSF GDB 9.2 and fix a bunch of issues. 2020-06-09 07:54:16 -07:00
Keith Seitz 28b99d9981 Fix python build and re-enable it.
(RH BZ 1829702, Kevin Buettner and Keith Seitz)
2020-06-05 15:45:45 -07:00
Miro Hrončok a6ec4e0365 Disable Python support to workaround problems with Python 3.9 (RHBZ 1829702) 2020-05-21 23:27:31 +02:00
Kevin Buettner c54196c27b Fix build breakage of gdb/python/python.c due to use of deprecated
Python function (RHBZ 1822715, Kevin Buettner)
2020-04-16 05:49:13 -07:00
Kevin Buettner c3e0b255c8 Fix build breakage when compiling bfd/elf.c with gcc 10. (RHBZ 1818011,
H.J. Lu)
2020-04-09 10:34:41 -04:00
Sergio Durigan Junior 03ff51b230 Fix generate-patches-from-git-repo.sh's use of "--keep-subject". 2020-04-08 16:25:25 -04:00
Sergio Durigan Junior 9e0dc4d5fc Add '--without-guile' to GDB_MINIMAL_CONFIGURE_FLAGS. 2020-03-02 10:54:58 -05:00
Sergio Durigan Junior 76de449876 Fix 'Recursive call to 'missing_rpm_list_print' when pagination is
on and missing RPM list is big' (RHBZ 1801974, Sergio Durigan
  Junior).
2020-02-13 14:21:00 -05:00
Sergio Durigan Junior cd3e3d1a80 Rename README.local-patches to README.local-patches.md 2020-02-11 15:34:42 -05:00
Sergio Durigan Junior 2a1cf3d881 Reformat README.local-patches to Markdown. 2020-02-11 15:33:51 -05:00
Sergio Durigan Junior 63fa2e2956 Enable libxxhash during build. 2020-02-10 15:46:11 -05:00
Sergio Durigan Junior c172b26911 Rebase to FSF GDB 9.1. 2020-02-08 11:17:48 -05:00
Dan Čermák e67700bf46 Re-enable guile support. 2020-02-04 16:19:46 -05:00
Sergio Durigan Junior a5d2c85367 Rebase to FSF GDB 9.0.90.20200203 (9.1pre).
Bump 'snapgnulib' date.
Update URL to 'https'.
Adjust build-id patchset.
Adjust VLA patchset.
Drop 'gdb-6.8-bz436037-reg-no-longer-active.patch'.
Drop 'gdb-6.6-scheduler_locking-step-is-default.patch'.
2020-02-04 15:07:12 -05:00
Fedora Release Engineering f258b03b2f - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 19:43:06 +00:00
Sergio Durigan Junior 99dc38b0d5 Rebase to FSF GDB 9.0.50.20191119 (9.1pre).
Drop 'gdb-readline62-ask-more-rh.patch'.
Drop 'gdb-6.5-bz216711-clone-is-outermost.patch'.
Adjust 'gdb-archer-pie-addons-keep-disabled.patch'.
2019-11-21 12:10:32 -05:00
Sergio Durigan Junior 2f578f51e4 Rebase to FSF GDB 9.0.50.20191018 (9.1pre).
Expand comment on "bundled(binutils)".
Remove libctf's files from RPM_BUILD_ROOT.
2019-10-19 14:30:13 -04:00
Jerry James 86fc1101ee Rebuild for mpfr 4 2019-10-09 19:49:47 -06:00
Sergio Durigan Junior 0a2f2a5526 Rebase to FSF GDB 8.3.50.20190924 (8.4pre).
Update 'gdb-6.6-buildid-locate.patch'.
2019-09-25 17:39:24 -04:00
Sergio Durigan Junior 8ac06474ff Rebase to FSF GDB 8.3.50.20190824 (8.4pre).
Update 'v1.5-libipt-static.patch'.
2019-08-25 16:37:00 -04:00
Miro Hrončok 92508e7ce6 Rebuilt for Python 3.8 2019-08-21 19:16:05 +02:00
Sergio Durigan Junior 9949e18054 Update bundled libipt copy to v2.0.1. 2019-08-18 17:33:14 -04:00
Sergio Durigan Junior 9c37e8a0b1 Rebase to FSF GDB 8.3.50.20190816 (8.4pre).
Drop 'gdb-testsuite-readline63-sigint.patch'.
Cleanup 'gdb-archer.patch' and remove several things, like the '-P' feature.
2019-08-18 16:06:28 -04:00
Miro Hrončok ece6742a5f Rebuilt for Python 3.8 2019-08-14 21:48:32 +02:00
Sergio Durigan Junior f7760f831c Rebase to FSF GDB 8.3.50.20190802 (8.4pre). 2019-08-02 19:25:51 -04:00
Fedora Release Engineering f3efb4b040 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 01:36:59 +00:00
Sergio Durigan Junior c79314bd92 Rebase to FSF GDB 8.3.50.20190702 (8.4pre).
Remove gdb-bz568248-oom-is-error.patch.
2019-07-02 18:30:05 -04:00
Sergio Durigan Junior 292cb418af Rebase to FSF GDB 8.3.50.20190625 (8.4pre). 2019-06-25 15:49:31 -04:00
Sergio Durigan Junior 2ff911f2f5 Rebuild for librpm9 (RH BZ 1720305). 2019-06-21 12:59:59 -04:00
Sergio Durigan Junior b1c3400f7f Rebase to FSF GDB 8.3.50.20190610 (8.4pre). 2019-06-10 11:33:29 -04:00
Sergio Durigan Junior 30a397d1b3 Sync gdb.spec with RHEL-8 GDB (thanks to Keith Seitz). 2019-06-05 11:57:36 -04:00
Sergio Durigan Junior cb6c609428 Rebase to FSF GDB 8.3.50.20190601 (8.4pre). 2019-06-02 00:02:45 -04:00
Sergio Durigan Junior f0a9ac3b0f Rebase to FSF GDB 8.3.50.20190528 (8.4pre). 2019-05-28 14:42:06 -04:00
Sergio Durigan Junior 06f4849386 Rebase to FSF GDB 8.3.50.20190517 (8.4pre). 2019-05-17 18:54:39 -04:00
Sergio Durigan Junior a17be6a448 Rebase to FSF GDB 8.3.50.20190510 (8.4pre). 2019-05-10 15:58:41 -04:00
Sergio Durigan Junior 865e2df5ec Unbreak previous commit.
Rebase to FSF GDB 8.3.50.20190501 (8.4pre).
Adjust VLA testcases.
Fix "gcore does not support COREFILTER_ELF_HEADERS" (RH BZ 1371380,
  Sergio Durigan Junior).
2019-05-02 20:08:19 -04:00
Sergio Durigan Junior 654fb507d8 Rebase to FSF GDB 8.3.50.20190501 (8.4pre). 2019-05-01 23:08:41 -04:00
Sergio Durigan Junior 0ec4d78c4e Share '/usr/bin/gdb-add-index' between gdb-minimal and gdb-headless
(Igor Gnatenko, RHBZ 1695015).
2019-04-29 10:30:20 -04:00
Igor Gnatenko d96e24456a
Add gdb-add-index to gdb-minimal
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-04-29 11:43:32 +02:00
Sergio Durigan Junior cc7695234a Provide 'gdb-minimal' package, specific for the buildroot (RHBZ 1695015).
Adjust 'gdb-libexec-add-index.patch' for the gdb-minimal case.
2019-04-28 20:46:29 -04:00
Sergio Durigan Junior 1b0ecbf0a5 Rebase to FSF GDB 8.3.50.20190425 (8.4pre), and fix build breakage. 2019-04-25 16:29:43 -04:00
Sergio Durigan Junior e507809c35 Rebase to FSF GDB 8.3.50.20190424 (8.4pre). 2019-04-24 14:28:02 -04:00
Sergio Durigan Junior a5d0cd87e1 Remove 'gdb-x86_64-i386-syscall-restart.patch'. 2019-04-12 18:22:24 -04:00
Sergio Durigan Junior e90857f9de Rebase to FSF GDB 8.3.50.20190412 (8.4pre).
Adjust 'gdb-6.3-rh-testversion-20041202.patch'.
Remove 'gdb-follow-child-stale-parent.patch'.
Remove 'gdb-rhbz795424-bitpos-20of25.patch'.
Remove 'gdb-rhbz795424-bitpos-21of25.patch'.
Remove 'gdb-rhbz795424-bitpos-22of25.patch'.
Remove 'gdb-rhbz795424-bitpos-23of25.patch'.
Remove 'gdb-rhbz795424-bitpos-25of25.patch'.
Remove 'gdb-rhbz795424-bitpos-25of25-test.patch'.
Remove 'gdb-rhbz795424-bitpos-arrayview.patch'.
Remove 'gdb-rhbz795424-bitpos-lazyvalue.patch'.
Remove 'gdb-bz541866-rwatch-before-run.patch'.
2019-04-12 16:35:59 -04:00
Sergio Durigan Junior 116197567a Fix 'gdb-8.3.50.20190321-3.fc31.x86_64: crashing' (by fixing
gdb-6.6-buildid-locate-rpm.patch) (RH BZ 1694091).
2019-03-29 14:14:19 -04:00
Sergio Durigan Junior 252ce24e08 Rebase to FSF GDB 8.3.50.20190321 (8.4pre).
Remove gdb-temporary-fix-arm-build-error.patch.
Fix "GDB crashes when using Python xmethods" (RH BZ 1690120).
2019-03-21 19:59:16 -04:00
Sergio Durigan Junior d1a098601d Temporarily add gdb-temporary-fix-arm-build-error.patch. 2019-03-19 19:19:25 -04:00
Sergio Durigan Junior 96770ac25f Rebase to FSF GDB 8.3.50.20190319 (8.4pre). 2019-03-19 18:07:06 -04:00
Sergio Durigan Junior 29841d1068 Rebase to FSF GDB 8.3.50.20190304 (8.4pre).
Rewrite gdb-6.6-buildid-locate.patch.
Remove gdb-python-gil.patch.
2019-03-05 11:27:44 -05:00
Sergio Durigan Junior b1bf7bc649 Rebase to FSF GDB 8.2.50.20190219 (8.3pre).
BuildRequire on 'source-highlight-devel' and enable styled output.
2019-02-19 19:06:53 -05:00
Igor Gnatenko 9404c96ac6
Disable temporarily guile support
guile 2.0 currently fails to build from source so it is not possible to
get it to use readline 8.0.

Let's disable guile support until GDB will be ported to 2.2[0] or 2.0
build will be fixed[1].

[0] https://sourceware.org/bugzilla/show_bug.cgi?id=21104
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1675089

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-02-17 22:57:49 +01:00
Igor Gnatenko e5955df97a Rebuild for readline 8.0 2019-02-17 09:30:50 +01:00
Sergio Durigan Junior c60e39b61c Remove libmpx dependency when using '--with testsuite', since GCC9
has dropped support for it.
2019-02-05 13:26:09 -05:00
Fedora Release Engineering 46d477eac9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 20:41:52 +00:00
Igor Gnatenko 538775743e Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:03 +01:00
Sergio Durigan Junior 0172100cc0 Fix:
BUILDSTDERR: ../../bfd/elf32-arm.c: In function 'elf32_arm_final_link_relocate':
BUILDSTDERR: ../../bfd/elf32-arm.c:10907:10: error: absolute value function 'labs' given an argument of type 'bfd_signed_vma' {aka 'long long int'} but has parameter of type 'long int' which may cause truncation of value [-Werror=absolute-value]
BUILDSTDERR: 10907 |  value = labs (relocation);
BUILDSTDERR:       |          ^~~~

And unbreak the build.
2019-01-21 15:26:26 -05:00
Sergio Durigan Junior 31f5b96fb9 Rebase to FSF GDB 8.2.50.20190120 (8.3pre).
Fix 'gdb does crash randomly on loading symbols or setting a breakpoint'
  (RHBZ 1638798, Keith Seitz).
2019-01-21 12:16:00 -05:00
Sergio Durigan Junior 2111580a73 Rebase to FSF GDB 8.2.50.20181220 (8.3pre). 2018-12-20 17:52:01 -05:00
Sergio Durigan Junior 83f9b09ebf Update gdb-6.3-gstack-20050411.patch (Pedro Alves).
Update gdb-archer-next-over-throw-cxx-exec.patch (Pedro Alves).
Update gdb-glibc-strstr-workaround.patch (Pedro Alves).
2018-12-11 16:37:09 -05:00
Sergio Durigan Junior 1ea4563053 Upload sources for gdb-8.2.50.20181130 2018-12-03 13:46:12 -05:00
Sergio Durigan Junior 9c7d730fb9 Rebase to FSF GDB 8.2.50.20181130 (8.3pre). 2018-12-03 13:40:10 -05:00
Sergio Durigan Junior f11faa1e6a Declare _python_bytecompile_extra.
Fix typo on gdb-x86_64-i386-syscall-restart.patch.
2018-11-20 13:54:57 -05:00
Miro Hrončok dba70321b8 https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 2018-11-15 12:53:54 +01:00
Sergio Durigan Junior 6ee43aeabb Rebase to FSF GDB 8.2.50.20181114 (8.3pre).
Drop gdb-6.3-ppc64syscall-20040622.patch.
Drop gdb-6.3-ppc64displaysymbol-20041124.patch.
Drop gdb-6.8-watchpoint-conditionals-test.patch.
2018-11-14 16:12:07 -05:00
Sergio Durigan Junior 4336687790 Use "--enable-unit-tests" flag when compiling GDB. 2018-10-17 23:26:03 -04:00
Sergio Durigan Junior e18aa17153 Rebase to FSF GDB 8.2.50.20181016 (8.3pre).
Enable and always run the unittests when building the package.
2018-10-16 18:34:23 -04:00
Sergio Durigan Junior d82716127f Rebase to FSF GDB 8.2.50.20181010 (8.3pre).
Remove 'gdb-6.8-sparc64-silence-memcpy-check.patch'.
Remove 'gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch'.
2018-10-10 18:37:53 -04:00
Sergio Durigan Junior a3b5cf46c2 Rebase to FSF GDB 8.2.50.20181006 (8.3pre). 2018-10-07 01:19:34 -04:00
Jan Kratochvil 453d99770b Fix annobin complaints (RH BZ 1630564):
--without-stage1-ldflags: Disable static libstdc++ and libgcc linking.
  --disable-libmcheck: That is a distro-level decision, not package decision.
2018-10-04 21:56:50 +02:00
Sergio Durigan Junior fc163ce193 Remove 'gdb-6.5-bz203661-emit-relocs.patch'.
Update changelog entry for last release.
2018-09-19 16:28:35 -04:00
Sergio Durigan Junior 0702d0d3e8 Rebase to FSF GDB 8.2.50.20180917 (8.3pre).
Add 'gdb-rhbz795424-bitpos-arrayview.patch'.
2018-09-17 18:38:14 -04:00
Sergio Durigan Junior 56040033ea Enable verbose output when running "make". 2018-08-21 15:33:32 -04:00
Jan Kratochvil 22998d94f7 Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). 2018-08-09 18:37:55 +02:00
Sergio Durigan Junior af8b999134 Reenable libipt. 2018-08-09 00:50:25 -04:00
Sergio Durigan Junior b9ce1a2833 Again, temporarily disable libipt (needed to upgrade libipt to 2.0). 2018-08-08 18:33:33 -04:00
Sergio Durigan Junior f774761950 Reenable libipt.
Rebuild due to new libipt release.
Adjust bundled libipt; remove unnecessary patch.
Sync IPv6 patch with F-28 GDB.
2018-08-08 18:00:06 -04:00
Sergio Durigan Junior 657623c611 Temporarily disable libipt (needed to upgrade libipt to 2.0). 2018-08-08 17:12:09 -04:00
Sergio Durigan Junior c26726c3ff Revert "Rebuild due to new libipt release."
This reverts commit 76ddc56b6d.
2018-08-08 16:27:05 -04:00
Sergio Durigan Junior 76ddc56b6d Rebuild due to new libipt release.
Adjust bundled libipt; remove unnecessary patch.
Sync IPv6 patch with F-28 GDB.
2018-08-08 15:04:49 -04:00
Jan Kratochvil f21bb2353c [dts] Fix build by removing a patch for already removed pahole.py .
[dts rhel6] Fix build by updating gdb-gnat-dwarf-crash-3of3.patch .
2018-08-08 17:30:20 +02:00
Sergio Durigan Junior 2ef085ccae Recompile to fix RH BZ 1609504 (due to RH BZ 1609577). 2018-07-30 16:01:20 -04:00
Sergio Durigan Junior 4f0bc6641e Rebase to FSF GDB 8.1.90.20180727 (8.2pre). 2018-07-28 15:23:17 -04:00
Sergio Durigan Junior 47b02ba87c Rebase to FSF GDB 8.1.90.20180724 (8.2pre). 2018-07-25 21:03:56 -04:00
Sergio Durigan Junior 2e649f71e0 Improve error handling on generate-* scripts 2018-07-25 17:35:59 -04:00
Sergio Durigan Junior 2f6fc56e9a Upload source files for last version 2018-07-15 12:31:12 -04:00
Sergio Durigan Junior 2cbda85f1c Rebase to FSF GDB 8.1.90.20180714 (8.2pre).
Backport IPv6 patch (RH BZ 881849, Sergio Durigan Junior).
2018-07-15 12:27:21 -04:00
Sergio Durigan Junior 17183a1d49 Extend specfile to run testsuites for native-gdbserver and native-extended-gdbserver 2018-07-14 16:04:17 -04:00
Fedora Release Engineering d790689b70 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 01:12:54 +00:00
Jan Kratochvil 138f53b360 [dts] [rhel6] Do not use mpfr as rhel6 has mpfr-2 while GDB requires mpfr-3. 2018-07-12 12:26:40 +02:00
Jan Kratochvil 5cc516897b Remove as no longer needed:
Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation
2018-07-12 11:16:09 +02:00
Jan Kratochvil 4f936c1cb8 [dts] Upgrade libstdc++-v3-python to 8.1.1-20180626. 2018-07-12 10:49:15 +02:00
Sergio Durigan Junior 0ec66a7bfb Rebuild due to GCC ABI change. 2018-07-12 00:36:08 -04:00
Sergio Durigan Junior 100fc38c45 Remove BuildRoot: directive from specfile.
Ref.: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/JJC5E3YKO4HNVLTKCLSDKLS6WMZSXOBK/
2018-07-10 17:23:26 -04:00
Sergio Durigan Junior e95ed4b7b3 Rebase to FSF GDB 8.1.90.20180708 (8.2pre). 2018-07-08 18:48:11 -04:00
Sergio Durigan Junior 9d054c36c2 Delete old sources 2018-07-04 23:23:41 -04:00
Sergio Durigan Junior 26734721d0 Upload source files for last version 2018-07-04 23:23:08 -04:00
Sergio Durigan Junior af046d7244 Rebase to FSF GDB 8.1.50.20180704 (8.2pre).
Remove defattr directives from specfile.
2018-07-04 20:59:29 -04:00
Miro Hrončok 57c3c609d3 Rebuilt for Python 3.7 2018-07-02 14:02:14 +02:00
Sergio Durigan Junior bf87ff816c Rebase to FSF GDB 8.1.50.20180629 (8.2pre).
Remove pahole.py.
Adjust handling of gdb-gdb.py.
2018-06-29 19:32:31 -04:00
Sergio Durigan Junior ab024a6de1 Rebase to FSF GDB 8.1.50.20180624 (8.2pre). 2018-06-27 15:50:46 -04:00
Sergio Durigan Junior a0d6e14aa3 Add BuildRequires: mpfr-devel (RH BZ 1593280).
Resolves: rhbz#1593280
2018-06-20 16:52:00 -04:00
Sergio Durigan Junior fd7e5d77a8 Remove need for "FileName:" line on the header of the patches. 2018-06-18 20:10:24 -04:00
Sergio Durigan Junior 3638ec5fec Upload sources to lookaside cache 2018-06-18 17:34:55 -04:00
Sergio Durigan Junior f3cfd8cd2d Rebase to FSF GDB 8.1.50.20180618 (8.2pre). 2018-06-18 17:33:24 -04:00
Sergio Durigan Junior 4f2cb1818a Do not run /sbin/install-info when installing the documentation
(except for DTS).
2018-06-18 13:47:30 -04:00
Sergio Durigan Junior 399e22022a Rebase to FSF GDB 8.1.50.20180613 (8.2pre). 2018-06-13 15:37:00 -04:00
Miro Hrončok ea73a43ec5 Rebuilt for Python 3.7 2018-06-13 16:03:58 +02:00
Miro Hrončok a902391148 Bootstrap for Python 3.7 2018-06-13 14:51:24 +02:00
Sergio Durigan Junior 8014ace474 Fix Python 3.7 breakage (RH BZ 1577396).
Resolves: rhbz#1577396
2018-06-08 17:04:24 -04:00
Sergio Durigan Junior 732f37d3a4 Add gdb-aarch64-guard-sve-macros.patch and unbreak Aarch64 build 2018-06-07 14:14:40 -04:00
Sergio Durigan Junior c9daf93497 Rebase to FSF GDB 8.1.50.20180605 (8.2pre). 2018-06-05 15:25:07 -04:00
Sergio Durigan Junior 56d681a596 Remove missing "^index .*" lines from patches, and regenerate them 2018-06-05 11:25:20 -04:00
Sergio Durigan Junior 9e41188f8d Rebase to FSF GDB 8.1.50.20180529 (8.2pre). 2018-06-04 16:28:10 -04:00
Sergio Durigan Junior 2bcd68d7bf Rebase to FSF GDB 8.1.50.20180522 (8.2pre). 2018-05-31 14:47:56 -04:00
Sergio Durigan Junior b7dc57f2a9 Improve generate-patches-from-git-repo.sh script
This commit improves the script used to generate the patches from the
upstream git repo.  Basically, it removes even more cruft that was
being added by 'git format-patch', making the output really simple and
deterministic (determinism which was a problem before).

Aside from the metadata, nothing else has been changed and therefore
it doesn't justify a new Fedora GDB release.
2018-05-17 16:11:29 -04:00
Sergio Durigan Junior f62b682777 Re-add "[aarch64] Fix missed unaligned hardware watchpoints (RH BZ 1347993)."
This commit re-adds the patch, using the current patch framework.
2018-05-17 16:02:26 -04:00
Sergio Durigan Junior 9736ebfbb0 Revert "[aarch64] Fix missed unaligned hardware watchpoints (RH BZ 1347993)."
This reverts commit 397c8a5922.
2018-05-17 14:52:53 -04:00
Jan Kratochvil 397c8a5922 [aarch64] Fix missed unaligned hardware watchpoints (RH BZ 1347993). 2018-05-05 18:54:28 +02:00
Jan Kratochvil fd48d313b8 Revert 'Fix PDF build on Rawhide/F-29', rm -rf texinfo/ (from RH BZ 1562580). 2018-04-02 18:55:20 +02:00
Jan Kratochvil 4262bf0e32 Fix PDF build on Rawhide/F-29. 2018-03-31 19:34:45 +02:00
Jan Kratochvil 35cdcb6a32 Add test: [s390x] Backport arch12 instructions decoding (RH BZ 1553104). 2018-03-23 20:50:27 +01:00
Jan Kratochvil ad1404c938 Add: BuildRequires: gcc-c++
https://fedoraproject.org/wiki/Packaging:C_and_C%2B%2B#BuildRequires_and_Requires
2018-03-03 05:35:46 +01:00
Rex Dieter 4ec1a6344c rebuild (guile) 2018-02-20 14:01:48 -06:00
Jan Kratochvil 3b2269511e [testsuite] Revert disable of BuildRequires: gcc-go (for RH BZ 1541639). 2018-02-17 17:22:13 +01:00
Igor Gnatenko 828d4ecb65
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 08:02:45 +01:00
Igor Gnatenko c287c646a5
Escape macros in %changelog
Reference: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/Y2ZUKK2B7T2IKXPMODNF6HB2O5T5TS6H/
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-09 09:04:34 +01:00
Fedora Release Engineering f9b3dfe2c9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 10:44:34 +00:00
Jan Kratochvil 1919df08fd Fix .spec build compatibility with <=F-27 and <=RHEL-7.
[testsuite] Temporarily disable BuildRequires: gcc-go (for RH BZ 1541639).
2018-02-06 06:27:37 +01:00
Sergio Durigan Junior 82f299dd3b Make generate-patches-from-git-repo.sh use "_git_upstream_commit" instead of "origin/master" for "git merge-base". 2018-02-05 13:01:55 -05:00
Jan Kratochvil 4a848ebc38 Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation
Fix ppc64 stwux encoding as found by gcc-8.0 -Werror=tautological-compare.
2018-02-04 21:49:30 +01:00
Jan Kratochvil 188c9fbf90 Fix -D_GLIBCXX_DEBUG gdb-add-index regression (RH BZ 1540559). 2018-02-04 21:04:11 +01:00
Sergio Durigan Junior 57200186ba Upload gdb-8.1.tar.xz to cache 2018-01-31 17:51:25 -05:00
Sergio Durigan Junior 6f7202ecff Rebase to FSF GDB 8.1. 2018-01-31 17:47:02 -05:00
esakaiev@redhat.com 3a396f9ecd Adding tests to the new_tests branch 2018-01-24 11:08:41 -05:00
Sergio Durigan Junior 21011c1e9c 8.0.90.20180109-2.fc26
Remove gdb-6.3-rh-dummykfail-20041202.patch (RH BZ 1535228).
Remove gdb-glibc-vdso-workaround.patch (RH BZ 1535244).

Resolves: rhbz#1535228
Resolves: rhbz#1535244
2018-01-19 16:03:40 -05:00
Sergio Durigan Junior a749f1b208 Upload source files for last commit 2018-01-10 14:25:28 -05:00
Sergio Durigan Junior c42f0297dc 8.0.90.20180109-1.fc26
Rebase to pre-FSF GDB 8.1 (8.1.90.20180109).
2018-01-10 14:21:10 -05:00
Sergio Durigan Junior 4632e1fa80 Rebase to FSF GDB 8.0.50.20171213 (8.1pre). 2017-12-18 12:28:39 -05:00
Sergio Durigan Junior a8767b37e5 8.0.50.20171204-34.fc26
- chmod +x on the generate-*.sh script.s
- Remove references to gdb-8.0.1 from 'sources' and '.gitignore'.
- Regenerate first line of the patches (remove commit hash).
- Fix empty Source line.
2017-12-10 17:00:49 -05:00
Sergio Durigan Junior b7971c4818 Fix build failure from last commit (add the _gdb.spec* files as Source) 2017-12-08 01:04:24 -05:00
Sergio Durigan Junior f637971ee3 - Rebase to FSF GDB 8.0.50.20171204 (8.1pre).
- Implemented new method for dealing with local patches.
2017-12-07 23:31:26 -05:00
Sergio Durigan Junior f524ac5870 Convert all the patches to 'git-am' format. 2017-12-04 14:24:00 -05:00
Jan Kratochvil bb1c5356b1 [testsuite] Fix BuildRequires for non-x86* arches. 2017-12-02 18:59:34 +01:00
Jan Kratochvil f408ba821f Use inlined func name for printing breakpoints (RH BZ 1228556, Keith Seitz). 2017-10-27 21:07:50 +02:00
Jan Kratochvil d614670f9d [s390x] Backport arch14 guarded-storage register support (RH BZ 1498758). 2017-10-07 16:14:55 +02:00
Jan Kratochvil 5210cb945e Performance fix of gcore to use --readnever (for RH BZ 1493675). 2017-09-28 19:56:23 +02:00
Troy Dawson 1b69fa99d4 Cleanup spec file conditionals 2017-09-26 15:31:01 -07:00
Jan Kratochvil 364e8a5927 Rebase to FSF GDB 8.0.1 (8.0 stable branch). 2017-09-12 09:43:19 +02:00
Jan Kratochvil f318b4ab7b [rhel6] Fix T-stopping of processes after their detachment (RH BZ 1486223). 2017-08-30 20:44:56 +02:00
Jan Kratochvil d4a557a0ab Backport DWARF-5 and breakpoint fixes from upstream stable branch 8.0. 2017-08-24 16:51:41 +02:00
Jan Kratochvil 4f1de05c3f [s390x] Backport arch12 support and other s390x fixes (RH BZ 1420304). 2017-08-19 22:40:32 +02:00
Jan Kratochvil 99b34dc784 Backport a fix for clang && -gsplit-dwarf debuggees (RH BZ 1482892). 2017-08-18 14:04:02 +02:00
Jan Kratochvil 9eb42f22d5 Fix compatibility with F-27 debuginfo packaging.
Fix compatibility with F-27 librpm version 8.
2017-08-13 13:22:19 +02:00
Jan Kratochvil 3bff4d98ba Two fixes from upstream stable branch 8.0. 2017-08-03 19:02:03 +02:00
Fedora Release Engineering 2d3d9675a7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-02 21:00:38 +00:00
Fedora Release Engineering d1308d3e8b - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 09:11:20 +00:00
Jan Kratochvil 4d0140dca1 [rhel6 dts] Use devtoolset gcc for GDB being now in C++11. 2017-06-12 21:57:44 +02:00
Jan Kratochvil c52da2003f [dts] Upgrade libstdc++-v3-python to 7.1.1-20170526. 2017-06-10 08:25:34 +02:00
Jan Kratochvil 39868f2076 [rhel dts libipt] Fix#2 [-Werror=implicit-fallthrough=] with gcc-7.1.1. 2017-06-09 15:45:38 +02:00
Jan Kratochvil 80d902f397 [rhel dts libipt] Fix [-Werror=implicit-fallthrough=] with gcc-7.1.1. 2017-06-09 07:35:25 +02:00
Jan Kratochvil 7e382f5dd2 Rebase to FSF GDB 8.0 final.
[rhel7 dts] Rebase bundled libipt to 1.6.1.
2017-06-09 06:22:17 +02:00
Jan Kratochvil b5e2ceba4b Move 'dnf-command(debuginfo-install)' gdb-headless -> gdb (RH BZ 1452335). 2017-05-20 20:12:10 +02:00
Fedora Release Engineering 7c86337b97 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild 2017-05-15 20:49:22 +00:00
Jan Kratochvil e6074aa8c0 [.spec] Update patches categorization. 2017-05-08 23:06:41 +02:00
Jan Kratochvil ee50e95c11 [ppc*] Fix gdb.arch/powerpc-power7.exp testcase regression (RH BZ 1440044). 2017-05-02 23:05:38 +02:00
Jan Kratochvil 5bb0f3bac3 Rebase to FSF GDB 7.99.90.20170420 (pre-8.0 stable branch). 2017-04-21 14:47:41 +02:00
Jan Kratochvil 5e93e40f3c Fix reported gdb-vla-intel-stringbt-fix.patch regression (SuSE).
Remove gcc-7 compilation compatibility hack.
2017-04-19 22:54:25 +02:00
Jan Kratochvil 5b3c4903f6 [testsuite] [ppc*,s390*] Do not FAIL rhbz1261564-aarch64-watchpoint.exp
(RH BZ 1352563).
2017-03-10 23:36:53 +01:00
Jan Kratochvil dbc649db15 Rebase to pre-7.13 FSF GDB trunk. 2017-03-09 23:53:59 +01:00
Jan Kratochvil 0fffd6c99d Fix gdb-vla-intel-fortran-strides.patch rebase regression. 2017-03-02 11:02:25 +01:00
Jan Kratochvil b1807ab4e1 Fix gdb.arch/amd64-entry-value-paramref.exp rebase regression. 2017-02-28 23:05:31 +01:00
Jan Kratochvil f9739f5031 [rhel] Fix gdb.python/py-gil-mthread.exp for Python 2 compat. (RH BZ 1427487). 2017-02-28 16:36:04 +01:00
Jan Kratochvil af2c2a5422 Rebase to pre-7.13 FSF GDB trunk.
Dropped gdb-6.7-bz426600-DW_TAG_interface_type-test.patch as GCJ is no more.
2017-02-27 22:30:32 +01:00
Jan Kratochvil 26c3bd5ab5 New testcase for: Fix <tab>-completion crash (Gary Benson, RH BZ 1398387).
[testsuite] Use more standard_output_file.
2017-02-25 06:45:31 +01:00
Jan Kratochvil 8d40388f0a Fix <tab>-completion crash (Gary Benson, RH BZ 1398387). 2017-02-15 17:06:33 +01:00
Jan Kratochvil 04e185f768 Release bump. 2017-02-14 19:23:34 +01:00
Jan Kratochvil f3b44f72fc [dts] Upgrade libstdc++-v3-python to 6.3.1-20170212. 2017-02-12 14:28:20 +01:00
Jan Kratochvil 7a79f904cf Fix build compatibility with gcc-7. 2017-02-08 18:41:52 +01:00
Jan Kratochvil 082583feeb Add missing %license macro 2017-02-08 16:34:17 +01:00
Jan Kratochvil 1d69420972 Rebase to released FSF GDB 7.12.1. 2017-01-21 19:27:42 +01:00
Jan Kratochvil 7a45095ecc Enable libinproctrace.so on all archs except arm32. 2017-01-17 19:35:17 +01:00
Jan Kratochvil 194c0860de Fix gdb-readline62-ask-more-rh.patch for Rawhide readline-7.0. 2017-01-13 11:27:14 +01:00
Igor Gnatenko 21eae8e63e Rebuild for readline 7.x
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2017-01-12 17:30:28 +01:00
Jan Kratochvil 35d56bae33 [rhel6] Fix missing /usr/bin/realpath. 2017-01-12 11:16:39 +01:00
Jan Kratochvil 718f2d69b3 Update from FSF GDB 7.12 stable branch to snapshot: gdb-7.12.0.20170111 2017-01-11 18:11:21 +01:00
Jan Kratochvil 6022fd9542 sources: md5->sha512 2017-01-11 17:38:06 +01:00
Jan Kratochvil a06a12e15b Fix Python backtraces for 32-bit inferiors (Tom Tromey, RH BZ 1411094). 2017-01-08 13:00:47 +01:00
Jan Kratochvil b6aa878929 Fix gdb-add-index for 444 *.debug files. 2017-01-06 19:38:37 +01:00
Rex Dieter 7fedccf706 fix logic of prior Conflicts
theoretically should not be required due to versioned dependeny
on -headless already, but it cannot hurt either
2017-01-02 18:52:52 -06:00
Rex Dieter 602e87ce15 avoid hard-coded python
python isn't present in buildroot, try %__python instead
2017-01-02 18:40:33 -06:00
Rex Dieter 714c89f6bc Conflicts: gdb-headless < 7.12-29 (#1402554) 2017-01-02 18:07:51 -06:00
Charalampos Stratakis 246098eea8 Python 3.6 rebuild: Rebuild with python3 support. 2016-12-10 11:46:53 +01:00
Charalampos Stratakis 9bafb7c0fd Python 3.6: Rebuild without python3 support 2016-12-09 15:54:49 +01:00
Jan Kratochvil 5eb569c1b7 Fix gdb-headless /usr/bin/ executables (BZ 1390251). 2016-10-31 21:08:30 +01:00
Jan Kratochvil b513153c46 Fix testcase: gdb.base/gdb-rhbz1156192-recursive-dlopen.exp 2016-10-24 23:23:00 +02:00
Jan Kratochvil 43d7d2a8eb More work on missing testcases present in rhel6 GDB; some still FAIL. 2016-10-23 22:09:55 +02:00
Jan Kratochvil 29d49d9491 Add missing testcases present in rhel6 GDB; some still FAIL. 2016-10-20 22:30:43 +02:00
Jan Kratochvil 2b94f0063a [rhel6] Fix .spec without devtoolset-6-build installed (RH BZ 1384947). 2016-10-14 19:21:40 +02:00
Jan Kratochvil d08a20f70d Fix TLS (such as 'errno') regression. 2016-10-12 10:50:06 +02:00
Jan Kratochvil 425d099f6b [testsuite] Various testsuite fixes.
- [aarch64] Fix gdb.cp/nextoverthrow.exp regression (Yao Qi).
2016-10-12 10:26:19 +02:00
Jan Kratochvil 1c3e2fa7ac Fix .spec build: error: Macro %buildisa has empty body 2016-10-07 23:28:47 +02:00
Jan Kratochvil 53edfc5dad Rebase to FSF GDB 7.12. 2016-10-07 23:19:55 +02:00
Jan Kratochvil eed01b8fe7 Rebase to FSF GDB 7.11.90.20161006 (pre-7.12 branch snapshot). 2016-10-06 15:22:49 +02:00
Jan Kratochvil 25e02352ec Rebase to FSF GDB 7.11.90.20160929 (pre-7.12 branch snapshot).
- Fixes GDB crashes on inf. function call scripts (RH BZ 1378147, Pedro Alves).
2016-09-29 10:57:10 +02:00
Jan Kratochvil 4ca26b1f03 Fix attachment of JIT-debug-enabled inf. (7.11.1 regression, RH BZ 1375553).
- Rebase to FSF GDB 7.11.90.20160928 (pre-7.12 branch snapshot).
2016-09-28 17:34:37 +02:00
Jan Kratochvil 2f00fc1fdb Fix description empty lines. 2016-09-15 22:54:02 +02:00
Jan Kratochvil 303cd25eb9 Provide gdb-headless package (RH BZ 1195005). 2016-09-14 23:33:09 +02:00
Jan Kratochvil 60c662d53a [testsuite] More testsuite fixes. 2016-09-12 23:09:34 +02:00
Jan Kratochvil 235c57bc26 Various mostly testsuite compatibility and regression fixes. 2016-09-12 22:56:27 +02:00
Jan Kratochvil d258670d64 Rebase to FSF GDB 7.11.90.20160907 (pre-7.12 branch snapshot).
- Rebase Intel VLA patchset.
2016-09-07 22:47:48 +02:00
Jan Kratochvil 35cbc92246 [rhel6+7] Fix compatibility of bison <3.1 and gcc >=6. 2016-09-07 13:45:40 +02:00
Jan Kratochvil 0414aeba5a Release bump for a mistaken build. 2016-09-04 21:05:39 +02:00
Jan Kratochvil dc6b8f4f24 Fix libipt bundling in 7.12. 2016-09-04 20:19:06 +02:00
Jan Kratochvil 0300a2eb2d Rebase to FSF GDB 7.11.90.20160904 (pre-7.12 branch snapshot).
- Make Version tag 7.12; but it is still a pre-release.
2016-09-04 19:32:35 +02:00
Jan Kratochvil d987921748 Rebase to FSF GDB 7.11.90.20160829 (pre-7.12 branch snapshot). 2016-08-29 09:50:02 +02:00
Jan Kratochvil 72aed9dc5e Fix Intel VLA patchset regression: dynamic.exp: p varw filled 2016-08-26 17:09:47 +02:00
Jan Kratochvil 8cff818ba3 Merge Fedora packaging changes from Fedora 24 gdb-7.11.1-83.fc24: 2016-08-23 21:04:27 +02:00
Jan Kratochvil a5a9adcd40 Merge commit '3f32311b4a6fe79de1a3da7bca5c08613eb3734e' 2016-08-23 20:54:15 +02:00
Jan Kratochvil 9faadbe569 Rebase to FSF GDB 7.11.90.20160807 (pre-7.12 branch snapshot). 2016-08-07 23:29:04 +02:00
Jan Kratochvil 5c5eb100c4 Testcase for: Load strictly build-id-checked core files only if no executable
is specified (Jan Kratochvil, RH BZ 1339862).
2016-07-31 23:28:07 +02:00
Jan Kratochvil 2e29a3ec7b Do not apply RHEL-6 patches on non-RHEL-6 even for testsuite. 2016-07-28 20:11:28 +02:00
Jan Kratochvil 1e35566c47 Rebase to FSF GDB 7.11.50.20160721 (pre-7.12 trunk snapshot). 2016-07-21 16:36:21 +02:00
Jan Kratochvil 7306e88eb4 Rebase to FSF GDB 7.11.50.20160716 (pre-7.12 trunk snapshot). 2016-07-17 16:35:49 +02:00
167 changed files with 13664 additions and 19643 deletions

7
.gitignore vendored
View File

@ -1,3 +1,4 @@
/gdb-libstdc++-v3-python-6.1.1-20160817.tar.xz
/v1.5.tar.gz
/gdb-7.11.1.tar.xz
/binutils-gdb
/gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz
/v2.0.2.tar.gz
/gdb-10.1.tar.xz

104
README.local-patches.md Normal file
View File

@ -0,0 +1,104 @@
# Fedora GDB local patches policy
In order to make things easier for the Fedora GDB maintainer, we
choose to auto-generate the local patches by making use of an upstream
git repository. Below you can find a few instructions on how to work
using this method.
You need to run the following commands from the directory that
contains the "gdb.spec" file.
## Importing the GDB patches into a git repository
1) The local patches (`*.patch`) need to be imported into an upstream
git repository. For example, let's assume you cloned the repository
by doing:
`$ git clone git://sourceware.org/git/binutils-gdb.git`
> TIP: if you already have the repository cloned somewhere in your
> system, you can pass a "--reference <dir>" to the "git clone"
> command and it will use your local repository as much as possible
> to make the clone, speeding up things.
2) After cloning the upstream repository, you can import your patches
by using the script "generate-git-repo-from-patches.sh":
`$ sh generate-git-repo-from-patches.sh <REPOSITORY_DIR>`
The script will basically cd into the repository, checkout the
revision specified in the file `_git_upstream_commit`, iterate through
the file `_patch_order` and "git-am" every patch *in that order*.
This operation should complete without errors; if you find a problem
with `git-am`, it probably means that the revision specified in the
file `_git_upstream_commit` is wrong.
## Rebasing the patches against a newer version/release
1) First, cd into the upstream repository. All you have to do is
choose the revision against which you plan to rebase the patches, and
`git rebase <REVISION>`. git will do the rest, and you will be able
to perform conflict resolution by git's algorithm, which is smarter.
## Creating new patches
1) Create the new patch on top of the the others, as usual. Note that
you can use `git rebase` whenever you want to reorder patch order, or
even to delete a patch.
2) When writing the commit log, you must obey a few rules. The
subject line *must* be the filename of the patch. This line will be
used when exporting the patches from the git repository, and
(obviously) it gives the filename that should be used for this
specific patch.
3) You can also add comments that will go into the auto-generated
`Patch:` file (see below). To do that, use the special marker `;;` at
the beginning of the line. This way, a commit log that says:
~~~~~~~~~~~
test-patch.patch
;; This is a test patch
;; Second line
~~~~~~~~~~~
Will generate the following entry in the auto-generated `Patch:` file:
~~~~~~~~~~~
# This is a test patch
# Second line
PatchXYZ: test-patch.patch
~~~~~~~~~~~
## Exporting the GDB patches from the git repository
1) When you're done working with the patches, go back to the directory
that contains the `gdb.spec` file, and from there you run:
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR>`
This will regenerate all of the `*.patch` files (excluding the ones that
were also excluded from the git repository), and also regenerate a few
control files. These control files are:
- `_gdb.spec.Patch.include`: This file contains the `Patch:` directives.
- `_gdb.spec.patch.include`: This file contains the `%patch` directives.
- `_patch_order`: This file contains the patches, in the exact order
that they must be applied. It is used when importing the patches
into the git repository.
- `_git_upstream_commit`: This file contains the last upstream commit
against which the patches were rebased. It is used when importing
the patches into the git repository.
NOTE: If you did a rebase against a newer upstream version, you need
to specify the commit/tag/branch against which you rebased:
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR> <COMMIT_OR_TAG_OR_BRANCH>`
For example, if you rebased against `gdb-8.1-release`:
`$ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR> gdb-8.1-release`

384
_gdb.spec.Patch.include Normal file
View File

@ -0,0 +1,384 @@
# Match the Fedora's version info.
#=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
# Test support of multiple destructors just like multiple constructors
#=fedoratest
Patch008: gdb-6.3-test-dtorfix-20050121.patch
# Fix to support executable moving
#=fedoratest
Patch009: 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
# Verify printing of inherited members test
#=fedoratest
Patch012: 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
# 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
# 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
# Testcase for deadlocking on last address space byte; for corrupted backtraces.
#=fedoratest
Patch016: 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
# 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
# Find symbols properly at their original (included) file (BZ 109921).
#=fedoratest
Patch020: 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
# Testcase for exec() from threaded program (BZ 202689).
#=fedoratest
Patch022: 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
# Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
#=fedoratest
Patch024: 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
# Support for stepping over PPC atomic instruction sequences (BZ 237572).
#=fedoratest
Patch026: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
# Test leftover zombie process (BZ 243845).
#=fedoratest
Patch028: 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
# 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
#=push+jan
Patch031: 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
# Test PPC hiding of call-volatile parameter register.
#=fedoratest
Patch033: 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
# Test ia64 memory leaks of the code using libunwind.
#=fedoratest
Patch035: 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
# 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
# Test a crash on `focus cmd', `focus prev' commands.
#=fedoratest
Patch039: 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
# Test a crash on libraries missing the .text section.
#=fedoratest
Patch041: 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
# New test for step-resume breakpoint placed in multiple threads at once.
#=fedoratest
Patch043: 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
# 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
# Testcase for "Do not make up line information" fix by Daniel Jacobowitz.
#=fedoratest
Patch049: 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
# Fix follow-exec for C++ programs (bugreported by Martin Stransky).
#=fedoratest
Patch052: 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
# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
#=push+jan
Patch055: 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
# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
#=fedoratest
Patch057: 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
# [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp.
#=fedoratest
Patch059: gdb-test-dw2-aranges.patch
# [archer-keiths-expr-cumulative+upstream] Import C++ testcases.
#=fedoratest
Patch060: 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
# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
#=fedoratest
Patch062: gdb-physname-pr12273-test.patch
# Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890).
#=fedoratest
Patch063: 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
# Workaround PR libc/14166 for inferior calls of strstr.
#=fedoratest: Compatibility with RHELs (unchecked which ones).
Patch066: 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
# Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343).
#=fedoratest
Patch068: 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
# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
#=fedoratest
Patch071: 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
# Display Fortran strings in backtraces.
#=fedoratest
Patch076: 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
# 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
# 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
# Test 'info type-printers' Python error (RH BZ 1350436).
#=fedoratest
Patch081: 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
# Force libncursesw over libncurses to match the includes (RH BZ 1270534).
#=push+jan
Patch084: 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
# [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
# [aarch64] Fix hardware watchpoints (RH BZ 1261564).
#=fedoratest
Patch089: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
# Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
#=fedora
Patch090: 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
# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
#=fedora
Patch092: gdb-linux_perf-bundle.patch
# Fix gdb-headless /usr/bin/ executables (BZ 1390251).
#
# Also, make /usr/bin/gdb.minimal be the default GDB used, if it's
# present. For rationale, see:
#
# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
#=fedora
Patch093: 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
# [s390x] Backport arch12 instructions decoding (RH BZ 1553104).
# =fedoratest
Patch097: gdb-rhbz1553104-s390x-arch12-test.patch

94
_gdb.spec.patch.include Normal file
View File

@ -0,0 +1,94 @@
%patch001 -p1
%patch002 -p1
%patch003 -p1
%patch004 -p1
%patch005 -p1
%patch006 -p1
%patch007 -p1
%patch008 -p1
%patch009 -p1
%patch010 -p1
%patch012 -p1
%patch013 -p1
%patch014 -p1
%patch015 -p1
%patch016 -p1
%patch017 -p1
%patch018 -p1
%patch019 -p1
%patch020 -p1
%patch021 -p1
%patch022 -p1
%patch023 -p1
%patch024 -p1
%patch025 -p1
%patch026 -p1
%patch028 -p1
%patch029 -p1
%patch030 -p1
%patch031 -p1
%patch032 -p1
%patch033 -p1
%patch034 -p1
%patch035 -p1
%patch036 -p1
%patch038 -p1
%patch039 -p1
%patch040 -p1
%patch041 -p1
%patch042 -p1
%patch043 -p1
%patch044 -p1
%patch045 -p1
%patch046 -p1
%patch047 -p1
%patch048 -p1
%patch049 -p1
%patch050 -p1
%patch051 -p1
%patch052 -p1
%patch053 -p1
%patch054 -p1
%patch055 -p1
%patch056 -p1
%patch057 -p1
%patch058 -p1
%patch059 -p1
%patch060 -p1
%patch061 -p1
%patch062 -p1
%patch063 -p1
%patch064 -p1
%patch065 -p1
%patch066 -p1
%patch067 -p1
%patch068 -p1
%patch069 -p1
%patch070 -p1
%patch071 -p1
%patch072 -p1
%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

1
_git_upstream_commit Normal file
View File

@ -0,0 +1 @@
606e3fd147ed9a00df165e46f30fe5c46dcda345

97
_patch_order Normal file
View File

@ -0,0 +1,97 @@
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
gdb-6.3-inferior-notification-20050721.patch
gdb-6.3-inheritancetest-20050726.patch
gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
gdb-6.5-sharedlibrary-path.patch
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
gdb-6.6-bz230000-power6-disassembly-test.patch
gdb-6.6-bz229517-gcore-without-terminal.patch
gdb-6.6-testsuite-timeouts.patch
gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
gdb-6.3-attach-see-vdso-test.patch
gdb-6.5-bz243845-stale-testing-zombie-test.patch
gdb-6.6-buildid-locate.patch
gdb-6.6-buildid-locate-solib-missing-ids.patch
gdb-6.6-buildid-locate-rpm.patch
gdb-6.7-charsign-test.patch
gdb-6.7-ppc-clobbered-registers-O2-test.patch
gdb-6.7-testsuite-stable-results.patch
gdb-6.5-ia64-libunwind-leak-test.patch
gdb-6.5-missed-trap-on-step-test.patch
gdb-6.5-gcore-buffer-limit-test.patch
gdb-6.3-mapping-zero-inode-test.patch
gdb-6.3-focus-cmd-prev-test.patch
gdb-6.8-bz442765-threaded-exec-test.patch
gdb-6.5-section-num-fixup-test.patch
gdb-6.8-bz466901-backtrace-full-prelinked.patch
gdb-simultaneous-step-resume-breakpoint-test.patch
gdb-core-open-vdso-warning.patch
gdb-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
gdb-test-pid0-core.patch
gdb-test-dw2-aranges.patch
gdb-test-expr-cumulative-archer.patch
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

View File

@ -1,7 +1,15 @@
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.c 2016-02-15 23:25:36.749601045 +0100
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-attach-see-vdso-test.patch
;; Test kernel VDSO decoding while attaching to an i386 process.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -28,10 +36,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.c
+ pause ();
+ return 1;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.exp 2016-02-15 23:25:44.889658840 +0100
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp
@@ -0,0 +1,72 @@
+# Copyright 2007
+

View File

@ -1,6 +1,15 @@
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S 1969-12-31 19:00:00.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S 2007-08-02 13:23:10.000000000 -0400
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-bz140532-ppc-unwinding-test.patch
;; Update PPC unwinding patches to their upstream variants (BZ 140532).
;;=fedoratest
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
@@ -0,0 +1,78 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -80,9 +89,10 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm3
+}
+
+*/
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S
--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S 1969-12-31 19:00:00.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S 2007-08-02 14:28:56.000000000 -0400
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S
@@ -0,0 +1,98 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -182,9 +192,10 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm6
+}
+
+*/
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c
--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c 1969-12-31 19:00:00.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c 2007-08-02 13:25:10.000000000 -0400
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c
@@ -0,0 +1,29 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -215,9 +226,10 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c gd
+ func1 ();
+ return 0;
+}
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp 1969-12-31 19:00:00.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp 2007-08-02 14:21:29.000000000 -0400
diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
@@ -0,0 +1,72 @@
+# Copyright 2006, 2007 Free Software Foundation, Inc.
+
@ -256,8 +268,8 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
+ fail "powerpc arch test"
+ return
+}
+set objfile2 ${objdir}/${subdir}/${testfile}-asm.o
+set binfile ${objdir}/${subdir}/${testfile}
+set objfile2 [standard_output_file ${testfile}-asm.o]
+set binfile [standard_output_file ${testfile}]
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2}" ${binfile} executable $flags] != ""} {
+ return -1
@ -291,12 +303,10 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
+ pass $test
+ }
+}
Fixup the testcase for ppc64 biarch GDB.
--- ./gdb/testsuite/gdb.arch/powerpc-prologue.exp 2008-01-13 13:32:19.000000000 +0100
+++ ./gdb/testsuite/gdb.arch/powerpc-prologue.exp 2008-01-02 00:04:10.000000000 +0100
@@ -17,8 +17,9 @@
diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp
--- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp
@@ -16,8 +16,9 @@
# Test PowerPC prologue analyzer.
# Do not run on AIX (where we won't be able to build the tests without

View File

@ -1,12 +1,19 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-bz202689-exec-from-pthread-test.patch
;; Testcase for exec() from threaded program (BZ 202689).
;;=fedoratest
2007-01-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.threads/threaded-exec.exp, gdb.threads/threaded-exec.c: New files.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c 2016-02-16 09:54:06.936904418 +0100
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/threaded-exec.c
@@ -0,0 +1,46 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -54,10 +61,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c
+ execl ("/bin/true", "/bin/true", NULL);
+ abort ();
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp 2016-02-16 09:54:19.965992585 +0100
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/threaded-exec.exp
@@ -0,0 +1,41 @@
+# threaded-exec.exp -- Check reset of the tracked threads on exec*(2)
+# Copyright (C) 2007 Free Software Foundation, Inc.

View File

@ -1,6 +1,16 @@
--- /dev/null 2008-03-23 13:41:46.072650180 +0100
+++ gdb-6.3/gdb/testsuite/gdb.base/focus-cmd-prev.exp 2008-03-23 23:46:45.000000000 +0100
@@ -0,0 +1,25 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-focus-cmd-prev-test.patch
;; Test a crash on `focus cmd', `focus prev' commands.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/focus-cmd-prev.exp b/gdb/testsuite/gdb.base/focus-cmd-prev.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/focus-cmd-prev.exp
@@ -0,0 +1,40 @@
+# Copyright 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -24,5 +34,20 @@
+gdb_exit
+gdb_start
+
+gdb_test "focus cmd"
+gdb_test "focus prev"
+# Do not use gdb_test or \r\n there since:
+# commit d7e747318f4d04af033f16325f9b6d74f67079ec
+# Eliminate make_cleanup_ui_file_delete / make ui_file a class hierarchy
+
+set test "focus cmd"
+gdb_test_multiple $test $test {
+ -re "$gdb_prompt $" {
+ pass $test
+ }
+}
+
+set test "focus prev"
+gdb_test_multiple $test $test {
+ -re "$gdb_prompt $" {
+ pass $test
+ }
+}

View File

@ -1,14 +1,22 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Andrew Cagney <cagney@gnu.org>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-gstack-20050411.patch
;; Add a wrapper script to GDB that implements pstack using the
;; --readnever option.
;;=push
2004-11-23 Andrew Cagney <cagney@redhat.com>
* Makefile.in (uninstall-gstack, install-gstack): New rules, add
to install and uninstall.
* gstack.sh, gstack.1: New files.
Index: gdb-7.7/gdb/Makefile.in
===================================================================
--- gdb-7.7.orig/gdb/Makefile.in 2014-02-06 20:29:09.401214339 +0100
+++ gdb-7.7/gdb/Makefile.in 2014-02-06 20:29:09.501214360 +0100
@@ -1067,7 +1067,7 @@ info install-info clean-info dvi pdf ins
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
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
@ -17,7 +25,7 @@ Index: gdb-7.7/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \
@@ -1104,7 +1104,25 @@ install-strip:
@@ -1775,7 +1775,25 @@ install-guile:
install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
@ -44,7 +52,7 @@ Index: gdb-7.7/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
@@ -1127,6 +1145,18 @@ uninstall: force $(CONFIG_UNINSTALL)
@@ -1798,6 +1816,18 @@ uninstall: force $(CONFIG_UNINSTALL)
fi
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
@ -63,10 +71,10 @@ Index: gdb-7.7/gdb/Makefile.in
# 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
Index: gdb-7.7/gdb/gstack.sh
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7/gdb/gstack.sh 2014-02-06 20:29:09.501214360 +0100
diff --git a/gdb/gstack.sh b/gdb/gstack.sh
new file mode 100644
--- /dev/null
+++ b/gdb/gstack.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
@ -111,81 +119,10 @@ Index: gdb-7.7/gdb/gstack.sh
+ -e 's/^\((gdb) \)*//' \
+ -e '/^#/p' \
+ -e '/^Thread/p'
Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7/gdb/testsuite/gdb.base/gstack.exp 2014-02-06 20:43:17.774747352 +0100
@@ -0,0 +1,66 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile gstack
+set executable ${testfile}
+set binfile [standard_output_file $executable]
+if {[build_executable ${testfile} ${executable} "" {debug}] == -1} {
+ return -1
+}
+
+set test "spawn inferior"
+set command "${binfile}"
+set res [remote_spawn host $command];
+if { $res < 0 || $res == "" } {
+ perror "Spawning $command failed."
+ fail $test
+ return
+}
+set use_gdb_stub 1
+set pid [exp_pid -i $res]
+gdb_expect {
+ -re "looping\r\n" {
+ pass $test
+ }
+ eof {
+ fail "$test (eof)"
+ return
+ }
+ timeout {
+ fail "$test (timeout)"
+ return
+ }
+}
+gdb_exit
+
+# Testcase uses the most simple notification not to get caught by attach on
+# exiting the function. Still we could retry the gstack command if we fail.
+
+set test "spawn gstack"
+set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END"
+set res [remote_spawn host $command];
+if { $res < 0 || $res == "" } {
+ perror "Spawning $command failed."
+ fail $test
+}
+set pid [exp_pid -i $res]
+gdb_test_multiple "" $test {
+ -re "^#0 +(0x\[0-9a-f\]+ in )?\\.?func \\(\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in \\.?main \\(\\) at \[^\r\n\]*\r\nGSTACK-END\r\n\$" {
+ pass $test
+ }
+}
+gdb_exit
+
+remote_exec host "kill -9 $pid"
Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7/gdb/testsuite/gdb.base/gstack.c 2014-02-06 20:29:09.502214360 +0100
diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gstack.c
@@ -0,0 +1,43 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -230,3 +167,92 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.c
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gstack.exp
@@ -0,0 +1,84 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile gstack
+set executable ${testfile}
+set binfile [standard_output_file $executable]
+if {[build_executable ${testfile} ${executable} "" {debug}] == -1} {
+ return -1
+}
+
+set test "spawn inferior"
+set command "${binfile}"
+set res [remote_spawn host $command];
+if { $res < 0 || $res == "" } {
+ perror "Spawning $command failed."
+ fail $test
+ return
+}
+
+# The spawn id of the test inferior.
+set test_spawn_id $res
+
+set use_gdb_stub 1
+set pid [exp_pid -i $res]
+gdb_expect {
+ -re "looping\r\n" {
+ pass $test
+ }
+ eof {
+ fail "$test (eof)"
+ return
+ }
+ timeout {
+ fail "$test (timeout)"
+ return
+ }
+}
+
+# Testcase uses the most simple notification not to get caught by attach on
+# exiting the function. Still we could retry the gstack command if we fail.
+
+set test "spawn gstack"
+set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END"
+set res [remote_spawn host $command];
+if { $res < 0 || $res == "" } {
+ perror "Spawning $command failed."
+ fail $test
+}
+
+set gdb_spawn_id $res
+
+gdb_test_multiple "" $test {
+ -re "^#0 +(0x\[0-9a-f\]+ in )?\\.?func \\(\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in \\.?main \\(\\) at \[^\r\n\]*\r\nGSTACK-END\r\n\$" {
+ pass $test
+ }
+}
+
+gdb_test_multiple "" "gstack exits" {
+ eof {
+ set result [wait -i $gdb_spawn_id]
+ verbose $result
+
+ gdb_assert { [lindex $result 2] == 0 } "gstack exits with no error"
+ gdb_assert { [lindex $result 3] == 0 } "gstack's exit status is 0"
+
+ remote_close host
+ clear_gdb_spawn_id
+ }
+}
+
+# Kill the test inferior.
+kill_wait_spawned_process $test_spawn_id

View File

@ -1,3 +1,11 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jeff Johnston <jjohnstn@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-inferior-notification-20050721.patch
;; Notify observers that the inferior has been created
;;=fedoratest
2005-07-21 Jeff Johnston <jjohnstn@redhat.com>
* gdb.base/attach-32.exp: New test for attaching in 32-bit
@ -9,10 +17,10 @@
* gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32.c 2016-02-15 23:23:02.923499512 +0100
diff --git a/gdb/testsuite/gdb.base/attach-32.c b/gdb/testsuite/gdb.base/attach-32.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-32.c
@@ -0,0 +1,20 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
@ -34,10 +42,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32.c
+ }
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32.exp 2016-02-15 23:25:11.385420957 +0100
diff --git a/gdb/testsuite/gdb.base/attach-32.exp b/gdb/testsuite/gdb.base/attach-32.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-32.exp
@@ -0,0 +1,245 @@
+# Copyright 2005 Free Software Foundation, Inc.
+
@ -254,7 +262,7 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32.exp
+}
+
+set GDBFLAGS_orig $GDBFLAGS
+set GDBFLAGS "--pid=$testpid"
+set GDBFLAGS "-iex \"set height 0\" --pid=$testpid"
+gdb_start
+set GDBFLAGS $GDBFLAGS_orig
+
@ -276,7 +284,7 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32.exp
+}
+
+set GDBFLAGS_orig $GDBFLAGS
+set GDBFLAGS "--pid=$testpid"
+set GDBFLAGS "-iex \"set height 0\" --pid=$testpid"
+gdb_start
+set GDBFLAGS $GDBFLAGS_orig
+
@ -284,10 +292,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32.exp
+do_call_attach_tests
+
+return 0
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32b.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32b.c 2016-02-15 23:23:02.924499519 +0100
diff --git a/gdb/testsuite/gdb.base/attach-32b.c b/gdb/testsuite/gdb.base/attach-32b.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-32b.c
@@ -0,0 +1,24 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop

View File

@ -1,3 +1,11 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jeff Johnston <jjohnstn@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-inheritancetest-20050726.patch
;; Verify printing of inherited members test
;;=fedoratest
2005-07-26 Jeff Johnston <jjohnstn@redhat.com>
* gdb.cp/b146835.exp: New testcase.
@ -5,26 +13,10 @@
* gdb.cp/b146835b.cc: Ditto.
* gdb.cp/b146835.h: Ditto.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835b.cc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835b.cc 2016-02-16 09:49:08.743886620 +0100
@@ -0,0 +1,11 @@
+#include "b146835.h"
+
+C::C() { d = 0; x = 3; }
+
+int C::z (char *s) { return 0; }
+
+C::~C() {}
+
+void A::funcD (class E *e, class D *d) {}
+void A::funcE (E *e, D *d) {}
+void A::funcF (unsigned long x, D *d) {}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.cc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.cc 2016-02-16 09:49:08.744886627 +0100
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 @@
+#include "b146835.h"
+#include <iostream>
@ -58,10 +50,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.cc
+ f.foo();
+}
+
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.exp 2016-02-16 09:51:48.601968339 +0100
diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/b146835.exp
@@ -0,0 +1,47 @@
+# This testcase is part of GDB, the GNU debugger.
+
@ -110,10 +102,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.exp
+
+# Verify that we can access the inherited member d
+gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.h 2016-02-16 09:49:08.744886627 +0100
diff --git a/gdb/testsuite/gdb.cp/b146835.h b/gdb/testsuite/gdb.cp/b146835.h
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/b146835.h
@@ -0,0 +1,36 @@
+
+class A {
@ -151,3 +143,19 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/b146835.h
+ int z (char *s);
+ virtual ~C();
+};
diff --git a/gdb/testsuite/gdb.cp/b146835b.cc b/gdb/testsuite/gdb.cp/b146835b.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/b146835b.cc
@@ -0,0 +1,11 @@
+#include "b146835.h"
+
+C::C() { d = 0; x = 3; }
+
+int C::z (char *s) { return 0; }
+
+C::~C() {}
+
+void A::funcD (class E *e, class D *d) {}
+void A::funcE (E *e, D *d) {}
+void A::funcF (unsigned long x, D *d) {}

View File

@ -1,114 +1,16 @@
Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.exp 2013-08-02 22:24:04.747745133 +0200
@@ -0,0 +1,101 @@
+# Copyright 2007, 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 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.
+
+# Test GDB's handling of gcore for mapping with a name but zero inode.
+
+if { [prepare_for_testing gcore-shmid0.exp gcore-shmid0] } {
+ return -1
+}
+
+# Does this gdb support gcore?
+set test "help gcore"
+gdb_test_multiple $test $test {
+ -re "Undefined command: .gcore.*$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*$gdb_prompt $" {
+ pass $test
+ }
+}
+
+if { ! [ runto_main ] } then {
+ untested gcore-shmid0.exp
+ return -1
+}
+
+gdb_breakpoint "initialized"
+gdb_breakpoint "unresolved"
+
+set oldtimeout $timeout
+set timeout [expr $oldtimeout + 120]
+
+set test "Continue to initialized."
+gdb_test_multiple "continue" $test {
+ -re "Breakpoint .*, initialized .* at .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Breakpoint .*, unresolved .* at .*\r\n$gdb_prompt $" {
+ set timeout $oldtimeout
+ unsupported $test
+ return -1
+ }
+}
+set timeout $oldtimeout
+
+set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore-shmid0.test]
+
+set test "save a corefile"
+gdb_test_multiple "gcore ${objdir}/${subdir}/gcore-shmid0.test" $test {
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
+ pass $test
+ }
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
+ unsupported $test
+ }
+}
+
+# Be sure to remove the handle first.
+# But it would get removed even on a kill by GDB as the handle is already
+# deleted, just it is still attached.
+gdb_continue_to_end "finish"
+
+set test "core-file command"
+gdb_test_multiple "core-file $objdir/$subdir/gcore-shmid0.test" $test {
+ -re ".* program is being debugged already.*y or n. $" {
+ # gdb_load may connect us to a gdbserver.
+ send_gdb "y\n"
+ exp_continue;
+ }
+ -re "Core was generated by .*\r\n\#0 .*\\\(\\\).*\r\n$gdb_prompt $" {
+ # The filename does not fit there anyway so do not check it.
+ pass $test
+ }
+ -re ".*registers from core file: File in wrong format.* $" {
+ fail "core-file command (could not read registers from core file)"
+ }
+}
+
+set test "backtrace"
+gdb_test_multiple "bt" $test {
+ -re "#0 *initialized \\\(\\\) at .*#1 .* main \\\(.*$gdb_prompt $" {
+ pass $test
+ }
+ -re "#0 *initialized \\\(\\\) at .*Cannot access memory at address .*$gdb_prompt $" {
+ fail $test
+ }
+}
Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.c 2013-08-02 22:22:17.573599496 +0200
@@ -0,0 +1,127 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-mapping-zero-inode-test.patch
;; Test GCORE for shmid 0 shared memory mappings.
;;=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible.
diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.c b/gdb/testsuite/gdb.base/gcore-shmid0.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-shmid0.c
@@ -0,0 +1,128 @@
+/* Copyright 2007, 2009 Free Software Foundation, Inc.
+
+ This file is part of GDB.
@ -139,6 +41,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.c
+#include <stdlib.h>
+#include <unistd.h>
+#include <assert.h>
+#include <time.h>
+
+/* The same test running in a parallel testsuite may steal us the zero SID,
+ even if we never get any EEXIST. Just try a while. */
@ -236,3 +139,109 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.c
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.exp b/gdb/testsuite/gdb.base/gcore-shmid0.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-shmid0.exp
@@ -0,0 +1,101 @@
+# Copyright 2007, 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 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.
+
+# Test GDB's handling of gcore for mapping with a name but zero inode.
+
+if { [prepare_for_testing gcore-shmid0.exp gcore-shmid0] } {
+ return -1
+}
+
+# Does this gdb support gcore?
+set test "help gcore"
+gdb_test_multiple $test $test {
+ -re "Undefined command: .gcore.*$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*$gdb_prompt $" {
+ pass $test
+ }
+}
+
+if { ! [ runto_main ] } then {
+ untested gcore-shmid0.exp
+ return -1
+}
+
+gdb_breakpoint "initialized"
+gdb_breakpoint "unresolved"
+
+set oldtimeout $timeout
+set timeout [expr $oldtimeout + 120]
+
+set test "Continue to initialized."
+gdb_test_multiple "continue" $test {
+ -re "Breakpoint .*, initialized .* at .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Breakpoint .*, unresolved .* at .*\r\n$gdb_prompt $" {
+ set timeout $oldtimeout
+ unsupported $test
+ return -1
+ }
+}
+set timeout $oldtimeout
+
+set escapedfilename [string_to_regexp [standard_output_file gcore-shmid0.test]]
+
+set test "save a corefile"
+gdb_test_multiple "gcore [standard_output_file gcore-shmid0.test]" $test {
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
+ pass $test
+ }
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
+ unsupported $test
+ }
+}
+
+# Be sure to remove the handle first.
+# But it would get removed even on a kill by GDB as the handle is already
+# deleted, just it is still attached.
+gdb_continue_to_end "finish"
+
+set test "core-file command"
+gdb_test_multiple "core-file [standard_output_file gcore-shmid0.test]" $test {
+ -re ".* program is being debugged already.*y or n. $" {
+ # gdb_load may connect us to a gdbserver.
+ send_gdb "y\n"
+ exp_continue;
+ }
+ -re "Core was generated by .*\r\n\#0 .*\\\(\\\).*\r\n$gdb_prompt $" {
+ # The filename does not fit there anyway so do not check it.
+ pass $test
+ }
+ -re ".*registers from core file: File in wrong format.* $" {
+ fail "core-file command (could not read registers from core file)"
+ }
+}
+
+set test "backtrace"
+gdb_test_multiple "bt" $test {
+ -re "#0 *initialized \\\(\\\) at .*#1 .* main \\\(.*$gdb_prompt $" {
+ pass $test
+ }
+ -re "#0 *initialized \\\(\\\) at .*Cannot access memory at address .*$gdb_prompt $" {
+ fail $test
+ }
+}

View File

@ -1,24 +0,0 @@
2004-11-24 Andrew Cagney <cagney@gnu.org>
* printcmd.c (build_address_symbolic): Find a section for the
address.
Index: gdb-6.8.50.20081128/gdb/printcmd.c
===================================================================
--- gdb-6.8.50.20081128.orig/gdb/printcmd.c 2008-12-04 01:36:05.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/printcmd.c 2008-12-04 01:37:18.000000000 +0100
@@ -616,6 +616,14 @@ build_address_symbolic (CORE_ADDR addr,
addr = overlay_mapped_address (addr, section);
}
}
+ /* To ensure that the symbol returned belongs to the correct setion
+ (and that the last [random] symbol from the previous section
+ isn't returned) try to find the section containing PC. First try
+ the overlay code (which by default returns NULL); and second try
+ the normal section code (which almost always succeeds). */
+ section = find_pc_overlay (addr);
+ if (section == NULL)
+ section = find_pc_section (addr);
/* First try to find the address in the symbol table, then
in the minsyms. Take the closest one. */

View File

@ -1,111 +0,0 @@
2004-06-22 Andrew Cagney <cagney@gnu.org>
* rs6000-tdep.c (struct rs6000_framedata): Add field "func_start".
(skip_prologue): Delete local variable "orig_pc", use
"func_start". Add local variable "num_skip_linux_syscall_insn",
use to skip over first half of a GNU/Linux syscall and update
"func_start".
Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
===================================================================
--- gdb-7.2.50.20110117.orig/gdb/rs6000-tdep.c 2011-01-11 20:23:02.000000000 +0100
+++ gdb-7.2.50.20110117/gdb/rs6000-tdep.c 2011-01-17 15:48:19.000000000 +0100
@@ -126,6 +126,7 @@ static const char *powerpc_vector_abi_st
struct rs6000_framedata
{
+ CORE_ADDR func_start; /* True function start. */
int offset; /* total size of frame --- the distance
by which we decrement sp to allocate
the frame */
@@ -1496,7 +1497,6 @@ static CORE_ADDR
skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
struct rs6000_framedata *fdata)
{
- CORE_ADDR orig_pc = pc;
CORE_ADDR last_prologue_pc = pc;
CORE_ADDR li_found_pc = 0;
gdb_byte buf[4];
@@ -1514,12 +1514,14 @@ skip_prologue (struct gdbarch *gdbarch,
int minimal_toc_loaded = 0;
int prev_insn_was_prologue_insn = 1;
int num_skip_non_prologue_insns = 0;
+ int num_skip_ppc64_gnu_linux_syscall_insn = 0;
int r0_contains_arg = 0;
const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (gdbarch);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
memset (fdata, 0, sizeof (struct rs6000_framedata));
+ fdata->func_start = pc;
fdata->saved_gpr = -1;
fdata->saved_fpr = -1;
fdata->saved_vr = -1;
@@ -1553,6 +1555,55 @@ skip_prologue (struct gdbarch *gdbarch,
break;
op = extract_unsigned_integer (buf, 4, byte_order);
+ /* A PPC64 GNU/Linux system call function is split into two
+ sub-functions: a non-threaded fast-path (__NAME_nocancel)
+ which does not use a frame; and a threaded slow-path
+ (Lpseudo_cancel) that does create a frame. Ref:
+ nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
+
+ *INDENT-OFF*
+ NAME:
+ SINGLE_THREAD_P
+ bne- .Lpseudo_cancel
+ __NAME_nocancel:
+ li r0,162
+ sc
+ bnslr+
+ b 0x7fe014ef64 <.__syscall_error>
+ Lpseudo_cancel:
+ stdu r1,-128(r1)
+ ...
+ *INDENT-ON*
+
+ Unfortunatly, because the latter case uses a local label (not
+ in the symbol table) a PC in "Lpseudo_cancel" appears to be
+ in "__NAME_nocancel". The following code recognizes this,
+ adjusting FUNC_START to point to where "Lpseudo_cancel"
+ should be, and parsing the prologue sequence as if
+ "Lpseudo_cancel" was the entry point. */
+
+ if (((op & 0xffff0000) == 0x38000000 /* li r0,N */
+ && pc == fdata->func_start + 0
+ && num_skip_ppc64_gnu_linux_syscall_insn == 0)
+ || (op == 0x44000002 /* sc */
+ && pc == fdata->func_start + 4
+ && num_skip_ppc64_gnu_linux_syscall_insn == 1)
+ || (op == 0x4ca30020 /* bnslr+ */
+ && pc == fdata->func_start + 8
+ && num_skip_ppc64_gnu_linux_syscall_insn == 2))
+ {
+ num_skip_ppc64_gnu_linux_syscall_insn++;
+ continue;
+ }
+ else if ((op & 0xfc000003) == 0x48000000 /* b __syscall_error */
+ && pc == fdata->func_start + 12
+ && num_skip_ppc64_gnu_linux_syscall_insn == 3)
+ {
+ num_skip_ppc64_gnu_linux_syscall_insn = -1;
+ fdata->func_start = pc;
+ continue;
+ }
+
if ((op & 0xfc1fffff) == 0x7c0802a6)
{ /* mflr Rx */
/* Since shared library / PIC code, which needs to get its
@@ -1734,9 +1785,9 @@ skip_prologue (struct gdbarch *gdbarch,
we have no line table information or the line info tells
us that the subroutine call is not part of the line
associated with the prologue. */
- if ((pc - orig_pc) > 8)
+ if ((pc - fdata->func_start) > 8)
{
- struct symtab_and_line prologue_sal = find_pc_line (orig_pc, 0);
+ struct symtab_and_line prologue_sal = find_pc_line (fdata->func_start, 0);
struct symtab_and_line this_sal = find_pc_line (pc, 0);
if ((prologue_sal.line == 0)

View File

@ -1,96 +0,0 @@
2004-11-18 Andrew Cagney <cagney@gnu.org>
* dwarf2read.c: Include "top.c".
(dwarf2_has_info): Check for readnever_symbol_files.
* symfile.c (readnever_symbol_files): Define.
* top.h (readnever_symbol_files): Declare.
* main.c (captured_main): Add --readnever option.
(print_gdb_help): Ditto.
2004-11-18 Andrew Cagney <cagney@gnu.org>
* gdb.texinfo (File Options): Document --readnever.
Index: gdb-7.10.50.20151022/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/doc/gdb.texinfo 2015-10-22 22:16:50.483482288 +0200
+++ gdb-7.10.50.20151022/gdb/doc/gdb.texinfo 2015-10-22 22:28:22.042554142 +0200
@@ -1032,6 +1032,12 @@ Read each symbol file's entire symbol ta
the default, which is to read it incrementally as it is needed.
This makes startup slower, but makes future operations faster.
+@item --readnever
+@cindex @code{--readnever}
+Do not read each symbol file's symbolic debug information. This makes
+startup faster but at the expense of not being able to perform
+symbolic debugging.
+
@end table
@node Mode Options
Index: gdb-7.10.50.20151022/gdb/main.c
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/main.c 2015-10-22 22:16:50.485482299 +0200
+++ gdb-7.10.50.20151022/gdb/main.c 2015-10-22 22:28:22.042554142 +0200
@@ -604,6 +604,7 @@ captured_main (void *data)
{"tui", no_argument, 0, OPT_TUI},
{"dbx", no_argument, &dbx_commands, 1},
{"readnow", no_argument, &readnow_symbol_files, 1},
+ {"readnever", no_argument, &readnever_symbol_files, 1},
{"r", no_argument, &readnow_symbol_files, 1},
{"quiet", no_argument, &quiet, 1},
{"q", no_argument, &quiet, 1},
@@ -1253,6 +1254,7 @@ Selection of debuggee and its files:\n\n
--se=FILE Use FILE as symbol file and executable file.\n\
--symbols=SYMFILE Read symbols from SYMFILE.\n\
--readnow Fully read symbol files on first access.\n\
+ --readnever Do not read symbol files.\n\
--write Set writing into executable and core files.\n\n\
"), stream);
fputs_unfiltered (_("\
Index: gdb-7.10.50.20151022/gdb/symfile.c
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/symfile.c 2015-10-22 22:16:50.486482305 +0200
+++ gdb-7.10.50.20151022/gdb/symfile.c 2015-10-22 22:28:22.043554148 +0200
@@ -80,6 +80,7 @@ static void clear_symtab_users_cleanup (
/* Global variables owned by this file. */
int readnow_symbol_files; /* Read full symbols immediately. */
+int readnever_symbol_files; /* Never read full symbols. */
/* Functions this file defines. */
Index: gdb-7.10.50.20151022/gdb/dwarf2read.c
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/dwarf2read.c 2015-10-22 22:28:22.046554165 +0200
+++ gdb-7.10.50.20151022/gdb/dwarf2read.c 2015-10-22 22:29:17.664881642 +0200
@@ -70,6 +70,7 @@
#include "filestuff.h"
#include "build-id.h"
#include "namespace.h"
+#include "top.h"
#include <fcntl.h>
#include <sys/types.h>
@@ -2059,7 +2060,8 @@ dwarf2_has_info (struct objfile *objfile
(void *) names);
dwarf2_per_objfile->objfile = objfile;
}
- return (!dwarf2_per_objfile->info.is_virtual
+ return !readnever_symbol_files &&
+ (!dwarf2_per_objfile->info.is_virtual
&& dwarf2_per_objfile->info.s.section != NULL
&& !dwarf2_per_objfile->abbrev.is_virtual
&& dwarf2_per_objfile->abbrev.s.section != NULL);
Index: gdb-7.10.50.20151022/gdb/top.h
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/top.h 2015-10-22 22:16:50.490482329 +0200
+++ gdb-7.10.50.20151022/gdb/top.h 2015-10-22 22:28:22.047554171 +0200
@@ -74,6 +74,7 @@ extern int gdb_in_secondary_prompt_p (vo
/* From random places. */
extern int readnow_symbol_files;
+extern int readnever_symbol_files;
/* Perform _initialize initialization. */
extern void gdb_init (char *);

View File

@ -1,22 +0,0 @@
2003-07-11 Elena Zannoni <ezannoni@redhat.com>
* lib/gdb.exp (setup_kfail, kfail): Redefine procedures.
--- ./gdb/testsuite/lib/gdb.exp.1 2004-11-24 15:59:46.131394720 -0500
+++ ./gdb/testsuite/lib/gdb.exp 2004-11-24 16:01:06.304206600 -0500
@@ -63,6 +63,15 @@
### Only procedures should come after this point.
+if {![llength [info procs kfail]]} {
+ proc setup_kfail { args } {
+ #setup_xfail args
+ }
+ proc kfail { bugid message } {
+ fail $message
+ }
+}
+
#
# gdb_version -- extract and print the version number of GDB
#

View File

@ -1,13 +1,20 @@
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-rh-testversion-20041202.patch
;; Match the Fedora's version info.
;;=fedora
2003-02-24 Elena Zannoni <ezannoni@redhat.com>
* gdb.gdb/selftest.exp: Add matching on specific Red Hat only version
string.
Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.gdb/selftest.exp
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/testsuite/gdb.gdb/selftest.exp 2010-06-26 08:44:47.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/testsuite/gdb.gdb/selftest.exp 2010-07-12 09:59:42.000000000 +0200
@@ -342,6 +342,9 @@ proc test_with_self { executable } {
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -53,6 +53,9 @@ proc test_with_self { } {
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
pass "printed version with cast"
}
@ -16,4 +23,16 @@ Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.gdb/selftest.exp
+ }
}
do_steps_and_nexts
# start the "xgdb" process
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)
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;
- sscanf (version, "%d.%d.%d", &vmajor, &vminor, &vrevision);
+ sscanf (version, "Fedora %d.%d.%d", &vmajor, &vminor, &vrevision);
set_internalvar_integer (major_version_var, vmajor);
set_internalvar_integer (minor_version_var, vminor + (vrevision > 0));
}

View File

@ -1,7 +1,15 @@
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/constructortest.cc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/constructortest.cc 2016-02-16 09:49:08.681886201 +0100
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-test-dtorfix-20050121.patch
;; Test support of multiple destructors just like multiple constructors
;;=fedoratest
diff --git a/gdb/testsuite/gdb.cp/constructortest.cc b/gdb/testsuite/gdb.cp/constructortest.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/constructortest.cc
@@ -0,0 +1,99 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -102,10 +110,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/constructortest.cc
+{
+ y = 2; /* First line D */
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/constructortest.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/constructortest.exp 2016-02-16 09:52:12.609130779 +0100
diff --git a/gdb/testsuite/gdb.cp/constructortest.exp b/gdb/testsuite/gdb.cp/constructortest.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/constructortest.exp
@@ -0,0 +1,130 @@
+# This testcase is part of GDB, the GNU debugger.
+

View File

@ -1,13 +1,21 @@
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-movedir-20050125.patch
;; Fix to support executable moving
;;=fedoratest
2005-01-25 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/move-dir.exp: New test.
* gdb.base/move-dir.c: Ditto.
* gdb.base/move-dir.h: Ditto.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.c 2016-02-15 23:23:02.892499288 +0100
diff --git a/gdb/testsuite/gdb.base/move-dir.c b/gdb/testsuite/gdb.base/move-dir.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/move-dir.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <stdlib.h>
@ -19,10 +27,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.c
+ other();
+}
+
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.exp 2016-02-15 23:29:58.768461406 +0100
diff --git a/gdb/testsuite/gdb.base/move-dir.exp b/gdb/testsuite/gdb.base/move-dir.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/move-dir.exp
@@ -0,0 +1,57 @@
+# Copyright 2005
+# Free Software Foundation, Inc.
@ -81,10 +89,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.exp
+
+set timeout $oldtimeout
+return 0
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.h 2016-02-15 23:23:02.892499288 +0100
diff --git a/gdb/testsuite/gdb.base/move-dir.h b/gdb/testsuite/gdb.base/move-dir.h
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/move-dir.h
@@ -0,0 +1,7 @@
+#include <stdlib.h>
+

View File

@ -1,7 +1,15 @@
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/attach.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/attach.c 2016-02-15 23:23:02.843498936 +0100
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-test-pie-20050107.patch
;; VSYSCALL and PIE
;;=fedoratest
diff --git a/gdb/testsuite/gdb.pie/attach.c b/gdb/testsuite/gdb.pie/attach.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/attach.c
@@ -0,0 +1,20 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
@ -23,386 +31,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/attach.c
+ }
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/attach2.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/attach2.c 2016-02-15 23:23:02.843498936 +0100
@@ -0,0 +1,24 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
+ is exited when & if the variable 'should_exit' is non-zero. (It
+ is initialized to zero in this program, so the loop will never
+ exit unless/until gdb sets the variable to non-zero.)
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int should_exit = 0;
+
+int main ()
+{
+ int local_i = 0;
+
+ sleep( 10 ); /* System call causes register fetch to fail */
+ /* This is a known HPUX "feature" */
+ while (! should_exit)
+ {
+ local_i++;
+ }
+ return (0);
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/break.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/break.c 2016-02-15 23:23:02.844498943 +0100
@@ -0,0 +1,146 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#ifdef vxworks
+
+# include <stdio.h>
+
+/* VxWorks does not supply atoi. */
+static int
+atoi (z)
+ char *z;
+{
+ int i = 0;
+
+ while (*z >= '0' && *z <= '9')
+ i = i * 10 + (*z++ - '0');
+ return i;
+}
+
+/* I don't know of any way to pass an array to VxWorks. This function
+ can be called directly from gdb. */
+
+vxmain (arg)
+char *arg;
+{
+ char *argv[2];
+
+ argv[0] = "";
+ argv[1] = arg;
+ main (2, argv, (char **) 0);
+}
+
+#else /* ! vxworks */
+# include <stdio.h>
+# include <stdlib.h>
+#endif /* ! vxworks */
+
+#ifdef PROTOTYPES
+extern int marker1 (void);
+extern int marker2 (int a);
+extern void marker3 (char *a, char *b);
+extern void marker4 (long d);
+#else
+extern int marker1 ();
+extern int marker2 ();
+extern void marker3 ();
+extern void marker4 ();
+#endif
+
+/*
+ * This simple classical example of recursion is useful for
+ * testing stack backtraces and such.
+ */
+
+#ifdef PROTOTYPES
+int factorial(int);
+
+int
+main (int argc, char **argv, char **envp)
+#else
+int
+main (argc, argv, envp)
+int argc;
+char *argv[], **envp;
+#endif
+{
+#ifdef usestubs
+ set_debug_traps(); /* set breakpoint 5 here */
+ breakpoint();
+#endif
+ if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
+ fprintf (stderr, "usage: factorial <number>\n");
+ return 1;
+ }
+ printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */
+ /* set breakpoint 12 here */
+ marker1 (); /* set breakpoint 11 here */
+ marker2 (43); /* set breakpoint 20 here */
+ marker3 ("stack", "trace"); /* set breakpoint 21 here */
+ marker4 (177601976L);
+ argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
+ return argc; /* set breakpoint 10 here */
+}
+
+#ifdef PROTOTYPES
+int factorial (int value)
+#else
+int factorial (value)
+int value;
+#endif
+{
+ if (value > 1) { /* set breakpoint 7 here */
+ value *= factorial (value - 1);
+ }
+ return (value); /* set breakpoint 19 here */
+}
+
+#ifdef PROTOTYPES
+int multi_line_if_conditional (int a, int b, int c)
+#else
+int multi_line_if_conditional (a, b, c)
+ int a, b, c;
+#endif
+{
+ if (a /* set breakpoint 3 here */
+ && b
+ && c)
+ return 0;
+ else
+ return 1;
+}
+
+#ifdef PROTOTYPES
+int multi_line_while_conditional (int a, int b, int c)
+#else
+int multi_line_while_conditional (a, b, c)
+ int a, b, c;
+#endif
+{
+ while (a /* set breakpoint 4 here */
+ && b
+ && c)
+ {
+ a--, b--, c--;
+ }
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/break1.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/break1.c 2016-02-15 23:23:02.844498943 +0100
@@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+/* The code for this file was extracted from the gdb testsuite
+ testcase "break.c". */
+
+/* The following functions do nothing useful. They are included
+ simply as places to try setting breakpoints at. They are
+ explicitly "one-line functions" to verify that this case works
+ (some versions of gcc have or have had problems with this).
+
+ These functions are in a separate source file to prevent an
+ optimizing compiler from inlining them and optimizing them away. */
+
+#ifdef PROTOTYPES
+int marker1 (void) { return (0); } /* set breakpoint 15 here */
+int marker2 (int a) { return (1); } /* set breakpoint 8 here */
+void marker3 (char *a, char *b) {} /* set breakpoint 17 here */
+void marker4 (long d) {} /* set breakpoint 14 here */
+#else
+int marker1 () { return (0); } /* set breakpoint 16 here */
+int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+void marker4 (d) long d; {} /* set breakpoint 13 here */
+#endif
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/coremaker.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/coremaker.c 2016-02-15 23:23:02.844498943 +0100
@@ -0,0 +1,142 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 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. */
+
+/* Simple little program that just generates a core dump from inside some
+ nested function calls. */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifndef __STDC__
+#define const /**/
+#endif
+
+#define MAPSIZE (8 * 1024)
+
+/* Don't make these automatic vars or we will have to walk back up the
+ stack to access them. */
+
+char *buf1;
+char *buf2;
+
+int coremaker_data = 1; /* In Data section */
+int coremaker_bss; /* In BSS section */
+
+const int coremaker_ro = 201; /* In Read-Only Data section */
+
+/* Note that if the mapping fails for any reason, we set buf2
+ to -1 and the testsuite notices this and reports it as
+ a failure due to a mapping error. This way we don't have
+ to test for specific errors when running the core maker. */
+
+void
+mmapdata ()
+{
+ int j, fd;
+
+ /* Allocate and initialize a buffer that will be used to write
+ the file that is later mapped in. */
+
+ buf1 = (char *) malloc (MAPSIZE);
+ for (j = 0; j < MAPSIZE; ++j)
+ {
+ buf1[j] = j;
+ }
+
+ /* Write the file to map in */
+
+ fd = open ("coremmap.data", O_CREAT | O_RDWR, 0666);
+ if (fd == -1)
+ {
+ perror ("coremmap.data open failed");
+ buf2 = (char *) -1;
+ return;
+ }
+ write (fd, buf1, MAPSIZE);
+
+ /* Now map the file into our address space as buf2 */
+
+ buf2 = (char *) mmap (0, MAPSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+ if (buf2 == (char *) -1)
+ {
+ perror ("mmap failed");
+ return;
+ }
+
+ /* Verify that the original data and the mapped data are identical.
+ If not, we'd rather fail now than when trying to access the mapped
+ data from the core file. */
+
+ for (j = 0; j < MAPSIZE; ++j)
+ {
+ if (buf1[j] != buf2[j])
+ {
+ fprintf (stderr, "mapped data is incorrect");
+ buf2 = (char *) -1;
+ return;
+ }
+ }
+}
+
+void
+func2 ()
+{
+ int coremaker_local[5];
+ int i;
+
+#ifdef SA_FULLDUMP
+ /* Force a corefile that includes the data section for AIX. */
+ {
+ struct sigaction sa;
+
+ sigaction (SIGABRT, (struct sigaction *)0, &sa);
+ sa.sa_flags |= SA_FULLDUMP;
+ sigaction (SIGABRT, &sa, (struct sigaction *)0);
+ }
+#endif
+
+ /* Make sure that coremaker_local doesn't get optimized away. */
+ for (i = 0; i < 5; i++)
+ coremaker_local[i] = i;
+ coremaker_bss = 0;
+ for (i = 0; i < 5; i++)
+ coremaker_bss += coremaker_local[i];
+ coremaker_data = coremaker_ro + 1;
+ abort ();
+}
+
+void
+func1 ()
+{
+ func2 ();
+}
+
+int main ()
+{
+ mmapdata ();
+ func1 ();
+ return 0;
+}
+
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/attach.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/attach.exp 2016-02-15 23:37:15.190560048 +0100
diff --git a/gdb/testsuite/gdb.pie/attach.exp b/gdb/testsuite/gdb.pie/attach.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/attach.exp
@@ -0,0 +1,416 @@
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+
@ -820,10 +452,190 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/attach.exp
+do_call_attach_tests
+
+return 0
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/break.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/break.exp 2016-02-15 23:37:15.191560055 +0100
diff --git a/gdb/testsuite/gdb.pie/attach2.c b/gdb/testsuite/gdb.pie/attach2.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/attach2.c
@@ -0,0 +1,24 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
+ is exited when & if the variable 'should_exit' is non-zero. (It
+ is initialized to zero in this program, so the loop will never
+ exit unless/until gdb sets the variable to non-zero.)
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int should_exit = 0;
+
+int main ()
+{
+ int local_i = 0;
+
+ sleep( 10 ); /* System call causes register fetch to fail */
+ /* This is a known HPUX "feature" */
+ while (! should_exit)
+ {
+ local_i++;
+ }
+ return (0);
+}
diff --git a/gdb/testsuite/gdb.pie/break.c b/gdb/testsuite/gdb.pie/break.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/break.c
@@ -0,0 +1,146 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#ifdef vxworks
+
+# include <stdio.h>
+
+/* VxWorks does not supply atoi. */
+static int
+atoi (z)
+ char *z;
+{
+ int i = 0;
+
+ while (*z >= '0' && *z <= '9')
+ i = i * 10 + (*z++ - '0');
+ return i;
+}
+
+/* I don't know of any way to pass an array to VxWorks. This function
+ can be called directly from gdb. */
+
+vxmain (arg)
+char *arg;
+{
+ char *argv[2];
+
+ argv[0] = "";
+ argv[1] = arg;
+ main (2, argv, (char **) 0);
+}
+
+#else /* ! vxworks */
+# include <stdio.h>
+# include <stdlib.h>
+#endif /* ! vxworks */
+
+#ifdef PROTOTYPES
+extern int marker1 (void);
+extern int marker2 (int a);
+extern void marker3 (char *a, char *b);
+extern void marker4 (long d);
+#else
+extern int marker1 ();
+extern int marker2 ();
+extern void marker3 ();
+extern void marker4 ();
+#endif
+
+/*
+ * This simple classical example of recursion is useful for
+ * testing stack backtraces and such.
+ */
+
+#ifdef PROTOTYPES
+int factorial(int);
+
+int
+main (int argc, char **argv, char **envp)
+#else
+int
+main (argc, argv, envp)
+int argc;
+char *argv[], **envp;
+#endif
+{
+#ifdef usestubs
+ set_debug_traps(); /* set breakpoint 5 here */
+ breakpoint();
+#endif
+ if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
+ fprintf (stderr, "usage: factorial <number>\n");
+ return 1;
+ }
+ printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */
+ /* set breakpoint 12 here */
+ marker1 (); /* set breakpoint 11 here */
+ marker2 (43); /* set breakpoint 20 here */
+ marker3 ("stack", "trace"); /* set breakpoint 21 here */
+ marker4 (177601976L);
+ argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
+ return argc; /* set breakpoint 10 here */
+}
+
+#ifdef PROTOTYPES
+int factorial (int value)
+#else
+int factorial (value)
+int value;
+#endif
+{
+ if (value > 1) { /* set breakpoint 7 here */
+ value *= factorial (value - 1);
+ }
+ return (value); /* set breakpoint 19 here */
+}
+
+#ifdef PROTOTYPES
+int multi_line_if_conditional (int a, int b, int c)
+#else
+int multi_line_if_conditional (a, b, c)
+ int a, b, c;
+#endif
+{
+ if (a /* set breakpoint 3 here */
+ && b
+ && c)
+ return 0;
+ else
+ return 1;
+}
+
+#ifdef PROTOTYPES
+int multi_line_while_conditional (int a, int b, int c)
+#else
+int multi_line_while_conditional (a, b, c)
+ int a, b, c;
+#endif
+{
+ while (a /* set breakpoint 4 here */
+ && b
+ && c)
+ {
+ a--, b--, c--;
+ }
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.pie/break.exp b/gdb/testsuite/gdb.pie/break.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/break.exp
@@ -0,0 +1,954 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004
@ -1779,10 +1591,59 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/break.exp
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/corefile.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/corefile.exp 2016-02-15 23:37:15.191560055 +0100
diff --git a/gdb/testsuite/gdb.pie/break1.c b/gdb/testsuite/gdb.pie/break1.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/break1.c
@@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+/* The code for this file was extracted from the gdb testsuite
+ testcase "break.c". */
+
+/* The following functions do nothing useful. They are included
+ simply as places to try setting breakpoints at. They are
+ explicitly "one-line functions" to verify that this case works
+ (some versions of gcc have or have had problems with this).
+
+ These functions are in a separate source file to prevent an
+ optimizing compiler from inlining them and optimizing them away. */
+
+#ifdef PROTOTYPES
+int marker1 (void) { return (0); } /* set breakpoint 15 here */
+int marker2 (int a) { return (1); } /* set breakpoint 8 here */
+void marker3 (char *a, char *b) {} /* set breakpoint 17 here */
+void marker4 (long d) {} /* set breakpoint 14 here */
+#else
+int marker1 () { return (0); } /* set breakpoint 16 here */
+int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+void marker4 (d) long d; {} /* set breakpoint 13 here */
+#endif
diff --git a/gdb/testsuite/gdb.pie/corefile.exp b/gdb/testsuite/gdb.pie/corefile.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/corefile.exp
@@ -0,0 +1,233 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
@ -2017,3 +1878,150 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pie/corefile.exp
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
+
+gdb_test "core" "No core file now."
diff --git a/gdb/testsuite/gdb.pie/coremaker.c b/gdb/testsuite/gdb.pie/coremaker.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/coremaker.c
@@ -0,0 +1,142 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 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. */
+
+/* Simple little program that just generates a core dump from inside some
+ nested function calls. */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifndef __STDC__
+#define const /**/
+#endif
+
+#define MAPSIZE (8 * 1024)
+
+/* Don't make these automatic vars or we will have to walk back up the
+ stack to access them. */
+
+char *buf1;
+char *buf2;
+
+int coremaker_data = 1; /* In Data section */
+int coremaker_bss; /* In BSS section */
+
+const int coremaker_ro = 201; /* In Read-Only Data section */
+
+/* Note that if the mapping fails for any reason, we set buf2
+ to -1 and the testsuite notices this and reports it as
+ a failure due to a mapping error. This way we don't have
+ to test for specific errors when running the core maker. */
+
+void
+mmapdata ()
+{
+ int j, fd;
+
+ /* Allocate and initialize a buffer that will be used to write
+ the file that is later mapped in. */
+
+ buf1 = (char *) malloc (MAPSIZE);
+ for (j = 0; j < MAPSIZE; ++j)
+ {
+ buf1[j] = j;
+ }
+
+ /* Write the file to map in */
+
+ fd = open ("coremmap.data", O_CREAT | O_RDWR, 0666);
+ if (fd == -1)
+ {
+ perror ("coremmap.data open failed");
+ buf2 = (char *) -1;
+ return;
+ }
+ write (fd, buf1, MAPSIZE);
+
+ /* Now map the file into our address space as buf2 */
+
+ buf2 = (char *) mmap (0, MAPSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+ if (buf2 == (char *) -1)
+ {
+ perror ("mmap failed");
+ return;
+ }
+
+ /* Verify that the original data and the mapped data are identical.
+ If not, we'd rather fail now than when trying to access the mapped
+ data from the core file. */
+
+ for (j = 0; j < MAPSIZE; ++j)
+ {
+ if (buf1[j] != buf2[j])
+ {
+ fprintf (stderr, "mapped data is incorrect");
+ buf2 = (char *) -1;
+ return;
+ }
+ }
+}
+
+void
+func2 ()
+{
+ int coremaker_local[5];
+ int i;
+
+#ifdef SA_FULLDUMP
+ /* Force a corefile that includes the data section for AIX. */
+ {
+ struct sigaction sa;
+
+ sigaction (SIGABRT, (struct sigaction *)0, &sa);
+ sa.sa_flags |= SA_FULLDUMP;
+ sigaction (SIGABRT, &sa, (struct sigaction *)0);
+ }
+#endif
+
+ /* Make sure that coremaker_local doesn't get optimized away. */
+ for (i = 0; i < 5; i++)
+ coremaker_local[i] = i;
+ coremaker_bss = 0;
+ for (i = 0; i < 5; i++)
+ coremaker_bss += coremaker_local[i];
+ coremaker_data = coremaker_ro + 1;
+ abort ();
+}
+
+void
+func1 ()
+{
+ func2 ();
+}
+
+int main ()
+{
+ mmapdata ();
+ func1 ();
+ return 0;
+}
+

View File

@ -1,3 +1,11 @@
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
@ -6,11 +14,10 @@
* gdb.gdb/xfullpath.exp: Ditto.
* gdb.gdb/observer.exp: Ditto.
Index: gdb-7.6.90.20140127/gdb/testsuite/lib/selftest-support.exp
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/testsuite/lib/selftest-support.exp 2014-01-27 22:42:04.022535966 +0100
+++ gdb-7.6.90.20140127/gdb/testsuite/lib/selftest-support.exp 2014-01-27 22:42:42.630565675 +0100
@@ -136,18 +136,18 @@ proc do_self_tests {function body} {
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.

View File

@ -1,3 +1,11 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jeff Johnston <jjohnstn@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-threaded-watchpoints2-20050225.patch
;; Test sibling threads to set threaded watchpoints for x86 and x86-64
;;=fedoratest
2005-02-28 Jeff Johnston <jjohnstn@redhat.com>
* config/i386/nm-linux.h: Change dr register routines to
@ -42,10 +50,10 @@
FIXME: The testcase does not expects multiple watchpoints hits per one stop.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/watchthreads-threaded.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/watchthreads-threaded.c 2016-02-15 23:37:39.766734541 +0100
diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.c b/gdb/testsuite/gdb.threads/watchthreads-threaded.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.c
@@ -0,0 +1,66 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -113,10 +121,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/watchthreads-threaded.c
+ pthread_exit(NULL);
+}
+
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/watchthreads-threaded.exp 2016-02-15 23:40:32.484960858 +0100
diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
@@ -0,0 +1,126 @@
+# This testcase is part of GDB, the GNU debugger.
+

View File

@ -1,7 +1,15 @@
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.c 2016-02-15 23:37:39.884735379 +0100
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-BEA-testsuite.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.
diff --git a/gdb/testsuite/gdb.threads/threadcrash.c b/gdb/testsuite/gdb.threads/threadcrash.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/threadcrash.c
@@ -0,0 +1,301 @@
+/*
+ * The point of this program is to crash in a multi-threaded app.
@ -304,10 +312,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.c
+
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.exp 2016-02-15 23:38:58.486293458 +0100
diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/threadcrash.exp
@@ -0,0 +1,37 @@
+# threadcrash.exp - The point of this program is to crash in a multi-threaded app.
+
@ -346,10 +354,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.exp
+}
+
+return 0
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.sh
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.sh 2016-02-15 23:37:39.885735386 +0100
diff --git a/gdb/testsuite/gdb.threads/threadcrash.sh b/gdb/testsuite/gdb.threads/threadcrash.sh
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/threadcrash.sh
@@ -0,0 +1,324 @@
+#! /bin/bash
+
@ -675,10 +683,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.sh
+rm -rf $WORKDIR
+
+exit $FAILURES
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.sh-orig
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.sh-orig 2016-02-15 23:37:39.885735386 +0100
diff --git a/gdb/testsuite/gdb.threads/threadcrash.sh-orig b/gdb/testsuite/gdb.threads/threadcrash.sh-orig
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/threadcrash.sh-orig
@@ -0,0 +1,248 @@
+#! /bin/bash
+

View File

@ -1,3 +1,11 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
;; Find symbols properly at their original (included) file (BZ 109921).
;;=fedoratest
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921
It is duplicite to its upstream variant:
@ -16,10 +24,10 @@ http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
* gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c,
gdb.dwarf2/dw2-included.h: New files.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.c 2016-02-16 09:52:29.861247534 +0100
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.c b/gdb/testsuite/gdb.dwarf2/dw2-included.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.c
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -47,10 +55,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.c
+{
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.exp 2016-02-16 09:52:36.481292330 +0100
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.exp b/gdb/testsuite/gdb.dwarf2/dw2-included.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.exp
@@ -0,0 +1,47 @@
+# Copyright 2006 Free Software Foundation, Inc.
+
@ -98,11 +106,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.exp
+gdb_test "list integer" "int integer;\r"
+gdb_test "ptype integer" "type = int\r"
+# Path varies depending on the build location.
+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\nint integer;\r"
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.h 2016-02-16 09:52:29.862247541 +0100
+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\n${decimal}:.*int integer;\r"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.h b/gdb/testsuite/gdb.dwarf2/dw2-included.h
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.h
@@ -0,0 +1,20 @@
+/* This testcase is part of GDB, the GNU debugger.
+

View File

@ -1,3 +1,11 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
;;=push+jan: It should be replaced by Infinity project.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
@ -24,7 +32,6 @@ call invalidates `struct frame *' in the callers - RH BZ 690908.
https://bugzilla.redhat.com/show_bug.cgi?id=1166549
2007-11-03 Jan Kratochvil <jan.kratochvil@redhat.com>
* ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer
@ -34,25 +41,24 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
<81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location
<81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
Index: gdb-7.10.90.20160211/gdb/printcmd.c
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/printcmd.c 2016-02-15 23:29:53.062420893 +0100
+++ gdb-7.10.90.20160211/gdb/printcmd.c 2016-02-15 23:33:31.068968762 +0100
@@ -1003,6 +1003,10 @@
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)
if (exp && *exp)
if (exp != nullptr && *exp)
{
+ /* '*((int *(*) (void)) __errno_location) ()' is incompatible with
+ function descriptors. */
+ if (target_has_execution && strcmp (exp, "errno") == 0)
+ exp = "*(*(int *(*)(void)) __errno_location) ()";
expr = parse_expression (exp);
make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2016-02-15 23:30:20.703617148 +0100
expression_up expr = parse_expression (exp);
val = evaluate_expression (expr.get ());
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -82,10 +88,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+
+ return 0; /* breakpoint */
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2016-02-15 23:35:25.582781821 +0100
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
@@ -0,0 +1,60 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@ -147,10 +153,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+
+# TODO: Test the error on resolving ERRNO with only libc loaded.
+# Just how to find the current libc filename?
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno2.c 2016-02-15 23:30:20.703617148 +0100
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -180,10 +186,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
+
+ return 0; /* breakpoint */
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp 2016-02-15 23:35:25.582781821 +0100
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
@@ -0,0 +1,71 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@ -225,7 +231,7 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
+ if $do_xfail {
+ setup_xfail "*-*-*"
+ }
+ gdb_test "print errno" ".* = 42" "print errno for core"
+ gdb_test "print (int) errno" ".* = 42" "print errno for core"
+}}
+
+set variant g2thrN

View File

@ -1,17 +0,0 @@
Index: gdb-7.4.50.20120602/gdb/symfile.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/symfile.c 2012-06-02 18:25:20.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/symfile.c 2012-06-02 18:26:36.145232057 +0200
@@ -3630,6 +3630,12 @@ default_symfile_relocate (struct objfile
DWO file. */
bfd *abfd = sectp->owner;
+ /* Executable files have all the relocations already resolved.
+ Handle files linked with --emit-relocs.
+ http://sources.redhat.com/ml/gdb/2006-08/msg00137.html */
+ if ((abfd->flags & EXEC_P) != 0)
+ return NULL;
+
/* We're only interested in sections with relocation
information. */
if ((sectp->flags & SEC_RELOC) == 0)

View File

@ -1,300 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
FIXME: This workaround should be dropped and
glibc/sysdeps/unix/sysv/linux/x86_64/clone.S should get CFI for the child
instead.
2006-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb/amd64-linux-tdep.c (linux_clone_code): New variable.
(LINUX_CLONE_LEN): New definition.
(amd64_linux_clone_running, amd64_linux_outermost_frame): New function.
(amd64_linux_init_abi): Initialize `outermost_frame_p'.
* gdb/i386-tdep.c (i386_gdbarch_init): Likewise.
* gdb/i386-tdep.h (gdbarch_tdep): Add `outermost_frame_p' member.
* gdb/amd64-tdep.c (amd64_frame_this_id): Call `outermost_frame_p'.
2006-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.threads/bt-clone-stop.exp, gdb.threads/bt-clone-stop.c:
New file.
2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/amd64-linux-tdep.c 2016-02-15 23:37:06.936501443 +0100
+++ gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c 2016-02-15 23:37:39.928735691 +0100
@@ -292,6 +292,80 @@
/* Set the program counter for process PTID to PC. */
+/* Detect the outermost frame; during unwind of
+ #5 0x000000305cec68c3 in clone () from /lib64/tls/libc.so.6
+ avoid the additional bogus frame
+ #6 0x0000000000000000 in ??
+ We compare if the `linux_clone_code' block is _before_ unwound PC. */
+
+static const unsigned char linux_clone_code[] =
+{
+/* libc/sysdeps/unix/sysv/linux/x86_64/clone.S */
+/* #ifdef RESET_PID */
+/* ... */
+/* mov $SYS_ify(getpid), %eax */
+/* 0xb8, 0x27, 0x00, 0x00, 0x00 */
+/* OR */
+/* mov $SYS_ify(getpid), %rax */
+/* 0x48, 0xc7, 0xc0, 0x27, 0x00, 0x00, 0x00 */
+/* so just: */
+ 0x27, 0x00, 0x00, 0x00,
+/* syscall */
+ 0x0f, 0x05,
+/* movl %eax, %fs:PID */
+ 0x64, 0x89, 0x04, 0x25, 0x94, 0x00, 0x00, 0x00,
+/* movl %eax, %fs:TID */
+ 0x64, 0x89, 0x04, 0x25, 0x90, 0x00, 0x00, 0x00,
+/* #endif */
+/* |* Set up arguments for the function call. *| */
+/* popq %rax |* Function to call. *| */
+ 0x58,
+/* popq %rdi |* Argument. *| */
+ 0x5f,
+/* call *%rax$ */
+ 0xff, 0xd0
+};
+
+#define LINUX_CLONE_LEN (sizeof linux_clone_code)
+
+static int
+amd64_linux_clone_running (struct frame_info *this_frame)
+{
+ CORE_ADDR pc = get_frame_pc (this_frame);
+ unsigned char buf[LINUX_CLONE_LEN];
+
+ if (!safe_frame_unwind_memory (this_frame, pc - LINUX_CLONE_LEN, buf,
+ LINUX_CLONE_LEN))
+ return 0;
+
+ if (memcmp (buf, linux_clone_code, LINUX_CLONE_LEN) != 0)
+ return 0;
+
+ return 1;
+}
+
+static int
+amd64_linux_outermost_frame (struct frame_info *this_frame)
+{
+ CORE_ADDR pc = get_frame_pc (this_frame);
+ const char *name;
+
+ find_pc_partial_function (pc, &name, NULL, NULL);
+
+ /* If we have NAME, we can optimize the search.
+ `clone' NAME still needs to have the code checked as its name may be
+ present in the user code.
+ `__clone' NAME should not be present in the user code but in the initial
+ parts of the `__clone' implementation the unwind still makes sense.
+ More detailed unwinding decision would be too much sensitive to possible
+ subtle changes in specific glibc revisions. */
+ if (name == NULL || strcmp (name, "clone") == 0
+ || strcmp ("__clone", name) == 0)
+ return (amd64_linux_clone_running (this_frame) != 0);
+
+ return 0;
+}
+
static void
amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
@@ -1800,6 +1874,8 @@
tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET;
+ tdep->outermost_frame_p = amd64_linux_outermost_frame;
+
/* Add the %orig_rax register used for syscall restarting. */
set_gdbarch_write_pc (gdbarch, amd64_linux_write_pc);
Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/amd64-tdep.c 2016-02-15 23:37:06.936501443 +0100
+++ gdb-7.10.90.20160211/gdb/amd64-tdep.c 2016-02-15 23:37:39.929735698 +0100
@@ -2494,6 +2494,7 @@
{
struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
if (!cache->base_p)
return UNWIND_UNAVAILABLE;
@@ -2502,6 +2503,10 @@
if (cache->base == 0)
return UNWIND_OUTERMOST;
+ /* Detect OS dependent outermost frames; such as `clone'. */
+ if (tdep->outermost_frame_p && tdep->outermost_frame_p (this_frame))
+ return UNWIND_OUTERMOST;
+
return UNWIND_NO_REASON;
}
@@ -2636,6 +2641,7 @@
{
struct amd64_frame_cache *cache =
amd64_sigtramp_frame_cache (this_frame, this_cache);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
if (!cache->base_p)
(*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame));
@@ -2644,6 +2650,11 @@
/* This marks the outermost frame. */
return;
}
+ else if (tdep->outermost_frame_p && tdep->outermost_frame_p (this_frame))
+ {
+ /* Detect OS dependent outermost frames; such as `clone'. */
+ return;
+ }
else
(*this_id) = frame_id_build (cache->base + 16, get_frame_pc (this_frame));
}
Index: gdb-7.10.90.20160211/gdb/i386-tdep.c
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/i386-tdep.c 2016-02-15 23:37:06.936501443 +0100
+++ gdb-7.10.90.20160211/gdb/i386-tdep.c 2016-02-15 23:37:39.931735713 +0100
@@ -8305,6 +8305,9 @@
tdep->xsave_xcr0_offset = -1;
+ /* Unwinding stops on i386 automatically. */
+ tdep->outermost_frame_p = NULL;
+
tdep->record_regmap = i386_record_regmap;
set_gdbarch_long_long_align_bit (gdbarch, 32);
Index: gdb-7.10.90.20160211/gdb/i386-tdep.h
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/i386-tdep.h 2016-02-15 23:37:06.936501443 +0100
+++ gdb-7.10.90.20160211/gdb/i386-tdep.h 2016-02-15 23:37:39.932735720 +0100
@@ -240,6 +240,9 @@
/* Regsets. */
const struct regset *fpregset;
+
+ /* Detect OS dependent outermost frames; such as `clone'. */
+ int (*outermost_frame_p) (struct frame_info *this_frame);
};
/* Floating-point registers. */
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c 2016-02-15 23:37:39.932735720 +0100
@@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ 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., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+
+#include <pthread.h>
+#include <unistd.h>
+#include <assert.h>
+
+
+void *threader (void *arg)
+{
+ assert (0);
+ return NULL;
+}
+
+int main (void)
+{
+ pthread_t t1;
+
+ pthread_create (&t1, NULL, threader, (void *) NULL);
+ for (;;)
+ pause();
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2016-02-15 23:37:56.197851204 +0100
@@ -0,0 +1,61 @@
+# 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.
+
+# Backtraced `clone' must not have `PC == 0' as its previous frame.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile bt-clone-stop
+set srcfile ${testfile}.c
+set binfile [standard_output_file ${testfile}]
+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# threader: threader.c:8: threader: Assertion `0' failed.
+# Program received signal SIGABRT, Aborted.
+
+gdb_test "run" \
+ {Thread 2 "bt-clone-stop" received signal SIGABRT.*} \
+ "run"
+
+# Former gdb unwind (the first function is `clone'):
+# #5 0x0000003421ecd62d in ?? () from /lib64/libc.so.6
+# #6 0x0000000000000000 in ?? ()
+# (gdb)
+# Tested `amd64_linux_outermost_frame' functionality should omit the line `#6'.
+#
+# Two `-re' cases below must be in this order (1st is a subset of the 2nd one).
+# Unhandled case below should not happen and it is fortunately handled by
+# `amd64_linux_outermost_frame' as FAIL (and result `0x0 entry output invalid').
+gdb_test_multiple "bt" "0x0 entry output invalid" {
+ -re "in threader \\(.*\n#\[0-9\]* *0x0* in .*$gdb_prompt $" {
+ fail "0x0 entry found"
+ }
+ -re "in threader \\(.*$gdb_prompt $" {
+ pass "0x0 entry not found"
+ }
+}

View File

@ -1,10 +1,50 @@
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-ppc-solib-trampoline-test.patch
;; Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
;;=fedoratest
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.exp 2016-02-15 23:31:47.312232078 +0100
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.c b/gdb/testsuite/gdb.base/step-over-trampoline.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ 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.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <stdio.h>
+
+int main (void)
+{
+ puts ("hello world");
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb.base/step-over-trampoline.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp
@@ -0,0 +1,54 @@
+# Copyright 2006 Free Software Foundation, Inc.
+
@ -60,36 +100,3 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.exp
+ fail "stepped into trampoline"
+ }
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.c 2016-02-15 23:30:54.698858518 +0100
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ 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.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <stdio.h>
+
+int main (void)
+{
+ puts ("hello world");
+ return 0;
+}

View File

@ -1,12 +1,18 @@
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
Index: gdb-7.7.90.20140613/gdb/symtab.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/symtab.c 2014-06-13 21:52:06.219338401 +0200
+++ gdb-7.7.90.20140613/gdb/symtab.c 2014-06-13 21:55:02.753531885 +0200
@@ -2394,6 +2394,13 @@ find_pc_sect_line (CORE_ADDR pc, struct
SYMBOL_LINKAGE_NAME (msymbol)); */
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
@ -14,8 +20,8 @@ Index: gdb-7.7.90.20140613/gdb/symtab.c
+ 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_LINKAGE_NAME (msymbol.minsym), paddress (target_gdbarch (), 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
return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
}
{
/* Detect an obvious case of infinite recursion. If this

View File

@ -1,6 +1,15 @@
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp
--- gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp 1969-12-31 19:00:00.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp 2007-07-31 13:04:12.000000000 -0400
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-bz243845-stale-testing-zombie-test.patch
;; Test leftover zombie process (BZ 243845).
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp
@@ -0,0 +1,75 @@
+# Copyright 2007 Free Software Foundation, Inc.
+

View File

@ -1,7 +1,15 @@
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcore-excessive-memory.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcore-excessive-memory.c 2016-02-15 23:28:15.943731340 +0100
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-gcore-buffer-limit-test.patch
;; Test gcore memory and time requirements for large inferiors.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.c b/gdb/testsuite/gdb.base/gcore-excessive-memory.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.c
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -40,10 +48,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcore-excessive-memory.c
+
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcore-excessive-memory.exp 2016-02-15 23:28:22.720779458 +0100
diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
@@ -0,0 +1,94 @@
+# Copyright 2008 Free Software Foundation, Inc.
+

View File

@ -1,7 +1,15 @@
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/unwind-leak.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/unwind-leak.c 2016-02-15 23:32:11.307402446 +0100
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-ia64-libunwind-leak-test.patch
;; Test ia64 memory leaks of the code using libunwind.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/unwind-leak.c b/gdb/testsuite/gdb.base/unwind-leak.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/unwind-leak.c
@@ -0,0 +1,29 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -32,10 +40,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/unwind-leak.c
+ alarm (0);
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/unwind-leak.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/unwind-leak.exp 2016-02-15 23:32:18.559453937 +0100
diff --git a/gdb/testsuite/gdb.base/unwind-leak.exp b/gdb/testsuite/gdb.base/unwind-leak.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/unwind-leak.exp
@@ -0,0 +1,83 @@
+# Copyright 2007 Free Software Foundation, Inc.
+

View File

@ -1,9 +1,15 @@
Index: ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
===================================================================
RCS file: ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
diff -N ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp 15 Nov 2006 21:43:24 -0000
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-last-address-space-byte-test.patch
;; Testcase for deadlocking on last address space byte; for corrupted backtraces.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/largecore-last-address-lock.exp b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp
@@ -0,0 +1,49 @@
+# Copyright 2006 Free Software Foundation, Inc.
+

View File

@ -1,10 +1,53 @@
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-missed-trap-on-step-test.patch
;; Test hiding unexpected breakpoints on intentional step commands.
;;=fedoratest
Fix has been committed to:
gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-during-step.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-during-step.exp 2016-02-15 23:34:10.455248408 +0100
diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.c b/gdb/testsuite/gdb.base/watchpoint-during-step.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.c
@@ -0,0 +1,30 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2007 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+static int var;
+
+int main()
+{
+ var = 1;
+ var = 2;
+ var = 3;
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.exp b/gdb/testsuite/gdb.base/watchpoint-during-step.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.exp
@@ -0,0 +1,44 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@ -50,38 +93,3 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-during-step.exp
+# we step from as in this case it is a valid upstream KFAIL gdb/38
+
+gdb_test "step" ".*Old value = 2.*New value = 3.*" "Catch the watchpoint"
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-during-step.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-during-step.c 2016-02-15 23:32:51.846690279 +0100
@@ -0,0 +1,30 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2007 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+static int var;
+
+int main()
+{
+ var = 1;
+ var = 2;
+ var = 3;
+ return 0;
+}

View File

@ -1,11 +1,18 @@
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-readline-long-line-crash-test.patch
;; Fix readline segfault on excessively long hand-typed lines.
;;=fedoratest
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/readline-overflow.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/readline-overflow.exp 2016-02-15 23:30:29.191677414 +0100
@@ -0,0 +1,126 @@
diff --git a/gdb/testsuite/gdb.base/readline-overflow.exp b/gdb/testsuite/gdb.base/readline-overflow.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/readline-overflow.exp
@@ -0,0 +1,104 @@
+# Copyright 2006 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -37,98 +44,76 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/readline-overflow.exp
+ strace $tracelevel
+}
+
+# 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.
+global env
+if [info exists env(INPUTRC)] {
+ set old_inputrc $env(INPUTRC)
+}
+set env(INPUTRC) "/dev/null"
+
+set oldtimeout1 $timeout
+set timeout 600
+save_vars { env(INPUTRC) 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
+
+if [info exists env(GDBHISTFILE)] {
+ set old_gdbhistfile $env(GDBHISTFILE)
+}
+if [info exists env(HISTSIZE)] {
+ set old_histsize $env(HISTSIZE)
+}
+set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
+set env(HISTSIZE) "10"
+ # 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"
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+ set timeout 600
+
+ set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
+ set env(HISTSIZE) "10"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+
+
+set width 11
+gdb_test "set width $width" \
+ "" \
+ "Setting width to $width."
+#gdb_test "set height 1" \
+# "" \
+# "Setting height to 1."
+send_gdb "run X"
+set i 0
+# It crashes using `set width 7' on `set total 3560'.
+# Sometimes it corrupts screen on `set width 7'.
+# Bugreport used `set total 130001':
+# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
+# Check also `timeout' above.
+set total 4200
+gdb_expect {
+ set width 11
+ gdb_test "set width $width" \
+ "" \
+ "Setting width to $width."
+ #gdb_test "set height 1" \
+ # "" \
+ # "Setting height to 1."
+ send_gdb "run X"
+ set i 0
+ # It crashes using `set width 7' on `set total 3560'.
+ # Sometimes it corrupts screen on `set width 7'.
+ # Bugreport used `set total 130001':
+ # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
+ # Check also `timeout' above.
+ set total 4200
+ gdb_expect {
+ -re X {
+ incr i
+ if {$i <= $total} {
+ send_gdb "X"
+ exp_continue
+ }
+ incr i
+ if {$i <= $total} {
+ send_gdb "X"
+ exp_continue
+ }
+ }
+ -re "\[ \b\r\n\]" {
+ exp_continue
+ exp_continue
+ }
+ eof {
+ fail "gdb sending total $total characters"
+ note "Failed after sending $i characters, reason: EOF"
+ gdb_clear_suppressed
+ fail "gdb sending total $total characters"
+ note "Failed after sending $i characters, reason: EOF"
+ gdb_clear_suppressed
+ }
+ timeout {
+ fail "gdb sending total $total characters"
+ note "Failed after sending $i characters (timeout $timeout), reason: TIMEOUT"
+ gdb_clear_suppressed
+ fail "gdb sending total $total characters"
+ note "Failed after sending $i characters (timeout $timeout), reason: TIMEOUT"
+ gdb_clear_suppressed
+ }
+ default {
+ fail "gdb sending total $total characters"
+ note "Failed after sending $i characters, reason: 0=\[$expect_out(0,string)\] buffer=\[$expect_out(buffer)\]"
+ gdb_clear_suppressed
+ fail "gdb sending total $total characters"
+ note "Failed after sending $i characters, reason: 0=\[$expect_out(0,string)\] buffer=\[$expect_out(buffer)\]"
+ gdb_clear_suppressed
+ }
+ }
+ send_gdb "\r"
+ gdb_test "" \
+ "No executable file specified..*" \
+ "All the characters transferred"
+}
+send_gdb "\r"
+gdb_test "" \
+ "No executable file specified..*" \
+ "All the characters transferred"
+
+
+# Restore globals modified in this test...
+if [info exists old_inputrc] {
+ set env(INPUTRC) $old_inputrc
+} else {
+ unset env(INPUTRC)
+}
+if [info exists old_gdbhistfile] {
+ set env(GDBHISTFILE) $old_gdbhistfile
+} else {
+ unset env(GDBHISTFILE)
+}
+if [info exists old_histsize] {
+ set env(HISTSIZE) $old_histsize
+} else {
+ unset env(HISTSIZE)
+}
+set timeout $oldtimeout1
+

View File

@ -1,7 +1,15 @@
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib-lib.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib-lib.c 2016-02-15 23:27:19.654331680 +0100
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-section-num-fixup-test.patch
;; Test a crash on libraries missing the .text section.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/datalib-lib.c
@@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -25,10 +33,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib-lib.c
+ bug-gdb@prep.ai.mit.edu */
+
+int var;
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib-main.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib-main.c 2016-02-15 23:27:19.654331680 +0100
diff --git a/gdb/testsuite/gdb.base/datalib-main.c b/gdb/testsuite/gdb.base/datalib-main.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/datalib-main.c
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -56,10 +64,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib-main.c
+{
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib.exp 2016-02-15 23:27:25.968376510 +0100
diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/datalib.exp
@@ -0,0 +1,51 @@
+# Copyright 2008 Free Software Foundation, Inc.
+

View File

@ -1,15 +1,21 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-sharedlibrary-path.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.
If you provided some relative path to the shared library, such as with
export LD_LIBRARY_PATH=.
then gdb would fail to match the shared library name during the TLS lookup.
Dropped the workaround/fix for gdb-6.8.50.20081128 - is it still needed?
The testsuite needs `gdb-6.3-bz146810-solib_absolute_prefix_is_empty.patch'.
The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
2006-09-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute
@ -23,10 +29,10 @@ The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
Port to gdb-6.7.50.20080227.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug-main.c 2016-02-16 10:16:12.629875073 +0100
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-main.c b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -53,10 +59,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
+{
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c 2016-02-16 10:16:12.630875080 +0100
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
@@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -80,10 +86,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
+ bug-gdb@prep.ai.mit.edu */
+
+__thread int var = 42;
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2016-02-16 10:16:31.241001010 +0100
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug.exp b/gdb/testsuite/gdb.threads/tls-sepdebug.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug.exp
@@ -0,0 +1,87 @@
+# Copyright 2006 Free Software Foundation, Inc.
+

View File

@ -1,5 +1,11 @@
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
Subject: Re: [patch] print a more useful error message for "gdb core"
[ Fixed up since the mail. ]
@ -31,16 +37,13 @@ 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.
@ -58,19 +61,19 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
* exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core".
Index: gdb-7.9.50.20150531/gdb/exec.c
===================================================================
--- gdb-7.9.50.20150531.orig/gdb/exec.c 2015-05-31 03:48:29.000000000 +0200
+++ gdb-7.9.50.20150531/gdb/exec.c 2015-05-31 20:07:35.092878685 +0200
@@ -35,6 +35,7 @@
#include "progspace.h"
#include "gdb_bfd.h"
#include "gcore.h"
+#include "exceptions.h"
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 <fcntl.h>
#include "readline/readline.h"
@@ -298,12 +299,27 @@ exec_file_attach (const char *filename,
#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))
{
@ -85,29 +88,28 @@ Index: gdb-7.9.50.20150531/gdb/exec.c
/* Make sure to close exec_bfd, or else "run" might try to use
it. */
exec_close ();
- error (_("\"%s\": not in executable format: %s"),
- scratch_pathname,
- gdb_bfd_errmsg (bfd_get_error (), matching));
- 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);
+ _("\"%s\" is a core file.\n"
+ "Please specify an executable to debug."),
+ scratch_pathname);
+ else
+ error (_("\"%s\": not in executable format: %s"),
+ scratch_pathname,
+ gdb_bfd_errmsg (bfd_get_error (), matching));
+ 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))
Index: gdb-7.9.50.20150531/gdb/main.c
===================================================================
--- gdb-7.9.50.20150531.orig/gdb/main.c 2015-05-31 20:07:34.183872824 +0200
+++ gdb-7.9.50.20150531/gdb/main.c 2015-05-31 20:10:05.095845935 +0200
@@ -435,6 +435,37 @@ typedef struct cmdarg {
/* Define type VEC (cmdarg_s). */
DEF_VEC_O (cmdarg_s);
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
@ -116,15 +118,13 @@ Index: gdb-7.9.50.20150531/gdb/main.c
+static void
+exec_or_core_file_attach (const char *filename, int from_tty)
+{
+ volatile struct gdb_exception e;
+
+ gdb_assert (exec_bfd == NULL);
+
+ TRY
+ try
+ {
+ exec_file_attach (filename, from_tty);
+ }
+ CATCH (e, RETURN_MASK_ALL)
+ catch (gdb_exception_error &e)
+ {
+ if (e.error == IS_CORE_ERROR)
+ {
@ -135,15 +135,14 @@ Index: gdb-7.9.50.20150531/gdb/main.c
+ if (exec_bfd != NULL)
+ return;
+ }
+ throw_exception (e);
+ throw_exception (std::move (e));
+ }
+ END_CATCH
+}
+
static int
captured_main (void *data)
static void
captured_main_1 (struct captured_main_args *context)
{
@@ -923,6 +954,8 @@ captured_main (void *data)
@@ -959,6 +987,8 @@ captured_main_1 (struct captured_main_args *context)
{
symarg = argv[optind];
execarg = argv[optind];
@ -152,7 +151,7 @@ Index: gdb-7.9.50.20150531/gdb/main.c
optind++;
}
@@ -1080,11 +1113,25 @@ captured_main (void *data)
@@ -1114,12 +1144,25 @@ captured_main_1 (struct captured_main_args *context)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
@ -171,21 +170,21 @@ Index: gdb-7.9.50.20150531/gdb/main.c
/* 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! */
- if (catch_command_errors_const (exec_file_attach, execarg,
- !batch_flag))
- 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. */
+ if (catch_command_errors_const (func, execarg, !batch_flag)
+ && core_bfd == NULL)
catch_command_errors_const (symbol_file_add_main, symarg,
!batch_flag);
+ 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);
}
Index: gdb-7.9.50.20150531/gdb/common/common-exceptions.h
===================================================================
--- gdb-7.9.50.20150531.orig/gdb/common/common-exceptions.h 2015-05-31 03:48:29.000000000 +0200
+++ gdb-7.9.50.20150531/gdb/common/common-exceptions.h 2015-05-31 20:07:35.093878692 +0200
@@ -105,6 +105,9 @@ enum errors {
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,

View File

@ -1,3 +1,13 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject:
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
;; Fix 'gdb gives highly misleading error when debuginfo pkg is present,
;; but not corresponding binary pkg' (RH BZ 981154).
;;=push+jan
Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
This is the fix for RH BZ #981154
@ -15,10 +25,10 @@ Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
NULL after it is free'd, otherwise the code below thinks that it is still
valid and doesn't print the necessary warning ("Try: yum install ...").
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 2016-02-15 23:31:06.327941085 +0100
diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
@@ -0,0 +1,97 @@
+# Copyright (C) 2014 Free Software Foundation, Inc.
+
@ -117,19 +127,3 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-ins
+
+# Leaving the link there will cause breakage in the next run.
+remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"
Index: gdb-7.10.90.20160211/gdb/build-id.c
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/build-id.c 2016-02-15 23:30:55.389863424 +0100
+++ gdb-7.10.90.20160211/gdb/build-id.c 2016-02-15 23:30:55.778866186 +0100
@@ -589,7 +589,10 @@
do_cleanups (inner);
if (abfd == NULL)
- continue;
+ {
+ filename = NULL;
+ continue;
+ }
if (build_id_verify (abfd, build_id_len, build_id))
break;

View File

@ -1,20 +1,15 @@
Index: gdb-7.6.90.20140127/gdb/proc-service.list
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/proc-service.list 2014-02-06 17:32:42.810640320 +0100
+++ gdb-7.6.90.20140127/gdb/proc-service.list 2014-02-06 17:33:35.406696964 +0100
@@ -37,4 +37,7 @@
ps_pstop;
ps_ptread;
ps_ptwrite;
+
+ /* gdb-6.6-buildid-locate-rpm.patch */
+ rpmsqEnable;
};
Index: gdb-7.6.90.20140127/gdb/build-id.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/build-id.c 2014-02-06 17:30:14.230480264 +0100
+++ gdb-7.6.90.20140127/gdb/build-id.c 2014-02-06 17:34:28.846754283 +0100
@@ -677,6 +677,19 @@ build_id_to_filename (const struct elf_b
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
;;=push+jan
diff --git a/gdb/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)
#include <dlfcn.h>
#endif
@ -34,3 +29,14 @@ Index: gdb-7.6.90.20140127/gdb/build-id.c
/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
and avoid their duplicities during a single inferior run. */
diff --git a/gdb/proc-service.list b/gdb/proc-service.list
--- a/gdb/proc-service.list
+++ b/gdb/proc-service.list
@@ -37,4 +37,7 @@
ps_pstop;
ps_ptread;
ps_ptwrite;
+
+ /* gdb-6.6-buildid-locate-rpm.patch */
+ rpmsqEnable;
};

View File

@ -1,10 +1,18 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-buildid-locate-rpm-scl.patch
;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
;;=push+jan
warning: Skipping deprecated .gdb_index section
https://bugzilla.redhat.com/show_bug.cgi?id=953585
diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb/build-id.c
--- gdb-7.10.50.20160106-orig/gdb/build-id.c 2016-01-09 14:40:39.420385241 +0100
+++ gdb-7.10.50.20160106/gdb/build-id.c 2016-01-09 14:41:05.944549393 +0100
@@ -713,7 +713,11 @@ static int missing_rpm_list_entries;
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;
/* Returns the count of newly added rpms. */
static int
@ -16,7 +24,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
{
static int rpm_init_done = 0;
rpmts ts;
@@ -817,7 +821,11 @@ missing_rpm_enlist (const char *filename
@@ -849,7 +853,11 @@ missing_rpm_enlist (const char *filename)
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
if (mi != NULL)
{
@ -28,7 +36,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
{
Header h;
char *debuginfo, **slot, *s, *s2;
@@ -935,6 +943,37 @@ missing_rpm_enlist (const char *filename
@@ -967,6 +975,37 @@ missing_rpm_enlist (const char *filename)
xfree (debuginfo);
count++;
}
@ -66,10 +74,10 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
rpmdbFreeIterator_p (mi);
}
@@ -945,6 +984,21 @@ missing_rpm_enlist (const char *filename
@@ -976,6 +1015,20 @@ missing_rpm_enlist (const char *filename)
return count;
}
static int
+#ifdef GDB_INDEX_VERIFY_VENDOR
+missing_rpm_enlist (const char *filename)
+{
@ -82,16 +90,15 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
+{
+ return missing_rpm_enlist_1 (filename, 1);
+}
+
+static int
+#endif
missing_rpm_list_compar (const char *const *ap, const char *const *bp)
+
static bool
missing_rpm_list_compar (const char *ap, const char *bp)
{
return strcoll (*ap, *bp);
diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/gdb/dwarf2read.c
--- gdb-7.10.50.20160106-orig/gdb/dwarf2read.c 2016-01-09 14:40:39.416385216 +0100
+++ gdb-7.10.50.20160106/gdb/dwarf2read.c 2016-01-09 14:41:05.942549381 +0100
@@ -3111,6 +3111,16 @@ read_index_from_section (struct objfile
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,
"set use-deprecated-index-sections on". */
if (version < 6 && !deprecated_ok)
{
@ -108,7 +115,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/g
static int warning_printed = 0;
if (!warning_printed)
{
@@ -3122,6 +3132,10 @@ to use the section anyway."),
@@ -3036,6 +3046,10 @@ to use the section anyway."),
warning_printed = 1;
}
return 0;

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,32 @@
Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
===================================================================
--- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 18:18:54.526417766 +0200
+++ gdb-7.9.90.20150709/gdb/solib-svr4.c 2015-07-09 18:19:33.074746586 +0200
@@ -1381,14 +1381,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-buildid-locate-solib-missing-ids.patch
;; Fix loading of core files without build-ids but with build-ids in executables.
;; Load strictly build-id-checked core files only if no executable is specified
;; (Jan Kratochvil, RH BZ 1339862).
;;=push+jan
gdb returns an incorrect back trace when applying a debuginfo
https://bugzilla.redhat.com/show_bug.cgi?id=1339862
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1340,14 +1340,27 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
}
{
- struct bfd_build_id *build_id;
+ struct bfd_build_id *build_id = NULL;
strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1);
newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
/* May get overwritten below. */
strcpy (newobj->so_name, newobj->so_original_name);
- build_id = build_id_addr_get (newobj->lm_info->l_ld);
- build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld);
+ /* In the case the main executable was found according to its build-id
+ (from a core file) prevent loading a different build of a library
+ with accidentally the same SO_NAME.
@ -28,11 +40,11 @@ Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
+ to the only existing file loaded that time - the executable. */
+ if (symfile_objfile != NULL
+ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
+ build_id = build_id_addr_get (li->l_ld);
if (build_id != NULL)
{
char *name, *build_id_filename;
@@ -1403,23 +1416,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
@@ -1362,23 +1375,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
xfree (name);
}
else
@ -57,3 +69,169 @@ Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
xfree (build_id_filename);
xfree (build_id);
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
@@ -0,0 +1,21 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+void
+lib (void)
+{
+}
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
@@ -0,0 +1,25 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+extern void lib (void);
+
+int
+main (void)
+{
+ lib ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
@@ -0,0 +1,105 @@
+# Copyright 2016 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if {[skip_shlib_tests]} {
+ return 0
+}
+
+set testfile "gcore-buildid-exec-but-not-solib"
+set srcmainfile ${testfile}-main.c
+set srclibfile ${testfile}-lib.c
+set libfile [standard_output_file ${testfile}-lib.so]
+set objfile [standard_output_file ${testfile}-main.o]
+set executable ${testfile}-main
+set binfile [standard_output_file ${executable}]
+set gcorefile [standard_output_file ${executable}.gcore]
+set outdir [file dirname $binfile]
+
+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != ""
+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
+ unsupported "-Wl,--build-id compilation failed"
+ return -1
+}
+set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
+ unsupported "-Wl,--build-id compilation failed"
+ return -1
+}
+
+clean_restart $executable
+gdb_load_shlib $libfile
+
+# Does this gdb support gcore?
+set test "help gcore"
+gdb_test_multiple $test $test {
+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
+if { ![runto lib] } then {
+ return -1
+}
+
+set escapedfilename [string_to_regexp ${gcorefile}]
+
+set test "save a corefile"
+gdb_test_multiple "gcore ${gcorefile}" $test {
+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Can't create a corefile\r\n$gdb_prompt $" {
+ unsupported $test
+ return -1
+ }
+}
+
+# Now restart gdb and load the corefile.
+
+clean_restart $executable
+gdb_load_shlib $libfile
+
+set buildid [build_id_debug_filename_get $libfile]
+
+regsub {\.debug$} $buildid {} buildid
+
+set debugdir [standard_output_file ${testfile}-debugdir]
+file delete -force -- $debugdir
+
+file mkdir $debugdir/[file dirname $libfile]
+file copy $libfile $debugdir/${libfile}
+
+file mkdir $debugdir/[file dirname $buildid]
+file copy $libfile $debugdir/${buildid}
+
+remote_exec build "ln -s /lib ${debugdir}/"
+remote_exec build "ln -s /lib64 ${debugdir}/"
+# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2
+
+gdb_test "set solib-absolute-prefix $debugdir"
+
+gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory"
+
+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
+
+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
+
+gdb_test "bt"
+gdb_test "info shared"

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,11 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-bz229517-gcore-without-terminal.patch
;; Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
;;=fedoratest
2007-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb_gcore.sh: Redirect GDB from `</dev/null'.
@ -6,11 +14,10 @@
* gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcorebg.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcorebg.c 2016-02-16 10:44:48.998527259 +0100
diff --git a/gdb/testsuite/gdb.base/gcorebg.c b/gdb/testsuite/gdb.base/gcorebg.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcorebg.c
@@ -0,0 +1,49 @@
+#include <stdio.h>
+#include <sys/types.h>
@ -61,10 +68,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcorebg.c
+
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcorebg.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcorebg.exp 2016-02-16 10:44:48.999527265 +0100
diff --git a/gdb/testsuite/gdb.base/gcorebg.exp b/gdb/testsuite/gdb.base/gcorebg.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcorebg.exp
@@ -0,0 +1,113 @@
+# Copyright 2007 Free Software Foundation, Inc.
+

View File

@ -1,14 +1,21 @@
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-bz230000-power6-disassembly-test.patch
;; Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
;;=fedoratest
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000
The original testcase
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000#c1
requires too recent GCC.
Index: gdb-7.5.50.20130215/gdb/testsuite/gdb.arch/powerpc-power6.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.5.50.20130215/gdb/testsuite/gdb.arch/powerpc-power6.exp 2013-02-25 14:31:06.658827177 +0100
diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.exp b/gdb/testsuite/gdb.arch/powerpc-power6.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-power6.exp
@@ -0,0 +1,54 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@ -35,7 +42,7 @@ Index: gdb-7.5.50.20130215/gdb/testsuite/gdb.arch/powerpc-power6.exp
+
+set testfile "powerpc-power6"
+set srcfile ${testfile}.s
+set objfile ${objdir}/${subdir}/${testfile}.o
+set objfile [standard_output_file ${testfile}.o]
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
+ untested "PowerPC prologue tests"
@ -64,10 +71,10 @@ Index: gdb-7.5.50.20130215/gdb/testsuite/gdb.arch/powerpc-power6.exp
+gdb_test "disass func" ":\tddivq *f0,f2,f0\r\n.*" "Power6 disassembly ddivq"
+gdb_test "disass func" ":\tdcmpu *cr1,f2,f1\r\n.*" "Power6 disassembly dcmpu"
+gdb_test "disass func" ":\tdcmpuq *cr1,f2,f0\r\n.*" "Power6 disassembly dcmpuq"
Index: gdb-7.5.50.20130215/gdb/testsuite/gdb.arch/powerpc-power6.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.5.50.20130215/gdb/testsuite/gdb.arch/powerpc-power6.s 2013-02-25 14:31:06.659827178 +0100
diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.s b/gdb/testsuite/gdb.arch/powerpc-power6.s
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-power6.s
@@ -0,0 +1,16 @@
+ .text
+ .globl func

View File

@ -1,143 +0,0 @@
2008-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.8pre.
Remove the `[' character from the GDB-6.8 default message.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c 2016-02-15 23:25:36.686600598 +0100
@@ -0,0 +1,57 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2007 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <assert.h>
+#include <stdlib.h>
+
+static void func (void)
+{
+}
+
+int main (void)
+{
+ pid_t child;
+
+ child = fork ();
+ switch (child)
+ {
+ case -1:
+ abort ();
+ case 0:
+ func ();
+ break;
+ default:
+ {
+/* We do not test the switching to the other fork by GDB `fork 1'. */
+#if 0
+ pid_t got;
+
+ got = waitpid (child, NULL, 0);
+ assert (got == child);
+#endif
+ break;
+ }
+ }
+ return 0;
+}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp 2016-02-15 23:27:55.792588265 +0100
@@ -0,0 +1,36 @@
+# 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.
+
+set testfile fork-detach
+set srcfile ${testfile}.c
+set binfile [standard_output_file ${testfile}]
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_run_cmd
+# `Starting program: .*' prefix is available since gdb-6.7.
+gdb_test "" \
+ "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
+ "Info message caught"
Index: gdb-7.10.90.20160211/gdb/infrun.c
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/infrun.c 2016-02-15 23:25:01.432350289 +0100
+++ gdb-7.10.90.20160211/gdb/infrun.c 2016-02-15 23:27:49.274541986 +0100
@@ -478,7 +478,7 @@
remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
}
- if (info_verbose || debug_infrun)
+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
{
/* Ensure that we have a process ptid. */
ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/catch-syscall.exp
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/catch-syscall.exp 2016-02-15 23:25:01.432350289 +0100
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/catch-syscall.exp 2016-02-15 23:25:36.689600619 +0100
@@ -165,7 +165,7 @@
# Deleting the catchpoints
delete_breakpoints
- gdb_continue_to_end
+ gdb_continue_to_end "" continue 1
}
proc test_catch_syscall_without_args {} {
@@ -236,7 +236,7 @@
# If it doesn't, everything is right (since we don't have
# a syscall named "mlock" in it). Otherwise, this is a failure.
set thistest "catch syscall with unused syscall ($syscall_name)"
- gdb_continue_to_end $thistest
+ gdb_continue_to_end $thistest continue 1
}
}

View File

@ -1,12 +1,20 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
;; Support for stepping over PPC atomic instruction sequences (BZ 237572).
;;=fedoratest
2007-06-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.threads/atomic-seq-threaded.c,
gdb.threads/atomic-seq-threaded.exp: New files.
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c 2008-12-08 22:27:01.000000000 +0100
diff --git a/gdb/testsuite/gdb.threads/atomic-seq-threaded.c b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
@@ -0,0 +1,171 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -179,10 +187,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
+
+ return 0; /* _exit_ */
+}
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp 2008-12-08 22:31:01.000000000 +0100
diff --git a/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp b/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
@@ -0,0 +1,84 @@
+# atomic-seq-threaded.exp -- Test case for stepping over RISC atomic code seqs.
+# This variant testcases the code for stepping another thread while skipping
@ -209,7 +217,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
+
+set testfile atomic-seq-threaded
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set binfile [standard_output_file ${testfile}]
+
+foreach opts {{} {compiler=gcc4} {FAIL}} {
+ if {$opts eq "FAIL"} {

View File

@ -1,62 +0,0 @@
Index: gdb-7.10.50.20151022/gdb/infrun.c
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/infrun.c 2015-10-22 22:30:15.887224452 +0200
+++ gdb-7.10.50.20151022/gdb/infrun.c 2015-10-22 22:30:25.742282478 +0200
@@ -2175,7 +2175,7 @@ static const char *const scheduler_enums
schedlock_replay,
NULL
};
-static const char *scheduler_mode = schedlock_replay;
+static const char *scheduler_mode = schedlock_step;
static void
show_scheduler_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-cli.exp
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2015-10-22 22:29:38.352003447 +0200
+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-cli.exp 2015-10-22 22:30:15.888224458 +0200
@@ -199,7 +199,7 @@ mi_expect_stop "breakpoint-hit" "main" "
# Test that the token is output even for CLI commands
# Also test that *stopped includes frame information.
mi_gdb_test "34 next" \
- ".*34\\\^running.*\\*running,thread-id=\"all\"" \
+ ".*34\\\^running.*\\*running,thread-id=\"1\"" \
"34 next: run"
# Test that the new current source line is output to the console
Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-logging.exp
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2015-10-22 22:29:38.352003447 +0200
+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-logging.exp 2015-10-22 22:30:15.888224458 +0200
@@ -53,7 +53,7 @@ close $chan
set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
-if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
+if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
pass "Log file contents"
} else {
fail "Log file contents"
@@ -76,7 +76,7 @@ set chan [open $milogfile]
set logcontent [read $chan]
close $chan
-if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
+if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
pass "Redirect log file contents"
} else {
fail "Redirect log file contents"
Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-console.exp
===================================================================
--- gdb-7.10.50.20151022.orig/gdb/testsuite/gdb.mi/mi-console.exp 2015-10-22 22:29:38.353003453 +0200
+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-console.exp 2015-10-22 22:30:15.888224458 +0200
@@ -60,6 +60,9 @@ if { [gdb_compile "${srcdir}/${subdir}/
mi_run_to_main
+# thread-id=\"all\" vs. thread-id=\"1\" below:
+mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
+
# The output we get from the target depends on how it is hosted. If
# we are semihosted (e.g., the sim or a remote target that supports
# the File I/O remote protocol extension), we see the target I/O

View File

@ -1,8 +1,15 @@
Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/annota1.exp
===================================================================
--- gdb-7.6.50.20130731-cvs.orig/gdb/testsuite/gdb.base/annota1.exp 2013-08-02 16:23:26.559936258 +0200
+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/annota1.exp 2013-08-02 16:23:56.590976418 +0200
@@ -41,6 +41,8 @@ if { [gdb_compile "${srcdir}/${subdir}/
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-testsuite-timeouts.patch
;; Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -39,6 +39,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
clean_restart ${binfile}
@ -11,11 +18,10 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/annota1.exp
# The commands we test here produce many lines of output; disable "press
# <return> to continue" prompts.
gdb_test_no_output "set height 0"
Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/annota3.exp
===================================================================
--- gdb-7.6.50.20130731-cvs.orig/gdb/testsuite/gdb.base/annota3.exp 2013-08-02 16:23:26.560936259 +0200
+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/annota3.exp 2013-08-02 16:24:11.654996267 +0200
@@ -40,6 +40,8 @@ if { [gdb_compile "${srcdir}/${subdir}/
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
--- a/gdb/testsuite/gdb.base/annota3.exp
+++ b/gdb/testsuite/gdb.base/annota3.exp
@@ -38,6 +38,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
clean_restart ${binfile}

View File

@ -1,18 +0,0 @@
Index: gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/staticthreads.exp
===================================================================
--- gdb-7.4.50.20111219.orig/gdb/testsuite/gdb.threads/staticthreads.exp 2011-12-19 21:07:01.436475201 +0100
+++ gdb-7.4.50.20111219/gdb/testsuite/gdb.threads/staticthreads.exp 2011-12-19 22:08:55.444514127 +0100
@@ -45,6 +45,13 @@ gdb_test_no_output "set print sevenbit-s
# See if the static multi-threaded program runs.
runto_main
+
+# See if we get excessive LWP there (patched glibc with unpatched GDB):
+# * 2 Thread 135661664 (LWP 3856) main () at threadloop.c:41
+# 1 process 3856 main () at threadloop.c:41
+
+gdb_test "info threads" "^info threads\r\n\[ \t\]*Id\[ \t\]+Target Id\[ \t\]+Frame\[ \t\]*\r\n\[^\r\n\]* Thread \[^\r\n\]*" "info threads on start"
+
gdb_test "break sem_post"
set test "Continue to main's call of sem_post"
gdb_test_multiple "continue" "$test" {

View File

@ -1,707 +0,0 @@
http://sourceware.org/ml/gdb-patches/2007-12/msg00397.html
2007-12-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/i386-interface.S, gdb.arch/i386-interface.exp: New files.
2008-03-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/i386-interface.exp: Fix a testcase race.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/i386-interface.S
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/i386-interface.S 2016-02-15 23:23:03.318502357 +0100
@@ -0,0 +1,628 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@gnu.org
+
+ This file is part of the gdb testsuite.
+
+ This file was produced by:
+ $ gcj -S interface.java -ggdb2 -Wall -m32
+ from the .java file:
+ interface Interface
+ {
+ }
+ class Class implements Interface
+ {
+ }
+*/
+
+ .file "cc28Pp2B.jar"
+ .section .debug_abbrev,"",@progbits
+.Ldebug_abbrev0:
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .text
+.Ltext0:
+ .local _MT_Interface
+ .comm _MT_Interface,0,4
+ .data
+ .align 4
+ .type _catch_classes_Interface, @object
+ .size _catch_classes_Interface, 24
+_catch_classes_Interface:
+ .zero 24
+ .section .rodata
+ .align 2
+ .type _Utf1, @object
+ .size _Utf1, 4
+_Utf1:
+ .value 36121
+ .value 9
+ .ascii "Interface"
+ .zero 1
+.globl _ZN9Interface6class$E
+ .data
+ .align 32
+ .type _ZN9Interface6class$E, @object
+ .size _ZN9Interface6class$E, 144
+_ZN9Interface6class$E:
+ .long _ZTVN4java4lang5ClassE+8
+ .long 403000
+ .long _Utf1
+ .value 1536
+ .zero 2
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long _MT_Interface
+ .value 0
+ .value 6
+ .long 0
+ .long 4
+ .value 0
+ .value 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long _catch_classes_Interface
+ .long 0
+ .long 0
+ .value 0
+ .byte 1
+ .zero 1
+ .long 0
+ .value 0
+ .zero 2
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .hidden _ZN9Interface7class$$E
+.globl _ZN9Interface7class$$E
+ .section .rodata
+ .align 4
+ .type _ZN9Interface7class$$E, @object
+ .size _ZN9Interface7class$$E, 4
+_ZN9Interface7class$$E:
+ .long _ZN9Interface6class$E
+ .text
+ .align 2
+.globl _ZN5ClassC1Ev
+ .type _ZN5ClassC1Ev, @function
+_ZN5ClassC1Ev:
+.LFB2:
+ pushl %ebp
+.LCFI0:
+ movl %esp, %ebp
+.LCFI1:
+ subl $24, %esp
+.LCFI2:
+.LBB2:
+#if 0
+ .file 1 "interface.java"
+#else
+ .file "interface.java"
+#endif
+ .loc 1 4 0
+ movl 8(%ebp), %eax
+ movl %eax, -4(%ebp)
+ movl -4(%ebp), %eax
+ movl %eax, (%esp)
+ call _ZN4java4lang6ObjectC1Ev
+.LBE2:
+ leave
+ ret
+.LFE2:
+ .size _ZN5ClassC1Ev, .-_ZN5ClassC1Ev
+ .hidden _ZTVN5ClassE
+.globl _ZTVN5ClassE
+ .data
+ .align 32
+ .type _ZTVN5ClassE, @object
+ .size _ZTVN5ClassE, 40
+_ZTVN5ClassE:
+ .long 0
+ .long 0
+ .long _ZN5Class6class$E
+ .long 4
+ .long _ZN4java4lang6Object8finalizeEJvv
+ .long _ZN4java4lang6Object8hashCodeEJiv
+ .long _ZN4java4lang6Object6equalsEJbPS1_
+ .long _ZN4java4lang6Object8toStringEJPNS0_6StringEv
+ .long _ZN4java4lang6Object5cloneEJPS1_v
+ .long _ZN4java4lang6Object22throwNoSuchMethodErrorEJvv
+ .set .L_ZN5ClassC1Ev0,_ZN5ClassC1Ev
+ .section .rodata
+ .align 2
+ .type _Utf2, @object
+ .size _Utf2, 4
+_Utf2:
+ .value 626
+ .value 6
+ .ascii "<init>"
+ .zero 1
+ .align 2
+ .type _Utf3, @object
+ .size _Utf3, 4
+_Utf3:
+ .value 39797
+ .value 3
+ .ascii "()V"
+ .zero 1
+ .data
+ .align 4
+ .type _MT_Class, @object
+ .size _MT_Class, 20
+_MT_Class:
+ .long _Utf2
+ .long _Utf3
+ .value 16384
+ .value -1
+ .long .L_ZN5ClassC1Ev0
+ .long 0
+ .align 4
+ .type _IF_Class, @object
+ .size _IF_Class, 4
+_IF_Class:
+ .long _ZN9Interface6class$E
+ .align 4
+ .type _catch_classes_Class, @object
+ .size _catch_classes_Class, 24
+_catch_classes_Class:
+ .zero 24
+ .section .rodata
+ .align 2
+ .type _Utf4, @object
+ .size _Utf4, 4
+_Utf4:
+ .value 47448
+ .value 5
+ .ascii "Class"
+ .zero 1
+.globl _ZN5Class6class$E
+ .data
+ .align 32
+ .type _ZN5Class6class$E, @object
+ .size _ZN5Class6class$E, 144
+_ZN5Class6class$E:
+ .long _ZTVN4java4lang5ClassE+8
+ .long 403000
+ .long _Utf4
+ .value 32
+ .zero 2
+ .long _ZN4java4lang6Object6class$E
+ .long 0
+ .long 0
+ .long 0
+ .long _MT_Class
+ .value 1
+ .value 6
+ .long 0
+ .long 4
+ .value 0
+ .value 0
+ .long _ZTVN5ClassE+8
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long _catch_classes_Class
+ .long _IF_Class
+ .long 0
+ .value 1
+ .byte 1
+ .zero 1
+ .long 0
+ .value 0
+ .zero 2
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .hidden _ZN5Class7class$$E
+.globl _ZN5Class7class$$E
+ .section .rodata
+ .align 4
+ .type _ZN5Class7class$$E, @object
+ .size _ZN5Class7class$$E, 4
+_ZN5Class7class$$E:
+ .long _ZN5Class6class$E
+ .section .jcr,"aw",@progbits
+ .align 4
+ .long _ZN9Interface6class$E
+ .long _ZN5Class6class$E
+ .section .debug_frame,"",@progbits
+.Lframe0:
+ .long .LECIE0-.LSCIE0
+.LSCIE0:
+ .long 0xffffffff
+ .byte 0x1
+ .string ""
+ .uleb128 0x1
+ .sleb128 -4
+ .byte 0x8
+ .byte 0xc
+ .uleb128 0x4
+ .uleb128 0x4
+ .byte 0x88
+ .uleb128 0x1
+ .align 4
+.LECIE0:
+.LSFDE0:
+ .long .LEFDE0-.LASFDE0
+.LASFDE0:
+ .long .Lframe0
+ .long .LFB2
+ .long .LFE2-.LFB2
+ .byte 0x4
+ .long .LCFI0-.LFB2
+ .byte 0xe
+ .uleb128 0x8
+ .byte 0x85
+ .uleb128 0x2
+ .byte 0x4
+ .long .LCFI1-.LCFI0
+ .byte 0xd
+ .uleb128 0x5
+ .align 4
+.LEFDE0:
+ .section .eh_frame,"a",@progbits
+.Lframe1:
+ .long .LECIE1-.LSCIE1
+.LSCIE1:
+ .long 0x0
+ .byte 0x1
+.globl __gcj_personality_v0
+ .string "zP"
+ .uleb128 0x1
+ .sleb128 -4
+ .byte 0x8
+ .uleb128 0x5
+ .byte 0x0
+ .long __gcj_personality_v0
+ .byte 0xc
+ .uleb128 0x4
+ .uleb128 0x4
+ .byte 0x88
+ .uleb128 0x1
+ .align 4
+.LECIE1:
+.LSFDE1:
+ .long .LEFDE1-.LASFDE1
+.LASFDE1:
+ .long .LASFDE1-.Lframe1
+ .long .LFB2
+ .long .LFE2-.LFB2
+ .uleb128 0x0
+ .byte 0x4
+ .long .LCFI0-.LFB2
+ .byte 0xe
+ .uleb128 0x8
+ .byte 0x85
+ .uleb128 0x2
+ .byte 0x4
+ .long .LCFI1-.LCFI0
+ .byte 0xd
+ .uleb128 0x5
+ .align 4
+.LEFDE1:
+ .text
+.Letext0:
+ .section .debug_loc,"",@progbits
+.Ldebug_loc0:
+.LLST0:
+ .long .LFB2-.Ltext0
+ .long .LCFI0-.Ltext0
+ .value 0x2
+ .byte 0x74
+ .sleb128 4
+ .long .LCFI0-.Ltext0
+ .long .LCFI1-.Ltext0
+ .value 0x2
+ .byte 0x74
+ .sleb128 8
+ .long .LCFI1-.Ltext0
+ .long .LFE2-.Ltext0
+ .value 0x2
+ .byte 0x75
+ .sleb128 8
+ .long 0x0
+ .long 0x0
+ .section .debug_info
+ .long 0x117
+ .value 0x2
+ .long .Ldebug_abbrev0
+ .byte 0x4
+ .uleb128 0x1
+ .string "GNU Java 4.3.0 20071221 (experimental)"
+ .byte 0xb
+ .string "interface.java"
+ .string "/home/jkratoch/redhat/bz371831"
+ .long .Ltext0
+ .long .Letext0
+ .long .Ldebug_line0
+ .uleb128 0x2
+ .string "Interface"
+ .byte 0x4
+ .byte 0x1
+ .byte 0x0
+ .long 0x8e
+ .long 0x8e
+ .uleb128 0x3
+ .long 0x8e
+ .byte 0x2
+ .byte 0x23
+ .uleb128 0x0
+ .byte 0x1
+ .byte 0x0
+ .uleb128 0x4
+ .string "java.lang.Object"
+ .byte 0x1
+ .uleb128 0x5
+ .string "Class"
+ .byte 0x4
+ .byte 0x1
+ .byte 0x0
+ .long 0x8e
+ .long 0xe8
+ .uleb128 0x3
+ .long 0x8e
+ .byte 0x2
+ .byte 0x23
+ .uleb128 0x0
+ .byte 0x1
+ .uleb128 0x6
+ .long 0x6e
+ .byte 0x2
+ .byte 0x23
+ .uleb128 0x0
+ .byte 0x1
+ .byte 0x1
+ .uleb128 0x7
+ .byte 0x1
+ .string "<init>"
+ .byte 0x1
+ .byte 0x0
+ .string "_ZN5ClassC1Ev"
+ .byte 0x1
+ .uleb128 0x8
+ .long 0xe8
+ .byte 0x1
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x9
+ .byte 0x4
+ .long 0xa1
+ .uleb128 0xa
+ .long 0xc6
+ .long .LFB2
+ .long .LFE2
+ .long .LLST0
+ .long 0x114
+ .uleb128 0xb
+ .long 0xe8
+ .byte 0x2
+ .byte 0x91
+ .sleb128 0
+ .uleb128 0xc
+ .long 0x114
+ .byte 0x2
+ .byte 0x91
+ .sleb128 -12
+ .byte 0x0
+ .uleb128 0x9
+ .byte 0x4
+ .long 0x8e
+ .byte 0x0
+ .section .debug_abbrev
+ .uleb128 0x1
+ .uleb128 0x11
+ .byte 0x1
+ .uleb128 0x25
+ .uleb128 0x8
+ .uleb128 0x13
+ .uleb128 0xb
+ .uleb128 0x3
+ .uleb128 0x8
+ .uleb128 0x1b
+ .uleb128 0x8
+ .uleb128 0x11
+ .uleb128 0x1
+ .uleb128 0x12
+ .uleb128 0x1
+ .uleb128 0x10
+ .uleb128 0x6
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x2
+ .uleb128 0x38
+ .byte 0x1
+ .uleb128 0x3
+ .uleb128 0x8
+ .uleb128 0xb
+ .uleb128 0xb
+ .uleb128 0x3a
+ .uleb128 0xb
+ .uleb128 0x3b
+ .uleb128 0xb
+ .uleb128 0x1d
+ .uleb128 0x13
+ .uleb128 0x1
+ .uleb128 0x13
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x3
+ .uleb128 0x1c
+ .byte 0x0
+ .uleb128 0x49
+ .uleb128 0x13
+ .uleb128 0x38
+ .uleb128 0xa
+ .uleb128 0x32
+ .uleb128 0xb
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x4
+ .uleb128 0x2
+ .byte 0x0
+ .uleb128 0x3
+ .uleb128 0x8
+ .uleb128 0x3c
+ .uleb128 0xc
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x5
+ .uleb128 0x2
+ .byte 0x1
+ .uleb128 0x3
+ .uleb128 0x8
+ .uleb128 0xb
+ .uleb128 0xb
+ .uleb128 0x3a
+ .uleb128 0xb
+ .uleb128 0x3b
+ .uleb128 0xb
+ .uleb128 0x1d
+ .uleb128 0x13
+ .uleb128 0x1
+ .uleb128 0x13
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x6
+ .uleb128 0x1c
+ .byte 0x0
+ .uleb128 0x49
+ .uleb128 0x13
+ .uleb128 0x38
+ .uleb128 0xa
+ .uleb128 0x4c
+ .uleb128 0xb
+ .uleb128 0x32
+ .uleb128 0xb
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x7
+ .uleb128 0x2e
+ .byte 0x1
+ .uleb128 0x3f
+ .uleb128 0xc
+ .uleb128 0x3
+ .uleb128 0x8
+ .uleb128 0x3a
+ .uleb128 0xb
+ .uleb128 0x3b
+ .uleb128 0xb
+ .uleb128 0x2007
+ .uleb128 0x8
+ .uleb128 0x3c
+ .uleb128 0xc
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x8
+ .uleb128 0x5
+ .byte 0x0
+ .uleb128 0x49
+ .uleb128 0x13
+ .uleb128 0x34
+ .uleb128 0xc
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x9
+ .uleb128 0xf
+ .byte 0x0
+ .uleb128 0xb
+ .uleb128 0xb
+ .uleb128 0x49
+ .uleb128 0x13
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xa
+ .uleb128 0x2e
+ .byte 0x1
+ .uleb128 0x47
+ .uleb128 0x13
+ .uleb128 0x11
+ .uleb128 0x1
+ .uleb128 0x12
+ .uleb128 0x1
+ .uleb128 0x40
+ .uleb128 0x6
+ .uleb128 0x1
+ .uleb128 0x13
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xb
+ .uleb128 0x5
+ .byte 0x0
+ .uleb128 0x49
+ .uleb128 0x13
+ .uleb128 0x2
+ .uleb128 0xa
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xc
+ .uleb128 0x34
+ .byte 0x0
+ .uleb128 0x49
+ .uleb128 0x13
+ .uleb128 0x2
+ .uleb128 0xa
+ .byte 0x0
+ .byte 0x0
+ .byte 0x0
+ .section .debug_pubnames,"",@progbits
+ .long 0x15
+ .value 0x2
+ .long .Ldebug_info0
+ .long 0x11b
+ .long 0xee
+ .string "()"
+ .long 0x0
+ .section .debug_aranges,"",@progbits
+ .long 0x1c
+ .value 0x2
+ .long .Ldebug_info0
+ .byte 0x4
+ .byte 0x0
+ .value 0x0
+ .value 0x0
+ .long .Ltext0
+ .long .Letext0-.Ltext0
+ .long 0x0
+ .long 0x0
+ .ident "GCC: (GNU) 4.3.0 20071221 (experimental)"
+ .section .note.GNU-stack,"",@progbits
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/i386-interface.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/i386-interface.exp 2016-02-15 23:23:15.978593556 +0100
@@ -0,0 +1,59 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+# This file is part of the gdb testsuite.
+
+# Test basis recognization of DW_TAG_interface_type.
+# GCC java_classify_record() produces it if returns RECORD_IS_INTERFACE.
+
+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} then {
+ verbose "Skipping i386 Java DW_TAG_interface_type test."
+ return
+}
+
+set testfile "i386-interface"
+set srcfile ${testfile}.S
+set binfile [standard_output_file ${testfile}.o]
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug additional_flags=-m32}] != "" } {
+ untested i386-gnu-cfi.exp
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set language java"
+
+set test "ptype Interface"
+gdb_test_multiple $test $test {
+ -re "type = class Interface *extends java.lang.Object \{.*$gdb_prompt $" {
+ pass $test
+ }
+}
+
+set test "ptype Class"
+gdb_test_multiple $test $test {
+ -re "type = class Class *extends java.lang.Object implements Interface \{.*$gdb_prompt $" {
+ pass $test
+ }
+}

View File

@ -1,3 +1,11 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.7-charsign-test.patch
;; Fix displaying of numeric char arrays as strings (BZ 224128).
;;=fedoratest: But it is failing anyway, one should check the behavior more.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
2007-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
@ -10,10 +18,10 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
Port to GDB-6.7 - only the testcase left, patch has been reverted,
char-vectors restricted.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.c 2016-02-15 23:26:06.429811778 +0100
diff --git a/gdb/testsuite/gdb.base/charsign.c b/gdb/testsuite/gdb.base/charsign.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/charsign.c
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -52,10 +60,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.c
+char_n n_typed[]="A";
+char_s s_typed[]="A";
+char_u u_typed[]="A";
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.exp 2016-02-15 23:26:12.409854237 +0100
diff --git a/gdb/testsuite/gdb.base/charsign.exp b/gdb/testsuite/gdb.base/charsign.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/charsign.exp
@@ -0,0 +1,63 @@
+# Copyright 2007 Free Software Foundation, Inc.
+

View File

@ -1,3 +1,11 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.7-ppc-clobbered-registers-O2-test.patch
;; Test PPC hiding of call-volatile parameter register.
;;=fedoratest
2007-11-04 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/ppc-clobbered-registers-O2.exp: `powerpc64' changed to
@ -13,8 +21,10 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
* (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as
default dwarf2_frame_set_init_reg function.
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c 3 Nov 2007 22:22:28 -0000
diff --git a/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c
@@ -0,0 +1,21 @@
+
+unsigned * __attribute__((noinline))
@ -37,8 +47,10 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
+ y = 14;
+ return (int)gen_movsd (&x, &y);
+}
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp 3 Nov 2007 22:22:28 -0000
diff --git a/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp
@@ -0,0 +1,54 @@
+# Copyright 2006 Free Software Foundation, Inc.
+#
@ -68,7 +80,7 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
+
+set testfile "ppc-clobbered-registers-O2"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set binfile [standard_output_file ${testfile}]
+set compile_flags "debug additional_flags=-O2"
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${compile_flags}] != "" } {

View File

@ -0,0 +1,104 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.7-testsuite-stable-results.patch
;; Testsuite fixes for more stable/comparable results.
;;=fedoratest
gdb/testsuite/gdb.base/fileio.c:
gdb/testsuite/gdb.base/fileio.exp:
2007-12-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/fileio.c (ROOTSUBDIR): New macro.
(main): CHDIR into ROOTSUBDIR. CHOWN ROOTSUBDIR and CHDIR into
ROOTSUBDIR if we are being run as root.
* gdb.base/fileio.exp: Change the startup and finish cleanup.
Change the test file reference to be into the `fileio.dir' directory.
sources/gdb/testsuite/gdb.base/dump.exp:
Found on RHEL-5.s390x.
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp:
random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp:
frames-invalid can happen asynchronously.
diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c
--- a/gdb/testsuite/gdb.base/fileio.c
+++ b/gdb/testsuite/gdb.base/fileio.c
@@ -559,6 +559,28 @@ strerrno (int err)
int
main ()
{
+ /* These tests
+ Open for write but no write permission returns EACCES
+ Unlinking a file in a directory w/o write access returns EACCES
+ fail if we are being run as root - drop the privileges here. */
+
+ if (geteuid () == 0)
+ {
+ uid_t uid = 99;
+
+ if (chown (OUTDIR, uid, uid) != 0)
+ {
+ printf ("chown %d.%d %s: %s\n", (int) uid, (int) uid,
+ OUTDIR, strerror (errno));
+ exit (1);
+ }
+ if (setuid (uid) || geteuid () == 0)
+ {
+ printf ("setuid %d: %s\n", (int) uid, strerror (errno));
+ exit (1);
+ }
+ }
+
/* Don't change the order of the calls. They partly depend on each other */
test_open ();
test_write ();
diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp
--- a/gdb/testsuite/gdb.base/fileio.exp
+++ b/gdb/testsuite/gdb.base/fileio.exp
@@ -24,9 +24,9 @@ if [target_info exists gdb,nofileio] {
standard_testfile
if {[is_remote host]} {
- set outdir .
+ set outdir "fileio.dir"
} else {
- set outdir [standard_output_file {}]
+ set outdir [standard_output_file "fileio.dir"]
}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
@@ -47,7 +47,8 @@ set dir2 [standard_output_file dir2.fileio.test]
if {[file exists $dir2] && ![file writable $dir2]} {
system "chmod +w $dir2"
}
-system "rm -rf [standard_output_file *.fileio.test]"
+system "rm -rf [standard_output_file fileio.dir]"
+system "mkdir -m777 [standard_output_file fileio.dir]"
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
@@ -89,7 +90,7 @@ gdb_test continue \
gdb_test "continue" ".*" ""
-catch "system \"chmod -f -w [standard_output_file nowrt.fileio.test]\""
+catch "system \"chmod -f -w [standard_output_file fileio.dir/nowrt.fileio.test]\""
gdb_test continue \
"Continuing\\..*open 5:.*EACCES$stop_msg" \
@@ -276,9 +277,7 @@ gdb_test continue \
gdb_exit
# Make dir2 writable again so rm -rf of a build tree Just Works.
-if {[file exists $dir2] && ![file writable $dir2]} {
- system "chmod +w $dir2"
-}
+system "chmod -R +w $outdir"
set timeout $oldtimeout
return 0

View File

@ -1,177 +0,0 @@
diff -dup -rup gdb-7.10.50.20160106-orig/gdb/infrun.c gdb-7.10.50.20160106/gdb/infrun.c
--- gdb-7.10.50.20160106-orig/gdb/infrun.c 2016-01-09 15:05:06.127481758 +0100
+++ gdb-7.10.50.20160106/gdb/infrun.c 2016-01-09 15:05:24.054593048 +0100
@@ -626,6 +626,13 @@ holding the child stopped. Try \"set de
target_pid_to_str (process_ptid));
}
+#ifdef NEED_DETACH_SIGSTOP
+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
+ In this point of code it cannot be 1 as we would not get FORK
+ executed without CONTINUE first which resets PID_WAS_STOPPED.
+ We would have to first TARGET_STOP and WAITPID it as with running
+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
+#endif
target_detach (NULL, 0);
}
diff -dup -rup gdb-7.10.50.20160106-orig/gdb/linux-nat.c gdb-7.10.50.20160106/gdb/linux-nat.c
--- gdb-7.10.50.20160106-orig/gdb/linux-nat.c 2016-01-09 15:05:06.225482366 +0100
+++ gdb-7.10.50.20160106/gdb/linux-nat.c 2016-01-09 15:05:24.050593023 +0100
@@ -194,6 +194,11 @@ enum tribool have_ptrace_getregset = TRI
static struct target_ops *linux_ops;
static struct target_ops linux_ops_saved;
+#ifdef NEED_DETACH_SIGSTOP
+/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */
+static pid_t pid_was_stopped;
+
+#endif
/* The method to call, if any, when a new thread is attached. */
static void (*linux_nat_new_thread) (struct lwp_info *);
@@ -961,6 +966,9 @@ linux_nat_post_attach_wait (ptid_t ptid,
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
"LNPAW: Attaching to a stopped process\n");
+#ifdef NEED_DETACH_SIGSTOP
+ pid_was_stopped = ptid_get_pid (ptid);
+#endif
/* The process is definitely stopped. It is in a job control
stop, unless the kernel predates the TASK_STOPPED /
@@ -1303,6 +1311,25 @@ get_pending_status (struct lwp_info *lp,
gdb_signal_to_string (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 (ptid_get_pid (lp->ptid) == pid_was_stopped)
+ {
+ int err;
+
+ errno = 0;
+ err = kill_lwp (ptid_get_lwp (lp->ptid), 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;
}
@@ -1416,6 +1443,10 @@ linux_nat_detach (struct target_ops *ops
}
else
linux_ops->to_detach (ops, args, from_tty);
+#ifdef NEED_DETACH_SIGSTOP
+
+ pid_was_stopped = 0;
+#endif
}
/* Resume execution of the inferior process. If STEP is nonzero,
@@ -1674,6 +1705,16 @@ linux_nat_resume (struct target_ops *ops
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 == ptid_get_pid (lp->ptid))
+ pid_was_stopped = 0;
+
+#endif
if (resume_many)
iterate_over_lwps (ptid, linux_nat_resume_callback, lp);
@@ -3618,6 +3659,10 @@ linux_nat_mourn_inferior (struct target_
/* Let the arch-specific native code know this process is gone. */
linux_nat_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 -dup -rup gdb-7.10.50.20160106-orig/gdb/testsuite/gdb.threads/attach-stopped.exp gdb-7.10.50.20160106/gdb/testsuite/gdb.threads/attach-stopped.exp
--- gdb-7.10.50.20160106-orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2016-01-06 02:48:38.000000000 +0100
+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.threads/attach-stopped.exp 2016-01-09 15:05:48.917747101 +0100
@@ -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,25 +0,0 @@
Index: gdb-6.8.50.20090803/gdb/valops.c
===================================================================
--- gdb-6.8.50.20090803.orig/gdb/valops.c 2009-08-04 06:30:45.000000000 +0200
+++ gdb-6.8.50.20090803/gdb/valops.c 2009-08-04 06:33:05.000000000 +0200
@@ -926,10 +926,18 @@ value_assign (struct value *toval, struc
struct gdbarch *gdbarch;
int value_reg;
- /* Figure out which frame this is in currently. */
- frame = frame_find_by_id (VALUE_FRAME_ID (toval));
value_reg = VALUE_REGNUM (toval);
+ /* Figure out which frame this is in currently. */
+ frame = frame_find_by_id (VALUE_FRAME_ID (toval));
+ /* "set $reg+=1" should work on programs with no debug info,
+ but frame_find_by_id returns NULL here (RH bug 436037).
+ Use current frame, it represents CPU state in this case.
+ If frame_find_by_id is changed to do it internally
+ (it is contemplated there), remove this. */
+ if (!frame)
+ frame = get_current_frame ();
+ /* Probably never happens. */
if (!frame)
error (_("Value being assigned to is no longer active."));

View File

@ -1,9 +1,16 @@
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-bz442765-threaded-exec-test.patch
;; Test various forms of threads tracking across exec() (BZ 442765).
;;=fedoratest
Test various forms of threads tracking across exec(2).
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.threads/threaded-exec.c 2016-02-16 09:54:45.157163049 +0100
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c 2016-02-16 09:54:46.210170175 +0100
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c
--- a/gdb/testsuite/gdb.threads/threaded-exec.c
+++ b/gdb/testsuite/gdb.threads/threaded-exec.c
@@ -18,21 +18,95 @@
Boston, MA 02111-1307, USA. */
@ -103,7 +110,7 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c
pthread_t t1;
int i;
@@ -40,7 +114,34 @@
@@ -40,7 +114,34 @@ main (void)
assert (i == 0);
i = pthread_join (t1, NULL);
assert (i == 0);
@ -140,10 +147,9 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c
+ execl (cmd, cmd, exec_nothreads, exec_threads, phase_s, NULL);
+ assert (0);
}
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.threads/threaded-exec.exp 2016-02-16 09:54:45.157163049 +0100
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp 2016-02-16 09:55:27.397448879 +0100
diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp
--- a/gdb/testsuite/gdb.threads/threaded-exec.exp
+++ b/gdb/testsuite/gdb.threads/threaded-exec.exp
@@ -20,9 +20,14 @@
set testfile threaded-exec
@ -161,7 +167,7 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp
return -1
}
@@ -30,9 +35,9 @@
@@ -30,9 +35,9 @@ gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir

View File

@ -1,147 +1,17 @@
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-bz466901-backtrace-full-prelinked.patch
;; Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
;;=fedoratest
Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp 2009-09-09 20:10:35.000000000 +0200
@@ -0,0 +1,102 @@
+# 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.
+
+# Minimal DWARF-2 unit test
+
+# This test can only be run on i386/x86_64 targets which support DWARF-2.
+# For now pick a sampling of likely targets.
+if {(![istarget *-*-linux*]
+ && ![istarget *-*-gnu*]
+ && ![istarget *-*-elf*]
+ && ![istarget *-*-openbsd*])
+ || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} {
+ return 0
+}
+
+set testfile "dw2-loclist-prelinked"
+set srcfuncfile ${testfile}-func.S
+set binsharedfuncfile [standard_output_file ${testfile}.so]
+set srcmainfile ${testfile}-main.c
+set binfile [standard_output_file ${testfile}]
+
+remote_exec build "rm -f ${binfile}"
+
+# get the value of gcc_compiled
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# This test can only be run on gcc as we use additional_flags=FIXME
+if {$gcc_compiled == 0} {
+ return 0
+}
+
+if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfuncfile}" "${binsharedfuncfile}" {debug additional_flags=-m32}] != "" } {
+ untested "Couldn't compile test library"
+ return -1
+}
+
+# The new separate debug info file will be stored in the .debug subdirectory.
+
+if [gdb_gnu_strip_debug ${binsharedfuncfile}] {
+ # check that you have a recent version of strip and objcopy installed
+ unsupported "cannot produce separate debug info files"
+ return -1
+}
+
+if {[catch "system \"/usr/sbin/prelink -qNR --no-exec-shield ${binsharedfuncfile}\""] != 0} {
+ # Maybe we don't have prelink.
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" \
+ "${binfile}" executable [list debug additional_flags=-m32 shlib=${binsharedfuncfile}]] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_run_cmd
+
+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
+
+# Incorrect:
+# #0 0x00110430 in __kernel_vsyscall ()
+# No symbol table info available.
+# #1 0x003d44c0 in raise () from /lib/libc.so.6
+# No symbol table info available.
+# #2 0x003d5e88 in abort () from /lib/libc.so.6
+# No symbol table info available.
+# #3 0x44f10437 in func () at dw2-loclist-prelinked.c:8
+# i = Could not find the frame base for "func".
+
+# Correct:
+# #0 0x00110430 in __kernel_vsyscall ()
+# No symbol table info available.
+# #1 0x003d44c0 in raise () from /lib/libc.so.6
+# No symbol table info available.
+# #2 0x003d5e88 in abort () from /lib/libc.so.6
+# No symbol table info available.
+# #3 0x4ae36437 in func () at dw2-loclist-prelinked.c:8
+# i = 3827288
+# #4 0x0804851a in main () at ../../../gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c:24
+# No locals.
+
+# `abort' can get expressed as `*__GI_abort'.
+gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()"
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c 2009-09-09 20:10:35.000000000 +0200
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 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/>. */
+
+/* dw2-loclist-prelinked-func.S */
+extern void func (void);
+
+int
+main (void)
+{
+ func ();
+ return 0;
+}
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S 2009-09-09 20:10:35.000000000 +0200
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
@@ -0,0 +1,328 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -471,3 +341,141 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
+ .string "short int"
+ .ident "GCC: (GNU) 4.3.2 20081007 (Red Hat 4.3.2-6)"
+ .section .note.GNU-stack,"",@progbits
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 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/>. */
+
+/* dw2-loclist-prelinked-func.S */
+extern void func (void);
+
+int
+main (void)
+{
+ func ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
@@ -0,0 +1,102 @@
+# 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.
+
+# Minimal DWARF-2 unit test
+
+# This test can only be run on i386/x86_64 targets which support DWARF-2.
+# For now pick a sampling of likely targets.
+if {(![istarget *-*-linux*]
+ && ![istarget *-*-gnu*]
+ && ![istarget *-*-elf*]
+ && ![istarget *-*-openbsd*])
+ || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} {
+ return 0
+}
+
+set testfile "dw2-loclist-prelinked"
+set srcfuncfile ${testfile}-func.S
+set binsharedfuncfile [standard_output_file ${testfile}.so]
+set srcmainfile ${testfile}-main.c
+set binfile [standard_output_file ${testfile}]
+
+remote_exec build "rm -f ${binfile}"
+
+# get the value of gcc_compiled
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# This test can only be run on gcc as we use additional_flags=FIXME
+if {$gcc_compiled == 0} {
+ return 0
+}
+
+if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfuncfile}" "${binsharedfuncfile}" {debug additional_flags=-m32}] != "" } {
+ untested "Couldn't compile test library"
+ return -1
+}
+
+# The new separate debug info file will be stored in the .debug subdirectory.
+
+if [gdb_gnu_strip_debug ${binsharedfuncfile}] {
+ # check that you have a recent version of strip and objcopy installed
+ unsupported "cannot produce separate debug info files"
+ return -1
+}
+
+if {[catch "system \"/usr/sbin/prelink -qNR --no-exec-shield ${binsharedfuncfile}\""] != 0} {
+ # Maybe we don't have prelink.
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" \
+ "${binfile}" executable [list debug additional_flags=-m32 shlib=${binsharedfuncfile}]] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_run_cmd
+
+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
+
+# Incorrect:
+# #0 0x00110430 in __kernel_vsyscall ()
+# No symbol table info available.
+# #1 0x003d44c0 in raise () from /lib/libc.so.6
+# No symbol table info available.
+# #2 0x003d5e88 in abort () from /lib/libc.so.6
+# No symbol table info available.
+# #3 0x44f10437 in func () at dw2-loclist-prelinked.c:8
+# i = Could not find the frame base for "func".
+
+# Correct:
+# #0 0x00110430 in __kernel_vsyscall ()
+# No symbol table info available.
+# #1 0x003d44c0 in raise () from /lib/libc.so.6
+# No symbol table info available.
+# #2 0x003d5e88 in abort () from /lib/libc.so.6
+# No symbol table info available.
+# #3 0x4ae36437 in func () at dw2-loclist-prelinked.c:8
+# i = 3827288
+# #4 0x0804851a in main () at ../../../gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c:24
+# No locals.
+
+# `abort' can get expressed as `*__GI_abort'.
+gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()"

View File

@ -1,3 +1,11 @@
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.
@ -5,40 +13,41 @@ 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 -dup -rup gdb-7.10.50.20160106-orig/gdb/defs.h gdb-7.10.50.20160106/gdb/defs.h
--- gdb-7.10.50.20160106-orig/gdb/defs.h 2016-01-09 15:06:57.658172875 +0100
+++ gdb-7.10.50.20160106/gdb/defs.h 2016-01-09 15:07:12.431264378 +0100
@@ -145,6 +145,9 @@ extern void set_quit_flag (void);
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 int immediate_quit;
+
extern void quit (void);
diff -dup -rup gdb-7.10.50.20160106-orig/gdb/extension.c gdb-7.10.50.20160106/gdb/extension.c
--- gdb-7.10.50.20160106-orig/gdb/extension.c 2016-01-06 02:48:37.000000000 +0100
+++ gdb-7.10.50.20160106/gdb/extension.c 2016-01-09 15:07:12.434264396 +0100
@@ -833,6 +833,11 @@ check_quit_flag (void)
int i, result = 0;
const struct extension_language_defn *extlang;
/* 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
ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
+
for (const struct extension_language_defn *extlang : extension_languages)
{
if (extlang->ops->check_quit_flag != NULL)
diff -dup -rup gdb-7.10.50.20160106-orig/gdb/top.c gdb-7.10.50.20160106/gdb/top.c
--- gdb-7.10.50.20160106-orig/gdb/top.c 2016-01-06 02:48:38.000000000 +0100
+++ gdb-7.10.50.20160106/gdb/top.c 2016-01-09 15:07:12.432264384 +0100
@@ -1557,7 +1557,13 @@ quit_force (char *args, int from_tty)
qt.args = args;
qt.from_tty = from_tty;
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. */
@ -49,21 +58,21 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/top.c gdb-7.10.50.20160106/gdb/top.
+#endif
/* Get out of tfind mode, and kill or detach all inferiors. */
TRY
diff -dup -rup gdb-7.10.50.20160106-orig/gdb/utils.c gdb-7.10.50.20160106/gdb/utils.c
--- gdb-7.10.50.20160106-orig/gdb/utils.c 2016-01-09 15:06:57.654172850 +0100
+++ gdb-7.10.50.20160106/gdb/utils.c 2016-01-09 15:07:12.433264390 +0100
@@ -122,6 +122,13 @@ int job_control;
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;
int immediate_quit;
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
/* Nonzero means that strings with character values >0x7F should be printed
as octal escapes. Zero means just print the value (e.g. it's an
+
/* 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,12 +0,0 @@
Index: gdb-7.4.50.20111218/gdb/sparc-tdep.c
===================================================================
--- gdb-7.4.50.20111218.orig/gdb/sparc-tdep.c 2011-09-28 19:59:42.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/sparc-tdep.c 2011-12-19 01:25:29.294046199 +0100
@@ -1316,6 +1316,7 @@ sparc32_store_return_value (struct type
if (sparc_floating_p (type) || sparc_complex_floating_p (type))
{
/* Floating return values. */
+ len = (len <= 8) ? len : 8;
memcpy (buf, valbuf, len);
regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
if (len > 4)

View File

@ -1,82 +0,0 @@
For:
http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html
http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-cond.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-cond.exp 2016-02-15 23:33:49.519099759 +0100
@@ -0,0 +1,37 @@
+# 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 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 watchpoint-cond
+set srcfile ${testfile}.c
+set binfile [standard_output_file ${testfile}]
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if { [runto_main] < 0 } {
+ untested watchpoint-cond
+ return -1
+}
+
+gdb_test "watch i if i < 20" "atchpoint \[0-9\]+: i"
+gdb_test "cont" "atchpoint \[0-9\]+: i.*Old value = 20.*New value = 19.*"
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-cond.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-cond.c 2016-02-15 23:32:51.974691188 +0100
@@ -0,0 +1,31 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+int
+main (int argc, char **argv)
+{
+ static int i = 0; /* `static' to start initialized. */
+ int j = 2;
+
+ for (j = 0; j < 30; j++)
+ i = 30 - j;
+
+ return 0;
+}

View File

@ -1,51 +0,0 @@
Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
===================================================================
--- gdb-7.9.90.20150709.orig/gdb/gdb_bfd.c 2015-07-09 18:23:59.344017882 +0200
+++ gdb-7.9.90.20150709/gdb/gdb_bfd.c 2015-07-09 18:24:06.986083071 +0200
@@ -24,12 +24,14 @@
#include "hashtab.h"
#include "filestuff.h"
#include "vec.h"
+#ifndef __sparc__
#ifdef HAVE_MMAP
#include <sys/mman.h>
#ifndef MAP_FAILED
#define MAP_FAILED ((void *) -1)
#endif
#endif
+#endif
#include "target.h"
#include "gdb/fileio.h"
#include "inferior.h"
@@ -397,6 +399,7 @@ free_one_bfd_section (bfd *abfd, asectio
if (sect != NULL && sect->data != NULL)
{
+#ifndef __sparc__
#ifdef HAVE_MMAP
if (sect->map_addr != NULL)
{
@@ -407,6 +410,7 @@ free_one_bfd_section (bfd *abfd, asectio
}
else
#endif
+#endif
xfree (sect->data);
}
}
@@ -558,6 +562,7 @@ gdb_bfd_map_section (asection *sectp, bf
if (descriptor->data != NULL)
goto done;
+#ifndef __sparc__
#ifdef HAVE_MMAP
if (!bfd_is_section_compressed (abfd, sectp))
{
@@ -592,6 +597,7 @@ gdb_bfd_map_section (asection *sectp, bf
}
}
#endif /* HAVE_MMAP */
+#endif
/* Handle compressed sections, or ordinary uncompressed sections in
the no-mmap case. */

View File

@ -1,8 +1,18 @@
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-next-over-throw-cxx-exec.patch
;; Fix follow-exec for C++ programs (bugreported by Martin Stransky).
;;=fedoratest
Archer-upstreamed:
http://sourceware.org/ml/archer/2010-q2/msg00031.html
--- ./gdb/testsuite/gdb.cp/cxxexec.cc 1970-01-01 01:00:00.000000000 +0100
+++ ./gdb/testsuite/gdb.cp/cxxexec.cc 2010-05-29 01:18:56.000000000 +0200
diff --git a/gdb/testsuite/gdb.cp/cxxexec.cc b/gdb/testsuite/gdb.cp/cxxexec.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/cxxexec.cc
@@ -0,0 +1,25 @@
+/* This test script is part of GDB, the GNU debugger.
+
@ -29,9 +39,11 @@ http://sourceware.org/ml/archer/2010-q2/msg00031.html
+ execlp ("true", "true", NULL);
+ return 1;
+}
--- ./gdb/testsuite/gdb.cp/cxxexec.exp 1970-01-01 01:00:00.000000000 +0100
+++ ./gdb/testsuite/gdb.cp/cxxexec.exp 2010-05-29 01:29:25.000000000 +0200
@@ -0,0 +1,51 @@
diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/cxxexec.exp
@@ -0,0 +1,42 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -71,15 +83,6 @@ http://sourceware.org/ml/archer/2010-q2/msg00031.html
+ }
+}
+
+set test continue
+gdb_test_multiple $test $test {
+ -re "Cannot access memory at address 0x\[0-9a-f\]+\r\n$gdb_prompt $" {
+ fail $test
+ }
+ -re "\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
+# `info inferiors' can show <null> on older GDBs.
+gdb_test "info threads" "info threads" "program finished"
+# Run to end. The buggy GDB failed instead with:
+# Cannot access memory at address ADDR.
+gdb_continue_to_end "" "continue" 1

View File

@ -1,12 +1,19 @@
Index: gdb-7.10.50.20160121/gdb/breakpoint.c
===================================================================
--- gdb-7.10.50.20160121.orig/gdb/breakpoint.c 2016-01-21 21:52:34.243387043 +0100
+++ gdb-7.10.50.20160121/gdb/breakpoint.c 2016-01-21 21:53:00.365542925 +0100
@@ -16139,6 +16139,50 @@
static struct cmd_list_element *enablebreaklist = NULL;
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;
void
+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
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;
@ -25,7 +32,7 @@ Index: gdb-7.10.50.20160121/gdb/breakpoint.c
+ CORE_ADDR relocated_address;
+ CORE_ADDR delta_offset;
+
+ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
+ delta_offset = delta[osect->the_bfd_section->index];
+ if (delta_offset == 0)
+ continue;
+ relocated_address = bl->address + delta_offset;
@ -34,7 +41,7 @@ Index: gdb-7.10.50.20160121/gdb/breakpoint.c
+ && relocated_address < obj_section_endaddr (osect))
+ {
+ if (bl->inserted)
+ remove_breakpoint (bl, mark_uninserted);
+ remove_breakpoint (bl);
+
+ bl->address += delta_offset;
+ bl->requested_address += delta_offset;
@ -45,31 +52,30 @@ Index: gdb-7.10.50.20160121/gdb/breakpoint.c
+ }
+
+ if (changed)
+ qsort (bp_location, bp_location_count, sizeof (*bp_location),
+ bp_location_compare);
+ std::sort (bp_locations, bp_locations + bp_locations_count,
+ bp_location_is_less_than);
+}
+
+void
_initialize_breakpoint (void)
{
struct cmd_list_element *c;
Index: gdb-7.10.50.20160121/gdb/breakpoint.h
===================================================================
--- gdb-7.10.50.20160121.orig/gdb/breakpoint.h 2016-01-21 21:52:34.244387049 +0100
+++ gdb-7.10.50.20160121/gdb/breakpoint.h 2016-01-21 21:53:00.366542931 +0100
@@ -1629,4 +1629,7 @@
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,
+ struct section_offsets *delta);
+ section_offsets &delta);
+
#endif /* !defined (BREAKPOINT_H) */
Index: gdb-7.10.50.20160121/gdb/objfiles.c
===================================================================
--- gdb-7.10.50.20160121.orig/gdb/objfiles.c 2016-01-21 21:52:34.245387055 +0100
+++ gdb-7.10.50.20160121/gdb/objfiles.c 2016-01-21 21:53:00.367542937 +0100
@@ -916,6 +916,11 @@
/* 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));
}

View File

@ -1,8 +1,14 @@
Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/gdbtypes.h 2015-05-31 16:55:29.723475485 +0200
+++ gdb-7.9.50.20150520/gdb/gdbtypes.h 2015-05-31 16:55:49.716601669 +0200
@@ -462,6 +462,7 @@ enum field_loc_kind
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 */
@ -10,7 +16,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
FIELD_LOC_KIND_PHYSADDR, /**< physaddr */
FIELD_LOC_KIND_PHYSNAME, /**< physname */
FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */
@@ -513,6 +514,7 @@ union field_location
@@ -699,6 +700,7 @@ union field_location
field. Otherwise, physname is the mangled label of the
static field. */
@ -18,65 +24,16 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
CORE_ADDR physaddr;
const char *physname;
@@ -1386,6 +1388,7 @@ extern void set_type_vptr_basetype (stru
#define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
#define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
+/* This address is unrelocated by the objfile's ANOFFSET. */
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
#define SET_FIELD_BITPOS(thisfld, bitpos) \
@@ -1397,6 +1400,7 @@ extern void set_type_vptr_basetype (stru
#define SET_FIELD_PHYSNAME(thisfld, name) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
FIELD_STATIC_PHYSNAME (thisfld) = (name))
+/* This address is unrelocated by the objfile's ANOFFSET. */
#define SET_FIELD_PHYSADDR(thisfld, addr) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
@@ -1413,6 +1417,7 @@ extern void set_type_vptr_basetype (stru
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
+/* This address is unrelocated by the objfile's ANOFFSET. */
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
Index: gdb-7.9.50.20150520/gdb/jv-lang.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/jv-lang.c 2015-05-31 16:55:29.724475491 +0200
+++ gdb-7.9.50.20150520/gdb/jv-lang.c 2015-05-31 16:55:30.820482408 +0200
@@ -427,7 +427,8 @@ java_link_class_type (struct gdbarch *gd
fields = NULL;
nfields--; /* First set up dummy "class" field. */
- SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas));
+ SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas)
+ - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
TYPE_FIELD_NAME (type, nfields) = "class";
TYPE_FIELD_TYPE (type, nfields) = value_type (clas);
SET_TYPE_FIELD_PRIVATE (type, nfields);
@@ -475,7 +476,8 @@ java_link_class_type (struct gdbarch *gd
SET_TYPE_FIELD_PROTECTED (type, i);
}
if (accflags & 0x0008) /* ACC_STATIC */
- SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset);
+ SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset
+ - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
else
SET_FIELD_BITPOS (TYPE_FIELD (type, i), 8 * boffset);
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
Index: gdb-7.9.50.20150520/gdb/value.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/value.c 2015-05-31 16:55:29.725475497 +0200
+++ gdb-7.9.50.20150520/gdb/value.c 2015-05-31 16:55:30.821482415 +0200
@@ -2951,7 +2951,8 @@ value_static_field (struct type *type, i
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_TYPE (type, fieldno),
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 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
+ + (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,97 +1,39 @@
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 f0ee78c5ccefe388a64273353ecd5c99dae62558
commit 718a1618b2f691a7f407213bb50f100ac59f91c3
tromey/python
diff --git a/README.archer b/README.archer
new file mode 100644
index 0000000..173b8ea
--- /dev/null
+++ b/README.archer
@@ -0,0 +1,2 @@
+This branch originally held the Python code for gdb. It still exists
+because a small amount of code here has not yet been merged upstream.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 95104ef..a9b198a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1534,6 +1534,12 @@ stamp-h: $(srcdir)/config.in config.status
CONFIG_LINKS= \
$(SHELL) config.status
+.gdbinit: $(srcdir)/gdbinit.in config.status
+ CONFIG_FILES=".gdbinit:gdbinit.in" \
+ CONFIG_COMMANDS= \
+ CONFIG_HEADERS= \
+ $(SHELL) config.status
+
config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
$(SHELL) config.status --recheck
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index 30cfd17..e977b30 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -65,7 +65,10 @@ PYTHON_FILE_LIST = \
@@ -80,6 +80,7 @@ PYTHON_FILE_LIST = \
gdb/unwinder.py \
gdb/prompt.py \
gdb/xmethod.py \
+ gdb/types.py \
gdb/command/__init__.py \
+ gdb/command/ignore_errors.py \
+ gdb/command/pahole.py \
gdb/command/xmethods.py \
gdb/command/explore.py \
gdb/command/backtrace.py \
gdb/command/frame_filters.py \
gdb/command/unwinders.py \
@@ -76,6 +79,8 @@ PYTHON_FILE_LIST = \
gdb/function/__init__.py \
@@ -92,6 +93,7 @@ PYTHON_FILE_LIST = \
gdb/function/as_string.py \
gdb/function/caller_is.py \
gdb/function/strfns.py \
+ gdb/function/caller_is.py \
+ gdb/function/in_scope.py \
gdb/printer/__init__.py \
gdb/printer/bound_registers.py
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 1665372..c4caffc 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1225,6 +1225,16 @@ for remote debugging.
Run using @var{device} for your program's standard input and output.
@c FIXME: kingdon thinks there is more to -tty. Investigate.
+@item -P
+@cindex @code{-P}
+@itemx --python
+@cindex @code{--python}
+Change interpretation of command line so that the argument immediately
+following this switch is taken to be the name of a Python script file.
+This option stops option processing; subsequent options are passed to
+Python as @code{sys.argv}. This option is only available if Python
+scripting support was enabled when @value{GDBN} was configured.
+
@c resolve the situation of these eventually
@item -tui
@cindex @code{--tui}
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 57ec22e..13beb05 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -88,8 +88,6 @@ containing @code{end}. For example:
@smallexample
(@value{GDBP}) python
-Type python script
-End with a line saying just "end".
>print 23
>end
23
diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
index 05a38b2..9801fdf 100644
--- a/gdb/gdb-gdb.gdb.in
+++ b/gdb/gdb-gdb.gdb.in
@@ -1,5 +1,15 @@
@ -110,158 +52,8 @@ index 05a38b2..9801fdf 100644
if !$gdb_init_done
set variable $gdb_init_done = 1
diff --git a/gdb/main.c b/gdb/main.c
index aecd60a..d0f7834 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -33,6 +33,7 @@
#include "interps.h"
#include "main.h"
+#include "python/python.h"
#include "source.h"
#include "cli/cli-cmds.h"
#include "objfiles.h"
@@ -453,6 +454,8 @@ captured_main (void *data)
char *cdarg = NULL;
char *ttyarg = NULL;
+ int python_script = 0;
+
/* These are static so that we can take their address in an
initializer. */
static int print_help;
@@ -663,10 +666,14 @@ captured_main (void *data)
{"args", no_argument, &set_args, 1},
{"l", required_argument, 0, 'l'},
{"return-child-result", no_argument, &return_child_result, 1},
+#if HAVE_PYTHON
+ {"python", no_argument, 0, 'P'},
+ {"P", no_argument, 0, 'P'},
+#endif
{0, no_argument, 0, 0}
};
- while (1)
+ while (!python_script)
{
int option_index;
@@ -684,6 +691,9 @@ captured_main (void *data)
case 0:
/* Long option that just sets a flag. */
break;
+ case 'P':
+ python_script = 1;
+ break;
case OPT_SE:
symarg = optarg;
execarg = optarg;
@@ -864,7 +874,31 @@ captured_main (void *data)
/* Now that gdb_init has created the initial inferior, we're in
position to set args for that inferior. */
- if (set_args)
+ if (python_script)
+ {
+ /* The first argument is a python script to evaluate, and
+ subsequent arguments are passed to the script for
+ processing there. */
+ if (optind >= argc)
+ {
+ fprintf_unfiltered (gdb_stderr,
+ _("%s: Python script file name required\n"),
+ argv[0]);
+ exit (1);
+ }
+
+ /* FIXME: should handle inferior I/O intelligently here.
+ E.g., should be possible to run gdb in pipeline and have
+ Python (and gdb) output go to stderr or file; and if a
+ prompt is needed, open the tty. */
+ quiet = 1;
+ /* FIXME: should read .gdbinit if, and only if, a prompt is
+ requested by the script. Though... maybe this is not
+ ideal? */
+ /* FIXME: likewise, reading in history. */
+ inhibit_gdbinit = 1;
+ }
+ else if (set_args)
{
/* The remaining options are the command-line options for the
inferior. The first one is the sym/exec file, and the rest
@@ -1137,7 +1171,8 @@ captured_main (void *data)
/* Read in the old history after all the command files have been
read. */
- init_history ();
+ if (!python_script)
+ init_history ();
if (batch_flag)
{
@@ -1148,13 +1183,25 @@ captured_main (void *data)
/* Show time and/or space usage. */
do_cleanups (pre_stat_chain);
- /* NOTE: cagney/1999-11-07: There is probably no reason for not
- moving this loop and the code found in captured_command_loop()
- into the command_loop() proper. The main thing holding back that
- change - SET_TOP_LEVEL() - has been eliminated. */
- while (1)
+#if HAVE_PYTHON
+ if (python_script)
{
- catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
+ extern int pagination_enabled;
+ pagination_enabled = 0;
+ run_python_script (argc - optind, &argv[optind]);
+ return 1;
+ }
+ else
+#endif
+ {
+ /* NOTE: cagney/1999-11-07: There is probably no reason for not
+ moving this loop and the code found in captured_command_loop()
+ into the command_loop() proper. The main thing holding back that
+ change - SET_TOP_LEVEL() - has been eliminated. */
+ while (1)
+ {
+ catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
+ }
}
/* No exit -- exit is through quit_command. */
}
@@ -1188,6 +1235,12 @@ print_gdb_help (struct ui_file *stream)
fputs_unfiltered (_("\
This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\
+ gdb [options] --args executable-file [inferior-arguments ...]\n"), stream);
+#if HAVE_PYTHON
+ fputs_unfiltered (_("\
+ gdb [options] [--python|-P] script-file [script-arguments ...]\n"), stream);
+#endif
+ fputs_unfiltered (_("\n\
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
"), stream);
fputs_unfiltered (_("\
@@ -1232,6 +1285,13 @@ Output and user interface control:\n\n\
#endif
fputs_unfiltered (_("\
--dbx DBX compatibility mode.\n\
+"), stream);
+#if HAVE_PYTHON
+ fputs_unfiltered (_("\
+ --python, -P Following argument is Python script file; remaining\n\
+ arguments are passed to script.\n"), stream);
+#endif
+ fputs_unfiltered (_("\
-q, --quiet, --silent\n\
Do not print version number on startup.\n\n\
"), stream);
diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py
new file mode 100644
index 0000000..6fa48ff
--- /dev/null
+++ b/gdb/python/lib/gdb/command/ignore_errors.py
@@ -0,0 +1,37 @@
@ -302,96 +94,8 @@ index 0000000..6fa48ff
+ pass
+
+IgnoreErrorsCommand ()
diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
new file mode 100644
index 0000000..e08eaf5
--- /dev/null
+++ b/gdb/python/lib/gdb/command/pahole.py
@@ -0,0 +1,81 @@
+# pahole command for gdb
+
+# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import gdb
+
+class Pahole (gdb.Command):
+ """Show the holes in a structure.
+This command takes a single argument, a type name.
+It prints the type and displays comments showing where holes are."""
+
+ def __init__ (self):
+ super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
+ gdb.COMPLETE_SYMBOL)
+
+ def maybe_print_hole(self, bitpos, field_bitpos):
+ if bitpos != field_bitpos:
+ hole = field_bitpos - bitpos
+ print (' /* XXX %d bit hole, try to pack */' % hole)
+
+ def pahole (self, type, level, name):
+ if name is None:
+ name = ''
+ tag = type.tag
+ if tag is None:
+ tag = ''
+ print ('%sstruct %s {' % (' ' * (2 * level), tag))
+ bitpos = 0
+ for field in type.fields ():
+ # Skip static fields.
+ if not hasattr (field, ('bitpos')):
+ continue
+
+ ftype = field.type.strip_typedefs()
+
+ self.maybe_print_hole(bitpos, field.bitpos)
+ bitpos = field.bitpos
+ if field.bitsize > 0:
+ fieldsize = field.bitsize
+ else:
+ # TARGET_CHAR_BIT here...
+ fieldsize = 8 * ftype.sizeof
+
+ # TARGET_CHAR_BIT
+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
+ bitpos = bitpos + fieldsize
+
+ if ftype.code == gdb.TYPE_CODE_STRUCT:
+ self.pahole (ftype, level + 1, field.name)
+ else:
+ print (' ' * (2 + 2 * level), end = "")
+ print ('%s %s' % (str (ftype), field.name))
+
+ if level == 0:
+ self.maybe_print_hole(bitpos, 8 * type.sizeof)
+
+ print (' ' * (14 + 2 * level), end = "")
+ print ('} %s' % name)
+
+ def invoke (self, arg, from_tty):
+ type = gdb.lookup_type (arg)
+ type = type.strip_typedefs ()
+ if type.code != gdb.TYPE_CODE_STRUCT:
+ raise (TypeError, '%s is not a struct type' % arg)
+ print (' ' * 14, end = "")
+ self.pahole (type, 0, '')
+
+Pahole()
diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py
new file mode 100644
index 0000000..8742680
--- /dev/null
+++ b/gdb/python/lib/gdb/function/in_scope.py
@@ -0,0 +1,47 @@
@ -442,140 +146,7 @@ index 0000000..8742680
+ return wanted == found
+
+InScope ()
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 4f88b0e..870a1ba 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -93,6 +93,8 @@ const struct extension_language_defn extension_language_python =
#include "linespec.h"
#include "source.h"
#include "version.h"
+#include "inferior.h"
+#include "gdbthread.h"
#include "target.h"
#include "gdbthread.h"
#include "interps.h"
@@ -1262,6 +1264,83 @@ gdbpy_print_stack (void)
/* Return the current Progspace.
There always is one. */
+/* True if 'gdb -P' was used, false otherwise. */
+static int running_python_script;
+
+/* True if we are currently in a call to 'gdb.cli', false otherwise. */
+static int in_cli;
+
+/* Enter the command loop. */
+
+static PyObject *
+gdbpy_cli (PyObject *unused1, PyObject *unused2)
+{
+ if (! running_python_script || in_cli)
+ return PyErr_Format (PyExc_RuntimeError, "cannot invoke CLI recursively");
+
+ if (ui_out_is_mi_like_p (current_uiout))
+ return PyErr_Format (PyExc_RuntimeError, _("Cannot invoke CLI from MI."));
+
+ in_cli = 1;
+ current_interp_command_loop ();
+ in_cli = 0;
+
+ Py_RETURN_NONE;
+}
+
+/* Set up the Python argument vector and evaluate a script. This is
+ used to implement 'gdb -P'. */
+
+void
+run_python_script (int argc, char **argv)
+{
+ FILE *input;
+
+ /* We never free this, since we plan to exit at the end. */
+ ensure_python_env (get_current_arch (), current_language);
+
+ running_python_script = 1;
+
+#if PYTHON_ABI_VERSION < 3
+ PySys_SetArgv (argc - 1, argv + 1);
+#else
+ {
+ wchar_t **wargv = alloca (sizeof (*wargv) * (argc + 1));
+ int i;
+
+ for (i = 1; i < argc; i++)
+ {
+ size_t len = mbstowcs (NULL, argv[i], 0);
+ size_t len2;
+
+ if (len == (size_t) -1)
+ {
+ fprintf (stderr, "Invalid multibyte argument #%d \"%s\"\n",
+ i, argv[i]);
+ exit (1);
+ }
+ wargv[i] = alloca (sizeof (**wargv) * (len + 1));
+ len2 = mbstowcs (wargv[i], argv[i], len + 1);
+ assert (len2 == len);
+ }
+ wargv[argc] = NULL;
+ PySys_SetArgv (argc - 1, wargv + 1);
+ }
+#endif
+
+ input = fopen (argv[0], "r");
+ if (! input)
+ {
+ fprintf (stderr, "could not open %s: %s\n", argv[0], strerror (errno));
+ exit (1);
+ }
+ PyRun_SimpleFile (input, argv[0]);
+ fclose (input);
+ exit (0);
+}
+
+
+
static PyObject *
gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
@@ -1982,6 +2061,8 @@ PyMethodDef python_GdbMethods[] =
Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
a Python String containing the output of the command if to_string is\n\
set to True." },
+ { "cli", gdbpy_cli, METH_NOARGS,
+ "Enter the gdb CLI" },
{ "parameter", gdbpy_parameter, METH_VARARGS,
"Return a gdb parameter's value" },
diff --git a/gdb/python/python.h b/gdb/python/python.h
index e6bfcca..688daa3 100644
--- a/gdb/python/python.h
+++ b/gdb/python/python.h
@@ -25,4 +25,6 @@
/* This is all that python exports to gdb. */
extern const struct extension_language_defn extension_language_python;
+extern void run_python_script (int argc, char **argv);
+
#endif /* GDB_PYTHON_H */
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 9f25a48..88b0842 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} {
set description "step over cmdarg_vec initialization"
set command "step"
}
+ -re ".*python_script = 0.*$gdb_prompt $" {
+ set description "step over python_script initialization"
+ set command "step"
+ }
-re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" {
set description "next over make_command_stats_cleanup and everything it calls"
set command "next"
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index 33fdbe5..264d00f 100644
--- 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
@ -588,10 +159,9 @@ index 33fdbe5..264d00f 100644
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
index baa17b7..45ad67e 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -388,6 +388,15 @@ proc test_value_after_death {} {
@@ -419,6 +419,15 @@ proc test_value_after_death {} {
"print value's type"
}
@ -607,9 +177,9 @@ index baa17b7..45ad67e 100644
# 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.
@@ -517,6 +526,7 @@ test_value_in_inferior
@@ -606,6 +615,7 @@ test_value_in_inferior
test_value_from_buffer
test_inferior_function_call
test_lazy_strings
test_value_after_death
+test_cast_regression

View File

@ -1,5 +1,12 @@
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
Subject: [patch 3/3] attach-fail-reasons: SELinux deny_ptrace
Hi,
@ -9,11 +16,9 @@ and here is the last bit for new SELinux 'deny_ptrace':
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>
@ -37,205 +42,10 @@ gdb/gdbserver/
(linux_create_inferior, linux_tracefork_child): Call it instead of
direct ptrace.
Index: gdb-7.10.50.20160106/gdb/nat/linux-ptrace.c
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/nat/linux-ptrace.c 2016-01-08 19:15:57.580707944 +0100
+++ gdb-7.10.50.20160106/gdb/nat/linux-ptrace.c 2016-01-08 19:16:02.654736246 +0100
@@ -24,6 +24,10 @@
#include "gdb_wait.h"
#include "gdb_ptrace.h"
+#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. */
@@ -48,6 +52,8 @@
buffer_xml_printf (buffer, _("process %d is a zombie "
"- the process has already terminated"),
(int) pid);
+
+ linux_ptrace_create_warnings (buffer);
}
/* See linux-ptrace.h. */
@@ -594,6 +600,22 @@
linux_ptrace_test_ret_to_nx ();
}
+/* Print all possible reasons we could fail to create a traced process. */
+
+void
+linux_ptrace_create_warnings (struct buffer *buffer)
+{
+#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)
+ buffer_xml_printf (buffer,
+ _("the SELinux boolean 'deny_ptrace' is enabled, "
+ "you can disable this process attach protection by: "
+ "(gdb) shell sudo setsebool deny_ptrace=0"));
+#endif /* HAVE_LIBSELINUX */
+}
+
/* Extract extended ptrace event from wait status. */
int
Index: gdb-7.10.50.20160106/gdb/nat/linux-ptrace.h
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/nat/linux-ptrace.h 2016-01-08 19:15:57.581707950 +0100
+++ gdb-7.10.50.20160106/gdb/nat/linux-ptrace.h 2016-01-08 19:16:02.655736251 +0100
@@ -164,6 +164,7 @@
extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
extern void linux_ptrace_init_warnings (void);
+extern void linux_ptrace_create_warnings (struct buffer *buffer);
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);
Index: gdb-7.10.50.20160106/gdb/configure.ac
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/configure.ac 2016-01-08 19:15:57.582707955 +0100
+++ gdb-7.10.50.20160106/gdb/configure.ac 2016-01-08 19:16:02.656736257 +0100
@@ -2077,6 +2077,10 @@
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,
Index: gdb-7.10.50.20160106/gdb/gdbserver/configure.ac
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/gdbserver/configure.ac 2016-01-08 19:15:57.582707955 +0100
+++ gdb-7.10.50.20160106/gdb/gdbserver/configure.ac 2016-01-08 19:16:02.656736257 +0100
@@ -524,6 +524,10 @@
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)
Index: gdb-7.10.50.20160106/gdb/gdbserver/linux-low.c
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/gdbserver/linux-low.c 2016-01-08 19:15:57.585707972 +0100
+++ gdb-7.10.50.20160106/gdb/gdbserver/linux-low.c 2016-01-08 19:16:02.658736268 +0100
@@ -853,6 +853,29 @@
return lwp;
}
+/* Execute PTRACE_TRACEME with error checking. */
+
+static void
+linux_traceme (const char *program)
+{
+ int save_errno;
+ struct buffer buffer;
+
+ errno = 0;
+ if (ptrace (PTRACE_TRACEME, 0,
+ (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0) == 0)
+ return;
+
+ save_errno = errno;
+ buffer_init (&buffer);
+ linux_ptrace_create_warnings (&buffer);
+ buffer_grow_str0 (&buffer, "");
+ fprintf (stderr, _("%sCannot trace created process %s: %s.\n"),
+ buffer_finish (&buffer), program, strerror (save_errno));
+ fflush (stderr);
+ _exit (0177);
+}
+
/* Start an inferior process and returns its pid.
ALLARGS is a vector of program-name and args. */
@@ -876,7 +899,7 @@
if (pid == 0)
{
close_most_fds ();
- ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0);
+ linux_traceme (program);
setpgid (0, 0);
Index: gdb-7.10.50.20160106/gdb/inf-ptrace.c
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/inf-ptrace.c 2016-01-08 19:15:57.586707977 +0100
+++ gdb-7.10.50.20160106/gdb/inf-ptrace.c 2016-01-08 19:16:02.659736274 +0100
@@ -79,7 +79,15 @@
inf_ptrace_me (void)
{
/* "Trace me, Dr. Memory!" */
+ errno = 0;
ptrace (PT_TRACE_ME, 0, (PTRACE_TYPE_ARG3)0, 0);
+ if (errno != 0)
+ {
+ fprintf_unfiltered (gdb_stderr, _("Cannot create process: %s\n"),
+ safe_strerror (errno));
+ gdb_flush (gdb_stderr);
+ _exit (0177);
+ }
}
/* Start a new inferior Unix child process. EXEC_FILE is the file to
Index: gdb-7.10.50.20160106/gdb/linux-nat.c
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/linux-nat.c 2016-01-08 19:15:57.587707983 +0100
+++ gdb-7.10.50.20160106/gdb/linux-nat.c 2016-01-08 19:16:02.660736279 +0100
@@ -1016,6 +1016,7 @@
{
struct cleanup *restore_personality
= maybe_disable_address_space_randomization (disable_randomization);
+ volatile struct gdb_exception ex;
/* The fork_child mechanism is synchronous and calls target_wait, so
we have to mask the async mode. */
@@ -1023,7 +1024,28 @@
/* Make sure we report all signals during startup. */
linux_nat_pass_signals (ops, 0, NULL);
- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
+ TRY
+ {
+ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
+ }
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ struct buffer buffer;
+ char *message, *buffer_s;
+
+ message = xstrdup (ex.message);
+ make_cleanup (xfree, message);
+
+ buffer_init (&buffer);
+ linux_ptrace_create_warnings (&buffer);
+
+ buffer_grow_str0 (&buffer, "");
+ buffer_s = buffer_finish (&buffer);
+ make_cleanup (xfree, buffer_s);
+
+ throw_error (ex.error, "%s%s", buffer_s, message);
+ }
+ END_CATCH
do_cleanups (restore_personality);
}
Index: gdb-7.10.50.20160106/gdb/config.in
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/config.in 2016-01-08 19:15:57.588707989 +0100
+++ gdb-7.10.50.20160106/gdb/config.in 2016-01-08 19:16:02.660736279 +0100
@@ -264,6 +264,9 @@
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
@ -245,7 +55,7 @@ Index: gdb-7.10.50.20160106/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
@@ -396,6 +399,9 @@
@@ -388,6 +391,9 @@
/* Define to 1 if you have the `scm_new_smob' function. */
#undef HAVE_SCM_NEW_SMOB
@ -255,11 +65,10 @@ Index: gdb-7.10.50.20160106/gdb/config.in
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
Index: gdb-7.10.50.20160106/gdb/configure
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/configure 2016-01-08 19:15:57.593708017 +0100
+++ gdb-7.10.50.20160106/gdb/configure 2016-01-08 19:16:02.665736307 +0100
@@ -14653,6 +14653,64 @@
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
@@ -16861,6 +16861,64 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
@ -324,13 +133,107 @@ Index: gdb-7.10.50.20160106/gdb/configure
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
# except that the argument to --with-sysroot is optional.
Index: gdb-7.10.50.20160106/gdb/gdbserver/config.in
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/gdbserver/config.in 2016-01-08 19:15:57.595708028 +0100
+++ gdb-7.10.50.20160106/gdb/gdbserver/config.in 2016-01-08 19:16:02.665736307 +0100
@@ -117,6 +117,9 @@
/* Define to 1 if you have the `mcheck' library (-lmcheck). */
#undef HAVE_LIBMCHECK
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
@ -338,9 +241,9 @@ Index: gdb-7.10.50.20160106/gdb/gdbserver/config.in
/* Define if the target supports branch tracing. */
#undef HAVE_LINUX_BTRACE
@@ -193,6 +196,9 @@
/* Define to 1 if you have the `pwrite' function. */
#undef HAVE_PWRITE
@@ -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
@ -348,11 +251,10 @@ Index: gdb-7.10.50.20160106/gdb/gdbserver/config.in
/* Define to 1 if you have the `setns' function. */
#undef HAVE_SETNS
Index: gdb-7.10.50.20160106/gdb/gdbserver/configure
===================================================================
--- gdb-7.10.50.20160106.orig/gdb/gdbserver/configure 2016-01-08 19:15:57.597708039 +0100
+++ gdb-7.10.50.20160106/gdb/gdbserver/configure 2016-01-08 19:16:02.667736318 +0100
@@ -7311,6 +7311,64 @@
diff --git a/gdbserver/configure b/gdbserver/configure
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -10683,6 +10683,64 @@ if $want_ipa ; then
fi
fi
@ -417,3 +319,38 @@ Index: gdb-7.10.50.20160106/gdb/gdbserver/configure
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,235 +0,0 @@
From 3a2b436ae9958a1029545c03201b7223ff33c150 Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Mon, 30 May 2016 14:11:43 +0200
Subject: [PATCH 1/2] Code cleanup: dwarf2_get_pc_bounds: -1/0/+1 -> enum
Make the code (maybe) more readable + primarily prepare it for [patch 2/2]
enum extension.
This change should have no code change impact.
gdb/ChangeLog
2016-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup: dwarf2_get_pc_bounds: -1/0/+1 -> enum
* dwarf2read.c (enum pc_bounds_kind) New.
(dwarf2_get_pc_bounds): Use it in the declaration.
(process_psymtab_comp_unit_reader): Adjust caller. Rename has_pc_info
to cu_bounds_kind.
(read_func_scope, read_lexical_block_scope, read_call_site_scope):
Adjust callers.
(dwarf2_get_pc_bounds): Use enum pc_bounds_kind in the definition.
(dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds): Adjust callers.
---
gdb/ChangeLog | 12 ++++++++++
gdb/dwarf2read.c | 71 ++++++++++++++++++++++++++++++++++++--------------------
2 files changed, 58 insertions(+), 25 deletions(-)
### a/gdb/ChangeLog
### b/gdb/ChangeLog
## -1,3 +1,15 @@
+2016-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup: dwarf2_get_pc_bounds: -1/0/+1 -> enum
+ * dwarf2read.c (enum pc_bounds_kind) New.
+ (dwarf2_get_pc_bounds): Use it in the declaration.
+ (process_psymtab_comp_unit_reader): Adjust caller. Rename has_pc_info
+ to cu_bounds_kind.
+ (read_func_scope, read_lexical_block_scope, read_call_site_scope):
+ Adjust callers.
+ (dwarf2_get_pc_bounds): Use enum pc_bounds_kind in the definition.
+ (dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds): Adjust callers.
+
2016-05-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS (QCatchSyscalls): Remove the parameter. Include ...
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1606,9 +1606,25 @@ static void read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu);
static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *,
struct dwarf2_cu *, struct partial_symtab *);
-static int dwarf2_get_pc_bounds (struct die_info *,
- CORE_ADDR *, CORE_ADDR *, struct dwarf2_cu *,
- struct partial_symtab *);
+/* How dwarf2_get_pc_bounds constructed its *LOWPC and *HIGHPC return
+ values. */
+enum pc_bounds_kind
+{
+ /* No valid combination of DW_AT_low_pc, DW_AT_high_pc or DW_AT_ranges
+ was found. */
+ PC_BOUNDS_NOT_PRESENT,
+
+ /* Discontiguous range was found - that is DW_AT_ranges was found. */
+ PC_BOUNDS_RANGES,
+
+ /* Contiguous range was found - DW_AT_low_pc and DW_AT_high_pc were found. */
+ PC_BOUNDS_HIGH_LOW,
+};
+
+static enum pc_bounds_kind dwarf2_get_pc_bounds (struct die_info *,
+ CORE_ADDR *, CORE_ADDR *,
+ struct dwarf2_cu *,
+ struct partial_symtab *);
static void get_scope_pc_bounds (struct die_info *,
CORE_ADDR *, CORE_ADDR *,
@@ -5947,7 +5963,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
CORE_ADDR baseaddr;
CORE_ADDR best_lowpc = 0, best_highpc = 0;
struct partial_symtab *pst;
- int has_pc_info;
+ enum pc_bounds_kind cu_bounds_kind;
const char *filename;
struct process_psymtab_comp_unit_data *info
= (struct process_psymtab_comp_unit_data *) data;
@@ -5977,9 +5993,9 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
/* Possibly set the default values of LOWPC and HIGHPC from
`DW_AT_ranges'. */
- has_pc_info = dwarf2_get_pc_bounds (comp_unit_die, &best_lowpc,
- &best_highpc, cu, pst);
- if (has_pc_info == 1 && best_lowpc < best_highpc)
+ cu_bounds_kind = dwarf2_get_pc_bounds (comp_unit_die, &best_lowpc,
+ &best_highpc, cu, pst);
+ if (cu_bounds_kind == PC_BOUNDS_HIGH_LOW && best_lowpc < best_highpc)
/* Store the contiguous range if it is not empty; it can be empty for
CUs with no code. */
addrmap_set_empty (objfile->psymtabs_addrmap,
@@ -6003,7 +6019,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
first_die = load_partial_dies (reader, info_ptr, 1);
scan_partial_symbols (first_die, &lowpc, &highpc,
- ! has_pc_info, cu);
+ cu_bounds_kind == PC_BOUNDS_NOT_PRESENT, cu);
/* If we didn't find a lowpc, set it to highpc to avoid
complaints from `maint check'. */
@@ -6012,7 +6028,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
/* If the compilation unit didn't have an explicit address range,
then use the information extracted from its child dies. */
- if (! has_pc_info)
+ if (cu_bounds_kind == PC_BOUNDS_NOT_PRESENT)
{
best_lowpc = lowpc;
best_highpc = highpc;
@@ -11373,7 +11389,8 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
}
/* Ignore functions with missing or invalid low and high pc attributes. */
- if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL))
+ if (dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL)
+ == PC_BOUNDS_NOT_PRESENT)
{
attr = dwarf2_attr (die, DW_AT_external, cu);
if (!attr || !DW_UNSND (attr))
@@ -11535,7 +11552,8 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
as multiple lexical blocks? Handling children in a sane way would
be nasty. Might be easier to properly extend generic blocks to
describe ranges. */
- if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL))
+ if (dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL)
+ == PC_BOUNDS_NOT_PRESENT)
return;
lowpc = gdbarch_adjust_dwarf2_addr (gdbarch, lowpc + baseaddr);
highpc = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
@@ -11745,7 +11763,8 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
CORE_ADDR lowpc;
/* DW_AT_entry_pc should be preferred. */
- if (!dwarf2_get_pc_bounds (target_die, &lowpc, NULL, target_cu, NULL))
+ if (dwarf2_get_pc_bounds (target_die, &lowpc, NULL, target_cu, NULL)
+ == PC_BOUNDS_NOT_PRESENT)
complaint (&symfile_complaints,
_("DW_AT_GNU_call_site_target target DIE has invalid "
"low pc, for referencing DIE 0x%x [in module %s]"),
@@ -12020,11 +12039,11 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
return 1;
}
-/* Get low and high pc attributes from a die. Return 1 if the attributes
- are present and valid, otherwise, return 0. Return -1 if the range is
- discontinuous, i.e. derived from DW_AT_ranges information. */
+/* Get low and high pc attributes from a die. See enum pc_bounds_kind
+ definition for the return value. *LOWPC and *HIGHPC are set iff
+ PC_BOUNDS_NOT_PRESENT is not returned. */
-static int
+static enum pc_bounds_kind
dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
CORE_ADDR *highpc, struct dwarf2_cu *cu,
struct partial_symtab *pst)
@@ -12033,7 +12052,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
struct attribute *attr_high;
CORE_ADDR low = 0;
CORE_ADDR high = 0;
- int ret = 0;
+ enum pc_bounds_kind ret = PC_BOUNDS_NOT_PRESENT;
attr_high = dwarf2_attr (die, DW_AT_high_pc, cu);
if (attr_high)
@@ -12048,10 +12067,10 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
}
else
/* Found high w/o low attribute. */
- return 0;
+ return PC_BOUNDS_NOT_PRESENT;
/* Found consecutive range of addresses. */
- ret = 1;
+ ret = PC_BOUNDS_HIGH_LOW;
}
else
{
@@ -12070,15 +12089,15 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
/* Value of the DW_AT_ranges attribute is the offset in the
.debug_ranges section. */
if (!dwarf2_ranges_read (ranges_offset, &low, &high, cu, pst))
- return 0;
+ return PC_BOUNDS_NOT_PRESENT;
/* Found discontinuous range of addresses. */
- ret = -1;
+ ret = PC_BOUNDS_RANGES;
}
}
/* read_partial_die has also the strict LOW < HIGH requirement. */
if (high <= low)
- return 0;
+ return PC_BOUNDS_NOT_PRESENT;
/* When using the GNU linker, .gnu.linkonce. sections are used to
eliminate duplicate copies of functions and vtables and such.
@@ -12089,7 +12108,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
If this is a discarded function, mark the pc bounds as invalid,
so that GDB will ignore it. */
if (low == 0 && !dwarf2_per_objfile->has_section_at_zero)
- return 0;
+ return PC_BOUNDS_NOT_PRESENT;
*lowpc = low;
if (highpc)
@@ -12110,7 +12129,8 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die,
CORE_ADDR low, high;
struct die_info *child = die->child;
- if (dwarf2_get_pc_bounds (die, &low, &high, cu, NULL))
+ if (dwarf2_get_pc_bounds (die, &low, &high, cu, NULL)
+ != PC_BOUNDS_NOT_PRESENT)
{
*lowpc = min (*lowpc, low);
*highpc = max (*highpc, high);
@@ -12147,7 +12167,8 @@ get_scope_pc_bounds (struct die_info *die,
CORE_ADDR best_high = (CORE_ADDR) 0;
CORE_ADDR current_low, current_high;
- if (dwarf2_get_pc_bounds (die, &current_low, &current_high, cu, NULL))
+ if (dwarf2_get_pc_bounds (die, &current_low, &current_high, cu, NULL)
+ != PC_BOUNDS_NOT_PRESENT)
{
best_low = current_low;
best_high = current_high;
--
2.5.5

View File

@ -1,343 +0,0 @@
From e385593eef98ac92be57159e141f4b805dadbbb3 Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Mon, 30 May 2016 14:14:43 +0200
Subject: [PATCH 2/2] PR 15231: import bare DW_TAG_lexical_block
Local variables in lambdas are not accessible
https://sourceware.org/bugzilla/show_bug.cgi?id=15231
GDB: read_lexical_block_scope
/* Ignore blocks with missing or invalid low and high pc attributes. */
[...]
if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL))
return;
But sometimes there is:
FAIL: gcc-5.3.1-6.fc23.x86_64
<2><92>: Abbrev Number: 11 (DW_TAG_lexical_block)
<3><9c>: Abbrev Number: 13 (DW_TAG_structure_type)
<9d> DW_AT_name : (indirect string, offset: 0x3c): <lambda()>
[...]
Where DW_TAG_lexical_block has no attributes. Such whole subtree is currently
dropped by GDB while I think it should just import all its children DIEs.
It even XFAIL->XPASSes gdb.ada/out_of_line_in_inlined.exp:
commit 0fa7fe506c242b459c4c05d331e7c7d66fb52390
Author: Joel Brobecker <brobecker@adacore.com>
out of line functions nested inside inline functions.
So I have removed that xfail.
gdb/ChangeLog
2016-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
PR c++/15231
* dwarf2read.c (enum pc_bounds_kind): Add PC_BOUNDS_INVALID.
(process_psymtab_comp_unit_reader, read_func_scope): Adjust callers.
(read_lexical_block_scope): Import DIEs from bare DW_TAG_lexical_block.
(read_call_site_scope): Adjust callers.
(dwarf2_get_pc_bounds): Implement pc_bounds_invalid.
(dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds): Adjust callers.
gdb/testsuite/ChangeLog
2016-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
PR c++/15231
* gdb.ada/out_of_line_in_inlined.exp: Remove xfails.
* gdb.dwarf2/dw2-lexical-block-bare.exp: New file.
---
gdb/ChangeLog | 10 ++++
gdb/dwarf2read.c | 53 ++++++++++------
gdb/testsuite/ChangeLog | 6 ++
gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 6 --
.../gdb.dwarf2/dw2-lexical-block-bare.exp | 70 ++++++++++++++++++++++
5 files changed, 120 insertions(+), 25 deletions(-)
create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
### a/gdb/ChangeLog
### b/gdb/ChangeLog
## -1,5 +1,15 @@
2016-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
+ PR c++/15231
+ * dwarf2read.c (enum pc_bounds_kind): Add PC_BOUNDS_INVALID.
+ (process_psymtab_comp_unit_reader, read_func_scope): Adjust callers.
+ (read_lexical_block_scope): Import DIEs from bare DW_TAG_lexical_block.
+ (read_call_site_scope): Adjust callers.
+ (dwarf2_get_pc_bounds): Implement pc_bounds_invalid.
+ (dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds): Adjust callers.
+
+2016-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
+
Code cleanup: dwarf2_get_pc_bounds: -1/0/+1 -> enum
* dwarf2read.c (enum pc_bounds_kind) New.
(dwarf2_get_pc_bounds): Use it in the declaration.
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1607,13 +1607,16 @@ static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *,
struct dwarf2_cu *, struct partial_symtab *);
/* How dwarf2_get_pc_bounds constructed its *LOWPC and *HIGHPC return
- values. */
+ values. Keep the items ordered with increasing constraints compliance. */
enum pc_bounds_kind
{
- /* No valid combination of DW_AT_low_pc, DW_AT_high_pc or DW_AT_ranges
- was found. */
+ /* No attribute DW_AT_low_pc, DW_AT_high_pc or DW_AT_ranges was found. */
PC_BOUNDS_NOT_PRESENT,
+ /* Some of the attributes DW_AT_low_pc, DW_AT_high_pc or DW_AT_ranges
+ were present but they do not form a valid range of PC addresses. */
+ PC_BOUNDS_INVALID,
+
/* Discontiguous range was found - that is DW_AT_ranges was found. */
PC_BOUNDS_RANGES,
@@ -6019,7 +6022,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
first_die = load_partial_dies (reader, info_ptr, 1);
scan_partial_symbols (first_die, &lowpc, &highpc,
- cu_bounds_kind == PC_BOUNDS_NOT_PRESENT, cu);
+ cu_bounds_kind <= PC_BOUNDS_INVALID, cu);
/* If we didn't find a lowpc, set it to highpc to avoid
complaints from `maint check'. */
@@ -6028,7 +6031,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
/* If the compilation unit didn't have an explicit address range,
then use the information extracted from its child dies. */
- if (cu_bounds_kind == PC_BOUNDS_NOT_PRESENT)
+ if (cu_bounds_kind <= PC_BOUNDS_INVALID)
{
best_lowpc = lowpc;
best_highpc = highpc;
@@ -11390,7 +11393,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
/* Ignore functions with missing or invalid low and high pc attributes. */
if (dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL)
- == PC_BOUNDS_NOT_PRESENT)
+ <= PC_BOUNDS_INVALID)
{
attr = dwarf2_attr (die, DW_AT_external, cu);
if (!attr || !DW_UNSND (attr))
@@ -11552,9 +11555,20 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
as multiple lexical blocks? Handling children in a sane way would
be nasty. Might be easier to properly extend generic blocks to
describe ranges. */
- if (dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL)
- == PC_BOUNDS_NOT_PRESENT)
- return;
+ switch (dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL))
+ {
+ case PC_BOUNDS_NOT_PRESENT:
+ /* DW_TAG_lexical_block has no attributes, process its children as if
+ there was no wrapping by that DW_TAG_lexical_block.
+ GCC does no longer produces such DWARF since GCC r224161. */
+ for (child_die = die->child;
+ child_die != NULL && child_die->tag;
+ child_die = sibling_die (child_die))
+ process_die (child_die, cu);
+ return;
+ case PC_BOUNDS_INVALID:
+ return;
+ }
lowpc = gdbarch_adjust_dwarf2_addr (gdbarch, lowpc + baseaddr);
highpc = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
@@ -11764,7 +11778,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
/* DW_AT_entry_pc should be preferred. */
if (dwarf2_get_pc_bounds (target_die, &lowpc, NULL, target_cu, NULL)
- == PC_BOUNDS_NOT_PRESENT)
+ <= PC_BOUNDS_INVALID)
complaint (&symfile_complaints,
_("DW_AT_GNU_call_site_target target DIE has invalid "
"low pc, for referencing DIE 0x%x [in module %s]"),
@@ -12041,7 +12055,7 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
/* Get low and high pc attributes from a die. See enum pc_bounds_kind
definition for the return value. *LOWPC and *HIGHPC are set iff
- PC_BOUNDS_NOT_PRESENT is not returned. */
+ neither PC_BOUNDS_NOT_PRESENT nor PC_BOUNDS_INVALID are returned. */
static enum pc_bounds_kind
dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
@@ -12052,7 +12066,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
struct attribute *attr_high;
CORE_ADDR low = 0;
CORE_ADDR high = 0;
- enum pc_bounds_kind ret = PC_BOUNDS_NOT_PRESENT;
+ enum pc_bounds_kind ret;
attr_high = dwarf2_attr (die, DW_AT_high_pc, cu);
if (attr_high)
@@ -12067,7 +12081,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
}
else
/* Found high w/o low attribute. */
- return PC_BOUNDS_NOT_PRESENT;
+ return PC_BOUNDS_INVALID;
/* Found consecutive range of addresses. */
ret = PC_BOUNDS_HIGH_LOW;
@@ -12089,15 +12103,17 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
/* Value of the DW_AT_ranges attribute is the offset in the
.debug_ranges section. */
if (!dwarf2_ranges_read (ranges_offset, &low, &high, cu, pst))
- return PC_BOUNDS_NOT_PRESENT;
+ return PC_BOUNDS_INVALID;
/* Found discontinuous range of addresses. */
ret = PC_BOUNDS_RANGES;
}
+ else
+ return PC_BOUNDS_NOT_PRESENT;
}
/* read_partial_die has also the strict LOW < HIGH requirement. */
if (high <= low)
- return PC_BOUNDS_NOT_PRESENT;
+ return PC_BOUNDS_INVALID;
/* When using the GNU linker, .gnu.linkonce. sections are used to
eliminate duplicate copies of functions and vtables and such.
@@ -12108,7 +12124,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
If this is a discarded function, mark the pc bounds as invalid,
so that GDB will ignore it. */
if (low == 0 && !dwarf2_per_objfile->has_section_at_zero)
- return PC_BOUNDS_NOT_PRESENT;
+ return PC_BOUNDS_INVALID;
*lowpc = low;
if (highpc)
@@ -12129,8 +12145,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die,
CORE_ADDR low, high;
struct die_info *child = die->child;
- if (dwarf2_get_pc_bounds (die, &low, &high, cu, NULL)
- != PC_BOUNDS_NOT_PRESENT)
+ if (dwarf2_get_pc_bounds (die, &low, &high, cu, NULL) >= PC_BOUNDS_RANGES)
{
*lowpc = min (*lowpc, low);
*highpc = max (*highpc, high);
@@ -12168,7 +12183,7 @@ get_scope_pc_bounds (struct die_info *die,
CORE_ADDR current_low, current_high;
if (dwarf2_get_pc_bounds (die, &current_low, &current_high, cu, NULL)
- != PC_BOUNDS_NOT_PRESENT)
+ >= PC_BOUNDS_RANGES)
{
best_low = current_low;
best_high = current_high;
### a/gdb/testsuite/ChangeLog
### b/gdb/testsuite/ChangeLog
## -1,3 +1,9 @@
+2016-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ PR c++/15231
+ * gdb.ada/out_of_line_in_inlined.exp: Remove xfails.
+ * gdb.dwarf2/dw2-lexical-block-bare.exp: New file.
+
2016-05-27 Pedro Alves <palves@redhat.com>
* gdb.threads/attach-many-short-lived-threads.exp (bad_dejagnu):
--- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp
+++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp
@@ -23,20 +23,14 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug optimize=-O2}]
clean_restart ${testfile}
-# GCC currently is missing a DW_AT_origin attribute in one of the
-# lexical blocks, preventing GDB from creating a symbol for the
-# subprogram we want to break on.
-setup_xfail "*-*-*"
gdb_test "break foo_o224_021.child1.child2" \
"Breakpoint \[0-9\]+ at.*: file .*foo_o224_021.adb, line \[0-9\]+."
gdb_run_cmd
-setup_xfail "*-*-*"
gdb_test "" \
"Breakpoint $decimal, foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*"
set opt_addr_in "($hex in)?"
-setup_xfail "*-*-*"
gdb_test "bt" \
[multi_line "#0 +$opt_addr_in +foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \
"#1 +$opt_addr_in +foo_o224_021\\.child1 \\(\\).*" \
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
@@ -0,0 +1,70 @@
+# Copyright 2016 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+load_lib dwarf.exp
+
+# This test can only be run on targets which support DWARF-2 and use gas.
+if {![dwarf2_support]} {
+ return 0
+}
+
+standard_testfile .S main.c
+
+# Make some DWARF for the test.
+set asm_file [standard_output_file $srcfile]
+Dwarf::assemble $asm_file {
+ cu {} {
+ compile_unit {
+ {low_pc [gdb_target_symbol main] DW_FORM_addr}
+ {high_pc [gdb_target_symbol main]+0x10000 DW_FORM_addr}
+ } {
+ declare_labels integer_label
+
+ integer_label: DW_TAG_base_type {
+ {DW_AT_byte_size 4 DW_FORM_sdata}
+ {DW_AT_encoding @DW_ATE_signed}
+ {DW_AT_name integer}
+ }
+
+ DW_TAG_subprogram {
+ {name main}
+ {DW_AT_external 1 flag}
+ {low_pc [gdb_target_symbol main] DW_FORM_addr}
+ {high_pc [gdb_target_symbol main]+0x10000 DW_FORM_addr}
+ } {
+ DW_TAG_lexical_block {
+ } {
+ DW_TAG_variable {
+ {DW_AT_name testvar}
+ {DW_AT_type :$integer_label}
+ {DW_AT_external 1 flag}
+ {DW_AT_location {
+ DW_OP_addr [gdb_target_symbol main]
+ } SPECIAL_expr}
+ }
+ }
+ }
+ }
+ }
+}
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} \
+ [list $srcfile2 $asm_file] {nodebug}] } {
+ return -1
+}
+
+runto_main
+
+# FAILing GDB did print: No symbol "testvar" in current context.
+gdb_test "p testvar" { = -?[0-9]+}
--
2.5.5

View File

@ -1,85 +1,45 @@
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.
--
Index: gdb-7.9.50.20150520/gdb/python/py-framefilter.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/python/py-framefilter.c 2015-05-31 17:36:34.681952530 +0200
+++ gdb-7.9.50.20150520/gdb/python/py-framefilter.c 2015-05-31 17:55:01.884788031 +0200
@@ -1523,6 +1523,7 @@ gdbpy_apply_frame_filter (const struct e
PyObject *iterable;
PyObject *item;
htab_t levels_printed;
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;
if (!gdb_python_initialized)
return EXT_LANG_BT_NO_FILTERS;
@@ -1543,24 +1544,7 @@ gdbpy_apply_frame_filter (const struct e
iterable = bootstrap_python_frame_filters (frame, frame_low, frame_high);
if (iterable == NULL)
- {
- /* Normally if there is an error GDB prints the exception,
- abandons the backtrace and exits. The user can then call "bt
- no-filters", and get a default backtrace (it would be
- confusing to automatically start a standard backtrace halfway
- through a Python filtered backtrace). However in the case
- where GDB cannot initialize the frame filters (most likely
- due to incorrect auto-load paths), GDB has printed nothing.
- In this case it is OK to print the default backtrace after
- printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS
- here to signify there are no filters after printing the
- initialization error. This return code will trigger a
- default backtrace. */
-
- gdbpy_print_stack ();
- do_cleanups (cleanups);
- return EXT_LANG_BT_NO_FILTERS;
- }
+ goto error_nothing_printed;
/* If iterable is None, then there are no frame filters registered.
If this is the case, defer to default GDB printing routines in MI
@@ -1591,15 +1575,40 @@ gdbpy_apply_frame_filter (const struct e
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 ();
+
- gdbpy_print_stack_or_quit ();
+ gdbpy_print_stack ();
+ count_printed++;
}
if (item == NULL && PyErr_Occurred ())
- goto error;
+ {
+ if (count_printed > 0)
+ goto error;
+ else
+ goto error_nothing_printed;
+ }
done:
do_cleanups (cleanups);
return success;
+ /* Normally if there is an error GDB prints the exception,
+ abandons the backtrace and exits. The user can then call "bt
+ no-filters", and get a default backtrace (it would be
+ confusing to automatically start a standard backtrace halfway
+ through a Python filtered backtrace). However in the case
+ where GDB cannot initialize the frame filters (most likely
+ due to incorrect auto-load paths), GDB has printed nothing.
+ In this case it is OK to print the default backtrace after
+ printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS
+ here to signify there are no filters after printing the
+ initialization error. This return code will trigger a
+ default backtrace. */
+
+ error_nothing_printed:
+ gdbpy_print_stack ();
+ do_cleanups (cleanups);
+ return EXT_LANG_BT_NO_FILTERS;
+
/* Exit and abandon backtrace on error, printing the exception that
is set. */
error:

View File

@ -1,5 +1,12 @@
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
Subject: [PATCH 1/3] Never kill PID on: gdb exec PID
Hi,
@ -16,25 +23,13 @@ A program is being debugged already. Kill it? (y or n) _
The first attachment of "/tmp/sleep" commandline argument errors at:
#0 throw_error (error=GENERIC_ERROR, fmt=0x116d135 "%s.") at ./common/common-exceptions.c:371
#1 in throw_perror_with_name (errcode=GENERIC_ERROR, string=0x7fffffffdb96 "/dfsfds") at utils.c:974
#2 in perror_with_name (string=0x7fffffffdb96 "/dfsfds") at utils.c:982
#3 in exec_file_attach (filename=0x7fffffffdb96 "/dfsfds", from_tty=1) at exec.c:268
267 if (scratch_chan < 0)
268 perror_with_name (filename);
#4 in catch_command_errors_const (command=0x80f59f <exec_file_attach>, arg=0x7fffffffdb96 "/dfsfds", from_tty=1) at main.c:395
#5 in captured_main (data=0x7fffffffd6f0) at main.c:1051
1051 if (catch_command_errors_const (exec_file_attach, execarg,
1052 !batch_flag))
Then GDB tries to attach to the process $p:
#0 inferior_appeared (inf=0x240e0b0, pid=29210) at inferior.c:305
#1 in inf_ptrace_attach (ops=0x2339540, args=0x21dcdc0 "29210", from_tty=1) at inf-ptrace.c:206
#2 in linux_nat_attach (ops=0x2339540, args=0x21dcdc0 "29210", from_tty=1) at linux-nat.c:1278
#3 in attach_command (args=0x21dcdc0 "29210", from_tty=1) at infcmd.c:2748
#4 in catch_command_errors (command=0x79d7e5 <attach_command>, arg=0x7fffffffdb9e "29210", from_tty=1) at main.c:368
#5 in captured_main (data=0x7fffffffd6f0) at main.c:1082
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
@ -45,37 +40,14 @@ the lines
still fail because consequently attach_command() fails to find the associated
executable file:
#0 throw_error (error=GENERIC_ERROR, fmt=0x116d135 "%s.") at ./common/common-exceptions.c:371
#1 in throw_perror_with_name (errcode=GENERIC_ERROR, string=0x2477860 "/tmp/sleep (deleted)") at utils.c:974
#2 in perror_with_name (string=0x2477860 "/tmp/sleep (deleted)") at utils.c:982
#3 in exec_file_attach (filename=0x2477860 "/tmp/sleep (deleted)", from_tty=1) at exec.c:268
267 if (scratch_chan < 0)
268 perror_with_name (filename);
#4 in exec_file_locate_attach (pid=29210, from_tty=1) at exec.c:173
#5 in attach_command_post_wait (args=0x24739b0 "29210", from_tty=1, async_exec=0) at infcmd.c:2628
#6 in attach_command_continuation (args=0x2473590, err=0) at infcmd.c:2700
#7 in do_my_continuations_1 (pmy_chain=0x7fffffffd190, err=0) at continuations.c:59
#8 in do_my_continuations (list=0x240e130, err=0) at continuations.c:83
#9 in do_all_inferior_continuations (err=0) at continuations.c:125
#10 in inferior_event_handler (event_type=INF_EXEC_COMPLETE, client_data=0x0) at inf-loop.c:60
#11 in fetch_inferior_event (client_data=0x0) at infrun.c:3929
#12 in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at inf-loop.c:44
#13 in handle_target_event (error=0, client_data=0x0) at linux-nat.c:4681
#14 in handle_file_event (file_ptr=0x21e4170, ready_mask=1) at event-loop.c:708
#15 in gdb_wait_for_event (block=0) at event-loop.c:834
#16 in gdb_do_one_event () at event-loop.c:298
#17 in wait_sync_command_done () at top.c:373
#18 in maybe_wait_sync_command_done (was_sync=0) at top.c:388
#19 in catch_command_errors (command=0x79d7e5 <attach_command>, arg=0x7fffffffdb9e "29210", from_tty=1) at main.c:370
#20 in captured_main (data=0x7fffffffd6f0) at main.c:1082
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
and therefore GDB executes the following:
(gdb) bt
#5 in query (ctlstr=0x1141ae8 "A program is being debugged already. Kill it? ") at utils.c:1371
#6 in target_preopen (from_tty=1) at target.c:2183
2179 if (have_inferiors ())
2180 {
2181 if (!from_tty
@ -85,20 +57,14 @@ and therefore GDB executes the following:
2185 else
2186 error (_("Program not killed."));
2187 }
#7 in core_open (arg=0x7fffffffdb9f "9694", from_tty=1) at corelow.c:283
#8 in core_file_command (filename=0x7fffffffdb9f "9694", from_tty=1) at corefile.c:77
#9 in catch_command_errors (command=0x86ca16 <core_file_command>, arg=0x7fffffffdb9f "9694", from_tty=1) at main.c:368
#10 in captured_main (data=0x7fffffffd6f0) at main.c:1084
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>
@ -110,32 +76,24 @@ gdb/testsuite/ChangeLog
* gdb.base/attach-kills.c: New.
* gdb.base/attach-kills.exp: New.
---
gdb/testsuite/gdb.base/attach-kills.c | 25 ++++++++++++++++
gdb/testsuite/gdb.base/attach-kills.exp | 49 +++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+)
create mode 100644 gdb/testsuite/gdb.base/attach-kills.c
create mode 100644 gdb/testsuite/gdb.base/attach-kills.exp
diff --git a/gdb/main.c b/gdb/main.c
index 49c9b68..bc19699 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1080,7 +1080,10 @@ captured_main (void *data)
if (isdigit (pid_or_core_arg[0]))
@@ -1199,7 +1199,10 @@ captured_main_1 (struct captured_main_args *context)
{
if (catch_command_errors (attach_command, pid_or_core_arg,
- !batch_flag) == 0)
+ !batch_flag) == 0
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 ())
catch_command_errors (core_file_command, pid_or_core_arg,
!batch_flag);
}
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
index 0000000..2398f00
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-kills.c
@@ -0,0 +1,25 @@
@ -166,7 +124,6 @@ index 0000000..2398f00
+}
diff --git a/gdb/testsuite/gdb.base/attach-kills.exp b/gdb/testsuite/gdb.base/attach-kills.exp
new file mode 100644
index 0000000..9a93cb7
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-kills.exp
@@ -0,0 +1,49 @@
@ -219,4 +176,3 @@ index 0000000..9a93cb7
+}
+
+kill_wait_spawned_process $test_spawn_id

View File

@ -1,3 +1,11 @@
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
@ -19,13 +27,10 @@ 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.
Index: gdb-7.7.90.20140613/gdb/infrun.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/infrun.c 2014-06-13 21:59:10.835805512 +0200
+++ gdb-7.7.90.20140613/gdb/infrun.c 2014-06-13 21:59:31.064829121 +0200
@@ -4820,6 +4820,16 @@ process_event_stop_test (struct executio
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)
{
@ -33,16 +38,16 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
+ struct minimal_symbol *stopf = lookup_minimal_symbol_by_pc (stop_pc).minsym;
+
+ if ((stop_fn == NULL
+ || strstr (SYMBOL_LINKAGE_NAME (stop_fn), ".omp_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 (MSYMBOL_LINKAGE_NAME (stopf), "._omp_fn.") == NULL))
+ || strstr (stopf->linkage_name (), "._omp_fn.") == NULL))
+{ /* ".omp_fn." */
+
/* We're doing a "next".
Normal (forward) execution: set a breakpoint at the
@@ -4855,6 +4865,7 @@ process_event_stop_test (struct executio
@@ -6821,6 +6831,7 @@ process_event_stop_test (struct execution_control_state *ecs)
keep_going (ecs);
return;
@ -50,10 +55,10 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
}
/* If we are in a function call trampoline (a stub between the
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp 2014-06-13 21:59:22.801819481 +0200
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.
+
@ -86,10 +91,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp
+
+gdb_breakpoint [gdb_get_line_number "success"]
+gdb_continue_to_breakpoint "success" ".*success.*"
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90 2014-06-13 21:59:22.801819481 +0200
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.
+

View File

@ -1,152 +0,0 @@
Index: gdb-7.10.90.20160211/gdb/config/i386/linux64.mh
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/config/i386/linux64.mh 2016-02-11 20:56:32.470674877 +0100
+++ gdb-7.10.90.20160211/gdb/config/i386/linux64.mh 2016-02-11 20:56:51.158797712 +0100
@@ -7,7 +7,7 @@
linux-procfs.o linux-ptrace.o linux-btrace.o \
linux-waitpid.o linux-personality.o x86-linux.o \
x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o
-NAT_FILE= config/nm-linux.h
+NAT_FILE= nm-linux64.h
NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
Index: gdb-7.10.90.20160211/gdb/config/i386/linux.mh
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/config/i386/linux.mh 2016-02-11 20:56:26.925638430 +0100
+++ gdb-7.10.90.20160211/gdb/config/i386/linux.mh 2016-02-11 20:56:32.471674884 +0100
@@ -1,6 +1,6 @@
# Host: Intel 386 running GNU/Linux.
-NAT_FILE= config/nm-linux.h
+NAT_FILE= nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o \
x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
proc-service.o linux-thread-db.o \
Index: gdb-7.10.90.20160211/gdb/config/i386/nm-linux.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/config/i386/nm-linux.h 2016-02-11 20:56:32.471674884 +0100
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux i386.
+
+ Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef NM_LINUX_H
+#define NM_LINUX_H
+
+#include "config/nm-linux.h"
+
+/* Red Hat backward compatibility with gdb-6.8. */
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
Index: gdb-7.10.90.20160211/gdb/config/i386/nm-linux64.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/config/i386/nm-linux64.h 2016-02-11 20:56:32.471674884 +0100
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux amd64.
+
+ Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef NM_LINUX64_H
+#define NM_LINUX64_H
+
+#include "config/nm-linux.h"
+
+/* Red Hat backward compatibility with gdb-6.8. */
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
Index: gdb-7.10.90.20160211/gdb/target.h
===================================================================
--- gdb-7.10.90.20160211.orig/gdb/target.h 2016-02-11 20:56:26.926638437 +0100
+++ gdb-7.10.90.20160211/gdb/target.h 2016-02-11 20:56:32.472674890 +0100
@@ -1924,9 +1924,11 @@
CNT is the number of such watchpoints used so far, including this
one. OTHERTYPE is who knows what... */
+#ifndef target_can_use_hardware_watchpoint
#define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
(*current_target.to_can_use_hw_breakpoint) (&current_target, \
TYPE, CNT, OTHERTYPE)
+#endif
/* Returns the number of debug registers needed to watch the given
memory region, or zero if not supported. */
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2016-02-11 20:56:32.472674890 +0100
@@ -0,0 +1,40 @@
+# Copyright 2009, 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Arch not supporting hw watchpoints does not imply no_hardware_watchpoints set.
+if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
+ && ![istarget "ia64-*-*"])
+ || [target_info exists gdb,no_hardware_watchpoints]} then {
+ verbose "Skipping watchpoint-hw-before-run test."
+ return
+}
+
+set test watchpoint-hw-before-run
+set srcfile watchpoint-hw-hit-once.c
+if { [prepare_for_testing ${test}.exp ${test} ${srcfile}] } {
+ return -1
+}
+
+gdb_test "rwatch watchee" "ardware read watchpoint 1: watchee"
+
+# `runto_main' or `runto main' would delete the watchpoint created above.
+
+if { [gdb_start_cmd] < 0 } {
+ untested start
+ return -1
+}
+gdb_test "" "main .* at .*" "start"
+
+gdb_test "continue" "Continuing.\r\n\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"

View File

@ -1,68 +0,0 @@
http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
Subject: [rfc patch] nomem: internal_error -> error
Hi,
unfortunately I see this problem reproducible only with the
archer-jankratochvil-vla branch (VLA = Variable Length Arrays - char[var]).
OTOH this branch I hopefully submit in some form for FSF GDB later.
In this case (a general problem but tested for example on Fedora 13 i686):
int
main (int argc, char **argv)
{
char a[argc];
return a[0];
}
(gdb) start
(gdb) print a
../../gdb/utils.c:1251: internal-error: virtual memory exhausted: can't allocate 4294951689 bytes.
It is apparently because boundary for the variable `a' is not initialized
there. Users notice it due to Eclipse-CDT trying to automatically display all
the local variables on each step.
Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
But is anone aware of the reasons to use internal_error there?
I find simple error as a perfectly reasonable there.
(history only tracks it since the initial import)
IIRC this idea has been discussed with Tom Tromey, not sure of its origin.
I understand it may be offtopic for FSF GDB but from some GDB crashes I am not
sure if it can happen only due to the VLA variables.
Thanks,
Jan
gdb/
2010-06-01 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
* utils.c (nomem): Change internal_error to error.
Index: gdb-7.3.50.20110722/gdb/utils.c
===================================================================
--- gdb-7.3.50.20110722.orig/gdb/utils.c 2011-07-22 19:28:58.000000000 +0200
+++ gdb-7.3.50.20110722/gdb/utils.c 2011-07-22 19:34:25.000000000 +0200
@@ -1219,13 +1219,11 @@ malloc_failure (long size)
{
if (size > 0)
{
- internal_error (__FILE__, __LINE__,
- _("virtual memory exhausted: can't allocate %ld bytes."),
- size);
+ error (_("virtual memory exhausted: can't allocate %ld bytes."), size);
}
else
{
- internal_error (__FILE__, __LINE__, _("virtual memory exhausted."));
+ error (_("virtual memory exhausted."));
}
}

View File

@ -1,7 +1,15 @@
Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S 2014-02-06 22:02:21.981449555 +0100
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-bz601887-dwarf4-rh-test.patch
;; Backport DWARF-4 support (BZ 601887, Tom Tromey).
;;=fedoratest
diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S
@@ -0,0 +1,167 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -170,10 +178,10 @@ Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S
+ .string "main"
+ .ident "GCC: (GNU) 4.4.4 20100503 (Red Hat 4.4.4-2)"
+ .section .note.GNU-stack,"",@progbits
Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c 2014-02-06 22:02:21.981449555 +0100
diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c
@@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -197,10 +205,10 @@ Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c
+{
+ return 0;
+}
Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp 2014-02-06 22:12:10.788032417 +0100
diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp
@@ -0,0 +1,42 @@
+# Copyright 2010 Free Software Foundation, Inc.
+

View File

@ -1,7 +1,17 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-bz634108-solib_address.patch
;; Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
;;=fedoratest
Fix gdb.solib_address (fix by Phil Muldoon).
s/solib_address/solib_name/ during upstreaming.
diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
@@ -0,0 +1,24 @@

View File

@ -1,6 +1,15 @@
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-ccache-workaround.patch
;; Workaround ccache making lineno non-zero for command-line definitions.
;;=fedoratest: ccache is rarely used and it is even fixed now.
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
@@ -33,6 +33,14 @@ if [test_compiler_info gcc*] {
@@ -25,6 +25,14 @@ if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
lappend options additional_flags=-g3
}

56
gdb-config.patch Normal file
View File

@ -0,0 +1,56 @@
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

@ -1,6 +1,15 @@
--- gdb-7.11/gdb/remote.c-orig 2016-04-06 17:46:52.428921496 +0200
+++ gdb-7.11/gdb/remote.c 2016-04-06 18:28:26.781923516 +0200
@@ -13002,7 +13002,17 @@ remote_pid_to_exec_file (struct target_o
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-container-rh-pkg.patch
;; Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
;;=fedora
diff --git a/gdb/remote.c b/gdb/remote.c
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -14031,7 +14031,17 @@ remote_target::pid_to_exec_file (int pid)
char *annex = NULL;
if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE)
@ -17,5 +26,5 @@
+ return NULL;
+ }
if (filename != NULL)
xfree (filename);
inferior *inf = find_inferior_pid (this, pid);
if (inf == NULL)

View File

@ -1,3 +1,12 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-core-open-vdso-warning.patch
;; Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
;; Fix regression of undisplayed missing shared libraries caused by a fix for.
;;=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*>
http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
@ -7,10 +16,9 @@ commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f
Author: Ulrich Weigand <uweigand@de.ibm.com>
Date: Wed Sep 25 11:52:50 2013 +0000
Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/solib-symbol.exp
===================================================================
--- gdb-7.6.50.20130731-cvs.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2013-08-02 16:27:28.833259471 +0200
+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/solib-symbol.exp 2013-08-02 16:28:22.549330973 +0200
diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp
--- a/gdb/testsuite/gdb.base/solib-symbol.exp
+++ b/gdb/testsuite/gdb.base/solib-symbol.exp
@@ -29,6 +29,7 @@ set testfile "solib-symbol-main"
set srcfile ${srcdir}/${subdir}/${testfile}.c
set binfile [standard_output_file ${testfile}]
@ -19,7 +27,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/solib-symbol.exp
if [get_compiler_info] {
return -1
@@ -72,8 +73,26 @@ gdb_test "br foo2" \
@@ -71,8 +72,26 @@ gdb_test "br foo2" \
"Breakpoint.*: foo2. .2 locations..*" \
"foo2 in mdlib"

View File

@ -1,30 +1,37 @@
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
Index: gdb-7.9.50.20150520/gdb/data-directory/Makefile.in
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/data-directory/Makefile.in 2015-05-31 18:05:43.046746351 +0200
+++ gdb-7.9.50.20150520/gdb/data-directory/Makefile.in 2015-05-31 18:05:58.483841655 +0200
@@ -60,6 +60,8 @@ PYTHON_FILE_LIST = \
gdb/frames.py \
gdb/FrameIterator.py \
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/types.py \
gdb/frames.py \
gdb/printing.py \
gdb/unwinder.py \
@@ -76,6 +78,7 @@ PYTHON_FILE_LIST = \
gdb/command/pretty_printers.py \
gdb/command/prompt.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/function/__init__.py \
gdb/function/caller_is.py \
gdb/function/strfns.py \
Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py 2015-05-31 18:05:58.484841661 +0200
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.
+
@ -62,7 +69,7 @@ Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py
+ if val != None:
+ val = str (val)
+ # FIXME: would be nice to have a more precise exception here.
+ except RuntimeError, text:
+ except RuntimeError as text:
+ val = text
+ if val == None:
+ stream.write ("???")
@ -148,10 +155,10 @@ Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py
+
+ def __getattr__ (self, name):
+ return getattr (self.frame, name)
Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/backtrace.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/backtrace.py 2015-05-31 18:05:58.484841661 +0200
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.
+
@ -195,10 +202,10 @@ Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/backtrace.py
+ return iter
+ return old_frame_filter (iter)
+
Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/command/backtrace.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/command/backtrace.py 2015-05-31 18:05:58.484841661 +0200
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.
+

View File

@ -1,63 +1,71 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-fedora-libncursesw.patch
;; Force libncursesw over libncurses to match the includes (RH BZ 1270534).
;;=push+jan
Fedora: Force libncursesw over libncurses to match the includes.
https://bugzilla.redhat.com/show_bug.cgi?id=1270534
diff -dup -rup gdb-7.10.50.20151113-orig/gdb/configure gdb-7.10.50.20151113/gdb/configure
--- gdb-7.10.50.20151113-orig/gdb/configure 2015-11-14 16:14:04.404118312 +0100
+++ gdb-7.10.50.20151113/gdb/configure 2015-11-14 16:17:59.074566047 +0100
@@ -8463,6 +8463,7 @@ if test x"$prefer_curses" = xyes; then
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
# search /usr/local/include, if ncurses is installed in /usr/local. A
# default installation of ncurses on alpha*-dec-osf* will lead to such
# a situation.
+ # Fedora: Force libncursesw over libncurses to match the includes.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
$as_echo_n "checking for library containing waddstr... " >&6; }
if test "${ac_cv_search_waddstr+set}" = set; then :
@@ -8487,7 +8488,7 @@ return waddstr ();
if ${ac_cv_search_waddstr+:} false; then :
@@ -9673,7 +9674,7 @@ return waddstr ();
return 0;
}
_ACEOF
-for ac_lib in '' ncurses cursesX curses; do
-for ac_lib in '' ncursesw ncurses cursesX curses; do
+for ac_lib in '' ncursesw; do
if test -z "$ac_lib"; then
ac_res="none required"
else
@@ -8561,6 +8562,7 @@ case $host_os in
@@ -9747,6 +9748,7 @@ case $host_os in
esac
# These are the libraries checked by Readline.
+# Fedora: Force libncursesw over libncurses to match the includes.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
$as_echo_n "checking for library containing tgetent... " >&6; }
if test "${ac_cv_search_tgetent+set}" = set; then :
@@ -8585,7 +8587,7 @@ return tgetent ();
if ${ac_cv_search_tgetent+:} false; then :
@@ -9771,7 +9773,7 @@ return tgetent ();
return 0;
}
_ACEOF
-for ac_lib in '' termcap tinfo curses ncurses; do
+for ac_lib in '' termcap tinfo ncursesw; do
-for ac_lib in '' termcap tinfow tinfo curses ncursesw ncurses; do
+for ac_lib in '' ncursesw; do
if test -z "$ac_lib"; then
ac_res="none required"
else
diff -dup -rup gdb-7.10.50.20151113-orig/gdb/configure.ac gdb-7.10.50.20151113/gdb/configure.ac
--- gdb-7.10.50.20151113-orig/gdb/configure.ac 2015-11-14 16:14:04.404118312 +0100
+++ gdb-7.10.50.20151113/gdb/configure.ac 2015-11-14 16:17:54.898540284 +0100
@@ -771,7 +771,8 @@ if test x"$prefer_curses" = xyes; then
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
# search /usr/local/include, if ncurses is installed in /usr/local. A
# default installation of ncurses on alpha*-dec-osf* will lead to such
# a situation.
- AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
- AC_SEARCH_LIBS(waddstr, [ncursesw ncurses cursesX curses])
+ # Fedora: Force libncursesw over libncurses to match the includes.
+ AC_SEARCH_LIBS(waddstr, [ncursesw])
if test "$ac_cv_search_waddstr" != no; then
curses_found=yes
@@ -813,7 +814,8 @@ case $host_os in
@@ -754,7 +755,8 @@ case $host_os in
esac
# These are the libraries checked by Readline.
-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses])
-AC_SEARCH_LIBS(tgetent, [termcap tinfow tinfo curses ncursesw ncurses])
+# Fedora: Force libncursesw over libncurses to match the includes.
+AC_SEARCH_LIBS(tgetent, [termcap tinfo ncursesw])
+AC_SEARCH_LIBS(tgetent, [ncursesw])
if test "$ac_cv_search_tgetent" = no; then
CONFIG_OBS="$CONFIG_OBS stub-termcap.o"

View File

@ -1,27 +0,0 @@
Problem occurs with python and its get_current_arch () as it selects
selected_frame and current_frame while still inferior_ptid is valid for the
original parent. But since this place it is already attached and later
unwinders try to access it, breaking:
-PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork
-PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork
-PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
-PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
-PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
--- ./gdb/infrun.c 2009-12-21 20:26:30.000000000 +0100
+++ ./gdb/infrun.c 2009-12-21 20:26:11.000000000 +0100
@@ -375,6 +375,9 @@ follow_fork (void)
}
else
{
+ /* Possibly referenced PARENT is no longer valid. */
+ reinit_frame_cache ();
+
/* This pending follow fork event is now handled, one way
or another. The previous selected thread may be gone
from the lists by now, but if it is still around, need

View File

@ -1,15 +1,19 @@
http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
Subject: [patch] Display Fortran strings in backtraces
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-fortran-frame-string.patch
;; Display Fortran strings in backtraces.
;;=fedoratest
http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
Hi,
for Fortran it fixes displaying normal strings also in frames/backtraces:
(gdb) frame
#0 f (s=..., _s=3) at ./gdb.fortran/fortran-frame-string.f90:24
->
#0 f (s='foo', _s=3) at ./gdb.fortran/fortran-frame-string.f90:24
The patch is simple and I do not see why it should not be this way.
@ -21,14 +25,11 @@ the Intel VLA patchset as it in fact is completely unrelated to "VLA".
No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu.
Thanks,
Jan
diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
new file mode 100644
index 0000000..4b78266
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
@@ -0,0 +1,36 @@
@ -70,7 +71,6 @@ index 0000000..4b78266
+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
index 0000000..3d1576f
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
@@ -0,0 +1,28 @@

View File

@ -1,611 +0,0 @@
http://sourceware.org/ml/gdb-patches/2016-02/msg00843.html
Subject: [PATCH v2 1/6] fortran: allow multi-dimensional subarrays
From: Christoph Weinmann <christoph.t.weinmann@intel.com>
Add an argument count for subrange expressions in Fortran.
Based on the counted value calculate a new array with the
elements specified by the user. First parse the user input,
secondly copy the desired array values into the return
array, thirdly re-create the necessary ranges and bounds.
1| program prog
2| integer :: ary(10,5) = (/ (i,i=1,10) (j, j=1,5) /)
3| end program prog
(gdb) print ary(2:4,1:3)
old> Syntax error in expression near ':3'
new> $3 = ( ( 21, 31, 41) ( 22, 32, 42) ( 23, 33, 43) )
2013-11-25 Christoph Weinmann <christoph.t.weinmann@intel.com>
* eval.c (multi_f77_subscript): Remove function.
* eval.c (evaluate_subrange_expr): When evaluating
an array or string expression, call
value_f90_subarray.
* eval.c (value_f90_subarray): Add argument parsing
and compute result array based on user input.
* f-exp.y: Increment argument counter for every subrange
expression entered by the user.
* valops.c (value_slice): Call value_slice_1 with
additional default argument.
* valops.c (value_slice_1): Add functionality to
copy and return result values based on input.
* value.h: Add function definition.
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
---
gdb/eval.c | 309 ++++++++++++++++++++++++++++++++++++++++++++++-------------
gdb/f-exp.y | 2 +
gdb/valops.c | 157 ++++++++++++++++++++++++------
gdb/value.h | 2 +
4 files changed, 375 insertions(+), 95 deletions(-)
diff --git a/gdb/eval.c b/gdb/eval.c
index 78ad946..c9f325f 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -399,29 +399,253 @@ init_array_element (struct value *array, struct value *element,
return index;
}
+/* Evaluates any operation on Fortran arrays or strings with at least
+ one user provided parameter. Expects the input ARRAY to be either
+ an array, or a string. Evaluates EXP by incrementing POS, and
+ writes the content from the elt stack into a local struct. NARGS
+ specifies number of literal or range arguments the user provided.
+ NARGS must be the same number as ARRAY has dimensions. */
+
static struct value *
-value_f90_subarray (struct value *array,
- struct expression *exp, int *pos, enum noside noside)
+value_f90_subarray (struct value *array, struct expression *exp,
+ int *pos, int nargs, enum noside noside)
{
- int pc = (*pos) + 1;
+ int i, dim_count = 0;
LONGEST low_bound, high_bound;
struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
- enum f90_range_type range_type
- = (enum f90_range_type) longest_to_int (exp->elts[pc].longconst);
-
- *pos += 3;
+ struct value *new_array = array;
+ struct type *array_type = check_typedef (value_type (new_array));
+ struct type *temp_type;
+
+ /* Local struct to hold user data for Fortran subarray dimensions. */
+ struct subscript_store
+ {
+ /* For every dimension, we are either working on a range or an index
+ expression, so we store this info separately for later. */
+ enum
+ {
+ SUBSCRIPT_RANGE, /* e.g. "(lowbound:highbound)" */
+ SUBSCRIPT_INDEX /* e.g. "(literal)" */
+ } kind;
+
+ /* We also store either the lower and upper bound info, or the index
+ number. Before evaluation of the input values, we do not know if we are
+ actually working on a range of ranges, or an index in a range. So as a
+ first step we store all input in a union. The array calculation itself
+ deals with this later on. */
+ union
+ {
+ struct subscript_range
+ {
+ enum f90_range_type f90_range_type;
+ LONGEST low, high;
+ }
+ range;
+ LONGEST number;
+ };
+ } *subscript_array;
+
+ /* Check if the number of arguments provided by the user matches
+ the number of dimension of the array. A string has only one
+ dimension. */
+ if (nargs != calc_f77_array_dims (value_type (new_array)))
+ error (_("Wrong number of subscripts"));
+
+ subscript_array = alloca (sizeof (*subscript_array) * nargs);
+
+ /* Parse the user input into the SUBSCRIPT_ARRAY to store it. We need
+ to evaluate it first, as the input is from left-to-right. The
+ array is stored from right-to-left. So we have to use the user
+ input in reverse order. Later on, we need the input information to
+ re-calculate the output array. For multi-dimensional arrays, we
+ can be dealing with any possible combination of ranges and indices
+ for every dimension. */
+ for (i = 0; i < nargs; i++)
+ {
+ struct subscript_store *index = &subscript_array[i];
- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
- low_bound = TYPE_LOW_BOUND (range);
- else
- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ /* The user input is a range, with or without lower and upper bound.
+ E.g.: "p arry(2:5)", "p arry( :5)", "p arry( : )", etc. */
+ if (exp->elts[*pos].opcode == OP_F90_RANGE)
+ {
+ int pc = (*pos) + 1;
+ struct subscript_range *range;
+
+ index->kind = SUBSCRIPT_RANGE;
+ range = &index->range;
+
+ *pos += 3;
+ range->f90_range_type = longest_to_int (exp->elts[pc].longconst);
+
+ /* If a lower bound was provided by the user, the bit has been
+ set and we can assign the value from the elt stack. Same for
+ upper bound. */
+ if ((range->f90_range_type == HIGH_BOUND_DEFAULT)
+ || range->f90_range_type == NONE_BOUND_DEFAULT)
+ range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp,
+ pos, noside));
+ if ((range->f90_range_type == LOW_BOUND_DEFAULT)
+ || range->f90_range_type == NONE_BOUND_DEFAULT)
+ range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
+ pos, noside));
+ }
+ /* User input is an index. E.g.: "p arry(5)". */
+ else
+ {
+ struct value *val;
- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
- high_bound = TYPE_HIGH_BOUND (range);
- else
- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ index->kind = SUBSCRIPT_INDEX;
+
+ /* Evaluate each subscript; it must be a legal integer in F77. This
+ ensures the validity of the provided index. */
+ val = evaluate_subexp_with_coercion (exp, pos, noside);
+ index->number = value_as_long (val);
+ }
+
+ }
+
+ /* Traverse the array from right to left and evaluate each corresponding
+ user input. VALUE_SUBSCRIPT is called for every index, until a range
+ expression is evaluated. After a range expression has been evaluated,
+ every subsequent expression is also treated as a range. */
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ struct subscript_store *index = &subscript_array[i];
+ struct type *index_type = TYPE_INDEX_TYPE (array_type);
+
+ switch (index->kind)
+ {
+ case SUBSCRIPT_RANGE:
+ {
+
+ /* When we hit the first range specified by the user, we must
+ treat any subsequent user entry as a range. We simply
+ increment DIM_COUNT which tells us how many times we are
+ calling VALUE_SLICE_1. */
+ struct subscript_range *range = &index->range;
+
+ /* If no lower bound was provided by the user, we take the
+ default boundary. Same for the high bound. */
+ if ((range->f90_range_type == LOW_BOUND_DEFAULT)
+ || (range->f90_range_type == BOTH_BOUND_DEFAULT))
+ range->low = TYPE_LOW_BOUND (index_type);
+
+ if ((range->f90_range_type == HIGH_BOUND_DEFAULT)
+ || (range->f90_range_type == BOTH_BOUND_DEFAULT))
+ range->high = TYPE_HIGH_BOUND (index_type);
+
+ /* Both user provided low and high bound have to be inside the
+ array bounds. Throw an error if not. */
+ if (range->low < TYPE_LOW_BOUND (index_type)
+ || range->low > TYPE_HIGH_BOUND (index_type)
+ || range->high < TYPE_LOW_BOUND (index_type)
+ || range->high > TYPE_HIGH_BOUND (index_type))
+ error (_("provided bound(s) outside array bound(s)"));
+
+ /* DIM_COUNT counts every user argument that is treated as a range.
+ This is necessary for expressions like 'print array(7, 8:9).
+ Here the first argument is a literal, but must be treated as a
+ range argument to allow the correct output representation. */
+ dim_count++;
+
+ new_array
+ = value_slice_1 (new_array,
+ longest_to_int (range->low),
+ longest_to_int (range->high - range->low + 1),
+ dim_count);
+ }
+ break;
+
+ case SUBSCRIPT_INDEX:
+ {
+ /* DIM_COUNT only stays '0' when no range argument was processed
+ before, starting from the last dimension. This way we can
+ reduce the number of dimensions from the result array.
+ However, if a range has been processed before an index, we
+ treat the index like a range with equal low- and high bounds
+ to get the value offset right. */
+ if (dim_count == 0)
+ new_array
+ = value_subscripted_rvalue (new_array, index->number,
+ f77_get_lowerbound (value_type
+ (new_array)));
+ else
+ {
+ /* Check for valid index input. */
+ if (index->number < TYPE_LOW_BOUND (index_type)
+ || index->number > TYPE_HIGH_BOUND (index_type))
+ error (_("error no such vector element"));
+
+ dim_count++;
+ new_array = value_slice_1 (new_array,
+ longest_to_int (index->number),
+ 1, /* length is '1' element */
+ dim_count);
+ }
+
+ }
+ break;
+ }
+ }
+
+ /* With DIM_COUNT > 1 we currently have a one dimensional array, but expect
+ an array of arrays, depending on how many ranges have been provided by
+ the user. So we need to rebuild the array dimensions for printing it
+ correctly.
+ Starting from right to left in the user input, after we hit the first
+ range argument every subsequent argument is also treated as a range.
+ E.g.:
+ "p ary(3, 7, 2:15)" in Fortran has only 1 dimension, but we calculated 3
+ ranges.
+ "p ary(3, 7:12, 4)" in Fortran has only 1 dimension, but we calculated 2
+ ranges.
+ "p ary(2:4, 5, 7)" in Fortran has only 1 dimension, and we calculated 1
+ range. */
+ if (dim_count > 1)
+ {
+ struct value *v = NULL;
- return value_slice (array, low_bound, high_bound - low_bound + 1);
+ temp_type = TYPE_TARGET_TYPE (value_type (new_array));
+
+ /* Every SUBSCRIPT_RANGE in the user input signifies an actual range in
+ the output array. So we traverse the SUBSCRIPT_ARRAY again, looking
+ for a range entry. When we find one, we use the range info to create
+ an additional range_type to set the correct bounds and dimensions for
+ the output array. */
+ for (i = 0; i < nargs; i++)
+ {
+ struct subscript_store *index = &subscript_array[i];
+
+ if (index->kind == SUBSCRIPT_RANGE)
+ {
+ struct type *range_type, *interim_array_type;
+
+ range_type
+ = create_static_range_type (NULL,
+ temp_type,
+ 1,
+ index->range.high - index->range.low + 1);
+
+ interim_array_type = create_array_type (NULL,
+ temp_type,
+ range_type);
+
+ /* For some reason the type code of the contents is missing, so
+ reset it from the original array. */
+ TYPE_CODE (interim_array_type)
+ = TYPE_CODE (value_type (new_array));
+
+ v = allocate_value (interim_array_type);
+
+ temp_type = value_type (v);
+ }
+
+ }
+ value_contents_copy (v, 0, new_array, 0, TYPE_LENGTH (temp_type));
+ return v;
+ }
+
+ return new_array;
}
@@ -1810,14 +2034,11 @@ evaluate_subexp_standard (struct type *expect_type,
switch (code)
{
case TYPE_CODE_ARRAY:
- if (exp->elts[*pos].opcode == OP_F90_RANGE)
- return value_f90_subarray (arg1, exp, pos, noside);
- else
- goto multi_f77_subscript;
+ return value_f90_subarray (arg1, exp, pos, nargs, noside);
case TYPE_CODE_STRING:
if (exp->elts[*pos].opcode == OP_F90_RANGE)
- return value_f90_subarray (arg1, exp, pos, noside);
+ return value_f90_subarray (arg1, exp, pos, 1, noside);
else
{
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
@@ -2222,49 +2443,6 @@ evaluate_subexp_standard (struct type *expect_type,
}
return (arg1);
- multi_f77_subscript:
- {
- LONGEST subscript_array[MAX_FORTRAN_DIMS];
- int ndimensions = 1, i;
- struct value *array = arg1;
-
- if (nargs > MAX_FORTRAN_DIMS)
- error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS);
-
- ndimensions = calc_f77_array_dims (type);
-
- if (nargs != ndimensions)
- error (_("Wrong number of subscripts"));
-
- gdb_assert (nargs > 0);
-
- /* Now that we know we have a legal array subscript expression
- let us actually find out where this element exists in the array. */
-
- /* Take array indices left to right. */
- for (i = 0; i < nargs; i++)
- {
- /* Evaluate each subscript; it must be a legal integer in F77. */
- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
-
- /* Fill in the subscript array. */
-
- subscript_array[i] = value_as_long (arg2);
- }
-
- /* Internal type of array is arranged right to left. */
- for (i = nargs; i > 0; i--)
- {
- struct type *array_type = check_typedef (value_type (array));
- LONGEST index = subscript_array[i - 1];
-
- array = value_subscripted_rvalue (array, index,
- f77_get_lowerbound (array_type));
- }
-
- return array;
- }
-
case BINOP_LOGICAL_AND:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
@@ -3121,6 +3299,9 @@ calc_f77_array_dims (struct type *array_type)
int ndimen = 1;
struct type *tmp_type;
+ if (TYPE_CODE (array_type) == TYPE_CODE_STRING)
+ return 1;
+
if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
error (_("Can't get dimensions for a non-array type"));
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 4faac32..9343abb 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -308,6 +308,8 @@ arglist : subrange
arglist : arglist ',' exp %prec ABOVE_COMMA
{ arglist_len++; }
+ | arglist ',' subrange %prec ABOVE_COMMA
+ { arglist_len++; }
;
/* There are four sorts of subrange types in F90. */
diff --git a/gdb/valops.c b/gdb/valops.c
index 5a244a9..09ea877 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3759,56 +3759,151 @@ value_of_this_silent (const struct language_defn *lang)
struct value *
value_slice (struct value *array, int lowbound, int length)
{
+ /* Pass unaltered arguments to VALUE_SLICE_1, plus a CALL_COUNT of '1' as we
+ are only considering the highest dimension, or we are working on a one
+ dimensional array. So we call VALUE_SLICE_1 exactly once. */
+ return value_slice_1 (array, lowbound, length, 1);
+}
+
+/* CALL_COUNT is used to determine if we are calling the function once, e.g.
+ we are working on the current dimension of ARRAY, or if we are calling
+ the function repeatedly. In the later case we need to take elements
+ from the TARGET_TYPE of ARRAY.
+ With a CALL_COUNT greater than 1 we calculate the offsets for every element
+ that should be in the result array. Then we fetch the contents and then
+ copy them into the result array. The result array will have one dimension
+ less than the input array, so later on we need to recreate the indices and
+ ranges in the calling function. */
+
+struct value *
+value_slice_1 (struct value *array, int lowbound, int length, int call_count)
+{
struct type *slice_range_type, *slice_type, *range_type;
- LONGEST lowerbound, upperbound;
- struct value *slice;
- struct type *array_type;
+ struct type *array_type = check_typedef (value_type (array));
+ struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
+ unsigned int elt_size, elt_offs;
+ LONGEST elt_stride, ary_high_bound, ary_low_bound;
+ struct value *v;
+ int slice_range_size, i = 0, row_count = 1, elem_count = 1;
- array_type = check_typedef (value_type (array));
+ /* Check for legacy code if we are actually dealing with an array or
+ string. */
if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY
&& TYPE_CODE (array_type) != TYPE_CODE_STRING)
error (_("cannot take slice of non-array"));
- range_type = TYPE_INDEX_TYPE (array_type);
- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
- error (_("slice from bad array or bitstring"));
+ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type));
+ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (array_type));
+
+ /* When we are working on a multi-dimensional array, we need to get the
+ attributes of the underlying type. */
+ if (call_count > 1)
+ {
+ elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
+ row_count = TYPE_LENGTH (array_type)
+ / TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
+ }
+
+ elem_count = length;
+ elt_size = TYPE_LENGTH (elt_type);
+ elt_offs = longest_to_int (lowbound - ary_low_bound);
+ elt_stride = TYPE_LENGTH (TYPE_INDEX_TYPE (array_type));
+
+ elt_offs *= elt_size;
+
+ /* Check for valid user input. In case of Fortran this was already done
+ in the calling function. */
+ if (call_count == 1
+ && (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
+ && elt_offs >= TYPE_LENGTH (array_type)))
+ error (_("no such vector element"));
- if (lowbound < lowerbound || length < 0
- || lowbound + length - 1 > upperbound)
- error (_("slice out of range"));
+ /* CALL_COUNT is 1 when we are dealing either with the highest dimension
+ of the array, or a one dimensional array. Set RANGE_TYPE accordingly.
+ In both cases we calculate how many rows/elements will be in the output
+ array by setting slice_range_size. */
+ if (call_count == 1)
+ {
+ range_type = TYPE_INDEX_TYPE (array_type);
+ slice_range_size = elem_count;
+
+ /* Check if the array bounds are valid. */
+ if (get_discrete_bounds (range_type, &ary_low_bound, &ary_high_bound) < 0)
+ error (_("slice from bad array or bitstring"));
+ }
+ /* When CALL_COUNT is greater than 1, we are dealing with an array of arrays.
+ So we need to get the type below the current one and set the RANGE_TYPE
+ accordingly. */
+ else
+ {
+ range_type = TYPE_INDEX_TYPE (TYPE_TARGET_TYPE (array_type));
+ slice_range_size = (ary_low_bound + row_count - 1) * (elem_count);
+ ary_low_bound = TYPE_LOW_BOUND (range_type);
+ }
/* FIXME-type-allocation: need a way to free this type when we are
- done with it. */
- slice_range_type = create_static_range_type ((struct type *) NULL,
- TYPE_TARGET_TYPE (range_type),
- lowbound,
- lowbound + length - 1);
+ done with it. */
+ slice_range_type = create_static_range_type (NULL, TYPE_TARGET_TYPE (range_type),
+ ary_low_bound, slice_range_size);
{
- struct type *element_type = TYPE_TARGET_TYPE (array_type);
- LONGEST offset
- = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
+ struct type *element_type;
+
+ /* When CALL_COUNT equals 1 we can use the legacy code for subarrays. */
+ if (call_count == 1)
+ {
+ element_type = TYPE_TARGET_TYPE (array_type);
- slice_type = create_array_type ((struct type *) NULL,
- element_type,
- slice_range_type);
- TYPE_CODE (slice_type) = TYPE_CODE (array_type);
+ slice_type = create_array_type (NULL, element_type, slice_range_type);
+
+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
+
+ if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
+ v = allocate_value_lazy (slice_type);
+ else
+ {
+ v = allocate_value (slice_type);
+ value_contents_copy (v,
+ value_embedded_offset (v),
+ array,
+ value_embedded_offset (array) + elt_offs,
+ elt_size * longest_to_int (length));
+ }
- if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
- slice = allocate_value_lazy (slice_type);
+ }
+ /* When CALL_COUNT is larger than 1 we are working on a range of ranges.
+ So we copy the relevant elements into the new array we return. */
else
{
- slice = allocate_value (slice_type);
- value_contents_copy (slice, 0, array, offset,
- type_length_units (slice_type));
+ LONGEST dst_offset = 0;
+ LONGEST src_row_length = TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
+
+ element_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (array_type));
+ slice_type = create_array_type (NULL, element_type, slice_range_type);
+
+ TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type));
+
+ v = allocate_value (slice_type);
+ for (i = 0; i < longest_to_int (row_count); i++)
+ {
+ /* Fetches the contents of ARRAY and copies them into V. */
+ value_contents_copy (v,
+ dst_offset,
+ array,
+ elt_offs,
+ elt_size * elem_count);
+ elt_offs += src_row_length;
+ dst_offset += elt_size * elem_count;
+ }
}
- set_value_component_location (slice, array);
- VALUE_FRAME_ID (slice) = VALUE_FRAME_ID (array);
- set_value_offset (slice, value_offset (array) + offset);
+ set_value_component_location (v, array);
+ VALUE_REGNUM (v) = VALUE_REGNUM (array);
+ VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array);
+ set_value_offset (v, value_offset (array) + elt_offs);
}
- return slice;
+ return v;
}
/* Create a value for a FORTRAN complex number. Currently most of the
diff --git a/gdb/value.h b/gdb/value.h
index 2eac5ef..3400460 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1056,6 +1056,8 @@ extern struct value *varying_to_slice (struct value *);
extern struct value *value_slice (struct value *, int, int);
+extern struct value *value_slice_1 (struct value *, int, int, int);
+
extern struct value *value_literal_complex (struct value *, struct value *,
struct type *);
--
2.5.0

View File

@ -1,45 +0,0 @@
http://sourceware.org/ml/gdb-patches/2016-02/msg00841.html
Subject: [PATCH v2 2/6] fortran: combine subarray and string computation
From: Christoph Weinmann <christoph.t.weinmann@intel.com>
Strings only have one dimension, but the element computation is
identical to the subarray computation for ranges and indices.
2013-11-26 Christoph Weinmann <christoph.t.weinmann@intel.com>
* eval.c (evaluate_subexp_standard): Call
value_f90_subarray for print expressions on array and
string types.
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
---
gdb/eval.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/gdb/eval.c b/gdb/eval.c
index c9f325f..164d7ab 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2034,16 +2034,8 @@ evaluate_subexp_standard (struct type *expect_type,
switch (code)
{
case TYPE_CODE_ARRAY:
- return value_f90_subarray (arg1, exp, pos, nargs, noside);
-
case TYPE_CODE_STRING:
- if (exp->elts[*pos].opcode == OP_F90_RANGE)
- return value_f90_subarray (arg1, exp, pos, 1, noside);
- else
- {
- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
- return value_subscript (arg1, value_as_long (arg2));
- }
+ return value_f90_subarray (arg1, exp, pos, nargs, noside);
case TYPE_CODE_PTR:
case TYPE_CODE_FUNC:
--
2.5.0

View File

@ -1,162 +0,0 @@
http://sourceware.org/ml/gdb-patches/2016-02/msg00845.html
Subject: [PATCH v2 3/6] fortran: change subrange enum to bit field
From: Christoph Weinmann <christoph.t.weinmann@intel.com>
Change Fortran subrange enum for subrange expressions to
represent a bitfield for easier manipulation. Consequently
also change occurences and evaluation of said enum. The
behaviour of GDB is unchanged.
2013-11-27 Christoph Weinmann <christoph.t.weinmann@intel.com>
* eval.c (value_f90_subarray): Change evaluation of the
subarray boundaries. Set boundaries to be either user
provided (bit in f90_range_type was set) or take the
default value if the boundary was not provided by the user.
* f-exp.y (subrange): Change rules for subrange expressions
to write the relevant bit sequence onto the elt stack.
* f-lang.h (f90_range_type): Change the enum to use bit
values for each boundary, if set by the user.
* parse.c (operator_length_standard): In case of
OP_F90_RANGE change the calculation of the number of
arguments on the elt stack, depending on the number of
boundaries provided by the user.
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
---
gdb/eval.c | 14 ++++++--------
gdb/f-exp.y | 11 ++++++-----
gdb/f-lang.h | 6 ++----
gdb/parse.c | 21 ++++++++-------------
4 files changed, 22 insertions(+), 30 deletions(-)
diff --git a/gdb/eval.c b/gdb/eval.c
index 164d7ab..9b8b051 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -480,12 +480,12 @@ value_f90_subarray (struct value *array, struct expression *exp,
/* If a lower bound was provided by the user, the bit has been
set and we can assign the value from the elt stack. Same for
upper bound. */
- if ((range->f90_range_type == HIGH_BOUND_DEFAULT)
- || range->f90_range_type == NONE_BOUND_DEFAULT)
+ if ((range->f90_range_type & SUBARRAY_LOW_BOUND)
+ == SUBARRAY_LOW_BOUND)
range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp,
pos, noside));
- if ((range->f90_range_type == LOW_BOUND_DEFAULT)
- || range->f90_range_type == NONE_BOUND_DEFAULT)
+ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND)
+ == SUBARRAY_HIGH_BOUND)
range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
pos, noside));
}
@@ -526,12 +526,10 @@ value_f90_subarray (struct value *array, struct expression *exp,
/* If no lower bound was provided by the user, we take the
default boundary. Same for the high bound. */
- if ((range->f90_range_type == LOW_BOUND_DEFAULT)
- || (range->f90_range_type == BOTH_BOUND_DEFAULT))
+ if ((range->f90_range_type & SUBARRAY_LOW_BOUND) == 0)
range->low = TYPE_LOW_BOUND (index_type);
- if ((range->f90_range_type == HIGH_BOUND_DEFAULT)
- || (range->f90_range_type == BOTH_BOUND_DEFAULT))
+ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND) == 0)
range->high = TYPE_HIGH_BOUND (index_type);
/* Both user provided low and high bound have to be inside the
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 9343abb..b1206de 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -315,26 +315,27 @@ arglist : arglist ',' exp %prec ABOVE_COMMA
/* There are four sorts of subrange types in F90. */
subrange: exp ':' exp %prec ABOVE_COMMA
- { write_exp_elt_opcode (pstate, OP_F90_RANGE);
- write_exp_elt_longcst (pstate, NONE_BOUND_DEFAULT);
+ { write_exp_elt_opcode (pstate, OP_F90_RANGE);
+ write_exp_elt_longcst (pstate,
+ SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND);
write_exp_elt_opcode (pstate, OP_F90_RANGE); }
;
subrange: exp ':' %prec ABOVE_COMMA
{ write_exp_elt_opcode (pstate, OP_F90_RANGE);
- write_exp_elt_longcst (pstate, HIGH_BOUND_DEFAULT);
+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND);
write_exp_elt_opcode (pstate, OP_F90_RANGE); }
;
subrange: ':' exp %prec ABOVE_COMMA
{ write_exp_elt_opcode (pstate, OP_F90_RANGE);
- write_exp_elt_longcst (pstate, LOW_BOUND_DEFAULT);
+ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND);
write_exp_elt_opcode (pstate, OP_F90_RANGE); }
;
subrange: ':' %prec ABOVE_COMMA
{ write_exp_elt_opcode (pstate, OP_F90_RANGE);
- write_exp_elt_longcst (pstate, BOTH_BOUND_DEFAULT);
+ write_exp_elt_longcst (pstate, 0);
write_exp_elt_opcode (pstate, OP_F90_RANGE); }
;
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index eeca107..4d56bf7 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -44,10 +44,8 @@ extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
enum f90_range_type
{
- BOTH_BOUND_DEFAULT, /* "(:)" */
- LOW_BOUND_DEFAULT, /* "(:high)" */
- HIGH_BOUND_DEFAULT, /* "(low:)" */
- NONE_BOUND_DEFAULT /* "(low:high)" */
+ SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" */
+ SUBARRAY_HIGH_BOUND = 0x2 /* "(:high)" */
};
/* A common block. */
diff --git a/gdb/parse.c b/gdb/parse.c
index 4191fc6..d500279 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1006,22 +1006,17 @@ operator_length_standard (const struct expression *expr, int endpos,
case OP_F90_RANGE:
oplen = 3;
+ args = 0;
range_type = (enum f90_range_type)
longest_to_int (expr->elts[endpos - 2].longconst);
- switch (range_type)
- {
- case LOW_BOUND_DEFAULT:
- case HIGH_BOUND_DEFAULT:
- args = 1;
- break;
- case BOTH_BOUND_DEFAULT:
- args = 0;
- break;
- case NONE_BOUND_DEFAULT:
- args = 2;
- break;
- }
+ /* Increment the argument counter for each argument
+ provided by the user. */
+ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
+ args++;
+
+ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
+ args++;
break;
--
2.5.0

View File

@ -1,142 +0,0 @@
http://sourceware.org/ml/gdb-patches/2016-02/msg00842.html
Subject: [PATCH v2 4/6] fortran: enable parsing of stride parameter for subranges
From: Christoph Weinmann <christoph.t.weinmann@intel.com>
Allow the user to provide a stride parameter for Fortran
subarrays. The stride parameter can be any integer except
'0'. The default stride value is '1'.
2013-11-27 Christoph Weinmann <christoph.t.weinmann@intel.com>
* eval.c (value_f90_subarray): Add expression evaluation
for a stride parameter in a Fortran range expression.
* f-exp.y: Add yacc rules for writing info on the elt stack
when the user provided a stride argument.
* f-lang.h (F90_RANGE): Add field to enum to show when a
stride was provided by the user.
* parse.c (operator_length_standard): Check if a stride
value was provided, and increment argument counter
accordingly.
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
---
gdb/eval.c | 10 +++++++++-
gdb/f-exp.y | 33 +++++++++++++++++++++++++++++++--
gdb/f-lang.h | 5 +++--
gdb/parse.c | 3 +++
4 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/gdb/eval.c b/gdb/eval.c
index 9b8b051..308ada3 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -438,7 +438,7 @@ value_f90_subarray (struct value *array, struct expression *exp,
struct subscript_range
{
enum f90_range_type f90_range_type;
- LONGEST low, high;
+ LONGEST low, high, stride;
}
range;
LONGEST number;
@@ -488,6 +488,14 @@ value_f90_subarray (struct value *array, struct expression *exp,
== SUBARRAY_HIGH_BOUND)
range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
pos, noside));
+
+ /* Assign the user's stride value if provided. */
+ if ((range->f90_range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
+ range->stride = value_as_long (evaluate_subexp (NULL_TYPE, exp,
+ pos, noside));
+ /* Assign the default stride value '1'. */
+ else
+ range->stride = 1;
}
/* User input is an index. E.g.: "p arry(5)". */
else
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index b1206de..5151fee 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -316,8 +316,8 @@ arglist : arglist ',' exp %prec ABOVE_COMMA
subrange: exp ':' exp %prec ABOVE_COMMA
{ write_exp_elt_opcode (pstate, OP_F90_RANGE);
- write_exp_elt_longcst (pstate,
- SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND);
+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
+ | SUBARRAY_HIGH_BOUND);
write_exp_elt_opcode (pstate, OP_F90_RANGE); }
;
@@ -339,6 +339,35 @@ subrange: ':' %prec ABOVE_COMMA
write_exp_elt_opcode (pstate, OP_F90_RANGE); }
;
+/* Each subrange type can have a stride argument. */
+subrange: exp ':' exp ':' exp %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_F90_RANGE);
+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
+ | SUBARRAY_HIGH_BOUND
+ | SUBARRAY_STRIDE);
+ write_exp_elt_opcode (pstate, OP_F90_RANGE); }
+ ;
+
+subrange: exp ':' ':' exp %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_F90_RANGE);
+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
+ | SUBARRAY_STRIDE);
+ write_exp_elt_opcode (pstate, OP_F90_RANGE); }
+ ;
+
+subrange: ':' exp ':' exp %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_F90_RANGE);
+ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND
+ | SUBARRAY_STRIDE);
+ write_exp_elt_opcode (pstate, OP_F90_RANGE); }
+ ;
+
+subrange: ':' ':' exp %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_F90_RANGE);
+ write_exp_elt_longcst (pstate, SUBARRAY_STRIDE);
+ write_exp_elt_opcode (pstate, OP_F90_RANGE); }
+ ;
+
complexnum: exp ',' exp
{ }
;
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index 4d56bf7..0ad57af 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -44,8 +44,9 @@ extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
enum f90_range_type
{
- SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" */
- SUBARRAY_HIGH_BOUND = 0x2 /* "(:high)" */
+ SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" or "(low::)" */
+ SUBARRAY_HIGH_BOUND = 0x2, /* "(:high)" or "(:high:)" */
+ SUBARRAY_STRIDE = 0x4 /* "(::stride)" */
};
/* A common block. */
diff --git a/gdb/parse.c b/gdb/parse.c
index d500279..07248c3 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1018,6 +1018,9 @@ operator_length_standard (const struct expression *expr, int endpos,
if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
args++;
+ if ((range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
+ args++;
+
break;
default:
--
2.5.0

View File

@ -1,412 +0,0 @@
http://sourceware.org/ml/gdb-patches/2016-02/msg00844.html
Subject: [PATCH v2 5/6] fortran: calculate subarray with stride values.
From: Christoph Weinmann <christoph.t.weinmann@intel.com>
Calculate elements of a subarray using a provided stride value
The stride value can be a positive or negative integer, but may
not be zero. If no stride is provided, use the default value
1 to print all elements inside the range.
1| program prog
2| integer :: ary(10) = (/ (i, i=1, 10) /)
3| end program prog
(gdb) print ary(1:10:2)
$3 = (1, 3, 5, 7, 9)
2013-11-27 Christoph Weinmann <christoph.t.weinmann>
* eval.c (value_f90_subarray): Add range size calculation
for stride based ranges, and evaluation of user stride
parameters. Add check for matching user input to array
bounds.
* valops.c (value_slice): Add call parameter with default
stride value for calling value_slice_1.
* valops.c (value_slice_1): Add function parameter for
stride length in the return subarray. Calculate array
elements based on stride value.
* value.h: Add stride parameter to declaration of
value_slice_1.
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
---
gdb/eval.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++-------------
gdb/valops.c | 87 +++++++++++++++++++++++++++++++++-------------
gdb/value.h | 2 +-
3 files changed, 152 insertions(+), 48 deletions(-)
diff --git a/gdb/eval.c b/gdb/eval.c
index 308ada3..d01b579 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -437,8 +437,8 @@ value_f90_subarray (struct value *array, struct expression *exp,
{
struct subscript_range
{
- enum f90_range_type f90_range_type;
- LONGEST low, high, stride;
+ enum f90_range_type f90_range_type;
+ LONGEST low, high, stride;
}
range;
LONGEST number;
@@ -475,7 +475,7 @@ value_f90_subarray (struct value *array, struct expression *exp,
range = &index->range;
*pos += 3;
- range->f90_range_type = longest_to_int (exp->elts[pc].longconst);
+ range->f90_range_type = exp->elts[pc].longconst;
/* If a lower bound was provided by the user, the bit has been
set and we can assign the value from the elt stack. Same for
@@ -484,6 +484,7 @@ value_f90_subarray (struct value *array, struct expression *exp,
== SUBARRAY_LOW_BOUND)
range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp,
pos, noside));
+
if ((range->f90_range_type & SUBARRAY_HIGH_BOUND)
== SUBARRAY_HIGH_BOUND)
range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
@@ -496,6 +497,10 @@ value_f90_subarray (struct value *array, struct expression *exp,
/* Assign the default stride value '1'. */
else
range->stride = 1;
+
+ /* Check the provided stride value is illegal, aka '0'. */
+ if (range->stride == 0)
+ error (_("Stride must not be 0"));
}
/* User input is an index. E.g.: "p arry(5)". */
else
@@ -512,10 +517,8 @@ value_f90_subarray (struct value *array, struct expression *exp,
}
- /* Traverse the array from right to left and evaluate each corresponding
- user input. VALUE_SUBSCRIPT is called for every index, until a range
- expression is evaluated. After a range expression has been evaluated,
- every subsequent expression is also treated as a range. */
+ /* Traverse the array from right to left and set the high and low bounds
+ for later use. */
for (i = nargs - 1; i >= 0; i--)
{
struct subscript_store *index = &subscript_array[i];
@@ -548,6 +551,48 @@ value_f90_subarray (struct value *array, struct expression *exp,
|| range->high > TYPE_HIGH_BOUND (index_type))
error (_("provided bound(s) outside array bound(s)"));
+ /* For a negative stride the lower boundary must be larger than the
+ upper boundary.
+ For a positive stride the lower boundary must be smaller than the
+ upper boundary. */
+ if ((range->stride < 0 && range->low < range->high)
+ || (range->stride > 0 && range->low > range->high))
+ error (_("Wrong value provided for stride and boundaries"));
+
+ }
+ break;
+
+ case SUBSCRIPT_INDEX:
+ break;
+
+ }
+
+ array_type = TYPE_TARGET_TYPE (array_type);
+ }
+
+ /* Reset ARRAY_TYPE before slicing.*/
+ array_type = check_typedef (value_type (new_array));
+
+ /* Traverse the array from right to left and evaluate each corresponding
+ user input. VALUE_SUBSCRIPT is called for every index, until a range
+ expression is evaluated. After a range expression has been evaluated,
+ every subsequent expression is also treated as a range. */
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ struct subscript_store *index = &subscript_array[i];
+ struct type *index_type = TYPE_INDEX_TYPE (array_type);
+
+ switch (index->kind)
+ {
+ case SUBSCRIPT_RANGE:
+ {
+
+ /* When we hit the first range specified by the user, we must
+ treat any subsequent user entry as a range. We simply
+ increment DIM_COUNT which tells us how many times we are
+ calling VALUE_SLICE_1. */
+ struct subscript_range *range = &index->range;
+
/* DIM_COUNT counts every user argument that is treated as a range.
This is necessary for expressions like 'print array(7, 8:9).
Here the first argument is a literal, but must be treated as a
@@ -555,10 +600,9 @@ value_f90_subarray (struct value *array, struct expression *exp,
dim_count++;
new_array
- = value_slice_1 (new_array,
- longest_to_int (range->low),
- longest_to_int (range->high - range->low + 1),
- dim_count);
+ = value_slice_1 (new_array, range->low,
+ range->high - range->low + 1,
+ range->stride, dim_count);
}
break;
@@ -572,27 +616,38 @@ value_f90_subarray (struct value *array, struct expression *exp,
to get the value offset right. */
if (dim_count == 0)
new_array
- = value_subscripted_rvalue (new_array, index->number,
+ = value_subscripted_rvalue (new_array, index->number,
f77_get_lowerbound (value_type
(new_array)));
else
{
- /* Check for valid index input. */
+ dim_count++;
+
+ /* We might end up here, because we have to treat the provided
+ index like a range. But now VALUE_SUBSCRIPTED_RVALUE
+ cannot do the range checks for us. So we have to make sure
+ ourselves that the user provided index is inside the
+ array bounds. Throw an error if not. */
if (index->number < TYPE_LOW_BOUND (index_type)
- || index->number > TYPE_HIGH_BOUND (index_type))
- error (_("error no such vector element"));
+ && index->number < TYPE_HIGH_BOUND (index_type))
+ error (_("provided bound(s) outside array bound(s)"));
+
+ if (index->number > TYPE_LOW_BOUND (index_type)
+ && index->number > TYPE_HIGH_BOUND (index_type))
+ error (_("provided bound(s) outside array bound(s)"));
- dim_count++;
new_array = value_slice_1 (new_array,
- longest_to_int (index->number),
- 1, /* length is '1' element */
+ index->number,
+ 1, /* COUNT is '1' element */
+ 1, /* STRIDE set to '1' */
dim_count);
}
}
break;
}
- }
+ array_type = TYPE_TARGET_TYPE (array_type);
+ }
/* With DIM_COUNT > 1 we currently have a one dimensional array, but expect
an array of arrays, depending on how many ranges have been provided by
@@ -617,7 +672,9 @@ value_f90_subarray (struct value *array, struct expression *exp,
the output array. So we traverse the SUBSCRIPT_ARRAY again, looking
for a range entry. When we find one, we use the range info to create
an additional range_type to set the correct bounds and dimensions for
- the output array. */
+ the output array. In addition, we may have a stride value that is not
+ '1', forcing us to adjust the number of elements in a range, according
+ to the stride value. */
for (i = 0; i < nargs; i++)
{
struct subscript_store *index = &subscript_array[i];
@@ -625,12 +682,20 @@ value_f90_subarray (struct value *array, struct expression *exp,
if (index->kind == SUBSCRIPT_RANGE)
{
struct type *range_type, *interim_array_type;
+ int new_length;
+
+ /* The length of a sub-dimension with all elements between the
+ bounds plus the start element itself. It may be modified by
+ a user provided stride value. */
+ new_length = index->range.high - index->range.low;
+
+ new_length /= index->range.stride;
range_type
= create_static_range_type (NULL,
- temp_type,
- 1,
- index->range.high - index->range.low + 1);
+ temp_type,
+ index->range.low,
+ index->range.low + new_length);
interim_array_type = create_array_type (NULL,
temp_type,
diff --git a/gdb/valops.c b/gdb/valops.c
index 09ea877..83c8462 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3759,10 +3759,13 @@ value_of_this_silent (const struct language_defn *lang)
struct value *
value_slice (struct value *array, int lowbound, int length)
{
- /* Pass unaltered arguments to VALUE_SLICE_1, plus a CALL_COUNT of '1' as we
- are only considering the highest dimension, or we are working on a one
- dimensional array. So we call VALUE_SLICE_1 exactly once. */
- return value_slice_1 (array, lowbound, length, 1);
+ /* Pass unaltered arguments to VALUE_SLICE_1, plus a default stride
+ value of '1', which returns every element between LOWBOUND and
+ (LOWBOUND + LENGTH). We also provide a default CALL_COUNT of '1'
+ as we are only considering the highest dimension, or we are
+ working on a one dimensional array. So we call VALUE_SLICE_1
+ exactly once. */
+ return value_slice_1 (array, lowbound, length, 1, 1);
}
/* CALL_COUNT is used to determine if we are calling the function once, e.g.
@@ -3776,7 +3779,8 @@ value_slice (struct value *array, int lowbound, int length)
ranges in the calling function. */
struct value *
-value_slice_1 (struct value *array, int lowbound, int length, int call_count)
+value_slice_1 (struct value *array, int lowbound, int length,
+ int stride_length, int call_count)
{
struct type *slice_range_type, *slice_type, *range_type;
struct type *array_type = check_typedef (value_type (array));
@@ -3799,14 +3803,24 @@ value_slice_1 (struct value *array, int lowbound, int length, int call_count)
attributes of the underlying type. */
if (call_count > 1)
{
+ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (elt_type));
+ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (elt_type));
elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
row_count = TYPE_LENGTH (array_type)
/ TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
}
- elem_count = length;
+ /* With a stride of '1', the number of elements per result row is equal to
+ the LENGTH of the subarray. With non-default stride values, we skip
+ elements, but have to add the start element to the total number of
+ elements per row. */
+ if (stride_length == 1)
+ elem_count = length;
+ else
+ elem_count = ((length - 1) / stride_length) + 1;
+
elt_size = TYPE_LENGTH (elt_type);
- elt_offs = longest_to_int (lowbound - ary_low_bound);
+ elt_offs = lowbound - ary_low_bound;
elt_stride = TYPE_LENGTH (TYPE_INDEX_TYPE (array_type));
elt_offs *= elt_size;
@@ -3825,7 +3839,7 @@ value_slice_1 (struct value *array, int lowbound, int length, int call_count)
if (call_count == 1)
{
range_type = TYPE_INDEX_TYPE (array_type);
- slice_range_size = elem_count;
+ slice_range_size = ary_low_bound + elem_count - 1;
/* Check if the array bounds are valid. */
if (get_discrete_bounds (range_type, &ary_low_bound, &ary_high_bound) < 0)
@@ -3837,7 +3851,7 @@ value_slice_1 (struct value *array, int lowbound, int length, int call_count)
else
{
range_type = TYPE_INDEX_TYPE (TYPE_TARGET_TYPE (array_type));
- slice_range_size = (ary_low_bound + row_count - 1) * (elem_count);
+ slice_range_size = ary_low_bound + (row_count * elem_count) - 1;
ary_low_bound = TYPE_LOW_BOUND (range_type);
}
@@ -3849,8 +3863,9 @@ value_slice_1 (struct value *array, int lowbound, int length, int call_count)
{
struct type *element_type;
- /* When CALL_COUNT equals 1 we can use the legacy code for subarrays. */
- if (call_count == 1)
+ /* When both CALL_COUNT and STRIDE_LENGTH equal 1, we can use the legacy
+ code for subarrays. */
+ if (call_count == 1 && stride_length == 1)
{
element_type = TYPE_TARGET_TYPE (array_type);
@@ -3871,29 +3886,53 @@ value_slice_1 (struct value *array, int lowbound, int length, int call_count)
}
}
- /* When CALL_COUNT is larger than 1 we are working on a range of ranges.
- So we copy the relevant elements into the new array we return. */
+ /* With a CALL_COUNT or STRIDE_LENGTH are greater than 1 we are working
+ on a range of ranges. So we copy the relevant elements into the
+ new array we return. */
else
{
+ int j, offs_store = elt_offs;
LONGEST dst_offset = 0;
LONGEST src_row_length = TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
- element_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (array_type));
+ if (call_count == 1)
+ {
+ /* When CALL_COUNT is equal to 1 we are working on the current range
+ and use these elements directly. */
+ element_type = TYPE_TARGET_TYPE (array_type);
+ }
+ else
+ {
+ /* Working on an array of arrays, the type of the elements is the type
+ of the subarrays' type. */
+ element_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (array_type));
+ }
+
slice_type = create_array_type (NULL, element_type, slice_range_type);
- TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type));
+ /* If we have a one dimensional array, we copy its TYPE_CODE. For a
+ multi dimensional array we copy the embedded type's TYPE_CODE. */
+ if (call_count == 1)
+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
+ else
+ TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type));
v = allocate_value (slice_type);
- for (i = 0; i < longest_to_int (row_count); i++)
+
+ /* Iterate through the rows of the outer array and set the new offset
+ for each row. */
+ for (i = 0; i < row_count; i++)
{
- /* Fetches the contents of ARRAY and copies them into V. */
- value_contents_copy (v,
- dst_offset,
- array,
- elt_offs,
- elt_size * elem_count);
- elt_offs += src_row_length;
- dst_offset += elt_size * elem_count;
+ elt_offs = offs_store + i * src_row_length;
+
+ /* Iterate through the elements in each row to copy only those. */
+ for (j = 1; j <= elem_count; j++)
+ {
+ /* Fetches the contents of ARRAY and copies them into V. */
+ value_contents_copy (v, dst_offset, array, elt_offs, elt_size);
+ elt_offs += elt_size * stride_length;
+ dst_offset += elt_size;
+ }
}
}
diff --git a/gdb/value.h b/gdb/value.h
index 3400460..c18ef2e 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -1056,7 +1056,7 @@ extern struct value *varying_to_slice (struct value *);
extern struct value *value_slice (struct value *, int, int);
-extern struct value *value_slice_1 (struct value *, int, int, int);
+extern struct value *value_slice_1 (struct value *, int, int, int, int);
extern struct value *value_literal_complex (struct value *, struct value *,
struct type *);
--
2.5.0

View File

@ -1,36 +0,0 @@
--- gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/subrange.exp-orig 2016-01-08 22:45:44.956842553 +0100
+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/subrange.exp 2016-01-08 23:26:05.078554629 +0100
@@ -39,27 +39,16 @@ foreach var {a alloc ptr} {
set old_prefix $pf_prefix
lappend pf_prefix "$var:"
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (2, 2:3)" { = \(22, 32\)}
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (2:3, 3)" { = \(32, 33\)}
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (1, 2:)" { = \(21, 31\)}
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (2, :2)" { = \(12, 22\)}
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (3, 2:2)" { = \(23\)}
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "ptype $var (3, 2:2)" " = $int4 \\(2:2\\)"
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (4, :)" { = \(14, 24, 34\)}
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)}
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "ptype $var (:, :)" " = $int4 \\(4,3\\)"
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (:)" "Wrong number of subscripts"
- setup_kfail "*-*-*" "vlaregression/9999"
gdb_test "p $var (:, :, :)" "Wrong number of subscripts"
set pf_prefix $old_prefix
@@ -68,5 +57,4 @@ foreach var {a alloc ptr} {
gdb_test_no_output {set $a=a}
delete_breakpoints
gdb_unload
-setup_kfail "*-*-*" "vlaregression/9999"
gdb_test {p $a (3, 2:2)} { = \(23\)}

View File

@ -1,515 +0,0 @@
http://sourceware.org/ml/gdb-patches/2016-02/msg00847.html
Subject: [PATCH v2 6/6] fortran: test cases for subarray strides and slices
From: Christoph Weinmann <christoph.t.weinmann@intel.com>
Add test cases for subarray creation with range, literal and
stride value permutations for one, two, and three dimensional
arrays.
2013-12-04 Christoph Weinmann <christoph.t.weinmann@intel.com>
testsuite/gdb.fortran/
* static-arrays.exp: New test.
* static-arrays.f90: New file.
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
---
gdb/testsuite/gdb.fortran/static-arrays.exp | 421 ++++++++++++++++++++++++++++
gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 ++++
2 files changed, 476 insertions(+)
create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.exp
create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.f90
diff --git a/gdb/testsuite/gdb.fortran/static-arrays.exp b/gdb/testsuite/gdb.fortran/static-arrays.exp
new file mode 100644
index 0000000..cc9ecc0
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/static-arrays.exp
@@ -0,0 +1,421 @@
+# Copyright 2015 Free Software Foundation, Inc.
+#
+# Contributed by Intel Corp. <christoph.t.weinmann@intel.com>
+#
+# 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 static-arrays.f90
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
+ return -1
+}
+
+if ![runto MAIN__] then {
+ perror "couldn't run to breakpoint MAIN__"
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "BP1"]
+gdb_continue_to_breakpoint "BP1" ".*BP1.*"
+
+# Tests subarrays of one dimensional arrays with subrange variations
+gdb_test "print ar1" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
+ "print ar1."
+gdb_test "print ar1\(4:7\)" "\\$\[0-9\]+ = \\(4, 5, 6, 7\\)" \
+ "print ar1\(4:7\)"
+gdb_test "print ar1\(8:\)" "\\$\[0-9\]+ = \\(8, 9\\).*" \
+ "print ar1\(8:\)"
+gdb_test "print ar1\(:3\)" "\\$\[0-9\]+ = \\(1, 2, 3\\).*" \
+ "print ar1\(:3\)"
+gdb_test "print ar1\(:\)" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
+ "print ar1\(:\)"
+
+# Check assignment
+gdb_test_no_output "set \$my_ary = ar1\(3:8\)"
+gdb_test "print \$my_ary" \
+ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
+ "Assignment of subarray to variable"
+gdb_test_no_output "set ar1\(5\) = 42"
+ gdb_test "print ar1\(3:8\)" \
+ "\\$\[0-9\]+ = \\(3, 4, 42, 6, 7, 8\\)" \
+ "print ar1\(3:8\) after assignment"
+gdb_test "print \$my_ary" \
+ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
+ "Assignment of subarray to variable after original array changed"
+
+# Test for subarrays of one dimensional arrays with literals
+ gdb_test "print ar1\(3\)" "\\$\[0-9\]+ = 3" \
+ "print ar1\(3\)"
+
+# Tests for subranges of 2 dimensional arrays with subrange variations
+gdb_test "print ar2\(2:3, 3:4\)" \
+ "\\$\[0-9\]+ = \\(\\( 23, 33\\) \\( 24, 34\\) \\)" \
+ "print ar2\(2:3, 3:4\)."
+gdb_test "print ar2\(8:9,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
+ "print ar2\(8:9,8:\)"
+gdb_test "print ar2\(8:9,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
+ "print ar2\(8:9,:2\)"
+
+gdb_test "print ar2\(8:,8:9\)" \
+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
+ "print ar2\(8:,8:9\)"
+gdb_test "print ar2\(8:,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
+ "print ar2\(8:,8:\)"
+gdb_test "print ar2\(8:,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
+ "print ar2\(8:,:2\)"
+
+gdb_test "print ar2\(:2,2:3\)" \
+ "\\$\[0-9\]+ = \\(\\( 12, 22\\) \\( 13, 23\\) \\)" \
+ "print ar2\(:2,2:3\)"
+gdb_test "print ar2\(:2,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 18, 28\\) \\( 19, 29\\) \\)" \
+ "print ar2\(:2,8:\)"
+gdb_test "print ar2\(:2,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( 11, 21\\) \\( 12, 22\\) \\)" \
+ "print ar2\(:2,:2\)"
+
+# Test subranges of 2 dimensional arrays with literals and subrange variations
+gdb_test "print ar2\(7, 3:6\)" \
+ "\\$\[0-9\]+ = \\(73, 74, 75, 76\\)" \
+ "print ar2\(7, 3:6\)"
+gdb_test "print ar2\(7,8:\)" \
+ "\\$\[0-9\]+ = \\(78, 79\\)" \
+ "print ar2\(7,8:\)"
+gdb_test "print ar2\(7,:2\)" \
+ "\\$\[0-9\]+ = \\(71, 72\\)" \
+ "print ar2\(7,:2\)"
+
+gdb_test "print ar2\(7:8,4\)" \
+ "\\$\[0-9\]+ = \\(74, 84\\)" \
+ "print ar2(7:8,4\)"
+gdb_test "print ar2\(8:,4\)" \
+ "\\$\[0-9\]+ = \\(84, 94\\)" \
+ "print ar2\(8:,4\)"
+gdb_test "print ar2\(:2,4\)" \
+ "\\$\[0-9\]+ = \\(14, 24\\)" \
+ "print ar2\(:2,4\)"
+gdb_test "print ar2\(3,4\)" \
+ "\\$\[0-9\]+ = 34" \
+ "print ar2\(3,4\)"
+
+# Test subarrays of 3 dimensional arrays with literals and subrange variations
+gdb_test "print ar3\(2:4,3:4,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 237, 337, 437\\) \\( 247, 347, 447\\)\
+ \\) \\( \\( 238, 338, 438\\) \\( 248, 348, 448\\) \\) \\)" \
+ "print ar3\(2:4,3:4,7:8\)"
+gdb_test "print ar3\(2:3,4:5,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 248, 348\\) \\( 258, 358\\) \\) \\(\
+ \\( 249, 349\\) \\( 259, 359\\) \\) \\)" \
+ "print ar3\(2:3,4:5,8:\)"
+gdb_test "print ar3\(2:3,4:5,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 241, 341\\) \\( 251, 351\\) \\) \\(\
+ \\( 242, 342\\) \\( 252, 352\\) \\) \\)" \
+ "print ar3\(2:3,4:5,:2\)"
+
+gdb_test "print ar3\(2:3,8:,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 287, 387\\) \\( 297, 397\\) \\) \\(\
+ \\( 288, 388\\) \\( 298, 398\\) \\) \\)" \
+ "print ar3\(2:3,8:,7:8\)"
+gdb_test "print ar3\(2:3,8:,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 288, 388\\) \\( 298, 398\\) \\) \\(\
+ \\( 289, 389\\) \\( 299, 399\\) \\) \\)" \
+ "print ar3\(2:3,8:,8:\)"
+gdb_test "print ar3\(2:3,8:,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 281, 381\\) \\( 291, 391\\) \\) \\(\
+ \\( 282, 382\\) \\( 292, 392\\) \\) \\)" \
+ "print ar3\(2:3,8:,:2\)"
+
+gdb_test "print ar3\(2:3,:2,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 217, 317\\) \\( 227, 327\\) \\) \\(\
+ \\( 218, 318\\) \\( 228, 328\\) \\) \\)" \
+ "print ar3\(2:3,:2,7:8\)"
+gdb_test "print ar3\(2:3,:2,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 218, 318\\) \\( 228, 328\\) \\) \\(\
+ \\( 219, 319\\) \\( 229, 329\\) \\) \\)" \
+ "print ar3\(2:3,:2,8:\)"
+gdb_test "print ar3\(2:3,:2,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 211, 311\\) \\( 221, 321\\) \\) \\(\
+ \\( 212, 312\\) \\( 222, 322\\) \\) \\)" \
+ "print ar3\(2:3,:2,:2\)"
+
+gdb_test "print ar3\(8:,3:4,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 837, 937\\) \\( 847, 947\\) \\) \\(\
+ \\( 838, 938\\) \\( 848, 948\\) \\) \\)" \
+ "print ar3\(8:,3:4,7:8\)"
+gdb_test "print ar3\(8:,4:5,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 848, 948\\) \\( 858, 958\\) \\) \\(\
+ \\( 849, 949\\) \\( 859, 959\\) \\) \\)" \
+ "print ar3\(8:,4:5,8:\)"
+gdb_test "print ar3\(8:,4:5,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 841, 941\\) \\( 851, 951\\) \\) \\(\
+ \\( 842, 942\\) \\( 852, 952\\) \\) \\)" \
+ "print ar3\(8:,4:5,:2\)"
+
+gdb_test "print ar3\(8:,8:,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 887, 987\\) \\( 897, 997\\) \\) \\(\
+ \\( 888, 988\\) \\( 898, 998\\) \\) \\)" \
+ "print ar3\(8:,8:,7:8\)"
+gdb_test "print ar3\(8:,8:,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 888, 988\\) \\( 898, 998\\) \\) \\(\
+ \\( 889, 989\\) \\( 899, 999\\) \\) \\)" \
+ "print ar3\(8:,8:,8:\)"
+gdb_test "print ar3\(8:,8:,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 881, 981\\) \\( 891, 991\\) \\) \\(\
+ \\( 882, 982\\) \\( 892, 992\\) \\) \\)" \
+ "print ar3\(8:,8:,:2\)"
+
+gdb_test "print ar3\(8:,:2,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 817, 917\\) \\( 827, 927\\) \\) \\(\
+ \\( 818, 918\\) \\( 828, 928\\) \\) \\)" \
+ "print ar3\(8:,:2,7:8\)"
+gdb_test "print ar3\(8:,:2,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 818, 918\\) \\( 828, 928\\) \\) \\(\
+ \\( 819, 919\\) \\( 829, 929\\) \\) \\)" \
+ "print ar3\(8:,:2,8:\)"
+gdb_test "print ar3\(8:,:2,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 811, 911\\) \\( 821, 921\\) \\) \\(\
+ \\( 812, 912\\) \\( 822, 922\\) \\) \\)" \
+ "print ar3\(8:,:2,:2\)"
+
+
+gdb_test "print ar3\(:2,3:4,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 137, 237\\) \\( 147, 247\\) \\) \\(\
+ \\( 138, 238\\) \\( 148, 248\\) \\) \\)" \
+ "print ar3 \(:2,3:4,7:8\)."
+gdb_test "print ar3\(:2,3:4,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 138, 238\\) \\( 148, 248\\) \\) \\(\
+ \\( 139, 239\\) \\( 149, 249\\) \\) \\)" \
+ "print ar3\(:2,3:4,8:\)"
+gdb_test "print ar3\(:2,3:4,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 131, 231\\) \\( 141, 241\\) \\) \\(\
+ \\( 132, 232\\) \\( 142, 242\\) \\) \\)" \
+ "print ar3\(:2,3:4,:2\)"
+
+gdb_test "print ar3\(:2,8:,7:8\)" "\\$\[0-9\]+ = \\(\\( \\( 187, 287\\) \\(\
+ 197, 297\\) \\) \\( \\( 188, 288\\) \\( 198, 298\\) \\) \\)" \
+ "print ar3\(:2,8:,7:8\)"
+gdb_test "print ar3\(:2,8:,8:\)" "\\$\[0-9\]+ = \\(\\( \\( 188, 288\\) \\( 198,\
+ 298\\) \\) \\( \\( 189, 289\\) \\( 199, 299\\) \\) \\)" \
+ "print ar3\(:2,8:,8:\)"
+gdb_test "print ar3\(:2,8:,:2\)" "\\$\[0-9\]+ = \\(\\( \\( 181, 281\\) \\( 191,\
+ 291\\) \\) \\( \\( 182, 282\\) \\( 192, 292\\) \\) \\)" \
+ "print ar3\(:2,8:,:2\)"
+
+gdb_test "print ar3\(:2,:2,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 117, 217\\) \\( 127, 227\\) \\) \\(\
+ \\( 118, 218\\) \\( 128, 228\\) \\) \\)" \
+ "print ar3\(:2,:2,7:8\)"
+gdb_test "print ar3\(:2,:2,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 118, 218\\) \\( 128, 228\\) \\) \\(\
+ \\( 119, 219\\) \\( 129, 229\\) \\) \\)" \
+ "print ar3\(:2,:2,8:\)"
+gdb_test "print ar3\(:2,:2,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 111, 211\\) \\( 121, 221\\) \\) \\(\
+ \\( 112, 212\\) \\( 122, 222\\) \\) \\)" \
+ "print ar3\(:2,:2,:2\)"
+
+#Tests for subarrays of 3 dimensional arrays with literals and subranges
+gdb_test "print ar3\(3,3:4,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( 337, 347\\) \\( 338, 348\\) \\)" \
+ "print ar3\(3,3:4,7:8\)"
+gdb_test "print ar3\(3,4:5,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 348, 358\\) \\( 349, 359\\) \\)" \
+ "print ar3\(3,4:5,8:\)"
+gdb_test "print ar3\(3,4:5,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( 341, 351\\) \\( 342, 352\\) \\)" \
+ "print ar3\(3,4:5,:2\)"
+gdb_test "print ar3\(3,4:5,3\)" \
+ "\\$\[0-9\]+ = \\(343, 353\\)" \
+ "print ar3\(3,4:5,3\)"
+
+gdb_test "print ar3\(2,8:,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( 287, 297\\) \\( 288, 298\\) \\)" \
+ "print ar3\(2,8:,7:8\)"
+gdb_test "print ar3\(2,8:,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 288, 298\\) \\( 289, 299\\) \\)" \
+ "print ar3\(2,8:,8:\)"
+gdb_test "print ar3\(2,8:,:2\)"\
+ "\\$\[0-9\]+ = \\(\\( 281, 291\\) \\( 282, 292\\) \\)" \
+ "print ar3\(2,8:,:2\)"
+gdb_test "print ar3\(2,8:,3\)" \
+ "\\$\[0-9\]+ = \\(283, 293\\)" \
+ "print ar3\(2,8:,3\)"
+
+gdb_test "print ar3\(2,:2,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( 217, 227\\) \\( 218, 228\\) \\)" \
+ "print ar3\(2,:2,7:8\)"
+gdb_test "print ar3\(2,:2,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 218, 228\\) \\( 219, 229\\) \\)" \
+ "print ar3\(2,:2,8:\)"
+gdb_test "print ar3\(2,:2,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( 211, 221\\) \\( 212, 222\\) \\)" \
+ "print ar3\(2,:2,:2\)"
+gdb_test "print ar3\(2,:2,3\)" \
+ "\\$\[0-9\]+ = \\(213, 223\\)" \
+ "print ar3\(2,:2,3\)"
+
+gdb_test "print ar3\(3,4,7:8\)" \
+ "\\$\[0-9\]+ = \\(347, 348\\)" \
+ "print ar3\(3,4,7:8\)"
+gdb_test "print ar3\(3,4,8:\)" \
+ "\\$\[0-9\]+ = \\(348, 349\\)" \
+i "print ar3\(3,4,8:\)"
+gdb_test "print ar3\(3,4,:2\)" \
+ "\\$\[0-9\]+ = \\(341, 342\\)" \
+ "print ar3\(3,4,:2\)"
+gdb_test "print ar3\(5,6,7\)" \
+ "\\$\[0-9\]+ = 567" \
+ "print ar3\(5,6,7\)"
+
+gdb_test "print ar3\(3:4,6,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( 367, 467\\) \\( 368, 468\\) \\)" \
+ "print ar3\(3:4,6,7:8\)"
+gdb_test "print ar3\(3:4,6,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 368, 468\\) \\( 369, 469\\) \\)" \
+ "print ar3\(3:4,6,8:\)"
+gdb_test "print ar3\(3:4,6,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( 361, 461\\) \\( 362, 462\\) \\)" \
+ "print ar3\(3:4,6,:2\)"
+gdb_test "print ar3\(3:4,6,5\)" \
+ "\\$\[0-9\]+ = \\(365, 465\\)" \
+ "print ar3\(3:4,6,5\)"
+
+gdb_test "print ar3\(8:,6,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( 867, 967\\) \\( 868, 968\\) \\)" \
+ "print ar3\(8:,6,7:8\)"
+gdb_test "print ar3\(8:,6,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 868, 968\\) \\( 869, 969\\) \\)" \
+ "print ar3\(8:,6,8:\)"
+gdb_test "print ar3\(8:,6,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( 861, 961\\) \\( 862, 962\\) \\)" \
+ "print ar3\(8:,6,:2\)"
+gdb_test "print ar3\(8:,6,5\)" \
+ "\\$\[0-9\]+ = \\(865, 965\\)" \
+ "print ar3\(8:,6,5\)"
+
+gdb_test "print ar3\(:2,6,7:8\)" \
+ "\\$\[0-9\]+ = \\(\\( 167, 267\\) \\( 168, 268\\) \\)" \
+ "print ar3\(:2,6,7:8\)"
+gdb_test "print ar3\(:2,6,8:\)" \
+ "\\$\[0-9\]+ = \\(\\( 168, 268\\) \\( 169, 269\\) \\)" \
+ "print ar3\(:2,6,8:\)"
+gdb_test "print ar3\(:2,6,:2\)" \
+ "\\$\[0-9\]+ = \\(\\( 161, 261\\) \\( 162, 262\\) \\)" \
+ "print ar3\(:2,6,:2\)"
+gdb_test "print ar3\(:2,6,5\)" \
+ "\\$\[0-9\]+ = \\(165, 265\\)" \
+ "print ar3\(:2,6,5\)"
+
+gdb_test "print ar3\(3:4,5:6,4\)" \
+ "\\$\[0-9\]+ = \\(\\( 354, 454\\) \\( 364, 464\\) \\)" \
+ "print ar2\(3:4,5:6,4\)"
+gdb_test "print ar3\(8:,5:6,4\)" \
+ "\\$\[0-9\]+ = \\(\\( 854, 954\\) \\( 864, 964\\) \\)" \
+ "print ar2\(8:,5:6,4\)"
+gdb_test "print ar3\(:2,5:6,4\)" \
+ "\\$\[0-9\]+ = \\(\\( 154, 254\\) \\( 164, 264\\) \\)" \
+ "print ar2\(:2,5:6,4\)"
+
+# Stride > 1
+gdb_test "print ar1\(2:6:2\)" \
+ "\\$\[0-9\]+ = \\(2, 4, 6\\)" \
+ "print ar1\(2:6:2\)"
+gdb_test "print ar2\(2:6:2,3:4\)" \
+ "\\$\[0-9\]+ = \\(\\( 23, 43, 63\\) \\( 24, 44, 64\\) \\)" \
+ "print ar2\(2:6:2,3:4\)"
+gdb_test "print ar2\(2:6:2,3\)" \
+ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
+ "print ar2\(2:6:2,3\)"
+gdb_test "print ar3\(2:6:2,3:5:2,4:7:3\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 234, 434, 634\\) \\( 254, 454, 654\\)\
+ \\) \\( \\( 237, 437, 637\\) \\( 257, 457, 657\\) \\) \\)" \
+ "print ar3\(2:6:2,3:5:2,4:7:3\)"
+gdb_test "print ar3\(2:6:2,5,4:7:3\)" \
+ "\\$\[0-9\]+ = \\(\\( 254, 454, 654\\) \\( 257, 457, 657\\)\
+ \\)" \
+ "print ar3\(2:6:2,5,4:7:3\)"
+
+# Stride < 0
+gdb_test "print ar1\(8:2:-2\)" \
+ "\\$\[0-9\]+ = \\(8, 6, 4, 2\\)" \
+ "print ar1\(8:2:-2\)"
+gdb_test "print ar2\(8:2:-2,3:4\)" \
+ "\\$\[0-9\]+ = \\(\\( 83, 63, 43, 23\\) \\( 84, 64, 44, 24\\)\
+ \\)" \
+ "print ar2\(8:2:-2,3:4\)"
+gdb_test "print ar2\(2:6:2,3\)" \
+ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
+ "print ar2\(2:6:2,3\)"
+gdb_test "print ar3\(2:3,7:3:-4,4:7:3\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 274, 374\\) \\( 234, 334\\) \\) \\(\
+ \\( 277, 377\\) \\( 237, 337\\) \\) \\)" \
+ "print ar3\(2:3,7:3:-4,4:7:3\)"
+gdb_test "print ar3\(2:6:2,5,7:4:-3\)" \
+ "\\$\[0-9\]+ = \\(\\( 257, 457, 657\\) \\( 254, 454, 654\\)\
+ \\)" \
+ "print ar3\(2:6:2,5,7:4:-3\)"
+
+# Tests with negative and mixed indices
+gdb_test "p ar4\(2:4, -2:1, -15:-14\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 261, 361, 461\\) \\( 271, 371, 471\\)\
+ \\( 281, 381, 481\\) \\( 291, 391, 491\\) \\) \\( \\( 262,\
+ 362, 462\\) \\( 272, 372, 472\\) \\( 282, 382, 482\\) \\( 292,\
+ 392, 492\\) \\) \\)" \
+ "print ar4(2:4, -2:1, -15:-14)"
+
+gdb_test "p ar4\(7,-6:2:3,-7\)" \
+ "\\$\[0-9\]+ = \\(729, 759, 789\\)" \
+ "print ar4(7,-6:2:3,-7)"
+
+gdb_test "p ar4\(9:2:-2, -6:2:3, -6:-15:-3\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 930, 730, 530, 330\\) \\( 960, 760,\
+ 560, 360\\) \\( 990, 790, 590, 390\\) \\) \\( \\( 927, 727,\
+ 527, 327\\) \\( 957, 757, 557, 357\\) \\( 987, 787, 587,\
+ 387\\) \\) \\( \\( 924, 724, 524, 324\\) \\( 954, 754, 554,\
+ 354\\) \\( 984, 784, 584, 384\\) \\) \\( \\( 921, 721, 521,\
+ 321\\) \\( 951, 751, 551, 351\\) \\( 981, 781, 581, 381\\) \\)\
+ \\)" \
+ "print ar4(9:2:-2, -6:2:3, -6:-15:-3)"
+
+gdb_test "p ar4\(:,:,:\)" \
+ "\\$\[0-9\]+ = \\(\\( \\( 111, 211, 311, 411, 511, 611, 711,\
+ 811, .*" \
+ "print ar4(:,:,:)"
+
+# Provoke error messages for bad user input
+gdb_test "print ar1\(0:4\)" \
+ "provided bound\\(s\\) outside array bound\\(s\\)" \
+ "print ar1\(0:4\)"
+gdb_test "print ar1\(8:12\)" \
+ "provided bound\\(s\\) outside array bound\\(s\\)" \
+ "print ar1\(8:12\)"
+gdb_test "print ar1\(8:2:\)" \
+ "A syntax error in expression, near `\\)'." \
+ "print ar1\(8:2:\)"
+gdb_test "print ar1\(8:2:2\)" \
+ "Wrong value provided for stride and boundaries" \
+ "print ar1\(8:2:2\)"
+gdb_test "print ar1\(2:8:-2\)" \
+ "Wrong value provided for stride and boundaries" \
+ "print ar1\(2:8:-2\)"
+gdb_test "print ar1\(2:7:0\)" \
+ "Stride must not be 0" \
+ "print ar1\(2:7:0\)"
+gdb_test "print ar1\(3:7\) = 42" \
+ "Invalid cast." \
+ "Assignment of value to subarray"
diff --git a/gdb/testsuite/gdb.fortran/static-arrays.f90 b/gdb/testsuite/gdb.fortran/static-arrays.f90
new file mode 100644
index 0000000..f22fcbe
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/static-arrays.f90
@@ -0,0 +1,55 @@
+! Copyright 2015 Free Software Foundation, Inc.
+!
+! Contributed by Intel Corp. <christoph.t.weinmann@intel.com>
+!
+! 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/>.
+
+subroutine sub
+ integer, dimension(9) :: ar1
+ integer, dimension(9,9) :: ar2
+ integer, dimension(9,9,9) :: ar3
+ integer, dimension(10,-7:3, -15:-5) :: ar4
+ integer :: i,j,k
+
+ ar1 = 1
+ ar2 = 1
+ ar3 = 1
+ ar4 = 4
+
+ ! Resulting array ar3 looks like ((( 111, 112, 113, 114,...)))
+ do i = 1, 9, 1
+ ar1(i) = i
+ do j = 1, 9, 1
+ ar2(i,j) = i*10 + j
+ do k = 1, 9, 1
+ ar3(i,j,k) = i*100 + j*10 + k
+ end do
+ end do
+ end do
+
+ do i = 1, 10, 1
+ do j = -7, 3, 1
+ do k = -15, -5, 1
+ ar4(i,j,k) = i*100 + (j+8)*10 + (k+16)
+ end do
+ end do
+ end do
+
+ ar1(1) = 11 !BP1
+ return
+end
+
+program testprog
+ call sub
+end
--
2.5.0

View File

@ -1,171 +0,0 @@
http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
Subject: Re: [0/4] RFC: add DWARF index support
Jan Kratochvil: Fixed $d -> $dir.
Jan Kratochvil: Remove /dev/null redirection.
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> This patch series adds support for a DWARF index to gdb.
Roland suggested we wrap up the index-creation code into a helper
script.
I'm not sure if this is something people would want in gdb proper, but I
figured I would send it here just in case.
Tom
2010-07-09 Tom Tromey <tromey@redhat.com>
* Makefile.in (install-only): Install gdb-add-index.
* gdb-add-index: New file.
2010-07-09 Tom Tromey <tromey@redhat.com>
* gdb.texinfo (Index Files): Mention gdb-add-index.
>From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
From: Tom Tromey <tromey@redhat.com>
Date: Fri, 9 Jul 2010 11:17:54 -0600
Subject: [PATCH 4/4] add gdb-add-index
Subject: [PATCH 4/4] add gdb-add-index
---
gdb/ChangeLog | 5 +++++
gdb/Makefile.in | 11 ++++++++++-
gdb/doc/ChangeLog | 4 ++++
gdb/doc/gdb.texinfo | 8 ++++++++
gdb/gdb-add-index | 30 ++++++++++++++++++++++++++++++
5 files changed, 57 insertions(+), 1 deletions(-)
create mode 100755 gdb/gdb-add-index
Index: gdb-7.6.90.20140127/gdb/Makefile.in
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/Makefile.in 2014-02-06 17:37:54.555975958 +0100
+++ gdb-7.6.90.20140127/gdb/Makefile.in 2014-02-06 17:38:52.110038415 +0100
@@ -1093,6 +1093,15 @@ install-only: install-gstack $(CONFIG_IN
$(INSTALL_SCRIPT) gcore \
$(DESTDIR)$(bindir)/$$transformed_name; \
fi
+ transformed_name=`t='$(program_transform_name)'; \
+ echo gdb-add-index | sed -e "$$t"` ; \
+ if test "x$$transformed_name" = x; then \
+ transformed_name=gdb-add-index ; \
+ else \
+ true ; \
+ fi ; \
+ $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \
+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
install-strip:
Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/doc/gdb.texinfo 2014-02-06 17:37:50.822971940 +0100
+++ gdb-7.6.90.20140127/gdb/doc/gdb.texinfo 2014-02-06 17:37:54.565975968 +0100
@@ -17749,6 +17749,14 @@ There are currently some limitation on i
for DWARF debugging information, not stabs. And, they do not
currently work for programs using Ada.
+@value{GDBN} comes with a program, @command{gdb-add-index}, which can
+be used to add the index to a symbol file. It takes the symbol file
+as its only argument:
+
+@smallexample
+$ gdb-add-index symfile
+@end smallexample
+
@node Symbol Errors
@section Errors Reading Symbol Files
@@ -43878,6 +43886,7 @@ switch (die->tag)
* gdbserver man:: Remote Server for the GNU Debugger man page
* gcore man:: Generate a core file of a running program
* gdbinit man:: gdbinit scripts
+* gdb-add-index man:: Add index files to speed up GDB
@end menu
@node gdb man
@@ -44530,6 +44539,54 @@ gdb(1), @code{info -f gdb -n Startup}
The full documentation for @value{GDBN} is maintained as a Texinfo manual.
If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
documentation are properly installed at your site, the command
+
+@smallexample
+info gdb
+@end smallexample
+
+should give you access to the complete manual.
+
+@cite{Using GDB: A Guide to the GNU Source-Level Debugger},
+Richard M. Stallman and Roland H. Pesch, July 1991.
+@end ifset
+@c man end
+
+@node gdb-add-index man
+@heading gdb-add-index
+
+@c man title gdb-add-index Add index files to speed up GDB
+
+@c man begin SYNOPSIS gdb-add-index
+gdb-add-index @var{filename}
+@c man end
+
+@c man begin DESCRIPTION gdb-add-index
+When GDB finds a symbol file, it scans the symbols in the file in order
+to construct an internal symbol table. This lets most GDB operations
+work quickly--at the cost of a delay early on. For large programs,
+this delay can be quite lengthy, so GDB provides a way to build an
+index, which speeds up startup.
+
+To determine whether a file contains such an index, use the command
+@command{readelf -S filename}: the index is stored in a section named
+@code{.gdb_index}. Note that the index is never generated for files that do
+not contain DWARF debug information (sections named @code{.debug_*}).
+
+See more in
+@ifset man
+the @value{GDBN} manual in node @code{Index Files}
+-- shell command @code{info -f gdb -n 'Index Files'}.
+@end ifset
+@ifclear man
+@ref{Index Files}.
+@end ifclear
+@c man end
+
+@c man begin SEEALSO gdb-add-index
+@ifset man
+The full documentation for @value{GDBN} is maintained as a Texinfo manual.
+If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
+documentation are properly installed at your site, the command
@smallexample
info gdb
Index: gdb-7.6.90.20140127/gdb/doc/Makefile.in
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/doc/Makefile.in 2014-02-06 17:37:50.824971942 +0100
+++ gdb-7.6.90.20140127/gdb/doc/Makefile.in 2014-02-06 17:37:54.565975968 +0100
@@ -165,7 +165,7 @@ POD2MAN5 = pod2man --center="GNU Develop
--release="gdb-`sed q version.subst`" --section=5
# List of man pages generated from gdb.texi
-MAN1S = gdb.1 gdbserver.1 gcore.1
+MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
MAN5S = gdbinit.5
MANS = $(MAN1S) $(MAN5S)
@@ -590,6 +590,13 @@ gcore.1: $(GDB_DOC_FILES)
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f gcore.pod
+gdb-add-index.1: $(GDB_DOC_FILES)
+ touch $@
+ -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
+ -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
+ rm -f gdb-add-index.pod
+
gdbinit.5: $(GDB_DOC_FILES)
touch $@
-$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod

View File

@ -1,39 +1,16 @@
Index: gdb-7.7.90.20140613/gdb/dwarf2read.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/dwarf2read.c 2014-06-13 21:56:54.744653443 +0200
+++ gdb-7.7.90.20140613/gdb/dwarf2read.c 2014-06-13 22:01:51.529990684 +0200
@@ -17695,6 +17695,26 @@ new_symbol_full (struct die_info *die, s
/* Cache this symbol's name and the name's demangled form (if any). */
SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack);
linkagename = dwarf2_physname (name, die, cu);
+
+ /* Workaround for:
+ * invalid IFUNC DW_AT_linkage_name: memmove strstr time
+ * http://sourceware.org/bugzilla/show_bug.cgi?id=14166 */
+ if (strcmp (linkagename, "strstr") == 0
+ && strstr (objfile_name (objfile), "/libc") != NULL)
+ {
+ struct objfile *objfile_msym;
+ struct bound_minimal_symbol bmsym;
+
+ if (objfile->separate_debug_objfile_backlink)
+ objfile_msym = objfile->separate_debug_objfile_backlink;
+ else
+ objfile_msym = objfile;
+ bmsym = lookup_minimal_symbol ("strstr", NULL, objfile_msym);
+ if (bmsym.minsym != NULL
+ && MSYMBOL_TYPE (bmsym.minsym) == mst_text_gnu_ifunc)
+ linkagename = "__strstr";
+ }
+
SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), 0, objfile);
/* Fortran does not have mangling standard and the mangling does differ
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp 2014-06-13 21:59:41.174840871 +0200
@@ -0,0 +1,108 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-glibc-strstr-workaround.patch
;; Workaround PR libc/14166 for inferior calls of strstr.
;;=fedoratest: Compatibility with RHELs (unchecked which ones).
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
@@ -0,0 +1,115 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -60,7 +37,7 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.ex
+set testfile "gnu-ifunc-strstr-workaround"
+set executable ${testfile}
+set srcfile start.c
+set binfile ${objdir}/${subdir}/${executable}
+set binfile [standard_output_file ${executable}]
+
+if [prepare_for_testing ${testfile}.exp $executable $srcfile] {
+ return -1
@ -96,6 +73,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.ex
+ set addr $expect_out(1,string)
+ pass "$test (fixed glibc)"
+ }
+ -re " = {<text gnu-indirect-function variable, no debug info>} (0x\[0-9a-f\]+) <__libc_strstr_ifunc>\r\n$gdb_prompt $" {
+ set addr $expect_out(1,string)
+ pass "$test (fixed glibc)"
+ }
+ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ <strstr>\r\n$gdb_prompt $" {
+ untested "$test (gnu-ifunc not in use by glibc)"
+ return 0
@ -135,6 +116,9 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.ex
+ -re " = {<text gnu-indirect-function variable, no debug info>} $addr <__libc_strstr>\r\n$gdb_prompt $" {
+ pass "$test (fixed glibc)"
+ }
+ -re " = {<text gnu-indirect-function variable, no debug info>} $addr <__libc_strstr_ifunc>\r\n$gdb_prompt $" {
+ pass "$test (fixed glibc)"
+ }
+ -re " = {void \\*\\(void\\)} 0x\[0-9a-f\]+ <strstr>\r\n$gdb_prompt $" {
+ fail $test
+ }

View File

@ -1,31 +0,0 @@
http://sourceware.org/ml/gdb-patches/2011-08/msg00331.html
Subject: [RFC] Work around PR libc/13097 "linux-vdso.so.1" #2
Hi,
missed the x86_64-m32 case:
gdb/
2011-08-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Work around PR libc/13097.
* solib.c (update_solib_list): Ignore "linux-vdso.so.1".
Index: gdb-7.9.50.20150520/gdb/solib.c
===================================================================
--- gdb-7.9.50.20150520.orig/gdb/solib.c 2015-05-31 17:04:16.870802493 +0200
+++ gdb-7.9.50.20150520/gdb/solib.c 2015-05-31 17:04:38.824941054 +0200
@@ -893,8 +893,11 @@ update_solib_list (int from_tty, struct
TRY
{
- /* Fill in the rest of the `struct so_list' node. */
- if (!solib_map_sections (i))
+ /* Fill in the rest of the `struct so_list' node.
+ Work around PR libc/13097. */
+ if (!solib_map_sections (i)
+ && strcmp (i->so_original_name, "linux-vdso.so.1") != 0
+ && strcmp (i->so_original_name, "linux-gate.so.1") != 0)
{
not_found++;
if (not_found_filename == NULL)

View File

@ -1,6 +1,12 @@
http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
Subject: [patch] gdb_assert -> complaint for weird DWARF
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
@ -21,7 +27,6 @@ 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
@ -34,25 +39,181 @@ gdb/
* dwarf2read.c (process_die): Change gdb_assert to complaint.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 3eaa0b1..71f5d34 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -8029,7 +8029,13 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
struct cleanup *in_process;
/* We should only be processing those not already in process. */
- gdb_assert (!die->in_process);
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 (&symfile_complaints,
+ _("DIE at 0x%x attempted to be processed twice"),
+ die->offset.sect_off);
+ complaint (_("DIE at 0x%s attempted to be processed twice"),
+ sect_offset_str (die->sect_off));
+ return;
+ }
+
process_die_scope scope (die, cu);
die->in_process = 1;
in_process = make_cleanup (reset_die_in_process,die);
--6TrnltStXW4iwmi0--
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,8 +1,15 @@
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
index 7ff74ba..00a5b5b 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -7382,10 +7382,12 @@ _ACEOF
@@ -9968,10 +9968,12 @@ _ACEOF
@ -19,10 +26,9 @@ index 7ff74ba..00a5b5b 100755
TARGET_PTR="unsigned __int128"
else
diff --git a/gdb/configure.ac b/gdb/configure.ac
index ec776d7..c02ace9 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -648,10 +648,12 @@ AC_CHECK_SIZEOF(unsigned long long)
@@ -803,10 +803,12 @@ AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(unsigned __int128)

Some files were not shown because too many files have changed in this diff Show More