diff --git a/.gitignore b/.gitignore index b9a54bb..62239b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz /v1.6.1.tar.gz /gdb-8.0.1.tar.xz +/gdb-8.0.50.20171204.tar.xz diff --git a/README.local-patches b/README.local-patches new file mode 100644 index 0000000..c1c7ab3 --- /dev/null +++ b/README.local-patches @@ -0,0 +1,96 @@ +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 " 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 + +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 ". 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 can be anything, but the body *must* have the following +special line: + + FileName: name-of-the-patch.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: + + FileName: 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 + +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. diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include new file mode 100644 index 0000000..c3dfa13 --- /dev/null +++ b/_gdb.spec.Patch.include @@ -0,0 +1,531 @@ +# 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 + +# Work around out-of-date dejagnu that does not have KFAIL +#=push: That dejagnu is too old to be supported. +Patch005: gdb-6.3-rh-dummykfail-20041202.patch + +# Better parse 64-bit PPC system call prologues. +#=push: Write new testcase. +Patch006: gdb-6.3-ppc64syscall-20040622.patch + +# Include the pc's section when doing a symbol lookup so that the +# correct symbol is found. +#=push: Write new testcase. +Patch007: gdb-6.3-ppc64displaysymbol-20041124.patch + +# Add a wrapper script to GDB that implements pstack using the +# --readnever option. +#=push +Patch008: gdb-6.3-gstack-20050411.patch + +# VSYSCALL and PIE +#=fedoratest +Patch009: gdb-6.3-test-pie-20050107.patch + +# Get selftest working with sep-debug-info +#=fedoratest +Patch010: gdb-6.3-test-self-20050110.patch + +# Test support of multiple destructors just like multiple constructors +#=fedoratest +Patch011: gdb-6.3-test-dtorfix-20050121.patch + +# Fix to support executable moving +#=fedoratest +Patch012: gdb-6.3-test-movedir-20050125.patch + +# Test sibling threads to set threaded watchpoints for x86 and x86-64 +#=fedoratest +Patch013: gdb-6.3-threaded-watchpoints2-20050225.patch + +# Notify observers that the inferior has been created +#=fedoratest +Patch014: gdb-6.3-inferior-notification-20050721.patch + +# Verify printing of inherited members test +#=fedoratest +Patch015: gdb-6.3-inheritancetest-20050726.patch + +# Add readnever option +#=push +Patch016: gdb-6.3-readnever-20050907.patch + +# Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661). +#=push+jan: There was some mail thread about it, this patch may be a hack. +Patch017: gdb-6.5-bz203661-emit-relocs.patch + +# Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). +#=push+jan: It should be replaced by Infinity project. +Patch018: 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. +Patch019: 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. +Patch020: gdb-6.5-BEA-testsuite.patch + +# Testcase for deadlocking on last address space byte; for corrupted backtraces. +#=fedoratest +Patch021: gdb-6.5-last-address-space-byte-test.patch + +# Fix readline segfault on excessively long hand-typed lines. +#=fedoratest +Patch022: gdb-6.5-readline-long-line-crash-test.patch + +# Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). +#=fedora +Patch023: gdb-6.5-bz216711-clone-is-outermost.patch + +# Test sideeffects of skipping ppc .so libs trampolines (BZ 218379). +#=fedoratest +Patch024: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch + +# Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). +#=fedora +Patch025: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch + +# Find symbols properly at their original (included) file (BZ 109921). +#=fedoratest +Patch026: gdb-6.5-bz109921-DW_AT_decl_file-test.patch + +# Update PPC unwinding patches to their upstream variants (BZ 140532). +#=fedoratest +Patch027: gdb-6.3-bz140532-ppc-unwinding-test.patch + +# Testcase for exec() from threaded program (BZ 202689). +#=fedoratest +Patch028: gdb-6.3-bz202689-exec-from-pthread-test.patch + +# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). +#=fedoratest +Patch029: gdb-6.6-bz230000-power6-disassembly-test.patch + +# Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). +#=fedoratest +Patch030: gdb-6.6-bz229517-gcore-without-terminal.patch + +# Notify user of a child forked process being detached (BZ 235197). +#=push+jan: This is more about discussion if/what should be printed. +Patch031: gdb-6.6-bz235197-fork-detach-info.patch + +# Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". +#=fedoratest +Patch032: gdb-6.6-testsuite-timeouts.patch + +# Support for stepping over PPC atomic instruction sequences (BZ 237572). +#=fedoratest +Patch033: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch + +# Make upstream `set scheduler-locking step' as default. +#=push+jan: How much is scheduler-locking relevant after non-stop? +Patch034: gdb-6.6-scheduler_locking-step-is-default.patch + +# Test kernel VDSO decoding while attaching to an i386 process. +#=fedoratest +Patch035: gdb-6.3-attach-see-vdso-test.patch + +# Test leftover zombie process (BZ 243845). +#=fedoratest +Patch036: gdb-6.5-bz243845-stale-testing-zombie-test.patch + +# New locating of the matching binaries from the pure core file (build-id). +#=push+jan +Patch037: 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 +Patch038: gdb-6.6-buildid-locate-solib-missing-ids.patch + +#=push+jan +Patch039: 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. +Patch040: gdb-6.7-charsign-test.patch + +# Test PPC hiding of call-volatile parameter register. +#=fedoratest +Patch041: gdb-6.7-ppc-clobbered-registers-O2-test.patch + +# Testsuite fixes for more stable/comparable results. +#=fedoratest +Patch042: gdb-6.7-testsuite-stable-results.patch + +# Test ia64 memory leaks of the code using libunwind. +#=fedoratest +Patch043: gdb-6.5-ia64-libunwind-leak-test.patch + +# Test hiding unexpected breakpoints on intentional step commands. +#=fedoratest +Patch044: gdb-6.5-missed-trap-on-step-test.patch + +# Test gcore memory and time requirements for large inferiors. +#=fedoratest +Patch045: gdb-6.5-gcore-buffer-limit-test.patch + +# Test GCORE for shmid 0 shared memory mappings. +#=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible. +Patch046: gdb-6.3-mapping-zero-inode-test.patch + +# Test a crash on `focus cmd', `focus prev' commands. +#=fedoratest +Patch047: gdb-6.3-focus-cmd-prev-test.patch + +# Test various forms of threads tracking across exec() (BZ 442765). +#=fedoratest +Patch048: gdb-6.8-bz442765-threaded-exec-test.patch + +# Silence memcpy check which returns false positive (sparc64) +#=push: But it is just a GCC workaround, look up the existing GCC PR for it. +Patch049: gdb-6.8-sparc64-silence-memcpy-check.patch + +# Test a crash on libraries missing the .text section. +#=fedoratest +Patch050: gdb-6.5-section-num-fixup-test.patch + +# Fix register assignments with no GDB stack frames (BZ 436037). +#=push+jan: This fix is incorrect. +Patch051: gdb-6.8-bz436037-reg-no-longer-active.patch + +# Test the watchpoints conditionals works. +#=fedoratest +Patch052: gdb-6.8-watchpoint-conditionals-test.patch + +# Fix resolving of variables at locations lists in prelinked libs (BZ 466901). +#=fedoratest +Patch053: gdb-6.8-bz466901-backtrace-full-prelinked.patch + +# New test for step-resume breakpoint placed in multiple threads at once. +#=fedoratest +Patch054: 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@.*> +Patch055: gdb-core-open-vdso-warning.patch + +# Fix syscall restarts for amd64->i386 biarch. +#=push+jan +Patch056: gdb-x86_64-i386-syscall-restart.patch + +# Fix stepping with OMP parallel Fortran sections (BZ 533176). +#=push+jan: It requires some better DWARF annotations. +Patch057: gdb-bz533176-fortran-omp-step.patch + +# Fix regression by python on ia64 due to stale current frame. +#=push+jan +Patch058: gdb-follow-child-stale-parent.patch + +# Workaround ccache making lineno non-zero for command-line definitions. +#=fedoratest: ccache is rarely used and it is even fixed now. +Patch059: gdb-ccache-workaround.patch + +#=push+jan: May get obsoleted by Tom's unrelocated objfiles patch. +Patch060: gdb-archer-pie-addons.patch + +#=push+jan: Breakpoints disabling matching should not be based on address. +Patch061: gdb-archer-pie-addons-keep-disabled.patch + +# Testcase for "Do not make up line information" fix by Daniel Jacobowitz. +#=fedoratest +Patch062: gdb-lineno-makeup-test.patch + +# Test power7 ppc disassembly. +#=fedoratest +Patch063: gdb-ppc-power7-test.patch + +# Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). +# Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). +#=push+jan: It should be fixed properly instead. +Patch064: gdb-bz541866-rwatch-before-run.patch + +# Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). +#=push+jan: Currently it is still not fully safe. +Patch065: gdb-moribund-utrace-workaround.patch + +# Fix follow-exec for C++ programs (bugreported by Martin Stransky). +#=fedoratest +Patch066: gdb-archer-next-over-throw-cxx-exec.patch + +# Backport DWARF-4 support (BZ 601887, Tom Tromey). +#=fedoratest +Patch067: gdb-bz601887-dwarf4-rh-test.patch + +#=push+jan +Patch068: gdb-6.6-buildid-locate-core-as-arg.patch + +# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). +#=push+jan +Patch069: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch + +# [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). +#=fedoratest +Patch070: gdb-test-bt-cfi-without-die.patch + +# Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey). +#=push: Re-check against the upstream version. +Patch071: gdb-gdb-add-index-script.patch + +# Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). +#=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted. +Patch072: gdb-bz568248-oom-is-error.patch + +# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). +#=fedoratest +Patch073: gdb-bz634108-solib_address.patch + +# New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). +#=fedoratest +Patch074: gdb-test-pid0-core.patch + +# [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. +#=fedoratest +Patch075: gdb-test-dw2-aranges.patch + +# [archer-keiths-expr-cumulative+upstream] Import C++ testcases. +#=fedoratest +Patch076: gdb-test-expr-cumulative-archer.patch + +# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). +#=fedoratest +Patch077: gdb-physname-pr11734-test.patch + +# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). +#=fedoratest +Patch078: gdb-physname-pr12273-test.patch + +# Toolchain on sparc is slightly broken and debuginfo files are generated +# with non 64bit aligned tables/offsets. +# See for example readelf -S ../Xvnc.debug. +# +# As a consenquence calculation of sectp->filepos as used in +# dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer +# that cannot be used directly as done with MMAP. +# Usage will result in a BusError. +# +# While we figure out what's wrong in the toolchain and do a full archive +# rebuild to fix it, we need to be able to use gdb :) +#=push +Patch079: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch + +# Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). +#=fedoratest +Patch080: gdb-test-ivy-bridge.patch + +# Work around PR libc/13097 "linux-vdso.so.1" warning message. +#=push+jan +Patch081: gdb-glibc-vdso-workaround.patch + +# Hack for proper PIE run of the testsuite. +#=fedoratest +Patch082: gdb-runtest-pie-override.patch + +# Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). +#=push+jan +Patch083: gdb-attach-fail-reasons-5of5.patch + +# Workaround crashes from stale frame_info pointer (BZ 804256). +#=push+jan +Patch084: gdb-stale-frame_info.patch + +# Workaround PR libc/14166 for inferior calls of strstr. +#=fedora: Compatibility with RHELs (unchecked which ones). +Patch085: gdb-glibc-strstr-workaround.patch + +# Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). +#=fedoratest +Patch086: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch + +# Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). +#=fedoratest +Patch087: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch + +# Fix `GDB cannot access struct member whose offset is larger than 256MB' +# (RH BZ 795424). +#=push +Patch088: gdb-rhbz795424-bitpos-20of25.patch + +# Fix `GDB cannot access struct member whose offset is larger than 256MB' +# (RH BZ 795424). +#=push +Patch089: gdb-rhbz795424-bitpos-21of25.patch + +# Fix `GDB cannot access struct member whose offset is larger than 256MB' +# (RH BZ 795424). +#=push +Patch090: gdb-rhbz795424-bitpos-22of25.patch + +# Fix `GDB cannot access struct member whose offset is larger than 256MB' +# (RH BZ 795424). +#=push +Patch091: gdb-rhbz795424-bitpos-23of25.patch + +# Fix `GDB cannot access struct member whose offset is larger than 256MB' +# (RH BZ 795424). +#=push +Patch092: gdb-rhbz795424-bitpos-25of25.patch + +# Fix `GDB cannot access struct member whose offset is larger than 256MB' +# (RH BZ 795424). +#=push +Patch093: gdb-rhbz795424-bitpos-25of25-test.patch + +# Fix `GDB cannot access struct member whose offset is larger than 256MB' +# (RH BZ 795424). +#=push +Patch094: gdb-rhbz795424-bitpos-lazyvalue.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 +Patch095: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch + +# Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). +#=push+jan +Patch096: gdb-gnat-dwarf-crash-3of3.patch + +# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) +#=fedoratest +Patch097: 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 +Patch098: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch + +#=fedoratest +Patch099: gdb-archer-vla-tests.patch + +#=fedoratest +Patch100: gdb-vla-intel-tests.patch + +# Continue backtrace even if a frame filter throws an exception (Phil Muldoon). +#=push +Patch101: gdb-btrobust.patch + +# Display Fortran strings in backtraces. +#=fedoratest +Patch102: gdb-fortran-frame-string.patch + +# Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957). +#=push +Patch103: gdb-python-gil.patch + +# Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to +# crash.' (RH BZ 1156192). +#=fedoratest +Patch104: gdb-rhbz1156192-recursive-dlopen-test.patch + +# Fix jit-reader.h for multi-lib. +#=push+jan +Patch105: gdb-jit-reader-multilib.patch + +# Fix '`catch syscall' doesn't work for parent after `fork' is called' +# (Philippe Waroquiers, RH BZ 1149205). +#=fedoratest +Patch106: 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 +Patch107: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch + +# Test 'info type-printers' Python error (RH BZ 1350436). +#=fedoratest +Patch108: gdb-rhbz1350436-type-printers-error.patch + +# Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan +# Kratochvil, RH BZ 1084404). +#=fedoratest +Patch109: 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 +Patch110: gdb-bz1219747-attach-kills.patch + +# Force libncursesw over libncurses to match the includes (RH BZ 1270534). +#=push+jan +Patch111: gdb-fedora-libncursesw.patch + +# Test clflushopt instruction decode (for RH BZ 1262471). +#=fedoratest +Patch112: gdb-opcodes-clflushopt-test.patch + +# [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon). +#=fedora +Patch113: gdb-dts-rhel6-python-compat.patch + +# [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). +#=push+jan +Patch114: gdb-6.6-buildid-locate-rpm-scl.patch + +# Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). +#=fedora +Patch115: gdb-readline62-ask-more-rh.patch + +# [RHEL5,RHEL6] Fix attaching to stopped processes. +# [RHEL5] Workaround kernel for detaching SIGSTOPped processes (BZ 809382). +#=fedora +Patch116: gdb-6.8-attach-signalled-detach-stopped.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 . +Patch117: gdb-6.8-quit-never-aborts.patch + +# [aarch64] Fix hardware watchpoints (RH BZ 1261564). +#=fedoratest +Patch118: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch + +# Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). +#=fedora +Patch119: gdb-container-rh-pkg.patch + +# New test for Python "Cannot locate object file for block" (for RH BZ 1325795). +#=fedoratest +Patch120: gdb-rhbz1325795-framefilters-test.patch + +# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). +#=fedora +Patch121: gdb-linux_perf-bundle.patch + +# Fix gdb-headless /usr/bin/ executables (BZ 1390251). +#=fedora +Patch122: gdb-libexec-add-index.patch + +# Fix gdb-add-index for 444 *.debug files. +#=push+jan +Patch123: gdb-add-index-chmod.patch + +# New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). +#=fedoratest +Patch124: gdb-rhbz1398387-tab-crash-test.patch + +# [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). +#=fedoratest +Patch125: gdb-testsuite-readline63-sigint.patch + +# Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher +#=push +Patch126: gdb-archer.patch + +# Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd +Patch127: gdb-vla-intel-fix-print-char-array.patch + diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include new file mode 100644 index 0000000..28c6d1f --- /dev/null +++ b/_gdb.spec.patch.include @@ -0,0 +1,127 @@ +%patch001 -p1 +%patch002 -p1 +%patch003 -p1 +%patch004 -p1 +%patch005 -p1 +%patch006 -p1 +%patch007 -p1 +%patch008 -p1 +%patch009 -p1 +%patch010 -p1 +%patch011 -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 +%patch027 -p1 +%patch028 -p1 +%patch029 -p1 +%patch030 -p1 +%patch031 -p1 +%patch032 -p1 +%patch033 -p1 +%patch034 -p1 +%patch035 -p1 +%patch036 -p1 +%patch037 -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 +%patch098 -p1 +%patch099 -p1 +%patch100 -p1 +%patch101 -p1 +%patch102 -p1 +%patch103 -p1 +%patch104 -p1 +%patch105 -p1 +%patch106 -p1 +%patch107 -p1 +%patch108 -p1 +%patch109 -p1 +%patch110 -p1 +%patch111 -p1 +%patch112 -p1 +%patch113 -p1 +%patch114 -p1 +%patch115 -p1 +%patch116 -p1 +%patch117 -p1 +%patch118 -p1 +%patch119 -p1 +%patch120 -p1 +%patch121 -p1 +%patch122 -p1 +%patch123 -p1 +%patch124 -p1 +%patch125 -p1 +%patch126 -p1 +%patch127 -p1 diff --git a/_git_upstream_commit b/_git_upstream_commit new file mode 100644 index 0000000..10effd0 --- /dev/null +++ b/_git_upstream_commit @@ -0,0 +1 @@ +1e97a22796cced8bba3359df46e8c2883653516f diff --git a/_patch_order b/_patch_order new file mode 100644 index 0000000..47c9eba --- /dev/null +++ b/_patch_order @@ -0,0 +1,127 @@ +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-rh-dummykfail-20041202.patch +gdb-6.3-ppc64syscall-20040622.patch +gdb-6.3-ppc64displaysymbol-20041124.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.3-readnever-20050907.patch +gdb-6.5-bz203661-emit-relocs.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-bz216711-clone-is-outermost.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-bz235197-fork-detach-info.patch +gdb-6.6-testsuite-timeouts.patch +gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +gdb-6.6-scheduler_locking-step-is-default.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.8-sparc64-silence-memcpy-check.patch +gdb-6.5-section-num-fixup-test.patch +gdb-6.8-bz436037-reg-no-longer-active.patch +gdb-6.8-watchpoint-conditionals-test.patch +gdb-6.8-bz466901-backtrace-full-prelinked.patch +gdb-simultaneous-step-resume-breakpoint-test.patch +gdb-core-open-vdso-warning.patch +gdb-x86_64-i386-syscall-restart.patch +gdb-bz533176-fortran-omp-step.patch +gdb-follow-child-stale-parent.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-bz541866-rwatch-before-run.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-gdb-add-index-script.patch +gdb-bz568248-oom-is-error.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-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +gdb-test-ivy-bridge.patch +gdb-glibc-vdso-workaround.patch +gdb-runtest-pie-override.patch +gdb-attach-fail-reasons-5of5.patch +gdb-stale-frame_info.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-rhbz795424-bitpos-20of25.patch +gdb-rhbz795424-bitpos-21of25.patch +gdb-rhbz795424-bitpos-22of25.patch +gdb-rhbz795424-bitpos-23of25.patch +gdb-rhbz795424-bitpos-25of25.patch +gdb-rhbz795424-bitpos-25of25-test.patch +gdb-rhbz795424-bitpos-lazyvalue.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-python-gil.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-readline62-ask-more-rh.patch +gdb-6.8-attach-signalled-detach-stopped.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-add-index-chmod.patch +gdb-rhbz1398387-tab-crash-test.patch +gdb-testsuite-readline63-sigint.patch +gdb-archer.patch +gdb-vla-intel-fix-print-char-array.patch diff --git a/gdb-6.3-attach-see-vdso-test.patch b/gdb-6.3-attach-see-vdso-test.patch index f0d5769..cedcf29 100644 --- a/gdb-6.3-attach-see-vdso-test.patch +++ b/gdb-6.3-attach-see-vdso-test.patch @@ -1,14 +1,24 @@ +From 720465552f359e1b44666516d8032bfe11d9e9cf Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-attach-see-vdso-test.patch FileName: gdb-6.3-attach-see-vdso-test.patch +;; Test kernel VDSO decoding while attaching to an i386 process. +;;=fedoratest +--- + gdb/testsuite/gdb.base/attach-see-vdso.c | 25 +++++++++++ + gdb/testsuite/gdb.base/attach-see-vdso.exp | 72 ++++++++++++++++++++++++++++++ + 2 files changed, 97 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/attach-see-vdso.c + create mode 100644 gdb/testsuite/gdb.base/attach-see-vdso.exp -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 +diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c +new file mode 100644 +index 0000000000..cf3c7207a5 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/attach-see-vdso.c @@ -0,0 +1,25 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -35,10 +45,11 @@ 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 +index 0000000000..e8a538097e +--- /dev/null ++++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp @@ -0,0 +1,72 @@ +# Copyright 2007 + @@ -112,3 +123,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.exp +# work. + +remote_exec build "kill -9 ${testpid}" +-- +2.14.3 + diff --git a/gdb-6.3-bz140532-ppc-unwinding-test.patch b/gdb-6.3-bz140532-ppc-unwinding-test.patch index 395b822..239e55f 100644 --- a/gdb-6.3-bz140532-ppc-unwinding-test.patch +++ b/gdb-6.3-bz140532-ppc-unwinding-test.patch @@ -1,13 +1,29 @@ +From c0b26dbea92bc106b9356fde2dd85c7a493055f7 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-bz140532-ppc-unwinding-test.patch FileName: gdb-6.3-bz140532-ppc-unwinding-test.patch +;; Update PPC unwinding patches to their upstream variants (BZ 140532). +;;=fedoratest +--- + .../gdb.arch/powerpc-bcl-prologue-asm32.S | 78 +++++++++++++++++ + .../gdb.arch/powerpc-bcl-prologue-asm64.S | 98 ++++++++++++++++++++++ + gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c | 29 +++++++ + gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp | 72 ++++++++++++++++ + gdb/testsuite/gdb.arch/powerpc-prologue.exp | 5 +- + 5 files changed, 280 insertions(+), 2 deletions(-) + create mode 100644 gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S + create mode 100644 gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S + create mode 100644 gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c + create mode 100644 gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp -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 +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 +index 0000000000..1e4301af89 +--- /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. + @@ -87,9 +103,11 @@ 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 +index 0000000000..1af5c19a16 +--- /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. + @@ -189,9 +207,11 @@ 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 +index 0000000000..6b5bb08d0f +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c @@ -0,0 +1,29 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -222,9 +242,11 @@ 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 +index 0000000000..5f50c4ef43 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp @@ -0,0 +1,72 @@ +# Copyright 2006, 2007 Free Software Foundation, Inc. + @@ -298,12 +320,11 @@ 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 +index 9ab172be7b..91ee3a29ba 100644 +--- 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 @@ -315,3 +336,6 @@ Fixup the testcase for ppc64 biarch GDB. verbose "Skipping PowerPC prologue tests." return } +-- +2.14.3 + diff --git a/gdb-6.3-bz202689-exec-from-pthread-test.patch b/gdb-6.3-bz202689-exec-from-pthread-test.patch index 392a475..f386cbf 100644 --- a/gdb-6.3-bz202689-exec-from-pthread-test.patch +++ b/gdb-6.3-bz202689-exec-from-pthread-test.patch @@ -1,19 +1,28 @@ +From d75b7ef141bcc3ea9eaf7fa8bd7023b6372e25fb Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-bz202689-exec-from-pthread-test.patch FileName: gdb-6.3-bz202689-exec-from-pthread-test.patch +;; Testcase for exec() from threaded program (BZ 202689). +;;=fedoratest 2007-01-17 Jan Kratochvil * gdb.threads/threaded-exec.exp, gdb.threads/threaded-exec.c: New files. +--- + gdb/testsuite/gdb.threads/threaded-exec.c | 46 +++++++++++++++++++++++++++++ + gdb/testsuite/gdb.threads/threaded-exec.exp | 41 +++++++++++++++++++++++++ + 2 files changed, 87 insertions(+) + create mode 100644 gdb/testsuite/gdb.threads/threaded-exec.c + create mode 100644 gdb/testsuite/gdb.threads/threaded-exec.exp - -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 +index 0000000000..522b24671d +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/threaded-exec.c @@ -0,0 +1,46 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -61,10 +70,11 @@ 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 +index 0000000000..77c8a7dc85 +--- /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. @@ -107,3 +117,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp + pass "Program exited" + } +} +-- +2.14.3 + diff --git a/gdb-6.3-focus-cmd-prev-test.patch b/gdb-6.3-focus-cmd-prev-test.patch index f7093ee..3395c42 100644 --- a/gdb-6.3-focus-cmd-prev-test.patch +++ b/gdb-6.3-focus-cmd-prev-test.patch @@ -1,14 +1,22 @@ +From 28e485ee8afbfc7b93a8cf7400cf9937487479c2 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-focus-cmd-prev-test.patch FileName: gdb-6.3-focus-cmd-prev-test.patch +;; Test a crash on `focus cmd', `focus prev' commands. +;;=fedoratest +--- + gdb/testsuite/gdb.base/focus-cmd-prev.exp | 40 +++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/focus-cmd-prev.exp -Index: gdb-7.12.50.20170226/gdb/testsuite/gdb.base/focus-cmd-prev.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170226/gdb/testsuite/gdb.base/focus-cmd-prev.exp 2017-03-02 09:39:14.508461085 +0100 +diff --git a/gdb/testsuite/gdb.base/focus-cmd-prev.exp b/gdb/testsuite/gdb.base/focus-cmd-prev.exp +new file mode 100644 +index 0000000000..d5a653f684 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/focus-cmd-prev.exp @@ -0,0 +1,40 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -50,3 +58,6 @@ Index: gdb-7.12.50.20170226/gdb/testsuite/gdb.base/focus-cmd-prev.exp + pass $test + } +} +-- +2.14.3 + diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 4facb04..caaa75d 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -1,20 +1,34 @@ +From fb87d00165f5686bbe548c48b88c3e2763db6845 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-gstack-20050411.patch FileName: 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 * Makefile.in (uninstall-gstack, install-gstack): New rules, add to install and uninstall. * gstack.sh, gstack.1: New files. +--- + gdb/Makefile.in | 34 ++++++++++++++++++-- + gdb/gstack.sh | 43 +++++++++++++++++++++++++ + gdb/testsuite/gdb.base/gstack.c | 43 +++++++++++++++++++++++++ + gdb/testsuite/gdb.base/gstack.exp | 66 +++++++++++++++++++++++++++++++++++++++ + 4 files changed, 184 insertions(+), 2 deletions(-) + create mode 100644 gdb/gstack.sh + create mode 100644 gdb/testsuite/gdb.base/gstack.c + create mode 100644 gdb/testsuite/gdb.base/gstack.exp -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 +index 5823098036..f95505ea21 100644 +--- a/gdb/Makefile.in ++++ b/gdb/Makefile.in +@@ -1747,7 +1747,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -23,7 +37,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: +@@ -1787,7 +1787,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -50,7 +64,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) +@@ -1810,6 +1828,18 @@ uninstall: force $(CONFIG_UNINSTALL) fi @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do @@ -69,10 +83,11 @@ 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 +index 0000000000..f7f07248f7 +--- /dev/null ++++ b/gdb/gstack.sh @@ -0,0 +1,43 @@ +#!/bin/sh + @@ -117,10 +132,60 @@ 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 +diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c +new file mode 100644 +index 0000000000..dc10813f04 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gstack.c +@@ -0,0 +1,43 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++#include ++#include ++ ++void ++func (void) ++{ ++ const char msg[] = "looping\n"; ++ ++ /* Use the most simple notification not to get caught by attach on exiting ++ the function. */ ++ write (1, msg, strlen (msg)); ++ ++ for (;;); ++} ++ ++int ++main (void) ++{ ++ alarm (60); ++ nice (100); ++ ++ func (); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp +new file mode 100644 +index 0000000000..1186ec57bc +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gstack.exp @@ -0,0 +1,66 @@ +# Copyright (C) 2012 Free Software Foundation, Inc. + @@ -188,51 +253,6 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.exp +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 -@@ -0,0 +1,43 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#include -+#include -+#include -+ -+void -+func (void) -+{ -+ const char msg[] = "looping\n"; -+ -+ /* Use the most simple notification not to get caught by attach on exiting -+ the function. */ -+ write (1, msg, strlen (msg)); -+ -+ for (;;); -+} -+ -+int -+main (void) -+{ -+ alarm (60); -+ nice (100); -+ -+ func (); -+ -+ return 0; -+} +-- +2.14.3 + diff --git a/gdb-6.3-inferior-notification-20050721.patch b/gdb-6.3-inferior-notification-20050721.patch index df7239f..dd43600 100644 --- a/gdb-6.3-inferior-notification-20050721.patch +++ b/gdb-6.3-inferior-notification-20050721.patch @@ -1,9 +1,13 @@ +From 1e46c1307539e7594e8b6807ea41665b4b218e5c Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-inferior-notification-20050721.patch FileName: gdb-6.3-inferior-notification-20050721.patch +;; Notify observers that the inferior has been created +;;=fedoratest + 2005-07-21 Jeff Johnston * gdb.base/attach-32.exp: New test for attaching in 32-bit @@ -14,11 +18,20 @@ FileName: gdb-6.3-inferior-notification-20050721.patch 2007-12-26 Jan Kratochvil * gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set. +--- + gdb/testsuite/gdb.base/attach-32.c | 20 +++ + gdb/testsuite/gdb.base/attach-32.exp | 245 +++++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.base/attach-32b.c | 24 ++++ + 3 files changed, 289 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/attach-32.c + create mode 100644 gdb/testsuite/gdb.base/attach-32.exp + create mode 100644 gdb/testsuite/gdb.base/attach-32b.c -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 +index 0000000000..0041b4732d +--- /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 @@ -40,10 +53,11 @@ 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 +index 0000000000..67ded02ccf +--- /dev/null ++++ b/gdb/testsuite/gdb.base/attach-32.exp @@ -0,0 +1,245 @@ +# Copyright 2005 Free Software Foundation, Inc. + @@ -290,10 +304,11 @@ 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 +index 0000000000..a78037ed38 +--- /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 @@ -319,3 +334,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-32b.c + } + return (0); +} +-- +2.14.3 + diff --git a/gdb-6.3-inheritancetest-20050726.patch b/gdb-6.3-inheritancetest-20050726.patch index 763b4a1..0a41422 100644 --- a/gdb-6.3-inheritancetest-20050726.patch +++ b/gdb-6.3-inheritancetest-20050726.patch @@ -1,36 +1,35 @@ +From 445e9a113406752c01f61e27987b05067833428b Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-inheritancetest-20050726.patch FileName: gdb-6.3-inheritancetest-20050726.patch +;; Verify printing of inherited members test +;;=fedoratest + 2005-07-26 Jeff Johnston * gdb.cp/b146835.exp: New testcase. * gdb.cp/b146835.cc: Ditto. * gdb.cp/b146835b.cc: Ditto. * gdb.cp/b146835.h: Ditto. +--- + gdb/testsuite/gdb.cp/b146835.cc | 32 +++++++++++++++++++++++++++ + gdb/testsuite/gdb.cp/b146835.exp | 47 ++++++++++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.cp/b146835.h | 36 ++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.cp/b146835b.cc | 11 ++++++++++ + 4 files changed, 126 insertions(+) + create mode 100644 gdb/testsuite/gdb.cp/b146835.cc + create mode 100644 gdb/testsuite/gdb.cp/b146835.exp + create mode 100644 gdb/testsuite/gdb.cp/b146835.h + create mode 100644 gdb/testsuite/gdb.cp/b146835b.cc -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 +index 0000000000..4161d523f5 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/b146835.cc @@ -0,0 +1,32 @@ +#include "b146835.h" +#include @@ -64,10 +63,11 @@ 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 +index 0000000000..d03815bcff +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/b146835.exp @@ -0,0 +1,47 @@ +# This testcase is part of GDB, the GNU debugger. + @@ -116,10 +116,11 @@ 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 +index 0000000000..48df7a2935 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/b146835.h @@ -0,0 +1,36 @@ + +class A { @@ -157,3 +158,23 @@ 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 +index 0000000000..1853c1fa38 +--- /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) {} +-- +2.14.3 + diff --git a/gdb-6.3-mapping-zero-inode-test.patch b/gdb-6.3-mapping-zero-inode-test.patch index 85381ad..be46f28 100644 --- a/gdb-6.3-mapping-zero-inode-test.patch +++ b/gdb-6.3-mapping-zero-inode-test.patch @@ -1,120 +1,24 @@ +From 7d82abcba954738d51d73493ce52ac006b26e420 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-mapping-zero-inode-test.patch FileName: 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. +--- + gdb/testsuite/gdb.base/gcore-shmid0.c | 128 ++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.base/gcore-shmid0.exp | 101 +++++++++++++++++++++++++ + 2 files changed, 229 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/gcore-shmid0.c + create mode 100644 gdb/testsuite/gdb.base/gcore-shmid0.exp -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 [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 -+ } -+} -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 +diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.c b/gdb/testsuite/gdb.base/gcore-shmid0.c +new file mode 100644 +index 0000000000..bb9709a75c +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-shmid0.c @@ -0,0 +1,128 @@ +/* Copyright 2007, 2009 Free Software Foundation, Inc. + @@ -244,3 +148,113 @@ 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 +index 0000000000..b1fec682aa +--- /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 ++ } ++} +-- +2.14.3 + diff --git a/gdb-6.3-ppc64displaysymbol-20041124.patch b/gdb-6.3-ppc64displaysymbol-20041124.patch index 100d8c0..27d4b4c 100644 --- a/gdb-6.3-ppc64displaysymbol-20041124.patch +++ b/gdb-6.3-ppc64displaysymbol-20041124.patch @@ -1,19 +1,27 @@ +From 6b6cdece746885bcd078e9384fb50d3e5c9abfa0 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-ppc64displaysymbol-20041124.patch FileName: gdb-6.3-ppc64displaysymbol-20041124.patch +;; Include the pc's section when doing a symbol lookup so that the +;; correct symbol is found. +;;=push: Write new testcase. + 2004-11-24 Andrew Cagney * printcmd.c (build_address_symbolic): Find a section for the address. +--- + gdb/printcmd.c | 8 ++++++++ + 1 file changed, 8 insertions(+) -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, +diff --git a/gdb/printcmd.c b/gdb/printcmd.c +index 2e596d1f09..20e5bda11e 100644 +--- a/gdb/printcmd.c ++++ b/gdb/printcmd.c +@@ -602,6 +602,14 @@ build_address_symbolic (struct gdbarch *gdbarch, addr = overlay_mapped_address (addr, section); } } @@ -28,3 +36,6 @@ Index: gdb-6.8.50.20081128/gdb/printcmd.c /* First try to find the address in the symbol table, then in the minsyms. Take the closest one. */ +-- +2.14.3 + diff --git a/gdb-6.3-ppc64syscall-20040622.patch b/gdb-6.3-ppc64syscall-20040622.patch index 20a5789..8a59e5f 100644 --- a/gdb-6.3-ppc64syscall-20040622.patch +++ b/gdb-6.3-ppc64syscall-20040622.patch @@ -1,9 +1,13 @@ +From 032dfcfc1e11fe69aa49e7974379043a6c3040c3 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-ppc64syscall-20040622.patch FileName: gdb-6.3-ppc64syscall-20040622.patch +;; Better parse 64-bit PPC system call prologues. +;;=push: Write new testcase. + 2004-06-22 Andrew Cagney * rs6000-tdep.c (struct rs6000_framedata): Add field "func_start". @@ -11,12 +15,15 @@ FileName: gdb-6.3-ppc64syscall-20040622.patch "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". +--- + gdb/rs6000-tdep.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 54 insertions(+), 3 deletions(-) -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 +diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c +index 456dbcccb1..d27ce7b2af 100644 +--- a/gdb/rs6000-tdep.c ++++ b/gdb/rs6000-tdep.c +@@ -134,6 +134,7 @@ static const char *powerpc_vector_abi_string = "auto"; struct rs6000_framedata { @@ -24,7 +31,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c int offset; /* total size of frame --- the distance by which we decrement sp to allocate the frame */ -@@ -1496,7 +1497,6 @@ static CORE_ADDR +@@ -1578,7 +1579,6 @@ static CORE_ADDR skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) { @@ -32,7 +39,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c 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, +@@ -1596,12 +1596,14 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, int minimal_toc_loaded = 0; int prev_insn_was_prologue_insn = 1; int num_skip_non_prologue_insns = 0; @@ -47,7 +54,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c fdata->saved_gpr = -1; fdata->saved_fpr = -1; fdata->saved_vr = -1; -@@ -1553,6 +1555,55 @@ skip_prologue (struct gdbarch *gdbarch, +@@ -1635,6 +1637,55 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, break; op = extract_unsigned_integer (buf, 4, byte_order); @@ -103,7 +110,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c 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, +@@ -1826,9 +1877,9 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, 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. */ @@ -115,3 +122,6 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c struct symtab_and_line this_sal = find_pc_line (pc, 0); if ((prologue_sal.line == 0) +-- +2.14.3 + diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch index 7cc7161..96702bd 100644 --- a/gdb-6.3-readnever-20050907.patch +++ b/gdb-6.3-readnever-20050907.patch @@ -1,9 +1,13 @@ +From b242ff013fe89c126e544b47538609b0f904771c Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-readnever-20050907.patch FileName: gdb-6.3-readnever-20050907.patch +;; Add readnever option +;;=push + 2004-11-18 Andrew Cagney * dwarf2read.c: Include "top.c". @@ -17,91 +21,15 @@ FileName: gdb-6.3-readnever-20050907.patch * gdb.texinfo (File Options): Document --readnever. -Index: gdb-7.99.90.20170420/gdb/doc/gdb.texinfo -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/doc/gdb.texinfo 2017-04-20 22:29:39.179740076 +0200 -+++ gdb-7.99.90.20170420/gdb/doc/gdb.texinfo 2017-04-20 22:29:40.924751096 +0200 -@@ -1037,6 +1037,12 @@ - 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.99.90.20170420/gdb/main.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/main.c 2017-04-20 22:29:39.182740095 +0200 -+++ gdb-7.99.90.20170420/gdb/main.c 2017-04-20 22:29:40.925751103 +0200 -@@ -615,6 +615,7 @@ - {"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}, -@@ -1254,6 +1255,7 @@ - --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.99.90.20170420/gdb/symfile.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/symfile.c 2017-04-20 22:29:39.183740101 +0200 -+++ gdb-7.99.90.20170420/gdb/symfile.c 2017-04-20 22:29:40.926751109 +0200 -@@ -79,6 +79,7 @@ - - /* 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.99.90.20170420/gdb/dwarf2read.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/dwarf2read.c 2017-04-20 22:29:39.190740145 +0200 -+++ gdb-7.99.90.20170420/gdb/dwarf2read.c 2017-04-20 22:29:57.973858766 +0200 -@@ -73,6 +73,7 @@ - #include "common/function-view.h" - #include "common/gdb_optional.h" - #include "common/underlying.h" -+#include "top.h" - - #include - #include -@@ -2208,7 +2209,8 @@ - (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.99.90.20170420/gdb/top.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/top.h 2017-04-20 22:29:39.191740152 +0200 -+++ gdb-7.99.90.20170420/gdb/top.h 2017-04-20 22:29:40.932751147 +0200 -@@ -269,6 +269,7 @@ - - /* From random places. */ - extern int readnow_symbol_files; -+extern int readnever_symbol_files; - - /* Perform _initialize initialization. */ - extern void gdb_init (char *); ---- gdb-8.0.1/gdb/gcore.in-orig 2017-06-04 17:51:26.000000000 +0200 -+++ gdb-8.0.1/gdb/gcore.in 2017-09-28 19:46:49.335407827 +0200 +Pushed upstream: https://sourceware.org/ml/gdb-cvs/2017-12/msg00007.html +--- + gdb/gcore.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/gcore.in b/gdb/gcore.in +index 632f21bdfa..016bcb9a28 100644 +--- a/gdb/gcore.in ++++ b/gdb/gcore.in @@ -85,7 +85,7 @@ for pid in $* do # ` Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-rh-dummykfail-20041202.patch FileName: gdb-6.3-rh-dummykfail-20041202.patch +;; Work around out-of-date dejagnu that does not have KFAIL +;;=push: That dejagnu is too old to be supported. + 2003-07-11 Elena Zannoni * 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 @@ +--- + gdb/testsuite/lib/gdb.exp | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index fc0278b9da..018367c161 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -124,6 +124,15 @@ set valnum_re "\\\$$decimal" ### Only procedures should come after this point. @@ -26,3 +35,6 @@ FileName: gdb-6.3-rh-dummykfail-20041202.patch # # gdb_version -- extract and print the version number of GDB # +-- +2.14.3 + diff --git a/gdb-6.3-rh-testversion-20041202.patch b/gdb-6.3-rh-testversion-20041202.patch index b425ac8..bf8f251 100644 --- a/gdb-6.3-rh-testversion-20041202.patch +++ b/gdb-6.3-rh-testversion-20041202.patch @@ -1,20 +1,27 @@ -From f408ba821f8c8b5ad6564b98806666d2478f7599 Mon Sep 17 00:00:00 2001 +From ab1e6ca291c467953f5a4b308595a4287618b836 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb.gdb/selftest.exp: Add matching on specific Red Hat only version string +Subject: gdb.gdb/selftest.exp: Add matching on specific Red Hat only version + string FileName: gdb-6.3-rh-testversion-20041202.patch +;; Match the Fedora's version info. +;;=fedora + 2003-02-24 Elena Zannoni * gdb.gdb/selftest.exp: Add matching on specific Red Hat only version string. +--- + gdb/testsuite/gdb.gdb/selftest.exp | 3 +++ + 1 file changed, 3 insertions(+) -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.gdb/selftest.exp 2017-02-07 19:47:06.472874620 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp 2017-02-07 19:48:12.593380575 +0100 -@@ -53,6 +53,9 @@ +diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp +index 712060c9ae..a4a446f9df 100644 +--- 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" } @@ -24,3 +31,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp } # start the "xgdb" process +-- +2.14.3 + diff --git a/gdb-6.3-test-dtorfix-20050121.patch b/gdb-6.3-test-dtorfix-20050121.patch index 3a5d303..41e9a5e 100644 --- a/gdb-6.3-test-dtorfix-20050121.patch +++ b/gdb-6.3-test-dtorfix-20050121.patch @@ -1,14 +1,24 @@ -From f408ba821f8c8b5ad6564b98806666d2478f7599 Mon Sep 17 00:00:00 2001 +From d129a2807c31a40c5eaea1a7e0d853649a1e4abe Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-test-dtorfix-20050121.patch FileName: gdb-6.3-test-dtorfix-20050121.patch -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 +;; Test support of multiple destructors just like multiple constructors +;;=fedoratest +--- + gdb/testsuite/gdb.cp/constructortest.cc | 99 +++++++++++++++++++++++ + gdb/testsuite/gdb.cp/constructortest.exp | 130 +++++++++++++++++++++++++++++++ + 2 files changed, 229 insertions(+) + create mode 100644 gdb/testsuite/gdb.cp/constructortest.cc + create mode 100644 gdb/testsuite/gdb.cp/constructortest.exp + +diff --git a/gdb/testsuite/gdb.cp/constructortest.cc b/gdb/testsuite/gdb.cp/constructortest.cc +new file mode 100644 +index 0000000000..9ac8793e50 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/constructortest.cc @@ -0,0 +1,99 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -109,10 +119,11 @@ 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 +index 0000000000..341f6c99ad +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/constructortest.exp @@ -0,0 +1,130 @@ +# This testcase is part of GDB, the GNU debugger. + @@ -244,3 +255,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/constructortest.exp +} + +gdb_continue_to_breakpoint "First line ~C" +-- +2.14.3 + diff --git a/gdb-6.3-test-movedir-20050125.patch b/gdb-6.3-test-movedir-20050125.patch index 851081f..cf4fd9a 100644 --- a/gdb-6.3-test-movedir-20050125.patch +++ b/gdb-6.3-test-movedir-20050125.patch @@ -1,19 +1,32 @@ +From fa01a7c6656eadbc6dd3ff1128fb0b2ec988f6ce Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-test-movedir-20050125.patch FileName: gdb-6.3-test-movedir-20050125.patch +;; Fix to support executable moving +;;=fedoratest + 2005-01-25 Elena Zannoni * gdb.base/move-dir.exp: New test. * gdb.base/move-dir.c: Ditto. * gdb.base/move-dir.h: Ditto. +--- + gdb/testsuite/gdb.base/move-dir.c | 10 +++++++ + gdb/testsuite/gdb.base/move-dir.exp | 57 +++++++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.base/move-dir.h | 7 +++++ + 3 files changed, 74 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/move-dir.c + create mode 100644 gdb/testsuite/gdb.base/move-dir.exp + create mode 100644 gdb/testsuite/gdb.base/move-dir.h -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 +index 0000000000..89b65b4b6a +--- /dev/null ++++ b/gdb/testsuite/gdb.base/move-dir.c @@ -0,0 +1,10 @@ +#include +#include @@ -25,10 +38,11 @@ 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 +index 0000000000..f189ea77b9 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/move-dir.exp @@ -0,0 +1,57 @@ +# Copyright 2005 +# Free Software Foundation, Inc. @@ -87,10 +101,11 @@ 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 +index 0000000000..4a99725a00 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/move-dir.h @@ -0,0 +1,7 @@ +#include + @@ -99,3 +114,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.h + printf ("%s\n", ostring);; +} + +-- +2.14.3 + diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index 7b289fe..134d6ba 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -1,14 +1,36 @@ +From 47108e703ac6b76a12ee310512b60342d460f680 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-test-pie-20050107.patch FileName: gdb-6.3-test-pie-20050107.patch +;; VSYSCALL and PIE +;;=fedoratest +--- + gdb/testsuite/gdb.pie/attach.c | 20 + + gdb/testsuite/gdb.pie/attach.exp | 416 ++++++++++++++++ + gdb/testsuite/gdb.pie/attach2.c | 24 + + gdb/testsuite/gdb.pie/break.c | 146 ++++++ + gdb/testsuite/gdb.pie/break.exp | 954 +++++++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.pie/break1.c | 44 ++ + gdb/testsuite/gdb.pie/corefile.exp | 233 +++++++++ + gdb/testsuite/gdb.pie/coremaker.c | 142 ++++++ + 8 files changed, 1979 insertions(+) + create mode 100644 gdb/testsuite/gdb.pie/attach.c + create mode 100644 gdb/testsuite/gdb.pie/attach.exp + create mode 100644 gdb/testsuite/gdb.pie/attach2.c + create mode 100644 gdb/testsuite/gdb.pie/break.c + create mode 100644 gdb/testsuite/gdb.pie/break.exp + create mode 100644 gdb/testsuite/gdb.pie/break1.c + create mode 100644 gdb/testsuite/gdb.pie/corefile.exp + create mode 100644 gdb/testsuite/gdb.pie/coremaker.c -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 +diff --git a/gdb/testsuite/gdb.pie/attach.c b/gdb/testsuite/gdb.pie/attach.c +new file mode 100644 +index 0000000000..0041b4732d +--- /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 @@ -30,386 +52,11 @@ 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 -+#include -+#include -+ -+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 -+ -+/* 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 -+# include -+#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 \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 -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 +index 0000000000..648c92608c +--- /dev/null ++++ b/gdb/testsuite/gdb.pie/attach.exp @@ -0,0 +1,416 @@ +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. + @@ -827,10 +474,193 @@ 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 +index 0000000000..a78037ed38 +--- /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 ++#include ++#include ++ ++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 +index 0000000000..bf398fcca9 +--- /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 ++ ++/* 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 ++# include ++#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 \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 +index 0000000000..97b87397c2 +--- /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 @@ -1786,10 +1616,61 @@ 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 +index 0000000000..2ed8b2a4a0 +--- /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 +index 0000000000..ca4b01be3e +--- /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. @@ -2024,3 +1905,154 @@ 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 +index 0000000000..a7fbd94141 +--- /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 ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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; ++} ++ +-- +2.14.3 + diff --git a/gdb-6.3-test-self-20050110.patch b/gdb-6.3-test-self-20050110.patch index 467f804..9cfb89d 100644 --- a/gdb-6.3-test-self-20050110.patch +++ b/gdb-6.3-test-self-20050110.patch @@ -1,9 +1,13 @@ +From 7f31b8c1940c73a2ca85bc925d6b61a10117cd2a Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-test-self-20050110.patch FileName: gdb-6.3-test-self-20050110.patch +;; Get selftest working with sep-debug-info +;;=fedoratest + 2004-02-23 Elena Zannoni * gdb.gdb/selftest.exp: Make sure that the debug directory is @@ -11,12 +15,15 @@ FileName: gdb-6.3-test-self-20050110.patch * gdb.gdb/complaints.exp: Ditto. * gdb.gdb/xfullpath.exp: Ditto. * gdb.gdb/observer.exp: Ditto. +--- + gdb/testsuite/lib/selftest-support.exp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) -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 +index 798d19dd89..e26e095b17 100644 +--- a/gdb/testsuite/lib/selftest-support.exp ++++ b/gdb/testsuite/lib/selftest-support.exp +@@ -156,18 +156,18 @@ proc do_self_tests {function body} { } # Remove any old copy lying around. @@ -39,3 +46,6 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/lib/selftest-support.exp if {$result < 0} then { warning "Couldn't test self" +-- +2.14.3 + diff --git a/gdb-6.3-threaded-watchpoints2-20050225.patch b/gdb-6.3-threaded-watchpoints2-20050225.patch index e3ab995..0ffaad3 100644 --- a/gdb-6.3-threaded-watchpoints2-20050225.patch +++ b/gdb-6.3-threaded-watchpoints2-20050225.patch @@ -1,9 +1,13 @@ +From aa2b8656004b28f8e274967b2e07b7ac9da41915 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-threaded-watchpoints2-20050225.patch FileName: 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 * config/i386/nm-linux.h: Change dr register routines to @@ -47,11 +51,18 @@ FileName: gdb-6.3-threaded-watchpoints2-20050225.patch testcase of the same name. ] FIXME: The testcase does not expects multiple watchpoints hits per one stop. +--- + gdb/testsuite/gdb.threads/watchthreads-threaded.c | 66 +++++++++++ + .../gdb.threads/watchthreads-threaded.exp | 126 +++++++++++++++++++++ + 2 files changed, 192 insertions(+) + create mode 100644 gdb/testsuite/gdb.threads/watchthreads-threaded.c + create mode 100644 gdb/testsuite/gdb.threads/watchthreads-threaded.exp -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 +index 0000000000..1402640ccf +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.c @@ -0,0 +1,66 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -119,10 +130,11 @@ 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 +index 0000000000..e9cdd59771 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp @@ -0,0 +1,126 @@ +# This testcase is part of GDB, the GNU debugger. + @@ -250,3 +262,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/watchthreads-threaded.exp +} else { + fail $message +} +-- +2.14.3 + diff --git a/gdb-6.5-BEA-testsuite.patch b/gdb-6.5-BEA-testsuite.patch index d3a5ada..a391639 100644 --- a/gdb-6.5-BEA-testsuite.patch +++ b/gdb-6.5-BEA-testsuite.patch @@ -1,13 +1,28 @@ +From 2b1fb9ed1702d69c897a059f8e5fdbdebce8533b Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-BEA-testsuite.patch FileName: gdb-6.5-BEA-testsuite.patch -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 +;; 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. +--- + gdb/testsuite/gdb.threads/threadcrash.c | 301 ++++++++++++++++++++++++ + gdb/testsuite/gdb.threads/threadcrash.exp | 37 +++ + gdb/testsuite/gdb.threads/threadcrash.sh | 324 ++++++++++++++++++++++++++ + gdb/testsuite/gdb.threads/threadcrash.sh-orig | 248 ++++++++++++++++++++ + 4 files changed, 910 insertions(+) + create mode 100644 gdb/testsuite/gdb.threads/threadcrash.c + create mode 100644 gdb/testsuite/gdb.threads/threadcrash.exp + create mode 100644 gdb/testsuite/gdb.threads/threadcrash.sh + create mode 100644 gdb/testsuite/gdb.threads/threadcrash.sh-orig + +diff --git a/gdb/testsuite/gdb.threads/threadcrash.c b/gdb/testsuite/gdb.threads/threadcrash.c +new file mode 100644 +index 0000000000..80c599d0fb +--- /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. @@ -310,10 +325,11 @@ 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 +index 0000000000..af6b919f58 +--- /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. + @@ -352,10 +368,11 @@ 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 +index 0000000000..7f7e6520d6 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/threadcrash.sh @@ -0,0 +1,324 @@ +#! /bin/bash + @@ -681,10 +698,11 @@ 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 +index 0000000000..eb602036c2 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/threadcrash.sh-orig @@ -0,0 +1,248 @@ +#! /bin/bash + @@ -934,3 +952,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threadcrash.sh-orig +rm -rf $WORKDIR + +exit $FAILURES +-- +2.14.3 + diff --git a/gdb-6.5-bz109921-DW_AT_decl_file-test.patch b/gdb-6.5-bz109921-DW_AT_decl_file-test.patch index b20d3c5..b4393be 100644 --- a/gdb-6.5-bz109921-DW_AT_decl_file-test.patch +++ b/gdb-6.5-bz109921-DW_AT_decl_file-test.patch @@ -1,9 +1,12 @@ +From d3fcf82a62d820f25b42398a4f6623c7ad7ea4d1 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz109921-DW_AT_decl_file-test.patch FileName: 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 @@ -22,11 +25,20 @@ 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. +--- + gdb/testsuite/gdb.dwarf2/dw2-included.c | 26 +++++++++++++++++ + gdb/testsuite/gdb.dwarf2/dw2-included.exp | 47 +++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.dwarf2/dw2-included.h | 20 +++++++++++++ + 3 files changed, 93 insertions(+) + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-included.c + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-included.exp + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-included.h -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 +index 0000000000..28e54fb932 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-included.c @@ -0,0 +1,26 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -54,10 +66,11 @@ 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 +index 0000000000..9aaf8e9772 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-included.exp @@ -0,0 +1,47 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -106,10 +119,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.exp +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 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.h b/gdb/testsuite/gdb.dwarf2/dw2-included.h +new file mode 100644 +index 0000000000..f31348ab4f +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-included.h @@ -0,0 +1,20 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -131,3 +145,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.h + USA. */ + +int integer; +-- +2.14.3 + diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index 1dfaed1..df6af86 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -1,9 +1,13 @@ +From 599be587bb5eed8a8c3908f52d75c1e93543ee5d Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch FileName: 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 @@ -30,7 +34,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 * ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer @@ -39,12 +42,23 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1166549 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 +--- + gdb/printcmd.c | 4 ++ + gdb/testsuite/gdb.dwarf2/dw2-errno.c | 28 +++++++++++++ + gdb/testsuite/gdb.dwarf2/dw2-errno.exp | 60 ++++++++++++++++++++++++++++ + gdb/testsuite/gdb.dwarf2/dw2-errno2.c | 28 +++++++++++++ + gdb/testsuite/gdb.dwarf2/dw2-errno2.exp | 71 +++++++++++++++++++++++++++++++++ + 5 files changed, 191 insertions(+) + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno.c + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno.exp + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno2.c + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno2.exp -Index: gdb-7.12.50.20170207/gdb/printcmd.c -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/printcmd.c 2017-02-07 21:06:20.196593884 +0100 -+++ gdb-7.12.50.20170207/gdb/printcmd.c 2017-02-07 21:07:10.230973906 +0100 -@@ -1258,6 +1258,10 @@ +diff --git a/gdb/printcmd.c b/gdb/printcmd.c +index 20e5bda11e..38642641b9 100644 +--- a/gdb/printcmd.c ++++ b/gdb/printcmd.c +@@ -1210,6 +1210,10 @@ print_command_1 (const char *exp, int voidprint) if (exp && *exp) { @@ -55,10 +69,11 @@ Index: gdb-7.12.50.20170207/gdb/printcmd.c expression_up expr = parse_expression (exp); val = evaluate_expression (expr.get ()); } -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2017-02-07 21:06:20.196593884 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c +new file mode 100644 +index 0000000000..7bd10d0978 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -88,10 +103,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c + + return 0; /* breakpoint */ +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2017-02-07 21:06:20.196593884 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp +new file mode 100644 +index 0000000000..1f13cc1323 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp @@ -0,0 +1,60 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -153,10 +169,11 @@ Index: gdb-7.12.50.20170207/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.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c 2017-02-07 21:06:20.196593884 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c +new file mode 100644 +index 0000000000..7bd10d0978 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -186,10 +203,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c + + return 0; /* breakpoint */ +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp 2017-02-07 21:06:20.197593892 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp +new file mode 100644 +index 0000000000..0f6e66870b +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp @@ -0,0 +1,71 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -231,7 +249,7 @@ Index: gdb-7.12.50.20170207/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 @@ -262,3 +280,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp + +# TODO: Test the error on resolving ERRNO with only libc loaded. +# Just how to find the current libc filename? +-- +2.14.3 + diff --git a/gdb-6.5-bz203661-emit-relocs.patch b/gdb-6.5-bz203661-emit-relocs.patch index def081a..1c81698 100644 --- a/gdb-6.5-bz203661-emit-relocs.patch +++ b/gdb-6.5-bz203661-emit-relocs.patch @@ -1,14 +1,21 @@ +From e4110d40b80bf37595c9f189af73d6dedb113259 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz203661-emit-relocs.patch FileName: gdb-6.5-bz203661-emit-relocs.patch -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 +;; Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661). +;;=push+jan: There was some mail thread about it, this patch may be a hack. +--- + gdb/symfile.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/gdb/symfile.c b/gdb/symfile.c +index 8f45d45d85..37a31950a2 100644 +--- a/gdb/symfile.c ++++ b/gdb/symfile.c +@@ -3634,6 +3634,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp, DWO file. */ bfd *abfd = sectp->owner; @@ -21,3 +28,6 @@ Index: gdb-7.4.50.20120602/gdb/symfile.c /* We're only interested in sections with relocation information. */ if ((sectp->flags & SEC_RELOC) == 0) +-- +2.14.3 + diff --git a/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb-6.5-bz216711-clone-is-outermost.patch index cc63f6e..adcef20 100644 --- a/gdb-6.5-bz216711-clone-is-outermost.patch +++ b/gdb-6.5-bz216711-clone-is-outermost.patch @@ -1,9 +1,12 @@ +From c0f75843ac7b311bc8e0faef1d7d3d5e2e549df3 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz216711-clone-is-outermost.patch FileName: gdb-6.5-bz216711-clone-is-outermost.patch +;; Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). +;;=fedora https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711 @@ -29,12 +32,22 @@ instead. 2007-10-16 Jan Kratochvil Port to GDB-6.7. +--- + gdb/amd64-linux-tdep.c | 76 +++++++++++++++++++++++++++++ + gdb/amd64-tdep.c | 11 +++++ + gdb/i386-tdep.c | 3 ++ + gdb/i386-tdep.h | 3 ++ + gdb/testsuite/gdb.threads/bt-clone-stop.c | 39 +++++++++++++++ + gdb/testsuite/gdb.threads/bt-clone-stop.exp | 61 +++++++++++++++++++++++ + 6 files changed, 193 insertions(+) + create mode 100644 gdb/testsuite/gdb.threads/bt-clone-stop.c + create mode 100644 gdb/testsuite/gdb.threads/bt-clone-stop.exp -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 @@ +diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c +index 87f09a4542..2a705ea41a 100644 +--- a/gdb/amd64-linux-tdep.c ++++ b/gdb/amd64-linux-tdep.c +@@ -291,6 +291,80 @@ amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, /* Set the program counter for process PTID to PC. */ @@ -115,7 +128,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c static void amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) { -@@ -1800,6 +1874,8 @@ +@@ -1802,6 +1876,8 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch) tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET; @@ -124,11 +137,11 @@ Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c /* 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 @@ +diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c +index bcd37ef048..81fbe52795 100644 +--- a/gdb/amd64-tdep.c ++++ b/gdb/amd64-tdep.c +@@ -2555,6 +2555,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, { struct amd64_frame_cache *cache = amd64_frame_cache (this_frame, this_cache); @@ -136,7 +149,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c if (!cache->base_p) return UNWIND_UNAVAILABLE; -@@ -2502,6 +2503,10 @@ +@@ -2563,6 +2564,10 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, if (cache->base == 0) return UNWIND_OUTERMOST; @@ -147,7 +160,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c return UNWIND_NO_REASON; } -@@ -2636,6 +2641,7 @@ +@@ -2697,6 +2702,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame, { struct amd64_frame_cache *cache = amd64_sigtramp_frame_cache (this_frame, this_cache); @@ -155,7 +168,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c if (!cache->base_p) (*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame)); -@@ -2644,6 +2650,11 @@ +@@ -2705,6 +2711,11 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame, /* This marks the outermost frame. */ return; } @@ -167,11 +180,11 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c 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 @@ +diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c +index 81048081ad..290b1c8368 100644 +--- a/gdb/i386-tdep.c ++++ b/gdb/i386-tdep.c +@@ -8401,6 +8401,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->xsave_xcr0_offset = -1; @@ -181,11 +194,11 @@ Index: gdb-7.10.90.20160211/gdb/i386-tdep.c 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 @@ +diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h +index f190bb3002..6fb45ca59c 100644 +--- a/gdb/i386-tdep.h ++++ b/gdb/i386-tdep.h +@@ -251,6 +251,9 @@ struct gdbarch_tdep /* Regsets. */ const struct regset *fpregset; @@ -195,10 +208,11 @@ Index: gdb-7.10.90.20160211/gdb/i386-tdep.h }; /* 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 +diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.c b/gdb/testsuite/gdb.threads/bt-clone-stop.c +new file mode 100644 +index 0000000000..2ac93f8664 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/bt-clone-stop.c @@ -0,0 +1,39 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -239,10 +253,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c + 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 +diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.exp b/gdb/testsuite/gdb.threads/bt-clone-stop.exp +new file mode 100644 +index 0000000000..02728e05b9 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/bt-clone-stop.exp @@ -0,0 +1,61 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -305,3 +320,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp + pass "0x0 entry not found" + } +} +-- +2.14.3 + diff --git a/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch b/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch index 9e78146..d054a85 100644 --- a/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +++ b/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch @@ -1,17 +1,60 @@ +From 5c0ae003e4412f25bfafa5ab0073852bb6c295ba Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch FileName: 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 +--- + gdb/testsuite/gdb.base/step-over-trampoline.c | 28 +++++++++++++ + gdb/testsuite/gdb.base/step-over-trampoline.exp | 54 +++++++++++++++++++++++++ + 2 files changed, 82 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/step-over-trampoline.c + create mode 100644 gdb/testsuite/gdb.base/step-over-trampoline.exp - -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 +index 0000000000..a012da1031 +--- /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 ++ ++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 +index 0000000000..a183e36263 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp @@ -0,0 +1,54 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -67,36 +110,6 @@ 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 -+ -+int main (void) -+{ -+ puts ("hello world"); -+ return 0; -+} +-- +2.14.3 + diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch index ecd9ebf..dda2c6e 100644 --- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -1,18 +1,23 @@ +From aa4a5d2f57b748a80198c2015aaae81e6d4ff80d Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch FileName: 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 +--- + gdb/symtab.c | 7 +++++++ + 1 file changed, 7 insertions(+) - -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 +diff --git a/gdb/symtab.c b/gdb/symtab.c +index dd7434ed50..d731a5421b 100644 +--- a/gdb/symtab.c ++++ b/gdb/symtab.c +@@ -3141,6 +3141,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) SYMBOL_LINKAGE_NAME (msymbol)); */ ; /* fall through */ @@ -26,3 +31,6 @@ Index: gdb-7.7.90.20140613/gdb/symtab.c else return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0); } +-- +2.14.3 + diff --git a/gdb-6.5-bz243845-stale-testing-zombie-test.patch b/gdb-6.5-bz243845-stale-testing-zombie-test.patch index 37c7aa8..a483612 100644 --- a/gdb-6.5-bz243845-stale-testing-zombie-test.patch +++ b/gdb-6.5-bz243845-stale-testing-zombie-test.patch @@ -1,13 +1,22 @@ +From e1f17c2fd64dea2eed810ca42cf687fba3fd8510 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz243845-stale-testing-zombie-test.patch FileName: gdb-6.5-bz243845-stale-testing-zombie-test.patch +;; Test leftover zombie process (BZ 243845). +;;=fedoratest +--- + gdb/testsuite/gdb.base/tracefork-zombie.exp | 75 +++++++++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/tracefork-zombie.exp -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 +diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp +new file mode 100644 +index 0000000000..5807040840 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp @@ -0,0 +1,75 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -84,3 +93,6 @@ diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp gdb- +} else { + fail $test +} +-- +2.14.3 + diff --git a/gdb-6.5-gcore-buffer-limit-test.patch b/gdb-6.5-gcore-buffer-limit-test.patch index 1cfb728..5aef382 100644 --- a/gdb-6.5-gcore-buffer-limit-test.patch +++ b/gdb-6.5-gcore-buffer-limit-test.patch @@ -1,14 +1,24 @@ +From e31680bcf1cfd0fbfad00e92cdb5029a317c093c Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-gcore-buffer-limit-test.patch FileName: gdb-6.5-gcore-buffer-limit-test.patch +;; Test gcore memory and time requirements for large inferiors. +;;=fedoratest +--- + gdb/testsuite/gdb.base/gcore-excessive-memory.c | 37 +++++++++ + gdb/testsuite/gdb.base/gcore-excessive-memory.exp | 94 +++++++++++++++++++++++ + 2 files changed, 131 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/gcore-excessive-memory.c + create mode 100644 gdb/testsuite/gdb.base/gcore-excessive-memory.exp -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 +diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.c b/gdb/testsuite/gdb.base/gcore-excessive-memory.c +new file mode 100644 +index 0000000000..56b4d3a63a +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.c @@ -0,0 +1,37 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -47,10 +57,11 @@ 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 +index 0000000000..4e71b5534e +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp @@ -0,0 +1,94 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -146,3 +157,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcore-excessive-memory.exp + +# Cleanup. +exec kill -9 $pid_of_bin +-- +2.14.3 + diff --git a/gdb-6.5-ia64-libunwind-leak-test.patch b/gdb-6.5-ia64-libunwind-leak-test.patch index d5be9a7..0674bf4 100644 --- a/gdb-6.5-ia64-libunwind-leak-test.patch +++ b/gdb-6.5-ia64-libunwind-leak-test.patch @@ -1,14 +1,24 @@ +From 542fd88438a3b966bf18d4b40bf73fe10726213a Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-ia64-libunwind-leak-test.patch FileName: gdb-6.5-ia64-libunwind-leak-test.patch +;; Test ia64 memory leaks of the code using libunwind. +;;=fedoratest +--- + gdb/testsuite/gdb.base/unwind-leak.c | 29 ++++++++++++ + gdb/testsuite/gdb.base/unwind-leak.exp | 83 ++++++++++++++++++++++++++++++++++ + 2 files changed, 112 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/unwind-leak.c + create mode 100644 gdb/testsuite/gdb.base/unwind-leak.exp -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 +diff --git a/gdb/testsuite/gdb.base/unwind-leak.c b/gdb/testsuite/gdb.base/unwind-leak.c +new file mode 100644 +index 0000000000..58e34fb264 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/unwind-leak.c @@ -0,0 +1,29 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -39,10 +49,11 @@ 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 +index 0000000000..098962a57c +--- /dev/null ++++ b/gdb/testsuite/gdb.base/unwind-leak.exp @@ -0,0 +1,83 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -127,3 +138,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/unwind-leak.exp + fail $test + } +} +-- +2.14.3 + diff --git a/gdb-6.5-last-address-space-byte-test.patch b/gdb-6.5-last-address-space-byte-test.patch index f7071e2..fbe8398 100644 --- a/gdb-6.5-last-address-space-byte-test.patch +++ b/gdb-6.5-last-address-space-byte-test.patch @@ -1,15 +1,22 @@ +From 95319c14b0cc5f4f44ca0088de5fdd44c4db5d5e Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-last-address-space-byte-test.patch FileName: gdb-6.5-last-address-space-byte-test.patch -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 +;; Testcase for deadlocking on last address space byte; for corrupted backtraces. +;;=fedoratest +--- + .../gdb.base/largecore-last-address-lock.exp | 49 ++++++++++++++++++++++ + 1 file changed, 49 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/largecore-last-address-lock.exp + +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 +index 0000000000..8a597e9b15 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp @@ -0,0 +1,49 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -60,3 +67,6 @@ diff -N ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp + "Read the last address space byte" + +set timeout ${timeoutold} +-- +2.14.3 + diff --git a/gdb-6.5-missed-trap-on-step-test.patch b/gdb-6.5-missed-trap-on-step-test.patch index 776d806..cea9450 100644 --- a/gdb-6.5-missed-trap-on-step-test.patch +++ b/gdb-6.5-missed-trap-on-step-test.patch @@ -1,17 +1,63 @@ +From 1203cb00b3ac2d3f14f9601e2ee749976617f005 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-missed-trap-on-step-test.patch FileName: 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 +--- + gdb/testsuite/gdb.base/watchpoint-during-step.c | 30 ++++++++++++++++ + gdb/testsuite/gdb.base/watchpoint-during-step.exp | 44 +++++++++++++++++++++++ + 2 files changed, 74 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/watchpoint-during-step.c + create mode 100644 gdb/testsuite/gdb.base/watchpoint-during-step.exp -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 +index 0000000000..107eae45a0 +--- /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 +index 0000000000..12ba99f1a9 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/watchpoint-during-step.exp @@ -0,0 +1,44 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -57,38 +103,6 @@ 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; -+} +-- +2.14.3 + diff --git a/gdb-6.5-readline-long-line-crash-test.patch b/gdb-6.5-readline-long-line-crash-test.patch index ba83431..c7f60b4 100644 --- a/gdb-6.5-readline-long-line-crash-test.patch +++ b/gdb-6.5-readline-long-line-crash-test.patch @@ -1,17 +1,24 @@ +From 2b4ff32b8c143887747c49a67d32f945412278b9 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-readline-long-line-crash-test.patch FileName: 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 +--- + gdb/testsuite/gdb.base/readline-overflow.exp | 126 +++++++++++++++++++++++++++ + 1 file changed, 126 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/readline-overflow.exp - -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 +diff --git a/gdb/testsuite/gdb.base/readline-overflow.exp b/gdb/testsuite/gdb.base/readline-overflow.exp +new file mode 100644 +index 0000000000..5e46816d21 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/readline-overflow.exp @@ -0,0 +1,126 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -139,3 +146,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/readline-overflow.exp +} +set timeout $oldtimeout1 + +-- +2.14.3 + diff --git a/gdb-6.5-section-num-fixup-test.patch b/gdb-6.5-section-num-fixup-test.patch index 1157425..21ebc66 100644 --- a/gdb-6.5-section-num-fixup-test.patch +++ b/gdb-6.5-section-num-fixup-test.patch @@ -1,14 +1,26 @@ +From 8909018fa1815f0323970616cb34036512095a5d Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-section-num-fixup-test.patch FileName: gdb-6.5-section-num-fixup-test.patch +;; Test a crash on libraries missing the .text section. +;;=fedoratest +--- + gdb/testsuite/gdb.base/datalib-lib.c | 22 +++++++++++++++ + gdb/testsuite/gdb.base/datalib-main.c | 26 ++++++++++++++++++ + gdb/testsuite/gdb.base/datalib.exp | 51 +++++++++++++++++++++++++++++++++++ + 3 files changed, 99 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/datalib-lib.c + create mode 100644 gdb/testsuite/gdb.base/datalib-main.c + create mode 100644 gdb/testsuite/gdb.base/datalib.exp -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 +diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c +new file mode 100644 +index 0000000000..dd39e23746 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/datalib-lib.c @@ -0,0 +1,22 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -32,10 +44,11 @@ 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 +index 0000000000..4e0b80d2d6 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/datalib-main.c @@ -0,0 +1,26 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -63,10 +76,11 @@ 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 +index 0000000000..385716d901 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/datalib.exp @@ -0,0 +1,51 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -119,3 +133,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/datalib.exp +gdb_test "start" \ + "main \\(\\) at .*${srcfilemain}.*" \ + "start" +-- +2.14.3 + diff --git a/gdb-6.5-sharedlibrary-path.patch b/gdb-6.5-sharedlibrary-path.patch index f9b5977..3c17a67 100644 --- a/gdb-6.5-sharedlibrary-path.patch +++ b/gdb-6.5-sharedlibrary-path.patch @@ -1,21 +1,23 @@ +From 929ceca097bec5a5f5182e85c5ab9a7ef38fe39e Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-sharedlibrary-path.patch FileName: 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 * solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute @@ -28,11 +30,20 @@ The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. 2008-02-27 Jan Kratochvil Port to gdb-6.7.50.20080227. +--- + gdb/testsuite/gdb.threads/tls-sepdebug-main.c | 25 +++++++ + gdb/testsuite/gdb.threads/tls-sepdebug-shared.c | 22 +++++++ + gdb/testsuite/gdb.threads/tls-sepdebug.exp | 87 +++++++++++++++++++++++++ + 3 files changed, 134 insertions(+) + create mode 100644 gdb/testsuite/gdb.threads/tls-sepdebug-main.c + create mode 100644 gdb/testsuite/gdb.threads/tls-sepdebug-shared.c + create mode 100644 gdb/testsuite/gdb.threads/tls-sepdebug.exp -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 +index 0000000000..ea5d0174d6 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c @@ -0,0 +1,25 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -59,10 +70,11 @@ 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 +index 0000000000..61b49251ba +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c @@ -0,0 +1,22 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -86,10 +98,11 @@ 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 +index 0000000000..00773f78f2 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-sepdebug.exp @@ -0,0 +1,87 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -178,3 +191,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-sepdebug.exp + "\\\$1 = \[0-9\].*" \ + "print TLS variable from a shared library with $name-directory separate debug info file" +} +-- +2.14.3 + diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch index 4381eb0..3ad2cd5 100644 --- a/gdb-6.6-buildid-locate-core-as-arg.patch +++ b/gdb-6.6-buildid-locate-core-as-arg.patch @@ -1,9 +1,11 @@ +From c3963f29ef9be6e48dee8b058da646867757810c Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Re: [patch] print a more useful error message for "gdb core" +Subject: print a more useful error message for "gdb core" FileName: gdb-6.6-buildid-locate-core-as-arg.patch +;;=push+jan http://sourceware.org/ml/gdb-patches/2010-01/msg00558.html @@ -37,16 +39,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 * exceptions.h (enum errors ): New. @@ -63,11 +62,30 @@ 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". +--- + gdb/common/common-exceptions.h | 3 +++ + gdb/exec.c | 22 +++++++++++++++--- + gdb/main.c | 53 +++++++++++++++++++++++++++++++++++++++--- + 3 files changed, 72 insertions(+), 6 deletions(-) -Index: gdb-7.12.50.20170226/gdb/exec.c -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/exec.c 2017-02-27 22:18:00.945026211 +0100 -+++ gdb-7.12.50.20170226/gdb/exec.c 2017-02-27 22:18:08.111076350 +0100 +diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h +index 99aa876dfc..3b9ed3ee71 100644 +--- a/gdb/common/common-exceptions.h ++++ b/gdb/common/common-exceptions.h +@@ -104,6 +104,9 @@ enum errors { + "_ERROR" is appended to the name. */ + MAX_COMPLETIONS_REACHED_ERROR, + ++ /* Attempt to load a core file as executable. */ ++ IS_CORE_ERROR, ++ + /* Add more errors here. */ + NR_ERRORS + }; +diff --git a/gdb/exec.c b/gdb/exec.c +index 4fbe9dd635..a78ab99fc7 100644 +--- a/gdb/exec.c ++++ b/gdb/exec.c @@ -35,6 +35,7 @@ #include "progspace.h" #include "gdb_bfd.h" @@ -76,7 +94,7 @@ Index: gdb-7.12.50.20170226/gdb/exec.c #include #include "readline/readline.h" -@@ -359,12 +360,27 @@ +@@ -346,12 +347,27 @@ exec_file_attach (const char *filename, int from_tty) if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) { @@ -107,11 +125,11 @@ Index: gdb-7.12.50.20170226/gdb/exec.c } if (build_section_table (exec_bfd, §ions, §ions_end)) -Index: gdb-7.12.50.20170226/gdb/main.c -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/main.c 2017-02-27 22:18:00.945026211 +0100 -+++ gdb-7.12.50.20170226/gdb/main.c 2017-02-27 22:18:08.112076357 +0100 -@@ -459,6 +459,37 @@ +diff --git a/gdb/main.c b/gdb/main.c +index 8f04da107a..d5b4c3adb9 100644 +--- a/gdb/main.c ++++ b/gdb/main.c +@@ -446,6 +446,37 @@ struct cmdarg char *string; }; @@ -147,9 +165,9 @@ Index: gdb-7.12.50.20170226/gdb/main.c +} + static void - captured_main_1 (struct captured_main_args *context, int &python_script) + captured_main_1 (struct captured_main_args *context) { -@@ -910,6 +941,8 @@ +@@ -881,6 +912,8 @@ captured_main_1 (struct captured_main_args *context) { symarg = argv[optind]; execarg = argv[optind]; @@ -158,7 +176,7 @@ Index: gdb-7.12.50.20170226/gdb/main.c optind++; } -@@ -1060,11 +1093,25 @@ +@@ -1031,11 +1064,25 @@ captured_main_1 (struct captured_main_args *context) && symarg != NULL && strcmp (execarg, symarg) == 0) { @@ -177,27 +195,16 @@ Index: gdb-7.12.50.20170226/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)) +- if (catch_command_errors (exec_file_attach, execarg, +- !batch_flag)) + 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) ++ if (catch_command_errors (func, execarg, !batch_flag) + && core_bfd == NULL) - catch_command_errors_const (symbol_file_add_main_adapter, symarg, - !batch_flag); + catch_command_errors (symbol_file_add_main_adapter, symarg, + !batch_flag); } -Index: gdb-7.12.50.20170226/gdb/common/common-exceptions.h -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/common/common-exceptions.h 2017-02-27 22:18:00.946026218 +0100 -+++ gdb-7.12.50.20170226/gdb/common/common-exceptions.h 2017-02-27 22:18:08.112076357 +0100 -@@ -106,6 +106,9 @@ - "_ERROR" is appended to the name. */ - MAX_COMPLETIONS_REACHED_ERROR, - -+ /* Attempt to load a core file as executable. */ -+ IS_CORE_ERROR, -+ - /* Add more errors here. */ - NR_ERRORS - }; +-- +2.14.3 + diff --git a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch index 3dc85a6..c10e8f1 100644 --- a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +++ b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch @@ -1,9 +1,15 @@ +From ee95f1e165896f860268b46e04fc1711374af019 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Subject: + gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch FileName: 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 : This is the fix for RH BZ #981154 @@ -20,11 +26,33 @@ Comments by Sergio Durigan Junior : and had a little thinko there. The variable 'filename' needs to be set to NULL after it is free'd, otherwise the code below thinks that it is still valid and doesn't print the necessary warning ("Try: yum install ..."). +--- + gdb/build-id.c | 5 +- + .../rhbz981154-misleading-yum-install-warning.exp | 97 ++++++++++++++++++++++ + 2 files changed, 101 insertions(+), 1 deletion(-) + create mode 100644 gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 2017-02-26 19:14:58.492609659 +0100 +diff --git a/gdb/build-id.c b/gdb/build-id.c +index a1fd3bfaab..831f16459f 100644 +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -592,7 +592,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, + do_cleanups (inner); + + if (abfd == NULL) +- continue; ++ { ++ filename = NULL; ++ continue; ++ } + + if (build_id_verify (abfd.get(), build_id_len, build_id)) + break; +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 +index 0000000000..bb70c5cf44 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp @@ -0,0 +1,97 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -123,19 +151,6 @@ Index: gdb-7.12.50.20170207/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.12.50.20170207/gdb/build-id.c -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/build-id.c 2017-02-26 19:14:51.943562799 +0100 -+++ gdb-7.12.50.20170207/gdb/build-id.c 2017-02-26 19:14:58.492609659 +0100 -@@ -589,7 +589,10 @@ - do_cleanups (inner); - - if (abfd == NULL) -- continue; -+ { -+ filename = NULL; -+ continue; -+ } - - if (build_id_verify (abfd.get(), build_id_len, build_id)) - break; +-- +2.14.3 + diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch index aed1fff..f38ead3 100644 --- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch @@ -1,27 +1,22 @@ +From f193c41757aab810d11339c1a001b6ea33b9575f Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch FileName: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). +;;=push+jan +--- + gdb/build-id.c | 13 +++++++++++++ + gdb/proc-service.list | 3 +++ + 2 files changed, 16 insertions(+) -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 +diff --git a/gdb/build-id.c b/gdb/build-id.c +index d420e3f9e7..a1fd3bfaab 100644 +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -678,6 +678,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) #include #endif @@ -41,3 +36,18 @@ 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 +index 79c2e5b7fc..ac8364928c 100644 +--- 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; + }; +-- +2.14.3 + diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch index f3752eb..73f6900 100644 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -1,16 +1,25 @@ +From 1edc19907a3ff66132cca69c54b0cdfeaf21a2b3 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-rpm-scl.patch FileName: 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 +--- + gdb/build-id.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + gdb/dwarf2read.c | 14 ++++++++++++++ + 2 files changed, 68 insertions(+) -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 +index 831f16459f..531e652e75 100644 +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -715,7 +715,11 @@ static int missing_rpm_list_entries; /* Returns the count of newly added rpms. */ static int @@ -22,7 +31,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 +@@ -822,7 +826,11 @@ missing_rpm_enlist (const char *filename) mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); if (mi != NULL) { @@ -34,7 +43,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 +@@ -940,6 +948,37 @@ missing_rpm_enlist (const char *filename) xfree (debuginfo); count++; } @@ -72,7 +81,7 @@ 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 +@@ -950,6 +989,21 @@ missing_rpm_enlist (const char *filename) } static int @@ -94,10 +103,11 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb missing_rpm_list_compar (const char *const *ap, const char *const *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/dwarf2read.c b/gdb/dwarf2read.c +index 49b2658ade..e44844fbd7 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -3373,6 +3373,16 @@ read_index_from_section (struct objfile *objfile, "set use-deprecated-index-sections on". */ if (version < 6 && !deprecated_ok) { @@ -114,7 +124,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."), +@@ -3384,6 +3394,10 @@ to use the section anyway."), warning_printed = 1; } return 0; @@ -125,3 +135,6 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/g } /* Version 7 indices generated by gold refer to the CU for a symbol instead of the TU (for symbols coming from TUs), +-- +2.14.3 + diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index da84836..f1067bd 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,61 +1,27 @@ +From 8882716512a2a656edf8a600af79f53630e5632c Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-rpm.patch FileName: gdb-6.6-buildid-locate-rpm.patch +;;=push+jan +--- + gdb/aclocal.m4 | 215 +++++++++++++++++++++++ + gdb/build-id.c | 407 +++++++++++++++++++++++++++++++++++++++++++- + gdb/config.in | 6 + + gdb/configure | 508 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + gdb/configure.ac | 193 +++++++++++++++++++++ + gdb/corelow.c | 2 +- + gdb/event-top.c | 8 +- + gdb/symfile.h | 2 + + 8 files changed, 1331 insertions(+), 10 deletions(-) -Index: gdb-7.11.50.20160630/gdb/event-top.c -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/event-top.c 2016-07-02 23:43:24.085214144 +0200 -+++ gdb-7.11.50.20160630/gdb/event-top.c 2016-07-03 14:37:12.572130734 +0200 -@@ -40,6 +40,7 @@ - #include "buffer.h" - #include "ser-event.h" - #include "gdb_select.h" -+#include "symfile.h" - - /* readline include files. */ - #include "readline/readline.h" -@@ -347,6 +348,8 @@ - /* Reset the nesting depth used when trace-commands is set. */ - reset_command_nest_depth (); - -+ debug_flush_missing (); -+ - old_chain = make_cleanup (free_current_contents, &actual_gdb_prompt); - - /* Do not call the python hook on an explicit prompt change as -@@ -794,7 +797,10 @@ - command_handler (cmd); - - if (ui->prompt_state != PROMPTED) -- display_gdb_prompt (0); -+ { -+ debug_flush_missing (); -+ display_gdb_prompt (0); -+ } - } - } - -Index: gdb-7.11.50.20160630/gdb/symfile.h -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/symfile.h 2016-07-03 14:34:32.032753668 +0200 -+++ gdb-7.11.50.20160630/gdb/symfile.h 2016-07-03 14:37:12.573130742 +0200 -@@ -592,6 +592,8 @@ - /* build-id support. */ - extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); - extern void debug_print_missing (const char *binary, const char *debug); -+extern void debug_flush_missing (void); -+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file") - - /* From dwarf2read.c */ - -Index: gdb-7.11.50.20160630/gdb/aclocal.m4 -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/aclocal.m4 2016-07-02 23:43:24.085214144 +0200 -+++ gdb-7.11.50.20160630/gdb/aclocal.m4 2016-07-03 14:37:12.576130768 +0200 -@@ -11,6 +11,221 @@ +diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 +index e0d38ea267..da5ac313e3 100644 +--- a/gdb/aclocal.m4 ++++ b/gdb/aclocal.m4 +@@ -12,6 +12,221 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @@ -276,11 +242,457 @@ Index: gdb-7.11.50.20160630/gdb/aclocal.m4 + # AM_AUX_DIR_EXPAND -*- Autoconf -*- - # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -Index: gdb-7.11.50.20160630/gdb/config.in -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/config.in 2016-07-02 23:43:24.085214144 +0200 -+++ gdb-7.11.50.20160630/gdb/config.in 2016-07-03 14:37:12.576130768 +0200 + # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +diff --git a/gdb/build-id.c b/gdb/build-id.c +index 11d3774d9e..d420e3f9e7 100644 +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -35,6 +35,8 @@ + #include "elf/common.h" + #include "elf-bfd.h" + #include ++#include "elf/external.h" ++#include "inferior.h" + + #define BUILD_ID_VERBOSE_NONE 0 + #define BUILD_ID_VERBOSE_FILENAMES 1 +@@ -666,8 +668,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) + return result; + } + ++#ifdef HAVE_LIBRPM ++ ++#include ++#include ++#include ++#include ++#ifdef DLOPEN_LIBRPM ++#include ++#endif ++ ++/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files ++ and avoid their duplicities during a single inferior run. */ ++ ++static struct htab *missing_rpm_hash; ++ ++/* This MISSING_RPM_LIST tracker is used to collect and print as a single line ++ all the rpms right before the nearest GDB prompt. It gets cleared after ++ each such print (it is questionable if we should clear it after the print). ++ */ ++ ++struct missing_rpm ++ { ++ struct missing_rpm *next; ++ char rpm[1]; ++ }; ++static struct missing_rpm *missing_rpm_list; ++static int missing_rpm_list_entries; ++ ++/* Returns the count of newly added rpms. */ ++ ++static int ++missing_rpm_enlist (const char *filename) ++{ ++ static int rpm_init_done = 0; ++ rpmts ts; ++ rpmdbMatchIterator mi; ++ int count = 0; ++ ++#ifdef DLOPEN_LIBRPM ++ /* Duplicate here the declarations to verify they match. The same sanity ++ check is present also in `configure.ac'. */ ++ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); ++ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg); ++ extern int rpmReadConfigFiles(const char * file, const char * target); ++ static int (*rpmReadConfigFiles_p) (const char * file, const char * target); ++ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); ++ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi); ++ extern Header rpmdbNextIterator(rpmdbMatchIterator mi); ++ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi); ++ extern rpmts rpmtsCreate(void); ++ static rpmts (*rpmtsCreate_p) (void); ++ extern rpmts rpmtsFree(rpmts ts); ++ static rpmts (*rpmtsFree_p) (rpmts ts); ++ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++ const void * keyp, size_t keylen); ++ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts, ++ rpmTag rpmtag, ++ const void *keyp, ++ size_t keylen); ++#else /* !DLOPEN_LIBRPM */ ++# define headerFormat_p headerFormat ++# define rpmReadConfigFiles_p rpmReadConfigFiles ++# define rpmdbFreeIterator_p rpmdbFreeIterator ++# define rpmdbNextIterator_p rpmdbNextIterator ++# define rpmtsCreate_p rpmtsCreate ++# define rpmtsFree_p rpmtsFree ++# define rpmtsInitIterator_p rpmtsInitIterator ++#endif /* !DLOPEN_LIBRPM */ ++ ++ gdb_assert (filename != NULL); ++ ++ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0) ++ return 0; ++ ++ if (is_target_filename (filename)) ++ return 0; ++ ++ if (filename[0] != '/') ++ { ++ warning (_("Ignoring non-absolute filename: <%s>"), filename); ++ return 0; ++ } ++ ++ if (!rpm_init_done) ++ { ++ static int init_tried; ++ ++ /* Already failed the initialization before? */ ++ if (init_tried) ++ return 0; ++ init_tried = 1; ++ ++#ifdef DLOPEN_LIBRPM ++ { ++ void *h; ++ ++ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY); ++ if (!h) ++ { ++ warning (_("Unable to open \"%s\" (%s), " ++ "missing debuginfos notifications will not be displayed"), ++ DLOPEN_LIBRPM, dlerror ()); ++ return 0; ++ } ++ ++ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat")) ++ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles")) ++ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator")) ++ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) ++ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) ++ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) ++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) ++ { ++ warning (_("Opened library \"%s\" is incompatible (%s), " ++ "missing debuginfos notifications will not be displayed"), ++ DLOPEN_LIBRPM, dlerror ()); ++ if (dlclose (h)) ++ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM, ++ dlerror ()); ++ return 0; ++ } ++ } ++#endif /* DLOPEN_LIBRPM */ ++ ++ if (rpmReadConfigFiles_p (NULL, NULL) != 0) ++ { ++ warning (_("Error reading the rpm configuration files")); ++ return 0; ++ } ++ ++ rpm_init_done = 1; ++ } ++ ++ ts = rpmtsCreate_p (); ++ ++ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); ++ if (mi != NULL) ++ { ++ for (;;) ++ { ++ Header h; ++ char *debuginfo, **slot, *s, *s2; ++ errmsg_t err; ++ size_t srcrpmlen = sizeof (".src.rpm") - 1; ++ size_t debuginfolen = sizeof ("-debuginfo") - 1; ++ rpmdbMatchIterator mi_debuginfo; ++ ++ h = rpmdbNextIterator_p (mi); ++ if (h == NULL) ++ break; ++ ++ /* Verify the debuginfo file is not already installed. */ ++ ++ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}", ++ &err); ++ if (!debuginfo) ++ { ++ warning (_("Error querying the rpm file `%s': %s"), filename, ++ err); ++ continue; ++ } ++ /* s = `.src.rpm-debuginfo.%{arch}' */ ++ s = strrchr (debuginfo, '-') - srcrpmlen; ++ s2 = NULL; ++ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0) ++ { ++ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */ ++ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo); ++ } ++ if (s2) ++ { ++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ ++ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo); ++ } ++ if (!s2) ++ { ++ warning (_("Error querying the rpm file `%s': %s"), filename, ++ debuginfo); ++ xfree (debuginfo); ++ continue; ++ } ++ /* s = `.src.rpm-debuginfo.%{arch}' */ ++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ ++ memmove (s2 + debuginfolen, s2, s - s2); ++ memcpy (s2, "-debuginfo", debuginfolen); ++ /* s = `XXXX.%{arch}' */ ++ /* strlen ("XXXX") == srcrpmlen + debuginfolen */ ++ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */ ++ /* strlen ("XX") == srcrpmlen */ ++ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen, ++ strlen (s + srcrpmlen + debuginfolen) + 1); ++ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */ ++ ++ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ ++ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ ++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); ++ xfree (debuginfo); ++ if (mi_debuginfo) ++ { ++ rpmdbFreeIterator_p (mi_debuginfo); ++ count = 0; ++ break; ++ } ++ ++ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ ++ debuginfo = headerFormat_p (h, ++ "%{name}-%{version}-%{release}.%{arch}", ++ &err); ++ if (!debuginfo) ++ { ++ warning (_("Error querying the rpm file `%s': %s"), filename, ++ err); ++ continue; ++ } ++ ++ /* Base package name for `debuginfo-install'. We do not use the ++ `yum' command directly as the line ++ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH ++ would be more complicated than just: ++ debuginfo-install NAME-VERSION-RELEASE.ARCH ++ Do not supply the rpm base name (derived from .src.rpm name) as ++ debuginfo-install is unable to install the debuginfo package if ++ the base name PKG binary rpm is not installed while for example ++ PKG-libs would be installed (RH Bug 467901). ++ FUTURE: After multiple debuginfo versions simultaneously installed ++ get supported the support for the VERSION-RELEASE tags handling ++ may need an update. */ ++ ++ if (missing_rpm_hash == NULL) ++ { ++ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE ++ should not deallocate the entries. */ ++ ++ missing_rpm_hash = htab_create_alloc (64, htab_hash_string, ++ (int (*) (const void *, const void *)) streq, ++ NULL, xcalloc, xfree); ++ } ++ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT); ++ /* XCALLOC never returns NULL. */ ++ gdb_assert (slot != NULL); ++ if (*slot == NULL) ++ { ++ struct missing_rpm *missing_rpm; ++ ++ *slot = debuginfo; ++ ++ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo)); ++ strcpy (missing_rpm->rpm, debuginfo); ++ missing_rpm->next = missing_rpm_list; ++ missing_rpm_list = missing_rpm; ++ missing_rpm_list_entries++; ++ } ++ else ++ xfree (debuginfo); ++ count++; ++ } ++ ++ rpmdbFreeIterator_p (mi); ++ } ++ ++ rpmtsFree_p (ts); ++ ++ return count; ++} ++ ++static int ++missing_rpm_list_compar (const char *const *ap, const char *const *bp) ++{ ++ return strcoll (*ap, *bp); ++} ++ ++/* It returns a NULL-terminated array of strings needing to be FREEd. It may ++ also return only NULL. */ ++ ++static void ++missing_rpm_list_print (void) ++{ ++ char **array, **array_iter; ++ struct missing_rpm *list_iter; ++ struct cleanup *cleanups; ++ ++ if (missing_rpm_list_entries == 0) ++ return; ++ ++ array = (char **) xmalloc (sizeof (*array) * missing_rpm_list_entries); ++ cleanups = make_cleanup (xfree, array); ++ ++ array_iter = array; ++ for (list_iter = missing_rpm_list; list_iter != NULL; ++ list_iter = list_iter->next) ++ { ++ *array_iter++ = list_iter->rpm; ++ } ++ gdb_assert (array_iter == array + missing_rpm_list_entries); ++ ++ qsort (array, missing_rpm_list_entries, sizeof (*array), ++ (int (*) (const void *, const void *)) missing_rpm_list_compar); ++ ++ printf_unfiltered (_("Missing separate debuginfos, use: %s"), ++#ifdef DNF_DEBUGINFO_INSTALL ++ "dnf " ++#endif ++ "debuginfo-install"); ++ for (array_iter = array; array_iter < array + missing_rpm_list_entries; ++ array_iter++) ++ { ++ putchar_unfiltered (' '); ++ puts_unfiltered (*array_iter); ++ } ++ putchar_unfiltered ('\n'); ++ ++ while (missing_rpm_list != NULL) ++ { ++ list_iter = missing_rpm_list; ++ missing_rpm_list = list_iter->next; ++ xfree (list_iter); ++ } ++ missing_rpm_list_entries = 0; ++ ++ do_cleanups (cleanups); ++} ++ ++static void ++missing_rpm_change (void) ++{ ++ debug_flush_missing (); ++ ++ gdb_assert (missing_rpm_list == NULL); ++ if (missing_rpm_hash != NULL) ++ { ++ htab_delete (missing_rpm_hash); ++ missing_rpm_hash = NULL; ++ } ++} ++ ++enum missing_exec ++ { ++ /* Init state. EXEC_BFD also still could be NULL. */ ++ MISSING_EXEC_NOT_TRIED, ++ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */ ++ MISSING_EXEC_NOT_FOUND, ++ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded ++ or separate) or the main executable's RPM is now contained in ++ MISSING_RPM_HASH. */ ++ MISSING_EXEC_ENLISTED ++ }; ++static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED; ++ ++#endif /* HAVE_LIBRPM */ ++ ++void ++debug_flush_missing (void) ++{ ++#ifdef HAVE_LIBRPM ++ missing_rpm_list_print (); ++#endif ++} ++ + /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages +- Try to install the hash file ... ++ yum --enablerepo='*debug*' install ... + avoidance. */ + + struct missing_filepair +@@ -721,11 +1081,17 @@ missing_filepair_change (void) + /* All their memory came just from missing_filepair_OBSTACK. */ + missing_filepair_hash = NULL; + } ++#ifdef HAVE_LIBRPM ++ missing_exec = MISSING_EXEC_NOT_TRIED; ++#endif + } + + static void + debug_print_executable_changed (void) + { ++#ifdef HAVE_LIBRPM ++ missing_rpm_change (); ++#endif + missing_filepair_change (); + } + +@@ -792,14 +1158,39 @@ debug_print_missing (const char *binary, const char *debug) + + *slot = missing_filepair; + +- /* We do not collect and flush these messages as each such message +- already requires its own separate lines. */ ++#ifdef HAVE_LIBRPM ++ if (missing_exec == MISSING_EXEC_NOT_TRIED) ++ { ++ char *execfilename; + +- fprintf_unfiltered (gdb_stdlog, +- _("Missing separate debuginfo for %s\n"), binary); +- if (debug != NULL) +- fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"), +- debug); ++ execfilename = get_exec_file (0); ++ if (execfilename != NULL) ++ { ++ if (missing_rpm_enlist (execfilename) == 0) ++ missing_exec = MISSING_EXEC_NOT_FOUND; ++ else ++ missing_exec = MISSING_EXEC_ENLISTED; ++ } ++ } ++ if (missing_exec != MISSING_EXEC_ENLISTED) ++ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0) ++ && (debug == NULL || missing_rpm_enlist (debug) == 0)) ++#endif /* HAVE_LIBRPM */ ++ { ++ /* We do not collect and flush these messages as each such message ++ already requires its own separate lines. */ ++ ++ fprintf_unfiltered (gdb_stdlog, ++ _("Missing separate debuginfo for %s\n"), binary); ++ if (debug != NULL) ++ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"), ++#ifdef DNF_DEBUGINFO_INSTALL ++ "dnf" ++#else ++ "yum" ++#endif ++ " --enablerepo='*debug*' install", debug); ++ } + } + + /* See build-id.h. */ +diff --git a/gdb/config.in b/gdb/config.in +index 1d11a97080..edd7028f76 100644 +--- a/gdb/config.in ++++ b/gdb/config.in @@ -33,6 +33,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -291,7 +703,7 @@ Index: gdb-7.11.50.20160630/gdb/config.in /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -261,6 +264,9 @@ +@@ -264,6 +267,9 @@ /* Define if Python 2.7 is being used. */ #undef HAVE_LIBPYTHON2_7 @@ -301,11 +713,11 @@ Index: gdb-7.11.50.20160630/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -Index: gdb-7.11.50.20160630/gdb/configure -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/configure 2016-07-02 23:43:24.085214144 +0200 -+++ gdb-7.11.50.20160630/gdb/configure 2016-07-03 14:37:12.581130811 +0200 -@@ -705,6 +705,11 @@ +diff --git a/gdb/configure b/gdb/configure +index 7b250079de..e314e28ff3 100755 +--- a/gdb/configure ++++ b/gdb/configure +@@ -716,6 +716,11 @@ PKGVERSION HAVE_NATIVE_GCORE_TARGET TARGET_OBS subdirs @@ -317,7 +729,7 @@ Index: gdb-7.11.50.20160630/gdb/configure GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -814,6 +819,7 @@ +@@ -820,6 +825,7 @@ with_gdb_datadir with_relocated_sources with_auto_load_dir with_auto_load_safe_path @@ -325,7 +737,7 @@ Index: gdb-7.11.50.20160630/gdb/configure enable_targets enable_64_bit_bfd enable_gdbcli -@@ -870,6 +876,11 @@ +@@ -878,6 +884,11 @@ CCC CPP MAKEINFO MAKEINFOFLAGS @@ -337,7 +749,7 @@ Index: gdb-7.11.50.20160630/gdb/configure YACC YFLAGS XMKMF' -@@ -1541,6 +1552,8 @@ +@@ -1548,6 +1559,8 @@ Optional Packages: [--with-auto-load-dir] --without-auto-load-safe-path do not restrict auto-loaded files locations @@ -346,7 +758,7 @@ Index: gdb-7.11.50.20160630/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1595,6 +1608,13 @@ +@@ -1605,6 +1618,13 @@ Some influential environment variables: MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS Parameters for MAKEINFO. @@ -360,7 +772,7 @@ Index: gdb-7.11.50.20160630/gdb/configure YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. -@@ -5613,6 +5633,494 @@ +@@ -6486,6 +6506,494 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -855,11 +1267,11 @@ Index: gdb-7.11.50.20160630/gdb/configure subdirs="$subdirs testsuite" -Index: gdb-7.11.50.20160630/gdb/configure.ac -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/configure.ac 2016-07-02 23:43:24.085214144 +0200 -+++ gdb-7.11.50.20160630/gdb/configure.ac 2016-07-03 14:37:12.582130819 +0200 -@@ -177,6 +177,199 @@ +diff --git a/gdb/configure.ac b/gdb/configure.ac +index 8e706b6e27..9de441fe79 100644 +--- a/gdb/configure.ac ++++ b/gdb/configure.ac +@@ -167,6 +167,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path]) @@ -1059,11 +1471,11 @@ Index: gdb-7.11.50.20160630/gdb/configure.ac AC_CONFIG_SUBDIRS(testsuite) # Check whether to support alternative target configurations -Index: gdb-7.11.50.20160630/gdb/corelow.c -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/corelow.c 2016-07-03 14:34:32.022753582 +0200 -+++ gdb-7.11.50.20160630/gdb/corelow.c 2016-07-03 14:37:12.582130819 +0200 -@@ -310,7 +310,7 @@ +diff --git a/gdb/corelow.c b/gdb/corelow.c +index b6e9ddc652..547313c4b5 100644 +--- a/gdb/corelow.c ++++ b/gdb/corelow.c +@@ -309,7 +309,7 @@ build_id_locate_exec (int from_tty) symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; } else @@ -1072,448 +1484,52 @@ Index: gdb-7.11.50.20160630/gdb/corelow.c do_cleanups (back_to); -Index: gdb-7.11.50.20160630/gdb/build-id.c -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/build-id.c 2016-07-03 14:36:50.124938187 +0200 -+++ gdb-7.11.50.20160630/gdb/build-id.c 2016-07-03 14:42:25.171812134 +0200 -@@ -35,6 +35,7 @@ - #include "elf/common.h" - #include "elf-bfd.h" - #include -+#include "elf/external.h" +diff --git a/gdb/event-top.c b/gdb/event-top.c +index 89936965a9..a1866f0c88 100644 +--- a/gdb/event-top.c ++++ b/gdb/event-top.c +@@ -40,6 +40,7 @@ + #include "buffer.h" + #include "ser-event.h" + #include "gdb_select.h" ++#include "symfile.h" - #define BUILD_ID_VERBOSE_NONE 0 - #define BUILD_ID_VERBOSE_FILENAMES 1 -@@ -665,8 +666,366 @@ - return result; - } + /* readline include files. */ + #include "readline/readline.h" +@@ -359,6 +360,8 @@ display_gdb_prompt (const char *new_prompt) + /* Reset the nesting depth used when trace-commands is set. */ + reset_command_nest_depth (); -+#ifdef HAVE_LIBRPM -+ -+#include -+#include -+#include -+#include -+#ifdef DLOPEN_LIBRPM -+#include -+#endif -+ -+/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files -+ and avoid their duplicities during a single inferior run. */ -+ -+static struct htab *missing_rpm_hash; -+ -+/* This MISSING_RPM_LIST tracker is used to collect and print as a single line -+ all the rpms right before the nearest GDB prompt. It gets cleared after -+ each such print (it is questionable if we should clear it after the print). -+ */ -+ -+struct missing_rpm -+ { -+ struct missing_rpm *next; -+ char rpm[1]; -+ }; -+static struct missing_rpm *missing_rpm_list; -+static int missing_rpm_list_entries; -+ -+/* Returns the count of newly added rpms. */ -+ -+static int -+missing_rpm_enlist (const char *filename) -+{ -+ static int rpm_init_done = 0; -+ rpmts ts; -+ rpmdbMatchIterator mi; -+ int count = 0; -+ -+#ifdef DLOPEN_LIBRPM -+ /* Duplicate here the declarations to verify they match. The same sanity -+ check is present also in `configure.ac'. */ -+ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); -+ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg); -+ extern int rpmReadConfigFiles(const char * file, const char * target); -+ static int (*rpmReadConfigFiles_p) (const char * file, const char * target); -+ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); -+ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi); -+ extern Header rpmdbNextIterator(rpmdbMatchIterator mi); -+ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi); -+ extern rpmts rpmtsCreate(void); -+ static rpmts (*rpmtsCreate_p) (void); -+ extern rpmts rpmtsFree(rpmts ts); -+ static rpmts (*rpmtsFree_p) (rpmts ts); -+ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, -+ const void * keyp, size_t keylen); -+ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts, -+ rpmTag rpmtag, -+ const void *keyp, -+ size_t keylen); -+#else /* !DLOPEN_LIBRPM */ -+# define headerFormat_p headerFormat -+# define rpmReadConfigFiles_p rpmReadConfigFiles -+# define rpmdbFreeIterator_p rpmdbFreeIterator -+# define rpmdbNextIterator_p rpmdbNextIterator -+# define rpmtsCreate_p rpmtsCreate -+# define rpmtsFree_p rpmtsFree -+# define rpmtsInitIterator_p rpmtsInitIterator -+#endif /* !DLOPEN_LIBRPM */ -+ -+ gdb_assert (filename != NULL); -+ -+ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0) -+ return 0; -+ -+ if (is_target_filename (filename)) -+ return 0; -+ -+ if (filename[0] != '/') -+ { -+ warning (_("Ignoring non-absolute filename: <%s>"), filename); -+ return 0; -+ } -+ -+ if (!rpm_init_done) -+ { -+ static int init_tried; -+ -+ /* Already failed the initialization before? */ -+ if (init_tried) -+ return 0; -+ init_tried = 1; -+ -+#ifdef DLOPEN_LIBRPM -+ { -+ void *h; -+ -+ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY); -+ if (!h) -+ { -+ warning (_("Unable to open \"%s\" (%s), " -+ "missing debuginfos notifications will not be displayed"), -+ DLOPEN_LIBRPM, dlerror ()); -+ return 0; -+ } -+ -+ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat")) -+ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles")) -+ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator")) -+ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) -+ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) -+ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) -+ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) -+ { -+ warning (_("Opened library \"%s\" is incompatible (%s), " -+ "missing debuginfos notifications will not be displayed"), -+ DLOPEN_LIBRPM, dlerror ()); -+ if (dlclose (h)) -+ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM, -+ dlerror ()); -+ return 0; -+ } -+ } -+#endif /* DLOPEN_LIBRPM */ -+ -+ if (rpmReadConfigFiles_p (NULL, NULL) != 0) -+ { -+ warning (_("Error reading the rpm configuration files")); -+ return 0; -+ } -+ -+ rpm_init_done = 1; -+ } -+ -+ ts = rpmtsCreate_p (); -+ -+ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); -+ if (mi != NULL) -+ { -+ for (;;) -+ { -+ Header h; -+ char *debuginfo, **slot, *s, *s2; -+ errmsg_t err; -+ size_t srcrpmlen = sizeof (".src.rpm") - 1; -+ size_t debuginfolen = sizeof ("-debuginfo") - 1; -+ rpmdbMatchIterator mi_debuginfo; -+ -+ h = rpmdbNextIterator_p (mi); -+ if (h == NULL) -+ break; -+ -+ /* Verify the debuginfo file is not already installed. */ -+ -+ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}", -+ &err); -+ if (!debuginfo) -+ { -+ warning (_("Error querying the rpm file `%s': %s"), filename, -+ err); -+ continue; -+ } -+ /* s = `.src.rpm-debuginfo.%{arch}' */ -+ s = strrchr (debuginfo, '-') - srcrpmlen; -+ s2 = NULL; -+ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0) -+ { -+ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */ -+ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo); -+ } -+ if (s2) -+ { -+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ -+ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo); -+ } -+ if (!s2) -+ { -+ warning (_("Error querying the rpm file `%s': %s"), filename, -+ debuginfo); -+ xfree (debuginfo); -+ continue; -+ } -+ /* s = `.src.rpm-debuginfo.%{arch}' */ -+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ -+ memmove (s2 + debuginfolen, s2, s - s2); -+ memcpy (s2, "-debuginfo", debuginfolen); -+ /* s = `XXXX.%{arch}' */ -+ /* strlen ("XXXX") == srcrpmlen + debuginfolen */ -+ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */ -+ /* strlen ("XX") == srcrpmlen */ -+ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen, -+ strlen (s + srcrpmlen + debuginfolen) + 1); -+ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */ -+ -+ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ -+ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ -+ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); -+ xfree (debuginfo); -+ if (mi_debuginfo) -+ { -+ rpmdbFreeIterator_p (mi_debuginfo); -+ count = 0; -+ break; -+ } -+ -+ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ -+ debuginfo = headerFormat_p (h, -+ "%{name}-%{version}-%{release}.%{arch}", -+ &err); -+ if (!debuginfo) -+ { -+ warning (_("Error querying the rpm file `%s': %s"), filename, -+ err); -+ continue; -+ } -+ -+ /* Base package name for `debuginfo-install'. We do not use the -+ `yum' command directly as the line -+ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH -+ would be more complicated than just: -+ debuginfo-install NAME-VERSION-RELEASE.ARCH -+ Do not supply the rpm base name (derived from .src.rpm name) as -+ debuginfo-install is unable to install the debuginfo package if -+ the base name PKG binary rpm is not installed while for example -+ PKG-libs would be installed (RH Bug 467901). -+ FUTURE: After multiple debuginfo versions simultaneously installed -+ get supported the support for the VERSION-RELEASE tags handling -+ may need an update. */ -+ -+ if (missing_rpm_hash == NULL) -+ { -+ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE -+ should not deallocate the entries. */ -+ -+ missing_rpm_hash = htab_create_alloc (64, htab_hash_string, -+ (int (*) (const void *, const void *)) streq, -+ NULL, xcalloc, xfree); -+ } -+ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT); -+ /* XCALLOC never returns NULL. */ -+ gdb_assert (slot != NULL); -+ if (*slot == NULL) -+ { -+ struct missing_rpm *missing_rpm; -+ -+ *slot = debuginfo; -+ -+ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo)); -+ strcpy (missing_rpm->rpm, debuginfo); -+ missing_rpm->next = missing_rpm_list; -+ missing_rpm_list = missing_rpm; -+ missing_rpm_list_entries++; -+ } -+ else -+ xfree (debuginfo); -+ count++; -+ } -+ -+ rpmdbFreeIterator_p (mi); -+ } -+ -+ rpmtsFree_p (ts); -+ -+ return count; -+} -+ -+static int -+missing_rpm_list_compar (const char *const *ap, const char *const *bp) -+{ -+ return strcoll (*ap, *bp); -+} -+ -+/* It returns a NULL-terminated array of strings needing to be FREEd. It may -+ also return only NULL. */ -+ -+static void -+missing_rpm_list_print (void) -+{ -+ char **array, **array_iter; -+ struct missing_rpm *list_iter; -+ struct cleanup *cleanups; -+ -+ if (missing_rpm_list_entries == 0) -+ return; -+ -+ array = (char **) xmalloc (sizeof (*array) * missing_rpm_list_entries); -+ cleanups = make_cleanup (xfree, array); -+ -+ array_iter = array; -+ for (list_iter = missing_rpm_list; list_iter != NULL; -+ list_iter = list_iter->next) -+ { -+ *array_iter++ = list_iter->rpm; -+ } -+ gdb_assert (array_iter == array + missing_rpm_list_entries); -+ -+ qsort (array, missing_rpm_list_entries, sizeof (*array), -+ (int (*) (const void *, const void *)) missing_rpm_list_compar); -+ -+ printf_unfiltered (_("Missing separate debuginfos, use: %s"), -+#ifdef DNF_DEBUGINFO_INSTALL -+ "dnf " -+#endif -+ "debuginfo-install"); -+ for (array_iter = array; array_iter < array + missing_rpm_list_entries; -+ array_iter++) -+ { -+ putchar_unfiltered (' '); -+ puts_unfiltered (*array_iter); -+ } -+ putchar_unfiltered ('\n'); -+ -+ while (missing_rpm_list != NULL) -+ { -+ list_iter = missing_rpm_list; -+ missing_rpm_list = list_iter->next; -+ xfree (list_iter); -+ } -+ missing_rpm_list_entries = 0; -+ -+ do_cleanups (cleanups); -+} -+ -+static void -+missing_rpm_change (void) -+{ + debug_flush_missing (); + -+ gdb_assert (missing_rpm_list == NULL); -+ if (missing_rpm_hash != NULL) -+ { -+ htab_delete (missing_rpm_hash); -+ missing_rpm_hash = NULL; -+ } -+} -+ -+enum missing_exec -+ { -+ /* Init state. EXEC_BFD also still could be NULL. */ -+ MISSING_EXEC_NOT_TRIED, -+ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */ -+ MISSING_EXEC_NOT_FOUND, -+ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded -+ or separate) or the main executable's RPM is now contained in -+ MISSING_RPM_HASH. */ -+ MISSING_EXEC_ENLISTED -+ }; -+static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED; -+ -+#endif /* HAVE_LIBRPM */ -+ -+void -+debug_flush_missing (void) -+{ -+#ifdef HAVE_LIBRPM -+ missing_rpm_list_print (); -+#endif -+} -+ - /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages -- Try to install the hash file ... -+ yum --enablerepo='*debug*' install ... - avoidance. */ + /* Do not call the python hook on an explicit prompt change as + passed to this function, as this forms a secondary/local prompt, + IE, displayed but not set. */ +@@ -773,7 +776,10 @@ command_line_handler (char *rl) + command_handler (cmd); - struct missing_filepair -@@ -720,11 +1079,17 @@ - /* All their memory came just from missing_filepair_OBSTACK. */ - missing_filepair_hash = NULL; - } -+#ifdef HAVE_LIBRPM -+ missing_exec = MISSING_EXEC_NOT_TRIED; -+#endif - } - - static void - debug_print_executable_changed (void) - { -+#ifdef HAVE_LIBRPM -+ missing_rpm_change (); -+#endif - missing_filepair_change (); - } - -@@ -791,14 +1156,39 @@ - - *slot = missing_filepair; - -- /* We do not collect and flush these messages as each such message -- already requires its own separate lines. */ -+#ifdef HAVE_LIBRPM -+ if (missing_exec == MISSING_EXEC_NOT_TRIED) -+ { -+ char *execfilename; - -- fprintf_unfiltered (gdb_stdlog, -- _("Missing separate debuginfo for %s\n"), binary); -- if (debug != NULL) -- fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"), -- debug); -+ execfilename = get_exec_file (0); -+ if (execfilename != NULL) + if (ui->prompt_state != PROMPTED) +- display_gdb_prompt (0); + { -+ if (missing_rpm_enlist (execfilename) == 0) -+ missing_exec = MISSING_EXEC_NOT_FOUND; -+ else -+ missing_exec = MISSING_EXEC_ENLISTED; ++ debug_flush_missing (); ++ display_gdb_prompt (0); + } -+ } -+ if (missing_exec != MISSING_EXEC_ENLISTED) -+ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0) -+ && (debug == NULL || missing_rpm_enlist (debug) == 0)) -+#endif /* HAVE_LIBRPM */ -+ { -+ /* We do not collect and flush these messages as each such message -+ already requires its own separate lines. */ -+ -+ fprintf_unfiltered (gdb_stdlog, -+ _("Missing separate debuginfo for %s\n"), binary); -+ if (debug != NULL) -+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"), -+#ifdef DNF_DEBUGINFO_INSTALL -+ "dnf" -+#else -+ "yum" -+#endif -+ " --enablerepo='*debug*' install", debug); -+ } + } } - /* See build-id.h. */ +diff --git a/gdb/symfile.h b/gdb/symfile.h +index 45bbe0a229..69eead20d9 100644 +--- a/gdb/symfile.h ++++ b/gdb/symfile.h +@@ -546,6 +546,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data, + /* build-id support. */ + extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); + extern void debug_print_missing (const char *binary, const char *debug); ++extern void debug_flush_missing (void); ++#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file") + + /* From dwarf2read.c */ + +-- +2.14.3 + diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index 08d901e..72a574b 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -1,18 +1,32 @@ +From d27963f81d095648d49c623d5567dc1aa96429e2 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-solib-missing-ids.patch FileName: 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 +--- + gdb/solib-svr4.c | 35 ++++--- + .../gcore-buildid-exec-but-not-solib-lib.c | 21 +++++ + .../gcore-buildid-exec-but-not-solib-main.c | 25 +++++ + .../gdb.base/gcore-buildid-exec-but-not-solib.exp | 105 +++++++++++++++++++++ + 4 files changed, 167 insertions(+), 19 deletions(-) + create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c + create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c + create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp -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 +diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c +index 08788092dc..12207ac6e9 100644 +--- a/gdb/solib-svr4.c ++++ b/gdb/solib-svr4.c +@@ -1387,14 +1387,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, } { @@ -38,11 +52,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 +@@ -1409,23 +1422,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, xfree (name); } else @@ -67,8 +81,69 @@ Index: gdb-7.9.90.20150709/gdb/solib-svr4.c xfree (build_id_filename); xfree (build_id); ---- /dev/null 2016-07-02 20:29:01.679404943 +0200 -+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 2016-07-31 23:04:49.062753722 +0200 +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 +index 0000000000..d74b690c73 +--- /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 . */ ++ ++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 +index 0000000000..46b9dfe161 +--- /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 . */ ++ ++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 +index 0000000000..0c46489f31 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp @@ -0,0 +1,105 @@ +# Copyright 2016 Free Software Foundation, Inc. + @@ -175,55 +250,6 @@ Index: gdb-7.9.90.20150709/gdb/solib-svr4.c + +gdb_test "bt" +gdb_test "info shared" ---- /dev/null 2016-07-02 20:29:01.679404943 +0200 -+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 2016-07-28 21:06:40.977786922 +0200 -@@ -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 . */ -+ -+extern void lib (void); -+ -+int -+main (void) -+{ -+ lib (); -+ return 0; -+} ---- /dev/null 2016-07-02 20:29:01.679404943 +0200 -+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 2016-07-28 21:06:40.977786922 +0200 -@@ -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 . */ -+ -+void -+lib (void) -+{ -+} +-- +2.14.3 + diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 0a65462..460594c 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -1,359 +1,34 @@ +From b38d8630ecce2839b35e18ec8420fce6aacc04e5 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate.patch FileName: gdb-6.6-buildid-locate.patch +;; New locating of the matching binaries from the pure core file (build-id). +;;=push+jan +--- + gdb/build-id.c | 753 +++++++++++++++++++++++- + gdb/build-id.h | 15 +- + gdb/coffread.c | 2 +- + gdb/corelow.c | 67 +++ + gdb/doc/gdb.texinfo | 21 + + gdb/dwarf2read.c | 2 +- + gdb/elfread.c | 7 +- + gdb/objfiles.h | 4 + + gdb/python/py-objfile.c | 4 +- + gdb/solib-svr4.c | 50 +- + gdb/symfile.h | 4 + + gdb/testsuite/gdb.base/corefile.exp | 30 + + gdb/testsuite/gdb.base/new-ui-pending-input.exp | 1 + + gdb/testsuite/lib/gdb.exp | 10 + + gdb/testsuite/lib/mi-support.exp | 10 + + 15 files changed, 940 insertions(+), 40 deletions(-) -Index: gdb-7.99.90.20170420/gdb/corelow.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/corelow.c 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/corelow.c 2017-04-20 23:00:43.358629183 +0200 -@@ -45,6 +45,10 @@ - #include "gdb_bfd.h" - #include "completer.h" - #include "filestuff.h" -+#include "auxv.h" -+#include "elf/common.h" -+#include "gdbcmd.h" -+#include "build-id.h" - - #ifndef O_LARGEFILE - #define O_LARGEFILE 0 -@@ -266,6 +270,54 @@ - inferior_ptid = ptid; /* Yes, make it current. */ - } - -+static int build_id_core_loads = 1; -+ -+static void -+build_id_locate_exec (int from_tty) -+{ -+ CORE_ADDR at_entry; -+ struct bfd_build_id *build_id; -+ char *execfilename, *debug_filename; -+ char *build_id_filename; -+ struct cleanup *back_to; -+ -+ if (exec_bfd != NULL || symfile_objfile != NULL) -+ return; -+ -+ if (target_auxv_search (¤t_target, AT_ENTRY, &at_entry) <= 0) -+ return; -+ -+ build_id = build_id_addr_get (at_entry); -+ if (build_id == NULL) -+ return; -+ back_to = make_cleanup (xfree, build_id); -+ -+ /* SYMFILE_OBJFILE should refer to the main executable (not only to its -+ separate debug info file). gcc44+ keeps .eh_frame only in the main -+ executable without its duplicate .debug_frame in the separate debug info -+ file - such .eh_frame would not be found if SYMFILE_OBJFILE would refer -+ directly to the separate debug info file. */ -+ -+ execfilename = build_id_to_filename (build_id, &build_id_filename); -+ make_cleanup (xfree, build_id_filename); -+ -+ if (execfilename != NULL) -+ { -+ make_cleanup (xfree, execfilename); -+ exec_file_attach (execfilename, from_tty); -+ symbol_file_add_main (execfilename, -+ symfile_add_flag (!from_tty ? 0 : SYMFILE_VERBOSE)); -+ if (symfile_objfile != NULL) -+ symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; -+ } -+ else -+ debug_print_missing (_("the main executable file"), build_id_filename); -+ -+ do_cleanups (back_to); -+ -+ /* No automatic SOLIB_ADD as the libraries would get read twice. */ -+} -+ - /* This routine opens and sets up the core file bfd. */ - - static void -@@ -402,6 +454,14 @@ - switch_to_thread (thread->ptid); - } - -+ /* Find the build_id identifiers. If it gets executed after -+ POST_CREATE_INFERIOR we would clash with asking to discard the already -+ loaded VDSO symbols. If it gets executed before bfd_map_over_sections -+ INFERIOR_PTID is still not set and libthread_db initialization crashes on -+ PID == 0 in ps_pglobal_lookup. */ -+ if (build_id_core_loads != 0) -+ build_id_locate_exec (from_tty); -+ - post_create_inferior (&core_ops, from_tty); - - /* Now go through the target stack looking for threads since there -@@ -1079,4 +1139,11 @@ - init_core_ops (); - - add_target_with_completer (&core_ops, filename_completer); -+ -+ add_setshow_boolean_cmd ("build-id-core-loads", class_files, -+ &build_id_core_loads, _("\ -+Set whether CORE-FILE loads the build-id associated files automatically."), _("\ -+Show whether CORE-FILE loads the build-id associated files automatically."), -+ NULL, NULL, NULL, -+ &setlist, &showlist); - } -Index: gdb-7.99.90.20170420/gdb/doc/gdb.texinfo -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/doc/gdb.texinfo 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/doc/gdb.texinfo 2017-04-20 23:00:43.366629228 +0200 -@@ -18987,6 +18987,27 @@ - - @end table - -+You can also adjust the current verbosity of the @dfn{build id} locating. -+ -+@table @code -+ -+@kindex set build-id-verbose -+@item set build-id-verbose 0 -+No additional messages are printed. -+ -+@item set build-id-verbose 1 -+Missing separate debug filenames are printed. -+ -+@item set build-id-verbose 2 -+Missing separate debug filenames are printed and also all the parsing of the -+binaries to find their @dfn{build id} content is printed. -+ -+@kindex show build-id-verbose -+@item show build-id-verbose -+Show the current verbosity value for the @dfn{build id} content locating. -+ -+@end table -+ - @cindex @code{.gnu_debuglink} sections - @cindex debug link sections - A debug link is a special section of the executable file named -Index: gdb-7.99.90.20170420/gdb/solib-svr4.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/solib-svr4.c 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/solib-svr4.c 2017-04-20 23:00:43.367629234 +0200 -@@ -45,6 +45,7 @@ - #include "auxv.h" - #include "gdb_bfd.h" - #include "probe.h" -+#include "build-id.h" - - static struct link_map_offsets *svr4_fetch_link_map_offsets (void); - static int svr4_have_link_map_offsets (void); -@@ -1420,9 +1421,52 @@ - continue; - } - -- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); -- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; -- strcpy (newobj->so_original_name, newobj->so_name); -+ { -+ struct bfd_build_id *build_id; -+ -+ strncpy (newobj->so_original_name, buffer, 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); -+ if (build_id != NULL) -+ { -+ char *name, *build_id_filename; -+ -+ /* Missing the build-id matching separate debug info file -+ would be handled while SO_NAME gets loaded. */ -+ name = build_id_to_filename (build_id, &build_id_filename); -+ if (name != NULL) -+ { -+ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1); -+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; -+ xfree (name); -+ } -+ else -+ { -+ debug_print_missing (newobj->so_name, build_id_filename); -+ -+ /* In the case the main executable was found according to -+ its build-id (from a core file) prevent loading -+ a different build of a library with accidentally the -+ same SO_NAME. -+ -+ It suppresses bogus backtraces (and prints "??" there -+ instead) if the on-disk files no longer match the -+ running program version. */ -+ -+ if (symfile_objfile != NULL -+ && (symfile_objfile->flags -+ & OBJF_BUILD_ID_CORE_LOADED) != 0) -+ newobj->so_name[0] = 0; -+ } -+ -+ xfree (build_id_filename); -+ xfree (build_id); -+ } -+ } -+ - xfree (buffer); - - /* If this entry has no name, or its name matches the name -Index: gdb-7.99.90.20170420/gdb/elfread.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/elfread.c 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/elfread.c 2017-04-20 23:00:43.367629234 +0200 -@@ -1265,8 +1265,9 @@ - && objfile->separate_debug_objfile == NULL - && objfile->separate_debug_objfile_backlink == NULL) - { -+ gdb::unique_xmalloc_ptr build_id_filename; - gdb::unique_xmalloc_ptr debugfile -- (find_separate_debug_file_by_buildid (objfile)); -+ (find_separate_debug_file_by_buildid (objfile, &build_id_filename)); - - if (debugfile == NULL) - debugfile.reset (find_separate_debug_file_by_debuglink (objfile)); -@@ -1278,6 +1279,10 @@ - symbol_file_add_separate (abfd.get (), debugfile.get (), - symfile_flags, objfile); - } -+ /* Check if any separate debug info has been extracted out. */ -+ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink") -+ != NULL) -+ debug_print_missing (objfile_name (objfile), build_id_filename.get ()); - } - } - -Index: gdb-7.99.90.20170420/gdb/symfile.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/symfile.h 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/symfile.h 2017-04-20 23:00:43.368629240 +0200 -@@ -567,6 +567,10 @@ - void map_symbol_filenames (symbol_filename_ftype *fun, void *data, - int need_fullname); - -+/* build-id support. */ -+extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); -+extern void debug_print_missing (const char *binary, const char *debug); -+ - /* From dwarf2read.c */ - - /* Names for a dwarf2 debugging section. The field NORMAL is the normal -Index: gdb-7.99.90.20170420/gdb/testsuite/lib/gdb.exp -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/testsuite/lib/gdb.exp 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/testsuite/lib/gdb.exp 2017-04-20 23:00:43.369629245 +0200 -@@ -1646,6 +1646,16 @@ - warning "Couldn't set the width to 0." - } - } -+ # Turn off the missing warnings as the testsuite does not expect it. -+ send_gdb "set build-id-verbose 0\n" -+ gdb_expect 10 { -+ -re "$gdb_prompt $" { -+ verbose "Disabled the missing debug infos warnings." 2 -+ } -+ timeout { -+ warning "Could not disable the missing debug infos warnings.." -+ } -+ } - return 0 - } - -Index: gdb-7.99.90.20170420/gdb/testsuite/lib/mi-support.exp -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/testsuite/lib/mi-support.exp 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/testsuite/lib/mi-support.exp 2017-04-20 23:00:43.369629245 +0200 -@@ -309,6 +309,16 @@ - warning "Couldn't set the width to 0." - } - } -+ # Turn off the missing warnings as the testsuite does not expect it. -+ send_gdb "190-gdb-set build-id-verbose 0\n" -+ gdb_expect 10 { -+ -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { -+ verbose "Disabled the missing debug infos warnings." 2 -+ } -+ timeout { -+ warning "Could not disable the missing debug infos warnings.." -+ } -+ } - - if { $separate_inferior_pty } { - mi_create_inferior_pty -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.base/new-ui-pending-input.exp -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2017-04-20 23:00:43.369629245 +0200 -@@ -62,6 +62,7 @@ - set options "" - append options " -iex \"set height 0\"" - append options " -iex \"set width 0\"" -+ append options " -iex \"set build-id-verbose 0\"" - append options " -iex \"new-ui console $extra_tty_name\"" - append options " -ex \"b $bpline\"" - append options " -ex \"run\"" -Index: gdb-7.99.90.20170420/gdb/objfiles.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/objfiles.h 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/objfiles.h 2017-04-20 23:00:43.370629251 +0200 -@@ -444,6 +444,10 @@ - htab_t static_links; - }; - -+/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */ -+ -+#define OBJF_BUILD_ID_CORE_LOADED static_cast(1 << 12) -+ - /* Declarations for functions defined in objfiles.c */ - - extern struct objfile *allocate_objfile (bfd *, const char *name, -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.base/corefile.exp -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/testsuite/gdb.base/corefile.exp 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.base/corefile.exp 2017-04-20 23:00:43.370629251 +0200 -@@ -293,3 +293,33 @@ - pass $test - } - } -+ -+ -+# Test auto-loading of binary files through build-id from the core file. -+set buildid [build_id_debug_filename_get $binfile] -+set wholetest "binfile found by build-id" -+if {$buildid == ""} { -+ untested "$wholetest (binary has no build-id)" -+} else { -+ gdb_exit -+ gdb_start -+ -+ regsub {\.debug$} $buildid {} buildid -+ set debugdir [standard_output_file ${testfile}-debugdir] -+ file delete -force -- $debugdir -+ file mkdir $debugdir/[file dirname $buildid] -+ file copy $binfile $debugdir/$buildid -+ -+ set test "show debug-file-directory" -+ gdb_test_multiple $test $test { -+ -re "The directory where separate debug symbols are searched for is \"(.*)\"\\.\r\n$gdb_prompt $" { -+ set debugdir_orig $expect_out(1,string) -+ pass $test -+ } -+ } -+ gdb_test_no_output "set debug-file-directory $debugdir:$debugdir_orig" "set debug-file-directory" -+ gdb_test "show build-id-core-loads" {Whether CORE-FILE loads the build-id associated files automatically is on\.} -+ gdb_test "core-file $corefile" "\r\nProgram terminated with .*" "core-file without executable" -+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*" -+ pass $wholetest -+} -Index: gdb-7.99.90.20170420/gdb/build-id.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/build-id.c 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/build-id.c 2017-04-20 23:03:00.060399474 +0200 +diff --git a/gdb/build-id.c b/gdb/build-id.c +index 4b2b63ecb4..11d3774d9e 100644 +--- a/gdb/build-id.c ++++ b/gdb/build-id.c @@ -26,11 +26,67 @@ #include "objfiles.h" #include "filenames.h" @@ -423,7 +98,7 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c { if (!bfd_check_format (abfd, bfd_object)) return NULL; -@@ -42,6 +98,348 @@ +@@ -42,6 +98,348 @@ build_id_bfd_get (bfd *abfd) return NULL; } @@ -772,7 +447,7 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c /* See build-id.h. */ int -@@ -50,7 +448,7 @@ +@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) const struct bfd_build_id *found; int retval = 0; @@ -781,7 +456,7 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c if (found == NULL) warning (_("File \"%s\" has no build-id, file skipped"), -@@ -65,23 +463,54 @@ +@@ -65,23 +463,54 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) return retval; } @@ -843,7 +518,7 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will cause "/.build-id/..." lookups. */ -@@ -94,9 +523,12 @@ +@@ -94,9 +523,12 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) size_t debugdir_len = strlen (debugdir); const gdb_byte *data = build_id; size_t size = build_id_len; @@ -857,18 +532,22 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c memcpy (link, debugdir, debugdir_len); s = &link[debugdir_len]; -@@ -110,45 +542,290 @@ +@@ -110,52 +542,299 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) *s++ = '/'; while (size-- > 0) s += sprintf (s, "%02x", (unsigned) *data++); - strcpy (s, ".debug"); -+ for (seqno = 0;; seqno++) -+ { -+ char *s2; + + if (separate_debug_file_debug) + printf_unfiltered (_(" Trying %s\n"), link); - /* lrealpath() is expensive even for the usually non-existent files. */ - if (access (link, F_OK) == 0) - filename = lrealpath (link); ++ for (seqno = 0;; seqno++) ++ { ++ char *s2; ++ + if (seqno) + { + /* There can be multiple build-id symlinks pointing to real files @@ -910,25 +589,17 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c + + if (abfd == NULL) + continue; - -- if (filename == NULL) -- continue; ++ + if (build_id_verify (abfd.get(), build_id_len, build_id)) + break; - -- /* We expect to be silent on the non-existing files. */ -- inner = make_cleanup (xfree, filename); -- abfd = gdb_bfd_open (filename, gnutarget, -1); -- do_cleanups (inner); ++ + abfd.release (); - -- if (abfd == NULL) -- continue; ++ + filename = NULL; + } -- if (build_id_verify (abfd.get(), build_id_len, build_id)) -- break; +- if (filename == NULL) +- continue; + if (filename != NULL) + { + /* LINK_ALL is not used below in this non-NULL FILENAME case. */ @@ -936,22 +607,30 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c + break; + } -- abfd.release (); +- /* We expect to be silent on the non-existing files. */ +- inner = make_cleanup (xfree, filename); +- abfd = gdb_bfd_open (filename, gnutarget, -1); +- do_cleanups (inner); + /* If the symlink has target request to install the target. + BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing. + https://bugzilla.redhat.com/show_bug.cgi?id=981154 */ + link0_resolved = link_resolve (link0, 0); + xfree (link0); -+ + +- if (abfd == NULL) +- continue; + if (link_all == NULL) + link_all = link0_resolved; + else + { + size_t len_orig = strlen (link_all); -+ + +- if (build_id_verify (abfd.get(), build_id_len, build_id)) +- break; + link_all = (char *) xrealloc (link_all, + len_orig + 1 + strlen (link0_resolved) + 1); -+ + +- abfd.release (); + /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with + its possible use as an argument for installation command. */ + link_all[len_orig] = ' '; @@ -1148,6 +827,10 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c + build_id = build_id_bfd_shdr_get (objfile->obfd); if (build_id != NULL) { + if (separate_debug_file_debug) + printf_unfiltered (_("\nLooking for separate debug info (build-id) for " + "%s\n"), objfile_name (objfile)); + + char *build_id_filename_cstr = NULL; gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, - build_id->data)); @@ -1163,10 +846,11 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c + build_id_filename_cstr = NULL; + } + } ++ /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), -@@ -160,3 +837,21 @@ +@@ -167,3 +846,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) } return NULL; } @@ -1188,10 +872,10 @@ Index: gdb-7.99.90.20170420/gdb/build-id.c + + observer_attach_executable_changed (debug_print_executable_changed); +} -Index: gdb-7.99.90.20170420/gdb/build-id.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/build-id.h 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/build-id.h 2017-04-20 23:00:43.371629257 +0200 +diff --git a/gdb/build-id.h b/gdb/build-id.h +index 137d9e18c5..c90472d63a 100644 +--- a/gdb/build-id.h ++++ b/gdb/build-id.h @@ -22,9 +22,10 @@ #include "gdb_bfd.h" @@ -1205,7 +889,7 @@ Index: gdb-7.99.90.20170420/gdb/build-id.h /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value. Otherwise, issue a warning and return false. */ -@@ -38,13 +39,19 @@ +@@ -38,13 +39,19 @@ extern int build_id_verify (bfd *abfd, the caller. */ extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len, @@ -1227,46 +911,11 @@ Index: gdb-7.99.90.20170420/gdb/build-id.h + gdb::unique_xmalloc_ptr *build_id_filename_return); #endif /* BUILD_ID_H */ -Index: gdb-7.99.90.20170420/gdb/dwarf2read.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/dwarf2read.c 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/dwarf2read.c 2017-04-20 23:00:43.375629279 +0200 -@@ -2671,7 +2671,7 @@ - } - - if (dwz_bfd == NULL) -- dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid); -+ dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid, NULL, 1); - - if (dwz_bfd == NULL) - error (_("could not find '.gnu_debugaltlink' file for %s"), -Index: gdb-7.99.90.20170420/gdb/python/py-objfile.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/python/py-objfile.c 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/python/py-objfile.c 2017-04-20 23:00:43.375629279 +0200 -@@ -137,7 +137,7 @@ - - TRY - { -- build_id = build_id_bfd_get (objfile->obfd); -+ build_id = build_id_bfd_shdr_get (objfile->obfd); - } - CATCH (except, RETURN_MASK_ALL) - { -@@ -544,7 +544,7 @@ - /* Don't return separate debug files. */ - if (objfile->separate_debug_objfile_backlink != NULL) - continue; -- obfd_build_id = build_id_bfd_get (objfile->obfd); -+ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd); - if (obfd_build_id == NULL) - continue; - if (objfpy_build_id_matches (obfd_build_id, build_id)) -Index: gdb-7.99.90.20170420/gdb/coffread.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/coffread.c 2017-04-20 23:00:35.415584426 +0200 -+++ gdb-7.99.90.20170420/gdb/coffread.c 2017-04-20 23:00:43.376629285 +0200 -@@ -734,7 +734,7 @@ +diff --git a/gdb/coffread.c b/gdb/coffread.c +index 98f6eec820..f22b2b7df1 100644 +--- a/gdb/coffread.c ++++ b/gdb/coffread.c +@@ -735,7 +735,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) { char *debugfile; @@ -1275,3 +924,386 @@ Index: gdb-7.99.90.20170420/gdb/coffread.c if (debugfile == NULL) debugfile = find_separate_debug_file_by_debuglink (objfile); +diff --git a/gdb/corelow.c b/gdb/corelow.c +index 68009054a0..b6e9ddc652 100644 +--- a/gdb/corelow.c ++++ b/gdb/corelow.c +@@ -45,6 +45,10 @@ + #include "gdb_bfd.h" + #include "completer.h" + #include "filestuff.h" ++#include "auxv.h" ++#include "elf/common.h" ++#include "gdbcmd.h" ++#include "build-id.h" + + #ifndef O_LARGEFILE + #define O_LARGEFILE 0 +@@ -264,6 +268,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) + inferior_ptid = ptid; /* Yes, make it current. */ + } + ++static int build_id_core_loads = 1; ++ ++static void ++build_id_locate_exec (int from_tty) ++{ ++ CORE_ADDR at_entry; ++ struct bfd_build_id *build_id; ++ char *execfilename, *debug_filename; ++ char *build_id_filename; ++ struct cleanup *back_to; ++ ++ if (exec_bfd != NULL || symfile_objfile != NULL) ++ return; ++ ++ if (target_auxv_search (¤t_target, AT_ENTRY, &at_entry) <= 0) ++ return; ++ ++ build_id = build_id_addr_get (at_entry); ++ if (build_id == NULL) ++ return; ++ back_to = make_cleanup (xfree, build_id); ++ ++ /* SYMFILE_OBJFILE should refer to the main executable (not only to its ++ separate debug info file). gcc44+ keeps .eh_frame only in the main ++ executable without its duplicate .debug_frame in the separate debug info ++ file - such .eh_frame would not be found if SYMFILE_OBJFILE would refer ++ directly to the separate debug info file. */ ++ ++ execfilename = build_id_to_filename (build_id, &build_id_filename); ++ make_cleanup (xfree, build_id_filename); ++ ++ if (execfilename != NULL) ++ { ++ make_cleanup (xfree, execfilename); ++ exec_file_attach (execfilename, from_tty); ++ symbol_file_add_main (execfilename, ++ symfile_add_flag (!from_tty ? 0 : SYMFILE_VERBOSE)); ++ if (symfile_objfile != NULL) ++ symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; ++ } ++ else ++ debug_print_missing (_("the main executable file"), build_id_filename); ++ ++ do_cleanups (back_to); ++ ++ /* No automatic SOLIB_ADD as the libraries would get read twice. */ ++} ++ + /* This routine opens and sets up the core file bfd. */ + + static void +@@ -392,6 +444,14 @@ core_open (const char *arg, int from_tty) + switch_to_thread (thread->ptid); + } + ++ /* Find the build_id identifiers. If it gets executed after ++ POST_CREATE_INFERIOR we would clash with asking to discard the already ++ loaded VDSO symbols. If it gets executed before bfd_map_over_sections ++ INFERIOR_PTID is still not set and libthread_db initialization crashes on ++ PID == 0 in ps_pglobal_lookup. */ ++ if (build_id_core_loads != 0) ++ build_id_locate_exec (from_tty); ++ + post_create_inferior (&core_ops, from_tty); + + /* Now go through the target stack looking for threads since there +@@ -1041,4 +1101,11 @@ _initialize_corelow (void) + init_core_ops (); + + add_target_with_completer (&core_ops, filename_completer); ++ ++ add_setshow_boolean_cmd ("build-id-core-loads", class_files, ++ &build_id_core_loads, _("\ ++Set whether CORE-FILE loads the build-id associated files automatically."), _("\ ++Show whether CORE-FILE loads the build-id associated files automatically."), ++ NULL, NULL, NULL, ++ &setlist, &showlist); + } +diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo +index 005fed89c5..d181aeb1c0 100644 +--- a/gdb/doc/gdb.texinfo ++++ b/gdb/doc/gdb.texinfo +@@ -19271,6 +19271,27 @@ information files. + + @end table + ++You can also adjust the current verbosity of the @dfn{build id} locating. ++ ++@table @code ++ ++@kindex set build-id-verbose ++@item set build-id-verbose 0 ++No additional messages are printed. ++ ++@item set build-id-verbose 1 ++Missing separate debug filenames are printed. ++ ++@item set build-id-verbose 2 ++Missing separate debug filenames are printed and also all the parsing of the ++binaries to find their @dfn{build id} content is printed. ++ ++@kindex show build-id-verbose ++@item show build-id-verbose ++Show the current verbosity value for the @dfn{build id} content locating. ++ ++@end table ++ + @cindex @code{.gnu_debuglink} sections + @cindex debug link sections + A debug link is a special section of the executable file named +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index fdd1d9d688..ef624ada33 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -2787,7 +2787,7 @@ dwarf2_get_dwz_file (void) + } + + if (dwz_bfd == NULL) +- dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid); ++ dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid, NULL, 1); + + if (dwz_bfd == NULL) + error (_("could not find '.gnu_debugaltlink' file for %s"), +diff --git a/gdb/elfread.c b/gdb/elfread.c +index b806ca3b40..9784a44b5a 100644 +--- a/gdb/elfread.c ++++ b/gdb/elfread.c +@@ -1248,8 +1248,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) + && objfile->separate_debug_objfile == NULL + && objfile->separate_debug_objfile_backlink == NULL) + { ++ gdb::unique_xmalloc_ptr build_id_filename; + gdb::unique_xmalloc_ptr debugfile +- (find_separate_debug_file_by_buildid (objfile)); ++ (find_separate_debug_file_by_buildid (objfile, &build_id_filename)); + + if (debugfile == NULL) + debugfile.reset (find_separate_debug_file_by_debuglink (objfile)); +@@ -1261,6 +1262,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) + symbol_file_add_separate (abfd.get (), debugfile.get (), + symfile_flags, objfile); + } ++ /* Check if any separate debug info has been extracted out. */ ++ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink") ++ != NULL) ++ debug_print_missing (objfile_name (objfile), build_id_filename.get ()); + } + } + +diff --git a/gdb/objfiles.h b/gdb/objfiles.h +index 62bd45400d..81cf0f542b 100644 +--- a/gdb/objfiles.h ++++ b/gdb/objfiles.h +@@ -470,6 +470,10 @@ struct objfile + htab_t static_links {}; + }; + ++/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */ ++ ++#define OBJF_BUILD_ID_CORE_LOADED static_cast(1 << 12) ++ + /* Declarations for functions defined in objfiles.c */ + + extern struct gdbarch *get_objfile_arch (const struct objfile *); +diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c +index 52f2e1f792..418086fa8b 100644 +--- a/gdb/python/py-objfile.c ++++ b/gdb/python/py-objfile.c +@@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, void *closure) + + TRY + { +- build_id = build_id_bfd_get (objfile->obfd); ++ build_id = build_id_bfd_shdr_get (objfile->obfd); + } + CATCH (except, RETURN_MASK_ALL) + { +@@ -544,7 +544,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) + /* Don't return separate debug files. */ + if (objfile->separate_debug_objfile_backlink != NULL) + continue; +- obfd_build_id = build_id_bfd_get (objfile->obfd); ++ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd); + if (obfd_build_id == NULL) + continue; + if (objfpy_build_id_matches (obfd_build_id, build_id)) +diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c +index 6e834fb5d7..08788092dc 100644 +--- a/gdb/solib-svr4.c ++++ b/gdb/solib-svr4.c +@@ -45,6 +45,7 @@ + #include "auxv.h" + #include "gdb_bfd.h" + #include "probe.h" ++#include "build-id.h" + + static struct link_map_offsets *svr4_fetch_link_map_offsets (void); + static int svr4_have_link_map_offsets (void); +@@ -1385,9 +1386,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, + continue; + } + +- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); +- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; +- strcpy (newobj->so_original_name, newobj->so_name); ++ { ++ struct bfd_build_id *build_id; ++ ++ strncpy (newobj->so_original_name, buffer, 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); ++ if (build_id != NULL) ++ { ++ char *name, *build_id_filename; ++ ++ /* Missing the build-id matching separate debug info file ++ would be handled while SO_NAME gets loaded. */ ++ name = build_id_to_filename (build_id, &build_id_filename); ++ if (name != NULL) ++ { ++ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1); ++ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; ++ xfree (name); ++ } ++ else ++ { ++ debug_print_missing (newobj->so_name, build_id_filename); ++ ++ /* In the case the main executable was found according to ++ its build-id (from a core file) prevent loading ++ a different build of a library with accidentally the ++ same SO_NAME. ++ ++ It suppresses bogus backtraces (and prints "??" there ++ instead) if the on-disk files no longer match the ++ running program version. */ ++ ++ if (symfile_objfile != NULL ++ && (symfile_objfile->flags ++ & OBJF_BUILD_ID_CORE_LOADED) != 0) ++ newobj->so_name[0] = 0; ++ } ++ ++ xfree (build_id_filename); ++ xfree (build_id); ++ } ++ } ++ + xfree (buffer); + + /* If this entry has no name, or its name matches the name +diff --git a/gdb/symfile.h b/gdb/symfile.h +index fa38abf496..45bbe0a229 100644 +--- a/gdb/symfile.h ++++ b/gdb/symfile.h +@@ -543,6 +543,10 @@ void expand_symtabs_matching + void map_symbol_filenames (symbol_filename_ftype *fun, void *data, + int need_fullname); + ++/* build-id support. */ ++extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); ++extern void debug_print_missing (const char *binary, const char *debug); ++ + /* From dwarf2read.c */ + + /* Names for a dwarf2 debugging section. The field NORMAL is the normal +diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp +index 9be4aef7f4..54cb5d0d42 100644 +--- a/gdb/testsuite/gdb.base/corefile.exp ++++ b/gdb/testsuite/gdb.base/corefile.exp +@@ -311,3 +311,33 @@ gdb_test_multiple "core-file $corefile" $test { + pass $test + } + } ++ ++ ++# Test auto-loading of binary files through build-id from the core file. ++set buildid [build_id_debug_filename_get $binfile] ++set wholetest "binfile found by build-id" ++if {$buildid == ""} { ++ untested "$wholetest (binary has no build-id)" ++} else { ++ gdb_exit ++ gdb_start ++ ++ regsub {\.debug$} $buildid {} buildid ++ set debugdir [standard_output_file ${testfile}-debugdir] ++ file delete -force -- $debugdir ++ file mkdir $debugdir/[file dirname $buildid] ++ file copy $binfile $debugdir/$buildid ++ ++ set test "show debug-file-directory" ++ gdb_test_multiple $test $test { ++ -re "The directory where separate debug symbols are searched for is \"(.*)\"\\.\r\n$gdb_prompt $" { ++ set debugdir_orig $expect_out(1,string) ++ pass $test ++ } ++ } ++ gdb_test_no_output "set debug-file-directory $debugdir:$debugdir_orig" "set debug-file-directory" ++ gdb_test "show build-id-core-loads" {Whether CORE-FILE loads the build-id associated files automatically is on\.} ++ gdb_test "core-file $corefile" "\r\nProgram terminated with .*" "core-file without executable" ++ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*" ++ pass $wholetest ++} +diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb.base/new-ui-pending-input.exp +index 37d6e4a670..38706ed341 100644 +--- a/gdb/testsuite/gdb.base/new-ui-pending-input.exp ++++ b/gdb/testsuite/gdb.base/new-ui-pending-input.exp +@@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_input {} { + set options "" + append options " -iex \"set height 0\"" + append options " -iex \"set width 0\"" ++ append options " -iex \"set build-id-verbose 0\"" + append options " -iex \"new-ui console $extra_tty_name\"" + append options " -ex \"b $bpline\"" + append options " -ex \"run\"" +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 018367c161..ff8218bf3d 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -1703,6 +1703,16 @@ proc default_gdb_start { } { + warning "Couldn't set the width to 0." + } + } ++ # Turn off the missing warnings as the testsuite does not expect it. ++ send_gdb "set build-id-verbose 0\n" ++ gdb_expect 10 { ++ -re "$gdb_prompt $" { ++ verbose "Disabled the missing debug infos warnings." 2 ++ } ++ timeout { ++ warning "Could not disable the missing debug infos warnings.." ++ } ++ } + return 0 + } + +diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp +index 5682b7e2e1..60e4f7db55 100644 +--- a/gdb/testsuite/lib/mi-support.exp ++++ b/gdb/testsuite/lib/mi-support.exp +@@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } { + warning "Couldn't set the width to 0." + } + } ++ # Turn off the missing warnings as the testsuite does not expect it. ++ send_gdb "190-gdb-set build-id-verbose 0\n" ++ gdb_expect 10 { ++ -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { ++ verbose "Disabled the missing debug infos warnings." 2 ++ } ++ timeout { ++ warning "Could not disable the missing debug infos warnings.." ++ } ++ } + + if { $separate_inferior_pty } { + mi_create_inferior_pty +-- +2.14.3 + diff --git a/gdb-6.6-bz229517-gcore-without-terminal.patch b/gdb-6.6-bz229517-gcore-without-terminal.patch index c294c41..670bc14 100644 --- a/gdb-6.6-bz229517-gcore-without-terminal.patch +++ b/gdb-6.6-bz229517-gcore-without-terminal.patch @@ -1,9 +1,12 @@ +From 8b7dd4ff0fcfb1161143fb39f36355333674f904 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-bz229517-gcore-without-terminal.patch FileName: 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 @@ -12,12 +15,18 @@ FileName: gdb-6.6-bz229517-gcore-without-terminal.patch 2007-04-22 Jan Kratochvil * gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files. +--- + gdb/testsuite/gdb.base/gcorebg.c | 49 ++++++++++++++++ + gdb/testsuite/gdb.base/gcorebg.exp | 113 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 162 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/gcorebg.c + create mode 100644 gdb/testsuite/gdb.base/gcorebg.exp - -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 +index 0000000000..427ebe9b4f +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcorebg.c @@ -0,0 +1,49 @@ +#include +#include @@ -68,10 +77,11 @@ 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 +index 0000000000..a5471ba5df +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcorebg.exp @@ -0,0 +1,113 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -186,3 +196,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/gcorebg.exp + +set env(PATH) $oldpath +remote_file target delete "./gdb" +-- +2.14.3 + diff --git a/gdb-6.6-bz230000-power6-disassembly-test.patch b/gdb-6.6-bz230000-power6-disassembly-test.patch index dc0c101..7a87c0e 100644 --- a/gdb-6.6-bz230000-power6-disassembly-test.patch +++ b/gdb-6.6-bz230000-power6-disassembly-test.patch @@ -1,21 +1,30 @@ +From 2027832732bb1dba560e17348c8df2fc09b6c698 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-bz230000-power6-disassembly-test.patch FileName: 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. +--- + gdb/testsuite/gdb.arch/powerpc-power6.exp | 54 +++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.arch/powerpc-power6.s | 16 +++++++++ + 2 files changed, 70 insertions(+) + create mode 100644 gdb/testsuite/gdb.arch/powerpc-power6.exp + create mode 100644 gdb/testsuite/gdb.arch/powerpc-power6.s - -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 +index 0000000000..082a4b7802 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/powerpc-power6.exp @@ -0,0 +1,54 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -71,10 +80,11 @@ 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 +index 0000000000..6694b237ab +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/powerpc-power6.s @@ -0,0 +1,16 @@ + .text + .globl func @@ -92,3 +102,6 @@ Index: gdb-7.5.50.20130215/gdb/testsuite/gdb.arch/powerpc-power6.s + .long 0xfc020444 /* ddivq f0,f2,f0 */ + .long 0xec820d04 /* dcmpu cr1,f2,f1 */ + .long 0xfc820504 /* dcmpuq cr1,f2,f0 */ +-- +2.14.3 + diff --git a/gdb-6.6-bz235197-fork-detach-info.patch b/gdb-6.6-bz235197-fork-detach-info.patch index 40baf00..ae672d2 100644 --- a/gdb-6.6-bz235197-fork-detach-info.patch +++ b/gdb-6.6-bz235197-fork-detach-info.patch @@ -1,19 +1,66 @@ +From 57e6b14abc3acde3321011b12a3ba04483119abd Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-bz235197-fork-detach-info.patch FileName: gdb-6.6-bz235197-fork-detach-info.patch +;; Notify user of a child forked process being detached (BZ 235197). +;;=push+jan: This is more about discussion if/what should be printed. 2008-03-01 Jan Kratochvil Port to GDB-6.8pre. Remove the `[' character from the GDB-6.8 default message. +--- + gdb/infrun.c | 2 +- + gdb/testsuite/gdb.base/catch-syscall.exp | 4 +-- + gdb/testsuite/gdb.base/fork-detach.c | 57 ++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.base/fork-detach.exp | 36 ++++++++++++++++++++ + 4 files changed, 96 insertions(+), 3 deletions(-) + create mode 100644 gdb/testsuite/gdb.base/fork-detach.c + create mode 100644 gdb/testsuite/gdb.base/fork-detach.exp -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 +diff --git a/gdb/infrun.c b/gdb/infrun.c +index d7df3c7d57..a8a26fc36d 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -461,7 +461,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + 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)); +diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp +index 595ccbeae0..c9dbc3aba2 100644 +--- a/gdb/testsuite/gdb.base/catch-syscall.exp ++++ b/gdb/testsuite/gdb.base/catch-syscall.exp +@@ -179,7 +179,7 @@ proc check_for_program_end {} { + # Deleting the catchpoints + delete_breakpoints + +- gdb_continue_to_end ++ gdb_continue_to_end "" continue 1 + } + + proc test_catch_syscall_without_args {} { +@@ -250,7 +250,7 @@ proc test_catch_syscall_with_wrong_args {} { + # 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 + } + } + +diff --git a/gdb/testsuite/gdb.base/fork-detach.c b/gdb/testsuite/gdb.base/fork-detach.c +new file mode 100644 +index 0000000000..0ba8f465f3 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/fork-detach.c @@ -0,0 +1,57 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -72,10 +119,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c + } + 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 +diff --git a/gdb/testsuite/gdb.base/fork-detach.exp b/gdb/testsuite/gdb.base/fork-detach.exp +new file mode 100644 +index 0000000000..1f1fcef6c4 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/fork-detach.exp @@ -0,0 +1,36 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -113,38 +161,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp +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 - } - } - +-- +2.14.3 + diff --git a/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch b/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch index 0c342cf..e1cc690 100644 --- a/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +++ b/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch @@ -1,19 +1,29 @@ +From 7413553bcc803fd6c9ac1d647df2e4f87214a699 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch FileName: 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 * gdb.threads/atomic-seq-threaded.c, gdb.threads/atomic-seq-threaded.exp: New files. +--- + gdb/testsuite/gdb.threads/atomic-seq-threaded.c | 171 ++++++++++++++++++++++ + gdb/testsuite/gdb.threads/atomic-seq-threaded.exp | 84 +++++++++++ + 2 files changed, 255 insertions(+) + create mode 100644 gdb/testsuite/gdb.threads/atomic-seq-threaded.c + create mode 100644 gdb/testsuite/gdb.threads/atomic-seq-threaded.exp -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 +index 0000000000..04f998bfa6 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c @@ -0,0 +1,171 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -186,10 +196,11 @@ 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 +index 0000000000..eb49db506e +--- /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 @@ -275,3 +286,6 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp +gdb_test "c" \ + ".*Program exited normally\\..*" \ + "run till program exit" +-- +2.14.3 + diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch index d1bb3a1..78e3cd9 100644 --- a/gdb-6.6-scheduler_locking-step-is-default.patch +++ b/gdb-6.6-scheduler_locking-step-is-default.patch @@ -1,15 +1,25 @@ +From 0bba7203685fef8c5c19b8c9f548611b78138f1a Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-scheduler_locking-step-is-default.patch FileName: gdb-6.6-scheduler_locking-step-is-default.patch +;; Make upstream `set scheduler-locking step' as default. +;;=push+jan: How much is scheduler-locking relevant after non-stop? +--- + gdb/infrun.c | 2 +- + gdb/testsuite/gdb.mi/mi-cli.exp | 2 +- + gdb/testsuite/gdb.mi/mi-console.exp | 3 +++ + gdb/testsuite/gdb.mi/mi-logging.exp | 4 ++-- + gdb/testsuite/gdb.opt/inline-cmds.exp | 2 +- + 5 files changed, 8 insertions(+), 5 deletions(-) -Index: gdb-7.12.50.20170207/gdb/infrun.c -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/infrun.c 2017-02-07 21:07:40.321202448 +0100 -+++ gdb-7.12.50.20170207/gdb/infrun.c 2017-02-07 21:07:42.680220365 +0100 -@@ -2218,7 +2218,7 @@ +diff --git a/gdb/infrun.c b/gdb/infrun.c +index a8a26fc36d..db742f7398 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -2202,7 +2202,7 @@ static const char *const scheduler_enums[] = { schedlock_replay, NULL }; @@ -18,11 +28,11 @@ Index: gdb-7.12.50.20170207/gdb/infrun.c static void show_scheduler_mode (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2017-02-07 21:07:40.322202455 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp 2017-02-07 21:07:42.680220365 +0100 -@@ -199,7 +199,7 @@ +diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp +index 3a9e1c354f..0f398276e9 100644 +--- a/gdb/testsuite/gdb.mi/mi-cli.exp ++++ b/gdb/testsuite/gdb.mi/mi-cli.exp +@@ -199,7 +199,7 @@ mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" \ # Test that the token is output even for CLI commands # Also test that *stopped includes frame information. mi_gdb_test "34 next" \ @@ -31,33 +41,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp "34 next: run" # Test that the new current source line is output to the console -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2017-02-07 21:07:42.681220372 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp 2017-02-07 21:09:36.950088269 +0100 -@@ -53,7 +53,7 @@ - - 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 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.12.50.20170207/gdb/testsuite/gdb.mi/mi-console.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-console.exp 2017-02-07 21:07:40.323202463 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-console.exp 2017-02-07 21:07:42.681220372 +0100 -@@ -60,6 +60,9 @@ +diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp +index ae99c93b8a..378a2749e4 100644 +--- a/gdb/testsuite/gdb.mi/mi-console.exp ++++ b/gdb/testsuite/gdb.mi/mi-console.exp +@@ -60,6 +60,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb mi_run_to_main @@ -67,11 +55,33 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-console.exp # 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 -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2017-02-07 21:07:40.323202463 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp 2017-02-07 21:07:42.681220372 +0100 -@@ -331,7 +331,7 @@ +diff --git a/gdb/testsuite/gdb.mi/mi-logging.exp b/gdb/testsuite/gdb.mi/mi-logging.exp +index 07eaff90d1..ae1a0c1b41 100644 +--- a/gdb/testsuite/gdb.mi/mi-logging.exp ++++ b/gdb/testsuite/gdb.mi/mi-logging.exp +@@ -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" +diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp +index 8bd92c2d59..e69f3d4bbf 100644 +--- a/gdb/testsuite/gdb.opt/inline-cmds.exp ++++ b/gdb/testsuite/gdb.opt/inline-cmds.exp +@@ -331,7 +331,7 @@ proc mi_cli_step {cli_output_re message} { send_gdb "interpreter-exec console \"step\"\n" gdb_expect { @@ -80,3 +90,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp pass $message } timeout { +-- +2.14.3 + diff --git a/gdb-6.6-testsuite-timeouts.patch b/gdb-6.6-testsuite-timeouts.patch index e36bda5..63924c5 100644 --- a/gdb-6.6-testsuite-timeouts.patch +++ b/gdb-6.6-testsuite-timeouts.patch @@ -1,15 +1,22 @@ +From c706d41119b6e8ff8414a56f7528e8ec5317ebe8 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-testsuite-timeouts.patch FileName: gdb-6.6-testsuite-timeouts.patch +;; Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". +;;=fedoratest +--- + gdb/testsuite/gdb.base/annota1.exp | 2 ++ + gdb/testsuite/gdb.base/annota3.exp | 2 ++ + 2 files changed, 4 insertions(+) -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}/ +diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp +index bb3dc2ffae..7080f264fc 100644 +--- 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} @@ -18,11 +25,11 @@ 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 # 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 +index 5a971f0018..0ee5c355db 100644 +--- 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} @@ -31,3 +38,6 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/annota3.exp # The commands we test here produce many lines of output; disable "press # to continue" prompts. gdb_test_no_output "set height 0" +-- +2.14.3 + diff --git a/gdb-6.6-threads-static-test.patch b/gdb-6.6-threads-static-test.patch deleted file mode 100644 index 9de8587..0000000 --- a/gdb-6.6-threads-static-test.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.6-threads-static-test.patch - -FileName: gdb-6.6-threads-static-test.patch - - -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.threads/staticthreads.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.threads/staticthreads.exp 2017-02-26 17:24:48.392316045 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.threads/staticthreads.exp 2017-02-26 17:25:38.649677595 +0100 -@@ -41,6 +41,13 @@ - # 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" { diff --git a/gdb-6.7-charsign-test.patch b/gdb-6.7-charsign-test.patch index 09bd923..d787012 100644 --- a/gdb-6.7-charsign-test.patch +++ b/gdb-6.7-charsign-test.patch @@ -1,9 +1,13 @@ +From 77814ab46a0b77a45a68f2fefe300ebc897f0323 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.7-charsign-test.patch FileName: 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 @@ -15,11 +19,18 @@ 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. +--- + gdb/testsuite/gdb.base/charsign.c | 37 ++++++++++++++++++++++ + gdb/testsuite/gdb.base/charsign.exp | 63 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 100 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/charsign.c + create mode 100644 gdb/testsuite/gdb.base/charsign.exp -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 +index 0000000000..41d175ff9d +--- /dev/null ++++ b/gdb/testsuite/gdb.base/charsign.c @@ -0,0 +1,37 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -58,10 +69,11 @@ 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 +index 0000000000..b5fa580490 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/charsign.exp @@ -0,0 +1,63 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -126,3 +138,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.exp +do_test {} +do_test {-fsigned-char} +do_test {-funsigned-char} +-- +2.14.3 + diff --git a/gdb-6.7-ppc-clobbered-registers-O2-test.patch b/gdb-6.7-ppc-clobbered-registers-O2-test.patch index eb36aa4..24c16a8 100644 --- a/gdb-6.7-ppc-clobbered-registers-O2-test.patch +++ b/gdb-6.7-ppc-clobbered-registers-O2-test.patch @@ -1,9 +1,12 @@ +From e1940695db0e185ff9e6696aecae57510f93d09a Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.7-ppc-clobbered-registers-O2-test.patch FileName: gdb-6.7-ppc-clobbered-registers-O2-test.patch +;; Test PPC hiding of call-volatile parameter register. +;;=fedoratest 2007-11-04 Jan Kratochvil @@ -19,9 +22,18 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html * rs6000-tdep.c (ppc_dwarf2_frame_init_reg): New function. * (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as default dwarf2_frame_set_init_reg function. +--- + .../gdb.arch/ppc-clobbered-registers-O2.c | 21 +++++++++ + .../gdb.arch/ppc-clobbered-registers-O2.exp | 54 ++++++++++++++++++++++ + 2 files changed, 75 insertions(+) + create mode 100644 gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c + create mode 100644 gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp ---- /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 +index 0000000000..698ff8a0b5 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c @@ -0,0 +1,21 @@ + +unsigned * __attribute__((noinline)) @@ -44,8 +56,11 @@ 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 +index 0000000000..c9ebd0e522 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp @@ -0,0 +1,54 @@ +# Copyright 2006 Free Software Foundation, Inc. +# @@ -101,3 +116,6 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html + +gdb_test backtrace ".*operand0=.*operand1=.*" \ + "Check value of call clobbered registers" +-- +2.14.3 + diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch index 904394d..415f59b 100644 --- a/gdb-6.7-testsuite-stable-results.patch +++ b/gdb-6.7-testsuite-stable-results.patch @@ -1,9 +1,12 @@ +From 4fbac2039836532b621a1a0aa686186e0db4a0bc Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.7-testsuite-stable-results.patch FileName: 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: @@ -15,23 +18,24 @@ gdb/testsuite/gdb.base/fileio.exp: * 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. +--- + gdb/testsuite/gdb.base/fileio.c | 22 ++++++++++++++++++++++ + gdb/testsuite/gdb.base/fileio.exp | 13 ++++++------- + 2 files changed, 28 insertions(+), 7 deletions(-) -Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.c -=================================================================== ---- gdb-7.12.orig/gdb/testsuite/gdb.base/fileio.c 2016-08-01 17:50:21.000000000 +0200 -+++ gdb-7.12/gdb/testsuite/gdb.base/fileio.c 2016-10-07 22:49:20.689346914 +0200 -@@ -556,6 +556,28 @@ +diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c +index 7f482a34d3..1caadbae84 100644 +--- a/gdb/testsuite/gdb.base/fileio.c ++++ b/gdb/testsuite/gdb.base/fileio.c +@@ -560,6 +560,28 @@ strerrno (int err) int main () { @@ -60,11 +64,11 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.c /* Don't change the order of the calls. They partly depend on each other */ test_open (); test_write (); -Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.exp -=================================================================== ---- gdb-7.12.orig/gdb/testsuite/gdb.base/fileio.exp 2016-08-01 17:50:21.000000000 +0200 -+++ gdb-7.12/gdb/testsuite/gdb.base/fileio.exp 2016-10-07 22:54:44.680071906 +0200 -@@ -24,9 +24,9 @@ +diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp +index 99afaffb05..92e9743c79 100644 +--- 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]} { @@ -76,7 +80,7 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.exp } if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ -@@ -47,7 +47,8 @@ +@@ -47,7 +47,8 @@ set dir2 [standard_output_file dir2.fileio.test] if {[file exists $dir2] && ![file writable $dir2]} { system "chmod +w $dir2" } @@ -86,7 +90,7 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.exp set oldtimeout $timeout set timeout [expr "$timeout + 60"] -@@ -89,7 +90,7 @@ +@@ -89,7 +90,7 @@ gdb_test continue \ gdb_test "continue" ".*" "" @@ -95,7 +99,7 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.exp gdb_test continue \ "Continuing\\..*open 5:.*EACCES$stop_msg" \ -@@ -276,9 +277,7 @@ +@@ -276,9 +277,7 @@ gdb_test continue \ gdb_exit # Make dir2 writable again so rm -rf of a build tree Just Works. @@ -106,3 +110,6 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.exp set timeout $oldtimeout return 0 +-- +2.14.3 + diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch index 4d77b11..fa88c91 100644 --- a/gdb-6.8-attach-signalled-detach-stopped.patch +++ b/gdb-6.8-attach-signalled-detach-stopped.patch @@ -1,14 +1,24 @@ +From 2e4efbbc861186e5f87c7b2619b171b87a94ca9c Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-attach-signalled-detach-stopped.patch FileName: gdb-6.8-attach-signalled-detach-stopped.patch -Index: gdb-7.99.90.20170420/gdb/infrun.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/infrun.c 2017-04-20 23:19:16.056434309 +0200 -+++ gdb-7.99.90.20170420/gdb/infrun.c 2017-04-20 23:19:22.932480367 +0200 -@@ -620,6 +620,13 @@ +;; [RHEL5,RHEL6] Fix attaching to stopped processes. +;; [RHEL5] Workaround kernel for detaching SIGSTOPped processes (BZ 809382). +;;=fedora +--- + gdb/infrun.c | 7 ++++ + gdb/linux-nat.c | 45 +++++++++++++++++++++ + gdb/testsuite/gdb.threads/attach-stopped.exp | 60 +++++++++++++++++++++++++++- + 3 files changed, 111 insertions(+), 1 deletion(-) + +diff --git a/gdb/infrun.c b/gdb/infrun.c +index c20a02e600..299585f350 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -606,6 +606,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \ target_pid_to_str (process_ptid)); } @@ -22,11 +32,11 @@ Index: gdb-7.99.90.20170420/gdb/infrun.c target_detach (NULL, 0); } -Index: gdb-7.99.90.20170420/gdb/linux-nat.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/linux-nat.c 2017-04-20 23:19:16.058434322 +0200 -+++ gdb-7.99.90.20170420/gdb/linux-nat.c 2017-04-20 23:19:22.933480373 +0200 -@@ -194,6 +194,11 @@ +diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +index 6040c1f129..667e61e701 100644 +--- a/gdb/linux-nat.c ++++ b/gdb/linux-nat.c +@@ -194,6 +194,11 @@ enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN; static struct target_ops *linux_ops; static struct target_ops linux_ops_saved; @@ -38,7 +48,7 @@ Index: gdb-7.99.90.20170420/gdb/linux-nat.c /* The method to call, if any, when a new thread is attached. */ static void (*linux_nat_new_thread) (struct lwp_info *); -@@ -1055,6 +1060,9 @@ +@@ -1065,6 +1070,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled) if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); @@ -48,7 +58,7 @@ Index: gdb-7.99.90.20170420/gdb/linux-nat.c /* The process is definitely stopped. It is in a job control stop, unless the kernel predates the TASK_STOPPED / -@@ -1412,6 +1420,25 @@ +@@ -1420,6 +1428,25 @@ get_detach_signal (struct lwp_info *lp) return gdb_signal_to_host (signo); } @@ -74,7 +84,7 @@ Index: gdb-7.99.90.20170420/gdb/linux-nat.c return 0; } -@@ -1570,6 +1597,10 @@ +@@ -1578,6 +1605,10 @@ linux_nat_detach (struct target_ops *ops, const char *args, int from_tty) detach_one_lwp (main_lwp, &signo); inf_ptrace_detach_success (ops); @@ -85,7 +95,7 @@ Index: gdb-7.99.90.20170420/gdb/linux-nat.c } } -@@ -1830,6 +1861,16 @@ +@@ -1838,6 +1869,16 @@ linux_nat_resume (struct target_ops *ops, return; } @@ -102,7 +112,7 @@ Index: gdb-7.99.90.20170420/gdb/linux-nat.c if (resume_many) iterate_over_lwps (ptid, linux_nat_resume_callback, lp); -@@ -3826,6 +3867,10 @@ +@@ -3830,6 +3871,10 @@ linux_nat_mourn_inferior (struct target_ops *ops) /* Let the arch-specific native code know this process is gone. */ linux_nat_forget_process (pid); @@ -113,11 +123,11 @@ Index: gdb-7.99.90.20170420/gdb/linux-nat.c } /* Convert a native/host siginfo object, into/from the siginfo in the -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.threads/attach-stopped.exp -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2017-04-20 23:19:16.059434329 +0200 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.threads/attach-stopped.exp 2017-04-20 23:19:22.933480373 +0200 -@@ -56,7 +56,65 @@ +diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp +index 15a0352fc7..30dee99893 100644 +--- 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} @@ -184,3 +194,6 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.threads/attach-stopped.exp set test "$threadtype: attach2 to stopped, after setting file" gdb_test_multiple "attach $testpid" "$test" { +-- +2.14.3 + diff --git a/gdb-6.8-bz436037-reg-no-longer-active.patch b/gdb-6.8-bz436037-reg-no-longer-active.patch index f89ddca..1af9717 100644 --- a/gdb-6.8-bz436037-reg-no-longer-active.patch +++ b/gdb-6.8-bz436037-reg-no-longer-active.patch @@ -1,15 +1,21 @@ +From f3c13cbd2010f906554c84063e3a4a138c2be840 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-bz436037-reg-no-longer-active.patch FileName: gdb-6.8-bz436037-reg-no-longer-active.patch +;; Fix register assignments with no GDB stack frames (BZ 436037). +;;=push+jan: This fix is incorrect. +--- + gdb/valops.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) -Index: gdb-7.12.50.20170207/gdb/valops.c -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/valops.c 2017-02-26 17:26:43.839146565 +0100 -+++ gdb-7.12.50.20170207/gdb/valops.c 2017-02-26 17:28:40.840988272 +0100 -@@ -1112,6 +1112,8 @@ +diff --git a/gdb/valops.c b/gdb/valops.c +index 4ecfa9fd96..30623efc6e 100644 +--- a/gdb/valops.c ++++ b/gdb/valops.c +@@ -1103,6 +1103,8 @@ value_assign (struct value *toval, struct value *fromval) struct gdbarch *gdbarch; int value_reg; @@ -18,7 +24,7 @@ Index: gdb-7.12.50.20170207/gdb/valops.c /* Figure out which frame this is in currently. We use VALUE_FRAME_ID for obtaining the value's frame id instead of -@@ -1121,8 +1123,14 @@ +@@ -1112,8 +1114,14 @@ value_assign (struct value *toval, struct value *fromval) frame. */ frame = frame_find_by_id (VALUE_FRAME_ID (toval)); @@ -35,3 +41,6 @@ Index: gdb-7.12.50.20170207/gdb/valops.c if (!frame) error (_("Value being assigned to is no longer active.")); +-- +2.14.3 + diff --git a/gdb-6.8-bz442765-threaded-exec-test.patch b/gdb-6.8-bz442765-threaded-exec-test.patch index af6cb38..8be5ad9 100644 --- a/gdb-6.8-bz442765-threaded-exec-test.patch +++ b/gdb-6.8-bz442765-threaded-exec-test.patch @@ -1,16 +1,23 @@ +From fbc6158c76d809aaafd43a083011f133f6bc64f6 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-bz442765-threaded-exec-test.patch FileName: 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). +--- + gdb/testsuite/gdb.threads/threaded-exec.c | 111 ++++++++++++++++++++++++++-- + gdb/testsuite/gdb.threads/threaded-exec.exp | 13 +++- + 2 files changed, 115 insertions(+), 9 deletions(-) -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 +index 522b24671d..7079317d3a 100644 +--- 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. */ @@ -110,7 +117,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); @@ -147,10 +154,10 @@ 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 +index 77c8a7dc85..8c43162b36 100644 +--- a/gdb/testsuite/gdb.threads/threaded-exec.exp ++++ b/gdb/testsuite/gdb.threads/threaded-exec.exp @@ -20,9 +20,14 @@ set testfile threaded-exec @@ -168,7 +175,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 @@ -180,3 +187,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp gdb_test_multiple {} "Program exited" { -re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" { +-- +2.14.3 + diff --git a/gdb-6.8-bz466901-backtrace-full-prelinked.patch b/gdb-6.8-bz466901-backtrace-full-prelinked.patch index 43378fd..0137a0a 100644 --- a/gdb-6.8-bz466901-backtrace-full-prelinked.patch +++ b/gdb-6.8-bz466901-backtrace-full-prelinked.patch @@ -1,154 +1,28 @@ +From a3c3e2a2711ac0d7ded373597348a1e889b8478a Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-bz466901-backtrace-full-prelinked.patch FileName: 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). +--- + .../gdb.dwarf2/dw2-loclist-prelinked-func.S | 328 +++++++++++++++++++++ + .../gdb.dwarf2/dw2-loclist-prelinked-main.c | 26 ++ + gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp | 102 +++++++ + 3 files changed, 456 insertions(+) + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp -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 . */ -+ -+/* 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 +index 0000000000..442c4d00a1 +--- /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. + @@ -478,3 +352,146 @@ 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 +index 0000000000..57386999ce +--- /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 . */ ++ ++/* 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 +index 0000000000..30d0473336 +--- /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()" +-- +2.14.3 + diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch index e0b8e67..e4d57dd 100644 --- a/gdb-6.8-quit-never-aborts.patch +++ b/gdb-6.8-quit-never-aborts.patch @@ -1,21 +1,31 @@ +From 6f9560ad830dbad83429859b2392831463f0fc96 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-quit-never-aborts.patch FileName: gdb-6.8-quit-never-aborts.patch +;; Make the GDB quit processing non-abortable to cleanup everything properly. +;;=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch . + We may abort the process of detaching threads with multiple SIGINTs - which are being sent during a testcase terminating its child GDB. Some of the threads may not be properly PTRACE_DETACHed which hurts if they should have been detached with SIGSTOP (as they are accidentally left running on the debugger termination). +--- + gdb/defs.h | 4 ++++ + gdb/extension.c | 5 +++++ + gdb/top.c | 6 ++++++ + gdb/utils.c | 7 +++++++ + 4 files changed, 22 insertions(+) -Index: gdb-7.12.50.20170207/gdb/defs.h -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/defs.h 2017-02-26 21:11:35.654350580 +0100 -+++ gdb-7.12.50.20170207/gdb/defs.h 2017-02-26 21:11:52.932473129 +0100 -@@ -169,6 +169,10 @@ +diff --git a/gdb/defs.h b/gdb/defs.h +index 27f3becab0..95395b41a3 100644 +--- a/gdb/defs.h ++++ b/gdb/defs.h +@@ -168,6 +168,10 @@ extern void default_quit_handler (void); /* Flag that function quit should call quit_force. */ extern volatile int sync_quit_force_run; @@ -26,11 +36,11 @@ Index: gdb-7.12.50.20170207/gdb/defs.h extern void quit (void); /* Helper for the QUIT macro. */ -Index: gdb-7.12.50.20170207/gdb/extension.c -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/extension.c 2017-02-26 21:11:35.655350587 +0100 -+++ gdb-7.12.50.20170207/gdb/extension.c 2017-02-26 21:11:52.933473136 +0100 -@@ -830,6 +830,11 @@ +diff --git a/gdb/extension.c b/gdb/extension.c +index 4ffad038c9..d029a2f23d 100644 +--- a/gdb/extension.c ++++ b/gdb/extension.c +@@ -830,6 +830,11 @@ check_quit_flag (void) int i, result = 0; const struct extension_language_defn *extlang; @@ -42,11 +52,11 @@ Index: gdb-7.12.50.20170207/gdb/extension.c ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang) { if (extlang->ops->check_quit_flag != NULL) -Index: gdb-7.12.50.20170207/gdb/top.c -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/top.c 2017-02-26 21:11:35.655350587 +0100 -+++ gdb-7.12.50.20170207/gdb/top.c 2017-02-26 21:11:52.933473136 +0100 -@@ -1619,7 +1619,13 @@ +diff --git a/gdb/top.c b/gdb/top.c +index 8cd7c99346..326c2399b3 100644 +--- a/gdb/top.c ++++ b/gdb/top.c +@@ -1583,7 +1583,13 @@ quit_force (int *exit_arg, int from_tty) qt.args = NULL; qt.from_tty = from_tty; @@ -60,13 +70,13 @@ Index: gdb-7.12.50.20170207/gdb/top.c /* Get out of tfind mode, and kill or detach all inferiors. */ TRY -Index: gdb-7.12.50.20170207/gdb/utils.c -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/utils.c 2017-02-26 21:11:35.657350601 +0100 -+++ gdb-7.12.50.20170207/gdb/utils.c 2017-02-26 21:11:52.934473143 +0100 -@@ -106,6 +106,13 @@ +diff --git a/gdb/utils.c b/gdb/utils.c +index f72ddab992..26a923d8b3 100644 +--- a/gdb/utils.c ++++ b/gdb/utils.c +@@ -107,6 +107,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time; - int job_control; + static int debug_timestamp = 0; +#ifdef NEED_DETACH_SIGSTOP +/* Nonzero means we are already processing the quitting cleanups and we should @@ -78,3 +88,6 @@ Index: gdb-7.12.50.20170207/gdb/utils.c /* 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 international character, and the terminal or window can cope.) */ +-- +2.14.3 + diff --git a/gdb-6.8-sparc64-silence-memcpy-check.patch b/gdb-6.8-sparc64-silence-memcpy-check.patch index 4cc3454..43f3e62 100644 --- a/gdb-6.8-sparc64-silence-memcpy-check.patch +++ b/gdb-6.8-sparc64-silence-memcpy-check.patch @@ -1,15 +1,21 @@ +From 27d2cc537fda7640aa465691cf98b1bfe424f22a Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-sparc64-silence-memcpy-check.patch FileName: gdb-6.8-sparc64-silence-memcpy-check.patch +;; Silence memcpy check which returns false positive (sparc64) +;;=push: But it is just a GCC workaround, look up the existing GCC PR for it. +--- + gdb/sparc-tdep.c | 1 + + 1 file changed, 1 insertion(+) -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 +diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c +index 809cb9ac2e..321c9244a9 100644 +--- a/gdb/sparc-tdep.c ++++ b/gdb/sparc-tdep.c +@@ -1444,6 +1444,7 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache, if (sparc_floating_p (type) || sparc_complex_floating_p (type)) { /* Floating return values. */ @@ -17,3 +23,6 @@ Index: gdb-7.4.50.20111218/gdb/sparc-tdep.c memcpy (buf, valbuf, len); regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf); if (len > 4) +-- +2.14.3 + diff --git a/gdb-6.8-watchpoint-conditionals-test.patch b/gdb-6.8-watchpoint-conditionals-test.patch index b2902e0..6d4da71 100644 --- a/gdb-6.8-watchpoint-conditionals-test.patch +++ b/gdb-6.8-watchpoint-conditionals-test.patch @@ -1,18 +1,65 @@ +From 8dbd757cb144a95f4c676f561b940adfa9cae95a Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-watchpoint-conditionals-test.patch FileName: gdb-6.8-watchpoint-conditionals-test.patch +;; Test the watchpoints conditionals works. +;;=fedoratest For: http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html +--- + gdb/testsuite/gdb.base/watchpoint-cond.c | 31 +++++++++++++++++++++++++ + gdb/testsuite/gdb.base/watchpoint-cond.exp | 37 ++++++++++++++++++++++++++++++ + 2 files changed, 68 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/watchpoint-cond.c + create mode 100644 gdb/testsuite/gdb.base/watchpoint-cond.exp -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 +diff --git a/gdb/testsuite/gdb.base/watchpoint-cond.c b/gdb/testsuite/gdb.base/watchpoint-cond.c +new file mode 100644 +index 0000000000..d4ec581946 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/watchpoint-cond.c +@@ -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 . ++ ++ 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; ++} +diff --git a/gdb/testsuite/gdb.base/watchpoint-cond.exp b/gdb/testsuite/gdb.base/watchpoint-cond.exp +new file mode 100644 +index 0000000000..31d5b602aa +--- /dev/null ++++ b/gdb/testsuite/gdb.base/watchpoint-cond.exp @@ -0,0 +1,37 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -51,39 +98,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-cond.exp + +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 . -+ -+ 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; -+} +-- +2.14.3 + diff --git a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch index d14052f..c6306c8 100644 --- a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +++ b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch @@ -1,14 +1,30 @@ +From e803da95eb585d32f8c8f793445982827255f6df Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch FileName: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +;; Toolchain on sparc is slightly broken and debuginfo files are generated +;; with non 64bit aligned tables/offsets. +;; See for example readelf -S ../Xvnc.debug. +;; +;; As a consenquence calculation of sectp->filepos as used in +;; dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer +;; that cannot be used directly as done with MMAP. +;; Usage will result in a BusError. +;; +;; While we figure out what's wrong in the toolchain and do a full archive +;; rebuild to fix it, we need to be able to use gdb :) +;;=push +--- + gdb/gdb_bfd.c | 6 ++++++ + 1 file changed, 6 insertions(+) -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 +diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c +index cc02740c1a..24155e7c55 100644 +--- a/gdb/gdb_bfd.c ++++ b/gdb/gdb_bfd.c @@ -24,12 +24,14 @@ #include "hashtab.h" #include "filestuff.h" @@ -24,7 +40,7 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c #include "target.h" #include "gdb/fileio.h" #include "inferior.h" -@@ -397,6 +399,7 @@ free_one_bfd_section (bfd *abfd, asectio +@@ -484,6 +486,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore) if (sect != NULL && sect->data != NULL) { @@ -32,15 +48,15 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c #ifdef HAVE_MMAP if (sect->map_addr != NULL) { -@@ -407,6 +410,7 @@ free_one_bfd_section (bfd *abfd, asectio +@@ -493,6 +496,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore) + gdb_assert (res == 0); } else - #endif +#endif + #endif xfree (sect->data); } - } -@@ -558,6 +562,7 @@ gdb_bfd_map_section (asection *sectp, bf +@@ -659,6 +663,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size) if (descriptor->data != NULL) goto done; @@ -48,7 +64,7 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c #ifdef HAVE_MMAP if (!bfd_is_section_compressed (abfd, sectp)) { -@@ -592,6 +597,7 @@ gdb_bfd_map_section (asection *sectp, bf +@@ -693,6 +698,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size) } } #endif /* HAVE_MMAP */ @@ -56,3 +72,6 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c /* Handle compressed sections, or ordinary uncompressed sections in the no-mmap case. */ +-- +2.14.3 + diff --git a/gdb-add-index-chmod.patch b/gdb-add-index-chmod.patch old mode 100755 new mode 100644 index bba85df..e0be641 --- a/gdb-add-index-chmod.patch +++ b/gdb-add-index-chmod.patch @@ -1,13 +1,15 @@ +From 0be595f4694536c348c37b0e720cca06513a001d Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [patch] contrib/gdb-add-index.sh: chmod u+w +Subject: contrib/gdb-add-index.sh: chmod u+w FileName: gdb-add-index-chmod.patch +;; Fix gdb-add-index for 444 *.debug files. +;;=push+jan + http://sourceware.org/ml/gdb-patches/2017-01/msg00110.html - - --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline @@ -26,7 +28,6 @@ that time while in Fedora 25 they are apparently no longer w. OK for check-in? - Jan --AhhlLboLdkugWU4S @@ -37,12 +38,15 @@ gdb/ChangeLog 2017-01-06 Jan Kratochvil * contrib/gdb-add-index.sh: Use chmod u+w for $file. +--- + gdb/contrib/gdb-add-index.sh | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh -index 0cd4ce3..5a190a0 100755 +index c34058d1d6..bbec184b5d 100755 --- a/gdb/contrib/gdb-add-index.sh +++ b/gdb/contrib/gdb-add-index.sh -@@ -38,10 +38,11 @@ fi +@@ -43,10 +43,11 @@ fi dir="${file%/*}" test "$dir" = "$file" && dir="." index="${file}.gdb-index" @@ -56,7 +60,7 @@ index 0cd4ce3..5a190a0 100755 $GDB --batch -nx -iex 'set auto-load no' \ -ex "file $file" -ex "save gdb-index $dir" || { -@@ -58,8 +59,13 @@ $GDB --batch -nx -iex 'set auto-load no' \ +@@ -63,8 +64,13 @@ $GDB --batch -nx -iex 'set auto-load no' \ status=0 if test -f "$index"; then @@ -70,6 +74,6 @@ index 0cd4ce3..5a190a0 100755 status=$? else echo "$myname: No index was created for $file" 1>&2 - ---AhhlLboLdkugWU4S-- +-- +2.14.3 diff --git a/gdb-archer-next-over-throw-cxx-exec.patch b/gdb-archer-next-over-throw-cxx-exec.patch index 589e779..de732d2 100644 --- a/gdb-archer-next-over-throw-cxx-exec.patch +++ b/gdb-archer-next-over-throw-cxx-exec.patch @@ -1,15 +1,27 @@ +From bd1c31ff283786d7593a36a26273b77d2db2c6fe Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer-next-over-throw-cxx-exec.patch FileName: 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 | 25 ++++++++++++++++++++ + gdb/testsuite/gdb.cp/cxxexec.exp | 51 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 76 insertions(+) + create mode 100644 gdb/testsuite/gdb.cp/cxxexec.cc + create mode 100644 gdb/testsuite/gdb.cp/cxxexec.exp ---- ./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 +index 0000000000..48fd63e9d3 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/cxxexec.cc @@ -0,0 +1,25 @@ +/* This test script is part of GDB, the GNU debugger. + @@ -36,8 +48,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 +diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp +new file mode 100644 +index 0000000000..c85dd0129d +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/cxxexec.exp @@ -0,0 +1,51 @@ +# Copyright 2010 Free Software Foundation, Inc. + @@ -90,3 +105,6 @@ http://sourceware.org/ml/archer/2010-q2/msg00031.html + +# `info inferiors' can show on older GDBs. +gdb_test "info threads" "info threads" "program finished" +-- +2.14.3 + diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 8b1ed2e..dd78766 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -1,18 +1,26 @@ +From caca5647414a2506b084ea0fb1fa067d212c9fa0 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer-pie-addons-keep-disabled.patch FileName: gdb-archer-pie-addons-keep-disabled.patch +;;=push+jan: Breakpoints disabling matching should not be based on address. +--- + gdb/breakpoint.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ + gdb/breakpoint.h | 3 +++ + gdb/objfiles.c | 5 +++++ + 3 files changed, 52 insertions(+) -Index: gdb-7.99.90.20170420/gdb/breakpoint.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/breakpoint.c 2017-04-20 23:04:39.627960523 +0200 -+++ gdb-7.99.90.20170420/gdb/breakpoint.c 2017-04-20 23:07:29.854919725 +0200 -@@ -16086,6 +16086,50 @@ +diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c +index d4d095d87e..bc0134db36 100644 +--- a/gdb/breakpoint.c ++++ b/gdb/breakpoint.c +@@ -15607,6 +15607,50 @@ initialize_breakpoint_ops (void) + static struct cmd_list_element *enablebreaklist = NULL; - void ++void +breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta) +{ + struct bp_location *bl, **blp_tmp; @@ -56,27 +64,28 @@ Index: gdb-7.99.90.20170420/gdb/breakpoint.c + bp_locations_compare); +} + -+void + void _initialize_breakpoint (void) { - struct cmd_list_element *c; -Index: gdb-7.99.90.20170420/gdb/breakpoint.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/breakpoint.h 2017-04-20 23:04:39.627960523 +0200 -+++ gdb-7.99.90.20170420/gdb/breakpoint.h 2017-04-20 23:04:48.331009563 +0200 -@@ -1646,4 +1646,7 @@ +diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h +index 6406a1d32b..eed2c968f2 100644 +--- a/gdb/breakpoint.h ++++ b/gdb/breakpoint.h +@@ -1656,6 +1656,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); + - #endif /* !defined (BREAKPOINT_H) */ -Index: gdb-7.99.90.20170420/gdb/objfiles.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/objfiles.c 2017-04-20 23:04:39.627960523 +0200 -+++ gdb-7.99.90.20170420/gdb/objfiles.c 2017-04-20 23:04:48.332009569 +0200 -@@ -909,6 +909,11 @@ + /* Print the specified breakpoint. */ + extern void print_breakpoint (breakpoint *bp); + +diff --git a/gdb/objfiles.c b/gdb/objfiles.c +index edde399802..1d24fa95ba 100644 +--- a/gdb/objfiles.c ++++ b/gdb/objfiles.c +@@ -879,6 +879,11 @@ objfile_relocate1 (struct objfile *objfile, obj_section_addr (s)); } @@ -88,3 +97,6 @@ Index: gdb-7.99.90.20170420/gdb/objfiles.c /* Data changed. */ return 1; } +-- +2.14.3 + diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch index 3f6aa3a..b67ecd8 100644 --- a/gdb-archer-pie-addons.patch +++ b/gdb-archer-pie-addons.patch @@ -1,15 +1,21 @@ +From 5756a6d385cfb451b752c6a77252f2befd43493f Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer-pie-addons.patch FileName: gdb-archer-pie-addons.patch +;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch. +--- + gdb/gdbtypes.h | 5 +++++ + gdb/value.c | 3 ++- + 2 files changed, 7 insertions(+), 1 deletion(-) -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 +diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h +index e26a09b456..d92ffc228b 100644 +--- a/gdb/gdbtypes.h ++++ b/gdb/gdbtypes.h +@@ -440,6 +440,7 @@ enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /**< bitpos */ FIELD_LOC_KIND_ENUMVAL, /**< enumval */ @@ -17,7 +23,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 +@@ -491,6 +492,7 @@ union field_location field. Otherwise, physname is the mangled label of the static field. */ @@ -25,7 +31,7 @@ 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 +@@ -1332,6 +1334,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #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) @@ -33,7 +39,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h #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 +@@ -1343,6 +1346,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -41,7 +47,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h #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 +@@ -1359,6 +1363,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #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)) @@ -49,11 +55,11 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h #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/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 +index 3e0ca25fa7..a61f728550 100644 +--- a/gdb/value.c ++++ b/gdb/value.c +@@ -2966,7 +2966,8 @@ value_static_field (struct type *type, int fieldno) { case FIELD_LOC_KIND_PHYSADDR: retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), @@ -63,3 +69,6 @@ Index: gdb-7.9.50.20150520/gdb/value.c break; case FIELD_LOC_KIND_PHYSNAME: { +-- +2.14.3 + diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch index 5ef0639..a260ab5 100644 --- a/gdb-archer-vla-tests.patch +++ b/gdb-archer-vla-tests.patch @@ -1,14 +1,106 @@ +From d4725aa3b3cec43052702127ca7ccdd3f380add7 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer-vla-tests.patch FileName: gdb-archer-vla-tests.patch -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.ada/packed_array.exp 2017-02-26 19:15:28.552824751 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp 2017-02-26 19:15:36.597882316 +0100 -@@ -56,5 +56,11 @@ +;;=fedoratest +--- + gdb/testsuite/gdb.ada/packed_array.exp | 6 + + gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S | 358 ++++++++++++++++ + gdb/testsuite/gdb.arch/x86_64-vla-pointer.c | 45 ++ + gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp | 65 +++ + gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S | 455 +++++++++++++++++++++ + gdb/testsuite/gdb.arch/x86_64-vla-typedef.c | 45 ++ + gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp | 64 +++ + gdb/testsuite/gdb.base/arrayidx.c | 7 + + gdb/testsuite/gdb.base/arrayidx.exp | 10 +- + .../gdb.base/internal-var-field-address.c | 20 + + .../gdb.base/internal-var-field-address.exp | 26 ++ + gdb/testsuite/gdb.base/vla-frame.c | 31 ++ + gdb/testsuite/gdb.base/vla-frame.exp | 38 ++ + gdb/testsuite/gdb.base/vla-overflow.c | 30 ++ + gdb/testsuite/gdb.base/vla-overflow.exp | 109 +++++ + gdb/testsuite/gdb.base/vla.c | 55 +++ + gdb/testsuite/gdb.base/vla.exp | 62 +++ + gdb/testsuite/gdb.cp/gdb9593.cc | 180 ++++++++ + gdb/testsuite/gdb.cp/gdb9593.exp | 182 +++++++++ + gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S | 246 +++++++++++ + gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp | 66 +++ + gdb/testsuite/gdb.dwarf2/dw2-stripped.c | 42 ++ + gdb/testsuite/gdb.dwarf2/dw2-stripped.exp | 79 ++++ + .../gdb.dwarf2/dw2-struct-member-data-location.S | 83 ++++ + .../gdb.dwarf2/dw2-struct-member-data-location.exp | 37 ++ + gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S | 121 ++++++ + gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp | 39 ++ + gdb/testsuite/gdb.fortran/dwarf-stride.exp | 42 ++ + gdb/testsuite/gdb.fortran/dwarf-stride.f90 | 40 ++ + gdb/testsuite/gdb.fortran/dynamic.exp | 154 +++++++ + gdb/testsuite/gdb.fortran/dynamic.f90 | 98 +++++ + gdb/testsuite/gdb.fortran/string.exp | 59 +++ + gdb/testsuite/gdb.fortran/string.f90 | 37 ++ + gdb/testsuite/gdb.fortran/subrange.exp | 72 ++++ + gdb/testsuite/gdb.fortran/subrange.f90 | 28 ++ + gdb/testsuite/gdb.mi/mi2-var-stale-type.c | 26 ++ + gdb/testsuite/gdb.mi/mi2-var-stale-type.exp | 57 +++ + gdb/testsuite/gdb.opt/array-from-register-func.c | 22 + + gdb/testsuite/gdb.opt/array-from-register.c | 28 ++ + gdb/testsuite/gdb.opt/array-from-register.exp | 33 ++ + gdb/testsuite/gdb.opt/fortran-string.exp | 39 ++ + gdb/testsuite/gdb.opt/fortran-string.f90 | 28 ++ + gdb/testsuite/gdb.pascal/arrays.exp | 104 +++++ + gdb/testsuite/gdb.pascal/arrays.pas | 82 ++++ + gdb/testsuite/lib/gdb.exp | 5 + + gdb/testsuite/lib/pascal.exp | 17 + + 46 files changed, 3471 insertions(+), 1 deletion(-) + create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S + create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer.c + create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp + create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S + create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef.c + create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp + create mode 100644 gdb/testsuite/gdb.base/internal-var-field-address.c + create mode 100644 gdb/testsuite/gdb.base/internal-var-field-address.exp + create mode 100644 gdb/testsuite/gdb.base/vla-frame.c + create mode 100644 gdb/testsuite/gdb.base/vla-frame.exp + create mode 100644 gdb/testsuite/gdb.base/vla-overflow.c + create mode 100644 gdb/testsuite/gdb.base/vla-overflow.exp + create mode 100644 gdb/testsuite/gdb.base/vla.c + create mode 100644 gdb/testsuite/gdb.base/vla.exp + create mode 100644 gdb/testsuite/gdb.cp/gdb9593.cc + create mode 100644 gdb/testsuite/gdb.cp/gdb9593.exp + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-stripped.c + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-stripped.exp + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp + create mode 100644 gdb/testsuite/gdb.fortran/dwarf-stride.exp + create mode 100644 gdb/testsuite/gdb.fortran/dwarf-stride.f90 + create mode 100644 gdb/testsuite/gdb.fortran/dynamic.exp + create mode 100644 gdb/testsuite/gdb.fortran/dynamic.f90 + create mode 100644 gdb/testsuite/gdb.fortran/string.exp + create mode 100644 gdb/testsuite/gdb.fortran/string.f90 + create mode 100644 gdb/testsuite/gdb.fortran/subrange.exp + create mode 100644 gdb/testsuite/gdb.fortran/subrange.f90 + create mode 100644 gdb/testsuite/gdb.mi/mi2-var-stale-type.c + create mode 100644 gdb/testsuite/gdb.mi/mi2-var-stale-type.exp + create mode 100644 gdb/testsuite/gdb.opt/array-from-register-func.c + create mode 100644 gdb/testsuite/gdb.opt/array-from-register.c + create mode 100644 gdb/testsuite/gdb.opt/array-from-register.exp + create mode 100644 gdb/testsuite/gdb.opt/fortran-string.exp + create mode 100644 gdb/testsuite/gdb.opt/fortran-string.f90 + create mode 100644 gdb/testsuite/gdb.pascal/arrays.exp + create mode 100644 gdb/testsuite/gdb.pascal/arrays.pas + +diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp +index 3222a95faa..8dafb65cf9 100644 +--- a/gdb/testsuite/gdb.ada/packed_array.exp ++++ b/gdb/testsuite/gdb.ada/packed_array.exp +@@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" { # are. Observed with (FSF GNU Ada 4.5.3 20110124). xfail $test } @@ -20,10 +112,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp + } } -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S 2017-02-26 19:15:36.598882323 +0100 +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S +new file mode 100644 +index 0000000000..3a983e6b22 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S @@ -0,0 +1,358 @@ + .file "x86_64-vla-pointer.c" + .text @@ -383,10 +476,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S + .string "array" + .ident "GCC: (GNU) 6.2.1 20160916 (Red Hat 6.2.1-2)" + .section .note.GNU-stack,"",@progbits -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c 2017-02-26 19:15:36.598882323 +0100 +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c +new file mode 100644 +index 0000000000..98ee43bbf2 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c @@ -0,0 +1,45 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -433,10 +527,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c +} + +#endif -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp 2017-02-26 19:15:36.598882323 +0100 +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp +new file mode 100644 +index 0000000000..3e2e64a6ab +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp @@ -0,0 +1,65 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -503,10 +598,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp +gdb_test "whatis array" "type = array_t" "second: whatis array" +gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "second: whatis array_t" +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2017-02-26 19:15:36.598882323 +0100 +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S +new file mode 100644 +index 0000000000..66f7a399bf +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S @@ -0,0 +1,455 @@ + .file "x86_64-vla-typedef.c" + .section .debug_abbrev,"",@progbits @@ -963,10 +1059,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S + .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)" + .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)" + .section .note.GNU-stack,"",@progbits -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2017-02-26 19:15:36.599882330 +0100 +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +new file mode 100644 +index 0000000000..40099e9d39 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c @@ -0,0 +1,45 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1013,10 +1110,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +} + +#endif -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2017-02-26 19:15:36.599882330 +0100 +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +new file mode 100644 +index 0000000000..4ef6214629 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp @@ -0,0 +1,64 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -1082,10 +1180,10 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +gdb_test "whatis array" "type = array_t" "second: whatis array" + +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.base/arrayidx.c 2017-02-26 19:15:28.555824772 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c 2017-02-26 19:15:36.599882330 +0100 +diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c +index 511b86b728..e111479bb3 100644 +--- a/gdb/testsuite/gdb.base/arrayidx.c ++++ b/gdb/testsuite/gdb.base/arrayidx.c @@ -17,6 +17,13 @@ int array[] = {1, 2, 3, 4}; @@ -1100,11 +1198,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c int main (void) { -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.base/arrayidx.exp 2017-02-26 19:15:28.555824772 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp 2017-02-26 19:15:36.599882330 +0100 -@@ -49,4 +49,12 @@ +diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp +index c2d4fd958d..69ed450ae3 100644 +--- a/gdb/testsuite/gdb.base/arrayidx.exp ++++ b/gdb/testsuite/gdb.base/arrayidx.exp +@@ -49,4 +49,12 @@ gdb_test "print array" \ "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \ "print array with array-indexes on" @@ -1118,10 +1216,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp + unsupported "$test (no GCC)" + } +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c 2017-02-26 19:15:36.599882330 +0100 +diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.c b/gdb/testsuite/gdb.base/internal-var-field-address.c +new file mode 100644 +index 0000000000..eeb7b8501c +--- /dev/null ++++ b/gdb/testsuite/gdb.base/internal-var-field-address.c @@ -0,0 +1,20 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1143,10 +1242,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c +struct { + int field; +} staticstruct = { 1 }; -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.exp 2017-02-26 19:15:36.600882337 +0100 +diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.exp b/gdb/testsuite/gdb.base/internal-var-field-address.exp +new file mode 100644 +index 0000000000..33c9e94eee +--- /dev/null ++++ b/gdb/testsuite/gdb.base/internal-var-field-address.exp @@ -0,0 +1,26 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -1174,10 +1274,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.ex + +gdb_test {set $varstruct = staticstruct} +gdb_test {p $varstruct.field} " = 1" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c 2017-02-26 19:15:36.600882337 +0100 +diff --git a/gdb/testsuite/gdb.base/vla-frame.c b/gdb/testsuite/gdb.base/vla-frame.c +new file mode 100644 +index 0000000000..5750f68b3d +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla-frame.c @@ -0,0 +1,31 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1210,10 +1311,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c + f (s); + return 0; +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp 2017-02-26 19:15:36.600882337 +0100 +diff --git a/gdb/testsuite/gdb.base/vla-frame.exp b/gdb/testsuite/gdb.base/vla-frame.exp +new file mode 100644 +index 0000000000..47736c7625 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla-frame.exp @@ -0,0 +1,38 @@ +# Copyright 2011 Free Software Foundation, Inc. +# @@ -1253,10 +1355,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp +} + +gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c 2017-02-26 19:15:36.600882337 +0100 +diff --git a/gdb/testsuite/gdb.base/vla-overflow.c b/gdb/testsuite/gdb.base/vla-overflow.c +new file mode 100644 +index 0000000000..c5d5ee0bb9 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla-overflow.c @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1288,10 +1391,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c + + return 0; +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp 2017-02-26 19:15:36.600882337 +0100 +diff --git a/gdb/testsuite/gdb.base/vla-overflow.exp b/gdb/testsuite/gdb.base/vla-overflow.exp +new file mode 100644 +index 0000000000..43a5825979 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla-overflow.exp @@ -0,0 +1,109 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -1402,10 +1506,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp +gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()" + +verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c 2017-02-26 19:15:36.600882337 +0100 +diff --git a/gdb/testsuite/gdb.base/vla.c b/gdb/testsuite/gdb.base/vla.c +new file mode 100644 +index 0000000000..e1f3ed1780 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla.c @@ -0,0 +1,55 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1462,10 +1567,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c + foo (78); + return 0; +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp 2017-02-26 19:15:36.600882337 +0100 +diff --git a/gdb/testsuite/gdb.base/vla.exp b/gdb/testsuite/gdb.base/vla.exp +new file mode 100644 +index 0000000000..71fe637272 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla.exp @@ -0,0 +1,62 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -1529,10 +1635,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp +gdb_test "p temp1" " = '1' " "second: print temp1" +gdb_test "p temp2" " = '2' " "second: print temp2" +gdb_test "p temp3" " = '3' " "second: print temp3" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc 2017-02-26 19:15:36.601882344 +0100 +diff --git a/gdb/testsuite/gdb.cp/gdb9593.cc b/gdb/testsuite/gdb.cp/gdb9593.cc +new file mode 100644 +index 0000000000..783c9622a8 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/gdb9593.cc @@ -0,0 +1,180 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1714,10 +1821,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc + } +} + -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp 2017-02-26 19:15:36.601882344 +0100 +diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/gdb9593.exp +new file mode 100644 +index 0000000000..ef40424402 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/gdb9593.exp @@ -0,0 +1,182 @@ +# Copyright 2008, 2009 Free Software Foundation, Inc. + @@ -1901,10 +2009,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp +gdb_test "advance $line" \ + ".*catch (...).*" \ + "advance-over-throw" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2017-02-26 19:15:36.601882344 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S +new file mode 100644 +index 0000000000..aac3baad8a +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S @@ -0,0 +1,246 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2152,10 +2261,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S + .string "char" +.Luint_str: + .string "unsigned int" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2017-02-26 19:15:36.602882352 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp +new file mode 100644 +index 0000000000..39e69b470f +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp @@ -0,0 +1,66 @@ +# Copyright 2010 Free Software Foundation, Inc. + @@ -2223,10 +2333,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp + +# The register contains unpredictable value - the array size. +gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2017-02-26 19:15:36.602882352 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c +new file mode 100644 +index 0000000000..1f02d90eeb +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c @@ -0,0 +1,42 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2270,10 +2381,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c + func1 (1, 2); + return 0; +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2017-02-26 19:15:36.602882352 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +new file mode 100644 +index 0000000000..9336e03157 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp @@ -0,0 +1,79 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -2354,10 +2466,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +gdb_test "step" \ + "func.* \\(.*\\) at .*" \ + "step" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2017-02-26 19:15:36.602882352 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S +new file mode 100644 +index 0000000000..5fcdd84986 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S @@ -0,0 +1,83 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2442,10 +2555,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-loca + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2017-02-26 19:15:36.602882352 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp +new file mode 100644 +index 0000000000..bc35209fe5 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp @@ -0,0 +1,37 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -2484,10 +2598,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-loca +clean_restart $binfile + +gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2017-02-26 19:15:36.602882352 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S +new file mode 100644 +index 0000000000..9dbbf3c3e1 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S @@ -0,0 +1,121 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2610,10 +2725,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S + .byte 0x0 /* Terminator */ + + .byte 0x0 /* Terminator */ -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2017-02-26 19:15:36.603882359 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp +new file mode 100644 +index 0000000000..cec673cd39 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp @@ -0,0 +1,39 @@ +# Copyright 2012 Free Software Foundation, Inc. + @@ -2654,10 +2770,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp + +gdb_test "ptype notype_string" {type = char \[129\]} +gdb_test "p notype_string" " = 'x' " -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2017-02-26 19:15:36.603882359 +0100 +diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.exp b/gdb/testsuite/gdb.fortran/dwarf-stride.exp +new file mode 100644 +index 0000000000..d7b8bea8db +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dwarf-stride.exp @@ -0,0 +1,42 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -2701,10 +2818,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp +gdb_continue_to_breakpoint "break-here" ".*break-here.*" +gdb_test "p c40pt(1)" " = '0-hello.*" +gdb_test "p c40pt(2)" " = '1-hello.*" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2017-02-26 19:15:36.603882359 +0100 +diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.f90 b/gdb/testsuite/gdb.fortran/dwarf-stride.f90 +new file mode 100644 +index 0000000000..e492b3af42 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dwarf-stride.f90 @@ -0,0 +1,40 @@ +! Copyright 2009 Free Software Foundation, Inc. +! @@ -2746,10 +2864,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90 + print *, c40pt ! break-here + +end program repro -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp 2017-02-26 19:15:36.603882359 +0100 +diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp +new file mode 100644 +index 0000000000..37d435f799 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic.exp @@ -0,0 +1,154 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -2905,10 +3024,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp +gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9" +# maps to foo::vary(1,3) +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90 2017-02-26 19:15:36.603882359 +0100 +diff --git a/gdb/testsuite/gdb.fortran/dynamic.f90 b/gdb/testsuite/gdb.fortran/dynamic.f90 +new file mode 100644 +index 0000000000..0f43564378 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic.f90 @@ -0,0 +1,98 @@ +! Copyright 2007 Free Software Foundation, Inc. +! @@ -3008,10 +3128,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90 + if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort + if (x (3, 1) .ne. 10) call abort +end -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp 2017-02-26 19:15:36.604882366 +0100 +diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp +new file mode 100644 +index 0000000000..1b7c0dbf73 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/string.exp @@ -0,0 +1,59 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -3072,10 +3193,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp +gdb_continue_to_breakpoint "var-finish" +gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set" +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90 2017-02-26 19:15:36.604882366 +0100 +diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90 +new file mode 100644 +index 0000000000..226dc5d0ff +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/string.f90 @@ -0,0 +1,37 @@ +! Copyright 2008 Free Software Foundation, Inc. +! @@ -3114,10 +3236,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90 + h = 'h' + call foo (g, h) +end -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp 2017-02-26 19:15:36.604882366 +0100 +diff --git a/gdb/testsuite/gdb.fortran/subrange.exp b/gdb/testsuite/gdb.fortran/subrange.exp +new file mode 100644 +index 0000000000..c121ab9751 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/subrange.exp @@ -0,0 +1,72 @@ +# Copyright 2011 Free Software Foundation, Inc. + @@ -3191,10 +3314,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp +gdb_unload +setup_kfail "*-*-*" "vlaregression/9999" +gdb_test {p $a (3, 2:2)} { = \(23\)} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90 2017-02-26 19:15:36.604882366 +0100 +diff --git a/gdb/testsuite/gdb.fortran/subrange.f90 b/gdb/testsuite/gdb.fortran/subrange.f90 +new file mode 100644 +index 0000000000..4747ea9746 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/subrange.f90 @@ -0,0 +1,28 @@ +! Copyright 2011 Free Software Foundation, Inc. +! @@ -3224,10 +3348,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90 + ptr => a + write (*,*) a ! break-static +end -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2017-02-26 19:15:36.604882366 +0100 +diff --git a/gdb/testsuite/gdb.mi/mi2-var-stale-type.c b/gdb/testsuite/gdb.mi/mi2-var-stale-type.c +new file mode 100644 +index 0000000000..ebced3c042 +--- /dev/null ++++ b/gdb/testsuite/gdb.mi/mi2-var-stale-type.c @@ -0,0 +1,26 @@ +/* Copyright 2011 Free Software Foundation, Inc. + @@ -3255,10 +3380,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c + + return 0; +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2017-02-26 19:15:36.604882366 +0100 +diff --git a/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp b/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp +new file mode 100644 +index 0000000000..88326c0390 +--- /dev/null ++++ b/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp @@ -0,0 +1,57 @@ +# Copyright 2011 Free Software Foundation, Inc. +# @@ -3317,10 +3443,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp +mi_create_varobj "vla" "vla" "create local variable vla" + +mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c 2017-02-26 19:15:36.604882366 +0100 +diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c +new file mode 100644 +index 0000000000..729f457c82 +--- /dev/null ++++ b/gdb/testsuite/gdb.opt/array-from-register-func.c @@ -0,0 +1,22 @@ +/* This file is part of GDB, the GNU debugger. + @@ -3344,10 +3471,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c +{ + return arr[0]; +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c 2017-02-26 19:15:36.605882373 +0100 +diff --git a/gdb/testsuite/gdb.opt/array-from-register.c b/gdb/testsuite/gdb.opt/array-from-register.c +new file mode 100644 +index 0000000000..3090e7e631 +--- /dev/null ++++ b/gdb/testsuite/gdb.opt/array-from-register.c @@ -0,0 +1,28 @@ +/* This file is part of GDB, the GNU debugger. + @@ -3377,10 +3505,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c + + return 0; +} -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp 2017-02-26 19:15:36.605882373 +0100 +diff --git a/gdb/testsuite/gdb.opt/array-from-register.exp b/gdb/testsuite/gdb.opt/array-from-register.exp +new file mode 100644 +index 0000000000..f2de718bc3 +--- /dev/null ++++ b/gdb/testsuite/gdb.opt/array-from-register.exp @@ -0,0 +1,33 @@ +# Copyright 2009 Free Software Foundation, Inc. +# @@ -3415,10 +3544,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp +# Seen regression: +# Address requested for identifier "arr" which is in register $rdi +gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp 2017-02-26 19:15:36.605882373 +0100 +diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp +new file mode 100644 +index 0000000000..90a2bdf212 +--- /dev/null ++++ b/gdb/testsuite/gdb.opt/fortran-string.exp @@ -0,0 +1,39 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -3459,10 +3589,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp +gdb_test "frame" ".*s='foo'.*" +gdb_test "ptype s" "type = character\\*3" +gdb_test "p s" "\\$\[0-9\]* = 'foo'" -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90 2017-02-26 19:15:36.605882373 +0100 +diff --git a/gdb/testsuite/gdb.opt/fortran-string.f90 b/gdb/testsuite/gdb.opt/fortran-string.f90 +new file mode 100644 +index 0000000000..e48d520085 +--- /dev/null ++++ b/gdb/testsuite/gdb.opt/fortran-string.f90 @@ -0,0 +1,28 @@ +! Copyright 2009 Free Software Foundation, Inc. +! @@ -3492,10 +3623,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90 + program main + call f ('foo') + end -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp 2017-02-26 19:15:36.605882373 +0100 +diff --git a/gdb/testsuite/gdb.pascal/arrays.exp b/gdb/testsuite/gdb.pascal/arrays.exp +new file mode 100644 +index 0000000000..22acdb86d8 +--- /dev/null ++++ b/gdb/testsuite/gdb.pascal/arrays.exp @@ -0,0 +1,104 @@ +# Copyright 2008, 2009 Free Software Foundation, Inc. +# @@ -3601,10 +3733,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp +} +gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char" + -Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas 2017-02-26 19:15:36.605882373 +0100 +diff --git a/gdb/testsuite/gdb.pascal/arrays.pas b/gdb/testsuite/gdb.pascal/arrays.pas +new file mode 100644 +index 0000000000..295602d68c +--- /dev/null ++++ b/gdb/testsuite/gdb.pascal/arrays.pas @@ -0,0 +1,82 @@ +{ + Copyright 2008, 2009 Free Software Foundation, Inc. @@ -3688,11 +3821,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas + s := 'test'#0'string'; + writeln(s); { set breakpoint 2 here } +end. -Index: gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/lib/gdb.exp 2017-02-26 19:15:28.564824836 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp 2017-02-26 19:15:36.607882387 +0100 -@@ -178,6 +178,11 @@ +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index ff8218bf3d..c5924f97af 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -178,6 +178,11 @@ proc gdb_unload {} { send_gdb "y\n" exp_continue } @@ -3704,11 +3837,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp -re "Discard symbol table from .*y or n.*$" { send_gdb "y\n" exp_continue -Index: gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/testsuite/lib/pascal.exp 2017-02-26 19:15:28.565824844 +0100 -+++ gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp 2017-02-26 19:15:36.607882387 +0100 -@@ -37,6 +37,9 @@ +diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp +index a0562c3fe5..8f0257196f 100644 +--- a/gdb/testsuite/lib/pascal.exp ++++ b/gdb/testsuite/lib/pascal.exp +@@ -37,6 +37,9 @@ proc pascal_init {} { global pascal_compiler_is_fpc global gpc_compiler global fpc_compiler @@ -3718,7 +3851,7 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp global env if { $pascal_init_done == 1 } { -@@ -64,6 +67,20 @@ +@@ -64,6 +67,20 @@ proc pascal_init {} { set pascal_compiler_is_fpc 1 verbose -log "Free Pascal compiler found" } @@ -3739,3 +3872,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp } set pascal_init_done 1 } +-- +2.14.3 + diff --git a/gdb-archer.patch b/gdb-archer.patch index c3c8da6..145c46d 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -1,3 +1,13 @@ +From a33be5ba95917ec49fc015387bfc9176fc78180c Mon Sep 17 00:00:00 2001 +From: Fedora GDB patches +Date: Fri, 27 Oct 2017 21:07:50 +0200 +Subject: gdb-archer.patch + +FileName: 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 @@ -5,21 +15,33 @@ GIT snapshot: commit 718a1618b2f691a7f407213bb50f100ac59f91c3 tromey/python +--- + gdb/Makefile.in | 6 ++ + gdb/data-directory/Makefile.in | 4 + + gdb/doc/gdb.texinfo | 10 +++ + gdb/doc/python.texi | 2 - + gdb/gdb-gdb.gdb.in | 10 +++ + gdb/main.c | 93 ++++++++++++++++++----- + gdb/python/lib/gdb/command/ignore_errors.py | 37 +++++++++ + gdb/python/lib/gdb/command/pahole.py | 81 ++++++++++++++++++++ + gdb/python/lib/gdb/function/in_scope.py | 47 ++++++++++++ + gdb/python/python-internal.h | 3 + + gdb/python/python.c | 113 ++++++++++++++++++++++++++++ + gdb/python/python.h | 2 + + gdb/testsuite/gdb.python/py-frame.exp | 2 + + gdb/testsuite/gdb.python/py-value.exp | 10 +++ + gdb/varobj.c | 8 ++ + gdb/varobj.h | 2 + + 16 files changed, 411 insertions(+), 19 deletions(-) + create mode 100644 gdb/python/lib/gdb/command/ignore_errors.py + create mode 100644 gdb/python/lib/gdb/command/pahole.py + create mode 100644 gdb/python/lib/gdb/function/in_scope.py - -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 291b1a0..150a8ef 100644 +index edd0b239d4..0c3f89aa7e 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -2350,6 +2350,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -2113,6 +2113,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -33,22 +55,19 @@ index 291b1a0..150a8ef 100644 $(SHELL) config.status --recheck diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in -index 304d4b0..d2007a4 100644 +index dadde8895a..19e436d725 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in -@@ -77,7 +77,11 @@ PYTHON_FILE_LIST = \ - gdb/types.py \ +@@ -80,6 +80,8 @@ PYTHON_FILE_LIST = \ gdb/unwinder.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/pretty_printers.py \ -@@ -89,6 +93,8 @@ PYTHON_FILE_LIST = \ +@@ -92,6 +94,8 @@ PYTHON_FILE_LIST = \ gdb/function/as_string.py \ gdb/function/caller_is.py \ gdb/function/strfns.py \ @@ -58,10 +77,10 @@ index 304d4b0..d2007a4 100644 gdb/printer/bound_registers.py diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 300d78e..699f2cb 100644 +index a79c686f0b..d13d4dd945 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -1230,6 +1230,16 @@ for remote debugging. +@@ -1240,6 +1240,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. @@ -79,7 +98,7 @@ index 300d78e..699f2cb 100644 @item -tui @cindex @code{--tui} diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi -index ce5810e..4ceb108 100644 +index 01243c7c7d..eb7bf3ca05 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -88,8 +88,6 @@ containing @code{end}. For example: @@ -92,7 +111,7 @@ index ce5810e..4ceb108 100644 >end 23 diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in -index 05a38b2..9801fdf 100644 +index 05a38b2670..9801fdff67 100644 --- a/gdb/gdb-gdb.gdb.in +++ b/gdb/gdb-gdb.gdb.in @@ -1,5 +1,15 @@ @@ -112,7 +131,7 @@ index 05a38b2..9801fdf 100644 set variable $gdb_init_done = 1 diff --git a/gdb/main.c b/gdb/main.c -index df4b111..6aca8b0 100644 +index df1f12bd79..a530a632bf 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -33,6 +33,7 @@ @@ -123,8 +142,8 @@ index df4b111..6aca8b0 100644 #include "source.h" #include "cli/cli-cmds.h" #include "objfiles.h" -@@ -459,7 +460,7 @@ struct cmdarg - }; +@@ -478,7 +479,7 @@ exec_or_core_file_attach (const char *filename, int from_tty) + } static void -captured_main_1 (struct captured_main_args *context) @@ -132,7 +151,7 @@ index df4b111..6aca8b0 100644 { int argc = context->argc; char **argv = context->argv; -@@ -676,10 +677,14 @@ captured_main_1 (struct captured_main_args *context) +@@ -695,10 +696,14 @@ captured_main_1 (struct captured_main_args *context) {"args", no_argument, &set_args, 1}, {"l", required_argument, 0, 'l'}, {"return-child-result", no_argument, &return_child_result, 1}, @@ -148,7 +167,7 @@ index df4b111..6aca8b0 100644 { int option_index; -@@ -697,6 +702,9 @@ captured_main_1 (struct captured_main_args *context) +@@ -716,6 +721,9 @@ captured_main_1 (struct captured_main_args *context) case 0: /* Long option that just sets a flag. */ break; @@ -158,7 +177,7 @@ index df4b111..6aca8b0 100644 case OPT_SE: symarg = optarg; execarg = optarg; -@@ -855,7 +863,31 @@ captured_main_1 (struct captured_main_args *context) +@@ -888,7 +896,31 @@ captured_main_1 (struct captured_main_args *context) /* Now that gdb_init has created the initial inferior, we're in position to set args for that inferior. */ @@ -191,7 +210,7 @@ index df4b111..6aca8b0 100644 { /* The remaining options are the command-line options for the inferior. The first one is the sym/exec file, and the rest -@@ -1125,7 +1157,8 @@ captured_main_1 (struct captured_main_args *context) +@@ -1178,7 +1210,8 @@ captured_main_1 (struct captured_main_args *context) /* Read in the old history after all the command files have been read. */ @@ -201,7 +220,7 @@ index df4b111..6aca8b0 100644 if (batch_flag) { -@@ -1138,16 +1171,29 @@ static void +@@ -1191,24 +1224,37 @@ static void captured_main (void *data) { struct captured_main_args *context = (struct captured_main_args *) data; @@ -217,7 +236,12 @@ index df4b111..6aca8b0 100644 - while (1) +#if HAVE_PYTHON + if (python_script) -+ { + { +- TRY +- { +- captured_command_loop (); +- } +- CATCH (ex, RETURN_MASK_ALL) + extern int pagination_enabled; + pagination_enabled = 0; + run_python_script (context->argc - optind, &context->argv[optind]); @@ -225,20 +249,29 @@ index df4b111..6aca8b0 100644 + } + else +#endif - { -- catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL); ++ { + /* 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); -+ } + { +- exception_print (gdb_stderr, ex); ++ TRY ++ { ++ captured_command_loop (); ++ } ++ CATCH (ex, RETURN_MASK_ALL) ++ { ++ exception_print (gdb_stderr, ex); ++ } ++ END_CATCH + } +- END_CATCH } /* No exit -- exit is through quit_command. */ } -@@ -1190,6 +1236,12 @@ print_gdb_help (struct ui_file *stream) +@@ -1251,6 +1297,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\ @@ -251,7 +284,7 @@ index df4b111..6aca8b0 100644 gdb [options] --args executable-file [inferior-arguments ...]\n\n\ "), stream); fputs_unfiltered (_("\ -@@ -1234,6 +1286,13 @@ Output and user interface control:\n\n\ +@@ -1296,6 +1348,13 @@ Output and user interface control:\n\n\ #endif fputs_unfiltered (_("\ --dbx DBX compatibility mode.\n\ @@ -267,7 +300,7 @@ index df4b111..6aca8b0 100644 "), 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 +index 0000000000..6fa48ff081 --- /dev/null +++ b/gdb/python/lib/gdb/command/ignore_errors.py @@ -0,0 +1,37 @@ @@ -310,7 +343,7 @@ index 0000000..6fa48ff +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 +index 0000000000..e08eaf5ca8 --- /dev/null +++ b/gdb/python/lib/gdb/command/pahole.py @@ -0,0 +1,81 @@ @@ -397,7 +430,7 @@ index 0000000..e08eaf5 +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 +index 0000000000..8742680614 --- /dev/null +++ b/gdb/python/lib/gdb/function/in_scope.py @@ -0,0 +1,47 @@ @@ -449,10 +482,10 @@ index 0000000..8742680 + +InScope () diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index e84c8d2..69305b4 100644 +index f099ae437f..468b0ebd92 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h -@@ -672,6 +672,9 @@ class gdbpy_enter_varobj : public gdbpy_enter +@@ -651,6 +651,9 @@ class gdbpy_enter_varobj : public gdbpy_enter }; @@ -463,7 +496,7 @@ index e84c8d2..69305b4 100644 extern const struct language_defn *python_language; diff --git a/gdb/python/python.c b/gdb/python/python.c -index 7e0c507..a67fbc3 100644 +index 0f71a4335e..03f6c55d40 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python = @@ -505,7 +538,7 @@ index 7e0c507..a67fbc3 100644 /* Set the quit flag. */ static void -@@ -1187,6 +1212,92 @@ gdbpy_print_stack (void) +@@ -1356,6 +1381,92 @@ gdbpy_print_stack (void) /* Return the current Progspace. There always is one. */ @@ -598,7 +631,7 @@ index 7e0c507..a67fbc3 100644 static PyObject * gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2) -@@ -1881,6 +1992,8 @@ PyMethodDef python_GdbMethods[] = +@@ -2035,6 +2146,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." }, @@ -608,7 +641,7 @@ index 7e0c507..a67fbc3 100644 "Return a gdb parameter's value" }, diff --git a/gdb/python/python.h b/gdb/python/python.h -index e407faa..fc1c632 100644 +index e407faabfd..fc1c6326a2 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -25,4 +25,6 @@ @@ -619,7 +652,7 @@ index e407faa..fc1c632 100644 + #endif /* GDB_PYTHON_H */ diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp -index f5d4a3c..3546f7b 100644 +index f5d4a3cc12..3546f7ba2a 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 @@ -632,7 +665,7 @@ index f5d4a3c..3546f7b 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 1781887..8a2ddd6 100644 +index 1781887c4a..8a2ddd6fae 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp @@ -384,6 +384,15 @@ proc test_value_after_death {} { @@ -660,10 +693,10 @@ index 1781887..8a2ddd6 100644 # Test either C or C++ values. diff --git a/gdb/varobj.c b/gdb/varobj.c -index 5f21d84..18506f1 100644 +index 93b97f6f70..753c6596b3 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c -@@ -226,6 +226,14 @@ is_root_p (const struct varobj *var) +@@ -217,6 +217,14 @@ is_root_p (const struct varobj *var) } #ifdef HAVE_PYTHON @@ -679,15 +712,18 @@ index 5f21d84..18506f1 100644 /* See python-internal.h. */ gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var) diff --git a/gdb/varobj.h b/gdb/varobj.h -index e35c1b8..12339d1 100644 +index 9163a34fd0..ed51b6ad34 100644 --- a/gdb/varobj.h +++ b/gdb/varobj.h -@@ -320,6 +320,8 @@ extern int varobj_has_more (const struct varobj *var, int to); +@@ -327,6 +327,8 @@ extern bool varobj_has_more (const struct varobj *var, int to); - extern int varobj_is_dynamic_p (const struct varobj *var); + extern bool varobj_is_dynamic_p (const struct varobj *var); +extern struct cleanup *varobj_ensure_python_env (const struct varobj *var); + - extern int varobj_default_value_is_changeable_p (const struct varobj *var); - extern int varobj_value_is_changeable_p (const struct varobj *var); + extern bool varobj_default_value_is_changeable_p (const struct varobj *var); + extern bool varobj_value_is_changeable_p (const struct varobj *var); +-- +2.14.3 + diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index be6c9c8..933455e 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -1,13 +1,15 @@ +From 2f8f9053a5b2630408c2a32ff6ba04a5067ab8f7 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [patch 3/3] attach-fail-reasons: SELinux deny_ptrace +Subject: attach-fail-reasons: SELinux deny_ptrace FileName: gdb-attach-fail-reasons-5of5.patch +;; Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). +;;=push+jan http://sourceware.org/ml/gdb-patches/2012-03/msg00171.html - Hi, and here is the last bit for new SELinux 'deny_ptrace': @@ -16,11 +18,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 @@ -43,185 +43,23 @@ gdb/gdbserver/ * linux-low.c (linux_traceme): New function. (linux_create_inferior, linux_tracefork_child): Call it instead of direct ptrace. +--- + gdb/config.in | 6 +++++ + gdb/configure | 58 ++++++++++++++++++++++++++++++++++++++++++++++ + gdb/configure.ac | 4 ++++ + gdb/gdbserver/config.in | 6 +++++ + gdb/gdbserver/configure | 58 ++++++++++++++++++++++++++++++++++++++++++++++ + gdb/gdbserver/configure.ac | 4 ++++ + gdb/gdbserver/linux-low.c | 16 ++++++++++++- + gdb/linux-nat.c | 24 ++++++++++++++++++- + gdb/nat/linux-ptrace.c | 22 ++++++++++++++++++ + gdb/nat/linux-ptrace.h | 1 + + 10 files changed, 197 insertions(+), 2 deletions(-) -Index: gdb-7.12.50.20170226/gdb/nat/linux-ptrace.c -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/nat/linux-ptrace.c 2017-02-26 21:27:14.780009449 +0100 -+++ gdb-7.12.50.20170226/gdb/nat/linux-ptrace.c 2017-02-26 21:27:18.838038193 +0100 -@@ -27,6 +27,10 @@ - #include - #endif - -+#ifdef HAVE_SELINUX_SELINUX_H -+# include -+#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. */ -@@ -51,6 +55,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.12.50.20170226/gdb/nat/linux-ptrace.h -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/nat/linux-ptrace.h 2017-02-26 21:27:14.780009449 +0100 -+++ gdb-7.12.50.20170226/gdb/nat/linux-ptrace.h 2017-02-26 21:27:18.838038193 +0100 -@@ -185,6 +185,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.12.50.20170226/gdb/configure.ac -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/configure.ac 2017-02-26 21:27:14.781009456 +0100 -+++ gdb-7.12.50.20170226/gdb/configure.ac 2017-02-26 21:27:18.839038200 +0100 -@@ -2092,6 +2092,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.12.50.20170226/gdb/gdbserver/configure.ac -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/gdbserver/configure.ac 2017-02-26 21:27:14.781009456 +0100 -+++ gdb-7.12.50.20170226/gdb/gdbserver/configure.ac 2017-02-26 21:27:18.839038200 +0100 -@@ -469,6 +469,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.12.50.20170226/gdb/gdbserver/linux-low.c -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/gdbserver/linux-low.c 2017-02-26 21:27:14.783009470 +0100 -+++ gdb-7.12.50.20170226/gdb/gdbserver/linux-low.c 2017-02-26 21:27:18.841038214 +0100 -@@ -946,6 +946,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. */ - -@@ -969,7 +992,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.12.50.20170226/gdb/linux-nat.c -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/linux-nat.c 2017-02-26 21:27:14.785009484 +0100 -+++ gdb-7.12.50.20170226/gdb/linux-nat.c 2017-02-26 21:27:18.842038221 +0100 -@@ -1110,6 +1110,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. */ -@@ -1117,7 +1118,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.12.50.20170226/gdb/config.in -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/config.in 2017-02-26 21:27:14.786009491 +0100 -+++ gdb-7.12.50.20170226/gdb/config.in 2017-02-26 21:27:18.842038221 +0100 +diff --git a/gdb/config.in b/gdb/config.in +index edd7028f76..4de3e842d1 100644 +--- a/gdb/config.in ++++ b/gdb/config.in @@ -270,6 +270,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -232,7 +70,7 @@ Index: gdb-7.12.50.20170226/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -402,6 +405,9 @@ +@@ -393,6 +396,9 @@ /* Define to 1 if you have the `scm_new_smob' function. */ #undef HAVE_SCM_NEW_SMOB @@ -242,11 +80,11 @@ Index: gdb-7.12.50.20170226/gdb/config.in /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE -Index: gdb-7.12.50.20170226/gdb/configure -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/configure 2017-02-26 21:27:14.790009519 +0100 -+++ gdb-7.12.50.20170226/gdb/configure 2017-02-26 21:27:18.846038249 +0100 -@@ -15492,6 +15492,64 @@ +diff --git a/gdb/configure b/gdb/configure +index e314e28ff3..d99f28b9f2 100755 +--- a/gdb/configure ++++ b/gdb/configure +@@ -15679,6 +15679,64 @@ cat >>confdefs.h <<_ACEOF _ACEOF @@ -311,11 +149,26 @@ Index: gdb-7.12.50.20170226/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.12.50.20170226/gdb/gdbserver/config.in -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/gdbserver/config.in 2017-02-26 21:27:14.791009527 +0100 -+++ gdb-7.12.50.20170226/gdb/gdbserver/config.in 2017-02-26 21:27:18.846038249 +0100 -@@ -123,6 +123,9 @@ +diff --git a/gdb/configure.ac b/gdb/configure.ac +index 9de441fe79..830618dbe5 100644 +--- a/gdb/configure.ac ++++ b/gdb/configure.ac +@@ -2042,6 +2042,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/gdbserver/config.in b/gdb/gdbserver/config.in +index dda7c1f150..b2a34b92ce 100644 +--- a/gdb/gdbserver/config.in ++++ b/gdb/gdbserver/config.in +@@ -126,6 +126,9 @@ /* Define to 1 if you have the `mcheck' library (-lmcheck). */ #undef HAVE_LIBMCHECK @@ -325,7 +178,7 @@ Index: gdb-7.12.50.20170226/gdb/gdbserver/config.in /* Define if the target supports branch tracing. */ #undef HAVE_LINUX_BTRACE -@@ -199,6 +202,9 @@ +@@ -202,6 +205,9 @@ /* Define to 1 if you have the `pwrite' function. */ #undef HAVE_PWRITE @@ -335,11 +188,11 @@ Index: gdb-7.12.50.20170226/gdb/gdbserver/config.in /* Define to 1 if you have the `setns' function. */ #undef HAVE_SETNS -Index: gdb-7.12.50.20170226/gdb/gdbserver/configure -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/gdbserver/configure 2017-02-26 21:27:14.793009541 +0100 -+++ gdb-7.12.50.20170226/gdb/gdbserver/configure 2017-02-26 21:27:18.848038263 +0100 -@@ -8429,6 +8429,64 @@ +diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure +index 835dcca314..9028c82b01 100755 +--- a/gdb/gdbserver/configure ++++ b/gdb/gdbserver/configure +@@ -8452,6 +8452,64 @@ if $want_ipa ; then fi fi @@ -404,3 +257,142 @@ Index: gdb-7.12.50.20170226/gdb/gdbserver/configure +diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac +index 456d3b360a..0074c437f1 100644 +--- a/gdb/gdbserver/configure.ac ++++ b/gdb/gdbserver/configure.ac +@@ -486,6 +486,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/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c +index f6a52d5859..ab3be27142 100644 +--- a/gdb/gdbserver/linux-low.c ++++ b/gdb/gdbserver/linux-low.c +@@ -963,7 +963,21 @@ 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; ++ struct buffer buffer; ++ ++ buffer_init (&buffer); ++ linux_ptrace_create_warnings (&buffer); ++ buffer_grow_str0 (&buffer, ""); ++ ++ std::string msg ++ = string_printf (_("%sCannot trace created process"), ++ buffer_finish (&buffer)); ++ ++ errno = save_errno; ++ trace_start_error_with_name (msg.c_str ()); ++ } + + if (setpgid (0, 0) < 0) + trace_start_error_with_name ("setpgid"); +diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +index 96cb21a2cf..6040c1f129 100644 +--- a/gdb/linux-nat.c ++++ b/gdb/linux-nat.c +@@ -1127,7 +1127,29 @@ linux_nat_create_inferior (struct target_ops *ops, + /* 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); ++ volatile struct gdb_exception ex; ++ 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 + } + + /* 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 +index 438177fa76..ab6ae86400 100644 +--- a/gdb/nat/linux-ptrace.c ++++ b/gdb/nat/linux-ptrace.c +@@ -27,6 +27,10 @@ + #include + #endif + ++#ifdef HAVE_SELINUX_SELINUX_H ++# include ++#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. */ +@@ -51,6 +55,8 @@ linux_ptrace_attach_fail_reason (pid_t pid, struct buffer *buffer) + 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_init_warnings (void) + 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 +diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h +index 59549452c0..b951492102 100644 +--- a/gdb/nat/linux-ptrace.h ++++ b/gdb/nat/linux-ptrace.h +@@ -185,6 +185,7 @@ extern void linux_ptrace_attach_fail_reason (pid_t pid, struct buffer *buffer); + 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); +-- +2.14.3 + diff --git a/gdb-btrobust.patch b/gdb-btrobust.patch index c39fe5c..dfaf336 100644 --- a/gdb-btrobust.patch +++ b/gdb-btrobust.patch @@ -1,19 +1,26 @@ +From a02022ce4c7a1841518e9cf17d1d9b7cade13483 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-btrobust.patch FileName: 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. -- +--- + gdb/python/py-framefilter.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) -Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c -=================================================================== ---- gdb-7.12.50.20170226.orig/gdb/python/py-framefilter.c 2017-02-26 21:33:23.150618708 +0100 -+++ gdb-7.12.50.20170226/gdb/python/py-framefilter.c 2017-02-26 21:33:29.993667179 +0100 -@@ -1388,6 +1388,7 @@ +diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c +index 75b055c98c..9f33a7aab9 100644 +--- a/gdb/python/py-framefilter.c ++++ b/gdb/python/py-framefilter.c +@@ -1388,6 +1388,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, htab_eq_pointer, NULL)); @@ -21,7 +28,7 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c while (true) { gdbpy_ref<> item (PyIter_Next (iterable.get ())); -@@ -1397,7 +1398,7 @@ +@@ -1397,7 +1398,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, if (PyErr_Occurred ()) { gdbpy_print_stack (); @@ -30,7 +37,7 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c } break; } -@@ -1409,6 +1410,7 @@ +@@ -1409,6 +1410,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, error and continue with other frames. */ if (success == EXT_LANG_BT_ERROR) gdbpy_print_stack (); @@ -38,3 +45,6 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c } return success; +-- +2.14.3 + diff --git a/gdb-bz1219747-attach-kills.patch b/gdb-bz1219747-attach-kills.patch index a697bff..e9b0deb 100644 --- a/gdb-bz1219747-attach-kills.patch +++ b/gdb-bz1219747-attach-kills.patch @@ -1,11 +1,14 @@ +From 3dd3bcfbbff9caefd394385aac0d82e4fca0f422 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [PATCH 1/3] Never kill PID on: gdb exec PID +Subject: Never kill PID on: gdb exec PID FileName: gdb-bz1219747-attach-kills.patch -http://sourceware.org/ml/gdb-patches/2015-10/msg00301.html +;; Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747). +;;=push+jan +http://sourceware.org/ml/gdb-patches/2015-10/msg00301.html Hi, @@ -22,25 +25,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 , 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 , 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) @@ -51,37 +42,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 , 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 @@ -91,20 +59,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 , 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 @@ -117,17 +79,18 @@ 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(+) + gdb/main.c | 5 +++- + gdb/testsuite/gdb.base/attach-kills.c | 25 +++++++++++++++++ + gdb/testsuite/gdb.base/attach-kills.exp | 49 +++++++++++++++++++++++++++++++++ + 3 files changed, 78 insertions(+), 1 deletion(-) 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 +index d5b4c3adb9..df1f12bd79 100644 --- a/gdb/main.c +++ b/gdb/main.c -@@ -1080,7 +1080,10 @@ captured_main (void *data) +@@ -1113,7 +1113,10 @@ captured_main_1 (struct captured_main_args *context) if (isdigit (pid_or_core_arg[0])) { if (catch_command_errors (attach_command, pid_or_core_arg, @@ -141,7 +104,7 @@ index 49c9b68..bc19699 100644 } 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 +index 0000000000..2398f00442 --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-kills.c @@ -0,0 +1,25 @@ @@ -172,7 +135,7 @@ 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 +index 0000000000..9a93cb7584 --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-kills.exp @@ -0,0 +1,49 @@ @@ -225,4 +188,6 @@ index 0000000..9a93cb7 +} + +kill_wait_spawned_process $test_spawn_id +-- +2.14.3 diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch index 32d60b9..01b90d8 100644 --- a/gdb-bz533176-fortran-omp-step.patch +++ b/gdb-bz533176-fortran-omp-step.patch @@ -1,9 +1,12 @@ +From 02e52bff09dbf734e16f57c0c75720af272023c4 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-bz533176-fortran-omp-step.patch FileName: 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 @@ -25,14 +28,19 @@ upstream) or "step" (default in F/RHEL) the simultaneous execution of the threads is inconvenient. Setting it to "on" will lockup the debugging as the threads need to get synchronized at some point. This is a more general debugging problem of GOMP outside of the scope of this Bug. +--- + gdb/infrun.c | 11 +++++++++++ + gdb/testsuite/gdb.fortran/omp-step.exp | 31 +++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/omp-step.f90 | 32 ++++++++++++++++++++++++++++++++ + 3 files changed, 74 insertions(+) + create mode 100644 gdb/testsuite/gdb.fortran/omp-step.exp + create mode 100644 gdb/testsuite/gdb.fortran/omp-step.f90 - - -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 +index db742f7398..8c2c424883 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -6663,6 +6663,16 @@ process_event_stop_test (struct execution_control_state *ecs) if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL) { @@ -49,7 +57,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c /* We're doing a "next". Normal (forward) execution: set a breakpoint at the -@@ -4855,6 +4865,7 @@ process_event_stop_test (struct executio +@@ -6696,6 +6706,7 @@ process_event_stop_test (struct execution_control_state *ecs) keep_going (ecs); return; @@ -57,10 +65,11 @@ 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 +index 0000000000..66440a7507 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/omp-step.exp @@ -0,0 +1,31 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -93,10 +102,11 @@ 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 +index 0000000000..a0cfb37014 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/omp-step.f90 @@ -0,0 +1,32 @@ +! Copyright 2009 Free Software Foundation, Inc. + @@ -130,3 +140,6 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90 + end do + print *, "success" + end +-- +2.14.3 + diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index 038bd14..8b03de4 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -1,39 +1,52 @@ +From 5846627ef662223a3a23f29e2e8da1c96b0f43c8 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-bz541866-rwatch-before-run.patch FileName: gdb-bz541866-rwatch-before-run.patch +;; Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). +;; Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). +;;=push+jan: It should be fixed properly instead. +--- + gdb/breakpoint.c | 4 +-- + gdb/config/i386/nm-linux.h | 28 +++++++++++++++ + gdb/config/i386/nm-linux64.h | 28 +++++++++++++++ + gdb/configure.nat | 2 ++ + gdb/target.h | 2 ++ + .../gdb.base/watchpoint-hw-before-run.exp | 40 ++++++++++++++++++++++ + 6 files changed, 102 insertions(+), 2 deletions(-) + create mode 100644 gdb/config/i386/nm-linux.h + create mode 100644 gdb/config/i386/nm-linux64.h + create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp -Index: gdb-7.11.90.20160807/gdb/config/i386/linux64.mh -=================================================================== ---- gdb-7.11.90.20160807.orig/gdb/config/i386/linux64.mh 2016-08-07 22:27:13.889285274 +0200 -+++ gdb-7.11.90.20160807/gdb/config/i386/linux64.mh 2016-08-07 22:29:20.451311124 +0200 -@@ -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 +diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c +index bc0134db36..269928a794 100644 +--- a/gdb/breakpoint.c ++++ b/gdb/breakpoint.c +@@ -8879,7 +8879,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, + int enabled, int internal, unsigned flags, + int display_canonical) + { +- int i; ++ int i ATTRIBUTE_UNUSED; - # The dynamically loaded libthread_db needs access to symbols in the -Index: gdb-7.11.90.20160807/gdb/config/i386/linux.mh -=================================================================== ---- gdb-7.11.90.20160807.orig/gdb/config/i386/linux.mh 2016-08-07 22:27:13.889285274 +0200 -+++ gdb-7.11.90.20160807/gdb/config/i386/linux.mh 2016-08-07 22:29:20.451311124 +0200 -@@ -1,6 +1,6 @@ - # Host: Intel 386 running GNU/Linux. + if (type == bp_hardware_breakpoint) + { +@@ -14442,7 +14442,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, --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.11.90.20160807/gdb/config/i386/nm-linux.h -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h 2016-08-07 22:29:20.451311124 +0200 + if (bpt->type == bp_hardware_breakpoint) + { +- int i; ++ int i ATTRIBUTE_UNUSED; + i = hw_breakpoint_used_count (); + target_resources_ok = + target_can_use_hardware_watchpoint (bp_hardware_breakpoint, +diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h +new file mode 100644 +index 0000000000..38e94baab1 +--- /dev/null ++++ b/gdb/config/i386/nm-linux.h @@ -0,0 +1,28 @@ +/* Native support for GNU/Linux i386. + @@ -63,10 +76,11 @@ Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 + +#endif /* NM_LINUX64_H */ -Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h 2016-08-07 22:29:20.451311124 +0200 +diff --git a/gdb/config/i386/nm-linux64.h b/gdb/config/i386/nm-linux64.h +new file mode 100644 +index 0000000000..212daba477 +--- /dev/null ++++ b/gdb/config/i386/nm-linux64.h @@ -0,0 +1,28 @@ +/* Native support for GNU/Linux amd64. + @@ -96,11 +110,31 @@ Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 + +#endif /* NM_LINUX64_H */ -Index: gdb-7.11.90.20160807/gdb/target.h -=================================================================== ---- gdb-7.11.90.20160807.orig/gdb/target.h 2016-08-07 22:27:13.889285274 +0200 -+++ gdb-7.11.90.20160807/gdb/target.h 2016-08-07 22:29:20.452311132 +0200 -@@ -1939,9 +1939,11 @@ +diff --git a/gdb/configure.nat b/gdb/configure.nat +index 962abd6edf..404b6c8deb 100644 +--- a/gdb/configure.nat ++++ b/gdb/configure.nat +@@ -237,6 +237,7 @@ case ${gdb_host} in + ;; + i386) + # Host: Intel 386 running GNU/Linux. ++ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux.h" + NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \ + i386-linux-nat.o x86-linux-nat.o linux-btrace.o \ + x86-linux.o x86-linux-dregs.o" +@@ -289,6 +290,7 @@ case ${gdb_host} in + case ${gdb_host_cpu} in + i386) + # Host: GNU/Linux x86-64 ++ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux64.h" + NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \ + amd64-nat.o amd64-linux-nat.o x86-linux-nat.o linux-btrace.o \ + x86-linux.o x86-linux-dregs.o amd64-linux-siginfo.o" +diff --git a/gdb/target.h b/gdb/target.h +index 638e2f06e6..999541d5d2 100644 +--- a/gdb/target.h ++++ b/gdb/target.h +@@ -1927,9 +1927,11 @@ extern struct thread_info *target_thread_handle_to_thread_info one. OTHERTYPE is the number of watchpoints of other types than this one used so far. */ @@ -112,10 +146,11 @@ Index: gdb-7.11.90.20160807/gdb/target.h /* Returns the number of debug registers needed to watch the given memory region, or zero if not supported. */ -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2016-08-07 22:29:20.452311132 +0200 +diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp +new file mode 100644 +index 0000000000..4ce9997e4a +--- /dev/null ++++ b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp @@ -0,0 +1,40 @@ +# Copyright 2009, 2010 Free Software Foundation, Inc. + @@ -157,16 +192,6 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp +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.*" -Index: gdb-7.11.90.20160807/gdb/breakpoint.c -=================================================================== ---- gdb-7.11.90.20160807.orig/gdb/breakpoint.c 2016-08-07 22:33:38.835405458 +0200 -+++ gdb-7.11.90.20160807/gdb/breakpoint.c 2016-08-07 22:34:45.023941950 +0200 -@@ -14953,7 +14953,7 @@ - - if (bpt->type == bp_hardware_breakpoint) - { -- int i; -+ int i ATTRIBUTE_UNUSED; - i = hw_breakpoint_used_count (); - target_resources_ok = - target_can_use_hardware_watchpoint (bp_hardware_breakpoint, +-- +2.14.3 + diff --git a/gdb-bz568248-oom-is-error.patch b/gdb-bz568248-oom-is-error.patch index 2adbcef..1448a85 100644 --- a/gdb-bz568248-oom-is-error.patch +++ b/gdb-bz568248-oom-is-error.patch @@ -1,9 +1,12 @@ +From 54052819687336d9ac4f728e49ed7ae1e5e847e3 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [rfc patch] nomem: internal_error -> error +Subject: nomem: internal_error -> error FileName: gdb-bz568248-oom-is-error.patch +;; Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). +;;=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted. http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html @@ -30,7 +33,6 @@ 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. @@ -41,22 +43,23 @@ 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 Tom Tromey * utils.c (nomem): Change internal_error to error. +--- + gdb/utils.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) -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) +diff --git a/gdb/utils.c b/gdb/utils.c +index 98ef6ac457..5e99a4d501 100644 +--- a/gdb/utils.c ++++ b/gdb/utils.c +@@ -776,13 +776,11 @@ malloc_failure (long size) { if (size > 0) { @@ -72,3 +75,6 @@ Index: gdb-7.3.50.20110722/gdb/utils.c } } +-- +2.14.3 + diff --git a/gdb-bz601887-dwarf4-rh-test.patch b/gdb-bz601887-dwarf4-rh-test.patch index 002f55f..8e627fd 100644 --- a/gdb-bz601887-dwarf4-rh-test.patch +++ b/gdb-bz601887-dwarf4-rh-test.patch @@ -1,14 +1,26 @@ +From b3e6a7a7ec792086722d832aa37a485d8e74c9e4 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-bz601887-dwarf4-rh-test.patch FileName: gdb-bz601887-dwarf4-rh-test.patch +;; Backport DWARF-4 support (BZ 601887, Tom Tromey). +;;=fedoratest +--- + gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S | 167 ++++++++++++++++++++++++++ + gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c | 22 ++++ + gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp | 42 +++++++ + 3 files changed, 231 insertions(+) + create mode 100644 gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S + create mode 100644 gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c + create mode 100644 gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp -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 +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 +index 0000000000..48b1bbf3e1 +--- /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. + @@ -177,10 +189,11 @@ 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 +index 0000000000..46fcd120f4 +--- /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. + @@ -204,10 +217,11 @@ 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 +index 0000000000..a728f9c5ed +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp @@ -0,0 +1,42 @@ +# Copyright 2010 Free Software Foundation, Inc. + @@ -251,3 +265,6 @@ Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp +clean_restart $executable + +gdb_test "ptype main" {type = int \(void\)} +-- +2.14.3 + diff --git a/gdb-bz634108-solib_address.patch b/gdb-bz634108-solib_address.patch index 22c4dd2..d3563f6 100644 --- a/gdb-bz634108-solib_address.patch +++ b/gdb-bz634108-solib_address.patch @@ -1,14 +1,24 @@ +From c5a976481a50928fbc6387adbea8b3bc86f75958 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-bz634108-solib_address.patch FileName: 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. +--- + .../gdb.python/rh634108-solib_address.exp | 24 ++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + create mode 100644 gdb/testsuite/gdb.python/rh634108-solib_address.exp +diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +new file mode 100644 +index 0000000000..c0451cf09e --- /dev/null +++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp @@ -0,0 +1,24 @@ @@ -36,3 +46,6 @@ s/solib_address/solib_name/ during upstreaming. +if { [skip_python_tests] } { continue } + +gdb_test "python print gdb.solib_name(-1)" "None" "gdb.solib_name exists" +-- +2.14.3 + diff --git a/gdb-ccache-workaround.patch b/gdb-ccache-workaround.patch index 14119a2..da3f20c 100644 --- a/gdb-ccache-workaround.patch +++ b/gdb-ccache-workaround.patch @@ -1,13 +1,21 @@ +From 30e67da41176f7613c720b5474dec4c4bc38d767 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-ccache-workaround.patch FileName: 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. +--- + gdb/testsuite/gdb.base/macscp.exp | 8 ++++++++ + 1 file changed, 8 insertions(+) +diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp +index d4242cceb1..6602bc591a 100644 --- 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 } @@ -22,3 +30,6 @@ FileName: gdb-ccache-workaround.patch # Generate the intermediate object file. This is required by Darwin to # have access to the .debug_macinfo section. if {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \ +-- +2.14.3 + diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index a1bfe21..00e1a71 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -1,12 +1,21 @@ +From 1a6d40bc0da17671c8259ee44f77a64a442a82fe Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-container-rh-pkg.patch FileName: gdb-container-rh-pkg.patch ---- 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 +;; Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). +;;=fedora +--- + gdb/remote.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/gdb/remote.c b/gdb/remote.c +index 303fcddd8a..6f824e532b 100644 +--- a/gdb/remote.c ++++ b/gdb/remote.c +@@ -13432,7 +13432,17 @@ remote_pid_to_exec_file (struct target_ops *self, int pid) char *annex = NULL; if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) @@ -23,5 +32,8 @@ FileName: gdb-container-rh-pkg.patch + return NULL; + } - if (filename != NULL) - xfree (filename); + inf = find_inferior_pid (pid); + if (inf == NULL) +-- +2.14.3 + diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch index 1ab8fe3..57b30c8 100644 --- a/gdb-core-open-vdso-warning.patch +++ b/gdb-core-open-vdso-warning.patch @@ -1,9 +1,13 @@ +From 7c7912da14d128d31170165874a0f23e1a53db48 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-core-open-vdso-warning.patch FileName: 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. @@ -13,11 +17,14 @@ Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Inp commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f Author: Ulrich Weigand Date: Wed Sep 25 11:52:50 2013 +0000 +--- + gdb/testsuite/gdb.base/solib-symbol.exp | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) -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 +index dd2f6c77d4..53824f8142 100644 +--- 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}] @@ -55,3 +62,6 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/solib-symbol.exp +gdb_run_cmd +gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \ + "warning for missing libraries" +-- +2.14.3 + diff --git a/gdb-dts-rhel6-python-compat.patch b/gdb-dts-rhel6-python-compat.patch index fdfd9aa..7b9cdc9 100644 --- a/gdb-dts-rhel6-python-compat.patch +++ b/gdb-dts-rhel6-python-compat.patch @@ -1,16 +1,29 @@ +From 8647aabb864dd18c51bb9b3006fdb0294ce94231 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-dts-rhel6-python-compat.patch FileName: gdb-dts-rhel6-python-compat.patch -https://bugzilla.redhat.com/show_bug.cgi?id=1020004 +;; [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon). +;;=fedora -Index: gdb-7.12.50.20170207/gdb/data-directory/Makefile.in -=================================================================== ---- gdb-7.12.50.20170207.orig/gdb/data-directory/Makefile.in 2017-02-26 21:10:31.418894975 +0100 -+++ gdb-7.12.50.20170207/gdb/data-directory/Makefile.in 2017-02-26 21:11:07.083147930 +0100 -@@ -71,6 +71,8 @@ +https://bugzilla.redhat.com/show_bug.cgi?id=1020004 +--- + gdb/data-directory/Makefile.in | 3 + + gdb/python/lib/gdb/FrameWrapper.py | 122 ++++++++++++++++++++++++++++++++ + gdb/python/lib/gdb/backtrace.py | 42 +++++++++++ + gdb/python/lib/gdb/command/backtrace.py | 106 +++++++++++++++++++++++++++ + 4 files changed, 273 insertions(+) + create mode 100644 gdb/python/lib/gdb/FrameWrapper.py + create mode 100644 gdb/python/lib/gdb/backtrace.py + create mode 100644 gdb/python/lib/gdb/command/backtrace.py + +diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in +index 304d4b05c0..dadde8895a 100644 +--- 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 \ @@ -19,18 +32,19 @@ Index: gdb-7.12.50.20170207/gdb/data-directory/Makefile.in gdb/frames.py \ gdb/printing.py \ gdb/prompt.py \ -@@ -83,6 +85,7 @@ - gdb/command/pahole.py \ - gdb/command/xmethods.py \ +@@ -79,6 +81,7 @@ PYTHON_FILE_LIST = \ + gdb/xmethod.py \ + gdb/command/__init__.py \ gdb/command/explore.py \ + gdb/command/backtrace.py \ gdb/command/frame_filters.py \ gdb/command/pretty_printers.py \ gdb/command/prompt.py \ -Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py 2017-02-26 21:10:31.419894983 +0100 +diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py +new file mode 100644 +index 0000000000..34ba4a2a12 +--- /dev/null ++++ b/gdb/python/lib/gdb/FrameWrapper.py @@ -0,0 +1,122 @@ +# Wrapper API for frames. + @@ -154,10 +168,11 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py + + def __getattr__ (self, name): + return getattr (self.frame, name) -Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py 2017-02-26 21:10:31.419894983 +0100 +diff --git a/gdb/python/lib/gdb/backtrace.py b/gdb/python/lib/gdb/backtrace.py +new file mode 100644 +index 0000000000..06c893f239 +--- /dev/null ++++ b/gdb/python/lib/gdb/backtrace.py @@ -0,0 +1,42 @@ +# Filtering backtrace. + @@ -201,10 +216,11 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py + return iter + return old_frame_filter (iter) + -Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py 2017-02-26 21:10:31.419894983 +0100 +diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py +new file mode 100644 +index 0000000000..eeea9093e8 +--- /dev/null ++++ b/gdb/python/lib/gdb/command/backtrace.py @@ -0,0 +1,106 @@ +# New backtrace command. + @@ -312,3 +328,6 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py + pair[1].describe (sys.stdout, full) + +FilteringBacktrace() +-- +2.14.3 + diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index 290bc6f..f582423 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -1,16 +1,25 @@ +From 076c0ad2e25b452e1b98b1c94e0f113d6221556a Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-fedora-libncursesw.patch FileName: 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 +--- + gdb/configure | 6 ++++-- + gdb/configure.ac | 6 ++++-- + 2 files changed, 8 insertions(+), 4 deletions(-) -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 +index 01210afccc..c1186fd294 100755 +--- a/gdb/configure ++++ b/gdb/configure +@@ -9238,6 +9238,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. @@ -18,16 +27,16 @@ diff -dup -rup gdb-7.10.50.20151113-orig/gdb/configure gdb-7.10.50.20151113/gdb/ { $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 (); +@@ -9262,7 +9263,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 +@@ -9336,6 +9337,7 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -35,35 +44,39 @@ diff -dup -rup gdb-7.10.50.20151113-orig/gdb/configure gdb-7.10.50.20151113/gdb/ { $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 (); +@@ -9360,7 +9362,7 @@ return tgetent (); return 0; } _ACEOF --for ac_lib in '' termcap tinfo curses ncurses; do +-for ac_lib in '' termcap tinfo curses ncursesw ncurses; do +for ac_lib in '' termcap tinfo 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 +index 8c6a5f7d1e..c7d5f2de99 100644 +--- a/gdb/configure.ac ++++ b/gdb/configure.ac +@@ -755,7 +755,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 +@@ -797,7 +798,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 tinfo curses ncursesw ncurses]) +# Fedora: Force libncursesw over libncurses to match the includes. +AC_SEARCH_LIBS(tgetent, [termcap tinfo ncursesw]) if test "$ac_cv_search_tgetent" = no; then CONFIG_OBS="$CONFIG_OBS stub-termcap.o" +-- +2.14.3 + diff --git a/gdb-follow-child-stale-parent.patch b/gdb-follow-child-stale-parent.patch index e7a0235..44927fc 100644 --- a/gdb-follow-child-stale-parent.patch +++ b/gdb-follow-child-stale-parent.patch @@ -1,9 +1,12 @@ +From 37503cd77a1aba329b10bb9ccd34fb01e7449e39 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-follow-child-stale-parent.patch FileName: gdb-follow-child-stale-parent.patch +;; Fix regression by python on ia64 due to stale current frame. +;;=push+jan 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 @@ -19,10 +22,15 @@ unwinders try to access it, breaking: +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 | 3 +++ + 1 file changed, 3 insertions(+) ---- ./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) +diff --git a/gdb/infrun.c b/gdb/infrun.c +index 8c2c424883..c20a02e600 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -749,6 +749,9 @@ follow_fork (void) } else { @@ -32,3 +40,6 @@ unwinders try to access it, breaking: /* 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 +-- +2.14.3 + diff --git a/gdb-fortran-frame-string.patch b/gdb-fortran-frame-string.patch index 2c7ee97..97102d8 100644 --- a/gdb-fortran-frame-string.patch +++ b/gdb-fortran-frame-string.patch @@ -1,21 +1,21 @@ +From e3cb070a2a3ff147d09947bee6f668bd86ade4f7 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [patch] Display Fortran strings in backtraces +Subject: Display Fortran strings in backtraces FileName: 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. @@ -27,14 +27,18 @@ 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 - +--- + gdb/testsuite/gdb.fortran/fortran-frame-string.exp | 36 ++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/fortran-frame-string.f90 | 28 +++++++++++++++++ + 2 files changed, 64 insertions(+) + create mode 100644 gdb/testsuite/gdb.fortran/fortran-frame-string.exp + create mode 100644 gdb/testsuite/gdb.fortran/fortran-frame-string.f90 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 +index 0000000000..7114afd440 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp @@ -0,0 +1,36 @@ @@ -76,7 +80,7 @@ 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 +index 0000000000..3d1576fb1f --- /dev/null +++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 @@ -0,0 +1,28 @@ @@ -108,3 +112,6 @@ index 0000000..3d1576f + program main + call f ('foo') + end +-- +2.14.3 + diff --git a/gdb-gdb-add-index-script.patch b/gdb-gdb-add-index-script.patch index fb9e3ea..62a40a6 100644 --- a/gdb-gdb-add-index-script.patch +++ b/gdb-gdb-add-index-script.patch @@ -1,11 +1,14 @@ +From f2c3f8c02ab0a1c4c02f6d954141266bd5890f23 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Re: [0/4] RFC: add DWARF index support +Subject: RFC: add DWARF index support FileName: gdb-gdb-add-index-script.patch -http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html +;; Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey). +;;=push: Re-check against the upstream version. +http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html Jan Kratochvil: Fixed $d -> $dir. Jan Kratochvil: Remove /dev/null redirection. @@ -36,21 +39,17 @@ From: Tom Tromey 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 + gdb/Makefile.in | 9 +++++++++ + gdb/doc/Makefile.in | 9 ++++++++- + gdb/doc/gdb.texinfo | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 74 insertions(+), 1 deletion(-) -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 +diff --git a/gdb/Makefile.in b/gdb/Makefile.in +index f95505ea21..edd0b239d4 100644 +--- a/gdb/Makefile.in ++++ b/gdb/Makefile.in +@@ -1773,6 +1773,15 @@ install-only: install-gstack $(CONFIG_INSTALL) $(INSTALL_SCRIPT) gcore \ $(DESTDIR)$(bindir)/$$transformed_name; \ fi @@ -66,11 +65,38 @@ Index: gdb-7.6.90.20140127/gdb/Makefile.in @$(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 +diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in +index e0e50c166e..3cdcbbd567 100644 +--- a/gdb/doc/Makefile.in ++++ b/gdb/doc/Makefile.in +@@ -174,7 +174,7 @@ POD2MAN5 = pod2man --center="GNU Development Tools" \ + --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) + +@@ -633,6 +633,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 +diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo +index d181aeb1c0..a79c686f0b 100644 +--- a/gdb/doc/gdb.texinfo ++++ b/gdb/doc/gdb.texinfo +@@ -19606,6 +19606,14 @@ There are currently some limitation on indices. They only work when for DWARF debugging information, not stabs. And, they do not currently work for programs using Ada. @@ -85,7 +111,7 @@ Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo @node Symbol Errors @section Errors Reading Symbol Files -@@ -43878,6 +43886,7 @@ switch (die->tag) +@@ -42524,6 +42532,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 @@ -93,22 +119,10 @@ Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo @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 -+ +@@ -43193,6 +43202,54 @@ Richard M. Stallman and Roland H. Pesch, July 1991. + @end ifset + @c man end + +@node gdb-add-index man +@heading gdb-add-index + @@ -145,33 +159,21 @@ Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo +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 ++@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 ++ + @include gpl.texi + + @node GNU Free Documentation License +-- +2.14.3 + diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index 440c8df..591f01e 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -1,15 +1,23 @@ +From 07fe0dc264430166eb380d3bd0f635f57e8cdcc3 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-glibc-strstr-workaround.patch FileName: gdb-glibc-strstr-workaround.patch +;; Workaround PR libc/14166 for inferior calls of strstr. +;;=fedora: Compatibility with RHELs (unchecked which ones). +--- + gdb/dwarf2read.c | 20 ++++ + .../gdb.base/gnu-ifunc-strstr-workaround.exp | 108 +++++++++++++++++++++ + 2 files changed, 128 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -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 +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index ef624ada33..72d15a94d8 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -20082,6 +20082,26 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* 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); @@ -36,10 +44,11 @@ Index: gdb-7.7.90.20140613/gdb/dwarf2read.c 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 +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 +index 0000000000..5469cd7354 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp @@ -0,0 +1,108 @@ +# Copyright (C) 2012 Free Software Foundation, Inc. + @@ -149,3 +158,6 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.ex + +gdb_test {print strstr("abc","b")} { = 0x[0-9a-f]+ "bc"} +gdb_test {print strstr("def","e")} { = 0x[0-9a-f]+ "ef"} +-- +2.14.3 + diff --git a/gdb-glibc-vdso-workaround.patch b/gdb-glibc-vdso-workaround.patch index b0031ec..f3a68ca 100644 --- a/gdb-glibc-vdso-workaround.patch +++ b/gdb-glibc-vdso-workaround.patch @@ -1,13 +1,15 @@ +From c1d744fe54aa2c83e0037a1d2a72fdc57163225f Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [RFC] Work around PR libc/13097 "linux-vdso.so.1" #2 +Subject: Work around PR libc/13097 "linux-vdso.so.1" #2 FileName: gdb-glibc-vdso-workaround.patch +;; Work around PR libc/13097 "linux-vdso.so.1" warning message. +;;=push+jan http://sourceware.org/ml/gdb-patches/2011-08/msg00331.html - Hi, missed the x86_64-m32 case: @@ -17,12 +19,15 @@ gdb/ Work around PR libc/13097. * solib.c (update_solib_list): Ignore "linux-vdso.so.1". +--- + gdb/solib.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) -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 +diff --git a/gdb/solib.c b/gdb/solib.c +index cb7a5c0b51..511671ea9d 100644 +--- a/gdb/solib.c ++++ b/gdb/solib.c +@@ -884,8 +884,11 @@ update_solib_list (int from_tty) TRY { @@ -36,3 +41,6 @@ Index: gdb-7.9.50.20150520/gdb/solib.c { not_found++; if (not_found_filename == NULL) +-- +2.14.3 + diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index d1a78bc..ad8c648 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -1,13 +1,15 @@ +From caf1c14f0fd0a4e097265703c6ff47d95902a890 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [patch] gdb_assert -> complaint for weird DWARF +Subject: gdb_assert -> complaint for weird DWARF FileName: gdb-gnat-dwarf-crash-3of3.patch +;; Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). +;;=push+jan + http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html - - --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline @@ -27,7 +29,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 @@ -39,16 +40,18 @@ gdb/ 2014-02-24 Jan Kratochvil * dwarf2read.c (process_die): Change gdb_assert to complaint. +--- + gdb/dwarf2read.c | 8 ++++++++ + 1 file changed, 8 insertions(+) -Index: gdb-7.99.90.20170420/gdb/dwarf2read.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/dwarf2read.c 2017-04-20 23:15:26.578897210 +0200 -+++ gdb-7.99.90.20170420/gdb/dwarf2read.c 2017-04-20 23:15:57.805106371 +0200 -@@ -8426,7 +8426,13 @@ - struct cleanup *in_process; - - /* We should only be processing those not already in process. */ -- gdb_assert (!die->in_process); +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index f14f5b563a..49b2658ade 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -9424,6 +9424,14 @@ private: + static void + process_die (struct die_info *die, struct dwarf2_cu *cu) + { + if (die->in_process) + { + complaint (&symfile_complaints, @@ -56,6 +59,10 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2read.c + to_underlying (die->sect_off)); + return; + } ++ + process_die_scope scope (die, cu); - die->in_process = 1; - in_process = make_cleanup (reset_die_in_process,die); + switch (die->tag) +-- +2.14.3 + diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch index 4ed017b..a9344d4 100644 --- a/gdb-jit-reader-multilib.patch +++ b/gdb-jit-reader-multilib.patch @@ -1,14 +1,22 @@ +From 7f5262c329f8109429a4b373ed4ca991c44a2705 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-jit-reader-multilib.patch FileName: gdb-jit-reader-multilib.patch +;; Fix jit-reader.h for multi-lib. +;;=push+jan +--- + gdb/configure | 8 +++++--- + gdb/configure.ac | 8 +++++--- + 2 files changed, 10 insertions(+), 6 deletions(-) + diff --git a/gdb/configure b/gdb/configure -index 7ff74ba..00a5b5b 100755 +index d99f28b9f2..01210afccc 100755 --- a/gdb/configure +++ b/gdb/configure -@@ -7382,10 +7382,12 @@ _ACEOF +@@ -9528,10 +9528,12 @@ _ACEOF @@ -25,10 +33,10 @@ index 7ff74ba..00a5b5b 100755 TARGET_PTR="unsigned __int128" else diff --git a/gdb/configure.ac b/gdb/configure.ac -index ec776d7..c02ace9 100644 +index 830618dbe5..8c6a5f7d1e 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -648,10 +648,12 @@ AC_CHECK_SIZEOF(unsigned long long) +@@ -832,10 +832,12 @@ AC_CHECK_SIZEOF(unsigned long long) AC_CHECK_SIZEOF(unsigned long) AC_CHECK_SIZEOF(unsigned __int128) @@ -44,3 +52,6 @@ index ec776d7..c02ace9 100644 elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then TARGET_PTR="unsigned __int128" else +-- +2.14.3 + diff --git a/gdb-libexec-add-index.patch b/gdb-libexec-add-index.patch index 304410a..640a179 100644 --- a/gdb-libexec-add-index.patch +++ b/gdb-libexec-add-index.patch @@ -1,11 +1,18 @@ +From 65eeeb0ebc2b0fdd57cf80cf4d361859988fa902 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-libexec-add-index.patch FileName: gdb-libexec-add-index.patch +;; Fix gdb-headless /usr/bin/ executables (BZ 1390251). +;;=fedora +--- + gdb/contrib/gdb-add-index.sh | 5 +++++ + 1 file changed, 5 insertions(+) + diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh -index cca7153..73181ec 100755 +index 0cd4ce3c9d..c34058d1d6 100755 --- a/gdb/contrib/gdb-add-index.sh +++ b/gdb/contrib/gdb-add-index.sh @@ -21,6 +21,11 @@ @@ -20,3 +27,6 @@ index cca7153..73181ec 100755 myname="${0##*/}" if test $# != 1; then +-- +2.14.3 + diff --git a/gdb-lineno-makeup-test.patch b/gdb-lineno-makeup-test.patch index a8be6e1..87b4374 100644 --- a/gdb-lineno-makeup-test.patch +++ b/gdb-lineno-makeup-test.patch @@ -1,9 +1,12 @@ +From efa504a63f3e9ec2fa0ec3f38e525122030e4111 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-lineno-makeup-test.patch FileName: gdb-lineno-makeup-test.patch +;; Testcase for "Do not make up line information" fix by Daniel Jacobowitz. +;;=fedoratest New testcase for: https://bugzilla.redhat.com/show_bug.cgi?id=466222 @@ -12,11 +15,20 @@ and the upstream fix: http://sourceware.org/ml/gdb-patches/2006-11/msg00253.html [rfc] Do not make up line information http://sourceware.org/ml/gdb-cvs/2006-11/msg00127.html +--- + gdb/testsuite/gdb.base/lineno-makeup-func.c | 21 ++++++++ + gdb/testsuite/gdb.base/lineno-makeup.c | 35 +++++++++++++ + gdb/testsuite/gdb.base/lineno-makeup.exp | 78 +++++++++++++++++++++++++++++ + 3 files changed, 134 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/lineno-makeup-func.c + create mode 100644 gdb/testsuite/gdb.base/lineno-makeup.c + create mode 100644 gdb/testsuite/gdb.base/lineno-makeup.exp -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup-func.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup-func.c 2016-02-15 23:29:16.595161971 +0100 +diff --git a/gdb/testsuite/gdb.base/lineno-makeup-func.c b/gdb/testsuite/gdb.base/lineno-makeup-func.c +new file mode 100644 +index 0000000000..1a0220ea52 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/lineno-makeup-func.c @@ -0,0 +1,21 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -39,10 +51,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup-func.c +func (void) +{ +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup.c 2016-02-15 23:29:23.873213646 +0100 +diff --git a/gdb/testsuite/gdb.base/lineno-makeup.c b/gdb/testsuite/gdb.base/lineno-makeup.c +new file mode 100644 +index 0000000000..5d4be90999 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/lineno-makeup.c @@ -0,0 +1,35 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -79,10 +92,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup.c + func (); + return 0; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup.exp 2016-02-15 23:29:23.873213646 +0100 +diff --git a/gdb/testsuite/gdb.base/lineno-makeup.exp b/gdb/testsuite/gdb.base/lineno-makeup.exp +new file mode 100644 +index 0000000000..9e11d78bf9 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/lineno-makeup.exp @@ -0,0 +1,78 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -162,3 +176,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/lineno-makeup.exp + fail $test + } +} +-- +2.14.3 + diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index f79a7a4..91b469f 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -1,13 +1,73 @@ +From 3ab88d9e69b2c75a3cbbe9a7bfcb148a0f0b2729 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-linux_perf-bundle.patch FileName: gdb-linux_perf-bundle.patch -Index: gdb-7.11.90.20160904/gdb/nat/linux-btrace.h -=================================================================== ---- gdb-7.11.90.20160904.orig/gdb/nat/linux-btrace.h 2016-09-04 04:02:13.000000000 +0200 -+++ gdb-7.11.90.20160904/gdb/nat/linux-btrace.h 2016-09-04 20:11:47.375275492 +0200 +;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). +;;=fedora +--- + gdb/configure | 2 +- + gdb/configure.ac | 2 +- + gdb/gdb.c | 8 +++ + gdb/nat/linux-btrace.h | 171 +++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 181 insertions(+), 2 deletions(-) + +diff --git a/gdb/configure b/gdb/configure +index c1186fd294..1cc220d281 100755 +--- a/gdb/configure ++++ b/gdb/configure +@@ -11907,7 +11907,7 @@ else + + #include + #ifndef PERF_ATTR_SIZE_VER5 +-# error ++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL + #endif + + _ACEOF +diff --git a/gdb/configure.ac b/gdb/configure.ac +index c7d5f2de99..0bd9fcace9 100644 +--- a/gdb/configure.ac ++++ b/gdb/configure.ac +@@ -1466,7 +1466,7 @@ else + AC_PREPROC_IFELSE(AC_LANG_SOURCE([[ + #include + #ifndef PERF_ATTR_SIZE_VER5 +-# error ++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL + #endif + ]]), [perf_event=yes], [perf_event=no]) + if test "$perf_event" != yes; then +diff --git a/gdb/gdb.c b/gdb/gdb.c +index fbf6711203..8dcde4e6d8 100644 +--- a/gdb/gdb.c ++++ b/gdb/gdb.c +@@ -20,11 +20,19 @@ + #include "main.h" + #include "interps.h" + ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE ++extern "C" void __libipt_init(void); ++#endif ++ + int + main (int argc, char **argv) + { + struct captured_main_args args; + ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE ++ __libipt_init(); ++#endif ++ + memset (&args, 0, sizeof args); + args.argc = argc; + args.argv = argv; +diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h +index c08b2eb9ae..4b4f22f5ec 100644 +--- a/gdb/nat/linux-btrace.h ++++ b/gdb/nat/linux-btrace.h @@ -28,6 +28,177 @@ # include #endif @@ -186,53 +246,6 @@ Index: gdb-7.11.90.20160904/gdb/nat/linux-btrace.h struct target_ops; #if HAVE_LINUX_PERF_EVENT_H -Index: gdb-7.11.90.20160904/gdb/configure -=================================================================== ---- gdb-7.11.90.20160904.orig/gdb/configure 2016-09-04 20:11:47.238274285 +0200 -+++ gdb-7.11.90.20160904/gdb/configure 2016-09-04 20:11:47.378275519 +0200 -@@ -10601,7 +10601,7 @@ - - #include - #ifndef PERF_ATTR_SIZE_VER5 --# error -+// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL - #endif - - _ACEOF -Index: gdb-7.11.90.20160904/gdb/configure.ac -=================================================================== ---- gdb-7.11.90.20160904.orig/gdb/configure.ac 2016-09-04 20:11:47.238274285 +0200 -+++ gdb-7.11.90.20160904/gdb/configure.ac 2016-09-04 20:11:47.379275528 +0200 -@@ -1461,7 +1461,7 @@ - AC_PREPROC_IFELSE(AC_LANG_SOURCE([[ - #include - #ifndef PERF_ATTR_SIZE_VER5 --# error -+// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL - #endif - ]]), [perf_event=yes], [perf_event=no]) - if test "$perf_event" != yes; then -Index: gdb-7.11.90.20160904/gdb/gdb.c -=================================================================== ---- gdb-7.11.90.20160904.orig/gdb/gdb.c 2016-09-04 04:02:13.000000000 +0200 -+++ gdb-7.11.90.20160904/gdb/gdb.c 2016-09-04 20:12:28.018633552 +0200 -@@ -20,11 +20,19 @@ - #include "main.h" - #include "interps.h" - -+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE -+extern "C" void __libipt_init(void); -+#endif -+ - int - main (int argc, char **argv) - { - struct captured_main_args args; - -+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE -+ __libipt_init(); -+#endif -+ - memset (&args, 0, sizeof args); - args.argc = argc; - args.argv = argv; +-- +2.14.3 + diff --git a/gdb-moribund-utrace-workaround.patch b/gdb-moribund-utrace-workaround.patch index f75f129..031684f 100644 --- a/gdb-moribund-utrace-workaround.patch +++ b/gdb-moribund-utrace-workaround.patch @@ -1,18 +1,26 @@ +From 53e7056c653cd49e558e008e3a0cd77cb91979df Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-moribund-utrace-workaround.patch FileName: gdb-moribund-utrace-workaround.patch +;; Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). +;;=push+jan: Currently it is still not fully safe. https://bugzilla.redhat.com/show_bug.cgi?id=590623 http://sources.redhat.com/bugzilla/show_bug.cgi?id=11593 Bug in FSF GDB exploited by the ptrace-on-utrace interaction. +--- + gdb/breakpoint.c | 2 ++ + 1 file changed, 2 insertions(+) +diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c +index 269928a794..fb129bf38a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -9084,6 +9084,8 @@ update_global_location_list (int should_insert) +@@ -12105,6 +12105,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) traps we can no longer explain. */ old_loc->events_till_retirement = 3 * (thread_count () + 1); @@ -21,3 +29,6 @@ Bug in FSF GDB exploited by the ptrace-on-utrace interaction. old_loc->owner = NULL; VEC_safe_push (bp_location_p, moribund_locations, old_loc); +-- +2.14.3 + diff --git a/gdb-opcodes-clflushopt-test.patch b/gdb-opcodes-clflushopt-test.patch index eea5048..18b0554 100644 --- a/gdb-opcodes-clflushopt-test.patch +++ b/gdb-opcodes-clflushopt-test.patch @@ -1,11 +1,49 @@ +From 894719f8a3979afa082ce377ce7d9536db552b5c Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-opcodes-clflushopt-test.patch FileName: gdb-opcodes-clflushopt-test.patch ---- /dev/null 2016-01-16 21:50:55.732812229 +0100 -+++ gdb-7.6.1/gdb/testsuite/gdb.arch/amd64-clflushopt.exp 2016-01-16 22:49:19.950683918 +0100 +;; Test clflushopt instruction decode (for RH BZ 1262471). +;;=fedoratest +--- + gdb/testsuite/gdb.arch/amd64-clflushopt.S | 19 +++++++++++++++++++ + gdb/testsuite/gdb.arch/amd64-clflushopt.exp | 25 +++++++++++++++++++++++++ + 2 files changed, 44 insertions(+) + create mode 100644 gdb/testsuite/gdb.arch/amd64-clflushopt.S + create mode 100644 gdb/testsuite/gdb.arch/amd64-clflushopt.exp + +diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.S b/gdb/testsuite/gdb.arch/amd64-clflushopt.S +new file mode 100644 +index 0000000000..dee4f006dc +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/amd64-clflushopt.S +@@ -0,0 +1,19 @@ ++/* 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 . ++ ++ This file is part of the gdb testsuite. */ ++ ++_start: .globl _start ++ clflushopt (%edi) +diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.exp b/gdb/testsuite/gdb.arch/amd64-clflushopt.exp +new file mode 100644 +index 0000000000..22a9decee2 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/amd64-clflushopt.exp @@ -0,0 +1,25 @@ +# Copyright 2016 Free Software Foundation, Inc. + @@ -32,25 +70,6 @@ FileName: gdb-opcodes-clflushopt-test.patch +} + +gdb_test "disas _start" "Dump of assembler code for function _start:\r\n *0x\[0-9a-f\]+ <\[+\]0>:\tclflushopt \\(%edi\\)\r\nEnd of assembler dump\\." "clflushopt" ---- /dev/null 2016-01-16 21:50:55.732812229 +0100 -+++ gdb-7.6.1/gdb/testsuite/gdb.arch/amd64-clflushopt.S 2016-01-16 22:49:26.398725209 +0100 -@@ -0,0 +1,19 @@ -+/* 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 . -+ -+ This file is part of the gdb testsuite. */ -+ -+_start: .globl _start -+ clflushopt (%edi) +-- +2.14.3 + diff --git a/gdb-physname-pr11734-test.patch b/gdb-physname-pr11734-test.patch index 9869998..8f95693 100644 --- a/gdb-physname-pr11734-test.patch +++ b/gdb-physname-pr11734-test.patch @@ -1,16 +1,34 @@ +From 99a10c8c5b41de19d0f19b8eb639419545f4a080 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-physname-pr11734-test.patch FileName: gdb-physname-pr11734-test.patch +;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). +;;=fedoratest http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html +--- + gdb/testsuite/gdb.cp/pr11734-1.cc | 30 +++++++++++++++++++++ + gdb/testsuite/gdb.cp/pr11734-2.cc | 27 +++++++++++++++++++ + gdb/testsuite/gdb.cp/pr11734-3.cc | 27 +++++++++++++++++++ + gdb/testsuite/gdb.cp/pr11734-4.cc | 27 +++++++++++++++++++ + gdb/testsuite/gdb.cp/pr11734.exp | 55 +++++++++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.cp/pr11734.h | 28 ++++++++++++++++++++ + 6 files changed, 194 insertions(+) + create mode 100644 gdb/testsuite/gdb.cp/pr11734-1.cc + create mode 100644 gdb/testsuite/gdb.cp/pr11734-2.cc + create mode 100644 gdb/testsuite/gdb.cp/pr11734-3.cc + create mode 100644 gdb/testsuite/gdb.cp/pr11734-4.cc + create mode 100644 gdb/testsuite/gdb.cp/pr11734.exp + create mode 100644 gdb/testsuite/gdb.cp/pr11734.h -Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc 2011-02-03 22:28:01.000000000 +0100 +diff --git a/gdb/testsuite/gdb.cp/pr11734-1.cc b/gdb/testsuite/gdb.cp/pr11734-1.cc +new file mode 100644 +index 0000000000..f3480ce977 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/pr11734-1.cc @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -42,10 +60,11 @@ Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc + return 0; +} + -Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc 2011-02-03 22:28:01.000000000 +0100 +diff --git a/gdb/testsuite/gdb.cp/pr11734-2.cc b/gdb/testsuite/gdb.cp/pr11734-2.cc +new file mode 100644 +index 0000000000..dbebe8281a +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/pr11734-2.cc @@ -0,0 +1,27 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -74,10 +93,11 @@ Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc +{ +} + -Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc 2011-02-03 22:28:01.000000000 +0100 +diff --git a/gdb/testsuite/gdb.cp/pr11734-3.cc b/gdb/testsuite/gdb.cp/pr11734-3.cc +new file mode 100644 +index 0000000000..faaeffc9dd +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/pr11734-3.cc @@ -0,0 +1,27 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -106,10 +126,11 @@ Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc +{ +} + -Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc 2011-02-03 22:28:01.000000000 +0100 +diff --git a/gdb/testsuite/gdb.cp/pr11734-4.cc b/gdb/testsuite/gdb.cp/pr11734-4.cc +new file mode 100644 +index 0000000000..6edf8110f1 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/pr11734-4.cc @@ -0,0 +1,27 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -138,10 +159,11 @@ Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc +{ +} + -Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp 2011-02-03 22:28:01.000000000 +0100 +diff --git a/gdb/testsuite/gdb.cp/pr11734.exp b/gdb/testsuite/gdb.cp/pr11734.exp +new file mode 100644 +index 0000000000..e731d422f6 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/pr11734.exp @@ -0,0 +1,55 @@ +# Copyright 2010 Free Software Foundation, Inc. +# @@ -198,10 +220,11 @@ Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp + +gdb_exit +return 0 -Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h 2011-02-03 22:28:01.000000000 +0100 +diff --git a/gdb/testsuite/gdb.cp/pr11734.h b/gdb/testsuite/gdb.cp/pr11734.h +new file mode 100644 +index 0000000000..7f6e72a685 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/pr11734.h @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -231,3 +254,6 @@ Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h + void foo (char *); +}; + +-- +2.14.3 + diff --git a/gdb-physname-pr12273-test.patch b/gdb-physname-pr12273-test.patch index 4c95c79..c0e71c8 100644 --- a/gdb-physname-pr12273-test.patch +++ b/gdb-physname-pr12273-test.patch @@ -1,16 +1,26 @@ +From be5736d56f84d924bd4dd82bf2cfbc7f0c07bc70 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-physname-pr12273-test.patch FileName: gdb-physname-pr12273-test.patch +;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). +;;=fedoratest http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html +--- + gdb/testsuite/gdb.cp/pr12273.cc | 37 ++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.cp/pr12273.exp | 46 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 83 insertions(+) + create mode 100644 gdb/testsuite/gdb.cp/pr12273.cc + create mode 100644 gdb/testsuite/gdb.cp/pr12273.exp -Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc 2011-02-03 22:31:01.000000000 +0100 +diff --git a/gdb/testsuite/gdb.cp/pr12273.cc b/gdb/testsuite/gdb.cp/pr12273.cc +new file mode 100644 +index 0000000000..79dd7bad74 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/pr12273.cc @@ -0,0 +1,37 @@ +/* This test case is part of GDB, the GNU debugger. + @@ -49,10 +59,11 @@ Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc + + GDB::even_harder ('a'); + return GDB::simple (); +} -Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp 2011-02-03 22:31:01.000000000 +0100 +diff --git a/gdb/testsuite/gdb.cp/pr12273.exp b/gdb/testsuite/gdb.cp/pr12273.exp +new file mode 100644 +index 0000000000..9d71482742 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/pr12273.exp @@ -0,0 +1,46 @@ +# Copyright 2010 Free Software Foundation, Inc. +# @@ -100,3 +111,6 @@ Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp +} + +gdb_exit +-- +2.14.3 + diff --git a/gdb-ppc-power7-test.patch b/gdb-ppc-power7-test.patch index d7e26b5..3e66368 100644 --- a/gdb-ppc-power7-test.patch +++ b/gdb-ppc-power7-test.patch @@ -1,10 +1,22 @@ +From 64acd14a4531db2271ea2aba924fea90d52ccb02 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-ppc-power7-test.patch FileName: gdb-ppc-power7-test.patch +;; Test power7 ppc disassembly. +;;=fedoratest +--- + gdb/testsuite/gdb.arch/powerpc-power7rh.exp | 178 ++++++++++++++++++++++++++++ + gdb/testsuite/gdb.arch/powerpc-power7rh.s | 107 +++++++++++++++++ + 2 files changed, 285 insertions(+) + create mode 100644 gdb/testsuite/gdb.arch/powerpc-power7rh.exp + create mode 100644 gdb/testsuite/gdb.arch/powerpc-power7rh.s +diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.exp b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp +new file mode 100644 +index 0000000000..0c2bbdaede --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp @@ -0,0 +1,178 @@ @@ -186,6 +198,9 @@ FileName: gdb-ppc-power7-test.patch +func_check 0x194 "frsqrtes f14,f15" +func_check 0x198 "frsqrtes. f14,f15" +func_check 0x19c "isel r2,r3,r4,28" +diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.s b/gdb/testsuite/gdb.arch/powerpc-power7rh.s +new file mode 100644 +index 0000000000..98b2e797e7 --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-power7rh.s @@ -0,0 +1,107 @@ @@ -296,3 +311,6 @@ FileName: gdb-ppc-power7-test.patch + .long 0xedc07834 /* 194: frsqrtes f14,f15 */ + .long 0xedc07835 /* 198: frsqrtes. f14,f15 */ + .long 0x7c43271e /* 19c: isel r2,r3,r4,28 */ +-- +2.14.3 + diff --git a/gdb-python-gil.patch b/gdb-python-gil.patch index 1538a14..abb91cc 100644 --- a/gdb-python-gil.patch +++ b/gdb-python-gil.patch @@ -1,14 +1,29 @@ +From 8c40408dadd86bcbb319173bab665b9fc6d12f72 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-python-gil.patch FileName: gdb-python-gil.patch -Index: gdb-7.99.90.20170420/gdb/doc/python.texi -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/doc/python.texi 2017-04-20 23:16:30.895328018 +0200 -+++ gdb-7.99.90.20170420/gdb/doc/python.texi 2017-04-20 23:16:35.690360136 +0200 -@@ -230,6 +230,14 @@ +;; Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957). +;;=push +--- + gdb/doc/python.texi | 8 ++++ + gdb/python/python-internal.h | 2 + + gdb/python/python.c | 42 +++++++++++++++--- + gdb/testsuite/gdb.python/py-gil-mthread.c | 13 ++++++ + gdb/testsuite/gdb.python/py-gil-mthread.exp | 69 +++++++++++++++++++++++++++++ + gdb/testsuite/gdb.python/py-gil-mthread.py | 28 ++++++++++++ + 6 files changed, 157 insertions(+), 5 deletions(-) + create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.c + create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.exp + create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.py + +diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi +index f411f60d7e..01243c7c7d 100644 +--- a/gdb/doc/python.texi ++++ b/gdb/doc/python.texi +@@ -232,6 +232,14 @@ returned as a string. The default is @code{False}, in which case the return value is @code{None}. If @var{to_string} is @code{True}, the @value{GDBN} virtual terminal will be temporarily set to unlimited width and height, and its pagination will be disabled; @pxref{Screen Size}. @@ -23,11 +38,11 @@ Index: gdb-7.99.90.20170420/gdb/doc/python.texi @end defun @findex gdb.breakpoints -Index: gdb-7.99.90.20170420/gdb/python/python-internal.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/python/python-internal.h 2017-04-20 23:16:30.896328024 +0200 -+++ gdb-7.99.90.20170420/gdb/python/python-internal.h 2017-04-20 23:16:35.690360136 +0200 -@@ -142,6 +142,8 @@ +diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h +index 8fc8cc5a5d..f099ae437f 100644 +--- a/gdb/python/python-internal.h ++++ b/gdb/python/python-internal.h +@@ -142,6 +142,8 @@ typedef int Py_ssize_t; #define PyGILState_Release(ARG) ((void)(ARG)) #define PyEval_InitThreads() #define PyThreadState_Swap(ARG) ((void)(ARG)) @@ -36,11 +51,11 @@ Index: gdb-7.99.90.20170420/gdb/python/python-internal.h #define PyEval_ReleaseLock() #endif -Index: gdb-7.99.90.20170420/gdb/python/python.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/python/python.c 2017-04-20 23:16:30.897328031 +0200 -+++ gdb-7.99.90.20170420/gdb/python/python.c 2017-04-20 23:18:11.377001070 +0200 -@@ -594,12 +594,16 @@ +diff --git a/gdb/python/python.c b/gdb/python/python.c +index c29a46b448..0f71a4335e 100644 +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -554,12 +554,16 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) { const char *arg; PyObject *from_tty_obj = NULL, *to_string_obj = NULL; @@ -61,7 +76,7 @@ Index: gdb-7.99.90.20170420/gdb/python/python.c return NULL; from_tty = 0; -@@ -620,6 +624,15 @@ +@@ -580,12 +584,28 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) to_string = cmp; } @@ -77,8 +92,7 @@ Index: gdb-7.99.90.20170420/gdb/python/python.c std::string to_string_res; TRY -@@ -628,6 +641,13 @@ - std::string copy (arg); + { struct interp *interp; + /* In the case of long running GDB commands, allow the user to @@ -91,10 +105,10 @@ Index: gdb-7.99.90.20170420/gdb/python/python.c scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0); scoped_restore save_uiout = make_scoped_restore (¤t_uiout); -@@ -642,10 +662,22 @@ - to_string_res = execute_command_to_string (©[0], from_tty); +@@ -600,10 +620,22 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) + to_string_res = execute_command_to_string (arg, from_tty); else - execute_command (©[0], from_tty); + execute_command (arg, from_tty); + + /* Reacquire the GIL if it was released earlier. */ + if (release_gil) @@ -115,10 +129,11 @@ Index: gdb-7.99.90.20170420/gdb/python/python.c } END_CATCH -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.c 2017-04-20 23:16:35.691360143 +0200 +diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.c b/gdb/testsuite/gdb.python/py-gil-mthread.c +new file mode 100644 +index 0000000000..1a12fc9c6d +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-gil-mthread.c @@ -0,0 +1,13 @@ +#include +#include @@ -133,10 +148,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.c + printf ("Sleeping %d\n", i); + } +} -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.exp 2017-04-20 23:16:35.691360143 +0200 +diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.exp b/gdb/testsuite/gdb.python/py-gil-mthread.exp +new file mode 100644 +index 0000000000..a89c16a45b +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-gil-mthread.exp @@ -0,0 +1,69 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -207,10 +223,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.exp + } + } +} -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.py -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.py 2017-04-20 23:16:35.692360149 +0200 +diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.py b/gdb/testsuite/gdb.python/py-gil-mthread.py +new file mode 100644 +index 0000000000..6a89964139 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-gil-mthread.py @@ -0,0 +1,28 @@ +try: + import thread @@ -240,3 +257,6 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.python/py-gil-mthread.py + +while 1: + pass +-- +2.14.3 + diff --git a/gdb-readline62-ask-more-rh.patch b/gdb-readline62-ask-more-rh.patch index d7cf154..ac8dbb9 100644 --- a/gdb-readline62-ask-more-rh.patch +++ b/gdb-readline62-ask-more-rh.patch @@ -1,14 +1,21 @@ +From d41f92047a8f2c1e1f31ff8939b2215862bce183 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-readline62-ask-more-rh.patch FileName: gdb-readline62-ask-more-rh.patch -Index: gdb-7.11.50.20160630/gdb/event-top.c -=================================================================== ---- gdb-7.11.50.20160630.orig/gdb/event-top.c 2016-07-03 16:32:36.108342159 +0200 -+++ gdb-7.11.50.20160630/gdb/event-top.c 2016-07-03 16:32:59.787523733 +0200 -@@ -1252,6 +1252,13 @@ +;; Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). +;;=fedora +--- + gdb/event-top.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/gdb/event-top.c b/gdb/event-top.c +index a1866f0c88..e7d3c1fc20 100644 +--- a/gdb/event-top.c ++++ b/gdb/event-top.c +@@ -1182,6 +1182,13 @@ gdb_setup_readline (int editing) { struct ui *ui = current_ui; @@ -22,3 +29,6 @@ Index: gdb-7.11.50.20160630/gdb/event-top.c /* This function is a noop for the sync case. The assumption is that the sync setup is ALL done in gdb_init, and we would only mess it up here. The sync stuff should really go away over +-- +2.14.3 + diff --git a/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch b/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch index e6ee120..521977e 100644 --- a/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +++ b/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch @@ -1,14 +1,24 @@ +From c2ad117a09b02ba7ec04f6f3e100969f4323fe8f Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch FileName: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +;; Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). +;;=fedoratest +--- + gdb/testsuite/gdb.base/set-solib-absolute-prefix.c | 26 +++++++++++++++ + .../gdb.base/set-solib-absolute-prefix.exp | 39 ++++++++++++++++++++++ + 2 files changed, 65 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/set-solib-absolute-prefix.c + create mode 100644 gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp -Index: gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c -=================================================================== +diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c +new file mode 100644 +index 0000000000..2675a34f1a --- /dev/null -+++ gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c ++++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2012 Free Software Foundation, Inc. + @@ -36,10 +46,11 @@ Index: gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c + printf ("Hello, World.\n"); + abort (); +} -Index: gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp -=================================================================== +diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp +new file mode 100644 +index 0000000000..bb4c8b962b --- /dev/null -+++ gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp ++++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp @@ -0,0 +1,39 @@ +# Copyright 2012 Free Software Foundation, Inc. + @@ -80,3 +91,6 @@ Index: gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp + ".*warning: Unable to find dynamic linker breakpoint function.*" \ + "set solib-absolute-prefix" +gdb_test "bt" "__kernel_vsyscall.*" "backtrace with __kernel_vsyscall" +-- +2.14.3 + diff --git a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch index d188be4..a31fd1e 100644 --- a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +++ b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch @@ -1,9 +1,13 @@ +From 53f60cee25b8e3307ebebdaa826b299db6e4d8d5 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch FileName: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +;; Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) +;;=fedoratest + Original message by Tom Tromey: @@ -25,11 +29,20 @@ Date: Wed Mar 28 17:38:08 2012 +0000 * python/py-inferior.c (infpy_read_memory): Remove cleanups and explicitly free 'buffer' on exit paths. Decref 'membuf_object' before returning. +--- + .../py-gdb-rhbz1007614-memleak-infpy_read_memory.c | 27 +++++++++ + ...y-gdb-rhbz1007614-memleak-infpy_read_memory.exp | 68 ++++++++++++++++++++++ + ...py-gdb-rhbz1007614-memleak-infpy_read_memory.py | 30 ++++++++++ + 3 files changed, 125 insertions(+) + create mode 100644 gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c + create mode 100644 gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp + create mode 100644 gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py -Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c -=================================================================== +diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c +new file mode 100644 +index 0000000000..f2697efa9a --- /dev/null -+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c ++++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c @@ -0,0 +1,27 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -58,10 +71,11 @@ Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_me +{ + return 0; +} -Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp -=================================================================== +diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +new file mode 100644 +index 0000000000..2e6786d499 --- /dev/null -+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp ++++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp @@ -0,0 +1,68 @@ +# Copyright 2014 Free Software Foundation, Inc. + @@ -131,10 +145,11 @@ Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_me +} else { + pass "there is not a memory leak on GDB (RHBZ 1007614)" +} -Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py -=================================================================== +diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py +new file mode 100644 +index 0000000000..e807728047 --- /dev/null -+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py ++++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py @@ -0,0 +1,30 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -166,3 +181,6 @@ Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_me + print "Hello, World!" + +HelloWorld () +-- +2.14.3 + diff --git a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch index c8ec849..56df5b7 100644 --- a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +++ b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch @@ -1,125 +1,33 @@ +From faadc471aba29e9dbf5f134d0bf1d53ed1d488b5 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch FileName: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +;; Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan +;; Kratochvil, RH BZ 1084404). +;;=fedoratest + These testcases have been created by compiling glibc-2.17-78 on RHEL-7.1 s390x/ppc64 boxes, and then taking the "select.o" file present at $builddir/misc/select.o. +--- + gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp | 34 ++++++++++++ + gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu | 70 +++++++++++++++++++++++++ + gdb/testsuite/gdb.arch/s390x-prologue-skip.exp | 34 ++++++++++++ + gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu | 64 ++++++++++++++++++++++ + 4 files changed, 202 insertions(+) + create mode 100644 gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp + create mode 100644 gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu + create mode 100644 gdb/testsuite/gdb.arch/s390x-prologue-skip.exp + create mode 100644 gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu -Index: gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp -=================================================================== +diff --git a/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp +new file mode 100644 +index 0000000000..2f54c1f981 --- /dev/null -+++ gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp -@@ -0,0 +1,34 @@ -+# Copyright 2015 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+if { ![istarget s390x-*linux-*] || ![is_lp64_target] } { -+ verbose "Skipping s390x-prologue-skip.exp" -+ return -+} -+ -+set testfile "s390x-prologue-skip" -+set uufile "${srcdir}/${subdir}/${testfile}.o.uu" -+set ofile "${srcdir}/${subdir}/${testfile}.o" -+ -+if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } { -+ untested "failed uudecode" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_load $ofile -+ -+gdb_test "break select" "Breakpoint $decimal at 0x48: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on select" -Index: gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu -=================================================================== ---- /dev/null -+++ gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu -@@ -0,0 +1,64 @@ -+begin 644 s390x-prologue-skip.o.uu -+M?T5,1@("`0`````````````!`!8````!```````````````````````````` -+M``+```````!```````!``!(`#^LE\!``).O?\&@`)+D$`.^G^_]@X^#P```D -+MP.4`````N00``NLE\+``!`J.N00`TKD$`"#`Y0````"Y!``MZ]_Q"``$I_0` -+M"L`0`````+\/$`"G=/_7"HZG2?`!N2$`),"T``````?^````5@`"````.0$! -+M^PX-``$!`0$````!```!+BXO7-C86QL+71E;7!L -+M871E+E,``0`````)`@```````````]```0)F$P("``$!````CP`"``````@! -+M```````````````````````````N+B]S>7-D97!S+W5N:7@OE(``7@. -+M`1L,#Z`!````````&````!P`````````1`!,CP6.!HT'2`[``@```!`````X -+M`````````"```````"YS>6UT86(`+G-T``````````&````!`````&``````````@````````` -+M&````%<````!``````````````````````````````$"`````````),````` -+M```````````````!``````````````!2````!``````````````````````` -+M```````)^`````````!@````$`````@`````````"``````````8````8P`` -+M``$``````````````````````````````94`````````%``````````````` -+M``````$``````````````'8````!``````````````````````````````&P -+M`````````#`````````````````````0``````````````!Q````!``````` -+M```````````````````````*6``````````P````$`````L`````````"``` -+M```````8````B@````$``````````@```````````````````>`````````` -+M2`````````````````````@``````````````(4````$```````````````` -+M``````````````J(`````````#`````0````#0`````````(`````````!@` -+M```1`````P`````````````````````````````"*`````````"4```````` -+M`````````````0```````````````0````(````````````````````````` -+M````!T`````````!L````!$````*``````````@`````````&`````D````# -+M``````````````````````````````CP`````````(X````````````````` -+M```!`````````````````````````````````````````````````P```0`` -+M`````````````````````````P```P```````````````````````````P`` -+M!````````````````````````````P``"``````````````````````````` -+M`P``"@```````````````````````````P``!@`````````````````````` -+M`````P``"P```````````````````````````P``#0`````````````````` -+M`````````P``!0`````````````````````````!$``````````````````` -+M```````````;$``````````````````````````````V$@```0````````!( -+M`````````"`````_$`````````````````````````````!7$@```0`````` -+M``!6`````````!````!I$`````````````````````````````!Y(@```0`` -+M``````!(`````````"````"'(@```0````````!(`````````"``7U]L:6)C -+M7V5N86)L95]A. ++ ++if { ![istarget s390x-*linux-*] || ![is_lp64_target] } { ++ verbose "Skipping s390x-prologue-skip.exp" ++ return ++} ++ ++set testfile "s390x-prologue-skip" ++set uufile "${srcdir}/${subdir}/${testfile}.o.uu" ++set ofile "${srcdir}/${subdir}/${testfile}.o" ++ ++if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } { ++ untested "failed uudecode" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_load $ofile ++ ++gdb_test "break select" "Breakpoint $decimal at 0x48: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on select" +diff --git a/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu b/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu +new file mode 100644 +index 0000000000..6442e6048d +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu +@@ -0,0 +1,64 @@ ++begin 644 s390x-prologue-skip.o.uu ++M?T5,1@("`0`````````````!`!8````!```````````````````````````` ++M``+```````!```````!``!(`#^LE\!``).O?\&@`)+D$`.^G^_]@X^#P```D ++MP.4`````N00``NLE\+``!`J.N00`TKD$`"#`Y0````"Y!``MZ]_Q"``$I_0` ++M"L`0`````+\/$`"G=/_7"HZG2?`!N2$`),"T``````?^````5@`"````.0$! ++M^PX-``$!`0$````!```!+BXO7-C86QL+71E;7!L ++M871E+E,``0`````)`@```````````]```0)F$P("``$!````CP`"``````@! ++M```````````````````````````N+B]S>7-D97!S+W5N:7@OE(``7@. ++M`1L,#Z`!````````&````!P`````````1`!,CP6.!HT'2`[``@```!`````X ++M`````````"```````"YS>6UT86(`+G-T``````````&````!`````&``````````@````````` ++M&````%<````!``````````````````````````````$"`````````),````` ++M```````````````!``````````````!2````!``````````````````````` ++M```````)^`````````!@````$`````@`````````"``````````8````8P`` ++M``$``````````````````````````````94`````````%``````````````` ++M``````$``````````````'8````!``````````````````````````````&P ++M`````````#`````````````````````0``````````````!Q````!``````` ++M```````````````````````*6``````````P````$`````L`````````"``` ++M```````8````B@````$``````````@```````````````````>`````````` ++M2`````````````````````@``````````````(4````$```````````````` ++M``````````````J(`````````#`````0````#0`````````(`````````!@` ++M```1`````P`````````````````````````````"*`````````"4```````` ++M`````````````0```````````````0````(````````````````````````` ++M````!T`````````!L````!$````*``````````@`````````&`````D````# ++M``````````````````````````````CP`````````(X````````````````` ++M```!`````````````````````````````````````````````````P```0`` ++M`````````````````````````P```P```````````````````````````P`` ++M!````````````````````````````P``"``````````````````````````` ++M`P``"@```````````````````````````P``!@`````````````````````` ++M`````P``"P```````````````````````````P``#0`````````````````` ++M`````````P``!0`````````````````````````!$``````````````````` ++M```````````;$``````````````````````````````V$@```0````````!( ++M`````````"`````_$`````````````````````````````!7$@```0`````` ++M``!6`````````!````!I$`````````````````````````````!Y(@```0`` ++M``````!(`````````"````"'(@```0````````!(`````````"``7U]L:6)C ++M7V5N86)L95]A Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1149205-catch-syscall-after-fork-test.patch FileName: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +;; Fix '`catch syscall' doesn't work for parent after `fork' is called' +;; (Philippe Waroquiers, RH BZ 1149205). +;;=fedoratest + URL: Message-ID: <1368136582.30058.7.camel@soleil> @@ -38,11 +43,18 @@ Author: Philippe Waroquiers Date: Tue May 21 18:47:05 2013 +0000 Fix internal error caused by interaction between catch signal and fork +--- + .../gdb.base/gdb-rhbz1149205-catch-syscall-fork.c | 11 ++++ + .../gdb-rhbz1149205-catch-syscall-fork.exp | 58 ++++++++++++++++++++++ + 2 files changed, 69 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c + create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp -Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c 2016-10-20 21:03:09.584272695 +0200 +diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c +new file mode 100644 +index 0000000000..947258e22f +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c @@ -0,0 +1,11 @@ +#include +#include @@ -55,10 +67,11 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c + chdir ("."); + return 0; +} -Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp 2016-10-20 21:04:13.337771174 +0200 +diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp +new file mode 100644 +index 0000000000..96d31d7018 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp @@ -0,0 +1,58 @@ +# Copyright 2015 Free Software Foundation, Inc. + @@ -118,3 +131,6 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp +gdb_test "continue" \ + "Continuing\.\r\n.*\r\nCatchpoint $decimal \\\(call to syscall .?chdir.?.*" \ + "continue from catch syscall after fork" +-- +2.14.3 + diff --git a/gdb-rhbz1156192-recursive-dlopen-test.patch b/gdb-rhbz1156192-recursive-dlopen-test.patch index 3497b67..9d93588 100644 --- a/gdb-rhbz1156192-recursive-dlopen-test.patch +++ b/gdb-rhbz1156192-recursive-dlopen-test.patch @@ -1,13 +1,29 @@ +From 4a9709d745aea900c19554f51cf526800db020df Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1156192-recursive-dlopen-test.patch FileName: gdb-rhbz1156192-recursive-dlopen-test.patch -Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c 2016-10-22 22:10:13.262634144 +0200 +;; Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to +;; crash.' (RH BZ 1156192). +;;=fedoratest +--- + .../gdb-rhbz1156192-recursive-dlopen-libbar.c | 30 +++++ + .../gdb-rhbz1156192-recursive-dlopen-libfoo.c | 30 +++++ + .../gdb.base/gdb-rhbz1156192-recursive-dlopen.c | 124 +++++++++++++++++++ + .../gdb.base/gdb-rhbz1156192-recursive-dlopen.exp | 137 +++++++++++++++++++++ + 4 files changed, 321 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c + create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c + create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c + create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp + +diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c +new file mode 100644 +index 0000000000..6ecf50d2ad +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c @@ -0,0 +1,30 @@ +/* Testcase for recursive dlopen calls. + @@ -39,10 +55,11 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c +{ + printf ("Called bar.\n"); +} -Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c 2016-10-22 22:10:13.262634144 +0200 +diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c +new file mode 100644 +index 0000000000..e4523933db +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c @@ -0,0 +1,30 @@ +/* Testcase for recursive dlopen calls. + @@ -74,10 +91,11 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c +{ + printf ("Called foo.\n"); +} -Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c 2016-10-22 22:10:13.262634144 +0200 +diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c +new file mode 100644 +index 0000000000..17b29904ef +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c @@ -0,0 +1,124 @@ +/* Testcase for recursive dlopen calls. + @@ -203,10 +221,11 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c + + return 0; +} -Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp 2016-10-24 23:21:58.043064177 +0200 +diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp +new file mode 100644 +index 0000000000..2c32676e50 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp @@ -0,0 +1,137 @@ +# Copyright 2014 Free Software Foundation, Inc. +# @@ -345,3 +364,6 @@ Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp +} + +test_stop_on_solib_events +-- +2.14.3 + diff --git a/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch b/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch index db093c6..5d7c890 100644 --- a/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +++ b/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch @@ -1,9 +1,15 @@ +From 8a169d5fbe05765decefd7f33691d57fec963211 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch FileName: gdb-rhbz1186476-internal-error-unqualified-name-re-set-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 + Comments from Sergio Durigan Junior: The "proper" fix for this whole problem would be to backport the @@ -14,11 +20,20 @@ Comments from Sergio Durigan Junior: allows the user to continue the debugging session), and tell the user that, although more than one location was found for his/her breakpoint, only one will be used. +--- + ...-internal-error-unqualified-name-re-set-main.cc | 22 ++++++++++ + ...86476-internal-error-unqualified-name-re-set.cc | 26 +++++++++++ + ...6476-internal-error-unqualified-name-re-set.exp | 51 ++++++++++++++++++++++ + 3 files changed, 99 insertions(+) + create mode 100644 gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc + create mode 100644 gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc + create mode 100644 gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp -Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc 2016-10-20 21:06:31.849854180 +0200 +diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc +new file mode 100644 +index 0000000000..1c9f8eabc1 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc @@ -0,0 +1,22 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -42,10 +57,11 @@ Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified- +{ + return 0; +} -Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc 2016-10-20 21:06:31.850854188 +0200 +diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc +new file mode 100644 +index 0000000000..007854b0c4 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc @@ -0,0 +1,26 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -73,10 +89,11 @@ Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified- + +C a; +C b (1); -Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp 2016-10-20 21:09:33.408270526 +0200 +diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp +new file mode 100644 +index 0000000000..19b2530969 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp @@ -0,0 +1,51 @@ +# Copyright 2015 Free Software Foundation, Inc. + @@ -129,3 +146,6 @@ Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified- +gdb_test "run" + +gdb_test "info break" " in C::C\\(\\) at .* in C::C\\(int\\) at .*" +-- +2.14.3 + diff --git a/gdb-rhbz1228556-bpt-inlined-func-name-1of2.patch b/gdb-rhbz1228556-bpt-inlined-func-name-1of2.patch deleted file mode 100644 index 66b5f91..0000000 --- a/gdb-rhbz1228556-bpt-inlined-func-name-1of2.patch +++ /dev/null @@ -1,142 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1228556-bpt-inlined-func-name-1of2.patch - -FileName: gdb-rhbz1228556-bpt-inlined-func-name-1of2.patch - -commit 06871ae84096ed1672eb76f44cea4d5dbe79ae24 -Author: Pedro Alves -Date: Wed Sep 20 16:12:54 2017 +0100 - - Make "list ambiguous" show symbol names too - - Currently, with an ambiguous "list first,last", we get: - - (gdb) list bar,main - Specified first line 'bar' is ambiguous: - file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97 - file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98 - - This commit makes gdb's output above a bit clearer by printing the - symbol name as well: - - (gdb) list bar,main - Specified first line 'bar' is ambiguous: - file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97, symbol: "bar(A)" - file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98, symbol: "bar(B)" - - And while at it, makes gdb print the symbol name when actually listing - multiple locations too. I.e., before (with "set listsize 2"): - - (gdb) list bar - file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97 - 96 - 97 int bar (A) { return 11; } - file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98 - 97 int bar (A) { return 11; } - 98 int bar (B) { return 22; } - - After: - - (gdb) list bar - file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 97, symbol: "bar(A)" - 96 - 97 int bar (A) { return 11; } - file: "src/gdb/testsuite/gdb.cp/overload.cc", line number: 98, symbol: "bar(B)" - 97 int bar (A) { return 11; } - 98 int bar (B) { return 22; } - - Currently, the result of decoding a linespec loses information about - the original symbol that was found. All we end up with is an address. - This makes it difficult to find the original symbol again to get at - its print name. Fix that by storing a pointer to the symbol in the - sal. We already store the symtab and obj_section, so it feels like a - natural progression to me. This avoids having to do any extra symbol - lookup too. - - gdb/ChangeLog: - 2017-09-20 Pedro Alves - - * cli/cli-cmds.c (list_command): Use print_sal_location. - (print_sal_location): New function. - (ambiguous_line_spec): Use print_sal_location. - * linespec.c (symbol_to_sal): Record the symbol in the sal. - * symtab.c (find_function_start_sal): Likewise. - * symtab.h (symtab_and_line::symbol): New field. - - gdb/testsuite/ChangeLog: - 2017-09-20 Pedro Alves - - * gdb.base/list-ambiguous.exp (test_list_ambiguous_symbol): Expect - symbol names in gdb's output. - * gdb.cp/overload.exp ("list all overloads"): Likewise. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,14 @@ - 2017-09-20 Pedro Alves - -+ * cli/cli-cmds.c (list_command): Use print_sal_location. -+ (print_sal_location): New function. -+ (ambiguous_line_spec): Use print_sal_location. -+ * linespec.c (symbol_to_sal): Record the symbol in the sal. -+ * symtab.c (find_function_start_sal): Likewise. -+ * symtab.h (symtab_and_line::symbol): New field. -+ -+2017-09-20 Pedro Alves -+ - * linespec.c (minsym_found): Handle non-text minsyms. - (symbol_to_sal): Record a sal.pc for non-block, non-label symbols. - -Index: gdb-8.0.1/gdb/linespec.c -=================================================================== ---- gdb-8.0.1.orig/gdb/linespec.c 2017-10-20 21:28:18.444609776 +0200 -+++ gdb-8.0.1/gdb/linespec.c 2017-10-20 21:29:12.382094104 +0200 -@@ -3864,6 +3864,7 @@ - { - init_sal (result); - result->symtab = symbol_symtab (sym); -+ result->symbol = sym; - result->line = SYMBOL_LINE (sym); - result->pc = SYMBOL_VALUE_ADDRESS (sym); - result->pspace = SYMTAB_PSPACE (result->symtab); -@@ -3879,6 +3880,7 @@ - /* We know its line number. */ - init_sal (result); - result->symtab = symbol_symtab (sym); -+ result->symbol = sym; - result->line = SYMBOL_LINE (sym); - result->pspace = SYMTAB_PSPACE (result->symtab); - return 1; -Index: gdb-8.0.1/gdb/symtab.c -=================================================================== ---- gdb-8.0.1.orig/gdb/symtab.c 2017-10-20 21:28:18.446609794 +0200 -+++ gdb-8.0.1/gdb/symtab.c 2017-10-20 21:29:51.390444377 +0200 -@@ -3478,6 +3478,7 @@ - fixup_symbol_section (sym, NULL); - section = SYMBOL_OBJ_SECTION (symbol_objfile (sym), sym); - sal = find_pc_sect_line (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)), section, 0); -+ sal.symbol = sym; - - if (funfirstline && sal.symtab != NULL - && (COMPUNIT_LOCATIONS_VALID (SYMTAB_COMPUNIT (sal.symtab)) -@@ -3501,6 +3502,7 @@ - sal.pspace = current_program_space; - sal.pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)); - sal.section = section; -+ sal.symbol = sym; - } - - if (funfirstline) -Index: gdb-8.0.1/gdb/symtab.h -=================================================================== ---- gdb-8.0.1.orig/gdb/symtab.h 2017-10-20 21:28:21.205634569 +0200 -+++ gdb-8.0.1/gdb/symtab.h 2017-10-20 21:28:40.933811716 +0200 -@@ -1420,6 +1420,7 @@ - struct program_space *pspace; - - struct symtab *symtab; -+ struct symbol *symbol = NULL; - struct obj_section *section; - /* Line number. Line numbers start at 1 and proceed through symtab->nlines. - 0 is never a valid line number; it is used to indicate that line number diff --git a/gdb-rhbz1228556-bpt-inlined-func-name-2of2.patch b/gdb-rhbz1228556-bpt-inlined-func-name-2of2.patch deleted file mode 100644 index e3402ed..0000000 --- a/gdb-rhbz1228556-bpt-inlined-func-name-2of2.patch +++ /dev/null @@ -1,218 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1228556-bpt-inlined-func-name-2of2.patch - -FileName: gdb-rhbz1228556-bpt-inlined-func-name-2of2.patch - -commit 4a27f119f59a44395e0a34b1526cee709e1d3fce -Author: Keith Seitz -Date: Fri Oct 27 10:57:23 2017 -0700 - - Use SaL symbol name when reporting breakpoint locations - - Currently, "info break" can show some (perhaps) unexpected results when - setting a breakpoint on an inlined function: - - (gdb) list - 1 #include - 2 - 3 static inline void foo() - 4 { - 5 printf("Hello world\n"); - 6 } - 7 - 8 int main() - 9 { - 10 foo(); - 11 return 0; - 12 } - 13 - (gdb) b foo - Breakpoint 1 at 0x400434: file foo.c, line 5. - (gdb) i b - Num Type Disp Enb Address What - 1 breakpoint keep y 0x0000000000400434 in main at foo.c:5 - - GDB reported that we understood what "foo" was, but we then report that the - breakpoint is actually set in main. While that is literally true, we can - do a little better. - - This is accomplished by copying the symbol for which the breakpoint was set - into the bp_location. From there, print_breakpoint_location can use this - information to print out symbol information (if available) instead of calling - find_pc_sect_function. - - With the patch installed, - - (gdb) i b - Num Type Disp Enb Address What - 1 breakpoint keep y 0x0000000000400434 in foo at foo.c:5 - - gdb/ChangeLog: - - * breakpoint.c (print_breakpoint_location): Use the symbol saved - in the bp_location, falling back to find_pc_sect_function when - needed. - (add_location_to_breakpoint): Save sal->symbol. - * breakpoint.h (struct bp_location) : New field. - * symtab.c (find_function_start_sal): Save the symbol into the SaL. - * symtab.h (struct symtab_and_line) : New field. - - gdb/testsuite/ChangeLog: - - * gdb.opt/inline-break.exp (break_info_1): New procedure. - Test "info break" for every inlined function breakpoint. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,3 +1,13 @@ -+2017-10-27 Keith Seitz -+ -+ * breakpoint.c (print_breakpoint_location): Use the symbol saved -+ in the bp_location, falling back to find_pc_sect_function when -+ needed. -+ (add_location_to_breakpoint): Save sal->symbol. -+ * breakpoint.h (struct bp_location) : New field. -+ * symtab.c (find_function_start_sal): Save the symbol into the SaL. -+ * symtab.h (struct symtab_and_line) : New field. -+ - 2017-10-26 Patrick Frants - - PR gdb/13669 ---- a/gdb/breakpoint.c -+++ b/gdb/breakpoint.c -@@ -5956,8 +5956,11 @@ print_breakpoint_location (struct breakpoint *b, - uiout->field_string ("what", event_location_to_string (b->location.get ())); - else if (loc && loc->symtab) - { -- struct symbol *sym -- = find_pc_sect_function (loc->address, loc->section); -+ const struct symbol *sym = loc->symbol; -+ -+ if (sym == NULL) -+ sym = find_pc_sect_function (loc->address, loc->section); -+ - if (sym) - { - uiout->text ("in "); -@@ -8743,6 +8746,7 @@ add_location_to_breakpoint (struct breakpoint *b, - loc->gdbarch = loc_gdbarch; - loc->line_number = sal->line; - loc->symtab = sal->symtab; -+ loc->symbol = sal->symbol; - - set_breakpoint_location_function (loc, - sal->explicit_pc || sal->explicit_line); ---- a/gdb/breakpoint.h -+++ b/gdb/breakpoint.h -@@ -486,6 +486,11 @@ public: - to find the corresponding source file name. */ - - struct symtab *symtab; -+ -+ /* The symbol found by the location parser, if any. This may be used to -+ ascertain when an event location was set at a different location than -+ the one originally selected by parsing, e.g., inlined symbols. */ -+ const struct symbol *symbol = NULL; - }; - - /* The possible return values for print_bpstat, print_it_normal, -### a/gdb/testsuite/ChangeLog -### b/gdb/testsuite/ChangeLog -## -1,3 +1,8 @@ -+2017-10-27 Keith Seitz -+ -+ * gdb.opt/inline-break.exp (break_info_1): New procedure. -+ Test "info break" for every inlined function breakpoint. -+ - 2017-10-27 Yao Qi - - * gdb.arch/insn-reloc.c (can_relocate_bl): Mark "x30" clobbered. ---- a/gdb/testsuite/gdb.opt/inline-break.exp -+++ b/gdb/testsuite/gdb.opt/inline-break.exp -@@ -24,6 +24,62 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ - return -1 - } - -+# Return a string that may be used to match the output of "info break NUM". -+# -+# Optional arguments: -+# -+# source - the name of the source file -+# func - the name of the function -+# disp - the event disposition -+# enabled - enable state -+# locs - number of locations -+# line - source line number (ignored without -source) -+ -+proc break_info_1 {num args} { -+ global decimal -+ -+ # Column delimiter -+ set c {[\t ]+} -+ -+ # Row delimiter -+ set end {[\r\n \t]+} -+ -+ # Table header -+ set header "[join [list Num Type Disp Enb Address What] ${c}]" -+ -+ # Get/configure any optional parameters. -+ parse_args [list {source ""} {func ".*"} {disp "keep"} \ -+ {enabled "y"} {locs 1} [list line $decimal] \ -+ {type "breakpoint"}] -+ -+ if {$source != ""} { -+ set source "$source:$line" -+ } -+ -+ # Result starts with the standard header. -+ set result "$header${end}" -+ -+ # Set up for multi-location breakpoint marker. -+ if {$locs == 1} { -+ set multi ".*" -+ } else { -+ set multi "${end}" -+ } -+ append result "[join [list $num $type $disp $enabled $multi] $c]" -+ -+ # Add location info. -+ for {set i 1} {$i <= $locs} {incr i} { -+ if {$locs > 1} { -+ append result "[join [list $num.$i $enabled] $c].*" -+ } -+ -+ # Add function/source file info. -+ append result "in $func at .*$source${end}" -+ } -+ -+ return $result -+} -+ - # - # func1 is a static inlined function that is called once. - # The result should be a single-location breakpoint. -@@ -111,3 +167,22 @@ gdb_test "print func1" \ - # - gdb_test "print func2" \ - "\\\$.* = {int \\(int\\)} .* " -+ -+# Test that "info break" reports the location of the breakpoints "inside" -+# the inlined functions -+ -+set results(1) [break_info_1 1 -source $srcfile -func "func1"] -+set results(2) [break_info_1 2 -locs 2 -source $srcfile -func "func2"] -+set results(3) [break_info_1 3 -source $srcfile -func "func3b"] -+set results(4) [break_info_1 4 -locs 2 -source $srcfile -func "func4b"] -+set results(5) [break_info_1 5 -locs 2 -source $srcfile -func "func5b"] -+set results(6) [break_info_1 6 -locs 3 -source $srcfile -func "func6b"] -+set results(7) [break_info_1 7 -locs 2 -source $srcfile -func "func7b"] -+set results(8) [break_info_1 8 -locs 3 -source $srcfile -func "func8b"] -+ -+for {set i 1} {$i <= [array size results]} {incr i} { -+ send_log "Expecting: $results($i)\n" -+ gdb_test "info break $i" $results($i) -+} -+ -+unset -nocomplain results diff --git a/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch b/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch index ad05657..a1c2d89 100644 --- a/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +++ b/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch @@ -1,13 +1,63 @@ +From c09ce04039dbc2d88cfbef1bbcb9f69853ba4db2 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch FileName: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Index: gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp 2016-03-10 22:31:31.152094080 +0100 +;; [aarch64] Fix hardware watchpoints (RH BZ 1261564). +;;=fedoratest +--- + .../gdb.base/rhbz1261564-aarch64-watchpoint.c | 33 ++++++++++++++ + .../gdb.base/rhbz1261564-aarch64-watchpoint.exp | 53 ++++++++++++++++++++++ + 2 files changed, 86 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c + create mode 100644 gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp + +diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c +new file mode 100644 +index 0000000000..085001d7f3 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c +@@ -0,0 +1,33 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2016 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++__attribute__((aligned(16))) struct ++{ ++ int var0, var4, var8; ++} aligned; ++ ++int ++main (void) ++{ ++ aligned.var0 = 1; ++ aligned.var4 = 2; ++ aligned.var8 = 3; ++ ++ aligned.var4 = aligned.var0; ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp +new file mode 100644 +index 0000000000..49bb975602 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp @@ -0,0 +1,53 @@ +# Copyright (C) 2016 Free Software Foundation, Inc. + @@ -62,41 +112,6 @@ Index: gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp +setup_xfail "powerpc*-*-*" + +gdb_continue_to_end -Index: gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c 2016-03-10 22:31:31.152094080 +0100 -@@ -0,0 +1,33 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2016 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+__attribute__((aligned(16))) struct -+{ -+ int var0, var4, var8; -+} aligned; -+ -+int -+main (void) -+{ -+ aligned.var0 = 1; -+ aligned.var4 = 2; -+ aligned.var8 = 3; -+ -+ aligned.var4 = aligned.var0; -+ -+ return 0; -+} +-- +2.14.3 + diff --git a/gdb-rhbz1325795-framefilters-test.patch b/gdb-rhbz1325795-framefilters-test.patch index dd203b3..9dabc33 100644 --- a/gdb-rhbz1325795-framefilters-test.patch +++ b/gdb-rhbz1325795-framefilters-test.patch @@ -1,11 +1,26 @@ +From 5f8fc002e9c0795d8761c4323d687bcf0e4cc16e Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1325795-framefilters-test.patch FileName: gdb-rhbz1325795-framefilters-test.patch ---- /dev/null 2016-09-12 21:37:05.332693927 +0200 -+++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-framefilter-thread.c 2016-09-12 21:43:56.448695513 +0200 +;; New test for Python "Cannot locate object file for block" (for RH BZ 1325795). +;;=fedoratest +--- + gdb/testsuite/gdb.python/py-framefilter-thread.c | 39 ++++++++++++++ + gdb/testsuite/gdb.python/py-framefilter-thread.exp | 54 +++++++++++++++++++ + gdb/testsuite/gdb.python/py-framefilter-thread.py | 60 ++++++++++++++++++++++ + 3 files changed, 153 insertions(+) + create mode 100644 gdb/testsuite/gdb.python/py-framefilter-thread.c + create mode 100644 gdb/testsuite/gdb.python/py-framefilter-thread.exp + create mode 100644 gdb/testsuite/gdb.python/py-framefilter-thread.py + +diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.c b/gdb/testsuite/gdb.python/py-framefilter-thread.c +new file mode 100644 +index 0000000000..6cebabb67a +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-framefilter-thread.c @@ -0,0 +1,39 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -46,8 +61,11 @@ FileName: gdb-rhbz1325795-framefilters-test.patch + + return 0; +} ---- /dev/null 2016-09-12 21:37:05.332693927 +0200 -+++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-framefilter-thread.exp 2016-09-12 21:46:54.623428493 +0200 +diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.exp b/gdb/testsuite/gdb.python/py-framefilter-thread.exp +new file mode 100644 +index 0000000000..71f9746337 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-framefilter-thread.exp @@ -0,0 +1,54 @@ +# Copyright (C) 2016 Free Software Foundation, Inc. + @@ -94,17 +112,20 @@ FileName: gdb-rhbz1325795-framefilters-test.patch + +# #2 0x00007ffff75f228d in 941595343737041 () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113^M +# vs. -+# #2 0x00007ffff75f228d in 941595343737041Traceback (most recent call last): -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 145, in frame_args -+# return self._base.frame_args() -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 152, in frame_args -+# return args.fetch_frame_args() -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 276, in fetch_frame_args -+# block = self.frame.block() -+# RuntimeError: Cannot locate object file for block. ++# #2 0x00007ffff75f228d in 941595343737041Traceback (most recent call last): ++# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 145, in frame_args ++# return self._base.frame_args() ++# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 152, in frame_args ++# return args.fetch_frame_args() ++# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 276, in fetch_frame_args ++# block = self.frame.block() ++# RuntimeError: Cannot locate object file for block. +gdb_test "bt" " in \[0-9\]+ \[^\r\n\]*" "bt with filters" ---- /dev/null 2016-09-12 21:37:05.332693927 +0200 -+++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-framefilter-thread.py 2016-09-12 21:49:16.150795235 +0200 +diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.py b/gdb/testsuite/gdb.python/py-framefilter-thread.py +new file mode 100644 +index 0000000000..8964799408 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-framefilter-thread.py @@ -0,0 +1,60 @@ +# Copyright (C) 2016 Free Software Foundation, Inc. + @@ -166,3 +187,6 @@ FileName: gdb-rhbz1325795-framefilters-test.patch + return frame_iter + +FrameFilter() +-- +2.14.3 + diff --git a/gdb-rhbz1350436-type-printers-error.patch b/gdb-rhbz1350436-type-printers-error.patch index 114da0a..cebb913 100644 --- a/gdb-rhbz1350436-type-printers-error.patch +++ b/gdb-rhbz1350436-type-printers-error.patch @@ -1,18 +1,28 @@ +From a50b4f703227b1c8b2ceb0c4c7b058d51cbbb006 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1350436-type-printers-error.patch FileName: gdb-rhbz1350436-type-printers-error.patch +;; Test 'info type-printers' Python error (RH BZ 1350436). +;;=fedoratest + Typo in Python support breaks info type-printers command https://bugzilla.redhat.com/show_bug.cgi?id=1350436 [testsuite patch] PR python/17136: 'info type-printers' causes an exception when there are per-objfile printers https://sourceware.org/ml/gdb-patches/2016-06/msg00455.html +--- + gdb/testsuite/gdb.python/py-typeprint.cc | 6 ++++++ + gdb/testsuite/gdb.python/py-typeprint.exp | 4 ++++ + gdb/testsuite/gdb.python/py-typeprint.py | 24 ++++++++++++++++++++++-- + 3 files changed, 32 insertions(+), 2 deletions(-) -diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc ---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc 2013-01-01 07:41:26.000000000 +0100 -+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc 2016-06-27 22:57:58.168642470 +0200 +diff --git a/gdb/testsuite/gdb.python/py-typeprint.cc b/gdb/testsuite/gdb.python/py-typeprint.cc +index 9ab6c4643d..39079fbd3a 100644 +--- a/gdb/testsuite/gdb.python/py-typeprint.cc ++++ b/gdb/testsuite/gdb.python/py-typeprint.cc @@ -31,6 +31,12 @@ templ s; basic_string bs; @@ -26,10 +36,11 @@ diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc gdb-7.6.1 int main() { return 0; -diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp ---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp 2013-01-01 07:41:26.000000000 +0100 -+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp 2016-06-27 22:58:13.846785208 +0200 -@@ -51,3 +51,7 @@ gdb_test_no_output "enable type-printer +diff --git a/gdb/testsuite/gdb.python/py-typeprint.exp b/gdb/testsuite/gdb.python/py-typeprint.exp +index 28e505331f..75e502b15c 100644 +--- a/gdb/testsuite/gdb.python/py-typeprint.exp ++++ b/gdb/testsuite/gdb.python/py-typeprint.exp +@@ -50,3 +50,7 @@ gdb_test_no_output "enable type-printer string" gdb_test "whatis bs" "string" "whatis with enabled printer" gdb_test "whatis s" "templ" @@ -37,9 +48,10 @@ diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp gdb-7.6. +gdb_test "info type-printers" "Type printers for \[^\r\n\]*/py-typeprint:\r\n *other\r\n.*" \ + "info type-printers for other" +gdb_test "whatis ovar" "type = Another" -diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py ---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py 2013-01-01 07:41:26.000000000 +0100 -+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py 2016-06-27 22:57:58.169642479 +0200 +diff --git a/gdb/testsuite/gdb.python/py-typeprint.py b/gdb/testsuite/gdb.python/py-typeprint.py +index cf9c1ce8b9..7e28df2b9e 100644 +--- a/gdb/testsuite/gdb.python/py-typeprint.py ++++ b/gdb/testsuite/gdb.python/py-typeprint.py @@ -15,7 +15,7 @@ import gdb @@ -77,3 +89,6 @@ diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py gdb-7.6.1 + +import gdb.types +gdb.types.register_type_printer(gdb.objfiles()[0], OtherTypePrinter()) +-- +2.14.3 + diff --git a/gdb-rhbz1398387-tab-crash-test.patch b/gdb-rhbz1398387-tab-crash-test.patch index 9af7eb1..0bfd56d 100644 --- a/gdb-rhbz1398387-tab-crash-test.patch +++ b/gdb-rhbz1398387-tab-crash-test.patch @@ -1,12 +1,22 @@ +From ee23f3da61798a8cfccc155c52cb04c6e247e505 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1398387-tab-crash-test.patch FileName: gdb-rhbz1398387-tab-crash-test.patch +;; New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). +;;=fedoratest +--- + gdb/testsuite/gdb.base/tab-crash.bz2.uu | 393 ++++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.base/tab-crash.exp | 43 ++++ + 2 files changed, 436 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/tab-crash.bz2.uu + create mode 100644 gdb/testsuite/gdb.base/tab-crash.exp + diff --git a/gdb/testsuite/gdb.base/tab-crash.bz2.uu b/gdb/testsuite/gdb.base/tab-crash.bz2.uu new file mode 100644 -index 0000000..e55ec50 +index 0000000000..e55ec5011b --- /dev/null +++ b/gdb/testsuite/gdb.base/tab-crash.bz2.uu @@ -0,0 +1,393 @@ @@ -405,7 +415,7 @@ index 0000000..e55ec50 +end diff --git a/gdb/testsuite/gdb.base/tab-crash.exp b/gdb/testsuite/gdb.base/tab-crash.exp new file mode 100644 -index 0000000..948c1e7 +index 0000000000..91c45aa366 --- /dev/null +++ b/gdb/testsuite/gdb.base/tab-crash.exp @@ -0,0 +1,43 @@ @@ -452,3 +462,6 @@ index 0000000..948c1e7 +clean_restart ${debugfile} + +gdb_test "complete p si" "complete p si\r\np size_of_encoded_value" +-- +2.14.3 + diff --git a/gdb-rhbz1420304-s390x-01of35.patch b/gdb-rhbz1420304-s390x-01of35.patch deleted file mode 100644 index 5fa9260..0000000 --- a/gdb-rhbz1420304-s390x-01of35.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-01of35.patch - -FileName: gdb-rhbz1420304-s390x-01of35.patch - - -commit d7ab4911f8aa3e1cd06ece40f74d0b4a532d6a10 -Author: Andreas Krebbel -Date: Mon May 8 19:10:42 2017 +0200 - - S/390: Fix ifunc missing runtime reloc - - This fixes a problem with a missing R_390_64 reloc against .data for a - function pointer to an ifunc function. - - No regressions on s390x. - - Pushed to mainline. - - bfd/ChangeLog: - - 2017-05-08 Andreas Krebbel - - * elf-s390-common.c: Don't check non_got_ref flag. - * elf32-s390.c (elf_s390_relocate_section): Likewise. - * elf64-s390.c (elf_s390_relocate_section): Likewise. - ---- a/bfd/elf-s390-common.c -+++ b/bfd/elf-s390-common.c -@@ -161,9 +161,7 @@ keep: - h->type = STT_FUNC; - } - -- /* We need dynamic relocation for STT_GNU_IFUNC symbol only when -- there is a non-GOT reference in a shared object. */ -- if (!bfd_link_pic (info) || !h->non_got_ref) -+ if (!bfd_link_pic (info)) - *head = NULL; - - /* Finally, allocate space. */ ---- a/bfd/elf32-s390.c -+++ b/bfd/elf32-s390.c -@@ -2774,7 +2774,7 @@ elf_s390_relocate_section (bfd *output_bfd, - && s390_is_ifunc_symbol_p (h) - && h->def_regular) - { -- if (!bfd_link_pic (info) || !h->non_got_ref) -+ if (!bfd_link_pic (info)) - { - /* For a non-shared object STT_GNU_IFUNC symbol must - go through PLT. */ ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -2737,10 +2737,11 @@ elf_s390_relocate_section (bfd *output_bfd, - && s390_is_ifunc_symbol_p (h) - && h->def_regular) - { -- if (!bfd_link_pic (info) || !h->non_got_ref) -+ if (!bfd_link_pic (info)) - { -- /* For a non-shared object STT_GNU_IFUNC symbol must -- go through PLT. */ -+ /* For a non-shared object the symbol will not -+ change. Hence we can write the address of the -+ target IPLT slot now. */ - relocation = (htab->elf.iplt->output_section->vma - + htab->elf.iplt->output_offset - + h ->plt.offset); diff --git a/gdb-rhbz1420304-s390x-02of35.patch b/gdb-rhbz1420304-s390x-02of35.patch deleted file mode 100644 index a89c919..0000000 --- a/gdb-rhbz1420304-s390x-02of35.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-02of35.patch - -FileName: gdb-rhbz1420304-s390x-02of35.patch - - -commit a0a110b0dd5077373c4102d1502130eb159c366b -Author: Andreas Krebbel -Date: Wed May 17 12:39:39 2017 +0200 - - S/390: Fix arch level of pckmo instruction. - - Fix wrong architecture level of PCKMO instruction. - - Committed to mainline. - - opcodes/ChangeLog: - - 2017-05-17 Andreas Krebbel - - * s390-opc.txt: PCKMO change arch level to z196. - - gas/ChangeLog: - - 2017-05-17 Andreas Krebbel - - * testsuite/gas/s390/zarch-z10.d: Remove pckmo. - * testsuite/gas/s390/zarch-z10.s: Remove pckmo. - * testsuite/gas/s390/zarch-z196.d: Add pckmo. - * testsuite/gas/s390/zarch-z196.s: Add pckmo. - ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -976,7 +976,6 @@ b286 qsi S_RD "query sampling information" z10 zarch - b2e0 scctr RRE_RR "set cpu counter" z10 zarch - b2e1 spctr RRE_RR "set peripheral counter" z10 zarch - b280 lpp S_RD "load program parameter" z10 zarch --b928 pckmo RRE_00 "perform cryptographic key management operation" z10 zarch - - # The new instructions of the IBM zEnterprise z196 - b9c8 ahhhr RRF_R0RR2 "add high high" z196 zarch -@@ -1116,6 +1115,7 @@ b92a kmf RRE_RR "cipher message with CFB" z196 zarch - b92b kmo RRE_RR "cipher message with OFB" z196 zarch - b92c pcc RRE_00 "perform cryptographic computation" z196 zarch - b92d kmctr RRF_R0RR "cipher message with counter" z196 zarch -+b928 pckmo RRE_00 "perform cryptographic key management operation" z196 zarch - - # The new instructions of the IBM zEnterprise EC12 - b2ec etnd RRE_R0 "extract transaction nesting depth" zEC12 zarch htm diff --git a/gdb-rhbz1420304-s390x-03of35.patch b/gdb-rhbz1420304-s390x-03of35.patch deleted file mode 100644 index 1798b2a..0000000 --- a/gdb-rhbz1420304-s390x-03of35.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-03of35.patch - -FileName: gdb-rhbz1420304-s390x-03of35.patch - - -commit bfcfbe611b4d7e650236f8b8ba7d0706cfe6a0b7 -Author: Andreas Krebbel -Date: Mon May 29 12:33:15 2017 +0200 - - S/390: Remove optional operand flag. - - The per operand optional flag hasn't been used for quite some time. - Cleanup some remains. - - include/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * opcode/s390.h: Remove S390_OPERAND_OPTIONAL. - - gas/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * config/tc-s390.c (md_gather_operands): Remove code dealing with - S390_OPERAND_OPTIONAL. - ---- a/include/opcode/s390.h -+++ b/include/opcode/s390.h -@@ -156,21 +156,17 @@ extern const struct s390_operand s390_operands[]; - /* This operand is a length. */ - #define S390_OPERAND_LENGTH 0x200 - --/* This operand is optional. Only a single operand at the end of -- the instruction may be optional. */ --#define S390_OPERAND_OPTIONAL 0x400 -- - /* The operand needs to be a valid GP or FP register pair. */ --#define S390_OPERAND_REG_PAIR 0x800 -+#define S390_OPERAND_REG_PAIR 0x400 - - /* This operand names a vector register. The disassembler uses this - to print register names with a leading 'v'. */ --#define S390_OPERAND_VR 0x1000 -+#define S390_OPERAND_VR 0x800 - --#define S390_OPERAND_CP16 0x2000 -+#define S390_OPERAND_CP16 0x1000 - --#define S390_OPERAND_OR1 0x4000 --#define S390_OPERAND_OR2 0x8000 --#define S390_OPERAND_OR8 0x10000 -+#define S390_OPERAND_OR1 0x2000 -+#define S390_OPERAND_OR2 0x4000 -+#define S390_OPERAND_OR8 0x8000 - - #endif /* S390_H */ diff --git a/gdb-rhbz1420304-s390x-04of35.patch b/gdb-rhbz1420304-s390x-04of35.patch deleted file mode 100644 index aa84ae6..0000000 --- a/gdb-rhbz1420304-s390x-04of35.patch +++ /dev/null @@ -1,104 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-04of35.patch - -FileName: gdb-rhbz1420304-s390x-04of35.patch - - -commit a09f2586017aeed82fa07c8bfea6c75859295bd9 -Author: Andreas Krebbel -Date: Mon May 29 12:34:56 2017 +0200 - - S/390: Improve error checking for optional operands - - So far we only had an instruction flag which made an arbitrary number - of operands optional. This limits error checking capabilities for - instructions marked that way. With this patch the optparm flag only - allows a single optional parameter and another one is added (optparm2) - allowing 2 optional arguments. Hopefully we won't need more than that - in the future. So far there will be only a single use of optparm2. - - gas/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * config/tc-s390.c (md_gather_operands): Support new optparm2 - instruction flag. - - include/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * opcode/s390.h: Add new instruction flags optparm2. - - opcodes/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * s390-dis.c (s390_print_insn_with_opcode): Support new optparm2 - instruction flag. - * s390-mkopc.c (main): Recognize the new instruction flag when - parsing instruction list. - ---- a/include/opcode/s390.h -+++ b/include/opcode/s390.h -@@ -48,10 +48,11 @@ enum s390_opcode_cpu_val - - /* Instruction specific flags. */ - #define S390_INSTR_FLAG_OPTPARM 0x1 -+#define S390_INSTR_FLAG_OPTPARM2 0x2 - --#define S390_INSTR_FLAG_HTM 0x2 --#define S390_INSTR_FLAG_VX 0x4 --#define S390_INSTR_FLAG_FACILITY_MASK 0x6 -+#define S390_INSTR_FLAG_HTM 0x4 -+#define S390_INSTR_FLAG_VX 0x8 -+#define S390_INSTR_FLAG_FACILITY_MASK 0xc - - /* The opcode table is an array of struct s390_opcode. */ - ---- a/opcodes/s390-dis.c -+++ b/opcodes/s390-dis.c -@@ -206,11 +206,20 @@ s390_print_insn_with_opcode (bfd_vma memaddr, - - /* For instructions with a last optional operand don't print it - if zero. */ -- if ((opcode->flags & S390_INSTR_FLAG_OPTPARM) -+ if ((opcode->flags & (S390_INSTR_FLAG_OPTPARM | S390_INSTR_FLAG_OPTPARM2)) - && val.u == 0 - && opindex[1] == 0) - break; - -+ if ((opcode->flags & S390_INSTR_FLAG_OPTPARM2) -+ && val.u == 0 && opindex[1] != 0 && opindex[2] == 0) -+ { -+ union operand_value next_op_val = -+ s390_extract_operand (buffer, s390_operands + opindex[1]); -+ if (next_op_val.u == 0) -+ break; -+ } -+ - if (flags & S390_OPERAND_GPR) - info->fprintf_func (info->stream, "%c%%r%u", separator, val.u); - else if (flags & S390_OPERAND_FPR) ---- a/opcodes/s390-mkopc.c -+++ b/opcodes/s390-mkopc.c -@@ -411,12 +411,16 @@ main (void) - && (str[7] == 0 || str[7] == ',')) { - flag_bits |= S390_INSTR_FLAG_OPTPARM; - str += 7; -+ } else if (strncmp (str, "optparm2", 8) == 0 -+ && (str[8] == 0 || str[8] == ',')) { -+ flag_bits |= S390_INSTR_FLAG_OPTPARM2; -+ str += 8; - } else if (strncmp (str, "htm", 3) == 0 -- && (str[3] == 0 || str[3] == ',')) { -+ && (str[3] == 0 || str[3] == ',')) { - flag_bits |= S390_INSTR_FLAG_HTM; - str += 3; - } else if (strncmp (str, "vx", 2) == 0 -- && (str[2] == 0 || str[2] == ',')) { -+ && (str[2] == 0 || str[2] == ',')) { - flag_bits |= S390_INSTR_FLAG_VX; - str += 2; - } else { diff --git a/gdb-rhbz1420304-s390x-05of35.patch b/gdb-rhbz1420304-s390x-05of35.patch deleted file mode 100644 index 71a7929..0000000 --- a/gdb-rhbz1420304-s390x-05of35.patch +++ /dev/null @@ -1,65 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-05of35.patch - -FileName: gdb-rhbz1420304-s390x-05of35.patch - - -commit ffc61c5de1a5a89e3e37fb9376725c32a839c34d -Author: Andreas Krebbel -Date: Mon May 29 12:36:57 2017 +0200 - - S/390: Add ipte/idte variants with optional operands - - This patch adds missing variants of ipte and idte instructions added with later CPU - generations. - - ipte got an optional operand with z196 and another one with zEC12. - idte got an optional operand with zEC12 - - opcodes/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * s390-opc.c: Add new idte/ipte variants. - * s390-opc.txt: Likewise. - - gas/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * testsuite/gas/s390/zarch-z196.d: Add new idte/ipte variants. - * testsuite/gas/s390/zarch-z196.s: Likewise. - * testsuite/gas/s390/zarch-zEC12.d: Likewise. - * testsuite/gas/s390/zarch-zEC12.s: Likewise. - ---- a/opcodes/s390-opc.c -+++ b/opcodes/s390-opc.c -@@ -355,7 +355,7 @@ const struct s390_operand s390_operands[] = - #define INSTR_RRF_FEUFEFE 4, { FE_24,FE_16,FE_28,U4_20,0,0 } /* e.g. qaxtr */ - #define INSTR_RRF_FUFF2 4, { F_24,F_28,F_16,U4_20,0,0 } /* e.g. adtra */ - #define INSTR_RRF_FEUFEFE2 4, { FE_24,FE_28,FE_16,U4_20,0,0 } /* e.g. axtra */ --#define INSTR_RRF_RURR 4, { R_24,R_28,R_16,U4_20,0,0 } /* e.g. .insn */ -+#define INSTR_RRF_RURR 4, { R_24,R_28,R_16,U4_20,0,0 } /* e.g. ipte */ - #define INSTR_RRF_RURR2 4, { R_24,R_16,R_28,U4_20,0,0 } /* e.g. lptea */ - #define INSTR_RRF_R0RR 4, { R_24,R_16,R_28,0,0,0 } /* e.g. idte */ - #define INSTR_RRF_R0RR2 4, { R_24,R_28,R_16,0,0,0 } /* e.g. ark */ ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -1116,6 +1116,7 @@ b92b kmo RRE_RR "cipher message with OFB" z196 zarch - b92c pcc RRE_00 "perform cryptographic computation" z196 zarch - b92d kmctr RRF_R0RR "cipher message with counter" z196 zarch - b928 pckmo RRE_00 "perform cryptographic key management operation" z196 zarch -+b221 ipte RRF_R0RR2 "invalidate page table entry" z196 zarch optparm - - # The new instructions of the IBM zEnterprise EC12 - b2ec etnd RRE_R0 "extract transaction nesting depth" zEC12 zarch htm -@@ -1143,6 +1144,8 @@ ed00000000aa cdzt RSL_LRDFU "convert from zoned long" zEC12 zarch - ed00000000ab cxzt RSL_LRDFEU "convert from zoned extended" zEC12 zarch - ed00000000a8 czdt RSL_LRDFU "convert to zoned long" zEC12 zarch - ed00000000a9 czxt RSL_LRDFEU "convert to zoned extended" zEC12 zarch -+b98e idte RRF_RURR2 "invalidate dat table entry" zEC12 zarch optparm -+b221 ipte RRF_RURR "invalidate page table entry" zEC12 zarch optparm2 - - # The new instructions of IBM z13 - diff --git a/gdb-rhbz1420304-s390x-06of35.patch b/gdb-rhbz1420304-s390x-06of35.patch deleted file mode 100644 index b7ede42..0000000 --- a/gdb-rhbz1420304-s390x-06of35.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-06of35.patch - -FileName: gdb-rhbz1420304-s390x-06of35.patch - - -commit 67aa8be4cb43cd94bc322fed8bdba48b3c8719c4 -Author: Andreas Krebbel -Date: Mon May 29 12:38:11 2017 +0200 - - S/390: Add missing operand to tb instruction - - gas/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * testsuite/gas/s390/esa-g5.d: Add missing operand to tb - instruction. - * testsuite/gas/s390/esa-g5.s: Likewise. - - opcodes/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * s390-opc.txt: Add missing operand to tb instruction. - ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -228,7 +228,7 @@ b246 stura RRE_RR "store using real address" g5 esa,zarch - 2f swr RR_FF "subtract unnormalized (long)" g5 esa,zarch - 37 sxr RR_FEFE "subtract normalized (ext.)" g5 esa,zarch - b24c tar RRE_AR "test access" g5 esa,zarch --b22c tb RRE_0R "test block" g5 esa,zarch -+b22c tb RRE_RR "test block" g5 esa,zarch - 91 tm SI_URD "test under mask" g5 esa,zarch - b236 tpi S_RD "test pending interruption" g5 esa,zarch - e501 tprot SSE_RDRD "test protection" g5 esa,zarch diff --git a/gdb-rhbz1420304-s390x-07of35.patch b/gdb-rhbz1420304-s390x-07of35.patch deleted file mode 100644 index 2745497..0000000 --- a/gdb-rhbz1420304-s390x-07of35.patch +++ /dev/null @@ -1,60 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-07of35.patch - -FileName: gdb-rhbz1420304-s390x-07of35.patch - - -commit ca87ae741fe9c8aad9db1afbf109dc070d0168cf -Author: Andreas Krebbel -Date: Mon May 29 12:38:42 2017 +0200 - - S/390: Fix instruction types of csdtr and csxtr - - opcodes/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * s390-opc.c: Add new instruction types RRF_0URF and RRF_0UREFE. - * s390-opc.txt: Fix instruction typs of csdtr and csxtr. - - gas/ChangeLog: - - 2017-05-30 Andreas Krebbel - - * testsuite/gas/s390/zarch-z9-ec.d: Adjust csdtr and csxtr. - * testsuite/gas/s390/zarch-z9-ec.s: Likewise. - ---- a/opcodes/s390-opc.c -+++ b/opcodes/s390-opc.c -@@ -374,6 +374,8 @@ const struct s390_operand s390_operands[] = - #define INSTR_RRF_U0RER 4, { RE_24,R_28,U4_16,0,0,0 } /* e.g. trte */ - #define INSTR_RRF_U0RERE 4, { RE_24,RE_28,U4_16,0,0,0 } /* e.g. cu24 */ - #define INSTR_RRF_00RR 4, { R_24,R_28,0,0,0,0 } /* e.g. clrtne */ -+#define INSTR_RRF_0URF 4, { R_24,F_28,U4_20,0,0,0 } /* e.g. csdtr */ -+#define INSTR_RRF_0UREFE 4, { RE_24,FE_28,U4_20,0,0,0 } /* e.g. csxtr */ - #define INSTR_RRF_UUFR 4, { F_24,U4_16,R_28,U4_20,0,0 } /* e.g. cdgtra */ - #define INSTR_RRF_UUFER 4, { FE_24,U4_16,R_28,U4_20,0,0 } /* e.g. cxfbra */ - #define INSTR_RRF_UURF 4, { R_24,U4_16,F_28,U4_20,0,0 } /* e.g. cgdtra */ -@@ -590,6 +592,8 @@ const struct s390_operand s390_operands[] = - #define MASK_RRF_U0RER { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } - #define MASK_RRF_U0RERE { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } - #define MASK_RRF_00RR { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 } -+#define MASK_RRF_0URF { 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00 } -+#define MASK_RRF_0UREFE { 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00 } - #define MASK_RRF_UUFR { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } - #define MASK_RRF_UUFER { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } - #define MASK_RRF_UURF { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -817,8 +817,8 @@ b3f2 cdutr RRE_FR "convert from unsigned bcd to long dfp" z9-ec zarch - b3fa cxutr RRE_FER "convert from unsigned bcd to extended dfp" z9-ec zarch - b3e1 cgdtr RRF_U0RF "convert from long dfp to fixed" z9-ec zarch - b3e9 cgxtr RRF_U0RFE "convert from extended dfp to fixed" z9-ec zarch --b3e3 csdtr RRE_RF "convert from long dfp to signed bcd" z9-ec zarch --b3eb csxtr RRE_RFE "convert from extended dfp to signed bcd" z9-ec zarch -+b3e3 csdtr RRF_0URF "convert from long dfp to signed bcd" z9-ec zarch -+b3eb csxtr RRF_0UREFE "convert from extended dfp to signed bcd" z9-ec zarch - b3e2 cudtr RRE_RF "convert from long dfp to unsigned bcd" z9-ec zarch - b3ea cuxtr RRE_RFE "convert from extended dfp to unsigned bcd" z9-ec zarch - b3d1 ddtr RRR_F0FF "divide long dfp" z9-ec zarch diff --git a/gdb-rhbz1420304-s390x-08of35.patch b/gdb-rhbz1420304-s390x-08of35.patch deleted file mode 100644 index 956e658..0000000 --- a/gdb-rhbz1420304-s390x-08of35.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-08of35.patch - -FileName: gdb-rhbz1420304-s390x-08of35.patch - - -commit 19fb31c0060f646a9f84be1a84ed1bea04e7ed57 -Author: Andreas Krebbel -Date: Thu Jun 1 13:46:15 2017 +0200 - - S/390: idte/ipte fixes - - Later CPU generations added optional operands to the ipte/idte - instructions. I've added these with: - https://sourceware.org/ml/binutils/2017-05/msg00316.html ... but - supported the optional operands only with the specific hardware - levels. However, it is more useful to have the optional operands - already in the first versions. Of course they need to be zero there. - - Regression-tested with on s390 and s390x. Committed to mainline. - - Bye, - - -Andreas- - - opcodes/ChangeLog: - - 2017-06-01 Andreas Krebbel - - * s390-opc.txt: Support the optional parameters with the first - versions of ipte/idte. - - gas/ChangeLog: - - 2017-06-01 Andreas Krebbel - - * testsuite/gas/s390/esa-g5.d: Add ipte tests. - * testsuite/gas/s390/esa-g5.s: Likewise. - * testsuite/gas/s390/zarch-z196.d: Remove ipte tests. - * testsuite/gas/s390/zarch-z196.s: Likewise. - * testsuite/gas/s390/zarch-z990.d: Add idte tests. - * testsuite/gas/s390/zarch-z990.s: Likewise. - * testsuite/gas/s390/zarch-zEC12.d: Remove ipte/idte tests. - * testsuite/gas/s390/zarch-zEC12.s: Likewise. - ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -79,7 +79,7 @@ b224 iac RRE_R0 "insert address space control" g5 esa,zarch - bf icm RS_RURD "insert characters under mask" g5 esa,zarch - b20b ipk S_00 "insert PSW key" g5 esa,zarch - b222 ipm RRE_R0 "insert program mask" g5 esa,zarch --b221 ipte RRE_RR "invalidate page table entry" g5 esa,zarch -+b221 ipte RRF_RURR "invalidate page table entry" g5 esa,zarch optparm2 - b229 iske RRE_RR "insert storage key extended" g5 esa,zarch - b223 ivsk RRE_RR "insert virtual storage key" g5 esa,zarch - 58 l RX_RRRD "load" g5 esa,zarch -@@ -700,7 +700,7 @@ eb000000008f clclu RSY_RRRD "compare logical long unicode with long offset" z990 - eb0000000096 lmh RSY_RRRD "load multiple high" z990 zarch - # new z990 instructions - b98a cspg RRE_RR "compare and swap and purge" z990 zarch --b98e idte RRF_R0RR "invalidate dat table entry" z990 zarch -+b98e idte RRF_RURR2 "invalidate dat table entry" z990 zarch optparm - b33e madr RRF_F0FF "multiply and add long hfp" z990 esa,zarch - ed000000003e mad RXF_FRRDF "multiply and add long hfp" z990 esa,zarch - b32e maer RRF_F0FF "multiply and add short hfp" z990 esa,zarch -@@ -1116,7 +1116,6 @@ b92b kmo RRE_RR "cipher message with OFB" z196 zarch - b92c pcc RRE_00 "perform cryptographic computation" z196 zarch - b92d kmctr RRF_R0RR "cipher message with counter" z196 zarch - b928 pckmo RRE_00 "perform cryptographic key management operation" z196 zarch --b221 ipte RRF_R0RR2 "invalidate page table entry" z196 zarch optparm - - # The new instructions of the IBM zEnterprise EC12 - b2ec etnd RRE_R0 "extract transaction nesting depth" zEC12 zarch htm -@@ -1144,8 +1143,6 @@ ed00000000aa cdzt RSL_LRDFU "convert from zoned long" zEC12 zarch - ed00000000ab cxzt RSL_LRDFEU "convert from zoned extended" zEC12 zarch - ed00000000a8 czdt RSL_LRDFU "convert to zoned long" zEC12 zarch - ed00000000a9 czxt RSL_LRDFEU "convert to zoned extended" zEC12 zarch --b98e idte RRF_RURR2 "invalidate dat table entry" zEC12 zarch optparm --b221 ipte RRF_RURR "invalidate page table entry" zEC12 zarch optparm2 - - # The new instructions of IBM z13 - diff --git a/gdb-rhbz1420304-s390x-09of35.patch b/gdb-rhbz1420304-s390x-09of35.patch deleted file mode 100644 index ec1b196..0000000 --- a/gdb-rhbz1420304-s390x-09of35.patch +++ /dev/null @@ -1,130 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-09of35.patch - -FileName: gdb-rhbz1420304-s390x-09of35.patch - - -commit 3704e3589d3d187fbf76e688388b1a92fd627c8d -Author: Andreas Krebbel -Date: Fri Jun 9 11:19:01 2017 +0200 - - S/390: Return with an error for broken tls rewrites - - bfd/ChangeLog: - - 2017-06-12 Andreas Krebbel - - * elf32-s390.c (elf_s390_relocate_section): Return false in case - the rewriting fails. - * elf64-s390.c (elf_s390_relocate_section): Likewise. - ---- a/bfd/elf32-s390.c -+++ b/bfd/elf32-s390.c -@@ -3231,7 +3231,6 @@ elf_s390_relocate_section (bfd *output_bfd, - unsigned int insn, ry; - - insn = bfd_get_32 (input_bfd, contents + rel->r_offset); -- ry = 0; - if ((insn & 0xff00f000) == 0x58000000) - /* l %rx,0(%ry,0) -> lr %rx,%ry + bcr 0,0 */ - ry = (insn & 0x000f0000); -@@ -3245,7 +3244,10 @@ elf_s390_relocate_section (bfd *output_bfd, - /* l %rx,0(%r12,%ry) -> lr %rx,%ry + bcr 0,0 */ - ry = (insn & 0x0000f000) << 4; - else -- invalid_tls_insn (input_bfd, input_section, rel); -+ { -+ invalid_tls_insn (input_bfd, input_section, rel); -+ return FALSE; -+ } - insn = 0x18000700 | (insn & 0x00f00000) | ry; - bfd_put_32 (output_bfd, insn, contents + rel->r_offset); - } -@@ -3258,7 +3260,10 @@ elf_s390_relocate_section (bfd *output_bfd, - if ((insn & 0xff000fff) != 0x4d000000 && - (insn & 0xffff0000) != 0xc0e50000 && - (insn & 0xff000000) != 0x0d000000) -- invalid_tls_insn (input_bfd, input_section, rel); -+ { -+ invalid_tls_insn (input_bfd, input_section, rel); -+ return FALSE; -+ } - if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1)) - { - if ((insn & 0xff000000) == 0x0d000000) -@@ -3287,7 +3292,10 @@ elf_s390_relocate_section (bfd *output_bfd, - /* If basr is used in the pic case to invoke - _tls_get_offset, something went wrong before. */ - if ((insn & 0xff000000) == 0x0d000000) -- invalid_tls_insn (input_bfd, input_section, rel); -+ { -+ invalid_tls_insn (input_bfd, input_section, rel); -+ return FALSE; -+ } - - if ((insn & 0xff000000) == 0x4d000000) - { -@@ -3317,7 +3325,10 @@ elf_s390_relocate_section (bfd *output_bfd, - if ((insn & 0xff000fff) != 0x4d000000 && - (insn & 0xffff0000) != 0xc0e50000 && - (insn & 0xff000000) != 0x0d000000) -- invalid_tls_insn (input_bfd, input_section, rel); -+ { -+ invalid_tls_insn (input_bfd, input_section, rel); -+ return FALSE; -+ } - - if ((insn & 0xff000000) == 0x0d000000) - { ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -3197,8 +3197,10 @@ elf_s390_relocate_section (bfd *output_bfd, - insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); - insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); - if (insn1 != 0x0004) -- invalid_tls_insn (input_bfd, input_section, rel); -- ry = 0; -+ { -+ invalid_tls_insn (input_bfd, input_section, rel); -+ return FALSE; -+ } - if ((insn0 & 0xff00f000) == 0xe3000000) - /* lg %rx,0(%ry,0) -> sllg %rx,%ry,0 */ - ry = (insn0 & 0x000f0000); -@@ -3212,7 +3214,10 @@ elf_s390_relocate_section (bfd *output_bfd, - /* lg %rx,0(%r12,%ry) -> sllg %rx,%ry,0 */ - ry = (insn0 & 0x0000f000) << 4; - else -- invalid_tls_insn (input_bfd, input_section, rel); -+ { -+ invalid_tls_insn (input_bfd, input_section, rel); -+ return FALSE; -+ } - insn0 = 0xeb000000 | (insn0 & 0x00f00000) | ry; - insn1 = 0x000d; - bfd_put_32 (output_bfd, insn0, contents + rel->r_offset); -@@ -3226,7 +3231,10 @@ elf_s390_relocate_section (bfd *output_bfd, - insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); - insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); - if ((insn0 & 0xffff0000) != 0xc0e50000) -- invalid_tls_insn (input_bfd, input_section, rel); -+ { -+ invalid_tls_insn (input_bfd, input_section, rel); -+ return FALSE; -+ } - if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1)) - { - /* GD->LE transition. -@@ -3253,7 +3261,10 @@ elf_s390_relocate_section (bfd *output_bfd, - insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); - insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); - if ((insn0 & 0xffff0000) != 0xc0e50000) -- invalid_tls_insn (input_bfd, input_section, rel); -+ { -+ invalid_tls_insn (input_bfd, input_section, rel); -+ return FALSE; -+ } - /* LD->LE transition. - brasl %r14,__tls_get_addr@plt -> brcl 0,. */ - insn0 = 0xc0040000; diff --git a/gdb-rhbz1420304-s390x-10of35.patch b/gdb-rhbz1420304-s390x-10of35.patch deleted file mode 100644 index c2e652b..0000000 --- a/gdb-rhbz1420304-s390x-10of35.patch +++ /dev/null @@ -1,277 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-10of35.patch - -FileName: gdb-rhbz1420304-s390x-10of35.patch - - -commit 0567c9861e113a573cc905002a59cb1bc3d78450 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:25 2017 +0200 - - Add test for modifiable DWARF locations - - This adds a test for read/write access to variables with various types of - DWARF locations. It uses register- and memory locations and composite - locations with register- and memory pieces. - - Since the new test calls gdb_test_no_output with commands that contain - braces, it is necessary for string_to_regexp to quote braces as well. - This was not done before. - - gdb/testsuite/ChangeLog: - - * gdb.dwarf2/var-access.c: New file. - * gdb.dwarf2/var-access.exp: New test. - * lib/gdb-utils.exp (string_to_regexp): Quote braces as well. - -### a/gdb/testsuite/ChangeLog -### b/gdb/testsuite/ChangeLog -## -1,3 +1,9 @@ -+2017-06-13 Andreas Arnez -+ -+ * gdb.dwarf2/var-access.c: New file. -+ * gdb.dwarf2/var-access.exp: New test. -+ * lib/gdb-utils.exp (string_to_regexp): Quote braces as well. -+ - 2017-06-12 Tom Tromey - - * gdb.dwarf2/formdata16.exp: Add tests. ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/var-access.c -@@ -0,0 +1,25 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2017 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 . */ -+ -+char buf[] = {0, 1, 2, 3, 4, 5, 6, 7}; -+ -+int -+main (void) -+{ -+ asm volatile ("main_label: .globl main_label"); -+ return 0; -+} ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp -@@ -0,0 +1,197 @@ -+# Copyright 2017 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 . -+ -+# Test reading/writing variables with non-trivial DWARF locations. In -+# particular the test uses register- and memory locations as well as -+# composite locations with register- and memory pieces. -+ -+load_lib dwarf.exp -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+if {![dwarf2_support]} { -+ return 0 -+} -+ -+# Choose suitable integer registers for the test. -+ -+set dwarf_regnum {0 1} -+ -+if { [istarget "aarch64*-*-*"] } { -+ set regname {x0 x1} -+} elseif { [istarget "arm*-*-*"] -+ || [istarget "s390*-*-*" ] -+ || [istarget "powerpc*-*-*"] -+ || [istarget "rs6000*-*-aix*"] } { -+ set regname {r0 r1} -+} elseif { [istarget "i?86-*-*"] } { -+ set regname {eax edx} -+} elseif { [istarget "x86_64-*-*"] } { -+ set regname {rax rdx} -+} else { -+ verbose "Skipping tests for accessing DWARF-described variables." -+ return -+} -+ -+standard_testfile .c ${gdb_test_file_name}-dw.S -+ -+# Make some DWARF for the test. -+ -+set asm_file [standard_output_file $srcfile2] -+Dwarf::assemble $asm_file { -+ global srcdir subdir srcfile -+ global dwarf_regnum regname -+ -+ set buf_var [gdb_target_symbol buf] -+ -+ cu {} { -+ DW_TAG_compile_unit { -+ {DW_AT_name var-pieces-dw.c} -+ {DW_AT_comp_dir /tmp} -+ } { -+ declare_labels char_type_label -+ declare_labels int_type_label short_type_label -+ declare_labels array_a8_label struct_s_label -+ -+ # char -+ char_type_label: base_type { -+ {name "char"} -+ {encoding @DW_ATE_unsigned_char} -+ {byte_size 1 DW_FORM_sdata} -+ } -+ -+ # int -+ int_type_label: base_type { -+ {name "int"} -+ {encoding @DW_ATE_signed} -+ {byte_size 4 DW_FORM_sdata} -+ } -+ -+ # char [8] -+ array_a8_label: array_type { -+ {type :$char_type_label} -+ } { -+ subrange_type { -+ {type :$int_type_label} -+ {upper_bound 7 DW_FORM_udata} -+ } -+ } -+ -+ # struct s { char a, b, c, d; }; -+ struct_s_label: structure_type { -+ {name "s"} -+ {byte_size 4 DW_FORM_sdata} -+ } { -+ member { -+ {name "a"} -+ {type :$char_type_label} -+ {data_member_location 0 DW_FORM_udata} -+ } -+ member { -+ {name "b"} -+ {type :$char_type_label} -+ {data_member_location 1 DW_FORM_udata} -+ } -+ member { -+ {name "c"} -+ {type :$char_type_label} -+ {data_member_location 2 DW_FORM_udata} -+ } -+ member { -+ {name "d"} -+ {type :$char_type_label} -+ {data_member_location 3 DW_FORM_udata} -+ } -+ } -+ -+ DW_TAG_subprogram { -+ {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }} -+ {DW_AT_external 1 flag} -+ } { -+ # Simple memory location. -+ DW_TAG_variable { -+ {name "a"} -+ {type :$array_a8_label} -+ {location { -+ addr $buf_var -+ } SPECIAL_expr} -+ } -+ # Memory pieces: two bytes from &buf[2], and two bytes -+ # from &buf[0]. -+ DW_TAG_variable { -+ {name "s1"} -+ {type :$struct_s_label} -+ {location { -+ addr $buf_var -+ plus_uconst 2 -+ piece 2 -+ addr $buf_var -+ piece 2 -+ } SPECIAL_expr} -+ } -+ # Register- and memory pieces: one byte each from r0, -+ # &buf[4], r1, and &buf[5]. -+ DW_TAG_variable { -+ {name "s2"} -+ {type :$struct_s_label} -+ {location { -+ regx [lindex $dwarf_regnum 0] -+ piece 1 -+ addr "$buf_var + 4" -+ piece 1 -+ regx [lindex $dwarf_regnum 1] -+ piece 1 -+ addr "$buf_var + 5" -+ piece 1 -+ } SPECIAL_expr} -+ } -+ } -+ } -+ } -+} -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} \ -+ [list $srcfile $asm_file] {nodebug}] } { -+ return -1 -+} -+ -+if ![runto_main] { -+ return -1 -+} -+ -+# Byte-aligned memory pieces. -+gdb_test "print/d s1" " = \\{a = 2, b = 3, c = 0, d = 1\\}" \ -+ "s1 == re-ordered buf" -+gdb_test_no_output "set var s1.a = 63" -+gdb_test "print/d s1" " = \\{a = 63, b = 3, c = 0, d = 1\\}" \ -+ "verify s1.a" -+gdb_test "print/d a" " = \\{0, 1, 63, 3, 4, 5, 6, 7\\}" \ -+ "verify s1.a through a" -+ -+# Byte-aligned register- and memory pieces. -+gdb_test_no_output "set var \$[lindex $regname 0] = 81" \ -+ "init reg for s2.a" -+gdb_test_no_output "set var \$[lindex $regname 1] = 28" \ -+ "init reg for s2.c" -+gdb_test "print/d s2" " = \\{a = 81, b = 4, c = 28, d = 5\\}" \ -+ "initialized s2 from mem and regs" -+gdb_test_no_output "set var s2.c += s2.a + s2.b - s2.d" -+gdb_test "print/d s2" " = \\{a = 81, b = 4, c = 108, d = 5\\}" \ -+ "verify s2.c" -+gdb_test "print/d \$[lindex $regname 1]" " = 108" \ -+ "verify s2.c through reg" -+gdb_test_no_output "set var s2 = {191, 73, 231, 123}" \ -+ "re-initialize s2" -+gdb_test "print/d s2" " = \\{a = 191, b = 73, c = 231, d = 123\\}" \ -+ "verify re-initialized s2" ---- a/gdb/testsuite/lib/gdb-utils.exp -+++ b/gdb/testsuite/lib/gdb-utils.exp -@@ -34,6 +34,6 @@ proc gdb_init_commands {} { - - proc string_to_regexp {str} { - set result $str -- regsub -all {[]*+.|()^$\[\\]} $str {\\&} result -+ regsub -all {[]*+.|(){}^$\[\\]} $str {\\&} result - return $result - } diff --git a/gdb-rhbz1420304-s390x-11of35.patch b/gdb-rhbz1420304-s390x-11of35.patch deleted file mode 100644 index ef5adfc..0000000 --- a/gdb-rhbz1420304-s390x-11of35.patch +++ /dev/null @@ -1,113 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-11of35.patch - -FileName: gdb-rhbz1420304-s390x-11of35.patch - - -commit d5d1163eff2415a01895f1cff8bbee32b3f0ab66 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:26 2017 +0200 - - write_pieced_value: Fix size capping logic - - A field f in a structure composed of DWARF pieces may be located in - multiple pieces, where the first and last of those may contain bits from - other fields as well. So when writing to f, the beginning of the first - and the end of the last of those pieces may have to be skipped. But the - logic in write_pieced_value for handling one of those pieces is flawed - when the first and last piece are the same, i.e., f is contained in a - single piece: - - < - - - - - - - - - piece_size - - - - - - - - - -> - +-------------------------------------------------+ - | skipped_bits | f_bits | / / / / / / / / / / | - +-------------------------------------------------+ - - The current logic determines the size of the sub-piece to operate on by - limiting the piece size to the bit size of f and then subtracting the - skipped bits: - - min (piece_size, f_bits) - skipped_bits - - Instead of: - - min (piece_size - skipped_bits, f_bits) - - So the resulting sub-piece size is corrupted, leading to wrong handling of - this piece in write_pieced_value. - - Note that the same bug was already found in read_pieced_value and fixed - there (but not in write_pieced_value), see PR 15391. - - This patch swaps the calculations, bringing them into the same (correct) - order as in read_pieced_value. - - gdb/ChangeLog: - - * dwarf2loc.c (write_pieced_value): Fix order of calculations for - size capping. - - gdb/testsuite/ChangeLog: - - * gdb.dwarf2/var-pieces.exp: Add test case for modifying a - variable at nonzero offset. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,3 +1,8 @@ -+2017-06-13 Andreas Arnez -+ -+ * dwarf2loc.c (write_pieced_value): Fix order of calculations for -+ size capping. -+ - 2017-06-13 Yao Qi - - * mips-linux-nat.c: Move include features/mips*-linux.c to ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1964,8 +1964,6 @@ write_pieced_value (struct value *to, struct value *from) - bits_to_skip -= this_size_bits; - continue; - } -- if (this_size_bits > type_len - offset) -- this_size_bits = type_len - offset; - if (bits_to_skip > 0) - { - dest_offset_bits = bits_to_skip; -@@ -1978,6 +1976,8 @@ write_pieced_value (struct value *to, struct value *from) - dest_offset_bits = 0; - source_offset_bits = offset; - } -+ if (this_size_bits > type_len - offset) -+ this_size_bits = type_len - offset; - - this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8; - source_offset = source_offset_bits / 8; -### a/gdb/testsuite/ChangeLog -### b/gdb/testsuite/ChangeLog -## -1,5 +1,10 @@ - 2017-06-13 Andreas Arnez - -+ * gdb.dwarf2/var-pieces.exp: Add test case for modifying a -+ variable at nonzero offset. -+ -+2017-06-13 Andreas Arnez -+ - * gdb.dwarf2/var-access.c: New file. - * gdb.dwarf2/var-access.exp: New test. - * lib/gdb-utils.exp (string_to_regexp): Quote braces as well. ---- a/gdb/testsuite/gdb.dwarf2/var-access.exp -+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp -@@ -178,6 +178,11 @@ gdb_test "print/d s1" " = \\{a = 63, b = 3, c = 0, d = 1\\}" \ - "verify s1.a" - gdb_test "print/d a" " = \\{0, 1, 63, 3, 4, 5, 6, 7\\}" \ - "verify s1.a through a" -+gdb_test_no_output "set var s1.b = 42" -+gdb_test "print/d s1" " = \\{a = 63, b = 42, c = 0, d = 1\\}" \ -+ "verify s1.b" -+gdb_test "print/d a" " = \\{0, 1, 63, 42, 4, 5, 6, 7\\}" \ -+ "verify s1.b through a" - - # Byte-aligned register- and memory pieces. - gdb_test_no_output "set var \$[lindex $regname 0] = 81" \ diff --git a/gdb-rhbz1420304-s390x-12of35.patch b/gdb-rhbz1420304-s390x-12of35.patch deleted file mode 100644 index f4bd787..0000000 --- a/gdb-rhbz1420304-s390x-12of35.patch +++ /dev/null @@ -1,196 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-12of35.patch - -FileName: gdb-rhbz1420304-s390x-12of35.patch - - -commit e93523245b704bc126705620969b4736b00350c5 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:26 2017 +0200 - - PR gdb/21226: Take DWARF stack value pieces from LSB end - - When taking a DW_OP_piece or DW_OP_bit_piece from a DW_OP_stack_value, the - existing logic always takes the piece from the lowest-addressed end, which - is wrong on big-endian targets. The DWARF standard states that the - "DW_OP_bit_piece operation describes a sequence of bits using the least - significant bits of that value", and this also matches the current logic - in GCC. For instance, the GCC guality test case pr54970.c fails on s390x - because of this. - - This fix adjusts the piece accordingly on big-endian targets. It is - assumed that: - - * DW_OP_piece shall take the piece from the LSB end as well; - - * pieces reaching outside the stack value bits are considered undefined, - and a zero value can be used instead. - - gdb/ChangeLog: - - PR gdb/21226 - * dwarf2loc.c (read_pieced_value): Anchor stack value pieces at - the LSB end, independent of endianness. - - gdb/testsuite/ChangeLog: - - PR gdb/21226 - * gdb.dwarf2/nonvar-access.exp: Add checks for verifying that - stack value pieces are taken from the LSB end. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ PR gdb/21226 -+ * dwarf2loc.c (read_pieced_value): Anchor stack value pieces at -+ the LSB end, independent of endianness. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (write_pieced_value): Fix order of calculations for - size capping. - ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1858,6 +1858,10 @@ read_pieced_value (struct value *v) - if (unavail) - mark_value_bits_unavailable (v, offset, this_size_bits); - } -+ -+ copy_bitwise (contents, dest_offset_bits, -+ intermediate_buffer, source_offset_bits % 8, -+ this_size_bits, bits_big_endian); - } - break; - -@@ -1866,26 +1870,30 @@ read_pieced_value (struct value *v) - p->v.mem.in_stack_memory, - p->v.mem.addr + source_offset, - buffer.data (), this_size); -+ copy_bitwise (contents, dest_offset_bits, -+ intermediate_buffer, source_offset_bits % 8, -+ this_size_bits, bits_big_endian); - break; - - case DWARF_VALUE_STACK: - { -- size_t n = this_size; -+ struct objfile *objfile = dwarf2_per_cu_objfile (c->per_cu); -+ struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile); -+ ULONGEST stack_value_size_bits -+ = 8 * TYPE_LENGTH (value_type (p->v.value)); - -- if (n > c->addr_size - source_offset) -- n = (c->addr_size >= source_offset -- ? c->addr_size - source_offset -- : 0); -- if (n == 0) -- { -- /* Nothing. */ -- } -- else -- { -- const gdb_byte *val_bytes = value_contents_all (p->v.value); -+ /* Use zeroes if piece reaches beyond stack value. */ -+ if (p->size > stack_value_size_bits) -+ break; - -- intermediate_buffer = val_bytes + source_offset; -- } -+ /* Piece is anchored at least significant bit end. */ -+ if (gdbarch_byte_order (objfile_gdbarch) == BFD_ENDIAN_BIG) -+ source_offset_bits += stack_value_size_bits - p->size; -+ -+ copy_bitwise (contents, dest_offset_bits, -+ value_contents_all (p->v.value), -+ source_offset_bits, -+ this_size_bits, bits_big_endian); - } - break; - -@@ -1899,6 +1907,10 @@ read_pieced_value (struct value *v) - : 0); - if (n != 0) - intermediate_buffer = p->v.literal.data + source_offset; -+ -+ copy_bitwise (contents, dest_offset_bits, -+ intermediate_buffer, source_offset_bits % 8, -+ this_size_bits, bits_big_endian); - } - break; - -@@ -1915,12 +1927,6 @@ read_pieced_value (struct value *v) - internal_error (__FILE__, __LINE__, _("invalid location type")); - } - -- if (p->location != DWARF_VALUE_OPTIMIZED_OUT -- && p->location != DWARF_VALUE_IMPLICIT_POINTER) -- copy_bitwise (contents, dest_offset_bits, -- intermediate_buffer, source_offset_bits % 8, -- this_size_bits, bits_big_endian); -- - offset += this_size_bits; - } - } -### a/gdb/testsuite/ChangeLog -### b/gdb/testsuite/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ PR gdb/21226 -+ * gdb.dwarf2/nonvar-access.exp: Add checks for verifying that -+ stack value pieces are taken from the LSB end. -+ -+2017-06-13 Andreas Arnez -+ - * gdb.dwarf2/var-pieces.exp: Add test case for modifying a - variable at nonzero offset. - ---- a/gdb/testsuite/gdb.dwarf2/nonvar-access.exp -+++ b/gdb/testsuite/gdb.dwarf2/nonvar-access.exp -@@ -128,14 +128,26 @@ Dwarf::assemble $asm_file { - {name def_t} - {type :$struct_t_label} - {location { -- const1u 0 -+ const2s -184 - stack_value - bit_piece 9 0 -- const1s -1 -+ const4u 1752286 - stack_value - bit_piece 23 0 - } SPECIAL_expr} - } -+ # Composite location with some empty pieces. -+ DW_TAG_variable { -+ {name part_def_a} -+ {type :$array_a9_label} -+ {location { -+ piece 3 -+ const4u 0xf1927314 -+ stack_value -+ piece 4 -+ piece 2 -+ } SPECIAL_expr} -+ } - # Implicit location: immediate value. - DW_TAG_variable { - {name def_implicit_s} -@@ -221,9 +233,12 @@ gdb_test "print/x *implicit_b_ptr" " = $val" - - # Byte-aligned fields, pieced together from DWARF stack values. - gdb_test "print def_s" " = \\{a = 0, b = -1\\}" -+switch $endian { big {set val 0x92} little {set val 0x73} } -+gdb_test "print/x part_def_a\[4\]" " = $val" -+gdb_test "print/x part_def_a\[8\]" " = " - - # Non-byte-aligned fields, pieced together from DWARF stack values. --gdb_test "print def_t" " = \\{a = 0, b = -1\\}" -+gdb_test "print def_t" " = \\{a = -184, b = 1752286\\}" - - # Simple variable without location. - gdb_test "print undef_int" " = " diff --git a/gdb-rhbz1420304-s390x-13of35.patch b/gdb-rhbz1420304-s390x-13of35.patch deleted file mode 100644 index ecb1b16..0000000 --- a/gdb-rhbz1420304-s390x-13of35.patch +++ /dev/null @@ -1,79 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-13of35.patch - -FileName: gdb-rhbz1420304-s390x-13of35.patch - - -commit 805acca042afed8e8431c92ab031167b03475676 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:26 2017 +0200 - - gdb/testsuite: Add "get_endianness" convenience proc - - The test suite contains multiple instances of determining the target's - endianness with GDB's "show endian" command. This patch replaces these by - an invocation of a new convenience proc 'get_endianness'. - - gdb/testsuite/ChangeLog: - - * lib/gdb.exp (get_endianness): New proc. - * gdb.arch/aarch64-fp.exp: Use it. - * gdb.arch/altivec-regs.exp: Likewise. - * gdb.arch/e500-regs.exp: Likewise. - * gdb.arch/vsx-regs.exp: Likewise. - * gdb.base/dump.exp: Likewise. - * gdb.base/funcargs.exp: Likewise. - * gdb.base/gnu_vector.exp: Likewise. - * gdb.dwarf2/formdata16.exp: Likewise. - * gdb.dwarf2/implptrpiece.exp: Likewise. - * gdb.dwarf2/nonvar-access.exp: Likewise. - * gdb.python/py-inferior.exp: Likewise. - * gdb.trace/unavailable-dwarf-piece.exp: Likewise. - -### a/gdb/testsuite/ChangeLog -### b/gdb/testsuite/ChangeLog -## -1,5 +1,21 @@ - 2017-06-13 Andreas Arnez - -+ * lib/gdb.exp (get_endianness): New proc. -+ * gdb.arch/aarch64-fp.exp: Use it. -+ * gdb.arch/altivec-regs.exp: Likewise. -+ * gdb.arch/e500-regs.exp: Likewise. -+ * gdb.arch/vsx-regs.exp: Likewise. -+ * gdb.base/dump.exp: Likewise. -+ * gdb.base/funcargs.exp: Likewise. -+ * gdb.base/gnu_vector.exp: Likewise. -+ * gdb.dwarf2/formdata16.exp: Likewise. -+ * gdb.dwarf2/implptrpiece.exp: Likewise. -+ * gdb.dwarf2/nonvar-access.exp: Likewise. -+ * gdb.python/py-inferior.exp: Likewise. -+ * gdb.trace/unavailable-dwarf-piece.exp: Likewise. -+ -+2017-06-13 Andreas Arnez -+ - PR gdb/21226 - * gdb.dwarf2/nonvar-access.exp: Add checks for verifying that - stack value pieces are taken from the LSB end. ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -5671,6 +5671,19 @@ proc set_remotetimeout { timeout } { - } - } - -+# Get the target's current endianness and return it. -+proc get_endianness { } { -+ global gdb_prompt -+ -+ gdb_test_multiple "show endian" "determine endianness" { -+ -re ".* (little|big) endian.*\r\n$gdb_prompt $" { -+ # Pass silently. -+ return $expect_out(1,string) -+ } -+ } -+ return "little" -+} -+ - # ROOT and FULL are file names. Returns the relative path from ROOT - # to FULL. Note that FULL must be in a subdirectory of ROOT. - # For example, given ROOT = /usr/bin and FULL = /usr/bin/ls, this diff --git a/gdb-rhbz1420304-s390x-14of35.patch b/gdb-rhbz1420304-s390x-14of35.patch deleted file mode 100644 index 7cae341..0000000 --- a/gdb-rhbz1420304-s390x-14of35.patch +++ /dev/null @@ -1,77 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-14of35.patch - -FileName: gdb-rhbz1420304-s390x-14of35.patch - - -commit af547a9614969e1d1ea6fcec6b59cd77a606380f -Author: Andreas Arnez -Date: Tue Jun 13 15:20:27 2017 +0200 - - read/write_pieced_value: Respect value parent's offset - - In the case of targeting a bit-field, read_pieced_value and - write_pieced_value calculate the number of bits preceding the bit-field - without considering the relative offset of the value's parent. This is - relevant for a structure variable like this: - - struct s { - uint64_t foo; - struct { - uint32_t bar; - uint32_t bf : 10; /* <-- target bit-field */ - } baz; - } s; - - In this scenario, if 'val' is a GDB value representing s.baz.bf, - val->parent represents the whole s.baz structure, and the following holds: - - - value_offset (val) == sizeof s.baz.bar == 4 - - value_offset (val->parent) == sizeof s.foo == 8 - - The current logic would only use value_offset(val), resulting in the wrong - offset into the target value. This is fixed. - - gdb/ChangeLog: - - * dwarf2loc.c (read_pieced_value): Respect parent value's offset - when targeting a bit-field. - (write_pieced_value): Likewise. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (read_pieced_value): Respect parent value's offset -+ when targeting a bit-field. -+ (write_pieced_value): Likewise. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (struct piece_closure) : Remove field. - (allocate_piece_closure): Drop addr_size parameter. - (dwarf2_evaluate_loc_desc_full): Adjust call to ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1776,7 +1776,8 @@ read_pieced_value (struct value *v) - bits_to_skip = 8 * value_offset (v); - if (value_bitsize (v)) - { -- bits_to_skip += value_bitpos (v); -+ bits_to_skip += (8 * value_offset (value_parent (v)) -+ + value_bitpos (v)); - type_len = value_bitsize (v); - } - else -@@ -1946,7 +1947,8 @@ write_pieced_value (struct value *to, struct value *from) - bits_to_skip = 8 * value_offset (to); - if (value_bitsize (to)) - { -- bits_to_skip += value_bitpos (to); -+ bits_to_skip += (8 * value_offset (value_parent (to)) -+ + value_bitpos (to)); - type_len = value_bitsize (to); - } - else diff --git a/gdb-rhbz1420304-s390x-15of35.patch b/gdb-rhbz1420304-s390x-15of35.patch deleted file mode 100644 index 255041c..0000000 --- a/gdb-rhbz1420304-s390x-15of35.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-15of35.patch - -FileName: gdb-rhbz1420304-s390x-15of35.patch - - -commit cdaac320fd62bff75562aaa3e466494dc72dd175 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:27 2017 +0200 - - write_pieced_value: Fix copy/paste error in size calculation - - In write_pieced_value, the number of bytes containing a portion of the - bit-field in a given piece is calculated with the wrong starting offset; - thus the result may be off by one. This bug was probably introduced when - copying this logic from read_pieced_value. Fix it. - - gdb/ChangeLog: - - * dwarf2loc.c (write_pieced_value): Fix copy/paste error in the - calculation of this_size. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,10 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (write_pieced_value): Fix copy/paste error in the -+ calculation of this_size. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (read_pieced_value): Respect parent value's offset - when targeting a bit-field. - (write_pieced_value): Likewise. ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1983,7 +1983,7 @@ write_pieced_value (struct value *to, struct value *from) - if (this_size_bits > type_len - offset) - this_size_bits = type_len - offset; - -- this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8; -+ this_size = (this_size_bits + dest_offset_bits % 8 + 7) / 8; - source_offset = source_offset_bits / 8; - dest_offset = dest_offset_bits / 8; - if (dest_offset_bits % 8 == 0 && source_offset_bits % 8 == 0) diff --git a/gdb-rhbz1420304-s390x-16of35.patch b/gdb-rhbz1420304-s390x-16of35.patch deleted file mode 100644 index 7d8d178..0000000 --- a/gdb-rhbz1420304-s390x-16of35.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-16of35.patch - -FileName: gdb-rhbz1420304-s390x-16of35.patch - -commit f1cc987420d9d2489eb453bd1c87139666cbe7fd -Author: Andreas Arnez -Date: Tue Jun 13 15:20:27 2017 +0200 - - write_pieced_value: Include transfer size in byte-wise check - - In write_pieced_value, when checking whether the data can be transferred - byte-wise, the current logic verifies the source- and destination offsets - to be byte-aligned, but not the transfer size. This is fixed. - - gdb/ChangeLog: - - * dwarf2loc.c (write_pieced_value): Include transfer size in - byte-wise check. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,10 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (write_pieced_value): Include transfer size in -+ byte-wise check. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (write_pieced_value): Fix copy/paste error in the - calculation of this_size. - ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1986,7 +1986,10 @@ write_pieced_value (struct value *to, struct value *from) - this_size = (this_size_bits + dest_offset_bits % 8 + 7) / 8; - source_offset = source_offset_bits / 8; - dest_offset = dest_offset_bits / 8; -- if (dest_offset_bits % 8 == 0 && source_offset_bits % 8 == 0) -+ -+ /* Check whether the data can be transferred byte-wise. */ -+ if (dest_offset_bits % 8 == 0 && source_offset_bits % 8 == 0 -+ && this_size_bits % 8 == 0) - { - source_buffer = contents + source_offset; - need_bitwise = 0; diff --git a/gdb-rhbz1420304-s390x-17of35.patch b/gdb-rhbz1420304-s390x-17of35.patch deleted file mode 100644 index 00b5e55..0000000 --- a/gdb-rhbz1420304-s390x-17of35.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-17of35.patch - -FileName: gdb-rhbz1420304-s390x-17of35.patch - -commit 07c9ca3bd8e6f83bcec49c922b52422c538f60f7 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:28 2017 +0200 - - write_pieced_value: Fix buffer offset for memory pieces - - In write_pieced_value, when transferring the data to target memory via a - buffer, the bit offset within the target value is not reduced to its - sub-byte fraction before using it as a bit offset into the buffer. This - is fixed. - - gdb/ChangeLog: - - * dwarf2loc.c (write_pieced_value): In DWARF_VALUE_MEMORY, - truncate full bytes from dest_offset_bits before using it as an - offset into the buffer. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (write_pieced_value): In DWARF_VALUE_MEMORY, -+ truncate full bytes from dest_offset_bits before using it as an -+ offset into the buffer. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (write_pieced_value): Include transfer size in - byte-wise check. - ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -2058,7 +2058,7 @@ write_pieced_value (struct value *to, struct value *from) - read_memory (p->v.mem.addr + dest_offset, buffer.data (), 1); - read_memory (p->v.mem.addr + dest_offset + this_size - 1, - &buffer[this_size - 1], 1); -- copy_bitwise (buffer.data (), dest_offset_bits, -+ copy_bitwise (buffer.data (), dest_offset_bits % 8, - contents, source_offset_bits, - this_size_bits, - bits_big_endian); diff --git a/gdb-rhbz1420304-s390x-18of35.patch b/gdb-rhbz1420304-s390x-18of35.patch deleted file mode 100644 index 271335d..0000000 --- a/gdb-rhbz1420304-s390x-18of35.patch +++ /dev/null @@ -1,172 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-18of35.patch - -FileName: gdb-rhbz1420304-s390x-18of35.patch - -commit 359b19bb24d048750aa5367ad56a33267300d1a8 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:28 2017 +0200 - - write_pieced_value: Transfer least significant bits into bit-field - - On big-endian targets, when targeting a bit-field, write_pieced_value - currently transfers the source value's *most* significant bits to the - target value, instead of its least significant bits. This is fixed. - - In particular the fix adjusts the initial value of 'offset', which can now - potentially be nonzero. Thus the variable 'type_len' is renamed to - 'max_offset', to avoid confusion. And for consistency, the affected logic - that was mirrored in read_pieced_value is changed there in the same way. - - gdb/ChangeLog: - - * dwarf2loc.c (write_pieced_value): When writing to a bit-field, - transfer the source value's least significant bits, instead of its - lowest-addressed ones. Rename type_len to max_offset. - (read_pieced_value): Mirror above changes to write_pieced_value as - applicable. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,13 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (write_pieced_value): When writing to a bit-field, -+ transfer the source value's least significant bits, instead of its -+ lowest-addressed ones. Rename type_len to max_offset. -+ (read_pieced_value): Mirror above changes to write_pieced_value as -+ applicable. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (write_pieced_value): In DWARF_VALUE_MEMORY, - truncate full bytes from dest_offset_bits before using it as an - offset into the buffer. ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1756,12 +1756,11 @@ static void - read_pieced_value (struct value *v) - { - int i; -- long offset = 0; -+ LONGEST offset = 0, max_offset; - ULONGEST bits_to_skip; - gdb_byte *contents; - struct piece_closure *c - = (struct piece_closure *) value_computed_closure (v); -- size_t type_len; - size_t buffer_size = 0; - std::vector buffer; - int bits_big_endian -@@ -1778,12 +1777,12 @@ read_pieced_value (struct value *v) - { - bits_to_skip += (8 * value_offset (value_parent (v)) - + value_bitpos (v)); -- type_len = value_bitsize (v); -+ max_offset = value_bitsize (v); - } - else -- type_len = 8 * TYPE_LENGTH (value_type (v)); -+ max_offset = 8 * TYPE_LENGTH (value_type (v)); - -- for (i = 0; i < c->n_pieces && offset < type_len; i++) -+ for (i = 0; i < c->n_pieces && offset < max_offset; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size, this_size_bits; -@@ -1798,20 +1797,13 @@ read_pieced_value (struct value *v) - bits_to_skip -= this_size_bits; - continue; - } -- if (bits_to_skip > 0) -- { -- dest_offset_bits = 0; -- source_offset_bits = bits_to_skip; -- this_size_bits -= bits_to_skip; -- bits_to_skip = 0; -- } -- else -- { -- dest_offset_bits = offset; -- source_offset_bits = 0; -- } -- if (this_size_bits > type_len - offset) -- this_size_bits = type_len - offset; -+ source_offset_bits = bits_to_skip; -+ this_size_bits -= bits_to_skip; -+ bits_to_skip = 0; -+ dest_offset_bits = offset; -+ -+ if (this_size_bits > max_offset - offset) -+ this_size_bits = max_offset - offset; - - this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8; - source_offset = source_offset_bits / 8; -@@ -1932,12 +1924,11 @@ static void - write_pieced_value (struct value *to, struct value *from) - { - int i; -- long offset = 0; - ULONGEST bits_to_skip; -+ LONGEST offset = 0, max_offset; - const gdb_byte *contents; - struct piece_closure *c - = (struct piece_closure *) value_computed_closure (to); -- size_t type_len; - size_t buffer_size = 0; - std::vector buffer; - int bits_big_endian -@@ -1949,12 +1940,20 @@ write_pieced_value (struct value *to, struct value *from) - { - bits_to_skip += (8 * value_offset (value_parent (to)) - + value_bitpos (to)); -- type_len = value_bitsize (to); -- } -+ /* Use the least significant bits of FROM. */ -+ if (gdbarch_byte_order (get_type_arch (value_type (from))) -+ == BFD_ENDIAN_BIG) -+ { -+ max_offset = 8 * TYPE_LENGTH (value_type (from)); -+ offset = max_offset - value_bitsize (to); -+ } -+ else -+ max_offset = value_bitsize (to); -+ } - else -- type_len = 8 * TYPE_LENGTH (value_type (to)); -+ max_offset = 8 * TYPE_LENGTH (value_type (to)); - -- for (i = 0; i < c->n_pieces && offset < type_len; i++) -+ for (i = 0; i < c->n_pieces && offset < max_offset; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits, this_size; -@@ -1968,20 +1967,13 @@ write_pieced_value (struct value *to, struct value *from) - bits_to_skip -= this_size_bits; - continue; - } -- if (bits_to_skip > 0) -- { -- dest_offset_bits = bits_to_skip; -- source_offset_bits = 0; -- this_size_bits -= bits_to_skip; -- bits_to_skip = 0; -- } -- else -- { -- dest_offset_bits = 0; -- source_offset_bits = offset; -- } -- if (this_size_bits > type_len - offset) -- this_size_bits = type_len - offset; -+ dest_offset_bits = bits_to_skip; -+ this_size_bits -= bits_to_skip; -+ bits_to_skip = 0; -+ source_offset_bits = offset; -+ -+ if (this_size_bits > max_offset - offset) -+ this_size_bits = max_offset - offset; - - this_size = (this_size_bits + dest_offset_bits % 8 + 7) / 8; - source_offset = source_offset_bits / 8; diff --git a/gdb-rhbz1420304-s390x-19of35.patch b/gdb-rhbz1420304-s390x-19of35.patch deleted file mode 100644 index 474b739..0000000 --- a/gdb-rhbz1420304-s390x-19of35.patch +++ /dev/null @@ -1,148 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-19of35.patch - -FileName: gdb-rhbz1420304-s390x-19of35.patch - -commit 3bf310110722b03d9ff9c4f34f5920a9be2878d0 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:29 2017 +0200 - - Add DWARF piece test cases for bit-field access - - This verifies some of the previous fixes to the logic in - write_pieced_value when accessing bit-fields. - - gdb/testsuite/ChangeLog: - - * gdb.dwarf2/var-access.exp: Add tests for accessing bit-fields - located in one or more DWARF pieces. - -### a/gdb/testsuite/ChangeLog -### b/gdb/testsuite/ChangeLog -## -1,5 +1,10 @@ - 2017-06-13 Andreas Arnez - -+ * gdb.dwarf2/var-access.exp: Add tests for accessing bit-fields -+ located in one or more DWARF pieces. -+ -+2017-06-13 Andreas Arnez -+ - * lib/gdb.exp (get_endianness): New proc. - * gdb.arch/aarch64-fp.exp: Use it. - * gdb.arch/altivec-regs.exp: Likewise. ---- a/gdb/testsuite/gdb.dwarf2/var-access.exp -+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp -@@ -62,7 +62,8 @@ Dwarf::assemble $asm_file { - } { - declare_labels char_type_label - declare_labels int_type_label short_type_label -- declare_labels array_a8_label struct_s_label -+ declare_labels array_a8_label struct_s_label struct_t_label -+ declare_labels struct_st_label - - # char - char_type_label: base_type { -@@ -115,6 +116,51 @@ Dwarf::assemble $asm_file { - } - } - -+ # struct t { int u, x:9, y:13, z:10; }; -+ struct_t_label: structure_type { -+ {name "t"} -+ {byte_size 8 DW_FORM_sdata} -+ } { -+ member { -+ {name "u"} -+ {type :$int_type_label} -+ } -+ member { -+ {name "x"} -+ {type :$int_type_label} -+ {data_member_location 4 DW_FORM_udata} -+ {bit_size 9 DW_FORM_udata} -+ } -+ member { -+ {name "y"} -+ {type :$int_type_label} -+ {data_bit_offset 41 DW_FORM_udata} -+ {bit_size 13 DW_FORM_udata} -+ } -+ member { -+ {name "z"} -+ {type :$int_type_label} -+ {data_bit_offset 54 DW_FORM_udata} -+ {bit_size 10 DW_FORM_udata} -+ } -+ } -+ -+ # struct st { struct s s; struct t t; }; -+ struct_st_label: structure_type { -+ {name "st"} -+ {byte_size 12 DW_FORM_udata} -+ } { -+ member { -+ {name "s"} -+ {type :$struct_s_label} -+ } -+ member { -+ {name "t"} -+ {type :$struct_t_label} -+ {data_member_location 4 DW_FORM_udata} -+ } -+ } -+ - DW_TAG_subprogram { - {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }} - {DW_AT_external 1 flag} -@@ -156,6 +202,19 @@ Dwarf::assemble $asm_file { - piece 1 - } SPECIAL_expr} - } -+ # Memory pieces for bitfield access: 8 bytes optimized -+ # out, 3 bytes from &buf[3], and 1 byte from &buf[1]. -+ DW_TAG_variable { -+ {name "st1"} -+ {type :$struct_st_label} -+ {location { -+ piece 8 -+ addr "$buf_var + 3" -+ piece 3 -+ addr "$buf_var + 1" -+ piece 1 -+ } SPECIAL_expr} -+ } - } - } - } -@@ -170,6 +229,9 @@ if ![runto_main] { - return -1 - } - -+# Determine byte order. -+set endian [get_endianness] -+ - # Byte-aligned memory pieces. - gdb_test "print/d s1" " = \\{a = 2, b = 3, c = 0, d = 1\\}" \ - "s1 == re-ordered buf" -@@ -200,3 +262,20 @@ gdb_test_no_output "set var s2 = {191, 73, 231, 123}" \ - "re-initialize s2" - gdb_test "print/d s2" " = \\{a = 191, b = 73, c = 231, d = 123\\}" \ - "verify re-initialized s2" -+ -+# Unaligned bitfield access through byte-aligned pieces. -+gdb_test_no_output "set var a = { 0 }" -+gdb_test_no_output "set var st1.t.x = -7" -+gdb_test_no_output "set var st1.t.z = 340" -+gdb_test_no_output "set var st1.t.y = 1234" -+gdb_test "print st1.t" " = \\{u = , x = -7, y = 1234, z = 340\\}" \ -+ "verify st1.t" -+switch $endian { -+ little {set val "0x55, 0x0, 0xf9, 0xa5, 0x9"} -+ big {set val "0x54, 0x0, 0xfc, 0x93, 0x49"} -+} -+# | -- | z:2-9 | -- | x:0-7 | x:8 y:0-6 | y:7-12 z:0-1 | -- | -- | -+# \_______________________________________________/ -+# val -+gdb_test "print/x a" " = \\{0x0, ${val}, 0x0, 0x0\\}" \ -+ "verify st1 through a" diff --git a/gdb-rhbz1420304-s390x-20of35.patch b/gdb-rhbz1420304-s390x-20of35.patch deleted file mode 100644 index ba920c3..0000000 --- a/gdb-rhbz1420304-s390x-20of35.patch +++ /dev/null @@ -1,80 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-20of35.patch - -FileName: gdb-rhbz1420304-s390x-20of35.patch - -commit 840989c113433c069f54872d7e051e1572202326 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:30 2017 +0200 - - read/write_pieced_value: Drop 'buffer_size' variable - - When the variable 'buffer_size' in read_pieced_value and - write_pieced_value was introduced, it was needed for tracking the buffer's - allocated size. Now that the buffer's data type has been changed to a - std::vector, the variable is no longer necessary; so remove it. - - gdb/ChangeLog: - - * dwarf2loc.c (read_pieced_value): Remove buffer_size variable. - (write_pieced_value): Likewise. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,10 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (read_pieced_value): Remove buffer_size variable. -+ (write_pieced_value): Likewise. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (write_pieced_value): When writing to a bit-field, - transfer the source value's least significant bits, instead of its - lowest-addressed ones. Rename type_len to max_offset. ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1761,7 +1761,6 @@ read_pieced_value (struct value *v) - gdb_byte *contents; - struct piece_closure *c - = (struct piece_closure *) value_computed_closure (v); -- size_t buffer_size = 0; - std::vector buffer; - int bits_big_endian - = gdbarch_bits_big_endian (get_type_arch (value_type (v))); -@@ -1806,12 +1805,8 @@ read_pieced_value (struct value *v) - this_size_bits = max_offset - offset; - - this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8; -+ buffer.reserve (this_size); - source_offset = source_offset_bits / 8; -- if (buffer_size < this_size) -- { -- buffer_size = this_size; -- buffer.reserve (buffer_size); -- } - intermediate_buffer = buffer.data (); - - /* Copy from the source to DEST_BUFFER. */ -@@ -1929,7 +1924,6 @@ write_pieced_value (struct value *to, struct value *from) - const gdb_byte *contents; - struct piece_closure *c - = (struct piece_closure *) value_computed_closure (to); -- size_t buffer_size = 0; - std::vector buffer; - int bits_big_endian - = gdbarch_bits_big_endian (get_type_arch (value_type (to))); -@@ -1988,11 +1982,7 @@ write_pieced_value (struct value *to, struct value *from) - } - else - { -- if (buffer_size < this_size) -- { -- buffer_size = this_size; -- buffer.reserve (buffer_size); -- } -+ buffer.reserve (this_size); - source_buffer = buffer.data (); - need_bitwise = 1; - } diff --git a/gdb-rhbz1420304-s390x-21of35.patch b/gdb-rhbz1420304-s390x-21of35.patch deleted file mode 100644 index 28dc008..0000000 --- a/gdb-rhbz1420304-s390x-21of35.patch +++ /dev/null @@ -1,233 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-21of35.patch - -FileName: gdb-rhbz1420304-s390x-21of35.patch - -commit 03c8af18d1a8f359fd023696848bda488119da60 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:30 2017 +0200 - - Fix handling of DWARF register pieces on big-endian targets - - For big-endian targets the logic in read/write_pieced_value tries to take - a register piece from the LSB end. This requires offsets and sizes to be - adjusted accordingly, and that's where the current implementation has some - issues: - - * The formulas for recalculating the bit- and byte-offsets into the - register are wrong. They just happen to yield correct results if - everything is byte-aligned and the piece's last byte belongs to the - given value. - - * After recalculating the bit offset into the register, the number of - bytes to be copied from the register is not recalculated. Of course - this does not matter if everything (particularly the piece size) is - byte-aligned. - - These issues are fixed. The size calculation is performed with a new - helper function bits_to_bytes(). - - gdb/ChangeLog: - - * dwarf2loc.c (bits_to_bytes): New function. - (read_pieced_value): Fix offset calculations for register pieces - on big-endian targets. - (write_pieced_value): Likewise. - - gdb/testsuite/ChangeLog: - - * gdb.dwarf2/var-access.exp: Add test for non-byte-aligned - register pieces. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,12 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (bits_to_bytes): New function. -+ (read_pieced_value): Fix offset calculations for register pieces -+ on big-endian targets. -+ (write_pieced_value): Likewise. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (read_pieced_value): Remove buffer_size variable. - (write_pieced_value): Likewise. - ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1752,6 +1752,15 @@ copy_bitwise_tests (void) - - #endif /* GDB_SELF_TEST */ - -+/* Return the number of bytes overlapping a contiguous chunk of N_BITS -+ bits whose first bit is located at bit offset START. */ -+ -+static size_t -+bits_to_bytes (ULONGEST start, ULONGEST n_bits) -+{ -+ return (start % 8 + n_bits + 7) / 8; -+} -+ - static void - read_pieced_value (struct value *v) - { -@@ -1804,7 +1813,7 @@ read_pieced_value (struct value *v) - if (this_size_bits > max_offset - offset) - this_size_bits = max_offset - offset; - -- this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8; -+ this_size = bits_to_bytes (source_offset_bits, this_size_bits); - buffer.reserve (this_size); - source_offset = source_offset_bits / 8; - intermediate_buffer = buffer.data (); -@@ -1817,20 +1826,20 @@ read_pieced_value (struct value *v) - struct frame_info *frame = frame_find_by_id (c->frame_id); - struct gdbarch *arch = get_frame_arch (frame); - int gdb_regnum = dwarf_reg_to_regnum_or_error (arch, p->v.regno); -+ ULONGEST reg_bits = 8 * register_size (arch, gdb_regnum); - int optim, unavail; -- LONGEST reg_offset = source_offset; - - if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG -- && this_size < register_size (arch, gdb_regnum)) -+ && p->size < reg_bits) - { - /* Big-endian, and we want less than full size. */ -- reg_offset = register_size (arch, gdb_regnum) - this_size; -- /* We want the lower-order THIS_SIZE_BITS of the bytes -- we extract from the register. */ -- source_offset_bits += 8 * this_size - this_size_bits; -+ source_offset_bits += reg_bits - p->size; - } -+ this_size = bits_to_bytes (source_offset_bits, this_size_bits); -+ buffer.reserve (this_size); - -- if (!get_frame_register_bytes (frame, gdb_regnum, reg_offset, -+ if (!get_frame_register_bytes (frame, gdb_regnum, -+ source_offset_bits / 8, - this_size, buffer.data (), - &optim, &unavail)) - { -@@ -1844,7 +1853,7 @@ read_pieced_value (struct value *v) - } - - copy_bitwise (contents, dest_offset_bits, -- intermediate_buffer, source_offset_bits % 8, -+ buffer.data (), source_offset_bits % 8, - this_size_bits, bits_big_endian); - } - break; -@@ -1969,7 +1978,7 @@ write_pieced_value (struct value *to, struct value *from) - if (this_size_bits > max_offset - offset) - this_size_bits = max_offset - offset; - -- this_size = (this_size_bits + dest_offset_bits % 8 + 7) / 8; -+ this_size = bits_to_bytes (dest_offset_bits, this_size_bits); - source_offset = source_offset_bits / 8; - dest_offset = dest_offset_bits / 8; - -@@ -1994,20 +2003,25 @@ write_pieced_value (struct value *to, struct value *from) - struct frame_info *frame = frame_find_by_id (c->frame_id); - struct gdbarch *arch = get_frame_arch (frame); - int gdb_regnum = dwarf_reg_to_regnum_or_error (arch, p->v.regno); -- int reg_offset = dest_offset; -+ ULONGEST reg_bits = 8 * register_size (arch, gdb_regnum); - - if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG -- && this_size <= register_size (arch, gdb_regnum)) -+ && p->size <= reg_bits) - { - /* Big-endian, and we want less than full size. */ -- reg_offset = register_size (arch, gdb_regnum) - this_size; -+ dest_offset_bits += reg_bits - p->size; - } -+ this_size = bits_to_bytes (dest_offset_bits, this_size_bits); -+ buffer.reserve (this_size); - -- if (need_bitwise) -+ if (dest_offset_bits % 8 != 0 || this_size_bits % 8 != 0) - { -+ /* Data is copied non-byte-aligned into the register. -+ Need some bits from original register value. */ - int optim, unavail; - -- if (!get_frame_register_bytes (frame, gdb_regnum, reg_offset, -+ if (!get_frame_register_bytes (frame, gdb_regnum, -+ dest_offset_bits / 8, - this_size, buffer.data (), - &optim, &unavail)) - { -@@ -2022,14 +2036,14 @@ write_pieced_value (struct value *to, struct value *from) - "bitfield; containing word " - "is unavailable")); - } -- copy_bitwise (buffer.data (), dest_offset_bits, -- contents, source_offset_bits, -- this_size_bits, -- bits_big_endian); - } - -- put_frame_register_bytes (frame, gdb_regnum, reg_offset, -- this_size, source_buffer); -+ copy_bitwise (buffer.data (), dest_offset_bits % 8, -+ contents, source_offset_bits, -+ this_size_bits, bits_big_endian); -+ put_frame_register_bytes (frame, gdb_regnum, -+ dest_offset_bits / 8, -+ this_size, buffer.data ()); - } - break; - case DWARF_VALUE_MEMORY: -### a/gdb/testsuite/ChangeLog -### b/gdb/testsuite/ChangeLog -## -1,5 +1,10 @@ - 2017-06-13 Andreas Arnez - -+ * gdb.dwarf2/var-access.exp: Add test for non-byte-aligned -+ register pieces. -+ -+2017-06-13 Andreas Arnez -+ - * gdb.dwarf2/var-access.exp: Add tests for accessing bit-fields - located in one or more DWARF pieces. - ---- a/gdb/testsuite/gdb.dwarf2/var-access.exp -+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp -@@ -215,6 +215,19 @@ Dwarf::assemble $asm_file { - piece 1 - } SPECIAL_expr} - } -+ # Register pieces for bitfield access: 4 bytes optimized -+ # out, 3 bytes from r0, and 1 byte from r1. -+ DW_TAG_variable { -+ {name "t2"} -+ {type :$struct_t_label} -+ {location { -+ piece 4 -+ regx [lindex $dwarf_regnum 0] -+ piece 3 -+ regx [lindex $dwarf_regnum 1] -+ piece 1 -+ } SPECIAL_expr} -+ } - } - } - } -@@ -279,3 +292,15 @@ switch $endian { - # val - gdb_test "print/x a" " = \\{0x0, ${val}, 0x0, 0x0\\}" \ - "verify st1 through a" -+ -+switch $endian { big {set val 0x7ffc} little {set val 0x3ffe00} } -+gdb_test_no_output "set var \$[lindex $regname 0] = $val" \ -+ "init t2, first piece" -+gdb_test_no_output "set var \$[lindex $regname 1] = 0" \ -+ "init t2, second piece" -+gdb_test "print/d t2" " = \\{u = , x = 0, y = -1, z = 0\\}" \ -+ "initialized t2 from regs" -+gdb_test_no_output "set var t2.y = 2641" -+gdb_test_no_output "set var t2.z = -400" -+gdb_test_no_output "set var t2.x = 200" -+gdb_test "print t2.x + t2.y + t2.z" " = 2441" diff --git a/gdb-rhbz1420304-s390x-22of35.patch b/gdb-rhbz1420304-s390x-22of35.patch deleted file mode 100644 index 680ba5d..0000000 --- a/gdb-rhbz1420304-s390x-22of35.patch +++ /dev/null @@ -1,226 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-22of35.patch - -FileName: gdb-rhbz1420304-s390x-22of35.patch - -commit 242d31ab7c3901e02bd68c1824d1d3610e02562b -Author: Andreas Arnez -Date: Tue Jun 13 15:20:30 2017 +0200 - - read/write_pieced_value: Improve logic for buffer allocation - - So far the main loop in read_pieced_value and write_pieced_value is - structured like this: - - (1) Prepare a buffer and some variables we may need; - - (2) depending on the DWARF piece type to be handled, use the buffer and - the prepared variables, ignore them, or even recalculate them. - - This approach reduces readability and may also lead to unnecessary copying - of data. This patch moves the preparations to the places where sufficient - information is available and removes some of the variables involved. - - gdb/ChangeLog: - - * dwarf2loc.c (read_pieced_value): Move the buffer allocation and - some other preparations to the places where sufficient information - is available. - (write_pieced_value): Likewise. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,12 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (read_pieced_value): Move the buffer allocation and -+ some other preparations to the places where sufficient information -+ is available. -+ (write_pieced_value): Likewise. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (bits_to_bytes): New function. - (read_pieced_value): Fix offset calculations for register pieces - on big-endian targets. ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1794,8 +1794,7 @@ read_pieced_value (struct value *v) - { - struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size, this_size_bits; -- long dest_offset_bits, source_offset_bits, source_offset; -- const gdb_byte *intermediate_buffer; -+ long dest_offset_bits, source_offset_bits; - - /* Compute size, source, and destination offsets for copying, in - bits. */ -@@ -1813,11 +1812,6 @@ read_pieced_value (struct value *v) - if (this_size_bits > max_offset - offset) - this_size_bits = max_offset - offset; - -- this_size = bits_to_bytes (source_offset_bits, this_size_bits); -- buffer.reserve (this_size); -- source_offset = source_offset_bits / 8; -- intermediate_buffer = buffer.data (); -- - /* Copy from the source to DEST_BUFFER. */ - switch (p->location) - { -@@ -1843,13 +1837,11 @@ read_pieced_value (struct value *v) - this_size, buffer.data (), - &optim, &unavail)) - { -- /* Just so garbage doesn't ever shine through. */ -- memset (buffer.data (), 0, this_size); -- - if (optim) - mark_value_bits_optimized_out (v, offset, this_size_bits); - if (unavail) - mark_value_bits_unavailable (v, offset, this_size_bits); -+ break; - } - - copy_bitwise (contents, dest_offset_bits, -@@ -1859,12 +1851,15 @@ read_pieced_value (struct value *v) - break; - - case DWARF_VALUE_MEMORY: -+ this_size = bits_to_bytes (source_offset_bits, this_size_bits); -+ buffer.reserve (this_size); -+ - read_value_memory (v, offset, - p->v.mem.in_stack_memory, -- p->v.mem.addr + source_offset, -+ p->v.mem.addr + source_offset_bits / 8, - buffer.data (), this_size); - copy_bitwise (contents, dest_offset_bits, -- intermediate_buffer, source_offset_bits % 8, -+ buffer.data (), source_offset_bits % 8, - this_size_bits, bits_big_endian); - break; - -@@ -1892,18 +1887,18 @@ read_pieced_value (struct value *v) - - case DWARF_VALUE_LITERAL: - { -- size_t n = this_size; -+ ULONGEST literal_size_bits = 8 * p->v.literal.length; -+ size_t n = this_size_bits; - -- if (n > p->v.literal.length - source_offset) -- n = (p->v.literal.length >= source_offset -- ? p->v.literal.length - source_offset -- : 0); -- if (n != 0) -- intermediate_buffer = p->v.literal.data + source_offset; -+ /* Cut off at the end of the implicit value. */ -+ if (source_offset_bits >= literal_size_bits) -+ break; -+ if (n > literal_size_bits - source_offset_bits) -+ n = literal_size_bits - source_offset_bits; - - copy_bitwise (contents, dest_offset_bits, -- intermediate_buffer, source_offset_bits % 8, -- this_size_bits, bits_big_endian); -+ p->v.literal.data, source_offset_bits, -+ n, bits_big_endian); - } - break; - -@@ -1960,9 +1955,7 @@ write_pieced_value (struct value *to, struct value *from) - { - struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits, this_size; -- long dest_offset_bits, source_offset_bits, dest_offset, source_offset; -- int need_bitwise; -- const gdb_byte *source_buffer; -+ long dest_offset_bits, source_offset_bits; - - this_size_bits = p->size; - if (bits_to_skip > 0 && bits_to_skip >= this_size_bits) -@@ -1978,24 +1971,6 @@ write_pieced_value (struct value *to, struct value *from) - if (this_size_bits > max_offset - offset) - this_size_bits = max_offset - offset; - -- this_size = bits_to_bytes (dest_offset_bits, this_size_bits); -- source_offset = source_offset_bits / 8; -- dest_offset = dest_offset_bits / 8; -- -- /* Check whether the data can be transferred byte-wise. */ -- if (dest_offset_bits % 8 == 0 && source_offset_bits % 8 == 0 -- && this_size_bits % 8 == 0) -- { -- source_buffer = contents + source_offset; -- need_bitwise = 0; -- } -- else -- { -- buffer.reserve (this_size); -- source_buffer = buffer.data (); -- need_bitwise = 1; -- } -- - switch (p->location) - { - case DWARF_VALUE_REGISTER: -@@ -2047,21 +2022,44 @@ write_pieced_value (struct value *to, struct value *from) - } - break; - case DWARF_VALUE_MEMORY: -- if (need_bitwise) -- { -- /* Only the first and last bytes can possibly have any -- bits reused. */ -- read_memory (p->v.mem.addr + dest_offset, buffer.data (), 1); -- read_memory (p->v.mem.addr + dest_offset + this_size - 1, -- &buffer[this_size - 1], 1); -- copy_bitwise (buffer.data (), dest_offset_bits % 8, -- contents, source_offset_bits, -- this_size_bits, -- bits_big_endian); -- } -+ { -+ CORE_ADDR start_addr = p->v.mem.addr + dest_offset_bits / 8; -+ -+ if (dest_offset_bits % 8 == 0 && this_size_bits % 8 == 0 -+ && source_offset_bits % 8 == 0) -+ { -+ /* Everything is byte-aligned; no buffer needed. */ -+ write_memory (start_addr, -+ contents + source_offset_bits / 8, -+ this_size_bits / 8); -+ break; -+ } -+ -+ this_size = bits_to_bytes (dest_offset_bits, this_size_bits); -+ buffer.reserve (this_size); - -- write_memory (p->v.mem.addr + dest_offset, -- source_buffer, this_size); -+ if (dest_offset_bits % 8 != 0 || this_size_bits % 8 != 0) -+ { -+ if (this_size <= 8) -+ { -+ /* Perform a single read for small sizes. */ -+ read_memory (start_addr, buffer.data (), this_size); -+ } -+ else -+ { -+ /* Only the first and last bytes can possibly have any -+ bits reused. */ -+ read_memory (start_addr, buffer.data (), 1); -+ read_memory (start_addr + this_size - 1, -+ &buffer[this_size - 1], 1); -+ } -+ } -+ -+ copy_bitwise (buffer.data (), dest_offset_bits % 8, -+ contents, source_offset_bits, -+ this_size_bits, bits_big_endian); -+ write_memory (start_addr, buffer.data (), this_size); -+ } - break; - default: - mark_value_bytes_optimized_out (to, 0, TYPE_LENGTH (value_type (to))); diff --git a/gdb-rhbz1420304-s390x-23of35.patch b/gdb-rhbz1420304-s390x-23of35.patch deleted file mode 100644 index 5cf8f10..0000000 --- a/gdb-rhbz1420304-s390x-23of35.patch +++ /dev/null @@ -1,173 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-23of35.patch - -FileName: gdb-rhbz1420304-s390x-23of35.patch - -commit 65d84b76164dc8ec1a1f0f0e0fd41667065ffd4e -Author: Andreas Arnez -Date: Tue Jun 13 15:20:31 2017 +0200 - - Respect piece offset for DW_OP_bit_piece - - So far GDB ignores the piece offset of all kinds of DWARF bit - pieces (DW_OP_bit_piece) and treats such pieces as if the offset was zero. - - This is fixed, and an appropriate test is added. - - gdb/ChangeLog: - - * dwarf2loc.c (read_pieced_value): Respect the piece offset, as - given by DW_OP_bit_piece. - (write_pieced_value): Likewise. - - Andreas Arnez - - * gdb.dwarf2/var-access.exp: Add test for composite location with - nonzero piece offsets. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (read_pieced_value): Respect the piece offset, as -+ given by DW_OP_bit_piece. -+ (write_pieced_value): Likewise. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (read_pieced_value): Move the buffer allocation and - some other preparations to the places where sufficient information - is available. ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1824,11 +1824,14 @@ read_pieced_value (struct value *v) - int optim, unavail; - - if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG -- && p->size < reg_bits) -+ && p->offset + p->size < reg_bits) - { - /* Big-endian, and we want less than full size. */ -- source_offset_bits += reg_bits - p->size; -+ source_offset_bits += reg_bits - (p->offset + p->size); - } -+ else -+ source_offset_bits += p->offset; -+ - this_size = bits_to_bytes (source_offset_bits, this_size_bits); - buffer.reserve (this_size); - -@@ -1851,6 +1854,7 @@ read_pieced_value (struct value *v) - break; - - case DWARF_VALUE_MEMORY: -+ source_offset_bits += p->offset; - this_size = bits_to_bytes (source_offset_bits, this_size_bits); - buffer.reserve (this_size); - -@@ -1871,12 +1875,15 @@ read_pieced_value (struct value *v) - = 8 * TYPE_LENGTH (value_type (p->v.value)); - - /* Use zeroes if piece reaches beyond stack value. */ -- if (p->size > stack_value_size_bits) -+ if (p->offset + p->size > stack_value_size_bits) - break; - - /* Piece is anchored at least significant bit end. */ - if (gdbarch_byte_order (objfile_gdbarch) == BFD_ENDIAN_BIG) -- source_offset_bits += stack_value_size_bits - p->size; -+ source_offset_bits += (stack_value_size_bits -+ - p->offset - p->size); -+ else -+ source_offset_bits += p->offset; - - copy_bitwise (contents, dest_offset_bits, - value_contents_all (p->v.value), -@@ -1891,6 +1898,7 @@ read_pieced_value (struct value *v) - size_t n = this_size_bits; - - /* Cut off at the end of the implicit value. */ -+ source_offset_bits += p->offset; - if (source_offset_bits >= literal_size_bits) - break; - if (n > literal_size_bits - source_offset_bits) -@@ -1981,11 +1989,14 @@ write_pieced_value (struct value *to, struct value *from) - ULONGEST reg_bits = 8 * register_size (arch, gdb_regnum); - - if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG -- && p->size <= reg_bits) -+ && p->offset + p->size < reg_bits) - { - /* Big-endian, and we want less than full size. */ -- dest_offset_bits += reg_bits - p->size; -+ dest_offset_bits += reg_bits - (p->offset + p->size); - } -+ else -+ dest_offset_bits += p->offset; -+ - this_size = bits_to_bytes (dest_offset_bits, this_size_bits); - buffer.reserve (this_size); - -@@ -2023,6 +2034,8 @@ write_pieced_value (struct value *to, struct value *from) - break; - case DWARF_VALUE_MEMORY: - { -+ dest_offset_bits += p->offset; -+ - CORE_ADDR start_addr = p->v.mem.addr + dest_offset_bits / 8; - - if (dest_offset_bits % 8 == 0 && this_size_bits % 8 == 0 ---- a/gdb/testsuite/gdb.dwarf2/var-access.exp -+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp -@@ -228,6 +228,24 @@ Dwarf::assemble $asm_file { - piece 1 - } SPECIAL_expr} - } -+ # One piece per bitfield, using piece offsets: 32 bits of -+ # an implicit value, 9 bits of a stack value, 13 bits of -+ # r0, and 10 bits of buf. -+ DW_TAG_variable { -+ {name "t3"} -+ {type :$struct_t_label} -+ {location { -+ implicit_value 0x12 0x34 0x56 0x78 0x9a -+ bit_piece 32 4 -+ const2s -280 -+ stack_value -+ bit_piece 9 2 -+ regx [lindex $dwarf_regnum 0] -+ bit_piece 13 14 -+ addr $buf_var -+ bit_piece 10 42 -+ } SPECIAL_expr} -+ } - } - } - } -@@ -304,3 +322,24 @@ gdb_test_no_output "set var t2.y = 2641" - gdb_test_no_output "set var t2.z = -400" - gdb_test_no_output "set var t2.x = 200" - gdb_test "print t2.x + t2.y + t2.z" " = 2441" -+ -+# Bitfield access through pieces with nonzero piece offsets. -+gdb_test_no_output "set var \$[lindex $regname 0] = 0xa8000" \ -+ "init reg for t3.y" -+gdb_test_no_output "set var *(char \[2\] *) (a + 5) = { 70, 82 }" \ -+ "init mem for t3.z" -+switch $endian { -+ little {set val "u = -1484430527, x = -70, y = 42, z = 145"} -+ big {set val "u = 591751049, x = -70, y = 42, z = 101"} -+} -+gdb_test "print t3" " = \\{$val\\}" \ -+ "initialized t3 from reg and mem" -+gdb_test_no_output "set var t3.y = -1" \ -+ "overwrite t3.y" -+gdb_test "print/x \$[lindex $regname 0]" " = 0x7ffc000" \ -+ "verify t3.y through reg" -+gdb_test_no_output "set var t3.z = -614" \ -+ "overwrite t3.z" -+switch $endian {big {set val "0x59, 0xa2"} little {set val "0x6a, 0x56"}} -+gdb_test "print/x *(char \[2\] *) (a + 5)" " = \\{$val\\}" \ -+ "verify t3.z through mem" diff --git a/gdb-rhbz1420304-s390x-24of35.patch b/gdb-rhbz1420304-s390x-24of35.patch deleted file mode 100644 index fc6b3fb..0000000 --- a/gdb-rhbz1420304-s390x-24of35.patch +++ /dev/null @@ -1,296 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-24of35.patch - -FileName: gdb-rhbz1420304-s390x-24of35.patch - -commit f236533e3c6a2693bea879b2a4d24d1229864ac9 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:31 2017 +0200 - - read/write_pieced_value: Remove unnecessary variable copies - - In read_pieced_value's main loop, the variables `dest_offset_bits' and - `source_offset_bits' are basically just copies of `offset' and - `bits_to_skip', respectively. In write_pieced_value the copies are - reversed. This is not very helpful when trying to keep the logic between - these functions in sync. Since the copies are unnecessary, this patch - just removes them. - - gdb/ChangeLog: - - * dwarf2loc.c (read_pieced_value): Remove unnecessary variables - dest_offset_bits and source_offset_bits. - (write_pieced_value): Likewise. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (read_pieced_value): Remove unnecessary variables -+ dest_offset_bits and source_offset_bits. -+ (write_pieced_value): Likewise. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (read_pieced_value): Respect the piece offset, as - given by DW_OP_bit_piece. - (write_pieced_value): Likewise. ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1790,25 +1790,16 @@ read_pieced_value (struct value *v) - else - max_offset = 8 * TYPE_LENGTH (value_type (v)); - -- for (i = 0; i < c->n_pieces && offset < max_offset; i++) -+ /* Advance to the first non-skipped piece. */ -+ for (i = 0; i < c->n_pieces && bits_to_skip >= c->pieces[i].size; i++) -+ bits_to_skip -= c->pieces[i].size; -+ -+ for (; i < c->n_pieces && offset < max_offset; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size, this_size_bits; -- long dest_offset_bits, source_offset_bits; -- -- /* Compute size, source, and destination offsets for copying, in -- bits. */ -- this_size_bits = p->size; -- if (bits_to_skip > 0 && bits_to_skip >= this_size_bits) -- { -- bits_to_skip -= this_size_bits; -- continue; -- } -- source_offset_bits = bits_to_skip; -- this_size_bits -= bits_to_skip; -- bits_to_skip = 0; -- dest_offset_bits = offset; - -+ this_size_bits = p->size - bits_to_skip; - if (this_size_bits > max_offset - offset) - this_size_bits = max_offset - offset; - -@@ -1827,16 +1818,16 @@ read_pieced_value (struct value *v) - && p->offset + p->size < reg_bits) - { - /* Big-endian, and we want less than full size. */ -- source_offset_bits += reg_bits - (p->offset + p->size); -+ bits_to_skip += reg_bits - (p->offset + p->size); - } - else -- source_offset_bits += p->offset; -+ bits_to_skip += p->offset; - -- this_size = bits_to_bytes (source_offset_bits, this_size_bits); -+ this_size = bits_to_bytes (bits_to_skip, this_size_bits); - buffer.reserve (this_size); - - if (!get_frame_register_bytes (frame, gdb_regnum, -- source_offset_bits / 8, -+ bits_to_skip / 8, - this_size, buffer.data (), - &optim, &unavail)) - { -@@ -1846,24 +1837,23 @@ read_pieced_value (struct value *v) - mark_value_bits_unavailable (v, offset, this_size_bits); - break; - } -- -- copy_bitwise (contents, dest_offset_bits, -- buffer.data (), source_offset_bits % 8, -+ copy_bitwise (contents, offset, -+ buffer.data (), bits_to_skip % 8, - this_size_bits, bits_big_endian); - } - break; - - case DWARF_VALUE_MEMORY: -- source_offset_bits += p->offset; -- this_size = bits_to_bytes (source_offset_bits, this_size_bits); -+ bits_to_skip += p->offset; -+ this_size = bits_to_bytes (bits_to_skip, this_size_bits); - buffer.reserve (this_size); - - read_value_memory (v, offset, - p->v.mem.in_stack_memory, -- p->v.mem.addr + source_offset_bits / 8, -+ p->v.mem.addr + bits_to_skip / 8, - buffer.data (), this_size); -- copy_bitwise (contents, dest_offset_bits, -- buffer.data (), source_offset_bits % 8, -+ copy_bitwise (contents, offset, -+ buffer.data (), bits_to_skip % 8, - this_size_bits, bits_big_endian); - break; - -@@ -1880,14 +1870,13 @@ read_pieced_value (struct value *v) - - /* Piece is anchored at least significant bit end. */ - if (gdbarch_byte_order (objfile_gdbarch) == BFD_ENDIAN_BIG) -- source_offset_bits += (stack_value_size_bits -- - p->offset - p->size); -+ bits_to_skip += stack_value_size_bits - p->offset - p->size; - else -- source_offset_bits += p->offset; -+ bits_to_skip += p->offset; - -- copy_bitwise (contents, dest_offset_bits, -+ copy_bitwise (contents, offset, - value_contents_all (p->v.value), -- source_offset_bits, -+ bits_to_skip, - this_size_bits, bits_big_endian); - } - break; -@@ -1898,14 +1887,14 @@ read_pieced_value (struct value *v) - size_t n = this_size_bits; - - /* Cut off at the end of the implicit value. */ -- source_offset_bits += p->offset; -- if (source_offset_bits >= literal_size_bits) -+ bits_to_skip += p->offset; -+ if (bits_to_skip >= literal_size_bits) - break; -- if (n > literal_size_bits - source_offset_bits) -- n = literal_size_bits - source_offset_bits; -+ if (n > literal_size_bits - bits_to_skip) -+ n = literal_size_bits - bits_to_skip; - -- copy_bitwise (contents, dest_offset_bits, -- p->v.literal.data, source_offset_bits, -+ copy_bitwise (contents, offset, -+ p->v.literal.data, bits_to_skip, - n, bits_big_endian); - } - break; -@@ -1924,6 +1913,7 @@ read_pieced_value (struct value *v) - } - - offset += this_size_bits; -+ bits_to_skip = 0; - } - } - -@@ -1959,23 +1949,16 @@ write_pieced_value (struct value *to, struct value *from) - else - max_offset = 8 * TYPE_LENGTH (value_type (to)); - -- for (i = 0; i < c->n_pieces && offset < max_offset; i++) -+ /* Advance to the first non-skipped piece. */ -+ for (i = 0; i < c->n_pieces && bits_to_skip >= c->pieces[i].size; i++) -+ bits_to_skip -= c->pieces[i].size; -+ -+ for (; i < c->n_pieces && offset < max_offset; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits, this_size; -- long dest_offset_bits, source_offset_bits; -- -- this_size_bits = p->size; -- if (bits_to_skip > 0 && bits_to_skip >= this_size_bits) -- { -- bits_to_skip -= this_size_bits; -- continue; -- } -- dest_offset_bits = bits_to_skip; -- this_size_bits -= bits_to_skip; -- bits_to_skip = 0; -- source_offset_bits = offset; - -+ this_size_bits = p->size - bits_to_skip; - if (this_size_bits > max_offset - offset) - this_size_bits = max_offset - offset; - -@@ -1992,22 +1975,22 @@ write_pieced_value (struct value *to, struct value *from) - && p->offset + p->size < reg_bits) - { - /* Big-endian, and we want less than full size. */ -- dest_offset_bits += reg_bits - (p->offset + p->size); -+ bits_to_skip += reg_bits - (p->offset + p->size); - } - else -- dest_offset_bits += p->offset; -+ bits_to_skip += p->offset; - -- this_size = bits_to_bytes (dest_offset_bits, this_size_bits); -+ this_size = bits_to_bytes (bits_to_skip, this_size_bits); - buffer.reserve (this_size); - -- if (dest_offset_bits % 8 != 0 || this_size_bits % 8 != 0) -+ if (bits_to_skip % 8 != 0 || this_size_bits % 8 != 0) - { - /* Data is copied non-byte-aligned into the register. - Need some bits from original register value. */ - int optim, unavail; - - if (!get_frame_register_bytes (frame, gdb_regnum, -- dest_offset_bits / 8, -+ bits_to_skip / 8, - this_size, buffer.data (), - &optim, &unavail)) - { -@@ -2024,34 +2007,34 @@ write_pieced_value (struct value *to, struct value *from) - } - } - -- copy_bitwise (buffer.data (), dest_offset_bits % 8, -- contents, source_offset_bits, -+ copy_bitwise (buffer.data (), bits_to_skip % 8, -+ contents, offset, - this_size_bits, bits_big_endian); - put_frame_register_bytes (frame, gdb_regnum, -- dest_offset_bits / 8, -+ bits_to_skip / 8, - this_size, buffer.data ()); - } - break; - case DWARF_VALUE_MEMORY: - { -- dest_offset_bits += p->offset; -+ bits_to_skip += p->offset; - -- CORE_ADDR start_addr = p->v.mem.addr + dest_offset_bits / 8; -+ CORE_ADDR start_addr = p->v.mem.addr + bits_to_skip / 8; - -- if (dest_offset_bits % 8 == 0 && this_size_bits % 8 == 0 -- && source_offset_bits % 8 == 0) -+ if (bits_to_skip % 8 == 0 && this_size_bits % 8 == 0 -+ && offset % 8 == 0) - { - /* Everything is byte-aligned; no buffer needed. */ - write_memory (start_addr, -- contents + source_offset_bits / 8, -+ contents + offset / 8, - this_size_bits / 8); - break; - } - -- this_size = bits_to_bytes (dest_offset_bits, this_size_bits); -+ this_size = bits_to_bytes (bits_to_skip, this_size_bits); - buffer.reserve (this_size); - -- if (dest_offset_bits % 8 != 0 || this_size_bits % 8 != 0) -+ if (bits_to_skip % 8 != 0 || this_size_bits % 8 != 0) - { - if (this_size <= 8) - { -@@ -2068,8 +2051,8 @@ write_pieced_value (struct value *to, struct value *from) - } - } - -- copy_bitwise (buffer.data (), dest_offset_bits % 8, -- contents, source_offset_bits, -+ copy_bitwise (buffer.data (), bits_to_skip % 8, -+ contents, offset, - this_size_bits, bits_big_endian); - write_memory (start_addr, buffer.data (), this_size); - } -@@ -2079,6 +2062,7 @@ write_pieced_value (struct value *to, struct value *from) - break; - } - offset += this_size_bits; -+ bits_to_skip = 0; - } - } - diff --git a/gdb-rhbz1420304-s390x-25of35.patch b/gdb-rhbz1420304-s390x-25of35.patch deleted file mode 100644 index cb488f5..0000000 --- a/gdb-rhbz1420304-s390x-25of35.patch +++ /dev/null @@ -1,82 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-25of35.patch - -FileName: gdb-rhbz1420304-s390x-25of35.patch - -commit 23f945bf8cebf348154aff43782de2e1977e9230 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:31 2017 +0200 - - Fix bit-/byte-offset mismatch in parameter to read_value_memory - - The function read_value_memory accepts a parameter embedded_offset and - expects it to represent the byte offset into the given value. However, - the only invocation with a possibly non-zero embedded_offset happens in - read_pieced_value, where a bit offset is passed instead. - - Adjust the implementation of read_value_memory to meet the caller's - expectation. This implicitly fixes the invocation in read_pieced_value. - - gdb/ChangeLog: - - * valops.c (read_value_memory): Change embedded_offset to - represent a bit offset instead of a byte offset. - * value.h (read_value_memory): Adjust comment. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ * valops.c (read_value_memory): Change embedded_offset to -+ represent a bit offset instead of a byte offset. -+ * value.h (read_value_memory): Adjust comment. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (read_pieced_value): Remove unnecessary variables - dest_offset_bits and source_offset_bits. - (write_pieced_value): Likewise. ---- a/gdb/valops.c -+++ b/gdb/valops.c -@@ -958,7 +958,7 @@ value_at_lazy (struct type *type, CORE_ADDR addr) - } - - void --read_value_memory (struct value *val, LONGEST embedded_offset, -+read_value_memory (struct value *val, LONGEST bit_offset, - int stack, CORE_ADDR memaddr, - gdb_byte *buffer, size_t length) - { -@@ -984,8 +984,9 @@ read_value_memory (struct value *val, LONGEST embedded_offset, - if (status == TARGET_XFER_OK) - /* nothing */; - else if (status == TARGET_XFER_UNAVAILABLE) -- mark_value_bytes_unavailable (val, embedded_offset + xfered_total, -- xfered_partial); -+ mark_value_bits_unavailable (val, (xfered_total * HOST_CHAR_BIT -+ + bit_offset), -+ xfered_partial * HOST_CHAR_BIT); - else if (status == TARGET_XFER_EOF) - memory_error (TARGET_XFER_E_IO, memaddr + xfered_total); - else ---- a/gdb/value.h -+++ b/gdb/value.h -@@ -581,12 +581,11 @@ extern int value_contents_eq (const struct value *val1, LONGEST offset1, - - /* Read LENGTH addressable memory units starting at MEMADDR into BUFFER, - which is (or will be copied to) VAL's contents buffer offset by -- EMBEDDED_OFFSET (that is, to &VAL->contents[EMBEDDED_OFFSET]). -- Marks value contents ranges as unavailable if the corresponding -- memory is likewise unavailable. STACK indicates whether the memory -- is known to be stack memory. */ -+ BIT_OFFSET bits. Marks value contents ranges as unavailable if -+ the corresponding memory is likewise unavailable. STACK indicates -+ whether the memory is known to be stack memory. */ - --extern void read_value_memory (struct value *val, LONGEST embedded_offset, -+extern void read_value_memory (struct value *val, LONGEST bit_offset, - int stack, CORE_ADDR memaddr, - gdb_byte *buffer, size_t length); - diff --git a/gdb-rhbz1420304-s390x-26of35.patch b/gdb-rhbz1420304-s390x-26of35.patch deleted file mode 100644 index 6106a4f..0000000 --- a/gdb-rhbz1420304-s390x-26of35.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-26of35.patch - -FileName: gdb-rhbz1420304-s390x-26of35.patch - -commit f65e204425b5b46a5927d9501c42f25d98a866ce -Author: Andreas Arnez -Date: Tue Jun 13 15:20:32 2017 +0200 - - write_pieced_value: Notify memory_changed observers - - So far write_pieced_value uses write_memory when writing memory pieces to - the target. However, this is a case where GDB potentially overwrites a - watchpoint value. In such a case write_memory_with_notification should be - used instead, so that memory_changed observers get notified. - - gdb/ChangeLog: - - * dwarf2loc.c (write_pieced_value): When writing the data for a - memory piece, use write_memory_with_notification instead of - write_memory. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (write_pieced_value): When writing the data for a -+ memory piece, use write_memory_with_notification instead of -+ write_memory. -+ -+2017-06-13 Andreas Arnez -+ - * valops.c (read_value_memory): Change embedded_offset to - represent a bit offset instead of a byte offset. - * value.h (read_value_memory): Adjust comment. ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -2025,9 +2025,9 @@ write_pieced_value (struct value *to, struct value *from) - && offset % 8 == 0) - { - /* Everything is byte-aligned; no buffer needed. */ -- write_memory (start_addr, -- contents + offset / 8, -- this_size_bits / 8); -+ write_memory_with_notification (start_addr, -+ contents + offset / 8, -+ this_size_bits / 8); - break; - } - -@@ -2054,7 +2054,8 @@ write_pieced_value (struct value *to, struct value *from) - copy_bitwise (buffer.data (), bits_to_skip % 8, - contents, offset, - this_size_bits, bits_big_endian); -- write_memory (start_addr, buffer.data (), this_size); -+ write_memory_with_notification (start_addr, buffer.data (), -+ this_size); - } - break; - default: diff --git a/gdb-rhbz1420304-s390x-27of35.patch b/gdb-rhbz1420304-s390x-27of35.patch deleted file mode 100644 index 22f64e2..0000000 --- a/gdb-rhbz1420304-s390x-27of35.patch +++ /dev/null @@ -1,487 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-27of35.patch - -FileName: gdb-rhbz1420304-s390x-27of35.patch - -commit 55acdf2242372ae52abb25c80db8e75df5578b23 -Author: Andreas Arnez -Date: Tue Jun 13 15:20:32 2017 +0200 - - read/write_pieced_value: Merge into one function - - Since read_pieced_value and write_pieced_value share significant logic, - this patch merges them into a single function rw_pieced_value. - - gdb/ChangeLog: - - * dwarf2loc.c (rw_pieced_value): New. Merge logic from... - (read_pieced_value, write_pieced_value): ...here. Reduce to - wrappers that just call rw_pieced_value. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,11 @@ - 2017-06-13 Andreas Arnez - -+ * dwarf2loc.c (rw_pieced_value): New. Merge logic from... -+ (read_pieced_value, write_pieced_value): ...here. Reduce to -+ wrappers that just call rw_pieced_value. -+ -+2017-06-13 Andreas Arnez -+ - * dwarf2loc.c (write_pieced_value): When writing the data for a - memory piece, use write_memory_with_notification instead of - write_memory. ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1761,31 +1761,55 @@ bits_to_bytes (ULONGEST start, ULONGEST n_bits) - return (start % 8 + n_bits + 7) / 8; - } - -+/* Read or write a pieced value V. If FROM != NULL, operate in "write -+ mode": copy FROM into the pieces comprising V. If FROM == NULL, -+ operate in "read mode": fetch the contents of the (lazy) value V by -+ composing it from its pieces. */ -+ - static void --read_pieced_value (struct value *v) -+rw_pieced_value (struct value *v, struct value *from) - { - int i; - LONGEST offset = 0, max_offset; - ULONGEST bits_to_skip; -- gdb_byte *contents; -+ gdb_byte *v_contents; -+ const gdb_byte *from_contents; - struct piece_closure *c - = (struct piece_closure *) value_computed_closure (v); - std::vector buffer; - int bits_big_endian - = gdbarch_bits_big_endian (get_type_arch (value_type (v))); - -- if (value_type (v) != value_enclosing_type (v)) -- internal_error (__FILE__, __LINE__, -- _("Should not be able to create a lazy value with " -- "an enclosing type")); -+ if (from != NULL) -+ { -+ from_contents = value_contents (from); -+ v_contents = NULL; -+ } -+ else -+ { -+ if (value_type (v) != value_enclosing_type (v)) -+ internal_error (__FILE__, __LINE__, -+ _("Should not be able to create a lazy value with " -+ "an enclosing type")); -+ v_contents = value_contents_raw (v); -+ from_contents = NULL; -+ } - -- contents = value_contents_raw (v); - bits_to_skip = 8 * value_offset (v); - if (value_bitsize (v)) - { - bits_to_skip += (8 * value_offset (value_parent (v)) - + value_bitpos (v)); -- max_offset = value_bitsize (v); -+ if (from != NULL -+ && (gdbarch_byte_order (get_type_arch (value_type (from))) -+ == BFD_ENDIAN_BIG)) -+ { -+ /* Use the least significant bits of FROM. */ -+ max_offset = 8 * TYPE_LENGTH (value_type (from)); -+ offset = max_offset - value_bitsize (v); -+ } -+ else -+ max_offset = value_bitsize (v); - } - else - max_offset = 8 * TYPE_LENGTH (value_type (v)); -@@ -1797,13 +1821,12 @@ read_pieced_value (struct value *v) - for (; i < c->n_pieces && offset < max_offset; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; -- size_t this_size, this_size_bits; -+ size_t this_size_bits, this_size; - - this_size_bits = p->size - bits_to_skip; - if (this_size_bits > max_offset - offset) - this_size_bits = max_offset - offset; - -- /* Copy from the source to DEST_BUFFER. */ - switch (p->location) - { - case DWARF_VALUE_REGISTER: -@@ -1826,39 +1849,137 @@ read_pieced_value (struct value *v) - this_size = bits_to_bytes (bits_to_skip, this_size_bits); - buffer.reserve (this_size); - -- if (!get_frame_register_bytes (frame, gdb_regnum, -- bits_to_skip / 8, -- this_size, buffer.data (), -- &optim, &unavail)) -+ if (from == NULL) - { -- if (optim) -- mark_value_bits_optimized_out (v, offset, this_size_bits); -- if (unavail) -- mark_value_bits_unavailable (v, offset, this_size_bits); -- break; -+ /* Read mode. */ -+ if (!get_frame_register_bytes (frame, gdb_regnum, -+ bits_to_skip / 8, -+ this_size, buffer.data (), -+ &optim, &unavail)) -+ { -+ if (optim) -+ mark_value_bits_optimized_out (v, offset, -+ this_size_bits); -+ if (unavail) -+ mark_value_bits_unavailable (v, offset, -+ this_size_bits); -+ break; -+ } -+ -+ copy_bitwise (v_contents, offset, -+ buffer.data (), bits_to_skip % 8, -+ this_size_bits, bits_big_endian); -+ } -+ else -+ { -+ /* Write mode. */ -+ if (bits_to_skip % 8 != 0 || this_size_bits % 8 != 0) -+ { -+ /* Data is copied non-byte-aligned into the register. -+ Need some bits from original register value. */ -+ get_frame_register_bytes (frame, gdb_regnum, -+ bits_to_skip / 8, -+ this_size, buffer.data (), -+ &optim, &unavail); -+ if (optim) -+ throw_error (OPTIMIZED_OUT_ERROR, -+ _("Can't do read-modify-write to " -+ "update bitfield; containing word " -+ "has been optimized out")); -+ if (unavail) -+ throw_error (NOT_AVAILABLE_ERROR, -+ _("Can't do read-modify-write to " -+ "update bitfield; containing word " -+ "is unavailable")); -+ } -+ -+ copy_bitwise (buffer.data (), bits_to_skip % 8, -+ from_contents, offset, -+ this_size_bits, bits_big_endian); -+ put_frame_register_bytes (frame, gdb_regnum, -+ bits_to_skip / 8, -+ this_size, buffer.data ()); - } -- copy_bitwise (contents, offset, -- buffer.data (), bits_to_skip % 8, -- this_size_bits, bits_big_endian); - } - break; - - case DWARF_VALUE_MEMORY: -- bits_to_skip += p->offset; -- this_size = bits_to_bytes (bits_to_skip, this_size_bits); -- buffer.reserve (this_size); -- -- read_value_memory (v, offset, -- p->v.mem.in_stack_memory, -- p->v.mem.addr + bits_to_skip / 8, -- buffer.data (), this_size); -- copy_bitwise (contents, offset, -- buffer.data (), bits_to_skip % 8, -- this_size_bits, bits_big_endian); -+ { -+ bits_to_skip += p->offset; -+ -+ CORE_ADDR start_addr = p->v.mem.addr + bits_to_skip / 8; -+ -+ if (bits_to_skip % 8 == 0 && this_size_bits % 8 == 0 -+ && offset % 8 == 0) -+ { -+ /* Everything is byte-aligned; no buffer needed. */ -+ if (from != NULL) -+ write_memory_with_notification (start_addr, -+ (from_contents -+ + offset / 8), -+ this_size_bits / 8); -+ else -+ read_value_memory (v, offset, -+ p->v.mem.in_stack_memory, -+ p->v.mem.addr + bits_to_skip / 8, -+ v_contents + offset / 8, -+ this_size_bits / 8); -+ break; -+ } -+ -+ this_size = bits_to_bytes (bits_to_skip, this_size_bits); -+ buffer.reserve (this_size); -+ -+ if (from == NULL) -+ { -+ /* Read mode. */ -+ read_value_memory (v, offset, -+ p->v.mem.in_stack_memory, -+ p->v.mem.addr + bits_to_skip / 8, -+ buffer.data (), this_size); -+ copy_bitwise (v_contents, offset, -+ buffer.data (), bits_to_skip % 8, -+ this_size_bits, bits_big_endian); -+ } -+ else -+ { -+ /* Write mode. */ -+ if (bits_to_skip % 8 != 0 || this_size_bits % 8 != 0) -+ { -+ if (this_size <= 8) -+ { -+ /* Perform a single read for small sizes. */ -+ read_memory (start_addr, buffer.data (), -+ this_size); -+ } -+ else -+ { -+ /* Only the first and last bytes can possibly have -+ any bits reused. */ -+ read_memory (start_addr, buffer.data (), 1); -+ read_memory (start_addr + this_size - 1, -+ &buffer[this_size - 1], 1); -+ } -+ } -+ -+ copy_bitwise (buffer.data (), bits_to_skip % 8, -+ from_contents, offset, -+ this_size_bits, bits_big_endian); -+ write_memory_with_notification (start_addr, -+ buffer.data (), -+ this_size); -+ } -+ } - break; - - case DWARF_VALUE_STACK: - { -+ if (from != NULL) -+ { -+ mark_value_bits_optimized_out (v, offset, this_size_bits); -+ break; -+ } -+ - struct objfile *objfile = dwarf2_per_cu_objfile (c->per_cu); - struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile); - ULONGEST stack_value_size_bits -@@ -1874,7 +1995,7 @@ read_pieced_value (struct value *v) - else - bits_to_skip += p->offset; - -- copy_bitwise (contents, offset, -+ copy_bitwise (v_contents, offset, - value_contents_all (p->v.value), - bits_to_skip, - this_size_bits, bits_big_endian); -@@ -1883,6 +2004,12 @@ read_pieced_value (struct value *v) - - case DWARF_VALUE_LITERAL: - { -+ if (from != NULL) -+ { -+ mark_value_bits_optimized_out (v, offset, this_size_bits); -+ break; -+ } -+ - ULONGEST literal_size_bits = 8 * p->v.literal.length; - size_t n = this_size_bits; - -@@ -1893,15 +2020,21 @@ read_pieced_value (struct value *v) - if (n > literal_size_bits - bits_to_skip) - n = literal_size_bits - bits_to_skip; - -- copy_bitwise (contents, offset, -+ copy_bitwise (v_contents, offset, - p->v.literal.data, bits_to_skip, - n, bits_big_endian); - } - break; - -- /* These bits show up as zeros -- but do not cause the value -- to be considered optimized-out. */ - case DWARF_VALUE_IMPLICIT_POINTER: -+ if (from != NULL) -+ { -+ mark_value_bits_optimized_out (v, offset, this_size_bits); -+ break; -+ } -+ -+ /* These bits show up as zeros -- but do not cause the value to -+ be considered optimized-out. */ - break; - - case DWARF_VALUE_OPTIMIZED_OUT: -@@ -1917,154 +2050,17 @@ read_pieced_value (struct value *v) - } - } - -+ - static void --write_pieced_value (struct value *to, struct value *from) -+read_pieced_value (struct value *v) - { -- int i; -- ULONGEST bits_to_skip; -- LONGEST offset = 0, max_offset; -- const gdb_byte *contents; -- struct piece_closure *c -- = (struct piece_closure *) value_computed_closure (to); -- std::vector buffer; -- int bits_big_endian -- = gdbarch_bits_big_endian (get_type_arch (value_type (to))); -- -- contents = value_contents (from); -- bits_to_skip = 8 * value_offset (to); -- if (value_bitsize (to)) -- { -- bits_to_skip += (8 * value_offset (value_parent (to)) -- + value_bitpos (to)); -- /* Use the least significant bits of FROM. */ -- if (gdbarch_byte_order (get_type_arch (value_type (from))) -- == BFD_ENDIAN_BIG) -- { -- max_offset = 8 * TYPE_LENGTH (value_type (from)); -- offset = max_offset - value_bitsize (to); -- } -- else -- max_offset = value_bitsize (to); -- } -- else -- max_offset = 8 * TYPE_LENGTH (value_type (to)); -- -- /* Advance to the first non-skipped piece. */ -- for (i = 0; i < c->n_pieces && bits_to_skip >= c->pieces[i].size; i++) -- bits_to_skip -= c->pieces[i].size; -- -- for (; i < c->n_pieces && offset < max_offset; i++) -- { -- struct dwarf_expr_piece *p = &c->pieces[i]; -- size_t this_size_bits, this_size; -- -- this_size_bits = p->size - bits_to_skip; -- if (this_size_bits > max_offset - offset) -- this_size_bits = max_offset - offset; -- -- switch (p->location) -- { -- case DWARF_VALUE_REGISTER: -- { -- struct frame_info *frame = frame_find_by_id (c->frame_id); -- struct gdbarch *arch = get_frame_arch (frame); -- int gdb_regnum = dwarf_reg_to_regnum_or_error (arch, p->v.regno); -- ULONGEST reg_bits = 8 * register_size (arch, gdb_regnum); -- -- if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG -- && p->offset + p->size < reg_bits) -- { -- /* Big-endian, and we want less than full size. */ -- bits_to_skip += reg_bits - (p->offset + p->size); -- } -- else -- bits_to_skip += p->offset; -- -- this_size = bits_to_bytes (bits_to_skip, this_size_bits); -- buffer.reserve (this_size); -- -- if (bits_to_skip % 8 != 0 || this_size_bits % 8 != 0) -- { -- /* Data is copied non-byte-aligned into the register. -- Need some bits from original register value. */ -- int optim, unavail; -- -- if (!get_frame_register_bytes (frame, gdb_regnum, -- bits_to_skip / 8, -- this_size, buffer.data (), -- &optim, &unavail)) -- { -- if (optim) -- throw_error (OPTIMIZED_OUT_ERROR, -- _("Can't do read-modify-write to " -- "update bitfield; containing word " -- "has been optimized out")); -- if (unavail) -- throw_error (NOT_AVAILABLE_ERROR, -- _("Can't do read-modify-write to update " -- "bitfield; containing word " -- "is unavailable")); -- } -- } -- -- copy_bitwise (buffer.data (), bits_to_skip % 8, -- contents, offset, -- this_size_bits, bits_big_endian); -- put_frame_register_bytes (frame, gdb_regnum, -- bits_to_skip / 8, -- this_size, buffer.data ()); -- } -- break; -- case DWARF_VALUE_MEMORY: -- { -- bits_to_skip += p->offset; -- -- CORE_ADDR start_addr = p->v.mem.addr + bits_to_skip / 8; -- -- if (bits_to_skip % 8 == 0 && this_size_bits % 8 == 0 -- && offset % 8 == 0) -- { -- /* Everything is byte-aligned; no buffer needed. */ -- write_memory_with_notification (start_addr, -- contents + offset / 8, -- this_size_bits / 8); -- break; -- } -- -- this_size = bits_to_bytes (bits_to_skip, this_size_bits); -- buffer.reserve (this_size); -- -- if (bits_to_skip % 8 != 0 || this_size_bits % 8 != 0) -- { -- if (this_size <= 8) -- { -- /* Perform a single read for small sizes. */ -- read_memory (start_addr, buffer.data (), this_size); -- } -- else -- { -- /* Only the first and last bytes can possibly have any -- bits reused. */ -- read_memory (start_addr, buffer.data (), 1); -- read_memory (start_addr + this_size - 1, -- &buffer[this_size - 1], 1); -- } -- } -+ rw_pieced_value (v, NULL); -+} - -- copy_bitwise (buffer.data (), bits_to_skip % 8, -- contents, offset, -- this_size_bits, bits_big_endian); -- write_memory_with_notification (start_addr, buffer.data (), -- this_size); -- } -- break; -- default: -- mark_value_bytes_optimized_out (to, 0, TYPE_LENGTH (value_type (to))); -- break; -- } -- offset += this_size_bits; -- bits_to_skip = 0; -- } -+static void -+write_pieced_value (struct value *to, struct value *from) -+{ -+ rw_pieced_value (to, from); - } - - /* An implementation of an lval_funcs method to see whether a value is diff --git a/gdb-rhbz1420304-s390x-28of35.patch b/gdb-rhbz1420304-s390x-28of35.patch deleted file mode 100644 index f28dec2..0000000 --- a/gdb-rhbz1420304-s390x-28of35.patch +++ /dev/null @@ -1,66 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-28of35.patch - -FileName: gdb-rhbz1420304-s390x-28of35.patch - -commit 5524b5250e319f41933605420e9526fb74cfb9ae -Author: Andreas Arnez -Date: Wed Jun 14 14:24:03 2017 +0200 - - Fix register selection in var-access.exp - - The new test var-access.exp causes FAILs on i686. This is because the - test chooses the wrong name for DWARF register number 1: It uses - "edx" (which corresponds to DWARF register number 2), but should have used - "ecx" instead. - - Also, the current logic in var-access.exp does not correctly distinguish - between a 64-bit and a 32-bit program on an x86-64 target. It uses the - 64-bit register names for both. - - These problems are fixed. In order to address the latter, the convenience - macros is_*_target are exploited where appropriate. - - gdb/testsuite/ChangeLog: - - * gdb.dwarf2/var-access.exp: Use register name ecx instead of edx - on 32-bit x86 targets. Exploit is_*_target macros where - appropriate. - -### a/gdb/testsuite/ChangeLog -### b/gdb/testsuite/ChangeLog -## -1,3 +1,9 @@ -+2017-06-14 Andreas Arnez -+ -+ * gdb.dwarf2/var-access.exp: Use register name ecx instead of edx -+ on 32-bit x86 targets. Exploit is_*_target macros where -+ appropriate. -+ - 2017-06-13 Andreas Arnez - - * gdb.dwarf2/var-access.exp: Add test for non-byte-aligned ---- a/gdb/testsuite/gdb.dwarf2/var-access.exp -+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp -@@ -28,16 +28,16 @@ if {![dwarf2_support]} { - - set dwarf_regnum {0 1} - --if { [istarget "aarch64*-*-*"] } { -+if { [is_aarch64_target] } { - set regname {x0 x1} --} elseif { [istarget "arm*-*-*"] -+} elseif { [is_aarch32_target] - || [istarget "s390*-*-*" ] - || [istarget "powerpc*-*-*"] - || [istarget "rs6000*-*-aix*"] } { - set regname {r0 r1} --} elseif { [istarget "i?86-*-*"] } { -- set regname {eax edx} --} elseif { [istarget "x86_64-*-*"] } { -+} elseif { [is_x86_like_target] } { -+ set regname {eax ecx} -+} elseif { [is_amd64_regs_target] } { - set regname {rax rdx} - } else { - verbose "Skipping tests for accessing DWARF-described variables." diff --git a/gdb-rhbz1420304-s390x-29of35.patch b/gdb-rhbz1420304-s390x-29of35.patch deleted file mode 100644 index 3f9489e..0000000 --- a/gdb-rhbz1420304-s390x-29of35.patch +++ /dev/null @@ -1,203 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-29of35.patch - -FileName: gdb-rhbz1420304-s390x-29of35.patch - -commit b4cbbe8f7294070cc93a71ace78f134965ddad82 -Author: Andreas Krebbel -Date: Thu Jun 8 17:24:50 2017 +0200 - - S/390: Add support for pgste marker - - This patch adds a new S/390 specific segment type: PT_S390_PGSTE. For - binaries marked with that segment the kernel will allocate 4k page - tables. The only user so far will be qemu. - - ld/ChangeLog: - - 2017-06-23 Andreas Krebbel - - * Makefile.in: Add s390.em as build dependency. - * emulparams/elf64_s390.sh (EXTRA_EM_FILE): Add s390.em. - * emultempl/s390.em: New file. - * gen-doc.texi: Add documentation for --s390-pgste option. - * ld.texinfo: Likewise. - - include/ChangeLog: - - 2017-06-23 Andreas Krebbel - - * elf/s390.h (PT_S390_PGSTE): Define macro. - - binutils/ChangeLog: - - 2017-06-23 Andreas Krebbel - - * readelf.c (get_s390_segment_type): Add support for the new - segment type PT_S390_PGSTE. - (get_segment_type): Call get_s390_segment_type. - - elfcpp/ChangeLog: - - 2017-06-23 Andreas Krebbel - - * elfcpp.h (enum PT): Add PT_S390_PGSTE to enum. - - bfd/ChangeLog: - - 2017-06-23 Andreas Krebbel - - * elf-s390.h: New file. - * elf64-s390.c (struct elf_s390_link_hash_table): Add params - field. - (elf_s390_additional_program_headers): New function. - (elf_s390_modify_segment_map): New function. - (bfd_elf_s390_set_options): New function. - (elf_backend_additional_program_headers) - (elf_backend_modify_segment_map): Add macro definitions. - ---- /dev/null -+++ b/bfd/elf-s390.h -@@ -0,0 +1,29 @@ -+/* S/390-specific support for ELF. -+ Copyright (C) 2017 Free Software Foundation, Inc. -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ 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, write to the Free Software -+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+/* Used to pass info between ld and bfd. */ -+struct s390_elf_params -+{ -+ /* Tell the kernel to allocate 4k page tables. */ -+ int pgste; -+}; -+ -+bfd_boolean bfd_elf_s390_set_options (struct bfd_link_info *info, -+ struct s390_elf_params *params); ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -25,6 +25,7 @@ - #include "libbfd.h" - #include "elf-bfd.h" - #include "elf/s390.h" -+#include "elf-s390.h" - #include - - /* In case we're on a 32-bit machine, construct a 64-bit "-1" value -@@ -660,6 +661,9 @@ struct elf_s390_link_hash_table - - /* Small local sym cache. */ - struct sym_cache sym_cache; -+ -+ /* Options passed from the linker. */ -+ struct s390_elf_params *params; - }; - - /* Get the s390 ELF linker hash table from a link_info structure. */ -@@ -3966,6 +3970,70 @@ elf64_s390_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) - return elf_s390_merge_obj_attributes (ibfd, info); - } - -+/* We may add a PT_S390_PGSTE program header. */ -+ -+static int -+elf_s390_additional_program_headers (bfd *abfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) -+{ -+ struct elf_s390_link_hash_table *htab; -+ -+ htab = elf_s390_hash_table (info); -+ return htab->params->pgste; -+} -+ -+ -+/* Add the PT_S390_PGSTE program header. */ -+ -+static bfd_boolean -+elf_s390_modify_segment_map (bfd *abfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) -+{ -+ struct elf_s390_link_hash_table *htab; -+ struct elf_segment_map *m, *pm = NULL; -+ -+ htab = elf_s390_hash_table (info); -+ if (!htab->params->pgste) -+ return TRUE; -+ -+ /* If there is already a PT_S390_PGSTE header, avoid adding -+ another. */ -+ m = elf_seg_map (abfd); -+ while (m && m->p_type != PT_S390_PGSTE) -+ { -+ pm = m; -+ m = m->next; -+ } -+ -+ if (m) -+ return TRUE; -+ -+ m = (struct elf_segment_map *) -+ bfd_zalloc (abfd, sizeof (struct elf_segment_map)); -+ if (m == NULL) -+ return FALSE; -+ m->p_type = PT_S390_PGSTE; -+ m->count = 0; -+ m->next = NULL; -+ if (pm) -+ pm->next = m; -+ -+ return TRUE; -+} -+ -+bfd_boolean -+bfd_elf_s390_set_options (struct bfd_link_info *info, -+ struct s390_elf_params *params) -+{ -+ struct elf_s390_link_hash_table *htab; -+ -+ htab = elf_s390_hash_table (info); -+ htab->params = params; -+ -+ return TRUE; -+} -+ -+ - /* Why was the hash table entry size definition changed from - ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and - this is the only reason for the s390_elf64_size_info structure. */ -@@ -4046,6 +4114,8 @@ const struct elf_size_info s390_elf64_size_info = - #define elf_backend_plt_sym_val elf_s390_plt_sym_val - #define elf_backend_add_symbol_hook elf_s390_add_symbol_hook - #define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p -+#define elf_backend_additional_program_headers elf_s390_additional_program_headers -+#define elf_backend_modify_segment_map elf_s390_modify_segment_map - - #define bfd_elf64_mkobject elf_s390_mkobject - #define elf_backend_object_p elf_s390_object_p ---- a/include/elf/s390.h -+++ b/include/elf/s390.h -@@ -37,6 +37,9 @@ - - #define EF_S390_HIGH_GPRS 0x00000001 - -+/* Request 4k page table size. */ -+#define PT_S390_PGSTE (PT_LOPROC + 0) -+ - /* Relocation types. */ - - START_RELOC_NUMBERS (elf_s390_reloc_type) diff --git a/gdb-rhbz1420304-s390x-30of35.patch b/gdb-rhbz1420304-s390x-30of35.patch deleted file mode 100644 index 9dd4a8b..0000000 --- a/gdb-rhbz1420304-s390x-30of35.patch +++ /dev/null @@ -1,91 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-30of35.patch - -FileName: gdb-rhbz1420304-s390x-30of35.patch - -commit 93ec5e23766a9f75aa4950748cf73964028a8d1b -Author: Andreas Krebbel -Date: Mon Jun 26 11:01:58 2017 +0200 - - S/390: Fix testsuite segfault added with recent pgste patch. - - The recent pgste patch caused several testcases to fail with a - segfault. Fixed with this patch by adding NULL pointer checks. - - regression-tested on s390x. - - bfd/ChangeLog: - - 2017-06-26 Andreas Krebbel - - * elf64-s390.c (elf_s390_additional_program_headers): Add NULL - pointer checks. - (elf_s390_modify_segment_map): Likewise. - (bfd_elf_s390_set_options): Lisewise. - -### a/bfd/ChangeLog -### b/bfd/ChangeLog -## -1,3 +1,10 @@ -+2017-06-26 Andreas Krebbel -+ -+ * elf64-s390.c (elf_s390_additional_program_headers): Add NULL -+ pointer checks. -+ (elf_s390_modify_segment_map): Likewise. -+ (bfd_elf_s390_set_options): Lisewise. -+ - 2017-06-26 Alan Modra - - * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -3978,22 +3978,29 @@ elf_s390_additional_program_headers (bfd *abfd ATTRIBUTE_UNUSED, - { - struct elf_s390_link_hash_table *htab; - -- htab = elf_s390_hash_table (info); -- return htab->params->pgste; -+ if (info) -+ { -+ htab = elf_s390_hash_table (info); -+ if (htab) -+ return htab->params->pgste; -+ } -+ return 0; - } - - - /* Add the PT_S390_PGSTE program header. */ - - static bfd_boolean --elf_s390_modify_segment_map (bfd *abfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_modify_segment_map (bfd *abfd, struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - struct elf_segment_map *m, *pm = NULL; - -+ if (!abfd || !info) -+ return TRUE; -+ - htab = elf_s390_hash_table (info); -- if (!htab->params->pgste) -+ if (!htab || !htab->params->pgste) - return TRUE; - - /* If there is already a PT_S390_PGSTE header, avoid adding -@@ -4027,8 +4034,12 @@ bfd_elf_s390_set_options (struct bfd_link_info *info, - { - struct elf_s390_link_hash_table *htab; - -- htab = elf_s390_hash_table (info); -- htab->params = params; -+ if (info) -+ { -+ htab = elf_s390_hash_table (info); -+ if (htab) -+ htab->params = params; -+ } - - return TRUE; - } diff --git a/gdb-rhbz1420304-s390x-31of35.patch b/gdb-rhbz1420304-s390x-31of35.patch deleted file mode 100644 index d34a628..0000000 --- a/gdb-rhbz1420304-s390x-31of35.patch +++ /dev/null @@ -1,175 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-31of35.patch - -FileName: gdb-rhbz1420304-s390x-31of35.patch - -commit 88ab90e860a46a1123fcfd13bfe51cd360e9c3f7 -Author: Andreas Arnez -Date: Thu Jun 29 10:30:09 2017 +0200 - - S390: Support guarded-storage core note sections - - Newer Linux kernel versions offer two new register sets in support of the - z/Architecture's guarded storage facility: NT_S390_GS_CB, the - "guarded-storage registers", and NT_S390_GS_BC, the "guarded-storage - broadcast control block". This patch adds support for the respective core - notes sections to binutils. - - bfd/ChangeLog: - * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype. - (elfcore_write_s390_gs_bc): Likewise. - * elf.c (elfcore_grok_s390_gs_cb): New function. - (elfcore_grok_s390_gs_bc): New function. - (elfcore_grok_note): Call them. - (elfcore_write_s390_gs_cb): New function. - (elfcore_write_s390_gs_bc): New function. - (elfcore_write_register_note): Call them. - - binutils/ChangeLog: - * readelf.c (get_note_type): Add NT_S390_GS_CB and NT_S390_GS_BC. - - include/ChangeLog: - * elf/common.h (NT_S390_GS_CB): New macro. - (NT_S390_GS_BC): Likewise. - -### a/bfd/ChangeLog -### b/bfd/ChangeLog -## -1,3 +1,14 @@ -+2017-06-29 Andreas Arnez -+ -+ * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype. -+ (elfcore_write_s390_gs_bc): Likewise. -+ * elf.c (elfcore_grok_s390_gs_cb): New function. -+ (elfcore_grok_s390_gs_bc): New function. -+ (elfcore_grok_note): Call them. -+ (elfcore_write_s390_gs_cb): New function. -+ (elfcore_write_s390_gs_bc): New function. -+ (elfcore_write_register_note): Call them. -+ - 2017-06-28 H.J. Lu - - * libbfd.c (_bfd_generic_get_section_contents): Don't call ---- a/bfd/elf-bfd.h -+++ b/bfd/elf-bfd.h -@@ -2533,6 +2533,10 @@ extern char *elfcore_write_s390_vxrs_low - (bfd *, char *, int *, const void *, int); - extern char *elfcore_write_s390_vxrs_high - (bfd *, char *, int *, const void *, int); -+extern char *elfcore_write_s390_gs_cb -+ (bfd *, char *, int *, const void *, int); -+extern char *elfcore_write_s390_gs_bc -+ (bfd *, char *, int *, const void *, int); - extern char *elfcore_write_arm_vfp - (bfd *, char *, int *, const void *, int); - extern char *elfcore_write_aarch_tls ---- a/bfd/elf.c -+++ b/bfd/elf.c -@@ -9191,6 +9191,18 @@ elfcore_grok_s390_vxrs_high (bfd *abfd, Elf_Internal_Note *note) - } - - static bfd_boolean -+elfcore_grok_s390_gs_cb (bfd *abfd, Elf_Internal_Note *note) -+{ -+ return elfcore_make_note_pseudosection (abfd, ".reg-s390-gs-cb", note); -+} -+ -+static bfd_boolean -+elfcore_grok_s390_gs_bc (bfd *abfd, Elf_Internal_Note *note) -+{ -+ return elfcore_make_note_pseudosection (abfd, ".reg-s390-gs-bc", note); -+} -+ -+static bfd_boolean - elfcore_grok_arm_vfp (bfd *abfd, Elf_Internal_Note *note) - { - return elfcore_make_note_pseudosection (abfd, ".reg-arm-vfp", note); -@@ -9668,6 +9680,20 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) - else - return TRUE; - -+ case NT_S390_GS_CB: -+ if (note->namesz == 6 -+ && strcmp (note->namedata, "LINUX") == 0) -+ return elfcore_grok_s390_gs_bc (abfd, note); -+ else -+ return TRUE; -+ -+ case NT_S390_GS_BC: -+ if (note->namesz == 6 -+ && strcmp (note->namedata, "LINUX") == 0) -+ return elfcore_grok_s390_gs_cb (abfd, note); -+ else -+ return TRUE; -+ - case NT_ARM_VFP: - if (note->namesz == 6 - && strcmp (note->namedata, "LINUX") == 0) -@@ -10728,6 +10754,32 @@ elfcore_write_s390_vxrs_high (bfd *abfd, - } - - char * -+elfcore_write_s390_gs_cb (bfd *abfd, -+ char *buf, -+ int *bufsiz, -+ const void *s390_gs_cb, -+ int size) -+{ -+ char *note_name = "LINUX"; -+ return elfcore_write_note (abfd, buf, bufsiz, -+ note_name, NT_S390_GS_CB, -+ s390_gs_cb, size); -+} -+ -+char * -+elfcore_write_s390_gs_bc (bfd *abfd, -+ char *buf, -+ int *bufsiz, -+ const void *s390_gs_bc, -+ int size) -+{ -+ char *note_name = "LINUX"; -+ return elfcore_write_note (abfd, buf, bufsiz, -+ note_name, NT_S390_GS_BC, -+ s390_gs_bc, size); -+} -+ -+char * - elfcore_write_arm_vfp (bfd *abfd, - char *buf, - int *bufsiz, -@@ -10815,6 +10867,10 @@ elfcore_write_register_note (bfd *abfd, - return elfcore_write_s390_vxrs_low (abfd, buf, bufsiz, data, size); - if (strcmp (section, ".reg-s390-vxrs-high") == 0) - return elfcore_write_s390_vxrs_high (abfd, buf, bufsiz, data, size); -+ if (strcmp (section, ".reg-s390-gs-cb") == 0) -+ return elfcore_write_s390_gs_cb (abfd, buf, bufsiz, data, size); -+ if (strcmp (section, ".reg-s390-gs-bc") == 0) -+ return elfcore_write_s390_gs_bc (abfd, buf, bufsiz, data, size); - if (strcmp (section, ".reg-arm-vfp") == 0) - return elfcore_write_arm_vfp (abfd, buf, bufsiz, data, size); - if (strcmp (section, ".reg-aarch-tls") == 0) -### a/include/ChangeLog -### b/include/ChangeLog -## -1,3 +1,8 @@ -+2017-06-29 Andreas Arnez -+ -+ * elf/common.h (NT_S390_GS_CB): New macro. -+ (NT_S390_GS_BC): Likewise. -+ - 2017-06-28 Tamar Christina - - * opcode/aarch64.h: (AARCH64_FEATURE_DOTPROD): New. ---- a/include/elf/common.h -+++ b/include/elf/common.h -@@ -598,6 +598,10 @@ - /* note name must be "LINUX". */ - #define NT_S390_VXRS_HIGH 0x30a /* S390 vector registers 16-31 */ - /* note name must be "LINUX". */ -+#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */ -+ /* note name must be "LINUX". */ -+#define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block */ -+ /* note name must be "LINUX". */ - #define NT_ARM_VFP 0x400 /* ARM VFP registers */ - /* The following definitions should really use NT_AARCH_..., but defined - this way for compatibility with Linux. */ diff --git a/gdb-rhbz1420304-s390x-32of35.patch b/gdb-rhbz1420304-s390x-32of35.patch deleted file mode 100644 index 13f4922..0000000 --- a/gdb-rhbz1420304-s390x-32of35.patch +++ /dev/null @@ -1,386 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-32of35.patch - -FileName: gdb-rhbz1420304-s390x-32of35.patch - -commit 55efceabc6149e96134c10676adb2b1e79e0ae13 -Author: Andreas Arnez -Date: Thu Jul 13 20:17:03 2017 +0200 - - S390: Add record/replay support for arch12 instructions - - Support record/replay of the z/Architecture instructions that were - introduced with arch12. - - gdb/ChangeLog: - - * s390-linux-tdep.c (s390_process_record): Add support for - instructions new in arch12. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,3 +1,8 @@ -+2017-07-13 Andreas Arnez -+ -+ * s390-linux-tdep.c (s390_process_record): Add support for -+ instructions new in arch12. -+ - 2017-07-11 John Baldwin - - * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Use ---- a/gdb/s390-linux-tdep.c -+++ b/gdb/s390-linux-tdep.c -@@ -4992,6 +4992,8 @@ ex: - case 0xb9e9: /* SGRK - subtract */ - case 0xb9ea: /* ALGRK - add logical */ - case 0xb9eb: /* SLGRK - subtract logical */ -+ case 0xb9ed: /* MSGRKC - multiply single 64x64 -> 64 */ -+ case 0xb9fd: /* MSRKC - multiply single 32x32 -> 32 */ - /* 64-bit gpr destination + flags */ - if (s390_record_gpr_g (gdbarch, regcache, inib[6])) - return -1; -@@ -5019,7 +5021,7 @@ ex: - case 0xb914: /* LGFR - load */ - case 0xb916: /* LLGFR - load logical */ - case 0xb917: /* LLGTR - load logical thirty one bits */ -- case 0xb91c: /* MSGFR - load */ -+ case 0xb91c: /* MSGFR - multiply single 64<32 */ - case 0xb946: /* BCTGR - branch on count */ - case 0xb984: /* LLGCR - load logical character */ - case 0xb985: /* LLGHR - load logical halfword */ -@@ -5038,6 +5040,7 @@ ex: - case 0xb91d: /* DSGFR - divide single */ - case 0xb986: /* MLGR - multiply logical */ - case 0xb987: /* DLGR - divide logical */ -+ case 0xb9ec: /* MGRK - multiply 64x64 -> 128 */ - /* 64-bit gpr pair destination */ - if (s390_record_gpr_g (gdbarch, regcache, inib[6])) - return -1; -@@ -5106,8 +5109,8 @@ ex: - /* 0xb922-0xb924 undefined */ - /* 0xb925 privileged */ - /* 0xb928 privileged */ -- /* 0xb929 undefined */ - -+ case 0xb929: /* KMA - cipher message with authentication */ - case 0xb92a: /* KMF - cipher message with cipher feedback [partial] */ - case 0xb92b: /* KMO - cipher message with output feedback [partial] */ - case 0xb92f: /* KMC - cipher message with chaining [partial] */ -@@ -5170,6 +5173,15 @@ ex: - if (record_full_arch_list_add_reg (regcache, S390_R0_REGNUM + (inib[7] | 1))) - return -1; - } -+ if (tmp != 0 && insn[0] == 0xb929) -+ { -+ if (record_full_arch_list_add_reg (regcache, -+ S390_R0_REGNUM + inib[4])) -+ return -1; -+ if (record_full_arch_list_add_reg (regcache, -+ S390_R0_REGNUM + (inib[4] | 1))) -+ return -1; -+ } - if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) - return -1; - break; -@@ -5571,10 +5583,11 @@ ex: - - /* 0xb9e3 undefined */ - /* 0xb9e5 undefined */ -- /* 0xb9ec-0xb9f1 undefined */ -+ /* 0xb9ee-0xb9f1 undefined */ - /* 0xb9f3 undefined */ - /* 0xb9f5 undefined */ -- /* 0xb9fc-0xb9ff undefined */ -+ /* 0xb9fc undefined */ -+ /* 0xb9fe -0xb9ff undefined */ - - default: - goto UNKNOWN_OP; -@@ -5962,6 +5975,7 @@ ex: - break; - - case 0xe3: -+ case 0xe6: - case 0xe7: - case 0xeb: - case 0xed: -@@ -6006,6 +6020,7 @@ ex: - case 0xe31c: /* MSGF - multiply single */ - case 0xe32a: /* LZRG - load and zero rightmost byte */ - case 0xe33a: /* LLZRGF - load logical and zero rightmost byte */ -+ case 0xe33c: /* MGH - multiply halfword 64x16mem -> 64 */ - case 0xe346: /* BCTG - branch on count */ - case 0xe377: /* LGB - load byte */ - case 0xe390: /* LLGC - load logical character */ -@@ -6036,6 +6051,7 @@ ex: - - case 0xe30d: /* DSG - divide single */ - case 0xe31d: /* DSGF - divide single */ -+ case 0xe384: /* MG - multiply 64x64mem -> 128 */ - case 0xe386: /* MLG - multiply logical */ - case 0xe387: /* DLG - divide logical */ - case 0xe38f: /* LPQ - load pair from quadword */ -@@ -6057,6 +6073,9 @@ ex: - /* 0xe310-0xe311 undefined */ - - case 0xe312: /* LT - load and test */ -+ case 0xe338: /* AGH - add halfword to 64 bit value */ -+ case 0xe339: /* SGH - subtract halfword from 64 bit value */ -+ case 0xe353: /* MSC - multiply single 32x32mem -> 32 */ - case 0xe354: /* NY - and */ - case 0xe356: /* OY - or */ - case 0xe357: /* XY - xor */ -@@ -6066,13 +6085,14 @@ ex: - case 0xe35f: /* SLY - subtract logical */ - case 0xe37a: /* AHY - add halfword */ - case 0xe37b: /* SHY - subtract halfword */ -+ case 0xe383: /* MSGC - multiply single 64x64mem -> 64 */ - case 0xe398: /* ALC - add logical with carry */ - case 0xe399: /* SLB - subtract logical with borrow */ - case 0xe727: /* LCBB - load count to block bounduary */ - case 0xeb81: /* ICMY - insert characters under mask */ - case 0xebdc: /* SRAK - shift left single */ - case 0xebdd: /* SLAK - shift left single */ -- /* 32-bit gpr destination + flags */ -+ /* 32/64-bit gpr destination + flags */ - if (record_full_arch_list_add_reg (regcache, S390_R0_REGNUM + inib[2])) - return -1; - if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) -@@ -6160,7 +6180,7 @@ ex: - case 0xe336: /* PFD - prefetch data */ - break; - -- /* 0xe337-0xe339 undefined */ -+ /* 0xe337 undefined */ - /* 0xe33c-0xe33d undefined */ - - case 0xe33e: /* STRV - store reversed */ -@@ -6183,8 +6203,12 @@ ex: - break; - - /* 0xe340-0xe345 undefined */ -- /* 0xe347-0xe34f undefined */ -- /* 0xe352-0xe353 undefined */ -+ -+ case 0xe347: /* BIC - branch indirect on condition */ -+ break; -+ -+ /* 0xe348-0xe34f undefined */ -+ /* 0xe352 undefined */ - - case 0xe35c: /* MFY - multiply */ - case 0xe396: /* ML - multiply logical */ -@@ -6216,11 +6240,12 @@ ex: - break; - - /* 0xe37d-0xe37f undefined */ -- /* 0xe383-0xe384 undefined */ - - case 0xe385: /* LGAT - load and trap */ - case 0xe39c: /* LLGTAT - load logical thirty one bits and trap */ - case 0xe39d: /* LLGFAT - load logical and trap */ -+ case 0xe650: /* VCVB - vector convert to binary 32 bit*/ -+ case 0xe652: /* VCVBG - vector convert to binary 64 bit*/ - case 0xe721: /* VLGV - vector load gr from vr element */ - /* 64-bit gpr destination + fpc for possible DXC write */ - if (s390_record_gpr_g (gdbarch, regcache, inib[2])) -@@ -6271,6 +6296,10 @@ ex: - /* 0xe3ce undefined */ - /* 0xe3d0-0xe3ff undefined */ - -+ case 0xe634: /* VPKZ - vector pack zoned */ -+ case 0xe635: /* VLRL - vector load rightmost with immed. length */ -+ case 0xe637: /* VLRLR - vector load rightmost with length */ -+ case 0xe649: /* VLIP - vector load immediate decimal */ - case 0xe700: /* VLEB - vector load element */ - case 0xe701: /* VLEH - vector load element */ - case 0xe702: /* VLEG - vector load element */ -@@ -6311,7 +6340,10 @@ ex: - case 0xe769: /* VNC - vector and with complement */ - case 0xe76a: /* VO - vector or */ - case 0xe76b: /* VNO - vector nor */ -+ case 0xe76c: /* VNX - vector not exclusive or */ - case 0xe76d: /* VX - vector xor */ -+ case 0xe76e: /* VNN - vector nand */ -+ case 0xe76f: /* VOC - vector or with complement */ - case 0xe770: /* VESLV - vector element shift left */ - case 0xe772: /* VERIM - vector element rotate and insert under mask */ - case 0xe773: /* VERLLV - vector element rotate left logical */ -@@ -6325,11 +6357,14 @@ ex: - case 0xe77e: /* VSRA - vector shift right arithmetic */ - case 0xe77f: /* VSRAB - vector shift right arithmetic by byte */ - case 0xe784: /* VPDI - vector permute doubleword immediate */ -+ case 0xe785: /* VBPERM - vector bit permute */ - case 0xe78c: /* VPERM - vector permute */ - case 0xe78d: /* VSEL - vector select */ - case 0xe78e: /* VFMS - vector fp multiply and subtract */ - case 0xe78f: /* VFMA - vector fp multiply and add */ - case 0xe794: /* VPK - vector pack */ -+ case 0xe79e: /* VFNMS - vector fp negative multiply and subtract */ -+ case 0xe79f: /* VFNMA - vector fp negative multiply and add */ - case 0xe7a1: /* VMLH - vector multiply logical high */ - case 0xe7a2: /* VML - vector multiply low */ - case 0xe7a3: /* VMH - vector multiply high */ -@@ -6345,6 +6380,7 @@ ex: - case 0xe7ae: /* VMAE - vector multiply and add even */ - case 0xe7af: /* VMAO - vector multiply and add odd */ - case 0xe7b4: /* VGFM - vector Galois field multiply sum */ -+ case 0xe7b8: /* VMSL - vector multiply sum logical */ - case 0xe7b9: /* VACCC - vector add with carry compute carry */ - case 0xe7bb: /* VAC - vector add with carry */ - case 0xe7bc: /* VGFMA - vector Galois field multiply sum and accumulate */ -@@ -6354,8 +6390,8 @@ ex: - case 0xe7c1: /* VCDLG - vector convert from logical 64-bit */ - case 0xe7c2: /* VCGD - vector convert to fixed 64-bit */ - case 0xe7c3: /* VCDG - vector convert from fixed 64-bit */ -- case 0xe7c4: /* VLDE - vector fp load lengthened */ -- case 0xe7c5: /* VLED - vector fp load rounded */ -+ case 0xe7c4: /* VLDE/VFLL - vector fp load lengthened */ -+ case 0xe7c5: /* VLED/VFLR - vector fp load rounded */ - case 0xe7c7: /* VFI - vector load fp integer */ - case 0xe7cc: /* VFPSO - vector fp perform sign operation */ - case 0xe7ce: /* VFSQ - vector fp square root */ -@@ -6369,6 +6405,8 @@ ex: - case 0xe7e3: /* VFA - vector fp add */ - case 0xe7e5: /* VFD - vector fp divide */ - case 0xe7e7: /* VFM - vector fp multiply */ -+ case 0xe7ee: /* VFMIN - vector fp minimum */ -+ case 0xe7ef: /* VFMAX - vector fp maximum */ - case 0xe7f0: /* VAVGL - vector average logical */ - case 0xe7f1: /* VACC - vector add and compute carry */ - case 0xe7f2: /* VAVG - vector average */ -@@ -6386,6 +6424,14 @@ ex: - return -1; - break; - -+ case 0xe63d: /* VSTRL - vector store rightmost with immed. length */ -+ oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], 0); -+ if (record_full_arch_list_add_mem (oaddr, inib[3] + 1)) -+ return -1; -+ if (record_full_arch_list_add_reg (regcache, S390_FPC_REGNUM)) -+ return -1; -+ break; -+ - case 0xe708: /* VSTEB - vector store element */ - oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); - if (record_full_arch_list_add_mem (oaddr, 1)) -@@ -6480,13 +6526,22 @@ ex: - return -1; - break; - -+ case 0xe63c: /* VUPKZ - vector unpack zoned */ -+ oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], 0); -+ if (record_full_arch_list_add_mem (oaddr, (ibyte[1] + 1) & 31)) -+ return -1; -+ if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) -+ return -1; -+ break; -+ -+ case 0xe63f: /* VSTRLR - vector store rightmost with length */ - case 0xe73f: /* VSTL - vector store with length */ - oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], 0); - regcache_raw_read_unsigned (regcache, S390_R0_REGNUM + inib[3], &tmp); - tmp &= 0xffffffffu; -- if (tmp > 16) -- tmp = 16; -- if (record_full_arch_list_add_mem (oaddr, tmp)) -+ if (tmp > 15) -+ tmp = 15; -+ if (record_full_arch_list_add_mem (oaddr, tmp + 1)) - return -1; - if (record_full_arch_list_add_reg (regcache, S390_FPC_REGNUM)) - return -1; -@@ -6494,6 +6549,17 @@ ex: - - /* 0xe747-0xe749 undefined */ - -+ case 0xe658: /* VCVD - vector convert to decimal 32 bit */ -+ case 0xe659: /* VSRP - vector shift and round decimal */ -+ case 0xe65a: /* VCVDG - vector convert to decimal 64 bit*/ -+ case 0xe65b: /* VPSOP - vector perform sign operation decimal */ -+ case 0xe671: /* VAP - vector add decimal */ -+ case 0xe673: /* VSP - vector subtract decimal */ -+ case 0xe678: /* VMP - vector multiply decimal */ -+ case 0xe679: /* VMSP - vector multiply decimal */ -+ case 0xe67a: /* VDP - vector divide decimal */ -+ case 0xe67b: /* VRP - vector remainder decimal */ -+ case 0xe67e: /* VSDP - vector shift and divide decimal */ - case 0xe74a: /* VFTCI - vector fp test data class immediate */ - case 0xe75c: /* VISTR - vector isolate string */ - case 0xe780: /* VFEE - vector find element equal */ -@@ -6504,7 +6570,7 @@ ex: - case 0xe797: /* VPKS - vector pack saturate */ - case 0xe7e8: /* VFCE - vector fp compare equal */ - case 0xe7ea: /* VFCHE - vector fp compare high or equal */ -- case 0xe7eb: /* VFCE - vector fp compare high */ -+ case 0xe7eb: /* VFCH - vector fp compare high */ - case 0xe7f8: /* VCEQ - vector compare equal */ - case 0xe7f9: /* VCHL - vector compare high logical */ - case 0xe7fb: /* VCH - vector compare high */ -@@ -6517,6 +6583,14 @@ ex: - return -1; - break; - -+ case 0xe65f: /* VTP - vector test decimal */ -+ /* flags + FPC */ -+ if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) -+ return -1; -+ if (record_full_arch_list_add_reg (regcache, S390_FPC_REGNUM)) -+ return -1; -+ break; -+ - /* 0xe74b-0xe74c undefined */ - /* 0xe74e-0xe74f undefined */ - /* 0xe751 undefined */ -@@ -6524,26 +6598,26 @@ ex: - /* 0xe757-0xe75b undefined */ - /* 0xe75d-0xe75e undefined */ - /* 0xe763 undefined */ -- /* 0xe76c undefined */ -- /* 0xe76e-0xe76f undefined */ - /* 0xe771 undefined */ - /* 0xe776 undefined */ - /* 0xe779 undefined */ - /* 0xe77b undefined */ - /* 0xe783 undefined */ -- /* 0xe785-0xe789 undefined */ -+ /* 0xe786-0xe789 undefined */ - /* 0xe78b undefined */ - /* 0xe790-0xe793 undefined */ - /* 0xe796 undefined */ -- /* 0xe798-0xe7a0 undefined */ -- /* 0xe7a8 undefined */ -+ /* 0xe798-0xe79d undefined */ -+ /* 0xe7a0 undefined */ -+ /* 0xe7a8 undefined */ - /* 0xe7b0-0xe7b3 undefined */ -- /* 0xe7b5-0xe7b8 undefined */ -+ /* 0xe7b5-0xe7b7 undefined */ - /* 0xe7ba undefined */ - /* 0xe7be undefined */ - /* 0xe7c6 undefined */ - /* 0xe7c8-0xe7c9 undefined */ - -+ case 0xe677: /* VCP - vector compare decimal */ - case 0xe7ca: /* WFK - vector fp compare and signal scalar */ - case 0xe7cb: /* WFC - vector fp compare scalar */ - case 0xe7d8: /* VTM - vector test under mask */ -@@ -6568,7 +6642,7 @@ ex: - /* 0xe7e4 undefined */ - /* 0xe7e6 undefined */ - /* 0xe7e9 undefined */ -- /* 0xe7ec-0xe7ef undefined */ -+ /* 0xe7ec-0xe7ed undefined */ - /* 0xe7f4 undefined */ - /* 0xe7f6 undefined */ - /* 0xe7fa undefined */ -@@ -7048,8 +7122,6 @@ ex: - } - break; - -- /* 0xe6 undefined */ -- - case 0xec: - /* RIE/RIS/RRS-format instruction */ - switch (ibyte[0] << 8 | ibyte[5]) diff --git a/gdb-rhbz1420304-s390x-33of35.patch b/gdb-rhbz1420304-s390x-33of35.patch deleted file mode 100644 index d2c1170..0000000 --- a/gdb-rhbz1420304-s390x-33of35.patch +++ /dev/null @@ -1,55 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-33of35.patch - -FileName: gdb-rhbz1420304-s390x-33of35.patch - -commit 47826cdbec2548cd1d25acf4cfaf908ae88f3325 -Author: Andreas Krebbel -Date: Fri Jul 21 10:54:06 2017 +0200 - - S/390: Support z14 as CPU name. - - With IBM z14 officially announced I can add z14 as CPU name. - - No regressions with that patch on s390x. - - gas/ChangeLog: - - 2017-07-21 Andreas Krebbel - - * config/tc-s390.c (s390_parse_cpu): Add z14 as alternate CPU - name. - * doc/as.texinfo: Add z14 to CPU string list. - * doc/c-s390.texi: Likewise. - - opcodes/ChangeLog: - - 2017-07-21 Andreas Krebbel - - * s390-mkopc.c (main): Enable z14 as CPU string in the opcode - table. - -### a/opcodes/ChangeLog -### b/opcodes/ChangeLog -## -1,3 +1,8 @@ -+2017-07-21 Andreas Krebbel -+ -+ * s390-mkopc.c (main): Enable z14 as CPU string in the opcode -+ table. -+ - 2017-07-20 Nick Clifton - - * po/de.po: Updated German translation. ---- a/opcodes/s390-mkopc.c -+++ b/opcodes/s390-mkopc.c -@@ -374,7 +374,8 @@ main (void) - else if (strcmp (cpu_string, "z13") == 0 - || strcmp (cpu_string, "arch11") == 0) - min_cpu = S390_OPCODE_Z13; -- else if (strcmp (cpu_string, "arch12") == 0) -+ else if (strcmp (cpu_string, "z14") == 0 -+ || strcmp (cpu_string, "arch12") == 0) - min_cpu = S390_OPCODE_ARCH12; - else { - fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string); diff --git a/gdb-rhbz1420304-s390x-34of35.patch b/gdb-rhbz1420304-s390x-34of35.patch deleted file mode 100644 index 8242f1b..0000000 --- a/gdb-rhbz1420304-s390x-34of35.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-34of35.patch - -FileName: gdb-rhbz1420304-s390x-34of35.patch - -commit 79c12faeea57e61364b6a7a3e411b096edce989c -Author: Andreas Krebbel -Date: Fri Jul 28 17:59:25 2017 +0200 - - S/390: Fix segfault when linking -shared -nostartfiles - - Regression-tested on s390x. - - bfd/ChangeLog: - - 2017-07-28 Andreas Krebbel - - * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL - pointer check for htab->elf.irelplt. - * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise. - ---- a/bfd/elf32-s390.c -+++ b/bfd/elf32-s390.c -@@ -3941,7 +3941,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, - break; - - case DT_PLTRELSZ: -- dyn.d_un.d_val = htab->elf.srelplt->size + htab->elf.irelplt->size; -+ dyn.d_un.d_val = htab->elf.srelplt->size; -+ if (htab->elf.irelplt) -+ dyn.d_un.d_val += htab->elf.irelplt->size; - break; - } - ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -3745,7 +3745,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, - break; - - case DT_PLTRELSZ: -- dyn.d_un.d_val = htab->elf.srelplt->size + htab->elf.irelplt->size; -+ dyn.d_un.d_val = htab->elf.srelplt->size; -+ if (htab->elf.irelplt) -+ dyn.d_un.d_val += htab->elf.irelplt->size; - break; - - case DT_RELASZ: -@@ -3756,7 +3758,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, - linker script arranges for .rela.plt to follow all - other relocation sections, we don't have to worry - about changing the DT_RELA entry. */ -- dyn.d_un.d_val -= htab->elf.srelplt->size + htab->elf.irelplt->size; -+ dyn.d_un.d_val -= htab->elf.srelplt->size; -+ if (htab->elf.irelplt) -+ dyn.d_un.d_val -= htab->elf.irelplt->size; - break; - } - diff --git a/gdb-rhbz1420304-s390x-35of35.patch b/gdb-rhbz1420304-s390x-35of35.patch deleted file mode 100644 index 5e0a0e0..0000000 --- a/gdb-rhbz1420304-s390x-35of35.patch +++ /dev/null @@ -1,73 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1420304-s390x-35of35.patch - -FileName: gdb-rhbz1420304-s390x-35of35.patch - -commit 1ef692ea23714876cc30b1a3ab3ef33a1369f17a -Author: Andreas Krebbel -Date: Tue Aug 1 15:13:40 2017 +0200 - - S/390: Fix claimfile failures - - This fixes a segfault when trying to access the local_plt field in the - s390 specific elf data althoug the underlaying object is a generic elf - object. - - This fixes the following testsuite failures: - - < FAIL: plugin claimfile replace symbol with source - < FAIL: plugin claimfile resolve symbol with source - < FAIL: plugin claimfile replace file with source - < FAIL: plugin set symbol visibility with source - < FAIL: plugin ignore lib with source - < FAIL: plugin claimfile replace lib with source - < FAIL: plugin 2 with source lib - < FAIL: load plugin 2 with source - < FAIL: plugin 3 with source lib - < FAIL: load plugin 3 with source - - bfd/ChangeLog: - - 2017-08-01 Andreas Krebbel - - * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it - isn't the S/390 specific elf data. - * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise. - -### a/bfd/ChangeLog -### b/bfd/ChangeLog -## -1,3 +1,9 @@ -+2017-08-01 Andreas Krebbel -+ -+ * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it -+ isn't the S/390 specific elf data. -+ * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise. -+ - 2017-07-31 Kuan-Lin Chen - - * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function. ---- a/bfd/elf32-s390.c -+++ b/bfd/elf32-s390.c -@@ -4001,6 +4001,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, - - symtab_hdr = &elf_symtab_hdr (ibfd); - -+ if (!is_s390_elf (ibfd)) -+ continue; -+ - local_plt = elf_s390_local_plt (ibfd); - if (local_plt != NULL) - for (i = 0; i < symtab_hdr->sh_info; i++) ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -3814,6 +3814,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, - - symtab_hdr = &elf_symtab_hdr (ibfd); - -+ if (!is_s390_elf (ibfd)) -+ continue; -+ - local_plt = elf_s390_local_plt (ibfd); - if (local_plt != NULL) - for (i = 0; i < symtab_hdr->sh_info; i++) diff --git a/gdb-rhbz1498758-1of5.patch b/gdb-rhbz1498758-1of5.patch deleted file mode 100755 index 4d68e22..0000000 --- a/gdb-rhbz1498758-1of5.patch +++ /dev/null @@ -1,52 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1498758-1of5.patch - -FileName: gdb-rhbz1498758-1of5.patch - -commit 8fe09d7421db51bc13c9228547d63e6315bd6bd0 -Author: Andreas Arnez -Date: Thu Sep 21 17:45:18 2017 +0200 - - S/390: Fix Elf note swap s390_gs_bc vs. s390_gs_cb - - Fix two typos that resulted in swapping the BFD names for the core note - register sections NT_S390_GS_CB and NT_S390_GS_BC. - - bfd/ChangeLog: - - * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and - NT_S390_GS_BC, correct the previously swapped invocations of - elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb. - -### a/bfd/ChangeLog -### b/bfd/ChangeLog -## -1,3 +1,9 @@ -+2017-09-21 Andreas Arnez -+ -+ * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and -+ NT_S390_GS_BC, correct the previously swapped invocations of -+ elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb. -+ - 2017-09-19 Alan Modra - - PR 21441 ---- a/bfd/elf.c -+++ b/bfd/elf.c -@@ -9698,14 +9698,14 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) - case NT_S390_GS_CB: - if (note->namesz == 6 - && strcmp (note->namedata, "LINUX") == 0) -- return elfcore_grok_s390_gs_bc (abfd, note); -+ return elfcore_grok_s390_gs_cb (abfd, note); - else - return TRUE; - - case NT_S390_GS_BC: - if (note->namesz == 6 - && strcmp (note->namedata, "LINUX") == 0) -- return elfcore_grok_s390_gs_cb (abfd, note); -+ return elfcore_grok_s390_gs_bc (abfd, note); - else - return TRUE; - diff --git a/gdb-rhbz1498758-2of5.patch b/gdb-rhbz1498758-2of5.patch deleted file mode 100755 index 7c6dbce..0000000 --- a/gdb-rhbz1498758-2of5.patch +++ /dev/null @@ -1,822 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1498758-2of5.patch - -FileName: gdb-rhbz1498758-2of5.patch - -commit 96235dc1ac3730c4e490d19db2e8287c0a40f307 -Author: Andreas Arnez -Date: Mon Sep 25 16:02:23 2017 +0200 - - S390: Add guarded-storage register definitions and tdescs - - Newer Linux kernel versions offer two new register sets in support of the - z/Architecture's guarded storage facility. This patch adds XML - descriptions and the respective autogenerated .c and .dat files for - s390/s390x targets with this feature. - - gdb/ChangeLog: - - * features/s390-gs-linux64.xml: New file. - * features/s390-gs.xml: New file. - * features/s390-gsbc.xml: New file. - * features/s390x-gs-linux64.xml: New file. - * features/Makefile (WHICH): Add s390-gs-linux64 and - s390x-gs-linux64. - (s390-gs-linux64-expedite, s390x-gs-linux64-expedite): New macros. - (XMLTOC): Add s390-gs-linux64.xml and s390x-linux64.xml. - * features/s390-gs-linux64.c: New generated file. - * features/s390x-gs-linux64.c: New file. - * regformats/s390-gs-linux64.dat: New file. - * regformats/s390x-gs-linux64.dat: New file. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,3 +1,18 @@ -+2017-09-25 Andreas Arnez -+ -+ * features/s390-gs-linux64.xml: New file. -+ * features/s390-gs.xml: New file. -+ * features/s390-gsbc.xml: New file. -+ * features/s390x-gs-linux64.xml: New file. -+ * features/Makefile (WHICH): Add s390-gs-linux64 and -+ s390x-gs-linux64. -+ (s390-gs-linux64-expedite, s390x-gs-linux64-expedite): New macros. -+ (XMLTOC): Add s390-gs-linux64.xml and s390x-linux64.xml. -+ * features/s390-gs-linux64.c: New generated file. -+ * features/s390x-gs-linux64.c: New file. -+ * regformats/s390-gs-linux64.dat: New file. -+ * regformats/s390x-gs-linux64.dat: New file. -+ - 2017-09-23 Tom Tromey - - * defs.h (make_cleanup_override_quit_handler): Don't declare. ---- a/gdb/features/Makefile -+++ b/gdb/features/Makefile -@@ -78,6 +78,7 @@ WHICH = aarch64 \ - s390-linux32v2 s390-linux64v2 s390x-linux64v2 \ - s390-te-linux64 s390x-te-linux64 s390-vx-linux64 s390x-vx-linux64 \ - s390-tevx-linux64 s390x-tevx-linux64 \ -+ s390-gs-linux64 s390x-gs-linux64 \ - tic6x-c64xp tic6x-c64x tic6x-c62x \ - tic6x-c64xp-linux tic6x-c64x-linux tic6x-c62x-linux - -@@ -105,12 +106,14 @@ s390-linux64v2-expedite = r14l,r15l,pswa - s390-te-linux64-expedite = r14l,r15l,pswa - s390-vx-linux64-expedite = r14l,r15l,pswa - s390-tevx-linux64-expedite = r14l,r15l,pswa -+s390-gs-linux64-expedite = r14,r15,pswa - s390x-linux64-expedite = r14,r15,pswa - s390x-linux64v1-expedite = r14,r15,pswa - s390x-linux64v2-expedite = r14,r15,pswa - s390x-te-linux64-expedite = r14,r15,pswa - s390x-vx-linux64-expedite = r14,r15,pswa - s390x-tevx-linux64-expedite = r14,r15,pswa -+s390x-gs-linux64-expedite = r14,r15,pswa - tic6x-c64xp-expedite = A15,PC - tic6x-c64x-expedite = A15,PC - tic6x-c62x-expedite = A15,PC -@@ -196,6 +199,8 @@ XMLTOC = \ - s390-vx-linux64.xml \ - s390x-tevx-linux64.xml \ - s390x-vx-linux64.xml \ -+ s390-gs-linux64.xml \ -+ s390x-gs-linux64.xml \ - tic6x-c62x-linux.xml \ - tic6x-c62x.xml \ - tic6x-c64x-linux.xml \ ---- /dev/null -+++ b/gdb/features/s390-gs-linux64.c -@@ -0,0 +1,198 @@ -+/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: -+ Original: s390-gs-linux64.xml */ -+ -+#include "defs.h" -+#include "osabi.h" -+#include "target-descriptions.h" -+ -+struct target_desc *tdesc_s390_gs_linux64; -+static void -+initialize_tdesc_s390_gs_linux64 (void) -+{ -+ struct target_desc *result = allocate_target_description (); -+ struct tdesc_feature *feature; -+ struct tdesc_type *field_type; -+ struct tdesc_type *type; -+ -+ set_tdesc_architecture (result, bfd_scan_arch ("s390:31-bit")); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.core"); -+ tdesc_create_reg (feature, "pswm", 0, 1, "psw", 32, "uint32"); -+ tdesc_create_reg (feature, "pswa", 1, 1, "psw", 32, "uint32"); -+ tdesc_create_reg (feature, "r0h", 2, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r0l", 3, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r1h", 4, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r1l", 5, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r2h", 6, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r2l", 7, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r3h", 8, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r3l", 9, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r4h", 10, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r4l", 11, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r5h", 12, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r5l", 13, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r6h", 14, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r6l", 15, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r7h", 16, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r7l", 17, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r8h", 18, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r8l", 19, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r9h", 20, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r9l", 21, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r10h", 22, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r10l", 23, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r11h", 24, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r11l", 25, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r12h", 26, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r12l", 27, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r13h", 28, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r13l", 29, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r14h", 30, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r14l", 31, 1, "lower", 32, "uint32"); -+ tdesc_create_reg (feature, "r15h", 32, 1, "upper", 32, "uint32"); -+ tdesc_create_reg (feature, "r15l", 33, 1, "lower", 32, "uint32"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.acr"); -+ tdesc_create_reg (feature, "acr0", 34, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr1", 35, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr2", 36, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr3", 37, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr4", 38, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr5", 39, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr6", 40, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr7", 41, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr8", 42, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr9", 43, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr10", 44, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr11", 45, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr12", 46, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr13", 47, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr14", 48, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr15", 49, 1, "access", 32, "uint32"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.fpr"); -+ tdesc_create_reg (feature, "fpc", 50, 1, "float", 32, "uint32"); -+ tdesc_create_reg (feature, "f0", 51, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f1", 52, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f2", 53, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f3", 54, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f4", 55, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f5", 56, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f6", 57, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f7", 58, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f8", 59, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f9", 60, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f10", 61, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f11", 62, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f12", 63, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f13", 64, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f14", 65, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f15", 66, 1, "float", 64, "ieee_double"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.linux"); -+ tdesc_create_reg (feature, "orig_r2", 67, 1, "system", 32, "uint32"); -+ tdesc_create_reg (feature, "last_break", 68, 0, "system", 32, "code_ptr"); -+ tdesc_create_reg (feature, "system_call", 69, 1, "system", 32, "uint32"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.tdb"); -+ tdesc_create_reg (feature, "tdb0", 70, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tac", 71, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tct", 72, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "atia", 73, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr0", 74, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr1", 75, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr2", 76, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr3", 77, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr4", 78, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr5", 79, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr6", 80, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr7", 81, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr8", 82, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr9", 83, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr10", 84, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr11", 85, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr12", 86, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr13", 87, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr14", 88, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr15", 89, 1, "tdb", 64, "uint64"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.vx"); -+ field_type = tdesc_named_type (feature, "ieee_single"); -+ tdesc_create_vector (feature, "v4f", field_type, 4); -+ -+ field_type = tdesc_named_type (feature, "ieee_double"); -+ tdesc_create_vector (feature, "v2d", field_type, 2); -+ -+ field_type = tdesc_named_type (feature, "int8"); -+ tdesc_create_vector (feature, "v16i8", field_type, 16); -+ -+ field_type = tdesc_named_type (feature, "int16"); -+ tdesc_create_vector (feature, "v8i16", field_type, 8); -+ -+ field_type = tdesc_named_type (feature, "int32"); -+ tdesc_create_vector (feature, "v4i32", field_type, 4); -+ -+ field_type = tdesc_named_type (feature, "int64"); -+ tdesc_create_vector (feature, "v2i64", field_type, 2); -+ -+ type = tdesc_create_union (feature, "vec128"); -+ field_type = tdesc_named_type (feature, "v4f"); -+ tdesc_add_field (type, "v4_float", field_type); -+ field_type = tdesc_named_type (feature, "v2d"); -+ tdesc_add_field (type, "v2_double", field_type); -+ field_type = tdesc_named_type (feature, "v16i8"); -+ tdesc_add_field (type, "v16_int8", field_type); -+ field_type = tdesc_named_type (feature, "v8i16"); -+ tdesc_add_field (type, "v8_int16", field_type); -+ field_type = tdesc_named_type (feature, "v4i32"); -+ tdesc_add_field (type, "v4_int32", field_type); -+ field_type = tdesc_named_type (feature, "v2i64"); -+ tdesc_add_field (type, "v2_int64", field_type); -+ field_type = tdesc_named_type (feature, "uint128"); -+ tdesc_add_field (type, "uint128", field_type); -+ -+ tdesc_create_reg (feature, "v0l", 90, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v1l", 91, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v2l", 92, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v3l", 93, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v4l", 94, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v5l", 95, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v6l", 96, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v7l", 97, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v8l", 98, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v9l", 99, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v10l", 100, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v11l", 101, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v12l", 102, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v13l", 103, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v14l", 104, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v15l", 105, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v16", 106, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v17", 107, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v18", 108, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v19", 109, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v20", 110, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v21", 111, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v22", 112, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v23", 113, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v24", 114, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v25", 115, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v26", 116, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v27", 117, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v28", 118, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v29", 119, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v30", 120, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v31", 121, 1, NULL, 128, "vec128"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.gs"); -+ tdesc_create_reg (feature, "gsd", 122, 1, "gs", 64, "uint64"); -+ tdesc_create_reg (feature, "gssm", 123, 1, "gs", 64, "uint64"); -+ tdesc_create_reg (feature, "gsepla", 124, 1, "gs", 64, "data_ptr"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.gsbc"); -+ tdesc_create_reg (feature, "bc_gsd", 125, 1, "gs", 64, "uint64"); -+ tdesc_create_reg (feature, "bc_gssm", 126, 1, "gs", 64, "uint64"); -+ tdesc_create_reg (feature, "bc_gsepla", 127, 1, "gs", 64, "data_ptr"); -+ -+ tdesc_s390_gs_linux64 = result; -+} ---- /dev/null -+++ b/gdb/features/s390-gs-linux64.xml -@@ -0,0 +1,28 @@ -+ -+ -+ -+ -+ -+ -+ -+ s390:31-bit -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ ---- /dev/null -+++ b/gdb/features/s390-gs.xml -@@ -0,0 +1,13 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ ---- /dev/null -+++ b/gdb/features/s390-gsbc.xml -@@ -0,0 +1,13 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ ---- /dev/null -+++ b/gdb/features/s390x-gs-linux64.c -@@ -0,0 +1,182 @@ -+/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: -+ Original: s390x-gs-linux64.xml */ -+ -+#include "defs.h" -+#include "osabi.h" -+#include "target-descriptions.h" -+ -+struct target_desc *tdesc_s390x_gs_linux64; -+static void -+initialize_tdesc_s390x_gs_linux64 (void) -+{ -+ struct target_desc *result = allocate_target_description (); -+ struct tdesc_feature *feature; -+ struct tdesc_type *field_type; -+ struct tdesc_type *type; -+ -+ set_tdesc_architecture (result, bfd_scan_arch ("s390:64-bit")); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.core"); -+ tdesc_create_reg (feature, "pswm", 0, 1, "psw", 64, "uint64"); -+ tdesc_create_reg (feature, "pswa", 1, 1, "psw", 64, "uint64"); -+ tdesc_create_reg (feature, "r0", 2, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r1", 3, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r2", 4, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r3", 5, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r4", 6, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r5", 7, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r6", 8, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r7", 9, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r8", 10, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r9", 11, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r10", 12, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r11", 13, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r12", 14, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r13", 15, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r14", 16, 1, "general", 64, "uint64"); -+ tdesc_create_reg (feature, "r15", 17, 1, "general", 64, "uint64"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.acr"); -+ tdesc_create_reg (feature, "acr0", 18, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr1", 19, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr2", 20, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr3", 21, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr4", 22, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr5", 23, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr6", 24, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr7", 25, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr8", 26, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr9", 27, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr10", 28, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr11", 29, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr12", 30, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr13", 31, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr14", 32, 1, "access", 32, "uint32"); -+ tdesc_create_reg (feature, "acr15", 33, 1, "access", 32, "uint32"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.fpr"); -+ tdesc_create_reg (feature, "fpc", 34, 1, "float", 32, "uint32"); -+ tdesc_create_reg (feature, "f0", 35, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f1", 36, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f2", 37, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f3", 38, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f4", 39, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f5", 40, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f6", 41, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f7", 42, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f8", 43, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f9", 44, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f10", 45, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f11", 46, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f12", 47, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f13", 48, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f14", 49, 1, "float", 64, "ieee_double"); -+ tdesc_create_reg (feature, "f15", 50, 1, "float", 64, "ieee_double"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.linux"); -+ tdesc_create_reg (feature, "orig_r2", 51, 1, "system", 64, "uint64"); -+ tdesc_create_reg (feature, "last_break", 52, 0, "system", 64, "code_ptr"); -+ tdesc_create_reg (feature, "system_call", 53, 1, "system", 32, "uint32"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.tdb"); -+ tdesc_create_reg (feature, "tdb0", 54, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tac", 55, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tct", 56, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "atia", 57, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr0", 58, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr1", 59, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr2", 60, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr3", 61, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr4", 62, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr5", 63, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr6", 64, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr7", 65, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr8", 66, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr9", 67, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr10", 68, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr11", 69, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr12", 70, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr13", 71, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr14", 72, 1, "tdb", 64, "uint64"); -+ tdesc_create_reg (feature, "tr15", 73, 1, "tdb", 64, "uint64"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.vx"); -+ field_type = tdesc_named_type (feature, "ieee_single"); -+ tdesc_create_vector (feature, "v4f", field_type, 4); -+ -+ field_type = tdesc_named_type (feature, "ieee_double"); -+ tdesc_create_vector (feature, "v2d", field_type, 2); -+ -+ field_type = tdesc_named_type (feature, "int8"); -+ tdesc_create_vector (feature, "v16i8", field_type, 16); -+ -+ field_type = tdesc_named_type (feature, "int16"); -+ tdesc_create_vector (feature, "v8i16", field_type, 8); -+ -+ field_type = tdesc_named_type (feature, "int32"); -+ tdesc_create_vector (feature, "v4i32", field_type, 4); -+ -+ field_type = tdesc_named_type (feature, "int64"); -+ tdesc_create_vector (feature, "v2i64", field_type, 2); -+ -+ type = tdesc_create_union (feature, "vec128"); -+ field_type = tdesc_named_type (feature, "v4f"); -+ tdesc_add_field (type, "v4_float", field_type); -+ field_type = tdesc_named_type (feature, "v2d"); -+ tdesc_add_field (type, "v2_double", field_type); -+ field_type = tdesc_named_type (feature, "v16i8"); -+ tdesc_add_field (type, "v16_int8", field_type); -+ field_type = tdesc_named_type (feature, "v8i16"); -+ tdesc_add_field (type, "v8_int16", field_type); -+ field_type = tdesc_named_type (feature, "v4i32"); -+ tdesc_add_field (type, "v4_int32", field_type); -+ field_type = tdesc_named_type (feature, "v2i64"); -+ tdesc_add_field (type, "v2_int64", field_type); -+ field_type = tdesc_named_type (feature, "uint128"); -+ tdesc_add_field (type, "uint128", field_type); -+ -+ tdesc_create_reg (feature, "v0l", 74, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v1l", 75, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v2l", 76, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v3l", 77, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v4l", 78, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v5l", 79, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v6l", 80, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v7l", 81, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v8l", 82, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v9l", 83, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v10l", 84, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v11l", 85, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v12l", 86, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v13l", 87, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v14l", 88, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v15l", 89, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "v16", 90, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v17", 91, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v18", 92, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v19", 93, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v20", 94, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v21", 95, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v22", 96, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v23", 97, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v24", 98, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v25", 99, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v26", 100, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v27", 101, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v28", 102, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v29", 103, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v30", 104, 1, NULL, 128, "vec128"); -+ tdesc_create_reg (feature, "v31", 105, 1, NULL, 128, "vec128"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.gs"); -+ tdesc_create_reg (feature, "gsd", 106, 1, "gs", 64, "uint64"); -+ tdesc_create_reg (feature, "gssm", 107, 1, "gs", 64, "uint64"); -+ tdesc_create_reg (feature, "gsepla", 108, 1, "gs", 64, "data_ptr"); -+ -+ feature = tdesc_create_feature (result, "org.gnu.gdb.s390.gsbc"); -+ tdesc_create_reg (feature, "bc_gsd", 109, 1, "gs", 64, "uint64"); -+ tdesc_create_reg (feature, "bc_gssm", 110, 1, "gs", 64, "uint64"); -+ tdesc_create_reg (feature, "bc_gsepla", 111, 1, "gs", 64, "data_ptr"); -+ -+ tdesc_s390x_gs_linux64 = result; -+} ---- /dev/null -+++ b/gdb/features/s390x-gs-linux64.xml -@@ -0,0 +1,27 @@ -+ -+ -+ -+ -+ -+ -+ -+ s390:64-bit -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ ---- /dev/null -+++ b/gdb/regformats/s390-gs-linux64.dat -@@ -0,0 +1,133 @@ -+# THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi :set ro: -+# Generated from: s390-gs-linux64.xml -+name:s390_gs_linux64 -+xmltarget:s390-gs-linux64.xml -+expedite:r14,r15,pswa -+32:pswm -+32:pswa -+32:r0h -+32:r0l -+32:r1h -+32:r1l -+32:r2h -+32:r2l -+32:r3h -+32:r3l -+32:r4h -+32:r4l -+32:r5h -+32:r5l -+32:r6h -+32:r6l -+32:r7h -+32:r7l -+32:r8h -+32:r8l -+32:r9h -+32:r9l -+32:r10h -+32:r10l -+32:r11h -+32:r11l -+32:r12h -+32:r12l -+32:r13h -+32:r13l -+32:r14h -+32:r14l -+32:r15h -+32:r15l -+32:acr0 -+32:acr1 -+32:acr2 -+32:acr3 -+32:acr4 -+32:acr5 -+32:acr6 -+32:acr7 -+32:acr8 -+32:acr9 -+32:acr10 -+32:acr11 -+32:acr12 -+32:acr13 -+32:acr14 -+32:acr15 -+32:fpc -+64:f0 -+64:f1 -+64:f2 -+64:f3 -+64:f4 -+64:f5 -+64:f6 -+64:f7 -+64:f8 -+64:f9 -+64:f10 -+64:f11 -+64:f12 -+64:f13 -+64:f14 -+64:f15 -+32:orig_r2 -+32:last_break -+32:system_call -+64:tdb0 -+64:tac -+64:tct -+64:atia -+64:tr0 -+64:tr1 -+64:tr2 -+64:tr3 -+64:tr4 -+64:tr5 -+64:tr6 -+64:tr7 -+64:tr8 -+64:tr9 -+64:tr10 -+64:tr11 -+64:tr12 -+64:tr13 -+64:tr14 -+64:tr15 -+64:v0l -+64:v1l -+64:v2l -+64:v3l -+64:v4l -+64:v5l -+64:v6l -+64:v7l -+64:v8l -+64:v9l -+64:v10l -+64:v11l -+64:v12l -+64:v13l -+64:v14l -+64:v15l -+128:v16 -+128:v17 -+128:v18 -+128:v19 -+128:v20 -+128:v21 -+128:v22 -+128:v23 -+128:v24 -+128:v25 -+128:v26 -+128:v27 -+128:v28 -+128:v29 -+128:v30 -+128:v31 -+64:gsd -+64:gssm -+64:gsepla -+64:bc_gsd -+64:bc_gssm -+64:bc_gsepla ---- /dev/null -+++ b/gdb/regformats/s390x-gs-linux64.dat -@@ -0,0 +1,117 @@ -+# THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi :set ro: -+# Generated from: s390x-gs-linux64.xml -+name:s390x_gs_linux64 -+xmltarget:s390x-gs-linux64.xml -+expedite:r14,r15,pswa -+64:pswm -+64:pswa -+64:r0 -+64:r1 -+64:r2 -+64:r3 -+64:r4 -+64:r5 -+64:r6 -+64:r7 -+64:r8 -+64:r9 -+64:r10 -+64:r11 -+64:r12 -+64:r13 -+64:r14 -+64:r15 -+32:acr0 -+32:acr1 -+32:acr2 -+32:acr3 -+32:acr4 -+32:acr5 -+32:acr6 -+32:acr7 -+32:acr8 -+32:acr9 -+32:acr10 -+32:acr11 -+32:acr12 -+32:acr13 -+32:acr14 -+32:acr15 -+32:fpc -+64:f0 -+64:f1 -+64:f2 -+64:f3 -+64:f4 -+64:f5 -+64:f6 -+64:f7 -+64:f8 -+64:f9 -+64:f10 -+64:f11 -+64:f12 -+64:f13 -+64:f14 -+64:f15 -+64:orig_r2 -+64:last_break -+32:system_call -+64:tdb0 -+64:tac -+64:tct -+64:atia -+64:tr0 -+64:tr1 -+64:tr2 -+64:tr3 -+64:tr4 -+64:tr5 -+64:tr6 -+64:tr7 -+64:tr8 -+64:tr9 -+64:tr10 -+64:tr11 -+64:tr12 -+64:tr13 -+64:tr14 -+64:tr15 -+64:v0l -+64:v1l -+64:v2l -+64:v3l -+64:v4l -+64:v5l -+64:v6l -+64:v7l -+64:v8l -+64:v9l -+64:v10l -+64:v11l -+64:v12l -+64:v13l -+64:v14l -+64:v15l -+128:v16 -+128:v17 -+128:v18 -+128:v19 -+128:v20 -+128:v21 -+128:v22 -+128:v23 -+128:v24 -+128:v25 -+128:v26 -+128:v27 -+128:v28 -+128:v29 -+128:v30 -+128:v31 -+64:gsd -+64:gssm -+64:gsepla -+64:bc_gsd -+64:bc_gssm -+64:bc_gsepla diff --git a/gdb-rhbz1498758-3of5.patch b/gdb-rhbz1498758-3of5.patch deleted file mode 100755 index 2179b2b..0000000 --- a/gdb-rhbz1498758-3of5.patch +++ /dev/null @@ -1,391 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1498758-3of5.patch - -FileName: gdb-rhbz1498758-3of5.patch - -commit 1b63490c9173f8c9770b7885def720516aa9b9f8 -Author: Andreas Arnez -Date: Mon Sep 25 16:02:23 2017 +0200 - - S390: Add guarded-storage register support to GDB - - Recognize targets with the new guarded-storage feature and then present - the guarded-storage registers and the Linux-specific guarded-storage - broadcast control block appropriately. - - gdb/ChangeLog: - - * s390-linux-nat.c (have_regset_gs): New static variable. - (s390_linux_fetch_inferior_registers): Handle guarded-storage - control block and guarded-storage broadcast control regsets. - (s390_read_description): Detect whether the target has - guarded-storage support, return appropriate tdesc. - * s390-linux-tdep.c (features/s390-gs-linux64.c): New include. - (features/s390x-gs-linux64.c): Likewise. - (struct gdbarch_tdep) : New field. - (s390_regmap_gs, s390_regmap_gsbc, s390_gs_regset) - (s390_gsbc_regset): New variables. - (s390_iterate_over_regset_sections): Iterate over s390_gs_regset - and s390_gsbc_regset, if applicable. - (s390_core_read_description): Check whether core file was from a - target with guarded-storage support; include appropriate regsets. - (s390_gdbarch_init): Add registers for guarded-storage support. - (_initialize_s390_tdep): Initialize new target descriptions that - include registers for guarded-storage support. - * s390-linux-tdep.h (HWCAP_S390_GS, S390_GSD_REGNUM) - (S390_GSSM_REGNUM, S390_GSEPLA_REGNUM) - (S390_BC_GSD_REGNUM, S390_BC_GSSM_REGNUM): New defines. - (S390_NUM_REGS): Adjust macro definition. - (s390_gs_regset, s390_gsbc_regset, tdesc_s390_gs_linux64) - (tdesc_s390x_gs_linux64): New declarations. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,31 @@ - 2017-09-25 Andreas Arnez - -+ * s390-linux-nat.c (have_regset_gs): New static variable. -+ (s390_linux_fetch_inferior_registers): Handle guarded-storage -+ control block and guarded-storage broadcast control regsets. -+ (s390_read_description): Detect whether the target has -+ guarded-storage support, return appropriate tdesc. -+ * s390-linux-tdep.c (features/s390-gs-linux64.c): New include. -+ (features/s390x-gs-linux64.c): Likewise. -+ (struct gdbarch_tdep) : New field. -+ (s390_regmap_gs, s390_regmap_gsbc, s390_gs_regset) -+ (s390_gsbc_regset): New variables. -+ (s390_iterate_over_regset_sections): Iterate over s390_gs_regset -+ and s390_gsbc_regset, if applicable. -+ (s390_core_read_description): Check whether core file was from a -+ target with guarded-storage support; include appropriate regsets. -+ (s390_gdbarch_init): Add registers for guarded-storage support. -+ (_initialize_s390_tdep): Initialize new target descriptions that -+ include registers for guarded-storage support. -+ * s390-linux-tdep.h (HWCAP_S390_GS, S390_GSD_REGNUM) -+ (S390_GSSM_REGNUM, S390_GSEPLA_REGNUM) -+ (S390_BC_GSD_REGNUM, S390_BC_GSSM_REGNUM): New defines. -+ (S390_NUM_REGS): Adjust macro definition. -+ (s390_gs_regset, s390_gsbc_regset, tdesc_s390_gs_linux64) -+ (tdesc_s390x_gs_linux64): New declarations. -+ -+2017-09-25 Andreas Arnez -+ - * features/s390-gs-linux64.xml: New file. - * features/s390-gs.xml: New file. - * features/s390-gsbc.xml: New file. ---- a/gdb/s390-linux-nat.c -+++ b/gdb/s390-linux-nat.c -@@ -54,6 +54,7 @@ static int have_regset_last_break = 0; - static int have_regset_system_call = 0; - static int have_regset_tdb = 0; - static int have_regset_vxrs = 0; -+static int have_regset_gs = 0; - - /* Register map for 32-bit executables running under a 64-bit - kernel. */ -@@ -406,6 +407,18 @@ s390_linux_fetch_inferior_registers (struct target_ops *ops, - fetch_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16, - &s390_vxrs_high_regset); - } -+ -+ if (have_regset_gs) -+ { -+ if (regnum == -1 || (regnum >= S390_GSD_REGNUM -+ && regnum <= S390_GSEPLA_REGNUM)) -+ fetch_regset (regcache, tid, NT_S390_GS_CB, 4 * 8, -+ &s390_gs_regset); -+ if (regnum == -1 || (regnum >= S390_BC_GSD_REGNUM -+ && regnum <= S390_BC_GSEPLA_REGNUM)) -+ fetch_regset (regcache, tid, NT_S390_GS_BC, 4 * 8, -+ &s390_gsbc_regset); -+ } - } - - /* Store register REGNUM back into the child process. If REGNUM is -@@ -974,8 +987,13 @@ s390_read_description (struct target_ops *ops) - && check_regset (tid, NT_S390_VXRS_LOW, 16 * 8) - && check_regset (tid, NT_S390_VXRS_HIGH, 16 * 16); - -+ have_regset_gs = (hwcap & HWCAP_S390_GS) -+ && check_regset (tid, NT_S390_GS_CB, 4 * 8) -+ && check_regset (tid, NT_S390_GS_BC, 4 * 8); -+ - if (s390_target_wordsize () == 8) -- return (have_regset_vxrs ? -+ return (have_regset_gs ? tdesc_s390x_gs_linux64 : -+ have_regset_vxrs ? - (have_regset_tdb ? tdesc_s390x_tevx_linux64 : - tdesc_s390x_vx_linux64) : - have_regset_tdb ? tdesc_s390x_te_linux64 : -@@ -984,7 +1002,8 @@ s390_read_description (struct target_ops *ops) - tdesc_s390x_linux64); - - if (hwcap & HWCAP_S390_HIGH_GPRS) -- return (have_regset_vxrs ? -+ return (have_regset_gs ? tdesc_s390_gs_linux64 : -+ have_regset_vxrs ? - (have_regset_tdb ? tdesc_s390_tevx_linux64 : - tdesc_s390_vx_linux64) : - have_regset_tdb ? tdesc_s390_te_linux64 : ---- a/gdb/s390-linux-tdep.c -+++ b/gdb/s390-linux-tdep.c -@@ -69,12 +69,14 @@ - #include "features/s390-te-linux64.c" - #include "features/s390-vx-linux64.c" - #include "features/s390-tevx-linux64.c" -+#include "features/s390-gs-linux64.c" - #include "features/s390x-linux64.c" - #include "features/s390x-linux64v1.c" - #include "features/s390x-linux64v2.c" - #include "features/s390x-te-linux64.c" - #include "features/s390x-vx-linux64.c" - #include "features/s390x-tevx-linux64.c" -+#include "features/s390x-gs-linux64.c" - - #define XML_SYSCALL_FILENAME_S390 "syscalls/s390-linux.xml" - #define XML_SYSCALL_FILENAME_S390X "syscalls/s390x-linux.xml" -@@ -113,6 +115,7 @@ struct gdbarch_tdep - int have_linux_v1; - int have_linux_v2; - int have_tdb; -+ bool have_gs; - }; - - -@@ -834,6 +837,24 @@ static const struct regcache_map_entry s390_regmap_vxrs_high[] = - { 0 } - }; - -+static const struct regcache_map_entry s390_regmap_gs[] = -+ { -+ { 1, REGCACHE_MAP_SKIP, 8 }, -+ { 1, S390_GSD_REGNUM, 8 }, -+ { 1, S390_GSSM_REGNUM, 8 }, -+ { 1, S390_GSEPLA_REGNUM, 8 }, -+ { 0 } -+ }; -+ -+static const struct regcache_map_entry s390_regmap_gsbc[] = -+ { -+ { 1, REGCACHE_MAP_SKIP, 8 }, -+ { 1, S390_BC_GSD_REGNUM, 8 }, -+ { 1, S390_BC_GSSM_REGNUM, 8 }, -+ { 1, S390_BC_GSEPLA_REGNUM, 8 }, -+ { 0 } -+ }; -+ - - /* Supply the TDB regset. Like regcache_supply_regset, but invalidate - the TDB registers unless the TDB format field is valid. */ -@@ -905,6 +926,18 @@ const struct regset s390_vxrs_high_regset = { - regcache_collect_regset - }; - -+const struct regset s390_gs_regset = { -+ s390_regmap_gs, -+ regcache_supply_regset, -+ regcache_collect_regset -+}; -+ -+const struct regset s390_gsbc_regset = { -+ s390_regmap_gsbc, -+ regcache_supply_regset, -+ regcache_collect_regset -+}; -+ - /* Iterate over supported core file register note sections. */ - - static void -@@ -951,6 +984,23 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch, - cb (".reg-s390-vxrs-high", 16 * 16, &s390_vxrs_high_regset, - "s390 vector registers 16-31", cb_data); - } -+ -+ /* Iterate over the guarded-storage regsets if in "read" mode, or if -+ their registers are available. */ -+ if (tdep->have_gs) -+ { -+ if (regcache == NULL -+ || REG_VALID == regcache_register_status (regcache, -+ S390_GSD_REGNUM)) -+ cb (".reg-s390-gs-cb", 4 * 8, &s390_gs_regset, -+ "s390 guarded-storage registers", cb_data); -+ -+ if (regcache == NULL -+ || REG_VALID == regcache_register_status (regcache, -+ S390_BC_GSD_REGNUM)) -+ cb (".reg-s390-gs-bc", 4 * 8, &s390_gsbc_regset, -+ "s390 guarded-storage broadcast control", cb_data); -+ } - } - - static const struct target_desc * -@@ -959,7 +1009,7 @@ s390_core_read_description (struct gdbarch *gdbarch, - { - asection *section = bfd_get_section_by_name (abfd, ".reg"); - CORE_ADDR hwcap = 0; -- int high_gprs, v1, v2, te, vx; -+ bool high_gprs, v1, v2, te, vx, gs; - - target_auxv_search (target, AT_HWCAP, &hwcap); - if (!section) -@@ -971,12 +1021,14 @@ s390_core_read_description (struct gdbarch *gdbarch, - v2 = (bfd_get_section_by_name (abfd, ".reg-s390-system-call") != NULL); - vx = (hwcap & HWCAP_S390_VX); - te = (hwcap & HWCAP_S390_TE); -+ gs = (hwcap & HWCAP_S390_GS); - - switch (bfd_section_size (abfd, section)) - { - case s390_sizeof_gregset: - if (high_gprs) -- return (te && vx ? tdesc_s390_tevx_linux64 : -+ return (gs ? tdesc_s390_gs_linux64 : -+ te && vx ? tdesc_s390_tevx_linux64 : - vx ? tdesc_s390_vx_linux64 : - te ? tdesc_s390_te_linux64 : - v2 ? tdesc_s390_linux64v2 : -@@ -986,7 +1038,8 @@ s390_core_read_description (struct gdbarch *gdbarch, - v1 ? tdesc_s390_linux32v1 : tdesc_s390_linux32); - - case s390x_sizeof_gregset: -- return (te && vx ? tdesc_s390x_tevx_linux64 : -+ return (gs ? tdesc_s390x_gs_linux64 : -+ te && vx ? tdesc_s390x_tevx_linux64 : - vx ? tdesc_s390x_vx_linux64 : - te ? tdesc_s390x_te_linux64 : - v2 ? tdesc_s390x_linux64v2 : -@@ -7767,6 +7820,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - int have_linux_v2 = 0; - int have_tdb = 0; - int have_vx = 0; -+ int have_gs = 0; - int first_pseudo_reg, last_pseudo_reg; - static const char *const stap_register_prefixes[] = { "%", NULL }; - static const char *const stap_register_indirection_prefixes[] = { "(", -@@ -7834,6 +7888,12 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", - "v25", "v26", "v27", "v28", "v29", "v30", "v31", - }; -+ static const char *const gs_cb[] = { -+ "gsd", "gssm", "gsepla", -+ }; -+ static const char *const gs_bc[] = { -+ "bc_gsd", "bc_gssm", "bc_gsepla", -+ }; - const struct tdesc_feature *feature; - int i, valid_p = 1; - -@@ -7937,6 +7997,29 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - have_vx = 1; - } - -+ /* Guarded-storage registers. */ -+ feature = tdesc_find_feature (tdesc, "org.gnu.gdb.s390.gs"); -+ if (feature) -+ { -+ for (i = 0; i < 3; i++) -+ valid_p &= tdesc_numbered_register (feature, tdesc_data, -+ S390_GSD_REGNUM + i, -+ gs_cb[i]); -+ have_gs = 1; -+ } -+ -+ /* Guarded-storage broadcast control. */ -+ feature = tdesc_find_feature (tdesc, "org.gnu.gdb.s390.gsbc"); -+ if (feature) -+ { -+ valid_p &= have_gs; -+ -+ for (i = 0; i < 3; i++) -+ valid_p &= tdesc_numbered_register (feature, tdesc_data, -+ S390_BC_GSD_REGNUM + i, -+ gs_bc[i]); -+ } -+ - if (!valid_p) - { - tdesc_data_cleanup (tdesc_data); -@@ -7970,6 +8053,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - continue; - if ((tdep->gpr_full_regnum != -1) != have_upper) - continue; -+ if (tdep->have_gs != have_gs) -+ continue; - if (tdesc_data != NULL) - tdesc_data_cleanup (tdesc_data); - return arches->gdbarch; -@@ -7982,6 +8067,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - tdep->have_linux_v1 = have_linux_v1; - tdep->have_linux_v2 = have_linux_v2; - tdep->have_tdb = have_tdb; -+ tdep->have_gs = have_gs; - gdbarch = gdbarch_alloc (&info, tdep); - - set_gdbarch_believe_pcc_promotion (gdbarch, 0); -@@ -8157,10 +8243,12 @@ _initialize_s390_tdep (void) - initialize_tdesc_s390_te_linux64 (); - initialize_tdesc_s390_vx_linux64 (); - initialize_tdesc_s390_tevx_linux64 (); -+ initialize_tdesc_s390_gs_linux64 (); - initialize_tdesc_s390x_linux64 (); - initialize_tdesc_s390x_linux64v1 (); - initialize_tdesc_s390x_linux64v2 (); - initialize_tdesc_s390x_te_linux64 (); - initialize_tdesc_s390x_vx_linux64 (); - initialize_tdesc_s390x_tevx_linux64 (); -+ initialize_tdesc_s390x_gs_linux64 (); - } ---- a/gdb/s390-linux-tdep.h -+++ b/gdb/s390-linux-tdep.h -@@ -33,6 +33,10 @@ - #define HWCAP_S390_VX 2048 - #endif - -+#ifndef HWCAP_S390_GS -+#define HWCAP_S390_GS 16384 -+#endif -+ - /* Register information. */ - - /* Program Status Word. */ -@@ -166,8 +170,14 @@ - #define S390_V29_REGNUM 119 - #define S390_V30_REGNUM 120 - #define S390_V31_REGNUM 121 -+#define S390_GSD_REGNUM 122 -+#define S390_GSSM_REGNUM 123 -+#define S390_GSEPLA_REGNUM 124 -+#define S390_BC_GSD_REGNUM 125 -+#define S390_BC_GSSM_REGNUM 126 -+#define S390_BC_GSEPLA_REGNUM 127 - /* Total. */ --#define S390_NUM_REGS 122 -+#define S390_NUM_REGS 128 - - /* Special register usage. */ - #define S390_SP_REGNUM S390_R15_REGNUM -@@ -198,6 +208,8 @@ extern const struct regset s390_tdb_regset; - #define s390_sizeof_tdbregset 0x100 - extern const struct regset s390_vxrs_low_regset; - extern const struct regset s390_vxrs_high_regset; -+extern const struct regset s390_gs_regset; -+extern const struct regset s390_gsbc_regset; - - /* GNU/Linux target descriptions. */ - extern struct target_desc *tdesc_s390_linux32; -@@ -209,11 +221,13 @@ extern struct target_desc *tdesc_s390_linux64v2; - extern struct target_desc *tdesc_s390_te_linux64; - extern struct target_desc *tdesc_s390_vx_linux64; - extern struct target_desc *tdesc_s390_tevx_linux64; -+extern struct target_desc *tdesc_s390_gs_linux64; - extern struct target_desc *tdesc_s390x_linux64; - extern struct target_desc *tdesc_s390x_linux64v1; - extern struct target_desc *tdesc_s390x_linux64v2; - extern struct target_desc *tdesc_s390x_te_linux64; - extern struct target_desc *tdesc_s390x_vx_linux64; - extern struct target_desc *tdesc_s390x_tevx_linux64; -+extern struct target_desc *tdesc_s390x_gs_linux64; - - #endif diff --git a/gdb-rhbz1498758-4of5.patch b/gdb-rhbz1498758-4of5.patch deleted file mode 100755 index 5063949..0000000 --- a/gdb-rhbz1498758-4of5.patch +++ /dev/null @@ -1,281 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1498758-4of5.patch - -FileName: gdb-rhbz1498758-4of5.patch - -commit ad3396348e0ebb61fdf71cff307bac08175ed366 -Author: Andreas Arnez -Date: Mon Sep 25 16:02:23 2017 +0200 - - S390: Add guarded-storage register support to gdbserver - - Enable gdbserver to deal with the new guarded-storage register sets. - - gdb/gdbserver/ChangeLog: - - * configure.srv (s390*-*-linux*): Add s390-gs-linux64.o and - s390x-gs-linux64.o to srv_regobj. Add s390-gs-linux64.xml, - s390x-gs-linux64.xml, s390-gs.xml, and s390-gsbc.xml to - srv_xmlfiles. Add s390-gs-linux64-ipa.o and - s390x-gs-linux64-ipa.o to ipa_obj. - * linux-s390-low.c (HWCAP_S390_GS): New define. - (s390_fill_gs, s390_store_gs, s390_fill_gsbc, s390_store_gsbc): - New functions. - (s390_regsets): Add regsets for NT_S390_GS_CB and NT_S390_GS_BC. - (s390_arch_setup): Check for guarded-storage support and choose - appropriate tdesc. - (initialize_low_arch): Invoke init_registers_s390_gs_linux64 and - init_registers_s390x_gs_linux64. - * linux-s390-tdesc.h (enum s390_linux_tdesc) : New - enum value. - (init_registers_s390x_gs_linux64, tdesc_s390x_gs_linux64) - (init_registers_s390_gs_linux64, tdesc_s390_gs_linux64): Declare. - -### a/gdb/gdbserver/ChangeLog -### b/gdb/gdbserver/ChangeLog -## -1,3 +1,23 @@ -+2017-09-25 Andreas Arnez -+ -+ * configure.srv (s390*-*-linux*): Add s390-gs-linux64.o and -+ s390x-gs-linux64.o to srv_regobj. Add s390-gs-linux64.xml, -+ s390x-gs-linux64.xml, s390-gs.xml, and s390-gsbc.xml to -+ srv_xmlfiles. Add s390-gs-linux64-ipa.o and -+ s390x-gs-linux64-ipa.o to ipa_obj. -+ * linux-s390-low.c (HWCAP_S390_GS): New define. -+ (s390_fill_gs, s390_store_gs, s390_fill_gsbc, s390_store_gsbc): -+ New functions. -+ (s390_regsets): Add regsets for NT_S390_GS_CB and NT_S390_GS_BC. -+ (s390_arch_setup): Check for guarded-storage support and choose -+ appropriate tdesc. -+ (initialize_low_arch): Invoke init_registers_s390_gs_linux64 and -+ init_registers_s390x_gs_linux64. -+ * linux-s390-tdesc.h (enum s390_linux_tdesc) : New -+ enum value. -+ (init_registers_s390x_gs_linux64, tdesc_s390x_gs_linux64) -+ (init_registers_s390_gs_linux64, tdesc_s390_gs_linux64): Declare. -+ - 2017-09-22 Simon Marchi - - * win32-i386-low.c (i386_arch_setup): Call init_target_desc. ---- a/gdb/gdbserver/configure.srv -+++ b/gdb/gdbserver/configure.srv -@@ -285,12 +285,14 @@ case "${target}" in - srv_regobj="${srv_regobj} s390-te-linux64.o" - srv_regobj="${srv_regobj} s390-vx-linux64.o" - srv_regobj="${srv_regobj} s390-tevx-linux64.o" -+ srv_regobj="${srv_regobj} s390-gs-linux64.o" - srv_regobj="${srv_regobj} s390x-linux64.o" - srv_regobj="${srv_regobj} s390x-linux64v1.o" - srv_regobj="${srv_regobj} s390x-linux64v2.o" - srv_regobj="${srv_regobj} s390x-te-linux64.o" - srv_regobj="${srv_regobj} s390x-vx-linux64.o" - srv_regobj="${srv_regobj} s390x-tevx-linux64.o" -+ srv_regobj="${srv_regobj} s390x-gs-linux64.o" - srv_tgtobj="$srv_linux_obj linux-s390-low.o" - srv_xmlfiles="s390-linux32.xml" - srv_xmlfiles="${srv_xmlfiles} s390-linux32v1.xml" -@@ -301,12 +303,14 @@ case "${target}" in - srv_xmlfiles="${srv_xmlfiles} s390-te-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390-vx-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390-tevx-linux64.xml" -+ srv_xmlfiles="${srv_xmlfiles} s390-gs-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-linux64v1.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-linux64v2.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-te-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-vx-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-tevx-linux64.xml" -+ srv_xmlfiles="${srv_xmlfiles} s390x-gs-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390-core32.xml" - srv_xmlfiles="${srv_xmlfiles} s390-core64.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-core64.xml" -@@ -314,6 +318,8 @@ case "${target}" in - srv_xmlfiles="${srv_xmlfiles} s390-fpr.xml" - srv_xmlfiles="${srv_xmlfiles} s390-tdb.xml" - srv_xmlfiles="${srv_xmlfiles} s390-vx.xml" -+ srv_xmlfiles="${srv_xmlfiles} s390-gs.xml" -+ srv_xmlfiles="${srv_xmlfiles} s390-gsbc.xml" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes -@@ -327,12 +333,14 @@ case "${target}" in - ipa_obj="${ipa_obj} s390-vx-linux64-ipa.o" - ipa_obj="${ipa_obj} s390-te-linux64-ipa.o" - ipa_obj="${ipa_obj} s390-tevx-linux64-ipa.o" -+ ipa_obj="${ipa_obj} s390-gs-linux64-ipa.o" - ipa_obj="${ipa_obj} s390x-linux64-ipa.o" - ipa_obj="${ipa_obj} s390x-linux64v1-ipa.o" - ipa_obj="${ipa_obj} s390x-linux64v2-ipa.o" - ipa_obj="${ipa_obj} s390x-vx-linux64-ipa.o" - ipa_obj="${ipa_obj} s390x-te-linux64-ipa.o" - ipa_obj="${ipa_obj} s390x-tevx-linux64-ipa.o" -+ ipa_obj="${ipa_obj} s390x-gs-linux64-ipa.o" - ;; - sh*-*-linux*) srv_regobj=reg-sh.o - srv_tgtobj="$srv_linux_obj linux-sh-low.o" ---- a/gdb/gdbserver/linux-s390-low.c -+++ b/gdb/gdbserver/linux-s390-low.c -@@ -45,6 +45,10 @@ - #define HWCAP_S390_VX 2048 - #endif - -+#ifndef HWCAP_S390_GS -+#define HWCAP_S390_GS 16384 -+#endif -+ - #define s390_num_regs 52 - - static int s390_regmap[] = { -@@ -370,6 +374,46 @@ s390_store_vxrs_high (struct regcache *regcache, const void *buf) - supply_register (regcache, v16 + i, (const char *) buf + 16 * i); - } - -+static void -+s390_fill_gs (struct regcache *regcache, void *buf) -+{ -+ int gsd = find_regno (regcache->tdesc, "gsd"); -+ int i; -+ -+ for (i = 0; i < 3; i++) -+ collect_register (regcache, gsd + i, (char *) buf + 8 * (i + 1)); -+} -+ -+static void -+s390_store_gs (struct regcache *regcache, const void *buf) -+{ -+ int gsd = find_regno (regcache->tdesc, "gsd"); -+ int i; -+ -+ for (i = 0; i < 3; i++) -+ supply_register (regcache, gsd + i, (const char *) buf + 8 * (i + 1)); -+} -+ -+static void -+s390_fill_gsbc (struct regcache *regcache, void *buf) -+{ -+ int bc_gsd = find_regno (regcache->tdesc, "bc_gsd"); -+ int i; -+ -+ for (i = 0; i < 3; i++) -+ collect_register (regcache, bc_gsd + i, (char *) buf + 8 * (i + 1)); -+} -+ -+static void -+s390_store_gsbc (struct regcache *regcache, const void *buf) -+{ -+ int bc_gsd = find_regno (regcache->tdesc, "bc_gsd"); -+ int i; -+ -+ for (i = 0; i < 3; i++) -+ supply_register (regcache, bc_gsd + i, (const char *) buf + 8 * (i + 1)); -+} -+ - static struct regset_info s390_regsets[] = { - { 0, 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL }, - #ifndef __s390x__ -@@ -388,6 +432,10 @@ static struct regset_info s390_regsets[] = { - EXTENDED_REGS, s390_fill_vxrs_low, s390_store_vxrs_low }, - { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_HIGH, 0, - EXTENDED_REGS, s390_fill_vxrs_high, s390_store_vxrs_high }, -+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_CB, 0, -+ EXTENDED_REGS, s390_fill_gs, s390_store_gs }, -+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_BC, 0, -+ EXTENDED_REGS, s390_fill_gsbc, s390_store_gsbc }, - NULL_REGSET - }; - -@@ -501,6 +549,8 @@ s390_arch_setup (void) - int have_regset_tdb = s390_check_regset (pid, NT_S390_TDB, 256); - int have_regset_vxrs = s390_check_regset (pid, NT_S390_VXRS_LOW, 128) - && s390_check_regset (pid, NT_S390_VXRS_HIGH, 256); -+ int have_regset_gs = s390_check_regset (pid, NT_S390_GS_CB, 32) -+ && s390_check_regset (pid, NT_S390_GS_BC, 32); - - /* Assume 31-bit inferior process. */ - if (have_regset_system_call) -@@ -529,8 +579,13 @@ s390_arch_setup (void) - if (have_regset_vxrs) - have_regset_vxrs = - (s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_VX) != 0; -+ if (have_regset_gs) -+ have_regset_gs = -+ (s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_GS) != 0; - -- if (have_regset_vxrs) -+ if (have_regset_gs) -+ tdesc = tdesc_s390x_gs_linux64; -+ else if (have_regset_vxrs) - tdesc = (have_regset_tdb ? tdesc_s390x_tevx_linux64 : - tdesc_s390x_vx_linux64); - else if (have_regset_tdb) -@@ -554,8 +609,12 @@ s390_arch_setup (void) - have_regset_tdb = (s390_get_hwcap (tdesc) & HWCAP_S390_TE) != 0; - if (have_regset_vxrs) - have_regset_vxrs = (s390_get_hwcap (tdesc) & HWCAP_S390_VX) != 0; -+ if (have_regset_gs) -+ have_regset_gs = (s390_get_hwcap (tdesc) & HWCAP_S390_GS) != 0; - -- if (have_regset_vxrs) -+ if (have_regset_gs) -+ tdesc = tdesc_s390_gs_linux64; -+ else if (have_regset_vxrs) - tdesc = (have_regset_tdb ? tdesc_s390_tevx_linux64 : - tdesc_s390_vx_linux64); - else if (have_regset_tdb) -@@ -596,6 +655,9 @@ s390_arch_setup (void) - case NT_S390_VXRS_HIGH: - regset->size = have_regset_vxrs ? 256 : 0; - break; -+ case NT_S390_GS_CB: -+ case NT_S390_GS_BC: -+ regset->size = have_regset_gs ? 32 : 0; - default: - break; - } -@@ -2797,6 +2859,7 @@ initialize_low_arch (void) - init_registers_s390_te_linux64 (); - init_registers_s390_vx_linux64 (); - init_registers_s390_tevx_linux64 (); -+ init_registers_s390_gs_linux64 (); - #ifdef __s390x__ - init_registers_s390x_linux64 (); - init_registers_s390x_linux64v1 (); -@@ -2804,6 +2867,7 @@ initialize_low_arch (void) - init_registers_s390x_te_linux64 (); - init_registers_s390x_vx_linux64 (); - init_registers_s390x_tevx_linux64 (); -+ init_registers_s390x_gs_linux64 (); - #endif - - initialize_regsets_info (&s390_regsets_info); ---- a/gdb/gdbserver/linux-s390-tdesc.h -+++ b/gdb/gdbserver/linux-s390-tdesc.h -@@ -31,6 +31,7 @@ enum s390_linux_tdesc { - S390_TDESC_TE, - S390_TDESC_VX, - S390_TDESC_TEVX, -+ S390_TDESC_GS, - }; - - #ifdef __s390x__ -@@ -59,6 +60,10 @@ extern const struct target_desc *tdesc_s390x_vx_linux64; - void init_registers_s390x_tevx_linux64 (void); - extern const struct target_desc *tdesc_s390x_tevx_linux64; - -+/* Defined in auto-generated file s390x-gs-linux64.c. */ -+void init_registers_s390x_gs_linux64 (void); -+extern const struct target_desc *tdesc_s390x_gs_linux64; -+ - #endif - - #if !defined __s390x__ || !defined IN_PROCESS_AGENT -@@ -99,4 +104,8 @@ extern const struct target_desc *tdesc_s390_vx_linux64; - void init_registers_s390_tevx_linux64 (void); - extern const struct target_desc *tdesc_s390_tevx_linux64; - -+/* Defined in auto-generated file s390-gs-linux64.c. */ -+void init_registers_s390_gs_linux64 (void); -+extern const struct target_desc *tdesc_s390_gs_linux64; -+ - #endif diff --git a/gdb-rhbz1498758-5of5.patch b/gdb-rhbz1498758-5of5.patch deleted file mode 100644 index 72ddcec..0000000 --- a/gdb-rhbz1498758-5of5.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz1498758-5of5.patch - -FileName: gdb-rhbz1498758-5of5.patch - -commit 289e23aa03084b22c73ebdcf18371f1e6666ead0 -Author: Andreas Arnez -Date: Mon Sep 25 16:02:24 2017 +0200 - - S390: Document guarded-storage register support - - This documents the newly added support for guarded-storage registers on - IBM z. - - gdb/ChangeLog: - - * NEWS: Advertise support for guarded-storage registers on IBM z. - - gdb/doc/ChangeLog: - - * gdb.texinfo (S/390 and System z Features): Document the new - features org.gnu.gdb.s390.gs and org.gnu.gdb.s390.gsbc. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,5 +1,9 @@ - 2017-09-25 Andreas Arnez - -+ * NEWS: Advertise support for guarded-storage registers on IBM z. -+ -+2017-09-25 Andreas Arnez -+ - * s390-linux-nat.c (have_regset_gs): New static variable. - (s390_linux_fetch_inferior_registers): Handle guarded-storage - control block and guarded-storage broadcast control regsets. -Index: gdb-8.0.1/gdb/NEWS -=================================================================== ---- gdb-8.0.1.orig/gdb/NEWS 2017-10-07 15:54:48.649165644 +0200 -+++ gdb-8.0.1/gdb/NEWS 2017-10-07 15:55:01.006264129 +0200 -@@ -3,6 +3,9 @@ - - * Fortran: Support pointers to dynamic types. - -+* GDB now supports access to the guarded-storage-control registers and the -+ software-based guarded-storage broadcast control registers on IBM z14. -+ - *** Changes in GDB 8.0 - - * GDB now supports access to the PKU register on GNU/Linux. The register is -Index: gdb-8.0.1/gdb/doc/gdb.texinfo -=================================================================== ---- gdb-8.0.1.orig/gdb/doc/gdb.texinfo 2017-10-07 15:54:44.891135692 +0200 -+++ gdb-8.0.1/gdb/doc/gdb.texinfo 2017-10-07 15:54:48.660165731 +0200 -@@ -41512,6 +41512,14 @@ - contain the 128-bit wide vector registers @samp{v16} through - @samp{v31}. - -+The @samp{org.gnu.gdb.s390.gs} feature is optional. It should contain -+the 64-bit wide guarded-storage-control registers @samp{gsd}, -+@samp{gssm}, and @samp{gsepla}. -+ -+The @samp{org.gnu.gdb.s390.gsbc} feature is optional. It should contain -+the 64-bit wide guarded-storage broadcast control registers -+@samp{bc_gsd}, @samp{bc_gssm}, and @samp{bc_gsepla}. -+ - @node Sparc Features - @subsection Sparc Features - @cindex target descriptions, sparc32 features diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index ad29559..09d1ee1 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -1,13 +1,16 @@ +From 5450536a1efedc409556e52bfd246b6b26557364 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [PATCH 1/4] Expand bitpos and type.length to LONGEST and ULONGEST +Subject: Expand bitpos and type.length to LONGEST and ULONGEST FileName: gdb-rhbz795424-bitpos-20of25.patch +;; Fix `GDB cannot access struct member whose offset is larger than 256MB' +;; (RH BZ 795424). +;;=push + http://sourceware.org/ml/gdb-patches/2012-09/msg00631.html - - --MP_/yp5f+W_ED2JtUlSyBi8xujr Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit @@ -468,12 +471,110 @@ gdb/testsuite/ChangeLog: Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-main.patch +--- + gdb/aarch64-linux-nat.c | 2 +- + gdb/ada-lang.c | 105 +++++++++++++++++++++------------------- + gdb/ada-lang.h | 6 +-- + gdb/ada-typeprint.c | 7 +-- + gdb/ada-valprint.c | 39 +++++++-------- + gdb/amd64-tdep.c | 8 +-- + gdb/annotate.c | 8 +-- + gdb/annotate.h | 4 +- + gdb/arch-utils.c | 2 +- + gdb/arch-utils.h | 2 +- + gdb/arm-linux-nat.c | 2 +- + gdb/ax-gdb.c | 30 ++++++------ + gdb/ax-general.c | 2 +- + gdb/ax.h | 2 +- + gdb/breakpoint.c | 8 +-- + gdb/breakpoint.h | 4 +- + gdb/c-lang.c | 6 +-- + gdb/c-lang.h | 4 +- + gdb/c-valprint.c | 10 ++-- + gdb/compile/compile-c-support.c | 4 +- + gdb/cp-abi.c | 6 +-- + gdb/cp-abi.h | 20 ++++---- + gdb/cp-valprint.c | 2 +- + gdb/d-lang.h | 2 +- + gdb/d-valprint.c | 2 +- + gdb/dwarf2loc.c | 18 +++---- + gdb/dwarf2read.c | 12 ++--- + gdb/eval.c | 15 +++--- + gdb/f-lang.c | 2 +- + gdb/f-lang.h | 2 +- + gdb/f-valprint.c | 14 +++--- + gdb/findvar.c | 6 +-- + gdb/frame.c | 4 +- + gdb/frame.h | 2 +- + gdb/gdbarch.c | 2 +- + gdb/gdbarch.h | 4 +- + gdb/gdbarch.sh | 2 +- + gdb/gdbtypes.c | 14 +++--- + gdb/gdbtypes.h | 6 +-- + gdb/gnu-v2-abi.c | 9 ++-- + gdb/gnu-v3-abi.c | 14 +++--- + gdb/go-lang.h | 2 +- + gdb/go-valprint.c | 2 +- + gdb/i386-tdep.c | 2 +- + gdb/language.c | 4 +- + gdb/language.h | 4 +- + gdb/m2-lang.c | 10 ++-- + gdb/m2-lang.h | 2 +- + gdb/m2-typeprint.c | 9 ++-- + gdb/m2-valprint.c | 16 +++--- + gdb/memrange.c | 4 +- + gdb/memrange.h | 8 +-- + gdb/mips-linux-nat.c | 2 +- + gdb/nat/x86-dregs.c | 4 +- + gdb/nat/x86-dregs.h | 2 +- + gdb/opencl-lang.c | 26 +++++----- + gdb/p-lang.c | 14 +++--- + gdb/p-lang.h | 6 +-- + gdb/p-valprint.c | 6 +-- + gdb/ppc-linux-nat.c | 2 +- + gdb/ppc-linux-tdep.c | 2 +- + gdb/printcmd.c | 4 +- + gdb/procfs.c | 2 +- + gdb/regcache.c | 19 ++++---- + gdb/regcache.h | 23 ++++----- + gdb/remote.c | 2 +- + gdb/rust-lang.c | 4 +- + gdb/s390-linux-nat.c | 2 +- + gdb/spu-multiarch.c | 2 +- + gdb/stack.c | 10 ++-- + gdb/symmisc.c | 6 +-- + gdb/target-delegates.c | 6 +-- + gdb/target.c | 4 +- + gdb/target.h | 2 +- + gdb/tracepoint.c | 32 ++++++------ + gdb/tracepoint.h | 2 +- + gdb/valarith.c | 12 ++--- + gdb/valops.c | 18 +++---- + gdb/valprint.c | 18 +++---- + gdb/valprint.h | 8 +-- + gdb/value.c | 10 ++-- + gdb/value.h | 15 +++--- + gdb/x86-nat.c | 2 +- + 83 files changed, 381 insertions(+), 362 deletions(-) -Index: gdb-8.0/gdb/ada-lang.c -=================================================================== ---- gdb-8.0.orig/gdb/ada-lang.c 2017-08-19 20:04:59.785780501 +0200 -+++ gdb-8.0/gdb/ada-lang.c 2017-08-19 20:05:10.056876589 +0200 -@@ -76,7 +76,7 @@ +diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c +index 9e317c04e4..8606111c00 100644 +--- a/gdb/aarch64-linux-nat.c ++++ b/gdb/aarch64-linux-nat.c +@@ -708,7 +708,7 @@ aarch64_linux_remove_watchpoint (struct target_ops *self, + + static int + aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) + { + return aarch64_linux_region_ok_for_watchpoint (addr, len); + } +diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c +index c5636b92f3..8b18a011ac 100644 +--- a/gdb/ada-lang.c ++++ b/gdb/ada-lang.c +@@ -78,7 +78,7 @@ static struct type *desc_bounds_type (struct type *); static struct value *desc_bounds (struct value *); @@ -482,7 +583,7 @@ Index: gdb-8.0/gdb/ada-lang.c static int fat_pntr_bounds_bitsize (struct type *); -@@ -84,13 +84,13 @@ +@@ -86,13 +86,13 @@ static struct type *desc_data_target_type (struct type *); static struct value *desc_data (struct value *); @@ -498,7 +599,7 @@ Index: gdb-8.0/gdb/ada-lang.c static int desc_bound_bitsize (struct type *, int, int); -@@ -173,7 +173,7 @@ +@@ -175,7 +175,7 @@ static struct type *static_unwrap_type (struct type *type); static struct value *unwrap_value (struct value *); @@ -507,7 +608,7 @@ Index: gdb-8.0/gdb/ada-lang.c static struct type *decode_constrained_packed_array_type (struct type *); -@@ -188,7 +188,8 @@ +@@ -190,7 +190,8 @@ static int ada_is_unconstrained_packed_array_type (struct type *); static struct value *value_subscript_packed (struct value *, int, struct value **); @@ -517,7 +618,7 @@ Index: gdb-8.0/gdb/ada-lang.c static struct value *coerce_unspec_val_to_type (struct value *, struct type *); -@@ -216,14 +217,14 @@ +@@ -216,14 +217,14 @@ static struct value *value_val_atr (struct type *, struct value *); static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); @@ -536,7 +637,7 @@ Index: gdb-8.0/gdb/ada-lang.c static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, struct value *); -@@ -237,7 +238,7 @@ +@@ -237,7 +238,7 @@ static int ada_is_direct_array_type (struct type *); static void ada_language_arch_info (struct gdbarch *, struct language_arch_info *); @@ -545,7 +646,7 @@ Index: gdb-8.0/gdb/ada-lang.c struct type *); static struct value *assign_aggregate (struct value *, struct value *, -@@ -699,7 +700,7 @@ +@@ -700,7 +701,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) } static const gdb_byte * @@ -554,7 +655,7 @@ Index: gdb-8.0/gdb/ada-lang.c { if (valaddr == NULL) return NULL; -@@ -708,7 +709,7 @@ +@@ -709,7 +710,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) } static CORE_ADDR @@ -563,7 +664,7 @@ Index: gdb-8.0/gdb/ada-lang.c { if (address == 0) return 0; -@@ -1755,7 +1756,7 @@ +@@ -1747,7 +1748,7 @@ desc_bounds (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ @@ -572,7 +673,7 @@ Index: gdb-8.0/gdb/ada-lang.c fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); -@@ -1821,7 +1822,7 @@ +@@ -1813,7 +1814,7 @@ desc_data (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ @@ -581,7 +682,7 @@ Index: gdb-8.0/gdb/ada-lang.c fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); -@@ -1856,7 +1857,7 @@ +@@ -1848,7 +1849,7 @@ desc_one_bound (struct value *bounds, int i, int which) of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ @@ -590,7 +691,7 @@ Index: gdb-8.0/gdb/ada-lang.c desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); -@@ -2046,7 +2047,7 @@ +@@ -2038,7 +2039,7 @@ ada_type_of_array (struct value *arr, int bounds) zero, and does not need to be recomputed. */ if (lo < hi) { @@ -599,7 +700,7 @@ Index: gdb-8.0/gdb/ada-lang.c (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; -@@ -2206,7 +2207,7 @@ +@@ -2198,7 +2199,7 @@ decode_packed_array_bitsize (struct type *type) the length is arbitrary. */ static struct type * @@ -608,7 +709,7 @@ Index: gdb-8.0/gdb/ada-lang.c { struct type *new_elt_type; struct type *new_type; -@@ -2260,7 +2261,7 @@ +@@ -2252,7 +2253,7 @@ decode_constrained_packed_array_type (struct type *type) char *name; const char *tail; struct type *shadow_type; @@ -617,7 +718,7 @@ Index: gdb-8.0/gdb/ada-lang.c if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); -@@ -2331,7 +2332,8 @@ +@@ -2323,7 +2324,8 @@ decode_constrained_packed_array (struct value *arr) array with no wrapper. In order to interpret the value through the (left-justified) packed array type we just built, we must first left-justify it. */ @@ -627,7 +728,7 @@ Index: gdb-8.0/gdb/ada-lang.c ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; -@@ -2559,7 +2561,7 @@ +@@ -2551,7 +2553,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, @@ -636,7 +737,7 @@ Index: gdb-8.0/gdb/ada-lang.c struct type *type) { struct value *v; -@@ -2630,7 +2632,7 @@ +@@ -2621,7 +2623,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, if (obj != NULL) { @@ -645,7 +746,7 @@ Index: gdb-8.0/gdb/ada-lang.c set_value_component_location (v, obj); set_value_bitpos (v, bit_offset + value_bitpos (obj)); -@@ -2676,7 +2678,7 @@ +@@ -2667,7 +2669,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, not overlap. */ static void move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, @@ -654,7 +755,7 @@ Index: gdb-8.0/gdb/ada-lang.c { unsigned int accum, mask; int accum_bits, chunk_size; -@@ -2766,7 +2768,7 @@ +@@ -2757,7 +2759,7 @@ ada_value_assign (struct value *toval, struct value *fromval) { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; @@ -663,7 +764,7 @@ Index: gdb-8.0/gdb/ada-lang.c gdb_byte *buffer = (gdb_byte *) alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); -@@ -2817,7 +2819,7 @@ +@@ -2808,7 +2810,7 @@ value_assign_to_component (struct value *container, struct value *component, (LONGEST) (value_address (component) - value_address (container)); int bit_offset_in_container = value_bitpos (component) - value_bitpos (container); @@ -672,7 +773,7 @@ Index: gdb-8.0/gdb/ada-lang.c val = value_cast (value_type (component), val); -@@ -4468,7 +4470,7 @@ +@@ -4473,7 +4475,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { @@ -681,7 +782,7 @@ Index: gdb-8.0/gdb/ada-lang.c const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); -@@ -4552,7 +4554,7 @@ +@@ -4557,7 +4559,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); @@ -690,7 +791,7 @@ Index: gdb-8.0/gdb/ada-lang.c gdb_byte *buf = (gdb_byte *) alloca (len); CORE_ADDR addr; -@@ -6752,7 +6754,7 @@ +@@ -6704,7 +6706,7 @@ value_tag_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address) { @@ -699,7 +800,7 @@ Index: gdb-8.0/gdb/ada-lang.c struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, -@@ -7233,7 +7235,7 @@ +@@ -7185,7 +7187,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) only in that it can handle packed values of arbitrary type. */ static struct value * @@ -708,7 +809,7 @@ Index: gdb-8.0/gdb/ada-lang.c struct type *arg_type) { struct type *type; -@@ -7245,7 +7247,7 @@ +@@ -7197,7 +7199,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { @@ -717,7 +818,7 @@ Index: gdb-8.0/gdb/ada-lang.c int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), -@@ -7272,9 +7274,9 @@ +@@ -7224,9 +7226,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ static int @@ -729,7 +830,7 @@ Index: gdb-8.0/gdb/ada-lang.c int *index_p) { int i; -@@ -7292,8 +7294,8 @@ +@@ -7244,8 +7246,8 @@ find_struct_field (const char *name, struct type *type, int offset, for (i = 0; i < TYPE_NFIELDS (type); i += 1) { @@ -740,7 +841,7 @@ Index: gdb-8.0/gdb/ada-lang.c const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) -@@ -7363,7 +7365,7 @@ +@@ -7315,7 +7317,7 @@ num_visible_fields (struct type *type) Searches recursively through wrapper fields (e.g., '_parent'). */ static struct value * @@ -749,7 +850,7 @@ Index: gdb-8.0/gdb/ada-lang.c struct type *type) { int i; -@@ -7396,7 +7398,7 @@ +@@ -7348,7 +7350,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -758,7 +859,7 @@ Index: gdb-8.0/gdb/ada-lang.c for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { -@@ -7414,8 +7416,8 @@ +@@ -7366,8 +7368,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, return NULL; } @@ -769,7 +870,7 @@ Index: gdb-8.0/gdb/ada-lang.c /* Return field #INDEX in ARG, where the index is that returned by -@@ -7424,7 +7426,7 @@ +@@ -7376,7 +7378,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, * If found, return value, else return NULL. */ static struct value * @@ -778,7 +879,7 @@ Index: gdb-8.0/gdb/ada-lang.c struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); -@@ -7436,7 +7438,7 @@ +@@ -7388,7 +7390,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, * *INDEX_P. */ static struct value * @@ -787,7 +888,7 @@ Index: gdb-8.0/gdb/ada-lang.c struct type *type) { int i; -@@ -7526,7 +7528,8 @@ +@@ -7478,7 +7480,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) v = ada_search_struct_field (name, arg, 0, t); else { @@ -797,7 +898,7 @@ Index: gdb-8.0/gdb/ada-lang.c struct type *field_type; CORE_ADDR address; -@@ -7832,8 +7835,8 @@ +@@ -7769,8 +7772,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ @@ -808,7 +909,7 @@ Index: gdb-8.0/gdb/ada-lang.c { return (off + alignment - 1) & ~(alignment - 1); } -@@ -8227,10 +8230,9 @@ +@@ -8164,10 +8167,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, struct value *mark = value_mark (); struct value *dval; struct type *rtype; @@ -821,7 +922,7 @@ Index: gdb-8.0/gdb/ada-lang.c int f; /* Compute the number of fields in this record type that are going -@@ -8308,7 +8310,7 @@ +@@ -8245,7 +8247,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, that follow this one. */ if (ada_is_aligner_type (field_type)) { @@ -830,7 +931,7 @@ Index: gdb-8.0/gdb/ada-lang.c field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); -@@ -8444,11 +8446,11 @@ +@@ -8381,11 +8383,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) @@ -846,7 +947,7 @@ Index: gdb-8.0/gdb/ada-lang.c } else { -@@ -8915,7 +8917,8 @@ +@@ -8852,7 +8854,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, type was a regular (non-packed) array type. As a result, the bitsize of the array elements needs to be set again, and the array length needs to be recomputed based on that bitsize. */ @@ -856,11 +957,11 @@ Index: gdb-8.0/gdb/ada-lang.c int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); -Index: gdb-8.0/gdb/ada-lang.h -=================================================================== ---- gdb-8.0.orig/gdb/ada-lang.h 2017-08-19 20:04:59.786780510 +0200 -+++ gdb-8.0/gdb/ada-lang.h 2017-08-19 20:05:10.056876589 +0200 -@@ -168,7 +168,7 @@ +diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h +index 0530e9aacd..3230de7940 100644 +--- a/gdb/ada-lang.h ++++ b/gdb/ada-lang.h +@@ -174,7 +174,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); @@ -869,7 +970,7 @@ Index: gdb-8.0/gdb/ada-lang.h struct ui_file *, int, struct value *, const struct value_print_options *); -@@ -183,7 +183,7 @@ +@@ -189,7 +189,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); extern void ada_printchar (int, struct type *, struct ui_file *); extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, @@ -878,7 +979,7 @@ Index: gdb-8.0/gdb/ada-lang.h const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, -@@ -255,7 +255,7 @@ +@@ -261,7 +261,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, @@ -887,11 +988,11 @@ Index: gdb-8.0/gdb/ada-lang.h struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); -Index: gdb-8.0/gdb/ada-typeprint.c -=================================================================== ---- gdb-8.0.orig/gdb/ada-typeprint.c 2017-08-19 20:04:59.786780510 +0200 -+++ gdb-8.0/gdb/ada-typeprint.c 2017-08-19 20:05:10.057876598 +0200 -@@ -891,8 +891,8 @@ +diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c +index 9d23302865..e437cf1a0e 100644 +--- a/gdb/ada-typeprint.c ++++ b/gdb/ada-typeprint.c +@@ -896,8 +896,8 @@ ada_print_type (struct type *type0, const char *varstring, const char *name = ada_type_name (type); if (!ada_is_range_type_name (name)) @@ -902,7 +1003,7 @@ Index: gdb-8.0/gdb/ada-typeprint.c else { fprintf_filtered (stream, "range "); -@@ -913,7 +913,8 @@ +@@ -918,7 +918,8 @@ ada_print_type (struct type *type0, const char *varstring, } break; case TYPE_CODE_FLT: @@ -912,12 +1013,12 @@ Index: gdb-8.0/gdb/ada-typeprint.c break; case TYPE_CODE_ENUM: if (show < 0) -Index: gdb-8.0/gdb/ada-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/ada-valprint.c 2017-08-19 20:04:59.787780520 +0200 -+++ gdb-8.0/gdb/ada-valprint.c 2017-08-19 20:05:10.057876598 +0200 -@@ -33,11 +33,11 @@ - #include "objfiles.h" +diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c +index 91dc301af5..4aa4d7a79f 100644 +--- a/gdb/ada-valprint.c ++++ b/gdb/ada-valprint.c +@@ -34,11 +34,11 @@ + #include "target-float.h" static int print_field_values (struct type *, const gdb_byte *, - int, @@ -930,7 +1031,7 @@ Index: gdb-8.0/gdb/ada-valprint.c const struct language_defn *); -@@ -279,7 +279,7 @@ +@@ -280,7 +280,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream, of a character. */ static int @@ -939,7 +1040,7 @@ Index: gdb-8.0/gdb/ada-valprint.c enum bfd_endian byte_order) { if (type_len == 1) -@@ -439,11 +439,11 @@ +@@ -440,11 +440,11 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) static void printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, @@ -953,7 +1054,7 @@ Index: gdb-8.0/gdb/ada-valprint.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -458,9 +458,9 @@ +@@ -459,9 +459,9 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, { /* Position of the character we are examining to see whether it is repeated. */ @@ -965,7 +1066,7 @@ Index: gdb-8.0/gdb/ada-valprint.c QUIT; -@@ -491,7 +491,8 @@ +@@ -492,7 +492,8 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, ada_emit_char (char_at (string, i, type_len, byte_order), elttype, stream, '\'', type_len); fputs_filtered ("'", stream); @@ -975,7 +1076,7 @@ Index: gdb-8.0/gdb/ada-valprint.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -@@ -519,7 +520,7 @@ +@@ -520,7 +521,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, void ada_printstr (struct ui_file *stream, struct type *type, @@ -984,7 +1085,7 @@ Index: gdb-8.0/gdb/ada-valprint.c const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -529,12 +530,12 @@ +@@ -530,12 +531,12 @@ ada_printstr (struct ui_file *stream, struct type *type, static int print_variant_part (struct type *type, int field_num, @@ -999,7 +1100,7 @@ Index: gdb-8.0/gdb/ada-valprint.c const struct language_defn *language) { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); -@@ -570,11 +571,11 @@ +@@ -571,11 +572,11 @@ print_variant_part (struct type *type, int field_num, static int print_field_values (struct type *type, const gdb_byte *valaddr, @@ -1013,7 +1114,7 @@ Index: gdb-8.0/gdb/ada-valprint.c const struct language_defn *language) { int i, len; -@@ -640,7 +641,7 @@ +@@ -641,7 +642,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, else { struct value *v; @@ -1022,7 +1123,7 @@ Index: gdb-8.0/gdb/ada-valprint.c int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; -@@ -685,8 +686,8 @@ +@@ -686,8 +687,8 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); struct type *elttype = TYPE_TARGET_TYPE (type); @@ -1033,7 +1134,7 @@ Index: gdb-8.0/gdb/ada-valprint.c /* We know that ELTTYPE cannot possibly be null, because we assume that we're called only when TYPE is a string-like type. -@@ -705,7 +706,7 @@ +@@ -706,7 +707,7 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, elements up to it. */ if (options->stop_print_at_null) { @@ -1042,7 +1143,7 @@ Index: gdb-8.0/gdb/ada-valprint.c /* Look for a NULL char. */ for (temp_len = 0; -@@ -1072,7 +1073,7 @@ +@@ -1079,7 +1080,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr, static void ada_val_print_1 (struct type *type, @@ -1051,7 +1152,7 @@ Index: gdb-8.0/gdb/ada-valprint.c struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, -@@ -1156,7 +1157,7 @@ +@@ -1163,7 +1164,7 @@ ada_val_print_1 (struct type *type, void ada_val_print (struct type *type, @@ -1060,11 +1161,40 @@ Index: gdb-8.0/gdb/ada-valprint.c struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options) -Index: gdb-8.0/gdb/annotate.c -=================================================================== ---- gdb-8.0.orig/gdb/annotate.c 2017-08-19 20:04:59.787780520 +0200 -+++ gdb-8.0/gdb/annotate.c 2017-08-19 20:05:10.057876598 +0200 -@@ -533,21 +533,21 @@ +diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c +index 81fbe52795..6f998d2303 100644 +--- a/gdb/amd64-tdep.c ++++ b/gdb/amd64-tdep.c +@@ -727,7 +727,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, + gdb_byte *readbuf, const gdb_byte *writebuf) + { + enum amd64_reg_class theclass[2]; +- int len = TYPE_LENGTH (type); ++ LONGEST len = TYPE_LENGTH (type); + static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; + static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; + int integer_reg = 0; +@@ -843,11 +843,13 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, + + gdb_assert (regnum != -1); + ++ LONGEST nlen = len < 8 ? len : 8; ++ + if (readbuf) +- regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8), ++ regcache_raw_read_part (regcache, regnum, offset, nlen, + readbuf + i * 8); + if (writebuf) +- regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8), ++ regcache_raw_write_part (regcache, regnum, offset, nlen, + writebuf + i * 8); + } + +diff --git a/gdb/annotate.c b/gdb/annotate.c +index 6a02f73299..4c609672e0 100644 +--- a/gdb/annotate.c ++++ b/gdb/annotate.c +@@ -531,21 +531,21 @@ annotate_frame_end (void) } void @@ -1090,11 +1220,11 @@ Index: gdb-8.0/gdb/annotate.c } void -Index: gdb-8.0/gdb/annotate.h -=================================================================== ---- gdb-8.0.orig/gdb/annotate.h 2017-08-19 20:04:59.788780529 +0200 -+++ gdb-8.0/gdb/annotate.h 2017-08-19 20:05:10.058876607 +0200 -@@ -92,8 +92,8 @@ +diff --git a/gdb/annotate.h b/gdb/annotate.h +index 8a9a64147d..91a4bcbe9a 100644 +--- a/gdb/annotate.h ++++ b/gdb/annotate.h +@@ -102,8 +102,8 @@ extern void annotate_frame_source_end (void); extern void annotate_frame_where (void); extern void annotate_frame_end (void); @@ -1105,11 +1235,37 @@ Index: gdb-8.0/gdb/annotate.h extern void annotate_elt_rep_end (void); extern void annotate_elt (void); extern void annotate_array_section_end (void); -Index: gdb-8.0/gdb/arm-linux-nat.c -=================================================================== ---- gdb-8.0.orig/gdb/arm-linux-nat.c 2017-08-19 20:04:59.788780529 +0200 -+++ gdb-8.0/gdb/arm-linux-nat.c 2017-08-19 20:05:10.058876607 +0200 -@@ -1067,7 +1067,7 @@ +diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c +index 6c0e0b3276..b22034322b 100644 +--- a/gdb/arch-utils.c ++++ b/gdb/arch-utils.c +@@ -228,7 +228,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch, + + const struct floatformat ** + default_floatformat_for_type (struct gdbarch *gdbarch, +- const char *name, int len) ++ const char *name, LONGEST len) + { + const struct floatformat **format = NULL; + +diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h +index 6d3c3629ef..51a67e69f3 100644 +--- a/gdb/arch-utils.h ++++ b/gdb/arch-utils.h +@@ -131,7 +131,7 @@ extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer; + /* Default implementation of gdbarch_floatformat_for_type. */ + extern const struct floatformat ** + default_floatformat_for_type (struct gdbarch *gdbarch, +- const char *name, int len); ++ const char *name, LONGEST len); + + extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame, + CORE_ADDR pc); +diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c +index cc7a67a402..b5732cb48e 100644 +--- a/gdb/arm-linux-nat.c ++++ b/gdb/arm-linux-nat.c +@@ -1067,7 +1067,7 @@ arm_linux_remove_hw_breakpoint (struct target_ops *self, ADDR? */ static int arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -1118,11 +1274,11 @@ Index: gdb-8.0/gdb/arm-linux-nat.c { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); CORE_ADDR max_wp_length, aligned_addr; -Index: gdb-8.0/gdb/ax-gdb.c -=================================================================== ---- gdb-8.0.orig/gdb/ax-gdb.c 2017-08-19 20:04:59.789780538 +0200 -+++ gdb-8.0/gdb/ax-gdb.c 2017-08-19 20:05:10.059876617 +0200 -@@ -83,12 +83,12 @@ +diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c +index 5027f6a464..c2ef7baa48 100644 +--- a/gdb/ax-gdb.c ++++ b/gdb/ax-gdb.c +@@ -82,12 +82,12 @@ static void gen_traced_pop (struct agent_expr *, struct axs_value *); static void gen_sign_extend (struct agent_expr *, struct type *); static void gen_extend (struct agent_expr *, struct type *); static void gen_fetch (struct agent_expr *, struct type *); @@ -1130,33 +1286,31 @@ Index: gdb-8.0/gdb/ax-gdb.c +static void gen_left_shift (struct agent_expr *, LONGEST); - static void gen_frame_args_address (struct gdbarch *, struct agent_expr *); - static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *); + static void gen_frame_args_address (struct agent_expr *); + static void gen_frame_locals_address (struct agent_expr *); -static void gen_offset (struct agent_expr *ax, int offset); +static void gen_offset (struct agent_expr *ax, LONGEST offset); static void gen_sym_offset (struct agent_expr *, struct symbol *); - static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, - struct axs_value *value, struct symbol *var); -@@ -137,15 +137,15 @@ - static void gen_address_of (struct agent_expr *, struct axs_value *); - static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, - struct axs_value *value, + static void gen_var_ref (struct agent_expr *ax, struct axs_value *value, + struct symbol *var); +@@ -132,13 +132,13 @@ static void gen_complement (struct agent_expr *ax, struct axs_value *value); + static void gen_deref (struct axs_value *); + static void gen_address_of (struct axs_value *); + static void gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value, - struct type *type, int start, int end); + struct type *type, LONGEST start, LONGEST end); - static void gen_primitive_field (struct expression *exp, - struct agent_expr *ax, + static void gen_primitive_field (struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type); + LONGEST offset, int fieldno, struct type *type); - static int gen_struct_ref_recursive (struct expression *exp, - struct agent_expr *ax, + static int gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value, - const char *field, int offset, + const char *field, LONGEST offset, struct type *type); - static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, + static void gen_struct_ref (struct agent_expr *ax, struct axs_value *value, -@@ -541,7 +541,7 @@ +@@ -529,7 +529,7 @@ gen_fetch (struct agent_expr *ax, struct type *type) right shift it by -DISTANCE bits if DISTANCE < 0. This generates unsigned (logical) right shifts. */ static void @@ -1165,7 +1319,7 @@ Index: gdb-8.0/gdb/ax-gdb.c { if (distance > 0) { -@@ -595,7 +595,7 @@ +@@ -583,7 +583,7 @@ gen_frame_locals_address (struct agent_expr *ax) programming in ML, it would be clearer why these are the same thing. */ static void @@ -1174,16 +1328,16 @@ Index: gdb-8.0/gdb/ax-gdb.c { /* It would suffice to simply push the offset and add it, but this makes it easier to read positive and negative offsets in the -@@ -1251,7 +1251,7 @@ +@@ -1254,7 +1254,7 @@ gen_address_of (struct axs_value *value) + structure. */ static void - gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, - struct axs_value *value, struct type *type, -- int start, int end) -+ LONGEST start, LONGEST end) + gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value, +- struct type *type, int start, int end) ++ struct type *type, LONGEST start, LONGEST end) { /* Note that ops[i] fetches 8 << i bits. */ static enum agent_op ops[] -@@ -1286,13 +1286,13 @@ +@@ -1289,13 +1289,13 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value, /* The first and one-after-last bits in the field, but rounded down and up to byte boundaries. */ @@ -1202,29 +1356,29 @@ Index: gdb-8.0/gdb/ax-gdb.c /* The index in ops of the opcode we're considering. */ int op; -@@ -1411,7 +1411,7 @@ +@@ -1413,7 +1413,7 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value, + static void - gen_primitive_field (struct expression *exp, - struct agent_expr *ax, struct axs_value *value, + gen_primitive_field (struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type) + LONGEST offset, int fieldno, struct type *type) { /* Is this a bitfield? */ if (TYPE_FIELD_PACKED (type, fieldno)) -@@ -1436,7 +1436,7 @@ +@@ -1437,7 +1437,7 @@ gen_primitive_field (struct agent_expr *ax, struct axs_value *value, + static int - gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, - struct axs_value *value, + gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value, - const char *field, int offset, struct type *type) + const char *field, LONGEST offset, struct type *type) { int i, rslt; int nbases = TYPE_N_BASECLASSES (type); -Index: gdb-8.0/gdb/ax-general.c -=================================================================== ---- gdb-8.0.orig/gdb/ax-general.c 2017-08-19 20:04:59.789780538 +0200 -+++ gdb-8.0/gdb/ax-general.c 2017-08-19 20:05:10.059876617 +0200 -@@ -177,7 +177,7 @@ +diff --git a/gdb/ax-general.c b/gdb/ax-general.c +index e07a469797..35298dd686 100644 +--- a/gdb/ax-general.c ++++ b/gdb/ax-general.c +@@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n) /* Append a trace_quick instruction to EXPR, to record N bytes. */ void @@ -1233,11 +1387,11 @@ Index: gdb-8.0/gdb/ax-general.c { /* N must fit in a byte. */ if (n < 0 || n > 255) -Index: gdb-8.0/gdb/ax.h -=================================================================== ---- gdb-8.0.orig/gdb/ax.h 2017-08-19 20:04:59.789780538 +0200 -+++ gdb-8.0/gdb/ax.h 2017-08-19 20:05:10.059876617 +0200 -@@ -205,7 +205,7 @@ +diff --git a/gdb/ax.h b/gdb/ax.h +index 066c5ee21e..e407b5b665 100644 +--- a/gdb/ax.h ++++ b/gdb/ax.h +@@ -193,7 +193,7 @@ extern void ax_ext (struct agent_expr *EXPR, int N); extern void ax_zero_ext (struct agent_expr *EXPR, int N); /* Append a trace_quick instruction to EXPR, to record N bytes. */ @@ -1246,11 +1400,11 @@ Index: gdb-8.0/gdb/ax.h /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or aop_if_goto). We assume we don't know the target offset yet, -Index: gdb-8.0/gdb/breakpoint.c -=================================================================== ---- gdb-8.0.orig/gdb/breakpoint.c 2017-08-19 20:04:59.792780566 +0200 -+++ gdb-8.0/gdb/breakpoint.c 2017-08-19 20:05:10.063876654 +0200 -@@ -2225,9 +2225,9 @@ +diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c +index fb129bf38a..7f47af941c 100644 +--- a/gdb/breakpoint.c ++++ b/gdb/breakpoint.c +@@ -2068,9 +2068,9 @@ should_be_inserted (struct bp_location *bl) { fprintf_unfiltered (gdb_stdlog, "infrun: stepping past non-steppable watchpoint. " @@ -1262,16 +1416,16 @@ Index: gdb-8.0/gdb/breakpoint.c } return 0; } -@@ -7151,7 +7151,7 @@ - +@@ -6866,7 +6866,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, static int - breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1, -- int len1, struct address_space *aspace2, -+ LONGEST len1, struct address_space *aspace2, + breakpoint_address_match_range (const address_space *aspace1, + CORE_ADDR addr1, +- int len1, const address_space *aspace2, ++ LONGEST len1, const address_space *aspace2, CORE_ADDR addr2) { return ((gdbarch_has_global_breakpoints (target_gdbarch ()) -@@ -11444,7 +11444,7 @@ +@@ -10993,7 +10993,7 @@ can_use_hardware_watchpoint (struct value *v) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); @@ -1280,11 +1434,11 @@ Index: gdb-8.0/gdb/breakpoint.c int num_regs; len = (target_exact_watchpoints -Index: gdb-8.0/gdb/breakpoint.h -=================================================================== ---- gdb-8.0.orig/gdb/breakpoint.h 2017-08-19 20:04:59.793780576 +0200 -+++ gdb-8.0/gdb/breakpoint.h 2017-08-19 20:05:10.063876654 +0200 -@@ -250,7 +250,7 @@ +diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h +index eed2c968f2..48e28a8fec 100644 +--- a/gdb/breakpoint.h ++++ b/gdb/breakpoint.h +@@ -252,7 +252,7 @@ struct bp_target_info /* If this is a ranged breakpoint, then this field contains the length of the range that will be watched for execution. */ @@ -1293,20 +1447,20 @@ Index: gdb-8.0/gdb/breakpoint.h /* If the breakpoint lives in memory and reading that memory would give back the breakpoint, instead of the original contents, then -@@ -422,7 +422,7 @@ +@@ -429,7 +429,7 @@ public: /* For hardware watchpoints, the size of the memory region being watched. For hardware ranged breakpoints, the size of the breakpoint range. */ -- int length; -+ LONGEST length; +- int length = 0; ++ LONGEST length = 0; /* Type of hardware watchpoint. */ - enum target_hw_bp_type watchpoint_type; -Index: gdb-8.0/gdb/c-lang.c -=================================================================== ---- gdb-8.0.orig/gdb/c-lang.c 2017-08-19 20:04:59.793780576 +0200 -+++ gdb-8.0/gdb/c-lang.c 2017-08-19 20:05:10.064876663 +0200 -@@ -186,7 +186,7 @@ + target_hw_bp_type watchpoint_type {}; +diff --git a/gdb/c-lang.c b/gdb/c-lang.c +index 8d96f94cbb..ec956f45c2 100644 +--- a/gdb/c-lang.c ++++ b/gdb/c-lang.c +@@ -184,7 +184,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream) void c_printstr (struct ui_file *stream, struct type *type, @@ -1315,7 +1469,7 @@ Index: gdb-8.0/gdb/c-lang.c const char *user_encoding, int force_ellipses, const struct value_print_options *options) { -@@ -672,7 +672,7 @@ +@@ -666,7 +666,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, } else { @@ -1324,7 +1478,7 @@ Index: gdb-8.0/gdb/c-lang.c /* Write the terminating character. */ for (i = 0; i < TYPE_LENGTH (type); ++i) -@@ -681,7 +681,7 @@ +@@ -675,7 +675,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, if (satisfy_expected) { LONGEST low_bound, high_bound; @@ -1333,11 +1487,11 @@ Index: gdb-8.0/gdb/c-lang.c if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), &low_bound, &high_bound) < 0) -Index: gdb-8.0/gdb/c-lang.h -=================================================================== ---- gdb-8.0.orig/gdb/c-lang.h 2017-08-19 20:04:59.793780576 +0200 -+++ gdb-8.0/gdb/c-lang.h 2017-08-19 20:05:10.064876663 +0200 -@@ -77,7 +77,7 @@ +diff --git a/gdb/c-lang.h b/gdb/c-lang.h +index 5ce64861c4..7b851880b7 100644 +--- a/gdb/c-lang.h ++++ b/gdb/c-lang.h +@@ -77,7 +77,7 @@ extern void c_print_typedef (struct type *, struct ui_file *); extern void c_val_print (struct type *, @@ -1346,7 +1500,7 @@ Index: gdb-8.0/gdb/c-lang.h struct ui_file *, int, struct value *, const struct value_print_options *); -@@ -97,7 +97,7 @@ +@@ -97,7 +97,7 @@ extern void c_printchar (int, struct type *, struct ui_file *); extern void c_printstr (struct ui_file * stream, struct type *elttype, const gdb_byte *string, @@ -1355,11 +1509,11 @@ Index: gdb-8.0/gdb/c-lang.h const char *user_encoding, int force_ellipses, const struct value_print_options *options); -Index: gdb-8.0/gdb/c-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/c-valprint.c 2017-08-19 20:04:59.794780585 +0200 -+++ gdb-8.0/gdb/c-valprint.c 2017-08-19 20:05:10.064876663 +0200 -@@ -244,7 +244,7 @@ +diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c +index 96e6c597cf..046469d7a4 100644 +--- a/gdb/c-valprint.c ++++ b/gdb/c-valprint.c +@@ -244,7 +244,7 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr, if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0) { LONGEST low_bound, high_bound; @@ -1368,7 +1522,7 @@ Index: gdb-8.0/gdb/c-valprint.c struct gdbarch *gdbarch = get_type_arch (type); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); unsigned int i = 0; /* Number of characters printed. */ -@@ -318,8 +318,8 @@ +@@ -318,8 +318,8 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr, if (cp_is_vtbl_ptr_type (elttype)) { i = 1; @@ -1379,7 +1533,7 @@ Index: gdb-8.0/gdb/c-valprint.c } else { -@@ -396,7 +396,7 @@ +@@ -396,7 +396,7 @@ c_val_print_struct (struct type *type, const gdb_byte *valaddr, -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ struct gdbarch *gdbarch = get_type_arch (type); @@ -1388,7 +1542,7 @@ Index: gdb-8.0/gdb/c-valprint.c + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8); struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); -@@ -495,7 +495,7 @@ +@@ -495,7 +495,7 @@ c_val_print_memberptr (struct type *type, const gdb_byte *valaddr, void c_val_print (struct type *type, @@ -1397,11 +1551,29 @@ Index: gdb-8.0/gdb/c-valprint.c struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options) -Index: gdb-8.0/gdb/cp-abi.c -=================================================================== ---- gdb-8.0.orig/gdb/cp-abi.c 2017-08-19 20:04:59.794780585 +0200 -+++ gdb-8.0/gdb/cp-abi.c 2017-08-19 20:05:10.065876673 +0200 -@@ -64,12 +64,12 @@ +diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c +index 6f759abb54..14fcec34ac 100644 +--- a/gdb/compile/compile-c-support.c ++++ b/gdb/compile/compile-c-support.c +@@ -307,11 +307,11 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch, + + default: + fprintf_unfiltered (stream, +- " unsigned char %s[%d]" ++ " unsigned char %s[%s]" + " __attribute__((__aligned__(" + "__BIGGEST_ALIGNMENT__)))", + regname.c_str (), +- TYPE_LENGTH (regtype)); ++ pulongest (TYPE_LENGTH (regtype))); + } + fputs_unfiltered (";\n", stream); + } +diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c +index 11b8424856..199cdac26e 100644 +--- a/gdb/cp-abi.c ++++ b/gdb/cp-abi.c +@@ -64,12 +64,12 @@ is_operator_name (const char *name) return (*current_cp_abi.is_operator_name) (name); } @@ -1416,7 +1588,7 @@ Index: gdb-8.0/gdb/cp-abi.c gdb_assert (current_cp_abi.baseclass_offset != NULL); -@@ -96,7 +96,7 @@ +@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, struct value * value_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, @@ -1425,11 +1597,11 @@ Index: gdb-8.0/gdb/cp-abi.c { if ((current_cp_abi.virtual_fn_field) == NULL) return NULL; -Index: gdb-8.0/gdb/cp-abi.h -=================================================================== ---- gdb-8.0.orig/gdb/cp-abi.h 2017-08-19 20:04:59.794780585 +0200 -+++ gdb-8.0/gdb/cp-abi.h 2017-08-19 20:05:10.065876673 +0200 -@@ -108,7 +108,7 @@ +diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h +index 6b82eacd01..154c4c83b1 100644 +--- a/gdb/cp-abi.h ++++ b/gdb/cp-abi.h +@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, struct fn_field *f, int j, struct type *type, @@ -1438,7 +1610,7 @@ Index: gdb-8.0/gdb/cp-abi.h /* Try to find the run-time type of VALUE, using C++ run-time type -@@ -144,11 +144,11 @@ +@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (struct value *value, contents of VAL. The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ @@ -1455,7 +1627,7 @@ Index: gdb-8.0/gdb/cp-abi.h /* Describe the target of a pointer to method. CONTENTS is the byte pattern representing the pointer to method. TYPE is the pointer to -@@ -226,12 +226,12 @@ +@@ -226,12 +226,12 @@ struct cp_abi_ops struct value *(*virtual_fn_field) (struct value **arg1p, struct fn_field * f, int j, struct type * type, @@ -1472,11 +1644,11 @@ Index: gdb-8.0/gdb/cp-abi.h void (*print_method_ptr) (const gdb_byte *contents, struct type *type, struct ui_file *stream); -Index: gdb-8.0/gdb/cp-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/cp-valprint.c 2017-08-19 20:04:59.794780585 +0200 -+++ gdb-8.0/gdb/cp-valprint.c 2017-08-19 20:05:10.065876673 +0200 -@@ -336,7 +336,7 @@ +diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c +index 609dabb660..38beb4d62a 100644 +--- a/gdb/cp-valprint.c ++++ b/gdb/cp-valprint.c +@@ -335,7 +335,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, } else if (i == vptr_fieldno && type == vptr_basetype) { @@ -1485,11 +1657,11 @@ Index: gdb-8.0/gdb/cp-valprint.c struct type *i_type = TYPE_FIELD_TYPE (type, i); if (valprint_check_validity (stream, i_type, i_offset, val)) -Index: gdb-8.0/gdb/d-lang.h -=================================================================== ---- gdb-8.0.orig/gdb/d-lang.h 2017-08-19 20:04:59.794780585 +0200 -+++ gdb-8.0/gdb/d-lang.h 2017-08-19 20:05:10.065876673 +0200 -@@ -81,7 +81,7 @@ +diff --git a/gdb/d-lang.h b/gdb/d-lang.h +index f47050aa30..69d4829de6 100644 +--- a/gdb/d-lang.h ++++ b/gdb/d-lang.h +@@ -81,7 +81,7 @@ extern struct block_symbol d_lookup_nested_symbol (struct type *, const char *, /* Defined in d-valprint.c */ extern void d_val_print (struct type *type, @@ -1498,11 +1670,11 @@ Index: gdb-8.0/gdb/d-lang.h struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options); -Index: gdb-8.0/gdb/d-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/d-valprint.c 2017-08-19 20:04:59.794780585 +0200 -+++ gdb-8.0/gdb/d-valprint.c 2017-08-19 20:05:10.065876673 +0200 -@@ -73,7 +73,7 @@ +diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c +index 9e18b22ff1..48770b65a8 100644 +--- a/gdb/d-valprint.c ++++ b/gdb/d-valprint.c +@@ -73,7 +73,7 @@ dynamic_array_type (struct type *type, /* Implements the la_val_print routine for language D. */ void @@ -1511,12 +1683,12 @@ Index: gdb-8.0/gdb/d-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options) -Index: gdb-8.0/gdb/dwarf2loc.c -=================================================================== ---- gdb-8.0.orig/gdb/dwarf2loc.c 2017-08-19 20:04:59.796780604 +0200 -+++ gdb-8.0/gdb/dwarf2loc.c 2017-08-19 20:07:00.692911605 +0200 -@@ -1826,7 +1826,7 @@ - for (; i < c->n_pieces && offset < max_offset; i++) +diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c +index d2742bbd91..d40a52c4e0 100644 +--- a/gdb/dwarf2loc.c ++++ b/gdb/dwarf2loc.c +@@ -1818,7 +1818,7 @@ rw_pieced_value (struct value *v, struct value *from) + for (; i < c->pieces.size () && offset < max_offset; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits, this_size; @@ -1524,7 +1696,7 @@ Index: gdb-8.0/gdb/dwarf2loc.c this_size_bits = p->size - bits_to_skip; if (this_size_bits > max_offset - offset) -@@ -2073,7 +2073,7 @@ +@@ -2065,7 +2065,7 @@ write_pieced_value (struct value *to, struct value *from) static int check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, @@ -1533,8 +1705,8 @@ Index: gdb-8.0/gdb/dwarf2loc.c { struct piece_closure *c = (struct piece_closure *) value_computed_closure (value); -@@ -2086,7 +2086,7 @@ - for (i = 0; i < c->n_pieces && bit_length > 0; i++) +@@ -2078,7 +2078,7 @@ check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, + for (i = 0; i < c->pieces.size () && bit_length > 0; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits = p->size; @@ -1542,7 +1714,7 @@ Index: gdb-8.0/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2194,8 +2194,8 @@ +@@ -2181,8 +2181,8 @@ indirect_pieced_value (struct value *value) struct type *type; struct frame_info *frame; struct dwarf2_locexpr_baton baton; @@ -1553,8 +1725,8 @@ Index: gdb-8.0/gdb/dwarf2loc.c struct dwarf_expr_piece *piece = NULL; LONGEST byte_offset; enum bfd_endian byte_order; -@@ -2212,7 +2212,7 @@ - for (i = 0; i < c->n_pieces && bit_length > 0; i++) +@@ -2199,7 +2199,7 @@ indirect_pieced_value (struct value *value) + for (i = 0; i < c->pieces.size () && bit_length > 0; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits = p->size; @@ -1562,7 +1734,7 @@ Index: gdb-8.0/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2503,9 +2503,9 @@ +@@ -2489,9 +2489,9 @@ if (frame != NULL) select_frame (frame); case DWARF_VALUE_STACK: { struct value *value = ctx.fetch (0); @@ -1573,13 +1745,13 @@ Index: gdb-8.0/gdb/dwarf2loc.c + ULONGEST len = TYPE_LENGTH (subobj_type); + ULONGEST max = TYPE_LENGTH (type); struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile); - struct cleanup *cleanup; -Index: gdb-8.0/gdb/dwarf2read.c -=================================================================== ---- gdb-8.0.orig/gdb/dwarf2read.c 2017-08-19 20:04:59.800780641 +0200 -+++ gdb-8.0/gdb/dwarf2read.c 2017-08-19 20:05:10.072876738 +0200 -@@ -2064,12 +2064,12 @@ + if (subobj_byte_offset + len > max) +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index 72d15a94d8..f14f5b563a 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -2165,12 +2165,12 @@ dwarf2_complex_location_expr_complaint (void) } static void @@ -1596,7 +1768,7 @@ Index: gdb-8.0/gdb/dwarf2read.c } static void -@@ -12863,8 +12863,8 @@ +@@ -13910,8 +13910,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ @@ -1607,11 +1779,11 @@ Index: gdb-8.0/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr) -Index: gdb-8.0/gdb/eval.c -=================================================================== ---- gdb-8.0.orig/gdb/eval.c 2017-08-19 20:04:59.801780651 +0200 -+++ gdb-8.0/gdb/eval.c 2017-08-19 20:05:10.073876748 +0200 -@@ -297,7 +297,8 @@ +diff --git a/gdb/eval.c b/gdb/eval.c +index 44f7a4edfe..f3acca6a69 100644 +--- a/gdb/eval.c ++++ b/gdb/eval.c +@@ -302,7 +302,8 @@ evaluate_struct_tuple (struct value *struct_val, while (--nargs >= 0) { struct value *val = NULL; @@ -1621,7 +1793,7 @@ Index: gdb-8.0/gdb/eval.c bfd_byte *addr; fieldno++; -@@ -358,7 +359,7 @@ +@@ -363,7 +364,7 @@ init_array_element (struct value *array, struct value *element, enum noside noside, LONGEST low_bound, LONGEST high_bound) { LONGEST index; @@ -1630,7 +1802,7 @@ Index: gdb-8.0/gdb/eval.c if (exp->elts[*pos].opcode == BINOP_COMMA) { -@@ -802,11 +803,11 @@ +@@ -807,11 +808,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, /* FIXME: Also mixed integral/booleans, with result an integer. */ { const struct builtin_type *builtin = builtin_type (gdbarch); @@ -1645,16 +1817,16 @@ Index: gdb-8.0/gdb/eval.c int unsigned_operation; /* Determine type length and signedness after promotion for -@@ -988,7 +989,7 @@ +@@ -1548,7 +1549,7 @@ evaluate_subexp_standard (struct type *expect_type, struct value **argvec; int code; int ix; - long mem_offset; + LONGEST mem_offset; struct type **arg_types; - int save_pos1; - struct symbol *function = NULL; -@@ -1167,7 +1168,7 @@ + + pc = (*pos)++; +@@ -1731,7 +1732,7 @@ evaluate_subexp_standard (struct type *expect_type, struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); @@ -1663,11 +1835,11 @@ Index: gdb-8.0/gdb/eval.c LONGEST low_bound, high_bound, index; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -Index: gdb-8.0/gdb/f-lang.c -=================================================================== ---- gdb-8.0.orig/gdb/f-lang.c 2017-08-19 20:04:59.801780651 +0200 -+++ gdb-8.0/gdb/f-lang.c 2017-08-19 20:05:10.073876748 +0200 -@@ -103,7 +103,7 @@ +diff --git a/gdb/f-lang.c b/gdb/f-lang.c +index fe909ff0f0..c6403bfb15 100644 +--- a/gdb/f-lang.c ++++ b/gdb/f-lang.c +@@ -101,7 +101,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream) static void f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, @@ -1676,11 +1848,11 @@ Index: gdb-8.0/gdb/f-lang.c const struct value_print_options *options) { const char *type_encoding = f_get_encoding (type); -Index: gdb-8.0/gdb/f-lang.h -=================================================================== ---- gdb-8.0.orig/gdb/f-lang.h 2017-08-19 20:04:59.802780660 +0200 -+++ gdb-8.0/gdb/f-lang.h 2017-08-19 20:05:10.073876748 +0200 -@@ -30,7 +30,7 @@ +diff --git a/gdb/f-lang.h b/gdb/f-lang.h +index 5633b4121d..fb00f37486 100644 +--- a/gdb/f-lang.h ++++ b/gdb/f-lang.h +@@ -30,7 +30,7 @@ extern void f_yyerror (const char *); /* Defined in f-exp.y */ extern void f_print_type (struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *); @@ -1689,12 +1861,12 @@ Index: gdb-8.0/gdb/f-lang.h struct ui_file *, int, struct value *, const struct value_print_options *); -Index: gdb-8.0/gdb/f-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/f-valprint.c 2017-08-19 20:04:59.802780660 +0200 -+++ gdb-8.0/gdb/f-valprint.c 2017-08-19 20:05:10.073876748 +0200 -@@ -38,7 +38,7 @@ - static void info_common_command (char *, int); +diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c +index b878d52b62..4ce78b1d52 100644 +--- a/gdb/f-valprint.c ++++ b/gdb/f-valprint.c +@@ -36,7 +36,7 @@ + static void f77_get_dynamic_length_of_aggregate (struct type *); -int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; @@ -1702,7 +1874,7 @@ Index: gdb-8.0/gdb/f-valprint.c /* Array which holds offsets to be applied to get a row's elements for a given array. Array also holds the size of each subarray. */ -@@ -73,8 +73,8 @@ +@@ -71,8 +71,8 @@ f77_get_upperbound (struct type *type) static void f77_get_dynamic_length_of_aggregate (struct type *type) { @@ -1713,7 +1885,7 @@ Index: gdb-8.0/gdb/f-valprint.c /* Recursively go all the way down into a possibly multi-dimensional F77 array and get the bounds. For simple arrays, this is pretty -@@ -106,7 +106,7 @@ +@@ -104,7 +104,7 @@ f77_get_dynamic_length_of_aggregate (struct type *type) static void f77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, @@ -1722,7 +1894,7 @@ Index: gdb-8.0/gdb/f-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -115,7 +115,7 @@ +@@ -113,7 +113,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type)); CORE_ADDR addr = address + embedded_offset; LONGEST lowerbound, upperbound; @@ -1731,7 +1903,7 @@ Index: gdb-8.0/gdb/f-valprint.c get_discrete_bounds (range_type, &lowerbound, &upperbound); -@@ -177,7 +177,7 @@ +@@ -175,7 +175,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, static void f77_print_array (struct type *type, const gdb_byte *valaddr, @@ -1740,7 +1912,7 @@ Index: gdb-8.0/gdb/f-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -216,7 +216,7 @@ +@@ -214,7 +214,7 @@ static const struct generic_val_print_decorations f_decorations = function; they are identical. */ void @@ -1749,11 +1921,11 @@ Index: gdb-8.0/gdb/f-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options) -Index: gdb-8.0/gdb/findvar.c -=================================================================== ---- gdb-8.0.orig/gdb/findvar.c 2017-08-19 20:04:59.802780660 +0200 -+++ gdb-8.0/gdb/findvar.c 2017-08-19 20:05:10.074876757 +0200 -@@ -817,7 +817,7 @@ +diff --git a/gdb/findvar.c b/gdb/findvar.c +index 2bc2095bf7..ced8418659 100644 +--- a/gdb/findvar.c ++++ b/gdb/findvar.c +@@ -821,7 +821,7 @@ struct value * default_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id) { @@ -1762,7 +1934,7 @@ Index: gdb-8.0/gdb/findvar.c struct value *value = allocate_value (type); struct frame_info *frame; -@@ -861,7 +861,7 @@ +@@ -865,7 +865,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) LONGEST offset = 0; LONGEST reg_offset = value_offset (value); int regnum = VALUE_REGNUM (value); @@ -1771,7 +1943,7 @@ Index: gdb-8.0/gdb/findvar.c gdb_assert (VALUE_LVAL (value) == lval_register); -@@ -876,7 +876,7 @@ +@@ -880,7 +880,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); @@ -1780,11 +1952,11 @@ Index: gdb-8.0/gdb/findvar.c /* If the register length is larger than the number of bytes remaining to copy, then only copy the appropriate bytes. */ -Index: gdb-8.0/gdb/frame.c -=================================================================== ---- gdb-8.0.orig/gdb/frame.c 2017-08-19 20:04:59.803780669 +0200 -+++ gdb-8.0/gdb/frame.c 2017-08-19 20:05:10.074876757 +0200 -@@ -1375,7 +1375,7 @@ +diff --git a/gdb/frame.c b/gdb/frame.c +index e643823716..95e6b23254 100644 +--- a/gdb/frame.c ++++ b/gdb/frame.c +@@ -1386,7 +1386,7 @@ deprecated_frame_register_read (struct frame_info *frame, int regnum, int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -1793,7 +1965,7 @@ Index: gdb-8.0/gdb/frame.c int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -1404,7 +1404,7 @@ +@@ -1415,7 +1415,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum, } if (len > maxsize) error (_("Bad debug information detected: " @@ -1802,11 +1974,11 @@ Index: gdb-8.0/gdb/frame.c /* Copy the data. */ while (len > 0) -Index: gdb-8.0/gdb/frame.h -=================================================================== ---- gdb-8.0.orig/gdb/frame.h 2017-08-19 20:04:59.803780669 +0200 -+++ gdb-8.0/gdb/frame.h 2017-08-19 20:05:10.074876757 +0200 -@@ -600,7 +600,7 @@ +diff --git a/gdb/frame.h b/gdb/frame.h +index 0ed7a14d03..4705805c6e 100644 +--- a/gdb/frame.h ++++ b/gdb/frame.h +@@ -601,7 +601,7 @@ extern void put_frame_register (struct frame_info *frame, int regnum, contents are optimized out or unavailable, set *OPTIMIZEDP, *UNAVAILABLEP accordingly. */ extern int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -1815,20 +1987,61 @@ Index: gdb-8.0/gdb/frame.h gdb_byte *myaddr, int *optimizedp, int *unavailablep); -Index: gdb-8.0/gdb/gdbtypes.c -=================================================================== ---- gdb-8.0.orig/gdb/gdbtypes.c 2017-08-19 20:04:59.804780679 +0200 -+++ gdb-8.0/gdb/gdbtypes.c 2017-08-19 20:05:10.075876766 +0200 -@@ -2807,7 +2807,7 @@ +diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c +index 007392cd6a..de8db19c44 100644 +--- a/gdb/gdbarch.c ++++ b/gdb/gdbarch.c +@@ -1805,7 +1805,7 @@ set_gdbarch_wchar_signed (struct gdbarch *gdbarch, + } + + const struct floatformat ** +-gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length) ++gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length) + { + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->floatformat_for_type != NULL); +diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h +index d2e6b6f63e..cbf3385db7 100644 +--- a/gdb/gdbarch.h ++++ b/gdb/gdbarch.h +@@ -198,8 +198,8 @@ extern void set_gdbarch_wchar_signed (struct gdbarch *gdbarch, int wchar_signed) + NAME, if non-NULL, is the type name, which may be used to distinguish + different target formats of the same length. */ + +-typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length); +-extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length); ++typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length); ++extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length); + extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type); + + /* For most targets, a pointer on the target and its representation as an +diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh +index 6459b12747..0b72aceea1 100755 +--- a/gdb/gdbarch.sh ++++ b/gdb/gdbarch.sh +@@ -388,7 +388,7 @@ v;int;wchar_signed;;;1;-1;1 + # Returns the floating-point format to be used for values of length LENGTH. + # NAME, if non-NULL, is the type name, which may be used to distinguish + # different target formats of the same length. +-m;const struct floatformat **;floatformat_for_type;const char *name, int length;name, length;0;default_floatformat_for_type;;0 ++m;const struct floatformat **;floatformat_for_type;const char *name, LONGEST length;name, length;0;default_floatformat_for_type;;0 + + # For most targets, a pointer on the target and its representation as an + # address in GDB have the same size and "look the same". For such a +diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c +index a25e0a84e9..775f120845 100644 +--- a/gdb/gdbtypes.c ++++ b/gdb/gdbtypes.c +@@ -2818,7 +2818,7 @@ floatformat_from_type (const struct type *type) least as long as OBJFILE. */ struct type * --init_type (struct objfile *objfile, enum type_code code, int length, -+init_type (struct objfile *objfile, enum type_code code, LONGEST length, +-init_type (struct objfile *objfile, enum type_code code, int bit, ++init_type (struct objfile *objfile, enum type_code code, LONGEST bit, const char *name) { struct type *type; -@@ -3116,8 +3116,8 @@ +@@ -3150,8 +3150,8 @@ is_public_ancestor (struct type *base, struct type *dclass) static int is_unique_ancestor_worker (struct type *base, struct type *dclass, @@ -1839,7 +2052,7 @@ Index: gdb-8.0/gdb/gdbtypes.c CORE_ADDR address, struct value *val) { int i, count = 0; -@@ -3128,7 +3128,7 @@ +@@ -3162,7 +3162,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; @@ -1848,7 +2061,7 @@ Index: gdb-8.0/gdb/gdbtypes.c iter = check_typedef (TYPE_BASECLASS (dclass, i)); -@@ -3169,7 +3169,7 @@ +@@ -3203,7 +3203,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, int is_unique_ancestor (struct type *base, struct value *val) { @@ -1857,7 +2070,7 @@ Index: gdb-8.0/gdb/gdbtypes.c return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), -@@ -4415,7 +4415,7 @@ +@@ -4449,7 +4449,7 @@ recursive_dump_type (struct type *type, int spaces) break; } puts_filtered ("\n"); @@ -1866,20 +2079,20 @@ Index: gdb-8.0/gdb/gdbtypes.c if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); -@@ -4875,7 +4875,7 @@ +@@ -4890,7 +4890,7 @@ copy_type (const struct type *type) struct type * arch_type (struct gdbarch *gdbarch, -- enum type_code code, int length, const char *name) -+ enum type_code code, LONGEST length, const char *name) +- enum type_code code, int bit, const char *name) ++ enum type_code code, LONGEST bit, const char *name) { struct type *type; -Index: gdb-8.0/gdb/gdbtypes.h -=================================================================== ---- gdb-8.0.orig/gdb/gdbtypes.h 2017-08-19 20:04:59.805780688 +0200 -+++ gdb-8.0/gdb/gdbtypes.h 2017-08-19 20:05:10.076876776 +0200 -@@ -787,7 +787,7 @@ +diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h +index d92ffc228b..c7ecf30554 100644 +--- a/gdb/gdbtypes.h ++++ b/gdb/gdbtypes.h +@@ -782,7 +782,7 @@ struct type type_length_units function should be used in order to get the length expressed in target addressable memory units. */ @@ -1888,7 +2101,7 @@ Index: gdb-8.0/gdb/gdbtypes.h /* * Core type, shared by a group of qualified types. */ -@@ -1665,7 +1665,7 @@ +@@ -1662,7 +1662,7 @@ extern unsigned int type_length_units (struct type *type); /* * Helper function to construct objfile-owned types. */ @@ -1897,7 +2110,7 @@ Index: gdb-8.0/gdb/gdbtypes.h const char *); extern struct type *init_integer_type (struct objfile *, int, int, const char *); -@@ -1682,7 +1682,7 @@ +@@ -1679,7 +1679,7 @@ extern struct type *init_pointer_type (struct objfile *, int, const char *, struct type *); /* Helper functions to construct architecture-owned types. */ @@ -1906,11 +2119,11 @@ Index: gdb-8.0/gdb/gdbtypes.h const char *); extern struct type *arch_integer_type (struct gdbarch *, int, int, const char *); -Index: gdb-8.0/gdb/gnu-v2-abi.c -=================================================================== ---- gdb-8.0.orig/gdb/gnu-v2-abi.c 2017-08-19 20:04:59.805780688 +0200 -+++ gdb-8.0/gdb/gnu-v2-abi.c 2017-08-19 20:05:10.076876776 +0200 -@@ -82,7 +82,7 @@ +diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c +index c25b23089c..00c51c4b86 100644 +--- a/gdb/gnu-v2-abi.c ++++ b/gdb/gnu-v2-abi.c +@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name) TYPE is the type in which F is located. */ static struct value * gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, @@ -1919,7 +2132,7 @@ Index: gdb-8.0/gdb/gnu-v2-abi.c { struct value *arg1 = *arg1p; struct type *type1 = check_typedef (value_type (arg1)); -@@ -338,7 +338,7 @@ +@@ -338,7 +338,7 @@ vb_match (struct type *type, int index, struct type *basetype) target). The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ @@ -1928,7 +2141,7 @@ Index: gdb-8.0/gdb/gnu-v2-abi.c gnuv2_baseclass_offset (struct type *type, int index, const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) -@@ -358,8 +358,7 @@ +@@ -358,8 +358,7 @@ gnuv2_baseclass_offset (struct type *type, int index, if (vb_match (type, i, basetype)) { struct type *field_type; @@ -1938,7 +2151,7 @@ Index: gdb-8.0/gdb/gnu-v2-abi.c CORE_ADDR addr; field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); -@@ -383,7 +382,7 @@ +@@ -383,7 +382,7 @@ gnuv2_baseclass_offset (struct type *type, int index, /* Don't go through baseclass_offset, as that wraps exceptions, thus, inner exceptions would be wrapped more than once. */ @@ -1947,11 +2160,11 @@ Index: gdb-8.0/gdb/gnu-v2-abi.c gnuv2_baseclass_offset (type, i, valaddr, embedded_offset, address, val); -Index: gdb-8.0/gdb/gnu-v3-abi.c -=================================================================== ---- gdb-8.0.orig/gdb/gnu-v3-abi.c 2017-08-19 20:04:59.806780698 +0200 -+++ gdb-8.0/gdb/gnu-v3-abi.c 2017-08-19 20:05:10.077876785 +0200 -@@ -109,7 +109,7 @@ +diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c +index 2accc60efc..a42c4d487f 100644 +--- a/gdb/gnu-v3-abi.c ++++ b/gdb/gnu-v3-abi.c +@@ -109,7 +109,7 @@ build_gdb_vtable_type (struct gdbarch *arch) { struct type *t; struct field *field_list, *field; @@ -1960,7 +2173,7 @@ Index: gdb-8.0/gdb/gnu-v3-abi.c struct type *void_ptr_type = builtin_type (arch)->builtin_data_ptr; -@@ -185,7 +185,7 @@ +@@ -185,7 +185,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch) /* Return the offset from the start of the imaginary `struct gdb_gnu_v3_abi_vtable' object to the vtable's "address point" (i.e., where objects' virtual table pointers point). */ @@ -1969,7 +2182,7 @@ Index: gdb-8.0/gdb/gnu-v3-abi.c vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type -@@ -408,7 +408,7 @@ +@@ -408,7 +408,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, @@ -1978,7 +2191,7 @@ Index: gdb-8.0/gdb/gnu-v3-abi.c { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; -@@ -438,7 +438,7 @@ +@@ -438,7 +438,7 @@ gnuv3_virtual_fn_field (struct value **value_p, -1 is returned on error. */ @@ -1987,7 +2200,7 @@ Index: gdb-8.0/gdb/gnu-v3-abi.c gnuv3_baseclass_offset (struct type *type, int index, const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) -@@ -447,7 +447,7 @@ +@@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *type, int index, struct type *ptr_type; struct value *vtable; struct value *vbase_array; @@ -1996,7 +2209,7 @@ Index: gdb-8.0/gdb/gnu-v3-abi.c /* Determine architecture. */ gdbarch = get_type_arch (type); -@@ -470,7 +470,7 @@ +@@ -470,7 +470,7 @@ gnuv3_baseclass_offset (struct type *type, int index, cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) error (_("Misaligned vbase offset.")); @@ -2005,7 +2218,7 @@ Index: gdb-8.0/gdb/gnu-v3-abi.c vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); gdb_assert (vtable != NULL); -@@ -514,7 +514,7 @@ +@@ -514,7 +514,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { @@ -2014,11 +2227,11 @@ Index: gdb-8.0/gdb/gnu-v3-abi.c struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) -Index: gdb-8.0/gdb/go-lang.h -=================================================================== ---- gdb-8.0.orig/gdb/go-lang.h 2017-08-19 20:04:59.806780698 +0200 -+++ gdb-8.0/gdb/go-lang.h 2017-08-19 20:05:10.077876785 +0200 -@@ -85,7 +85,7 @@ +diff --git a/gdb/go-lang.h b/gdb/go-lang.h +index e08b2f0a80..5fb9b5d90d 100644 +--- a/gdb/go-lang.h ++++ b/gdb/go-lang.h +@@ -85,7 +85,7 @@ extern void go_print_type (struct type *type, const char *varstring, /* Defined in go-valprint.c. */ extern void go_val_print (struct type *type, @@ -2027,11 +2240,11 @@ Index: gdb-8.0/gdb/go-lang.h struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options); -Index: gdb-8.0/gdb/go-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/go-valprint.c 2017-08-19 20:04:59.806780698 +0200 -+++ gdb-8.0/gdb/go-valprint.c 2017-08-19 20:05:10.077876785 +0200 -@@ -86,7 +86,7 @@ +diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c +index 77d37387ad..896a71911e 100644 +--- a/gdb/go-valprint.c ++++ b/gdb/go-valprint.c +@@ -86,7 +86,7 @@ print_go_string (struct type *type, /* Implements the la_val_print routine for language Go. */ void @@ -2040,11 +2253,24 @@ Index: gdb-8.0/gdb/go-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options) -Index: gdb-8.0/gdb/language.c -=================================================================== ---- gdb-8.0.orig/gdb/language.c 2017-08-19 20:04:59.806780698 +0200 -+++ gdb-8.0/gdb/language.c 2017-08-19 20:05:10.077876785 +0200 -@@ -753,7 +753,7 @@ +diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c +index 290b1c8368..d4f61eec76 100644 +--- a/gdb/i386-tdep.c ++++ b/gdb/i386-tdep.c +@@ -8175,7 +8175,7 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, + + const struct floatformat ** + i386_floatformat_for_type (struct gdbarch *gdbarch, +- const char *name, int len) ++ const char *name, LONGEST len) + { + if (len == 128 && name) + if (strcmp (name, "__float128") == 0 +diff --git a/gdb/language.c b/gdb/language.c +index c3872fc9a6..a851f4c966 100644 +--- a/gdb/language.c ++++ b/gdb/language.c +@@ -766,7 +766,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) static void unk_lang_printstr (struct ui_file *stream, struct type *type, @@ -2053,7 +2279,7 @@ Index: gdb-8.0/gdb/language.c const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -772,7 +772,7 @@ +@@ -785,7 +785,7 @@ unk_lang_print_type (struct type *type, const char *varstring, static void unk_lang_val_print (struct type *type, @@ -2062,11 +2288,11 @@ Index: gdb-8.0/gdb/language.c struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options) -Index: gdb-8.0/gdb/language.h -=================================================================== ---- gdb-8.0.orig/gdb/language.h 2017-08-19 20:04:59.806780698 +0200 -+++ gdb-8.0/gdb/language.h 2017-08-19 20:05:10.077876785 +0200 -@@ -197,7 +197,7 @@ +diff --git a/gdb/language.h b/gdb/language.h +index 47ad8da05d..0c4e53f0de 100644 +--- a/gdb/language.h ++++ b/gdb/language.h +@@ -188,7 +188,7 @@ struct language_defn struct ui_file * stream); void (*la_printstr) (struct ui_file * stream, struct type *elttype, @@ -2075,7 +2301,7 @@ Index: gdb-8.0/gdb/language.h const char *encoding, int force_ellipses, const struct value_print_options *); -@@ -235,7 +235,7 @@ +@@ -226,7 +226,7 @@ struct language_defn printing. */ void (*la_val_print) (struct type *type, @@ -2084,11 +2310,11 @@ Index: gdb-8.0/gdb/language.h struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options); -Index: gdb-8.0/gdb/m2-lang.c -=================================================================== ---- gdb-8.0.orig/gdb/m2-lang.c 2017-08-19 20:04:59.807780707 +0200 -+++ gdb-8.0/gdb/m2-lang.c 2017-08-19 20:05:10.078876795 +0200 -@@ -104,10 +104,10 @@ +diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c +index 09050c0480..dab0136533 100644 +--- a/gdb/m2-lang.c ++++ b/gdb/m2-lang.c +@@ -103,10 +103,10 @@ m2_printchar (int c, struct type *type, struct ui_file *stream) static void m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, @@ -2101,7 +2327,7 @@ Index: gdb-8.0/gdb/m2-lang.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -122,9 +122,9 @@ +@@ -121,9 +121,9 @@ m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, { /* Position of the character we are examining to see whether it is repeated. */ @@ -2113,7 +2339,7 @@ Index: gdb-8.0/gdb/m2-lang.c QUIT; -@@ -150,7 +150,7 @@ +@@ -149,7 +149,7 @@ m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, in_quotes = 0; } m2_printchar (string[i], type, stream); @@ -2122,11 +2348,11 @@ Index: gdb-8.0/gdb/m2-lang.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -Index: gdb-8.0/gdb/m2-lang.h -=================================================================== ---- gdb-8.0.orig/gdb/m2-lang.h 2017-08-19 20:04:59.807780707 +0200 -+++ gdb-8.0/gdb/m2-lang.h 2017-08-19 20:05:10.078876795 +0200 -@@ -34,7 +34,7 @@ +diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h +index 30fddd7b4b..0764e7dd5a 100644 +--- a/gdb/m2-lang.h ++++ b/gdb/m2-lang.h +@@ -34,7 +34,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); @@ -2135,11 +2361,11 @@ Index: gdb-8.0/gdb/m2-lang.h struct ui_file *, int, struct value *, const struct value_print_options *); -Index: gdb-8.0/gdb/m2-typeprint.c -=================================================================== ---- gdb-8.0.orig/gdb/m2-typeprint.c 2017-08-19 20:04:59.807780707 +0200 -+++ gdb-8.0/gdb/m2-typeprint.c 2017-08-19 20:05:10.078876795 +0200 -@@ -234,9 +234,12 @@ +diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c +index 0dd6f19fc7..3701fbb728 100644 +--- a/gdb/m2-typeprint.c ++++ b/gdb/m2-typeprint.c +@@ -234,9 +234,12 @@ static void m2_array (struct type *type, struct ui_file *stream, m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); } else @@ -2155,11 +2381,11 @@ Index: gdb-8.0/gdb/m2-typeprint.c } fprintf_filtered (stream, "] OF "); m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags); -Index: gdb-8.0/gdb/m2-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/m2-valprint.c 2017-08-19 20:04:59.807780707 +0200 -+++ gdb-8.0/gdb/m2-valprint.c 2017-08-19 20:05:10.078876795 +0200 -@@ -35,7 +35,7 @@ +diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c +index 9660fe7c03..7127af26f2 100644 +--- a/gdb/m2-valprint.c ++++ b/gdb/m2-valprint.c +@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struct type *type, struct ui_file *stream); static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, @@ -2168,7 +2394,7 @@ Index: gdb-8.0/gdb/m2-valprint.c struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options, -@@ -67,7 +67,7 @@ +@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high) static void m2_print_long_set (struct type *type, const gdb_byte *valaddr, @@ -2177,7 +2403,7 @@ Index: gdb-8.0/gdb/m2-valprint.c struct ui_file *stream) { int empty_set = 1; -@@ -158,7 +158,7 @@ +@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr, static void m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, @@ -2186,7 +2412,7 @@ Index: gdb-8.0/gdb/m2-valprint.c struct ui_file *stream, int recurse, const struct value_print_options *options) { -@@ -260,7 +260,7 @@ +@@ -260,7 +260,7 @@ print_variable_at_address (struct type *type, static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, @@ -2195,7 +2421,7 @@ Index: gdb-8.0/gdb/m2-valprint.c struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options, -@@ -308,13 +308,13 @@ +@@ -308,13 +308,13 @@ static const struct generic_val_print_decorations m2_decorations = function; they are identical. */ void @@ -2211,7 +2437,7 @@ Index: gdb-8.0/gdb/m2-valprint.c struct type *elttype; CORE_ADDR addr; const gdb_byte *valaddr = value_contents_for_printing (original_value); -@@ -340,7 +340,7 @@ +@@ -340,7 +340,7 @@ m2_val_print (struct type *type, int embedded_offset, elements up to it. */ if (options->stop_print_at_null) { @@ -2220,7 +2446,7 @@ Index: gdb-8.0/gdb/m2-valprint.c /* Look for a NULL char. */ for (temp_len = 0; -@@ -416,7 +416,7 @@ +@@ -416,7 +416,7 @@ m2_val_print (struct type *type, int embedded_offset, { struct type *range = elttype; LONGEST low_bound, high_bound; @@ -2229,10 +2455,10 @@ Index: gdb-8.0/gdb/m2-valprint.c int need_comma = 0; fputs_filtered ("{", stream); -Index: gdb-8.0/gdb/memrange.c -=================================================================== ---- gdb-8.0.orig/gdb/memrange.c 2017-08-19 20:04:59.807780707 +0200 -+++ gdb-8.0/gdb/memrange.c 2017-08-19 20:05:10.078876795 +0200 +diff --git a/gdb/memrange.c b/gdb/memrange.c +index 34feac53ab..002a359199 100644 +--- a/gdb/memrange.c ++++ b/gdb/memrange.c @@ -22,8 +22,8 @@ #include @@ -2244,11 +2470,20 @@ Index: gdb-8.0/gdb/memrange.c { ULONGEST h, l; -Index: gdb-8.0/gdb/memrange.h -=================================================================== ---- gdb-8.0.orig/gdb/memrange.h 2017-08-19 20:04:59.808780716 +0200 -+++ gdb-8.0/gdb/memrange.h 2017-08-19 20:05:10.079876804 +0200 -@@ -30,7 +30,7 @@ +diff --git a/gdb/memrange.h b/gdb/memrange.h +index fb10cda2b7..c6647b3211 100644 +--- a/gdb/memrange.h ++++ b/gdb/memrange.h +@@ -28,7 +28,7 @@ struct mem_range + { + mem_range () = default; + +- mem_range (CORE_ADDR start_, int length_) ++ mem_range (CORE_ADDR start_, LONGEST length_) + : start (start_), length (length_) + {} + +@@ -47,14 +47,14 @@ struct mem_range CORE_ADDR start; /* Length of the range. */ @@ -2256,8 +2491,6 @@ Index: gdb-8.0/gdb/memrange.h + LONGEST length; }; - typedef struct mem_range mem_range_s; -@@ -40,8 +40,8 @@ /* Returns true if the ranges defined by [start1, start1+len1) and [start2, start2+len2) overlap. */ @@ -2268,11 +2501,11 @@ Index: gdb-8.0/gdb/memrange.h /* Returns true if ADDR is in RANGE. */ -Index: gdb-8.0/gdb/mips-linux-nat.c -=================================================================== ---- gdb-8.0.orig/gdb/mips-linux-nat.c 2017-08-19 20:04:59.808780716 +0200 -+++ gdb-8.0/gdb/mips-linux-nat.c 2017-08-19 20:05:10.079876804 +0200 -@@ -584,7 +584,7 @@ +diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c +index e6ef5a6170..f95d167d30 100644 +--- a/gdb/mips-linux-nat.c ++++ b/gdb/mips-linux-nat.c +@@ -579,7 +579,7 @@ mips_linux_stopped_data_address (struct target_ops *t, CORE_ADDR *paddr) static int mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2281,11 +2514,46 @@ Index: gdb-8.0/gdb/mips-linux-nat.c { struct pt_watch_regs dummy_regs; int i; -Index: gdb-8.0/gdb/opencl-lang.c -=================================================================== ---- gdb-8.0.orig/gdb/opencl-lang.c 2017-08-19 20:04:59.808780716 +0200 -+++ gdb-8.0/gdb/opencl-lang.c 2017-08-19 20:05:10.079876804 +0200 -@@ -78,11 +78,11 @@ +diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c +index 478aa913e9..05ea2abf62 100644 +--- a/gdb/nat/x86-dregs.c ++++ b/gdb/nat/x86-dregs.c +@@ -380,7 +380,7 @@ x86_remove_aligned_watchpoint (struct x86_debug_reg_state *state, + + static int + x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state, +- x86_wp_op_t what, CORE_ADDR addr, int len, ++ x86_wp_op_t what, CORE_ADDR addr, LONGEST len, + enum target_hw_bp_type type) + { + int retval = 0; +@@ -548,7 +548,7 @@ x86_dr_remove_watchpoint (struct x86_debug_reg_state *state, + + int + x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) + { + int nregs; + +diff --git a/gdb/nat/x86-dregs.h b/gdb/nat/x86-dregs.h +index 7f7d70a678..9cf474db29 100644 +--- a/gdb/nat/x86-dregs.h ++++ b/gdb/nat/x86-dregs.h +@@ -116,7 +116,7 @@ extern int x86_dr_remove_watchpoint (struct x86_debug_reg_state *state, + /* Return non-zero if we can watch a memory region that starts at + address ADDR and whose length is LEN bytes. */ + extern int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state, +- CORE_ADDR addr, int len); ++ CORE_ADDR addr, LONGEST len); + + /* If the inferior has some break/watchpoint that triggered, set the + address associated with that break/watchpoint and return true. +diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c +index 12677605b2..262a4e7eb9 100644 +--- a/gdb/opencl-lang.c ++++ b/gdb/opencl-lang.c +@@ -76,11 +76,11 @@ builtin_opencl_type (struct gdbarch *gdbarch) static struct type * lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code, @@ -2299,7 +2567,7 @@ Index: gdb-8.0/gdb/opencl-lang.c struct type *type = NULL; struct type **types = builtin_opencl_type (gdbarch); -@@ -174,7 +174,7 @@ +@@ -172,7 +172,7 @@ lval_func_read (struct value *v) struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); LONGEST offset = value_offset (v); LONGEST elsize = TYPE_LENGTH (eltype); @@ -2308,7 +2576,7 @@ Index: gdb-8.0/gdb/opencl-lang.c LONGEST lowb = 0; LONGEST highb = 0; -@@ -203,7 +203,7 @@ +@@ -201,7 +201,7 @@ lval_func_write (struct value *v, struct value *fromval) struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); LONGEST offset = value_offset (v); LONGEST elsize = TYPE_LENGTH (eltype); @@ -2317,7 +2585,7 @@ Index: gdb-8.0/gdb/opencl-lang.c LONGEST lowb = 0; LONGEST highb = 0; -@@ -243,17 +243,17 @@ +@@ -241,17 +241,17 @@ lval_func_write (struct value *v, struct value *fromval) static int lval_func_check_synthetic_pointer (const struct value *v, @@ -2342,7 +2610,7 @@ Index: gdb-8.0/gdb/opencl-lang.c if (endrest) end++; -@@ -263,8 +263,8 @@ +@@ -261,8 +261,8 @@ lval_func_check_synthetic_pointer (const struct value *v, for (i = start; i < end; i++) { @@ -2353,11 +2621,11 @@ Index: gdb-8.0/gdb/opencl-lang.c if (!value_bits_synthetic_pointer (c->val, c->indices[i] * elsize + comp_offset, -Index: gdb-8.0/gdb/p-lang.c -=================================================================== ---- gdb-8.0.orig/gdb/p-lang.c 2017-08-19 20:04:59.808780716 +0200 -+++ gdb-8.0/gdb/p-lang.c 2017-08-19 20:05:10.079876804 +0200 -@@ -95,8 +95,8 @@ +diff --git a/gdb/p-lang.c b/gdb/p-lang.c +index e93c15b95f..5c8282b4e4 100644 +--- a/gdb/p-lang.c ++++ b/gdb/p-lang.c +@@ -93,8 +93,8 @@ pascal_main_name (void) are not multiple of TARGET_CHAR_BIT then the results are wrong but this does not happen for Free Pascal nor for GPC. */ int @@ -2368,7 +2636,7 @@ Index: gdb-8.0/gdb/p-lang.c struct type **char_type, const char **arrayname) { -@@ -216,12 +216,12 @@ +@@ -214,12 +214,12 @@ pascal_printchar (int c, struct type *type, struct ui_file *stream) void pascal_printstr (struct ui_file *stream, struct type *type, @@ -2383,7 +2651,7 @@ Index: gdb-8.0/gdb/p-lang.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -249,9 +249,9 @@ +@@ -247,9 +247,9 @@ pascal_printstr (struct ui_file *stream, struct type *type, { /* Position of the character we are examining to see whether it is repeated. */ @@ -2395,7 +2663,7 @@ Index: gdb-8.0/gdb/p-lang.c unsigned long int current_char; QUIT; -@@ -283,7 +283,7 @@ +@@ -281,7 +281,7 @@ pascal_printstr (struct ui_file *stream, struct type *type, in_quotes = 0; } pascal_printchar (current_char, type, stream); @@ -2404,11 +2672,11 @@ Index: gdb-8.0/gdb/p-lang.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -Index: gdb-8.0/gdb/p-lang.h -=================================================================== ---- gdb-8.0.orig/gdb/p-lang.h 2017-08-19 20:04:59.809780726 +0200 -+++ gdb-8.0/gdb/p-lang.h 2017-08-19 20:05:10.080876813 +0200 -@@ -36,7 +36,7 @@ +diff --git a/gdb/p-lang.h b/gdb/p-lang.h +index 1f82c1ac1f..dbe7703fd8 100644 +--- a/gdb/p-lang.h ++++ b/gdb/p-lang.h +@@ -36,7 +36,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); @@ -2417,7 +2685,7 @@ Index: gdb-8.0/gdb/p-lang.h CORE_ADDR, struct ui_file *, int, struct value *, const struct value_print_options *); -@@ -50,13 +50,13 @@ +@@ -50,13 +50,13 @@ extern void pascal_type_print_method_args (const char *, const char *, /* These are in p-lang.c: */ extern int @@ -2432,12 +2700,12 @@ Index: gdb-8.0/gdb/p-lang.h + ULONGEST, const char *, int, const struct value_print_options *); - extern struct type **const (pascal_builtin_types[]); -Index: gdb-8.0/gdb/p-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/p-valprint.c 2017-08-19 20:04:59.809780726 +0200 -+++ gdb-8.0/gdb/p-valprint.c 2017-08-19 20:05:10.080876813 +0200 -@@ -59,7 +59,7 @@ + extern struct type **const pascal_builtin_types[]; +diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c +index d12b63638b..3cdc847fe3 100644 +--- a/gdb/p-valprint.c ++++ b/gdb/p-valprint.c +@@ -60,7 +60,7 @@ static const struct generic_val_print_decorations p_decorations = void pascal_val_print (struct type *type, @@ -2446,7 +2714,7 @@ Index: gdb-8.0/gdb/p-valprint.c struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options) -@@ -70,8 +70,8 @@ +@@ -71,8 +71,8 @@ pascal_val_print (struct type *type, unsigned len; LONGEST low_bound, high_bound; struct type *elttype; @@ -2457,11 +2725,11 @@ Index: gdb-8.0/gdb/p-valprint.c struct type *char_type; CORE_ADDR addr; int want_space = 0; -Index: gdb-8.0/gdb/ppc-linux-nat.c -=================================================================== ---- gdb-8.0.orig/gdb/ppc-linux-nat.c 2017-08-19 20:04:59.809780726 +0200 -+++ gdb-8.0/gdb/ppc-linux-nat.c 2017-08-19 20:05:10.080876813 +0200 -@@ -1445,7 +1445,7 @@ +diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c +index f645221cb4..429b9c6231 100644 +--- a/gdb/ppc-linux-nat.c ++++ b/gdb/ppc-linux-nat.c +@@ -1445,7 +1445,7 @@ ppc_linux_can_use_hw_breakpoint (struct target_ops *self, static int ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2470,11 +2738,24 @@ Index: gdb-8.0/gdb/ppc-linux-nat.c { /* Handle sub-8-byte quantities. */ if (len <= 0) -Index: gdb-8.0/gdb/printcmd.c -=================================================================== ---- gdb-8.0.orig/gdb/printcmd.c 2017-08-19 20:04:59.810780735 +0200 -+++ gdb-8.0/gdb/printcmd.c 2017-08-19 20:05:10.081876823 +0200 -@@ -280,7 +280,7 @@ +diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c +index 0e43a64b69..20be2da63b 100644 +--- a/gdb/ppc-linux-tdep.c ++++ b/gdb/ppc-linux-tdep.c +@@ -1620,7 +1620,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, + + const struct floatformat ** + ppc_floatformat_for_type (struct gdbarch *gdbarch, +- const char *name, int len) ++ const char *name, LONGEST len) + { + if (len == 128 && name) + { +diff --git a/gdb/printcmd.c b/gdb/printcmd.c +index 38642641b9..d573fc909e 100644 +--- a/gdb/printcmd.c ++++ b/gdb/printcmd.c +@@ -277,7 +277,7 @@ print_formatted (struct value *val, int size, struct ui_file *stream) { struct type *type = check_typedef (value_type (val)); @@ -2483,20 +2764,20 @@ Index: gdb-8.0/gdb/printcmd.c if (VALUE_LVAL (val) == lval_memory) next_address = value_address (val) + len; -@@ -357,7 +357,7 @@ +@@ -353,7 +353,7 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, + int size, struct ui_file *stream) { struct gdbarch *gdbarch = get_type_arch (type); - LONGEST val_long = 0; - unsigned int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* String printing should go through val_print_scalar_formatted. */ -Index: gdb-8.0/gdb/procfs.c -=================================================================== ---- gdb-8.0.orig/gdb/procfs.c 2017-08-19 20:04:59.811780744 +0200 -+++ gdb-8.0/gdb/procfs.c 2017-08-19 20:05:10.082876832 +0200 -@@ -4864,7 +4864,7 @@ +diff --git a/gdb/procfs.c b/gdb/procfs.c +index 888dc695c5..1dd383aecb 100644 +--- a/gdb/procfs.c ++++ b/gdb/procfs.c +@@ -3399,7 +3399,7 @@ procfs_remove_watchpoint (struct target_ops *self, static int procfs_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2505,60 +2786,90 @@ Index: gdb-8.0/gdb/procfs.c { /* The man page for proc(4) on Solaris 2.6 and up says that the system can support "thousands" of hardware watchpoints, but gives -Index: gdb-8.0/gdb/regcache.c -=================================================================== ---- gdb-8.0.orig/gdb/regcache.c 2017-08-19 20:04:59.811780744 +0200 -+++ gdb-8.0/gdb/regcache.c 2017-08-19 20:05:10.082876832 +0200 -@@ -988,7 +988,7 @@ +diff --git a/gdb/regcache.c b/gdb/regcache.c +index ac905c6e49..7aea9df06a 100644 +--- a/gdb/regcache.c ++++ b/gdb/regcache.c +@@ -897,7 +897,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, + const void *buf); - static enum register_status - regcache_xfer_part (struct regcache *regcache, int regnum, -- int offset, int len, void *in, const void *out, -+ LONGEST offset, LONGEST len, void *in, const void *out, - enum register_status (*read) (struct regcache *regcache, - int regnum, - gdb_byte *buf), -@@ -1033,7 +1033,7 @@ + enum register_status +-regcache::xfer_part (int regnum, int offset, int len, void *in, ++regcache::xfer_part (int regnum, LONGEST offset, LONGEST len, void *in, + const void *out, bool is_raw) + { + struct gdbarch *gdbarch = arch (); +@@ -941,13 +941,13 @@ regcache::xfer_part (int regnum, int offset, int len, void *in, enum register_status regcache_raw_read_part (struct regcache *regcache, int regnum, - int offset, int len, gdb_byte *buf) + int offset, LONGEST len, gdb_byte *buf) { - struct regcache_descr *descr = regcache->descr; + return regcache->raw_read_part (regnum, offset, len, buf); + } -@@ -1044,7 +1044,7 @@ + enum register_status +-regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf) ++regcache::raw_read_part (int regnum, int offset, LONGEST len, gdb_byte *buf) + { + assert_regnum (regnum); + return xfer_part (regnum, offset, len, buf, NULL, true); +@@ -955,13 +955,13 @@ regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf) void regcache_raw_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf) + int offset, LONGEST len, const gdb_byte *buf) { - struct regcache_descr *descr = regcache->descr; + regcache->raw_write_part (regnum, offset, len, buf); + } -@@ -1055,7 +1055,7 @@ + void +-regcache::raw_write_part (int regnum, int offset, int len, ++regcache::raw_write_part (int regnum, int offset, LONGEST len, + const gdb_byte *buf) + { + assert_regnum (regnum); +@@ -970,14 +970,15 @@ regcache::raw_write_part (int regnum, int offset, int len, enum register_status regcache_cooked_read_part (struct regcache *regcache, int regnum, - int offset, int len, gdb_byte *buf) + LONGEST offset, LONGEST len, gdb_byte *buf) { - struct regcache_descr *descr = regcache->descr; + return regcache->cooked_read_part (regnum, offset, len, buf); + } -@@ -1066,7 +1066,7 @@ + + enum register_status +-regcache::cooked_read_part (int regnum, int offset, int len, gdb_byte *buf) ++regcache::cooked_read_part (int regnum, LONGEST offset, LONGEST len, ++ gdb_byte *buf) + { + gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers); + return xfer_part (regnum, offset, len, buf, NULL, false); +@@ -985,13 +986,13 @@ regcache::cooked_read_part (int regnum, int offset, int len, gdb_byte *buf) void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf) + LONGEST offset, LONGEST len, const gdb_byte *buf) { - struct regcache_descr *descr = regcache->descr; + regcache->cooked_write_part (regnum, offset, len, buf); + } -Index: gdb-8.0/gdb/regcache.h -=================================================================== ---- gdb-8.0.orig/gdb/regcache.h 2017-08-19 20:04:59.812780754 +0200 -+++ gdb-8.0/gdb/regcache.h 2017-08-19 20:05:10.083876841 +0200 -@@ -94,9 +94,9 @@ + void +-regcache::cooked_write_part (int regnum, int offset, int len, ++regcache::cooked_write_part (int regnum, LONGEST offset, LONGEST len, + const gdb_byte *buf) + { + gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers); +diff --git a/gdb/regcache.h b/gdb/regcache.h +index c5ef41b7a6..0d4f2cdccc 100644 +--- a/gdb/regcache.h ++++ b/gdb/regcache.h +@@ -82,9 +82,9 @@ extern void regcache_raw_set_cached_value extern enum register_status regcache_raw_read_part (struct regcache *regcache, int regnum, @@ -2570,7 +2881,7 @@ Index: gdb-8.0/gdb/regcache.h void regcache_invalidate (struct regcache *regcache, int regnum); -@@ -133,10 +133,11 @@ +@@ -121,10 +121,11 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, write style operations. */ enum register_status regcache_cooked_read_part (struct regcache *regcache, @@ -2585,11 +2896,42 @@ Index: gdb-8.0/gdb/regcache.h /* Special routines to read/write the PC. */ -Index: gdb-8.0/gdb/remote.c -=================================================================== ---- gdb-8.0.orig/gdb/remote.c 2017-08-19 20:04:59.814780772 +0200 -+++ gdb-8.0/gdb/remote.c 2017-08-19 20:05:10.085876860 +0200 -@@ -9915,7 +9915,7 @@ +@@ -302,15 +303,15 @@ public: + + void invalidate (int regnum); + +- enum register_status raw_read_part (int regnum, int offset, int len, ++ enum register_status raw_read_part (int regnum, int offset, LONGEST len, + gdb_byte *buf); + +- void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf); ++ void raw_write_part (int regnum, int offset, LONGEST len, const gdb_byte *buf); + +- enum register_status cooked_read_part (int regnum, int offset, int len, ++ enum register_status cooked_read_part (int regnum, LONGEST offset, LONGEST len, + gdb_byte *buf); + +- void cooked_write_part (int regnum, int offset, int len, ++ void cooked_write_part (int regnum, LONGEST offset, LONGEST len, + const gdb_byte *buf); + + void supply_regset (const struct regset *regset, +@@ -349,8 +350,8 @@ private: + + void restore (struct regcache *src); + +- enum register_status xfer_part (int regnum, int offset, int len, void *in, +- const void *out, bool is_raw); ++ enum register_status xfer_part (int regnum, LONGEST offset, LONGEST len, ++ void *in, const void *out, bool is_raw); + + void transfer_regset (const struct regset *regset, + struct regcache *out_regcache, +diff --git a/gdb/remote.c b/gdb/remote.c +index 0a62ae00e5..47d3a04dd9 100644 +--- a/gdb/remote.c ++++ b/gdb/remote.c +@@ -9964,7 +9964,7 @@ int remote_hw_breakpoint_limit = -1; static int remote_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2598,11 +2940,46 @@ Index: gdb-8.0/gdb/remote.c { if (remote_hw_watchpoint_length_limit == 0) return 0; -Index: gdb-8.0/gdb/spu-multiarch.c -=================================================================== ---- gdb-8.0.orig/gdb/spu-multiarch.c 2017-08-19 20:04:59.814780772 +0200 -+++ gdb-8.0/gdb/spu-multiarch.c 2017-08-19 20:05:10.085876860 +0200 -@@ -127,7 +127,7 @@ +diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c +index 1853f683e9..5d64976f61 100644 +--- a/gdb/rust-lang.c ++++ b/gdb/rust-lang.c +@@ -472,7 +472,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream) + + static void + rust_printstr (struct ui_file *stream, struct type *type, +- const gdb_byte *string, unsigned int length, ++ const gdb_byte *string, ULONGEST length, + const char *user_encoding, int force_ellipses, + const struct value_print_options *options) + { +@@ -618,7 +618,7 @@ static const struct generic_val_print_decorations rust_decorations = + /* la_val_print implementation for Rust. */ + + static void +-rust_val_print (struct type *type, int embedded_offset, ++rust_val_print (struct type *type, LONGEST embedded_offset, + CORE_ADDR address, struct ui_file *stream, int recurse, + struct value *val, + const struct value_print_options *options) +diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c +index 03b14a9ecc..2f84b41244 100644 +--- a/gdb/s390-linux-nat.c ++++ b/gdb/s390-linux-nat.c +@@ -921,7 +921,7 @@ s390_remove_hw_breakpoint (struct target_ops *self, + + static int + s390_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int cnt) ++ CORE_ADDR addr, LONGEST cnt) + { + return 1; + } +diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c +index 392995900e..a174bf5cb2 100644 +--- a/gdb/spu-multiarch.c ++++ b/gdb/spu-multiarch.c +@@ -128,7 +128,7 @@ spu_thread_architecture (struct target_ops *ops, ptid_t ptid) /* Override the to_region_ok_for_hw_watchpoint routine. */ static int spu_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2611,11 +2988,11 @@ Index: gdb-8.0/gdb/spu-multiarch.c { struct target_ops *ops_beneath = find_target_beneath (self); -Index: gdb-8.0/gdb/stack.c -=================================================================== ---- gdb-8.0.orig/gdb/stack.c 2017-08-19 20:04:59.815780782 +0200 -+++ gdb-8.0/gdb/stack.c 2017-08-19 20:05:10.086876869 +0200 -@@ -189,7 +189,7 @@ +diff --git a/gdb/stack.c b/gdb/stack.c +index 6bd0d45c32..b27fd158e7 100644 +--- a/gdb/stack.c ++++ b/gdb/stack.c +@@ -190,7 +190,7 @@ print_stack_frame (struct frame_info *frame, int print_level, argument (not just the first nameless argument). */ static void @@ -2624,7 +3001,7 @@ Index: gdb-8.0/gdb/stack.c int first, struct ui_file *stream) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -546,7 +546,7 @@ +@@ -540,7 +540,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, /* Offset of next stack argument beyond the one we have seen that is at the highest offset, or -1 if we haven't come to a stack argument yet. */ @@ -2633,7 +3010,7 @@ Index: gdb-8.0/gdb/stack.c /* Number of ints of arguments that we have printed so far. */ int args_printed = 0; /* True if we should print arguments, false otherwise. */ -@@ -575,8 +575,8 @@ +@@ -569,8 +569,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, case LOC_ARG: case LOC_REF_ARG: { @@ -2644,7 +3021,7 @@ Index: gdb-8.0/gdb/stack.c /* Compute address of next argument by adding the size of this argument and rounding to an int boundary. */ -@@ -711,7 +711,7 @@ +@@ -705,7 +705,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, enough about the stack to find them. */ if (num != -1) { @@ -2653,11 +3030,11 @@ Index: gdb-8.0/gdb/stack.c if (highest_offset == -1) start = gdbarch_frame_args_skip (get_frame_arch (frame)); -Index: gdb-8.0/gdb/symmisc.c -=================================================================== ---- gdb-8.0.orig/gdb/symmisc.c 2017-08-19 20:04:59.815780782 +0200 -+++ gdb-8.0/gdb/symmisc.c 2017-08-19 20:05:10.086876869 +0200 -@@ -604,11 +604,11 @@ +diff --git a/gdb/symmisc.c b/gdb/symmisc.c +index 96aa30f4fb..ea760e10e5 100644 +--- a/gdb/symmisc.c ++++ b/gdb/symmisc.c +@@ -585,11 +585,11 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, case LOC_CONST_BYTES: { @@ -2672,11 +3049,41 @@ Index: gdb-8.0/gdb/symmisc.c for (i = 0; i < TYPE_LENGTH (type); i++) fprintf_filtered (outfile, " %02x", (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); -Index: gdb-8.0/gdb/target.c -=================================================================== ---- gdb-8.0.orig/gdb/target.c 2017-08-19 20:04:59.816780791 +0200 -+++ gdb-8.0/gdb/target.c 2017-08-19 20:05:10.087876879 +0200 -@@ -57,7 +57,7 @@ +diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c +index 9691074bfe..04cadc1d4b 100644 +--- a/gdb/target-delegates.c ++++ b/gdb/target-delegates.c +@@ -760,14 +760,14 @@ debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, COR + } + + static int +-delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2) ++delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2) + { + self = self->beneath; + return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2); + } + + static int +-debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2) ++debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2) + { + int result; + fprintf_unfiltered (gdb_stdlog, "-> %s->to_region_ok_for_hw_watchpoint (...)\n", debug_target.to_shortname); +@@ -777,7 +777,7 @@ debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int + fputs_unfiltered (", ", gdb_stdlog); + target_debug_print_CORE_ADDR (arg1); + fputs_unfiltered (", ", gdb_stdlog); +- target_debug_print_int (arg2); ++ target_debug_print_LONGEST (arg2); + fputs_unfiltered (") = ", gdb_stdlog); + target_debug_print_int (result); + fputs_unfiltered ("\n", gdb_stdlog); +diff --git a/gdb/target.c b/gdb/target.c +index 3bfc8b5aef..c9471f61fb 100644 +--- a/gdb/target.c ++++ b/gdb/target.c +@@ -56,7 +56,7 @@ static int default_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); static int default_region_ok_for_hw_watchpoint (struct target_ops *, @@ -2685,7 +3092,7 @@ Index: gdb-8.0/gdb/target.c static void default_rcmd (struct target_ops *, const char *, struct ui_file *); -@@ -3228,7 +3228,7 @@ +@@ -3112,7 +3112,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename) static int default_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2694,11 +3101,11 @@ Index: gdb-8.0/gdb/target.c { return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT); } -Index: gdb-8.0/gdb/target.h -=================================================================== ---- gdb-8.0.orig/gdb/target.h 2017-08-19 20:04:59.816780791 +0200 -+++ gdb-8.0/gdb/target.h 2017-08-19 20:05:10.088876888 +0200 -@@ -555,7 +555,7 @@ +diff --git a/gdb/target.h b/gdb/target.h +index 999541d5d2..349e87de6f 100644 +--- a/gdb/target.h ++++ b/gdb/target.h +@@ -550,7 +550,7 @@ struct target_ops /* Documentation of this routine is provided with the corresponding target_* macro. */ int (*to_region_ok_for_hw_watchpoint) (struct target_ops *, @@ -2707,11 +3114,11 @@ Index: gdb-8.0/gdb/target.h TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); int (*to_can_accel_watchpoint_condition) (struct target_ops *, -Index: gdb-8.0/gdb/tracepoint.c -=================================================================== ---- gdb-8.0.orig/gdb/tracepoint.c 2017-08-19 20:04:59.817780800 +0200 -+++ gdb-8.0/gdb/tracepoint.c 2017-08-19 20:05:10.088876888 +0200 -@@ -904,10 +904,10 @@ +diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c +index 76d05dfc13..dd94ea8c8a 100644 +--- a/gdb/tracepoint.c ++++ b/gdb/tracepoint.c +@@ -852,10 +852,10 @@ collection_list::add_register (unsigned int regno) void collection_list::add_memrange (struct gdbarch *gdbarch, int type, bfd_signed_vma base, @@ -2724,7 +3131,7 @@ Index: gdb-8.0/gdb/tracepoint.c /* type: memrange_absolute == memory, other n == basereg */ /* base: addr if memory, offset if reg relative. */ -@@ -927,7 +927,7 @@ +@@ -875,7 +875,7 @@ collection_list::collect_symbol (struct symbol *sym, CORE_ADDR scope, int trace_string) { @@ -2733,7 +3140,7 @@ Index: gdb-8.0/gdb/tracepoint.c unsigned int reg; bfd_signed_vma offset; int treat_as_expr = 0; -@@ -948,8 +948,8 @@ +@@ -896,8 +896,8 @@ collection_list::collect_symbol (struct symbol *sym, offset = SYMBOL_VALUE_ADDRESS (sym); if (info_verbose) { @@ -2744,7 +3151,7 @@ Index: gdb-8.0/gdb/tracepoint.c paddress (gdbarch, offset)); } /* A struct may be a C++ class with static fields, go to general -@@ -981,9 +981,9 @@ +@@ -929,9 +929,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -2756,7 +3163,7 @@ Index: gdb-8.0/gdb/tracepoint.c paddress (gdbarch, offset), reg); } add_memrange (gdbarch, reg, offset, len); -@@ -993,9 +993,9 @@ +@@ -941,9 +941,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = 0; if (info_verbose) { @@ -2768,7 +3175,7 @@ Index: gdb-8.0/gdb/tracepoint.c paddress (gdbarch, offset), reg); } add_memrange (gdbarch, reg, offset, len); -@@ -1005,9 +1005,9 @@ +@@ -953,9 +953,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -2780,17 +3187,17 @@ Index: gdb-8.0/gdb/tracepoint.c paddress (gdbarch, offset), reg); } add_memrange (gdbarch, reg, offset, len); -@@ -2585,7 +2585,8 @@ +@@ -2500,7 +2500,8 @@ info_scope_command (const char *args_in, int from_tty) const char *symname; - char *save_args = args; + const char *save_args = args_in; struct block_iterator iter; - int j, count = 0; + int count = 0; + LONGEST j; struct gdbarch *gdbarch; int regno; - -@@ -2727,8 +2728,11 @@ + const char *args = args_in; +@@ -2644,8 +2645,11 @@ info_scope_command (const char *args_in, int from_tty) } } if (SYMBOL_TYPE (sym)) @@ -2804,11 +3211,24 @@ Index: gdb-8.0/gdb/tracepoint.c } if (BLOCK_FUNCTION (block)) break; -Index: gdb-8.0/gdb/valarith.c -=================================================================== ---- gdb-8.0.orig/gdb/valarith.c 2017-08-19 20:04:59.818780810 +0200 -+++ gdb-8.0/gdb/valarith.c 2017-08-19 20:05:10.089876897 +0200 -@@ -188,7 +188,7 @@ +diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h +index 60caa7ad39..f67079cdcf 100644 +--- a/gdb/tracepoint.h ++++ b/gdb/tracepoint.h +@@ -255,7 +255,7 @@ public: + void add_register (unsigned int regno); + void add_memrange (struct gdbarch *gdbarch, + int type, bfd_signed_vma base, +- unsigned long len); ++ ULONGEST len); + void collect_symbol (struct symbol *sym, + struct gdbarch *gdbarch, + long frame_regno, long frame_offset, +diff --git a/gdb/valarith.c b/gdb/valarith.c +index 59af9fcde4..90024302bc 100644 +--- a/gdb/valarith.c ++++ b/gdb/valarith.c +@@ -184,7 +184,7 @@ value_subscript (struct value *array, LONGEST index) to doubles, but no longer does. */ struct value * @@ -2817,7 +3237,7 @@ Index: gdb-8.0/gdb/valarith.c { struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); -@@ -665,7 +665,7 @@ +@@ -661,7 +661,7 @@ value_concat (struct value *arg1, struct value *arg2) struct value *inval1; struct value *inval2; struct value *outval = NULL; @@ -2826,7 +3246,7 @@ Index: gdb-8.0/gdb/valarith.c int count, idx; char *ptr; char inchar; -@@ -1518,7 +1518,7 @@ +@@ -1422,7 +1422,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) int value_logical_not (struct value *arg1) { @@ -2835,7 +3255,7 @@ Index: gdb-8.0/gdb/valarith.c const gdb_byte *p; struct type *type1; -@@ -1549,11 +1549,11 @@ +@@ -1450,11 +1450,11 @@ value_logical_not (struct value *arg1) static int value_strcmp (struct value *arg1, struct value *arg2) { @@ -2850,11 +3270,11 @@ Index: gdb-8.0/gdb/valarith.c for (i = 0; i < len; i++) { -Index: gdb-8.0/gdb/valops.c -=================================================================== ---- gdb-8.0.orig/gdb/valops.c 2017-08-19 20:04:59.819780819 +0200 -+++ gdb-8.0/gdb/valops.c 2017-08-19 20:05:10.090876907 +0200 -@@ -79,7 +79,7 @@ +diff --git a/gdb/valops.c b/gdb/valops.c +index 30623efc6e..a7c3613d84 100644 +--- a/gdb/valops.c ++++ b/gdb/valops.c +@@ -80,7 +80,7 @@ oload_classification classify_oload_match (struct badness_vector *, int, int); static struct value *value_struct_elt_for_reference (struct type *, @@ -2863,7 +3283,7 @@ Index: gdb-8.0/gdb/valops.c const char *, struct type *, int, enum noside); -@@ -183,7 +183,7 @@ +@@ -182,7 +182,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) space. */ struct value * @@ -2872,7 +3292,7 @@ Index: gdb-8.0/gdb/valops.c { struct objfile *objf; struct value *val = find_function_in_inferior ("malloc", &objf); -@@ -393,12 +393,12 @@ +@@ -397,12 +397,12 @@ value_cast (struct type *type, struct value *arg2) if (code1 == TYPE_CODE_ARRAY) { struct type *element_type = TYPE_TARGET_TYPE (type); @@ -2887,7 +3307,7 @@ Index: gdb-8.0/gdb/valops.c LONGEST low_bound, high_bound, new_length; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -1065,7 +1065,7 @@ +@@ -1054,7 +1054,7 @@ value_assign (struct value *toval, struct value *fromval) { const gdb_byte *dest_buffer; CORE_ADDR changed_addr; @@ -2896,7 +3316,7 @@ Index: gdb-8.0/gdb/valops.c gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) -@@ -3340,7 +3340,7 @@ +@@ -3325,7 +3325,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) the form "DOMAIN::NAME". */ static struct value * @@ -2905,7 +3325,7 @@ Index: gdb-8.0/gdb/valops.c struct type *curtype, const char *name, struct type *intype, int want_address, -@@ -3374,7 +3374,7 @@ +@@ -3359,7 +3359,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), @@ -2914,7 +3334,7 @@ Index: gdb-8.0/gdb/valops.c else if (noside != EVAL_NORMAL) return allocate_value (TYPE_FIELD_TYPE (t, i)); else -@@ -3542,7 +3542,7 @@ +@@ -3532,7 +3532,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; @@ -2923,7 +3343,7 @@ Index: gdb-8.0/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; -@@ -3691,7 +3691,7 @@ +@@ -3681,7 +3681,7 @@ value_rtti_indirect_type (struct value *v, int *full, struct value * value_full_object (struct value *argp, struct type *rtype, @@ -2932,11 +3352,11 @@ Index: gdb-8.0/gdb/valops.c int xusing_enc) { struct type *real_type; -Index: gdb-8.0/gdb/valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/valprint.c 2017-08-19 20:04:59.820780828 +0200 -+++ gdb-8.0/gdb/valprint.c 2017-08-19 20:05:10.090876907 +0200 -@@ -933,7 +933,7 @@ +diff --git a/gdb/valprint.c b/gdb/valprint.c +index 20e3a4178b..e34874c461 100644 +--- a/gdb/valprint.c ++++ b/gdb/valprint.c +@@ -882,7 +882,7 @@ generic_val_print_complex (struct type *type, void generic_val_print (struct type *type, @@ -2945,16 +3365,16 @@ Index: gdb-8.0/gdb/valprint.c struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, -@@ -1873,7 +1873,7 @@ +@@ -1776,7 +1776,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, -- unsigned len, enum bfd_endian byte_order) -+ ULONGEST len, enum bfd_endian byte_order) +- unsigned len, enum bfd_endian byte_order, ++ ULONGEST len, enum bfd_endian byte_order, + bool zero_pad) { const gdb_byte *p; - -@@ -1995,17 +1995,17 @@ +@@ -1929,17 +1929,17 @@ val_print_array_elements (struct type *type, int recurse, struct value *val, const struct value_print_options *options, @@ -2977,7 +3397,7 @@ Index: gdb-8.0/gdb/valprint.c LONGEST low_bound, high_bound; LONGEST low_pos, high_pos; -@@ -2095,7 +2095,7 @@ +@@ -2029,7 +2029,7 @@ val_print_array_elements (struct type *type, address, stream, recurse + 1, val, options, current_language); annotate_elt_rep (reps); @@ -2986,7 +3406,7 @@ Index: gdb-8.0/gdb/valprint.c annotate_elt_rep_end (); i = rep1 - 1; -@@ -2747,7 +2747,7 @@ +@@ -2675,7 +2675,7 @@ print_converted_chars_to_obstack (struct obstack *obstack, void generic_printstr (struct ui_file *stream, struct type *type, @@ -2995,29 +3415,29 @@ Index: gdb-8.0/gdb/valprint.c const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options) -Index: gdb-8.0/gdb/valprint.h -=================================================================== ---- gdb-8.0.orig/gdb/valprint.h 2017-08-19 20:04:59.820780828 +0200 -+++ gdb-8.0/gdb/valprint.h 2017-08-19 20:05:10.090876907 +0200 -@@ -119,7 +119,7 @@ +diff --git a/gdb/valprint.h b/gdb/valprint.h +index 302626d9d6..a92acfacec 100644 +--- a/gdb/valprint.h ++++ b/gdb/valprint.h +@@ -119,7 +119,7 @@ extern void val_print_array_elements (struct type *, LONGEST, CORE_ADDR, struct ui_file *, int, struct value *, const struct value_print_options *, - unsigned int); + ULONGEST); - extern void val_print_type_code_int (struct type *, const gdb_byte *, - struct ui_file *); -@@ -141,7 +141,7 @@ - unsigned int, enum bfd_endian); + extern void val_print_scalar_formatted (struct type *, + LONGEST, +@@ -138,7 +138,7 @@ extern void print_decimal_chars (struct ui_file *, const gdb_byte *, + unsigned int, bool, enum bfd_endian); extern void print_hex_chars (struct ui_file *, const gdb_byte *, -- unsigned int, enum bfd_endian); -+ ULONGEST, enum bfd_endian); +- unsigned int, enum bfd_endian, bool); ++ ULONGEST, enum bfd_endian, bool); extern void print_char_chars (struct ui_file *, struct type *, const gdb_byte *, unsigned int, enum bfd_endian); -@@ -194,7 +194,7 @@ +@@ -191,7 +191,7 @@ struct generic_val_print_decorations extern void generic_val_print (struct type *type, @@ -3026,7 +3446,7 @@ Index: gdb-8.0/gdb/valprint.h struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, -@@ -204,7 +204,7 @@ +@@ -201,7 +201,7 @@ extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding); extern void generic_printstr (struct ui_file *stream, struct type *type, @@ -3035,11 +3455,11 @@ Index: gdb-8.0/gdb/valprint.h const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options); -Index: gdb-8.0/gdb/value.c -=================================================================== ---- gdb-8.0.orig/gdb/value.c 2017-08-19 20:04:59.821780838 +0200 -+++ gdb-8.0/gdb/value.c 2017-08-19 20:05:10.091876916 +0200 -@@ -367,7 +367,8 @@ +diff --git a/gdb/value.c b/gdb/value.c +index a61f728550..0c87ae75ee 100644 +--- a/gdb/value.c ++++ b/gdb/value.c +@@ -363,7 +363,8 @@ value_bytes_available (const struct value *value, } int @@ -3049,20 +3469,18 @@ Index: gdb-8.0/gdb/value.c { gdb_assert (!value->lazy); -@@ -813,9 +814,9 @@ +@@ -809,8 +810,8 @@ find_first_range_overlap_and_match (struct ranges_and_idx *rp1, Return true if the available bits match. */ - static int + static bool -value_contents_bits_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, -- int length) +value_contents_bits_eq (const struct value *val1, LONGEST offset1, + const struct value *val2, LONGEST offset2, -+ LONGEST length) + int length) { /* Each array element corresponds to a ranges source (unavailable, - optimized out). '1' is for VAL1, '2' for VAL2. */ -@@ -1455,7 +1456,8 @@ +@@ -1445,7 +1446,8 @@ value_optimized_out (struct value *value) the following LENGTH bytes. */ void @@ -3072,11 +3490,11 @@ Index: gdb-8.0/gdb/value.c { mark_value_bits_optimized_out (value, offset * TARGET_CHAR_BIT, -Index: gdb-8.0/gdb/value.h -=================================================================== ---- gdb-8.0.orig/gdb/value.h 2017-08-19 20:04:59.822780847 +0200 -+++ gdb-8.0/gdb/value.h 2017-08-19 20:05:10.092876925 +0200 -@@ -246,7 +246,7 @@ +diff --git a/gdb/value.h b/gdb/value.h +index 8e85452969..5c8597f38c 100644 +--- a/gdb/value.h ++++ b/gdb/value.h +@@ -245,7 +245,7 @@ struct lval_funcs /* If non-NULL, this is used to determine whether the indicated bits of VALUE are a synthetic pointer. */ int (*check_synthetic_pointer) (const struct value *value, @@ -3085,7 +3503,7 @@ Index: gdb-8.0/gdb/value.h /* Return a duplicate of VALUE's closure, for use in a new value. This may simply return the same closure, if VALUE's is -@@ -377,7 +377,8 @@ +@@ -376,7 +376,8 @@ extern int value_optimized_out (struct value *value); otherwise. */ extern int value_bits_any_optimized_out (const struct value *value, @@ -3095,7 +3513,7 @@ Index: gdb-8.0/gdb/value.h /* Like value_optimized_out, but return true iff the whole value is optimized out. */ -@@ -387,7 +388,7 @@ +@@ -386,7 +387,7 @@ extern int value_entirely_optimized_out (struct value *value); LENGTH bytes as optimized out. */ extern void mark_value_bytes_optimized_out (struct value *value, @@ -3104,7 +3522,7 @@ Index: gdb-8.0/gdb/value.h /* Mark VALUE's content bits starting at OFFSET and extending for LENGTH bits as optimized out. */ -@@ -819,12 +820,11 @@ +@@ -820,12 +821,11 @@ extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type); @@ -3118,7 +3536,7 @@ Index: gdb-8.0/gdb/value.h extern struct value *value_cast_pointers (struct type *, struct value *, int); -@@ -1113,10 +1113,11 @@ +@@ -1136,10 +1136,11 @@ extern struct value *value_literal_complex (struct value *, struct value *, extern struct value *find_function_in_inferior (const char *, struct objfile **); @@ -3132,120 +3550,11 @@ Index: gdb-8.0/gdb/value.h /* User function handler. */ -Index: gdb-8.0/gdb/s390-linux-nat.c -=================================================================== ---- gdb-8.0.orig/gdb/s390-linux-nat.c 2017-08-19 20:04:59.822780847 +0200 -+++ gdb-8.0/gdb/s390-linux-nat.c 2017-08-19 20:05:10.092876925 +0200 -@@ -900,7 +900,7 @@ - - static int - s390_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int cnt) -+ CORE_ADDR addr, LONGEST cnt) - { - return 1; - } -Index: gdb-8.0/gdb/target-delegates.c -=================================================================== ---- gdb-8.0.orig/gdb/target-delegates.c 2017-08-19 20:04:59.823780856 +0200 -+++ gdb-8.0/gdb/target-delegates.c 2017-08-19 20:05:10.093876935 +0200 -@@ -760,14 +760,14 @@ - } - - static int --delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2) -+delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2) - { - self = self->beneath; - return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2); - } - - static int --debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2) -+debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2) - { - int result; - fprintf_unfiltered (gdb_stdlog, "-> %s->to_region_ok_for_hw_watchpoint (...)\n", debug_target.to_shortname); -@@ -777,7 +777,7 @@ - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_CORE_ADDR (arg1); - fputs_unfiltered (", ", gdb_stdlog); -- target_debug_print_int (arg2); -+ target_debug_print_LONGEST (arg2); - fputs_unfiltered (") = ", gdb_stdlog); - target_debug_print_int (result); - fputs_unfiltered ("\n", gdb_stdlog); -Index: gdb-8.0/gdb/aarch64-linux-nat.c -=================================================================== ---- gdb-8.0.orig/gdb/aarch64-linux-nat.c 2017-08-19 20:04:59.823780856 +0200 -+++ gdb-8.0/gdb/aarch64-linux-nat.c 2017-08-19 20:05:10.093876935 +0200 -@@ -708,7 +708,7 @@ - - static int - aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) - { - return aarch64_linux_region_ok_for_watchpoint (addr, len); - } -Index: gdb-8.0/gdb/nat/x86-dregs.c -=================================================================== ---- gdb-8.0.orig/gdb/nat/x86-dregs.c 2017-08-19 20:04:59.823780856 +0200 -+++ gdb-8.0/gdb/nat/x86-dregs.c 2017-08-19 20:05:10.093876935 +0200 -@@ -384,7 +384,7 @@ - - static int - x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state, -- x86_wp_op_t what, CORE_ADDR addr, int len, -+ x86_wp_op_t what, CORE_ADDR addr, LONGEST len, - enum target_hw_bp_type type) - { - int retval = 0; -@@ -552,7 +552,7 @@ - - int - x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) - { - int nregs; - -Index: gdb-8.0/gdb/compile/compile-c-support.c -=================================================================== ---- gdb-8.0.orig/gdb/compile/compile-c-support.c 2017-08-19 20:04:59.824780866 +0200 -+++ gdb-8.0/gdb/compile/compile-c-support.c 2017-08-19 20:05:10.093876935 +0200 -@@ -309,11 +309,11 @@ - - default: - fprintf_unfiltered (stream, -- " unsigned char %s[%d]" -+ " unsigned char %s[%s]" - " __attribute__((__aligned__(" - "__BIGGEST_ALIGNMENT__)))", - regname, -- TYPE_LENGTH (regtype)); -+ pulongest (TYPE_LENGTH (regtype))); - } - fputs_unfiltered (";\n", stream); - -Index: gdb-8.0/gdb/nat/x86-dregs.h -=================================================================== ---- gdb-8.0.orig/gdb/nat/x86-dregs.h 2017-08-19 20:04:59.824780866 +0200 -+++ gdb-8.0/gdb/nat/x86-dregs.h 2017-08-19 20:05:10.094876944 +0200 -@@ -116,7 +116,7 @@ - /* Return non-zero if we can watch a memory region that starts at - address ADDR and whose length is LEN bytes. */ - extern int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state, -- CORE_ADDR addr, int len); -+ CORE_ADDR addr, LONGEST len); - - /* If the inferior has some break/watchpoint that triggered, set the - address associated with that break/watchpoint and return true. -Index: gdb-8.0/gdb/x86-nat.c -=================================================================== ---- gdb-8.0.orig/gdb/x86-nat.c 2017-08-19 20:04:59.824780866 +0200 -+++ gdb-8.0/gdb/x86-nat.c 2017-08-19 20:05:10.094876944 +0200 -@@ -174,7 +174,7 @@ +diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c +index a26685914a..255cd5749f 100644 +--- a/gdb/x86-nat.c ++++ b/gdb/x86-nat.c +@@ -174,7 +174,7 @@ x86_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, static int x86_region_ok_for_watchpoint (struct target_ops *self, @@ -3254,144 +3563,6 @@ Index: gdb-8.0/gdb/x86-nat.c { struct x86_debug_reg_state *state = x86_debug_reg_state (ptid_get_pid (inferior_ptid)); -Index: gdb-8.0/gdb/rust-lang.c -=================================================================== ---- gdb-8.0.orig/gdb/rust-lang.c 2017-08-19 20:04:59.824780866 +0200 -+++ gdb-8.0/gdb/rust-lang.c 2017-08-19 20:05:10.094876944 +0200 -@@ -439,7 +439,7 @@ - - static void - rust_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *user_encoding, int force_ellipses, - const struct value_print_options *options) - { -@@ -563,7 +563,7 @@ - /* la_val_print implementation for Rust. */ - - static void --rust_val_print (struct type *type, int embedded_offset, -+rust_val_print (struct type *type, LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options) -Index: gdb-8.0/gdb/arch-utils.c -=================================================================== ---- gdb-8.0.orig/gdb/arch-utils.c 2017-08-19 20:04:59.825780875 +0200 -+++ gdb-8.0/gdb/arch-utils.c 2017-08-19 20:05:10.095876953 +0200 -@@ -247,7 +247,7 @@ - - const struct floatformat ** - default_floatformat_for_type (struct gdbarch *gdbarch, -- const char *name, int len) -+ const char *name, LONGEST len) - { - const struct floatformat **format = NULL; - -Index: gdb-8.0/gdb/arch-utils.h -=================================================================== ---- gdb-8.0.orig/gdb/arch-utils.h 2017-08-19 20:04:59.825780875 +0200 -+++ gdb-8.0/gdb/arch-utils.h 2017-08-19 20:05:10.095876953 +0200 -@@ -144,7 +144,7 @@ - /* Default implementation of gdbarch_floatformat_for_type. */ - extern const struct floatformat ** - default_floatformat_for_type (struct gdbarch *gdbarch, -- const char *name, int len); -+ const char *name, LONGEST len); - - extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame, - CORE_ADDR pc); -Index: gdb-8.0/gdb/findcmd.c -=================================================================== ---- gdb-8.0.orig/gdb/findcmd.c 2017-08-19 20:04:59.825780875 +0200 -+++ gdb-8.0/gdb/findcmd.c 2017-08-19 20:05:10.095876953 +0200 -@@ -180,7 +180,7 @@ - need to grow the pattern buf. */ - pattern_buf_size_need = (pattern_buf_end - pattern_buf - + std::max (TYPE_LENGTH (t), -- (unsigned) sizeof (int64_t))); -+ (ULONGEST) sizeof (int64_t))); - if (pattern_buf_size_need > pattern_buf_size) - { - size_t current_offset = pattern_buf_end - pattern_buf; -Index: gdb-8.0/gdb/gdbarch.c -=================================================================== ---- gdb-8.0.orig/gdb/gdbarch.c 2017-08-19 20:04:59.826780885 +0200 -+++ gdb-8.0/gdb/gdbarch.c 2017-08-19 20:05:10.096876963 +0200 -@@ -1806,7 +1806,7 @@ - } - - const struct floatformat ** --gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length) -+gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length) - { - gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->floatformat_for_type != NULL); -Index: gdb-8.0/gdb/gdbarch.h -=================================================================== ---- gdb-8.0.orig/gdb/gdbarch.h 2017-08-19 20:04:59.826780885 +0200 -+++ gdb-8.0/gdb/gdbarch.h 2017-08-19 20:05:10.096876963 +0200 -@@ -203,8 +203,8 @@ - NAME, if non-NULL, is the type name, which may be used to distinguish - different target formats of the same length. */ - --typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length); --extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length); -+typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length); -+extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length); - extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type); - - /* For most targets, a pointer on the target and its representation as an -Index: gdb-8.0/gdb/gdbarch.sh -=================================================================== ---- gdb-8.0.orig/gdb/gdbarch.sh 2017-08-19 20:04:59.827780894 +0200 -+++ gdb-8.0/gdb/gdbarch.sh 2017-08-19 20:05:10.097876972 +0200 -@@ -392,7 +392,7 @@ - # Returns the floating-point format to be used for values of length LENGTH. - # NAME, if non-NULL, is the type name, which may be used to distinguish - # different target formats of the same length. --m:const struct floatformat **:floatformat_for_type:const char *name, int length:name, length:0:default_floatformat_for_type::0 -+m:const struct floatformat **:floatformat_for_type:const char *name, LONGEST length:name, length:0:default_floatformat_for_type::0 - - # For most targets, a pointer on the target and its representation as an - # address in GDB have the same size and "look the same". For such a -Index: gdb-8.0/gdb/i386-tdep.c -=================================================================== ---- gdb-8.0.orig/gdb/i386-tdep.c 2017-08-19 20:04:59.828780903 +0200 -+++ gdb-8.0/gdb/i386-tdep.c 2017-08-19 20:05:10.098876982 +0200 -@@ -8180,7 +8180,7 @@ - - const struct floatformat ** - i386_floatformat_for_type (struct gdbarch *gdbarch, -- const char *name, int len) -+ const char *name, LONGEST len) - { - if (len == 128 && name) - if (strcmp (name, "__float128") == 0 -Index: gdb-8.0/gdb/ppc-linux-tdep.c -=================================================================== ---- gdb-8.0.orig/gdb/ppc-linux-tdep.c 2017-08-19 20:04:59.829780913 +0200 -+++ gdb-8.0/gdb/ppc-linux-tdep.c 2017-08-19 20:05:10.098876982 +0200 -@@ -1632,7 +1632,7 @@ - - const struct floatformat ** - ppc_floatformat_for_type (struct gdbarch *gdbarch, -- const char *name, int len) -+ const char *name, LONGEST len) - { - if (len == 128 && name) - if (strcmp (name, "__float128") == 0 -Index: gdb-8.0/gdb/tracepoint.h -=================================================================== ---- gdb-8.0.orig/gdb/tracepoint.h 2017-08-19 20:04:59.829780913 +0200 -+++ gdb-8.0/gdb/tracepoint.h 2017-08-19 20:05:10.099876991 +0200 -@@ -254,7 +254,7 @@ - void add_register (unsigned int regno); - void add_memrange (struct gdbarch *gdbarch, - int type, bfd_signed_vma base, -- unsigned long len); -+ ULONGEST len); - void collect_symbol (struct symbol *sym, - struct gdbarch *gdbarch, - long frame_regno, long frame_offset, +-- +2.14.3 + diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch index 115ff0d..c51d52c 100644 --- a/gdb-rhbz795424-bitpos-21of25.patch +++ b/gdb-rhbz795424-bitpos-21of25.patch @@ -1,13 +1,16 @@ +From 891638de98a5c1aca42533bda15be1ac80bb4c22 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [PATCH 2/4] Add a check to ensure that a type may fit into host memory +Subject: Add a check to ensure that a type may fit into host memory FileName: gdb-rhbz795424-bitpos-21of25.patch +;; Fix `GDB cannot access struct member whose offset is larger than 256MB' +;; (RH BZ 795424). +;;=push + http://sourceware.org/ml/gdb-patches/2012-09/msg00632.html - - --MP_/PnL6l3LUsXWpZ/olqawWlzb Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit @@ -57,12 +60,22 @@ gdb/ChangeLog Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-ensure-size_t.patch +--- + gdb/alpha-tdep.c | 7 +++++++ + gdb/cp-valprint.c | 1 + + gdb/defs.h | 2 ++ + gdb/p-valprint.c | 1 + + gdb/utils.c | 12 ++++++++++++ + gdb/valops.c | 1 + + gdb/value.c | 4 ++++ + gdb/vax-tdep.c | 1 + + 8 files changed, 29 insertions(+) -Index: gdb-8.0/gdb/alpha-tdep.c -=================================================================== ---- gdb-8.0.orig/gdb/alpha-tdep.c 2017-08-19 20:07:45.469330496 +0200 -+++ gdb-8.0/gdb/alpha-tdep.c 2017-08-19 20:07:50.670379152 +0200 -@@ -414,6 +414,13 @@ +diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c +index 3100d72ad1..6fbf41bcdc 100644 +--- a/gdb/alpha-tdep.c ++++ b/gdb/alpha-tdep.c +@@ -415,6 +415,13 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, accumulate_size = 0; else accumulate_size -= sizeof(arg_reg_buffer); @@ -76,48 +89,46 @@ Index: gdb-8.0/gdb/alpha-tdep.c sp -= accumulate_size; /* Keep sp aligned to a multiple of 16 as the ABI requires. */ -Index: gdb-8.0/gdb/cp-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/cp-valprint.c 2017-08-19 20:07:45.470330505 +0200 -+++ gdb-8.0/gdb/cp-valprint.c 2017-08-19 20:07:50.670379152 +0200 -@@ -537,6 +537,8 @@ - gdb_byte *buf; - struct cleanup *back_to; - +diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c +index 38beb4d62a..bcb59507bd 100644 +--- a/gdb/cp-valprint.c ++++ b/gdb/cp-valprint.c +@@ -529,6 +529,7 @@ cp_print_value (struct type *type, struct type *real_type, + if ((boffset + offset) < 0 + || (boffset + offset) >= TYPE_LENGTH (real_type)) + { + ulongest_fits_host_or_error (TYPE_LENGTH (baseclass)); + gdb::byte_vector buf (TYPE_LENGTH (baseclass)); + + if (target_read_memory (address + boffset, buf.data (), +diff --git a/gdb/defs.h b/gdb/defs.h +index f76293fedf..27f3becab0 100644 +--- a/gdb/defs.h ++++ b/gdb/defs.h +@@ -705,4 +705,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what); + + #include "utils.h" + ++extern void ulongest_fits_host_or_error (ULONGEST num); + - buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass)); - back_to = make_cleanup (xfree, buf); - -Index: gdb-8.0/gdb/findcmd.c -=================================================================== ---- gdb-8.0.orig/gdb/findcmd.c 2017-08-19 20:07:45.472330524 +0200 -+++ gdb-8.0/gdb/findcmd.c 2017-08-19 20:07:50.672379171 +0200 -@@ -186,6 +186,7 @@ - size_t current_offset = pattern_buf_end - pattern_buf; - - pattern_buf_size = pattern_buf_size_need * 2; -+ ulongest_fits_host_or_error (pattern_buf_size); - pattern_buf = (gdb_byte *) xrealloc (pattern_buf, pattern_buf_size); - pattern_buf_end = pattern_buf + current_offset; - } -Index: gdb-8.0/gdb/p-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/p-valprint.c 2017-08-19 20:07:45.472330524 +0200 -+++ gdb-8.0/gdb/p-valprint.c 2017-08-19 20:07:50.673379180 +0200 -@@ -772,6 +772,7 @@ - gdb_byte *buf; - struct cleanup *back_to; + #endif /* #ifndef DEFS_H */ +diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c +index 3cdc847fe3..8d5b395afd 100644 +--- a/gdb/p-valprint.c ++++ b/gdb/p-valprint.c +@@ -771,6 +771,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, + if (boffset < 0 || boffset >= TYPE_LENGTH (type)) + { + ulongest_fits_host_or_error (TYPE_LENGTH (baseclass)); - buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass)); - back_to = make_cleanup (xfree, buf); + buf.resize (TYPE_LENGTH (baseclass)); -Index: gdb-8.0/gdb/utils.c -=================================================================== ---- gdb-8.0.orig/gdb/utils.c 2017-08-19 20:07:45.473330533 +0200 -+++ gdb-8.0/gdb/utils.c 2017-08-19 20:07:50.673379180 +0200 -@@ -2776,6 +2776,18 @@ + base_valaddr = buf.data (); +diff --git a/gdb/utils.c b/gdb/utils.c +index 5e99a4d501..f72ddab992 100644 +--- a/gdb/utils.c ++++ b/gdb/utils.c +@@ -2822,6 +2822,18 @@ string_to_core_addr (const char *my_string) return addr; } @@ -133,26 +144,26 @@ Index: gdb-8.0/gdb/utils.c + pulongest (SIZE_MAX / 8)); +} + - char * + gdb::unique_xmalloc_ptr gdb_realpath (const char *filename) { -Index: gdb-8.0/gdb/valops.c -=================================================================== ---- gdb-8.0.orig/gdb/valops.c 2017-08-19 20:07:45.474330542 +0200 -+++ gdb-8.0/gdb/valops.c 2017-08-19 20:07:50.674379190 +0200 -@@ -2100,6 +2100,7 @@ - struct cleanup *back_to; +diff --git a/gdb/valops.c b/gdb/valops.c +index a7c3613d84..eebcb8e5e1 100644 +--- a/gdb/valops.c ++++ b/gdb/valops.c +@@ -2087,6 +2087,7 @@ search_struct_method (const char *name, struct value **arg1p, + { CORE_ADDR address; + ulongest_fits_host_or_error (TYPE_LENGTH (baseclass)); - tmp = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass)); - back_to = make_cleanup (xfree, tmp); + gdb::byte_vector tmp (TYPE_LENGTH (baseclass)); address = value_address (*arg1p); -Index: gdb-8.0/gdb/value.c -=================================================================== ---- gdb-8.0.orig/gdb/value.c 2017-08-19 20:07:45.476330561 +0200 -+++ gdb-8.0/gdb/value.c 2017-08-19 20:07:50.675379199 +0200 -@@ -936,6 +936,7 @@ + +diff --git a/gdb/value.c b/gdb/value.c +index 0c87ae75ee..105c28bea7 100644 +--- a/gdb/value.c ++++ b/gdb/value.c +@@ -926,6 +926,7 @@ allocate_value_lazy (struct type *type) description correctly. */ check_typedef (type); @@ -160,7 +171,7 @@ Index: gdb-8.0/gdb/value.c val = XCNEW (struct value); val->contents = NULL; val->next = all_values; -@@ -1033,6 +1034,8 @@ +@@ -1023,6 +1024,8 @@ check_type_length_before_alloc (const struct type *type) static void allocate_value_contents (struct value *val) { @@ -169,7 +180,7 @@ Index: gdb-8.0/gdb/value.c if (!val->contents) { check_type_length_before_alloc (val->enclosing_type); -@@ -3093,6 +3096,7 @@ +@@ -3015,6 +3018,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val))) { check_type_length_before_alloc (new_encl_type); @@ -177,11 +188,11 @@ Index: gdb-8.0/gdb/value.c val->contents = (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type)); } -Index: gdb-8.0/gdb/vax-tdep.c -=================================================================== ---- gdb-8.0.orig/gdb/vax-tdep.c 2017-08-19 20:07:45.476330561 +0200 -+++ gdb-8.0/gdb/vax-tdep.c 2017-08-19 20:07:50.675379199 +0200 -@@ -219,6 +219,7 @@ +diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c +index c1f10c8b65..f31acc8f01 100644 +--- a/gdb/vax-tdep.c ++++ b/gdb/vax-tdep.c +@@ -218,6 +218,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, ULONGEST addr; regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr); @@ -189,14 +200,6 @@ Index: gdb-8.0/gdb/vax-tdep.c read_memory (addr, readbuf, len); } -Index: gdb-8.0/gdb/defs.h -=================================================================== ---- gdb-8.0.orig/gdb/defs.h 2017-08-19 20:07:45.476330561 +0200 -+++ gdb-8.0/gdb/defs.h 2017-08-19 20:07:50.676379208 +0200 -@@ -750,4 +750,6 @@ - - #include "utils.h" - -+extern void ulongest_fits_host_or_error (ULONGEST num); -+ - #endif /* #ifndef DEFS_H */ +-- +2.14.3 + diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index 0b74fa4..82e4c5f 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -1,13 +1,16 @@ +From 0d283a012934a36adade9c3f0c504424a078bc51 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [PATCH 3/4] Expand watchpoint lengths to LONGEST +Subject: Expand watchpoint lengths to LONGEST FileName: gdb-rhbz795424-bitpos-22of25.patch +;; Fix `GDB cannot access struct member whose offset is larger than 256MB' +;; (RH BZ 795424). +;;=push + http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html - - --MP_/6HRlH6vpyqtSy4CYyMrX6b2 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit @@ -101,12 +104,37 @@ gdb/ChangeLog: Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-wp.patch +--- + gdb/aarch64-linux-nat.c | 2 +- + gdb/arm-linux-nat.c | 2 +- + gdb/nat/aarch64-linux-hw-point.c | 21 +++++++++++---------- + gdb/nat/aarch64-linux-hw-point.h | 4 ++-- + gdb/ppc-linux-nat.c | 14 +++++++------- + gdb/procfs.c | 4 ++-- + gdb/remote.c | 6 +++--- + gdb/target-delegates.c | 14 +++++++------- + gdb/target.c | 4 ++-- + gdb/target.h | 4 ++-- + 10 files changed, 38 insertions(+), 37 deletions(-) -Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/arm-linux-nat.c 2015-11-08 10:36:33.050071812 +0100 -+++ gdb-7.10.50.20151027/gdb/arm-linux-nat.c 2015-11-08 10:36:33.094072110 +0100 -@@ -1209,7 +1209,7 @@ arm_linux_stopped_by_watchpoint (struct +diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c +index 8606111c00..9a29445320 100644 +--- a/gdb/aarch64-linux-nat.c ++++ b/gdb/aarch64-linux-nat.c +@@ -767,7 +767,7 @@ aarch64_linux_stopped_by_watchpoint (struct target_ops *ops) + static int + aarch64_linux_watchpoint_addr_within_range (struct target_ops *target, + CORE_ADDR addr, +- CORE_ADDR start, int length) ++ CORE_ADDR start, LONGEST length) + { + return start <= addr && start + length - 1 >= addr; + } +diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c +index b5732cb48e..f7249fa799 100644 +--- a/gdb/arm-linux-nat.c ++++ b/gdb/arm-linux-nat.c +@@ -1177,7 +1177,7 @@ arm_linux_stopped_by_watchpoint (struct target_ops *ops) static int arm_linux_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -115,11 +143,107 @@ Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c { return start <= addr && start + length - 1 >= addr; } -Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ppc-linux-nat.c 2015-11-08 10:36:33.064071907 +0100 -+++ gdb-7.10.50.20151027/gdb/ppc-linux-nat.c 2015-11-08 10:36:33.095072117 +0100 -@@ -1807,11 +1807,11 @@ can_use_watchpoint_cond_accel (void) +diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c +index 9800d9a59c..ee1ea40664 100644 +--- a/gdb/nat/aarch64-linux-hw-point.c ++++ b/gdb/nat/aarch64-linux-hw-point.c +@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum target_hw_bp_type type, int len) + Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */ + + static int +-aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) ++aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len) + { + unsigned int alignment = 0; + +@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) + limitations can be largely relaxed with some further work. */ + + static void +-aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p, ++aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len, ++ CORE_ADDR *aligned_addr_p, + int *aligned_len_p, CORE_ADDR *next_addr_p, +- int *next_len_p) ++ LONGEST *next_len_p) + { + int aligned_len; + unsigned int offset; +@@ -501,7 +502,7 @@ aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type, + + static int + aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, +- CORE_ADDR addr, int len, int is_insert, ++ CORE_ADDR addr, LONGEST len, int is_insert, + struct aarch64_debug_reg_state *state) + { + while (len > 0) +@@ -524,9 +525,9 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, + " " + "aligned_addr: %s, aligned_len: %d\n" + " " +- "next_addr: %s, next_len: %d\n", ++ "next_addr: %s, next_len: %s\n", + is_insert, core_addr_to_string_nz (aligned_addr), +- aligned_len, core_addr_to_string_nz (addr), len); ++ aligned_len, core_addr_to_string_nz (addr), plongest (len)); + + if (ret != 0) + return ret; +@@ -537,7 +538,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, + + int + aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, +- int len, int is_insert, ++ LONGEST len, int is_insert, + struct aarch64_debug_reg_state *state) + { + if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len)) +@@ -588,14 +589,14 @@ aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, + void + aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, + const char *func, CORE_ADDR addr, +- int len, enum target_hw_bp_type type) ++ LONGEST len, enum target_hw_bp_type type) + { + int i; + + debug_printf ("%s", func); + if (addr || len) +- debug_printf (" (addr=0x%08lx, len=%d, type=%s)", +- (unsigned long) addr, len, ++ debug_printf (" (addr=0x%08lx, len=%s, type=%s)", ++ (unsigned long) addr, plongest (len), + type == hw_write ? "hw-write-watchpoint" + : (type == hw_read ? "hw-read-watchpoint" + : (type == hw_access ? "hw-access-watchpoint" +diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h +index 610a5f1215..18e1c826c3 100644 +--- a/gdb/nat/aarch64-linux-hw-point.h ++++ b/gdb/nat/aarch64-linux-hw-point.h +@@ -172,7 +172,7 @@ int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, + int len, int is_insert, + struct aarch64_debug_reg_state *state); + int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, +- int len, int is_insert, ++ LONGEST len, int is_insert, + struct aarch64_debug_reg_state *state); + + void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, +@@ -180,7 +180,7 @@ void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, + + void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, + const char *func, CORE_ADDR addr, +- int len, enum target_hw_bp_type type); ++ LONGEST len, enum target_hw_bp_type type); + + void aarch64_linux_get_debug_reg_capacity (int tid); + +diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c +index 429b9c6231..39004c1a77 100644 +--- a/gdb/ppc-linux-nat.c ++++ b/gdb/ppc-linux-nat.c +@@ -1798,11 +1798,11 @@ can_use_watchpoint_cond_accel (void) CONDITION_VALUE will hold the value which should be put in the DVC register. */ static void @@ -134,7 +258,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c CORE_ADDR addr_end_data, addr_end_dvc; /* The DVC register compares bytes within fixed-length windows which -@@ -1898,7 +1898,7 @@ num_memory_accesses (struct value *v) +@@ -1889,7 +1889,7 @@ num_memory_accesses (struct value *v) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, @@ -143,7 +267,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c { int pc = 1, num_accesses_left, num_accesses_right; struct value *left_val, *right_val, *left_chain, *right_chain; -@@ -1966,7 +1966,7 @@ check_condition (CORE_ADDR watch_addr, s +@@ -1957,7 +1957,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, true. */ static int ppc_linux_can_accel_watchpoint_condition (struct target_ops *self, @@ -152,7 +276,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c struct expression *cond) { CORE_ADDR data_value; -@@ -1983,7 +1983,7 @@ ppc_linux_can_accel_watchpoint_condition +@@ -1974,7 +1974,7 @@ ppc_linux_can_accel_watchpoint_condition (struct target_ops *self, static void create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, @@ -161,7 +285,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c struct expression *cond, int insert) { if (len == 1 -@@ -2249,7 +2249,7 @@ ppc_linux_stopped_by_watchpoint (struct +@@ -2240,7 +2240,7 @@ ppc_linux_stopped_by_watchpoint (struct target_ops *ops) static int ppc_linux_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -170,20 +294,20 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c { int mask; -Index: gdb-7.10.50.20151027/gdb/procfs.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/procfs.c 2015-11-08 10:36:33.065071913 +0100 -+++ gdb-7.10.50.20151027/gdb/procfs.c 2015-11-08 10:36:33.096072123 +0100 -@@ -2427,7 +2427,7 @@ procfs_address_to_host_pointer (CORE_ADD - #endif +diff --git a/gdb/procfs.c b/gdb/procfs.c +index 1dd383aecb..dbb98c165d 100644 +--- a/gdb/procfs.c ++++ b/gdb/procfs.c +@@ -1563,7 +1563,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) + } static int -proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags) +proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, LONGEST len, int wflags) { - #if !defined (PCWATCH) && !defined (PIOCSWATCH) - /* If neither or these is defined, we can't support watchpoints. -@@ -4706,7 +4706,7 @@ procfs_pid_to_str (struct target_ops *op + struct { + procfs_ctl_t cmd; +@@ -3250,7 +3250,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid) /* Insert a watchpoint. */ static int @@ -191,12 +315,12 @@ Index: gdb-7.10.50.20151027/gdb/procfs.c +procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag, int after) { - #ifndef AIX5 -Index: gdb-7.10.50.20151027/gdb/remote.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/remote.c 2015-11-08 10:36:33.067071927 +0100 -+++ gdb-7.10.50.20151027/gdb/remote.c 2015-11-08 10:36:33.097072130 +0100 -@@ -9085,7 +9085,7 @@ remote_insert_watchpoint (struct target_ + int pflags = 0; +diff --git a/gdb/remote.c b/gdb/remote.c +index 47d3a04dd9..303fcddd8a 100644 +--- a/gdb/remote.c ++++ b/gdb/remote.c +@@ -9892,7 +9892,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -205,7 +329,7 @@ Index: gdb-7.10.50.20151027/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -9105,7 +9105,7 @@ remote_insert_watchpoint (struct target_ +@@ -9912,7 +9912,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, static int remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -214,7 +338,7 @@ Index: gdb-7.10.50.20151027/gdb/remote.c { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -9134,7 +9134,7 @@ remote_remove_watchpoint (struct target_ +@@ -9941,7 +9941,7 @@ remote_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -223,68 +347,11 @@ Index: gdb-7.10.50.20151027/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -Index: gdb-7.10.50.20151027/gdb/target.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/target.c 2015-11-08 10:36:33.069071941 +0100 -+++ gdb-7.10.50.20151027/gdb/target.c 2015-11-08 10:36:33.098072137 +0100 -@@ -51,7 +51,7 @@ static void generic_tls_error (void) ATT - static void default_terminal_info (struct target_ops *, const char *, int); - - static int default_watchpoint_addr_within_range (struct target_ops *, -- CORE_ADDR, CORE_ADDR, int); -+ CORE_ADDR, CORE_ADDR, LONGEST); - - static int default_region_ok_for_hw_watchpoint (struct target_ops *, - CORE_ADDR, LONGEST); -@@ -3140,7 +3140,7 @@ default_region_ok_for_hw_watchpoint (str - static int - default_watchpoint_addr_within_range (struct target_ops *target, - CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, LONGEST length) - { - return addr >= start && addr < start + length; - } -Index: gdb-7.10.50.20151027/gdb/target.h -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/target.h 2015-11-08 10:36:33.069071941 +0100 -+++ gdb-7.10.50.20151027/gdb/target.h 2015-11-08 10:36:33.098072137 +0100 -@@ -543,7 +543,7 @@ struct target_ops - int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *) - TARGET_DEFAULT_RETURN (0); - int (*to_watchpoint_addr_within_range) (struct target_ops *, -- CORE_ADDR, CORE_ADDR, int) -+ CORE_ADDR, CORE_ADDR, LONGEST) - TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range); - - /* Documentation of this routine is provided with the corresponding -@@ -553,7 +553,7 @@ struct target_ops - TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); - - int (*to_can_accel_watchpoint_condition) (struct target_ops *, -- CORE_ADDR, int, int, -+ CORE_ADDR, LONGEST, int, - struct expression *) - TARGET_DEFAULT_RETURN (0); - int (*to_masked_watch_num_registers) (struct target_ops *, -Index: gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/aarch64-linux-nat.c 2015-11-08 10:36:33.074071975 +0100 -+++ gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c 2015-11-08 10:36:33.098072137 +0100 -@@ -795,7 +795,7 @@ aarch64_linux_stopped_by_watchpoint (str - static int - aarch64_linux_watchpoint_addr_within_range (struct target_ops *target, - CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, LONGEST length) - { - return start <= addr && start + length - 1 >= addr; - } -Index: gdb-7.10.50.20151027/gdb/target-delegates.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/target-delegates.c 2015-11-08 10:36:33.073071968 +0100 -+++ gdb-7.10.50.20151027/gdb/target-delegates.c 2015-11-08 10:36:33.099072144 +0100 -@@ -709,14 +709,14 @@ debug_stopped_data_address (struct targe +diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c +index 04cadc1d4b..052638b92b 100644 +--- a/gdb/target-delegates.c ++++ b/gdb/target-delegates.c +@@ -733,14 +733,14 @@ debug_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1) } static int @@ -301,7 +368,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c { int result; fprintf_unfiltered (gdb_stdlog, "-> %s->to_watchpoint_addr_within_range (...)\n", debug_target.to_shortname); -@@ -728,7 +728,7 @@ debug_watchpoint_addr_within_range (stru +@@ -752,7 +752,7 @@ debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, COR fputs_unfiltered (", ", gdb_stdlog); target_debug_print_CORE_ADDR (arg2); fputs_unfiltered (", ", gdb_stdlog); @@ -310,7 +377,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c fputs_unfiltered (") = ", gdb_stdlog); target_debug_print_int (result); fputs_unfiltered ("\n", gdb_stdlog); -@@ -761,20 +761,20 @@ debug_region_ok_for_hw_watchpoint (struc +@@ -785,20 +785,20 @@ debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONG } static int @@ -334,7 +401,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c { int result; fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_accel_watchpoint_condition (...)\n", debug_target.to_shortname); -@@ -784,7 +784,7 @@ debug_can_accel_watchpoint_condition (st +@@ -808,7 +808,7 @@ debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, i fputs_unfiltered (", ", gdb_stdlog); target_debug_print_CORE_ADDR (arg1); fputs_unfiltered (", ", gdb_stdlog); @@ -343,99 +410,50 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c fputs_unfiltered (", ", gdb_stdlog); target_debug_print_int (arg3); fputs_unfiltered (", ", gdb_stdlog); -Index: gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/nat/aarch64-linux-hw-point.c 2015-10-27 02:48:31.000000000 +0100 -+++ gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.c 2015-11-08 10:36:33.099072144 +0100 -@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum targ - Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */ +diff --git a/gdb/target.c b/gdb/target.c +index c9471f61fb..bcc67a9b4b 100644 +--- a/gdb/target.c ++++ b/gdb/target.c +@@ -53,7 +53,7 @@ static void generic_tls_error (void) ATTRIBUTE_NORETURN; + static void default_terminal_info (struct target_ops *, const char *, int); + static int default_watchpoint_addr_within_range (struct target_ops *, +- CORE_ADDR, CORE_ADDR, int); ++ CORE_ADDR, CORE_ADDR, LONGEST); + + static int default_region_ok_for_hw_watchpoint (struct target_ops *, + CORE_ADDR, LONGEST); +@@ -3120,7 +3120,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self, static int --aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) -+aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len) + default_watchpoint_addr_within_range (struct target_ops *target, + CORE_ADDR addr, +- CORE_ADDR start, int length) ++ CORE_ADDR start, LONGEST length) { - unsigned int alignment = 0; + return addr >= start && addr < start + length; + } +diff --git a/gdb/target.h b/gdb/target.h +index 349e87de6f..97ce16caf4 100644 +--- a/gdb/target.h ++++ b/gdb/target.h +@@ -544,7 +544,7 @@ struct target_ops + int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *) + TARGET_DEFAULT_RETURN (0); + int (*to_watchpoint_addr_within_range) (struct target_ops *, +- CORE_ADDR, CORE_ADDR, int) ++ CORE_ADDR, CORE_ADDR, LONGEST) + TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range); -@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpo - limitations can be largely relaxed with some further work. */ - - static void --aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p, -+aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len, -+ CORE_ADDR *aligned_addr_p, - int *aligned_len_p, CORE_ADDR *next_addr_p, -- int *next_len_p) -+ LONGEST *next_len_p) - { - int aligned_len; - unsigned int offset; -@@ -494,7 +495,7 @@ aarch64_handle_aligned_watchpoint (enum - - static int - aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, -- CORE_ADDR addr, int len, int is_insert, -+ CORE_ADDR addr, LONGEST len, int is_insert, - struct aarch64_debug_reg_state *state) - { - while (len > 0) -@@ -517,9 +518,9 @@ aarch64_handle_unaligned_watchpoint (enu - " " - "aligned_addr: %s, aligned_len: %d\n" - " " -- "next_addr: %s, next_len: %d\n", -+ "next_addr: %s, next_len: %s\n", - is_insert, core_addr_to_string_nz (aligned_addr), -- aligned_len, core_addr_to_string_nz (addr), len); -+ aligned_len, core_addr_to_string_nz (addr), plongest (len)); - - if (ret != 0) - return ret; -@@ -530,7 +531,7 @@ aarch64_handle_unaligned_watchpoint (enu - - int - aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, -- int len, int is_insert, -+ LONGEST len, int is_insert, - struct aarch64_debug_reg_state *state) - { - if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len)) -@@ -581,14 +582,14 @@ aarch64_linux_set_debug_regs (const stru - void - aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, - const char *func, CORE_ADDR addr, -- int len, enum target_hw_bp_type type) -+ LONGEST len, enum target_hw_bp_type type) - { - int i; - - debug_printf ("%s", func); - if (addr || len) -- debug_printf (" (addr=0x%08lx, len=%d, type=%s)", -- (unsigned long) addr, len, -+ debug_printf (" (addr=0x%08lx, len=%s, type=%s)", -+ (unsigned long) addr, plongest (len), - type == hw_write ? "hw-write-watchpoint" - : (type == hw_read ? "hw-read-watchpoint" - : (type == hw_access ? "hw-access-watchpoint" -Index: gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.h -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/nat/aarch64-linux-hw-point.h 2015-10-27 02:48:31.000000000 +0100 -+++ gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.h 2015-11-08 10:36:47.656170839 +0100 -@@ -168,7 +168,7 @@ int aarch64_handle_breakpoint (enum targ - int len, int is_insert, - struct aarch64_debug_reg_state *state); - int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, -- int len, int is_insert, -+ LONGEST len, int is_insert, - struct aarch64_debug_reg_state *state); - - void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, -@@ -176,7 +176,7 @@ void aarch64_linux_set_debug_regs (const - - void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, - const char *func, CORE_ADDR addr, -- int len, enum target_hw_bp_type type); -+ LONGEST len, enum target_hw_bp_type type); - - void aarch64_linux_get_debug_reg_capacity (int tid); + /* Documentation of this routine is provided with the corresponding +@@ -554,7 +554,7 @@ struct target_ops + TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); + int (*to_can_accel_watchpoint_condition) (struct target_ops *, +- CORE_ADDR, int, int, ++ CORE_ADDR, LONGEST, int, + struct expression *) + TARGET_DEFAULT_RETURN (0); + int (*to_masked_watch_num_registers) (struct target_ops *, +-- +2.14.3 + diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index 3080302..df554fe 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -1,13 +1,16 @@ +From 694123aad6bdf3a1cb753e380f2b866de119ced7 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [PATCH 4/4] Bitpos expansion - tdep changes +Subject: Bitpos expansion - tdep changes FileName: gdb-rhbz795424-bitpos-23of25.patch +;; Fix `GDB cannot access struct member whose offset is larger than 256MB' +;; (RH BZ 795424). +;;=push + http://sourceware.org/ml/gdb-patches/2012-09/msg00630.html - - --MP_/X_WjDOvz/B_fvlsrmCwRdxe Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit @@ -142,12 +145,48 @@ gdb/ChangeLog Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-tdep.patch +--- + gdb/alpha-tdep.c | 14 +++++++------- + gdb/amd64-tdep.c | 8 ++++---- + gdb/amd64-windows-tdep.c | 2 +- + gdb/arm-tdep.c | 20 +++++++++++--------- + gdb/avr-tdep.c | 10 +++++----- + gdb/bfin-tdep.c | 4 ++-- + gdb/cris-tdep.c | 12 ++++++------ + gdb/h8300-tdep.c | 8 ++++---- + gdb/hppa-tdep.c | 4 ++-- + gdb/i386-darwin-tdep.c | 2 +- + gdb/i386-tdep.c | 14 +++++++------- + gdb/iq2000-tdep.c | 5 +++-- + gdb/m32r-tdep.c | 2 +- + gdb/m68k-tdep.c | 8 ++++---- + gdb/m88k-tdep.c | 8 ++++---- + gdb/mep-tdep.c | 2 +- + gdb/mips-tdep.c | 48 ++++++++++++++++++++++++------------------------ + gdb/mn10300-tdep.c | 2 +- + gdb/mt-tdep.c | 4 ++-- + gdb/ppc-sysv-tdep.c | 23 ++++++++++++----------- + gdb/rl78-tdep.c | 4 ++-- + gdb/rs6000-aix-tdep.c | 6 +++--- + gdb/s390-linux-tdep.c | 6 +++--- + gdb/score-tdep.c | 2 +- + gdb/sh-tdep.c | 10 ++++++---- + gdb/sh64-tdep.c | 4 ++-- + gdb/sparc64-tdep.c | 12 ++++++------ + gdb/spu-tdep.c | 4 ++-- + gdb/tic6x-tdep.c | 9 +++++---- + gdb/tilegx-tdep.c | 2 +- + gdb/v850-tdep.c | 4 ++-- + gdb/vax-tdep.c | 4 ++-- + gdb/xstormy16-tdep.c | 5 +++-- + gdb/xtensa-tdep.c | 22 +++++++++++----------- + 34 files changed, 151 insertions(+), 143 deletions(-) -Index: gdb-7.99.90.20170420/gdb/alpha-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/alpha-tdep.c 2017-04-20 23:12:07.894566371 +0200 -+++ gdb-7.99.90.20170420/gdb/alpha-tdep.c 2017-04-20 23:12:11.228588703 +0200 -@@ -300,17 +300,17 @@ +diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c +index 6fbf41bcdc..e9ea0b4ba1 100644 +--- a/gdb/alpha-tdep.c ++++ b/gdb/alpha-tdep.c +@@ -301,17 +301,17 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; @@ -169,7 +208,7 @@ Index: gdb-7.99.90.20170420/gdb/alpha-tdep.c CORE_ADDR func_addr = find_function_addr (function, NULL); /* The ABI places the address of the called function in T12. */ -@@ -430,8 +430,8 @@ +@@ -431,8 +431,8 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs; m_arg--, --i >= 0;) { const gdb_byte *contents = m_arg->contents; @@ -180,7 +219,7 @@ Index: gdb-7.99.90.20170420/gdb/alpha-tdep.c /* Copy the bytes destined for registers into arg_reg_buffer. */ if (offset < sizeof(arg_reg_buffer)) -@@ -443,7 +443,7 @@ +@@ -444,7 +444,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else { @@ -189,33 +228,11 @@ Index: gdb-7.99.90.20170420/gdb/alpha-tdep.c memcpy (arg_reg_buffer + offset, contents, tlen); offset += tlen; contents += tlen; -Index: gdb-7.99.90.20170420/gdb/amd64-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/amd64-tdep.c 2017-04-20 23:12:07.897566391 +0200 -+++ gdb-7.99.90.20170420/gdb/amd64-tdep.c 2017-04-20 23:12:11.229588710 +0200 -@@ -735,7 +735,7 @@ - gdb_byte *readbuf, const gdb_byte *writebuf) - { - enum amd64_reg_class theclass[2]; -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; - static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; - int integer_reg = 0; -@@ -852,10 +852,10 @@ - gdb_assert (regnum != -1); - - if (readbuf) -- regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8), -+ regcache_raw_read_part (regcache, regnum, offset, std::min (len, (LONGEST) 8), - readbuf + i * 8); - if (writebuf) -- regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8), -+ regcache_raw_write_part (regcache, regnum, offset, std::min (len, (LONGEST) 8), - writebuf + i * 8); - } - -@@ -886,8 +886,8 @@ +diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c +index 6f998d2303..00c8dd90d0 100644 +--- a/gdb/amd64-tdep.c ++++ b/gdb/amd64-tdep.c +@@ -880,8 +880,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, }; struct value **stack_args = XALLOCAVEC (struct value *, nargs); int num_stack_args = 0; @@ -226,7 +243,7 @@ Index: gdb-7.99.90.20170420/gdb/amd64-tdep.c int integer_reg = 0; int sse_reg = 0; int i; -@@ -899,7 +899,7 @@ +@@ -893,7 +893,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); @@ -235,7 +252,7 @@ Index: gdb-7.99.90.20170420/gdb/amd64-tdep.c enum amd64_reg_class theclass[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; -@@ -963,7 +963,7 @@ +@@ -957,7 +957,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, gdb_assert (regnum != -1); memset (buf, 0, sizeof buf); @@ -244,11 +261,11 @@ Index: gdb-7.99.90.20170420/gdb/amd64-tdep.c regcache_raw_write_part (regcache, regnum, offset, 8, buf); } } -Index: gdb-7.99.90.20170420/gdb/amd64-windows-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/amd64-windows-tdep.c 2017-04-20 23:12:07.897566391 +0200 -+++ gdb-7.99.90.20170420/gdb/amd64-windows-tdep.c 2017-04-20 23:12:11.230588717 +0200 -@@ -290,7 +290,7 @@ +diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c +index 975c6848a4..a0eedb2a9b 100644 +--- a/gdb/amd64-windows-tdep.c ++++ b/gdb/amd64-windows-tdep.c +@@ -291,7 +291,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { @@ -257,11 +274,11 @@ Index: gdb-7.99.90.20170420/gdb/amd64-windows-tdep.c int regnum = -1; /* See if our value is returned through a register. If it is, then -Index: gdb-7.99.90.20170420/gdb/arm-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/arm-tdep.c 2017-04-20 23:12:07.905566445 +0200 -+++ gdb-7.99.90.20170420/gdb/arm-tdep.c 2017-04-20 23:12:11.233588737 +0200 -@@ -3492,7 +3492,7 @@ +diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c +index 54c6392ba7..39dcdb73ff 100644 +--- a/gdb/arm-tdep.c ++++ b/gdb/arm-tdep.c +@@ -3477,7 +3477,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b) array). Vector types are not currently supported, matching the generic AAPCS support. */ @@ -270,7 +287,7 @@ Index: gdb-7.99.90.20170420/gdb/arm-tdep.c arm_vfp_cprc_sub_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type) { -@@ -3575,7 +3575,7 @@ +@@ -3560,7 +3560,7 @@ arm_vfp_cprc_sub_candidate (struct type *t, } else { @@ -279,7 +296,7 @@ Index: gdb-7.99.90.20170420/gdb/arm-tdep.c unsigned unitlen; count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t), -@@ -3598,12 +3598,12 @@ +@@ -3583,12 +3583,12 @@ arm_vfp_cprc_sub_candidate (struct type *t, case TYPE_CODE_STRUCT: { @@ -294,7 +311,7 @@ Index: gdb-7.99.90.20170420/gdb/arm-tdep.c if (!field_is_static (&TYPE_FIELD (t, i))) sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), -@@ -3627,13 +3627,15 @@ +@@ -3612,13 +3612,15 @@ arm_vfp_cprc_sub_candidate (struct type *t, case TYPE_CODE_UNION: { @@ -313,7 +330,7 @@ Index: gdb-7.99.90.20170420/gdb/arm-tdep.c if (sub_count == -1) return -1; count = (count > sub_count ? count : sub_count); -@@ -3669,7 +3671,7 @@ +@@ -3654,7 +3656,7 @@ arm_vfp_call_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type, int *count) { enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN; @@ -322,7 +339,7 @@ Index: gdb-7.99.90.20170420/gdb/arm-tdep.c if (c <= 0 || c > 4) return 0; *base_type = b; -@@ -3750,7 +3752,7 @@ +@@ -3735,7 +3737,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { @@ -331,11 +348,11 @@ Index: gdb-7.99.90.20170420/gdb/arm-tdep.c struct type *arg_type; struct type *target_type; enum type_code typecode; -Index: gdb-7.99.90.20170420/gdb/avr-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/avr-tdep.c 2017-04-20 23:12:07.907566458 +0200 -+++ gdb-7.99.90.20170420/gdb/avr-tdep.c 2017-04-20 23:12:11.234588743 +0200 -@@ -1191,13 +1191,13 @@ +diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c +index f4ce2706d4..9bd51fd643 100644 +--- a/gdb/avr-tdep.c ++++ b/gdb/avr-tdep.c +@@ -1191,13 +1191,13 @@ avr_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) struct stack_item { @@ -351,7 +368,7 @@ Index: gdb-7.99.90.20170420/gdb/avr-tdep.c { struct stack_item *si; si = XNEW (struct stack_item); -@@ -1285,12 +1285,12 @@ +@@ -1285,12 +1285,12 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { @@ -367,11 +384,11 @@ Index: gdb-7.99.90.20170420/gdb/avr-tdep.c /* Calculate the potential last register needed. E.g. For length 2, registers regnum and regnum-1 (say 25 and 24) -Index: gdb-7.99.90.20170420/gdb/bfin-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/bfin-tdep.c 2017-04-20 23:12:07.907566458 +0200 -+++ gdb-7.99.90.20170420/gdb/bfin-tdep.c 2017-04-20 23:12:11.234588743 +0200 -@@ -504,7 +504,7 @@ +diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c +index f9594d7947..1628f2a820 100644 +--- a/gdb/bfin-tdep.c ++++ b/gdb/bfin-tdep.c +@@ -504,7 +504,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; long reg_r0, reg_r1, reg_r2; @@ -380,7 +397,7 @@ Index: gdb-7.99.90.20170420/gdb/bfin-tdep.c for (i = nargs - 1; i >= 0; i--) { -@@ -526,7 +526,7 @@ +@@ -526,7 +526,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, { struct type *value_type = value_enclosing_type (args[i]); struct type *arg_type = check_typedef (value_type); @@ -389,11 +406,11 @@ Index: gdb-7.99.90.20170420/gdb/bfin-tdep.c sp -= container_len; write_memory (sp, value_contents (args[i]), container_len); -Index: gdb-7.99.90.20170420/gdb/cris-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/cris-tdep.c 2017-04-20 23:12:07.909566471 +0200 -+++ gdb-7.99.90.20170420/gdb/cris-tdep.c 2017-04-20 23:12:11.235588750 +0200 -@@ -663,13 +663,13 @@ +diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c +index 9fbb8b4fac..82f25084bd 100644 +--- a/gdb/cris-tdep.c ++++ b/gdb/cris-tdep.c +@@ -663,13 +663,13 @@ static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch, struct stack_item { @@ -409,7 +426,7 @@ Index: gdb-7.99.90.20170420/gdb/cris-tdep.c { struct stack_item *si = XNEW (struct stack_item); si->data = (gdb_byte *) xmalloc (len); -@@ -833,13 +833,13 @@ +@@ -833,13 +833,13 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { @@ -427,11 +444,11 @@ Index: gdb-7.99.90.20170420/gdb/cris-tdep.c /* How may registers worth of storage do we need for this argument? */ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0); -Index: gdb-7.99.90.20170420/gdb/h8300-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/h8300-tdep.c 2017-04-20 23:12:07.910566478 +0200 -+++ gdb-7.99.90.20170420/gdb/h8300-tdep.c 2017-04-20 23:12:11.235588750 +0200 -@@ -637,7 +637,7 @@ +diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c +index acc2da93a4..9e380e12ba 100644 +--- a/gdb/h8300-tdep.c ++++ b/gdb/h8300-tdep.c +@@ -637,7 +637,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int struct_return, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -440,9 +457,9 @@ Index: gdb-7.99.90.20170420/gdb/h8300-tdep.c int wordsize = BINWORD (gdbarch); int reg = E_ARG0_REGNUM; int argument; -@@ -664,11 +664,11 @@ +@@ -663,11 +663,11 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + for (argument = 0; argument < nargs; argument++) { - struct cleanup *back_to; struct type *type = value_type (args[argument]); - int len = TYPE_LENGTH (type); + ssize_t len = TYPE_LENGTH (type); @@ -451,10 +468,10 @@ Index: gdb-7.99.90.20170420/gdb/h8300-tdep.c /* Pad the argument appropriately. */ - int padded_len = align_up (len, wordsize); + ssize_t padded_len = align_up (len, wordsize); - gdb_byte *padded = (gdb_byte *) xmalloc (padded_len); - back_to = make_cleanup (xfree, padded); + /* Use std::vector here to get zero initialization. */ + std::vector padded (padded_len); -@@ -697,7 +697,7 @@ +@@ -696,7 +696,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Heavens to Betsy --- it's really going in registers! Note that on the h8/300s, there are gaps between the registers in the register file. */ @@ -463,11 +480,11 @@ Index: gdb-7.99.90.20170420/gdb/h8300-tdep.c for (offset = 0; offset < padded_len; offset += wordsize) { -Index: gdb-7.99.90.20170420/gdb/hppa-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/hppa-tdep.c 2017-04-20 23:12:07.911566485 +0200 -+++ gdb-7.99.90.20170420/gdb/hppa-tdep.c 2017-04-20 23:12:11.236588757 +0200 -@@ -989,7 +989,7 @@ +diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c +index 141399f6a3..8223f84da4 100644 +--- a/gdb/hppa-tdep.c ++++ b/gdb/hppa-tdep.c +@@ -989,7 +989,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = value_type (arg); @@ -476,7 +493,7 @@ Index: gdb-7.99.90.20170420/gdb/hppa-tdep.c const bfd_byte *valbuf; bfd_byte fptrbuf[8]; int regnum; -@@ -1184,7 +1184,7 @@ +@@ -1184,7 +1184,7 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { @@ -485,11 +502,11 @@ Index: gdb-7.99.90.20170420/gdb/hppa-tdep.c int regnum, offset; if (len > 16) -Index: gdb-7.99.90.20170420/gdb/i386-darwin-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/i386-darwin-tdep.c 2017-04-20 23:12:07.912566492 +0200 -+++ gdb-7.99.90.20170420/gdb/i386-darwin-tdep.c 2017-04-20 23:12:11.237588763 +0200 -@@ -167,7 +167,7 @@ +diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c +index c642040432..1b30a50639 100644 +--- a/gdb/i386-darwin-tdep.c ++++ b/gdb/i386-darwin-tdep.c +@@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { @@ -498,11 +515,11 @@ Index: gdb-7.99.90.20170420/gdb/i386-darwin-tdep.c int num_m128 = 0; if (struct_return) -Index: gdb-7.99.90.20170420/gdb/i386-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/i386-tdep.c 2017-04-20 23:12:07.917566525 +0200 -+++ gdb-7.99.90.20170420/gdb/i386-tdep.c 2017-04-20 23:12:11.239588777 +0200 -@@ -2682,7 +2682,7 @@ +diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c +index d4f61eec76..5f6e31c9b3 100644 +--- a/gdb/i386-tdep.c ++++ b/gdb/i386-tdep.c +@@ -2677,7 +2677,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[4]; int i; int write_pass; @@ -511,7 +528,7 @@ Index: gdb-7.99.90.20170420/gdb/i386-tdep.c /* BND registers can be in arbitrary values at the moment of the inferior call. This can cause boundary violations that are not -@@ -2697,7 +2697,7 @@ +@@ -2692,7 +2692,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { @@ -520,7 +537,7 @@ Index: gdb-7.99.90.20170420/gdb/i386-tdep.c if (struct_return) { -@@ -2714,7 +2714,7 @@ +@@ -2709,7 +2709,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { @@ -529,7 +546,7 @@ Index: gdb-7.99.90.20170420/gdb/i386-tdep.c if (write_pass) { -@@ -2921,7 +2921,7 @@ +@@ -2916,7 +2916,7 @@ i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum type_code code = TYPE_CODE (type); @@ -538,7 +555,7 @@ Index: gdb-7.99.90.20170420/gdb/i386-tdep.c gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION -@@ -3743,7 +3743,7 @@ +@@ -3738,7 +3738,7 @@ static int i386_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) { @@ -547,7 +564,7 @@ Index: gdb-7.99.90.20170420/gdb/i386-tdep.c /* Values may be spread across multiple registers. Most debugging formats aren't expressive enough to specify the locations, so -@@ -3776,7 +3776,7 @@ +@@ -3771,7 +3771,7 @@ i386_register_to_value (struct frame_info *frame, int regnum, int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -556,7 +573,7 @@ Index: gdb-7.99.90.20170420/gdb/i386-tdep.c if (i386_fp_regnum_p (gdbarch, regnum)) return i387_register_to_value (frame, regnum, type, to, -@@ -3812,7 +3812,7 @@ +@@ -3807,7 +3807,7 @@ static void i386_value_to_register (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *from) { @@ -565,11 +582,11 @@ Index: gdb-7.99.90.20170420/gdb/i386-tdep.c if (i386_fp_regnum_p (get_frame_arch (frame), regnum)) { -Index: gdb-7.99.90.20170420/gdb/iq2000-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/iq2000-tdep.c 2017-04-20 23:12:07.918566532 +0200 -+++ gdb-7.99.90.20170420/gdb/iq2000-tdep.c 2017-04-20 23:12:11.239588777 +0200 -@@ -651,8 +651,9 @@ +diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c +index e47cc06a1f..7dc999d10e 100644 +--- a/gdb/iq2000-tdep.c ++++ b/gdb/iq2000-tdep.c +@@ -651,8 +651,9 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const bfd_byte *val; bfd_byte buf[4]; struct type *type; @@ -581,11 +598,11 @@ Index: gdb-7.99.90.20170420/gdb/iq2000-tdep.c /* Used to copy struct arguments into the stack. */ CORE_ADDR struct_ptr; -Index: gdb-7.99.90.20170420/gdb/m32r-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/m32r-tdep.c 2017-04-20 23:12:11.239588777 +0200 -+++ gdb-7.99.90.20170420/gdb/m32r-tdep.c 2017-04-20 23:12:30.385717023 +0200 -@@ -681,7 +681,7 @@ +diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c +index c00455bb5f..663ca20486 100644 +--- a/gdb/m32r-tdep.c ++++ b/gdb/m32r-tdep.c +@@ -679,7 +679,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, CORE_ADDR regval; gdb_byte *val; gdb_byte valbuf[M32R_ARG_REGISTER_SIZE]; @@ -594,11 +611,11 @@ Index: gdb-7.99.90.20170420/gdb/m32r-tdep.c /* First force sp to a 4-byte alignment. */ sp = sp & ~3; -Index: gdb-7.99.90.20170420/gdb/m68k-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/m68k-tdep.c 2017-04-20 23:12:07.919566538 +0200 -+++ gdb-7.99.90.20170420/gdb/m68k-tdep.c 2017-04-20 23:12:11.240588783 +0200 -@@ -377,7 +377,7 @@ +diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c +index 9dc1fe6f01..19c75f21d3 100644 +--- a/gdb/m68k-tdep.c ++++ b/gdb/m68k-tdep.c +@@ -373,7 +373,7 @@ m68k_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum type_code code = TYPE_CODE (type); @@ -607,7 +624,7 @@ Index: gdb-7.99.90.20170420/gdb/m68k-tdep.c gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION || code == TYPE_CODE_COMPLEX); -@@ -509,9 +509,9 @@ +@@ -505,9 +505,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); @@ -620,13 +637,13 @@ Index: gdb-7.99.90.20170420/gdb/m68k-tdep.c /* Non-scalars bigger than 4 bytes are left aligned, others are right aligned. */ -Index: gdb-7.99.90.20170420/gdb/m88k-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/m88k-tdep.c 2017-04-20 23:12:07.919566538 +0200 -+++ gdb-7.99.90.20170420/gdb/m88k-tdep.c 2017-04-20 23:12:11.240588783 +0200 -@@ -254,13 +254,13 @@ +diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c +index 6be27a96c6..8f186c75a2 100644 +--- a/gdb/m88k-tdep.c ++++ b/gdb/m88k-tdep.c +@@ -254,13 +254,13 @@ m88k_store_arguments (struct regcache *regcache, int nargs, { - struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch *gdbarch = regcache->arch (); int num_register_words = 0; - int num_stack_words = 0; + LONGEST num_stack_words = 0; @@ -640,7 +657,7 @@ Index: gdb-7.99.90.20170420/gdb/m88k-tdep.c if (m88k_integral_or_pointer_p (type) && len < 4) { -@@ -302,8 +302,8 @@ +@@ -302,8 +302,8 @@ m88k_store_arguments (struct regcache *regcache, int nargs, { const bfd_byte *valbuf = value_contents (args[i]); struct type *type = value_type (args[i]); @@ -651,11 +668,11 @@ Index: gdb-7.99.90.20170420/gdb/m88k-tdep.c if (m88k_in_register_p (type)) { -Index: gdb-7.99.90.20170420/gdb/mep-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/mep-tdep.c 2017-04-20 23:12:07.920566545 +0200 -+++ gdb-7.99.90.20170420/gdb/mep-tdep.c 2017-04-20 23:12:11.241588790 +0200 -@@ -2262,7 +2262,7 @@ +diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c +index bf08ca14d2..224642fe42 100644 +--- a/gdb/mep-tdep.c ++++ b/gdb/mep-tdep.c +@@ -2256,7 +2256,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, for (i = 0; i < argc; i++) { @@ -664,11 +681,11 @@ Index: gdb-7.99.90.20170420/gdb/mep-tdep.c if (arg_len > MEP_GPR_SIZE) { -Index: gdb-7.99.90.20170420/gdb/mips-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/mips-tdep.c 2017-04-20 23:12:07.928566599 +0200 -+++ gdb-7.99.90.20170420/gdb/mips-tdep.c 2017-04-20 23:12:11.243588804 +0200 -@@ -474,7 +474,7 @@ +diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c +index 830535f73d..0aca8ce3e0 100644 +--- a/gdb/mips-tdep.c ++++ b/gdb/mips-tdep.c +@@ -477,7 +477,7 @@ static void mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, enum bfd_endian endian, gdb_byte *in, @@ -677,7 +694,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c { int reg_offset = 0; -@@ -497,8 +497,8 @@ +@@ -500,8 +500,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, } if (mips_debug) fprintf_unfiltered (gdb_stderr, @@ -688,8 +705,8 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c if (mips_debug && out != NULL) { int i; -@@ -4530,13 +4530,13 @@ - gdb_byte valbuf[MAX_REGISTER_SIZE]; +@@ -4534,13 +4534,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + gdb_byte ref_valbuf[MAX_MIPS_ABI_REGSIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); @@ -705,7 +722,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c /* The EABI passes structures that do not fit in a register by reference. */ -@@ -4805,7 +4805,7 @@ +@@ -4810,7 +4810,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, @@ -714,7 +731,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c { int i; -@@ -4820,7 +4820,7 @@ +@@ -4825,7 +4825,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { @@ -723,7 +740,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c struct type *field_type; /* We're only looking at normal fields. */ -@@ -4862,7 +4862,7 @@ +@@ -4867,7 +4867,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -732,7 +749,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5213,11 +5213,11 @@ +@@ -5218,11 +5218,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { @@ -748,7 +765,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive -@@ -5259,8 +5259,8 @@ +@@ -5264,8 +5264,8 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, if (offset + xfer > TYPE_LENGTH (type)) xfer = TYPE_LENGTH (type) - offset; if (mips_debug) @@ -759,7 +776,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c mips_xfer_register (gdbarch, regcache, gdbarch_num_regs (gdbarch) + regnum, xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf, -@@ -5318,7 +5318,7 @@ +@@ -5323,7 +5323,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -768,7 +785,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5382,13 +5382,13 @@ +@@ -5387,13 +5387,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -785,7 +802,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c val = value_contents (arg); -@@ -5843,8 +5843,8 @@ +@@ -5847,8 +5847,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -796,7 +813,7 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5904,13 +5904,13 @@ +@@ -5908,13 +5908,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -813,11 +830,11 @@ Index: gdb-7.99.90.20170420/gdb/mips-tdep.c val = value_contents (arg); -Index: gdb-7.99.90.20170420/gdb/mn10300-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/mn10300-tdep.c 2017-04-20 23:12:07.929566605 +0200 -+++ gdb-7.99.90.20170420/gdb/mn10300-tdep.c 2017-04-20 23:12:11.243588804 +0200 -@@ -1220,7 +1220,7 @@ +diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c +index eadbbb367e..39d24b2ad1 100644 +--- a/gdb/mn10300-tdep.c ++++ b/gdb/mn10300-tdep.c +@@ -1212,7 +1212,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); int regs_used; @@ -826,11 +843,11 @@ Index: gdb-7.99.90.20170420/gdb/mn10300-tdep.c int stack_offset = 0; int argnum; const gdb_byte *val; -Index: gdb-7.99.90.20170420/gdb/mt-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/mt-tdep.c 2017-04-20 23:12:07.930566612 +0200 -+++ gdb-7.99.90.20170420/gdb/mt-tdep.c 2017-04-20 23:12:11.244588810 +0200 -@@ -788,9 +788,9 @@ +diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c +index 7992394ca2..5dd20ca8b0 100644 +--- a/gdb/mt-tdep.c ++++ b/gdb/mt-tdep.c +@@ -789,9 +789,9 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[MT_MAX_STRUCT_SIZE]; int argreg = MT_1ST_ARGREG; int split_param_len = 0; @@ -842,11 +859,11 @@ Index: gdb-7.99.90.20170420/gdb/mt-tdep.c int i, j; /* First handle however many args we can fit into MT_1ST_ARGREG thru -Index: gdb-7.99.90.20170420/gdb/ppc-sysv-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/ppc-sysv-tdep.c 2017-04-20 23:12:07.931566619 +0200 -+++ gdb-7.99.90.20170420/gdb/ppc-sysv-tdep.c 2017-04-20 23:12:11.245588817 +0200 -@@ -67,7 +67,7 @@ +diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c +index b43f22da17..24820fa6ab 100644 +--- a/gdb/ppc-sysv-tdep.c ++++ b/gdb/ppc-sysv-tdep.c +@@ -68,7 +68,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function)); ULONGEST saved_sp; @@ -855,7 +872,7 @@ Index: gdb-7.99.90.20170420/gdb/ppc-sysv-tdep.c int write_pass; gdb_assert (tdep->wordsize == 4); -@@ -98,9 +98,9 @@ +@@ -99,9 +99,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Next available vector register for vector arguments. */ int vreg = 2; /* Arguments start above the "LR save word" and "Back chain". */ @@ -867,7 +884,7 @@ Index: gdb-7.99.90.20170420/gdb/ppc-sysv-tdep.c /* If the function is returning a `struct', then the first word (which will be passed in r3) is used for struct return -@@ -119,7 +119,7 @@ +@@ -120,7 +120,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[argno]; struct type *type = check_typedef (value_type (arg)); @@ -876,7 +893,7 @@ Index: gdb-7.99.90.20170420/gdb/ppc-sysv-tdep.c const bfd_byte *val = value_contents (arg); if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 -@@ -1284,11 +1284,11 @@ +@@ -1285,11 +1285,11 @@ struct ppc64_sysv_argpos static void ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, @@ -886,15 +903,61 @@ Index: gdb-7.99.90.20170420/gdb/ppc-sysv-tdep.c { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int offset = 0; -+ ssize_t offset = 0; ++ LONGEST offset = 0; /* Enforce alignment of stack location, if requested. */ if (align > tdep->wordsize) -Index: gdb-7.99.90.20170420/gdb/rl78-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/rl78-tdep.c 2017-04-20 23:12:07.931566619 +0200 -+++ gdb-7.99.90.20170420/gdb/rl78-tdep.c 2017-04-20 23:12:11.245588817 +0200 -@@ -1352,8 +1352,8 @@ +@@ -1327,7 +1327,7 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, + if (argpos->regcache && argpos->greg <= 10) + regcache_cooked_write_part (argpos->regcache, + tdep->ppc_gp0_regnum + argpos->greg, +- offset, len, val); ++ offset, (LONGEST) len, val); + argpos->greg++; + } + } +@@ -1386,7 +1386,7 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, + if (argpos->regcache && argpos->freg <= 13) + { + int regnum = tdep->ppc_fp0_regnum + argpos->freg; +- int offset = 0; ++ LONGEST offset = 0; + + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + offset = 8 - TYPE_LENGTH (type); +@@ -1836,7 +1836,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, + && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT) + { + int regnum = tdep->ppc_fp0_regnum + 1 + index; +- int offset = 0; ++ LONGEST offset = 0; + + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + offset = 8 - TYPE_LENGTH (valtype); +@@ -1912,7 +1912,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, + && TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)) + { + int regnum = tdep->ppc_gp0_regnum + 3 + index; +- int offset = 0; ++ LONGEST offset = 0; + + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + offset = 8 - TYPE_LENGTH (valtype); +@@ -2020,7 +2020,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, + && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1) + { + int regnum = tdep->ppc_gp0_regnum + 3; +- int offset = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype)); ++ LONGEST offset ++ = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype)); + + if (writebuf != NULL) + regcache_cooked_write_part (regcache, regnum, +diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c +index 19f8098b7b..92a48ba513 100644 +--- a/gdb/rl78-tdep.c ++++ b/gdb/rl78-tdep.c +@@ -1347,8 +1347,8 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); @@ -905,11 +968,11 @@ Index: gdb-7.99.90.20170420/gdb/rl78-tdep.c sp -= container_len; write_memory (rl78_make_data_address (sp), -Index: gdb-7.99.90.20170420/gdb/rs6000-aix-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/rs6000-aix-tdep.c 2017-04-20 23:12:07.932566626 +0200 -+++ gdb-7.99.90.20170420/gdb/rs6000-aix-tdep.c 2017-04-20 23:12:11.245588817 +0200 -@@ -186,9 +186,9 @@ +diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c +index 8cc7539a8c..fc953c33d4 100644 +--- a/gdb/rs6000-aix-tdep.c ++++ b/gdb/rs6000-aix-tdep.c +@@ -187,9 +187,9 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int ii; @@ -921,7 +984,7 @@ Index: gdb-7.99.90.20170420/gdb/rs6000-aix-tdep.c gdb_byte tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ int wordsize = gdbarch_tdep (gdbarch)->wordsize; -@@ -319,7 +319,7 @@ +@@ -319,7 +319,7 @@ ran_out_of_registers_for_arguments: if ((argno < nargs) || argbytes) { @@ -930,11 +993,11 @@ Index: gdb-7.99.90.20170420/gdb/rs6000-aix-tdep.c if (argbytes) { -Index: gdb-7.99.90.20170420/gdb/s390-linux-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/s390-linux-tdep.c 2017-04-20 23:12:07.934566639 +0200 -+++ gdb-7.99.90.20170420/gdb/s390-linux-tdep.c 2017-04-20 23:12:11.247588830 +0200 -@@ -3081,7 +3081,7 @@ +diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c +index a0d4cdd740..2617919e8a 100644 +--- a/gdb/s390-linux-tdep.c ++++ b/gdb/s390-linux-tdep.c +@@ -3132,7 +3132,7 @@ s390_function_arg_vector (struct type *type) /* Determine whether N is a power of two. */ static int @@ -943,20 +1006,29 @@ Index: gdb-7.99.90.20170420/gdb/s390-linux-tdep.c { return n && ((n & (n - 1)) == 0); } -@@ -3138,7 +3138,7 @@ +@@ -3189,7 +3189,7 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg, enum bfd_endian byte_order, int is_unnamed) { struct type *type = check_typedef (value_type (arg)); - unsigned int length = TYPE_LENGTH (type); -+ ULONGEST length = TYPE_LENGTH (type); ++ LONGEST length = TYPE_LENGTH (type); int write_mode = as->regcache != NULL; if (s390_function_arg_float (type)) -Index: gdb-7.99.90.20170420/gdb/score-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/score-tdep.c 2017-04-20 23:12:07.935566646 +0200 -+++ gdb-7.99.90.20170420/gdb/score-tdep.c 2017-04-20 23:12:11.248588837 +0200 -@@ -525,7 +525,7 @@ +@@ -3452,7 +3452,7 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type, + { + enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + int word_size = gdbarch_ptr_bit (gdbarch) / 8; +- int length = TYPE_LENGTH (type); ++ LONGEST length = TYPE_LENGTH (type); + int code = TYPE_CODE (type); + + if (code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT) +diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c +index 5b68a2b332..9a16cc809e 100644 +--- a/gdb/score-tdep.c ++++ b/gdb/score-tdep.c +@@ -516,7 +516,7 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argnum; int argreg; @@ -965,11 +1037,11 @@ Index: gdb-7.99.90.20170420/gdb/score-tdep.c CORE_ADDR stack_offset = 0; CORE_ADDR addr = 0; -Index: gdb-7.99.90.20170420/gdb/sh-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/sh-tdep.c 2017-04-20 23:12:07.936566652 +0200 -+++ gdb-7.99.90.20170420/gdb/sh-tdep.c 2017-04-20 23:12:11.248588837 +0200 -@@ -814,7 +814,7 @@ +diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c +index 23675bb6cc..60cc6d3f4e 100644 +--- a/gdb/sh-tdep.c ++++ b/gdb/sh-tdep.c +@@ -813,7 +813,7 @@ sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) static int sh_use_struct_convention (int renesas_abi, struct type *type) { @@ -978,7 +1050,7 @@ Index: gdb-7.99.90.20170420/gdb/sh-tdep.c int nelem = TYPE_NFIELDS (type); /* The Renesas ABI returns aggregate types always on stack. */ -@@ -916,7 +916,7 @@ +@@ -915,7 +915,7 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp) /* Helper function to justify value in register according to endianess. */ static const gdb_byte * @@ -987,7 +1059,7 @@ Index: gdb-7.99.90.20170420/gdb/sh-tdep.c { static gdb_byte valbuf[4]; -@@ -1076,7 +1076,8 @@ +@@ -1075,7 +1075,8 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch, struct type *type; CORE_ADDR regval; const gdb_byte *val; @@ -997,7 +1069,7 @@ Index: gdb-7.99.90.20170420/gdb/sh-tdep.c int pass_on_stack = 0; int treat_as_flt; int last_reg_arg = INT_MAX; -@@ -1217,7 +1218,8 @@ +@@ -1216,7 +1217,8 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch, struct type *type; CORE_ADDR regval; const gdb_byte *val; @@ -1007,11 +1079,11 @@ Index: gdb-7.99.90.20170420/gdb/sh-tdep.c int pass_on_stack = 0; int last_reg_arg = INT_MAX; -Index: gdb-7.99.90.20170420/gdb/sh64-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/sh64-tdep.c 2017-04-20 23:12:07.937566659 +0200 -+++ gdb-7.99.90.20170420/gdb/sh64-tdep.c 2017-04-20 23:12:11.249588844 +0200 -@@ -1062,7 +1062,7 @@ +diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c +index 3004f15b03..01d0ca870c 100644 +--- a/gdb/sh64-tdep.c ++++ b/gdb/sh64-tdep.c +@@ -1079,7 +1079,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -1020,7 +1092,7 @@ Index: gdb-7.99.90.20170420/gdb/sh64-tdep.c int int_argreg; int float_arg_index = 0; int double_arg_index = 0; -@@ -1071,7 +1071,7 @@ +@@ -1088,7 +1088,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR regval; const gdb_byte *val; gdb_byte valbuf[8]; @@ -1029,34 +1101,20 @@ Index: gdb-7.99.90.20170420/gdb/sh64-tdep.c int argreg_size; int fp_args[12]; -Index: gdb-7.99.90.20170420/gdb/sparc-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/sparc-tdep.c 2017-04-20 23:12:07.938566666 +0200 -+++ gdb-7.99.90.20170420/gdb/sparc-tdep.c 2017-04-20 23:12:11.249588844 +0200 -@@ -567,7 +567,7 @@ - for (i = 0; i < nargs; i++) - { - struct type *type = value_type (args[i]); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - if (sparc_structure_or_union_p (type) - || (sparc_floating_p (type) && len == 16) -Index: gdb-7.99.90.20170420/gdb/sparc64-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/sparc64-tdep.c 2017-04-20 23:12:07.939566672 +0200 -+++ gdb-7.99.90.20170420/gdb/sparc64-tdep.c 2017-04-20 23:12:11.250588851 +0200 -@@ -696,7 +696,8 @@ +diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c +index 55aef132d9..ce1cf41d2f 100644 +--- a/gdb/sparc64-tdep.c ++++ b/gdb/sparc64-tdep.c +@@ -1205,7 +1205,7 @@ sparc64_16_byte_align_p (struct type *type) static void sparc64_store_floating_fields (struct regcache *regcache, struct type *type, - const gdb_byte *valbuf, int element, int bitpos) -+ const gdb_byte *valbuf, int element, -+ LONGEST bitpos) ++ const gdb_byte *valbuf, int element, LONGEST bitpos) { - struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch *gdbarch = regcache->arch (); int len = TYPE_LENGTH (type); -@@ -740,7 +741,7 @@ +@@ -1265,7 +1265,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -1065,16 +1123,16 @@ Index: gdb-7.99.90.20170420/gdb/sparc64-tdep.c sparc64_store_floating_fields (regcache, subtype, valbuf, element, subpos); -@@ -772,7 +773,7 @@ +@@ -1297,7 +1297,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, static void sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, - gdb_byte *valbuf, int bitpos) + gdb_byte *valbuf, LONGEST bitpos) { - struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch *gdbarch = regcache->arch (); -@@ -812,7 +813,7 @@ +@@ -1353,7 +1353,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -1083,7 +1141,7 @@ Index: gdb-7.99.90.20170420/gdb/sparc64-tdep.c sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); } -@@ -845,7 +846,7 @@ +@@ -1386,7 +1386,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); @@ -1092,7 +1150,7 @@ Index: gdb-7.99.90.20170420/gdb/sparc64-tdep.c if (sparc64_structure_or_union_p (type) || (sparc64_complex_floating_p (type) && len == 32)) -@@ -945,7 +946,7 @@ +@@ -1486,7 +1486,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, { const gdb_byte *valbuf = value_contents (args[i]); struct type *type = value_type (args[i]); @@ -1101,11 +1159,11 @@ Index: gdb-7.99.90.20170420/gdb/sparc64-tdep.c int regnum = -1; gdb_byte buf[16]; -Index: gdb-7.99.90.20170420/gdb/spu-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/spu-tdep.c 2017-04-20 23:12:07.940566679 +0200 -+++ gdb-7.99.90.20170420/gdb/spu-tdep.c 2017-04-20 23:12:11.251588857 +0200 -@@ -1431,7 +1431,7 @@ +diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c +index 34a536a260..4b39b1785e 100644 +--- a/gdb/spu-tdep.c ++++ b/gdb/spu-tdep.c +@@ -1430,7 +1430,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); const gdb_byte *contents = value_contents (arg); @@ -1114,7 +1172,7 @@ Index: gdb-7.99.90.20170420/gdb/spu-tdep.c /* If the argument doesn't wholly fit into registers, it and all subsequent arguments go to the stack. */ -@@ -1463,7 +1463,7 @@ +@@ -1462,7 +1462,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); @@ -1123,11 +1181,11 @@ Index: gdb-7.99.90.20170420/gdb/spu-tdep.c int preferred_slot; if (spu_scalar_value_p (type)) -Index: gdb-7.99.90.20170420/gdb/tic6x-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/tic6x-tdep.c 2017-04-20 23:12:07.940566679 +0200 -+++ gdb-7.99.90.20170420/gdb/tic6x-tdep.c 2017-04-20 23:12:11.251588857 +0200 -@@ -899,7 +899,7 @@ +diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c +index 66f2259612..3c7f55f500 100644 +--- a/gdb/tic6x-tdep.c ++++ b/gdb/tic6x-tdep.c +@@ -883,7 +883,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg = 0; int argnum; int stack_offset = 4; @@ -1136,7 +1194,7 @@ Index: gdb-7.99.90.20170420/gdb/tic6x-tdep.c CORE_ADDR func_addr = find_function_addr (function, NULL); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct type *func_type = value_type (function); -@@ -933,7 +933,7 @@ +@@ -917,7 +917,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Now make space on the stack for the args. */ for (argnum = 0; argnum < nargs; argnum++) { @@ -1145,7 +1203,7 @@ Index: gdb-7.99.90.20170420/gdb/tic6x-tdep.c if (argnum >= 10 - argreg) references_offset += len; stack_offset += len; -@@ -952,7 +952,7 @@ +@@ -936,7 +936,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1154,7 +1212,7 @@ Index: gdb-7.99.90.20170420/gdb/tic6x-tdep.c enum type_code typecode = TYPE_CODE (arg_type); val = value_contents (arg); -@@ -1112,7 +1112,8 @@ +@@ -1096,7 +1096,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else internal_error (__FILE__, __LINE__, @@ -1164,11 +1222,11 @@ Index: gdb-7.99.90.20170420/gdb/tic6x-tdep.c addr = sp + stack_offset; write_memory (addr, val, len); -Index: gdb-7.99.90.20170420/gdb/tilegx-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/tilegx-tdep.c 2017-04-20 23:12:07.941566686 +0200 -+++ gdb-7.99.90.20170420/gdb/tilegx-tdep.c 2017-04-20 23:12:11.251588857 +0200 -@@ -289,7 +289,7 @@ +diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c +index 3a630c33d8..33a3caafcf 100644 +--- a/gdb/tilegx-tdep.c ++++ b/gdb/tilegx-tdep.c +@@ -288,7 +288,7 @@ tilegx_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR stack_dest = sp; int argreg = TILEGX_R0_REGNUM; int i, j; @@ -1177,11 +1235,11 @@ Index: gdb-7.99.90.20170420/gdb/tilegx-tdep.c static const gdb_byte four_zero_words[16] = { 0 }; /* If struct_return is 1, then the struct return address will -Index: gdb-7.99.90.20170420/gdb/v850-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/v850-tdep.c 2017-04-20 23:12:07.941566686 +0200 -+++ gdb-7.99.90.20170420/gdb/v850-tdep.c 2017-04-20 23:12:11.252588864 +0200 -@@ -1019,7 +1019,7 @@ +diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c +index 065cc9b882..79b877325b 100644 +--- a/gdb/v850-tdep.c ++++ b/gdb/v850-tdep.c +@@ -1019,7 +1019,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argreg; int argnum; @@ -1190,7 +1248,7 @@ Index: gdb-7.99.90.20170420/gdb/v850-tdep.c int stack_offset; if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850) -@@ -1047,7 +1047,7 @@ +@@ -1047,7 +1047,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, in four registers available. Loop thru args from first to last. */ for (argnum = 0; argnum < nargs; argnum++) { @@ -1199,12 +1257,12 @@ Index: gdb-7.99.90.20170420/gdb/v850-tdep.c gdb_byte *val; gdb_byte valbuf[v850_reg_size]; -Index: gdb-7.99.90.20170420/gdb/vax-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/vax-tdep.c 2017-04-20 23:12:07.942566692 +0200 -+++ gdb-7.99.90.20170420/gdb/vax-tdep.c 2017-04-20 23:12:11.252588864 +0200 -@@ -111,7 +111,7 @@ - struct gdbarch *gdbarch = get_regcache_arch (regcache); +diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c +index f31acc8f01..03d7c61dcd 100644 +--- a/gdb/vax-tdep.c ++++ b/gdb/vax-tdep.c +@@ -110,7 +110,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, + struct gdbarch *gdbarch = regcache->arch (); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[4]; - int count = 0; @@ -1212,7 +1270,7 @@ Index: gdb-7.99.90.20170420/gdb/vax-tdep.c int i; /* We create an argument list on the stack, and make the argument -@@ -120,7 +120,7 @@ +@@ -119,7 +119,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, /* Push arguments in reverse order. */ for (i = nargs - 1; i >= 0; i--) { @@ -1221,11 +1279,11 @@ Index: gdb-7.99.90.20170420/gdb/vax-tdep.c sp -= (len + 3) & ~3; count += (len + 3) / 4; -Index: gdb-7.99.90.20170420/gdb/xstormy16-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/xstormy16-tdep.c 2017-04-20 23:12:07.942566692 +0200 -+++ gdb-7.99.90.20170420/gdb/xstormy16-tdep.c 2017-04-20 23:12:11.252588864 +0200 -@@ -233,8 +233,9 @@ +diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c +index 153375a1bd..5ae186d7fb 100644 +--- a/gdb/xstormy16-tdep.c ++++ b/gdb/xstormy16-tdep.c +@@ -232,8 +232,9 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR stack_dest = sp; int argreg = E_1ST_ARG_REGNUM; @@ -1237,11 +1295,11 @@ Index: gdb-7.99.90.20170420/gdb/xstormy16-tdep.c const gdb_byte *val; gdb_byte buf[xstormy16_pc_size]; -Index: gdb-7.99.90.20170420/gdb/xtensa-tdep.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/xtensa-tdep.c 2017-04-20 23:12:07.944566706 +0200 -+++ gdb-7.99.90.20170420/gdb/xtensa-tdep.c 2017-04-20 23:12:11.253588870 +0200 -@@ -1637,8 +1637,7 @@ +diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c +index 0b0ec2e416..9b538c6d7d 100644 +--- a/gdb/xtensa-tdep.c ++++ b/gdb/xtensa-tdep.c +@@ -1632,8 +1632,7 @@ xtensa_store_return_value (struct type *type, if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, @@ -1251,7 +1309,7 @@ Index: gdb-7.99.90.20170420/gdb/xtensa-tdep.c areg = arreg_number (gdbarch, gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); -@@ -1712,18 +1711,18 @@ +@@ -1707,18 +1706,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; @@ -1273,7 +1331,7 @@ Index: gdb-7.99.90.20170420/gdb/xtensa-tdep.c int regno; /* regno if in register. */ } u; }; -@@ -1747,9 +1746,10 @@ +@@ -1742,9 +1741,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1287,7 +1345,7 @@ Index: gdb-7.99.90.20170420/gdb/xtensa-tdep.c switch (TYPE_CODE (arg_type)) { case TYPE_CODE_INT: -@@ -1819,8 +1819,8 @@ +@@ -1814,8 +1814,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long); break; } @@ -1297,7 +1355,7 @@ Index: gdb-7.99.90.20170420/gdb/xtensa-tdep.c /* Align size and onstack_size. */ size = (size + info->align - 1) & ~(info->align - 1); -@@ -1865,7 +1865,7 @@ +@@ -1860,7 +1860,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, if (info->onstack) { @@ -1306,7 +1364,7 @@ Index: gdb-7.99.90.20170420/gdb/xtensa-tdep.c CORE_ADDR offset = sp + info->u.offset; /* Odd-sized structs are aligned to the lower side of a memory -@@ -1881,7 +1881,7 @@ +@@ -1876,7 +1876,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, } else { @@ -1315,3 +1373,6 @@ Index: gdb-7.99.90.20170420/gdb/xtensa-tdep.c const bfd_byte *cp = info->contents; int r = info->u.regno; +-- +2.14.3 + diff --git a/gdb-rhbz795424-bitpos-25of25-test.patch b/gdb-rhbz795424-bitpos-25of25-test.patch index 3e4fb23..c5b683b 100644 --- a/gdb-rhbz795424-bitpos-25of25-test.patch +++ b/gdb-rhbz795424-bitpos-25of25-test.patch @@ -1,11 +1,15 @@ +From 24e16d436c9acfa44106f83dc4359f33ae36b37c Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Re: [PATCH] Expand fortran array bounds sizes to LONGEST +Subject: Expand fortran array bounds sizes to LONGEST FileName: gdb-rhbz795424-bitpos-25of25-test.patch -http://sourceware.org/ml/gdb-patches/2012-10/msg00231.html +;; Fix `GDB cannot access struct member whose offset is larger than 256MB' +;; (RH BZ 795424). +;;=push +http://sourceware.org/ml/gdb-patches/2012-10/msg00231.html On Mon, 15 Oct 2012 15:25:55 +0200, Jan Kratochvil wrote: > I have filed for it now: @@ -15,91 +19,29 @@ On Mon, 15 Oct 2012 15:25:55 +0200, Jan Kratochvil wrote: Therefore it looks as a valid gfortran FSF GCC HEAD bug so provided a hand-patched .S file for i386; patched GDB PASSes with it. - Thanks, Jan - 2012-10-15 Siddhesh Poyarekar Jan Kratochvil * gdb.fortran/array-bounds.exp: New test file. * gdb.fortran/array-bounds.f: New test file. * gdb.fortran/array-bounds.S: New test file. +--- + gdb/testsuite/gdb.fortran/array-bounds.S | 529 +++++++++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/array-bounds.exp | 43 +++ + gdb/testsuite/gdb.fortran/array-bounds.f | 22 ++ + 3 files changed, 594 insertions(+) + create mode 100644 gdb/testsuite/gdb.fortran/array-bounds.S + create mode 100644 gdb/testsuite/gdb.fortran/array-bounds.exp + create mode 100644 gdb/testsuite/gdb.fortran/array-bounds.f ---- /dev/null 2012-09-26 15:32:16.098506310 +0200 -+++ gdb-7.2/gdb/testsuite/gdb.fortran/array-bounds.exp 2012-10-15 20:53:26.427072583 +0200 -@@ -0,0 +1,43 @@ -+# Copyright 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 . -+ -+# This file is part of the gdb testsuite. It contains test to ensure that -+# array bounds accept LONGEST. -+ -+if { [skip_fortran_tests] } { return -1 } -+ -+set testfile "array-bounds" -+ -+if { [is_ilp32_target] && ([istarget "i\[34567\]86-*-linux*"] -+ || [istarget "x86_64-*-linux*"]) } { -+ set srcfile ${testfile}.S -+ set opts {nodebug f90} -+} else { -+ set srcfile ${testfile}.f -+ set opts {debug f90} -+} -+ -+if {[prepare_for_testing $testfile.exp $testfile $srcfile $opts]} { -+ print "compile failed" -+ return -1 -+} -+ -+if { ![runto MAIN__] } { -+ perror "Could not run to breakpoint `MAIN__'." -+ continue -+} -+ -+gdb_test "print &foo" {.*\(4294967296:4294967297\).*} -+gdb_test "print &bar" {.*\(-4294967297:-4294967296\).*} ---- /dev/null 2012-09-26 15:32:16.098506310 +0200 -+++ gdb-7.2/gdb/testsuite/gdb.fortran/array-bounds.f 2012-10-15 19:35:12.500254261 +0200 -@@ -0,0 +1,22 @@ -+c Copyright 2012 Free Software Foundation, Inc. -+ -+c This program is free software; you can redistribute it and/or modify -+c it under the terms of the GNU General Public License as published by -+c the Free Software Foundation; either version 3 of the License, or -+c (at your option) any later version. -+c -+c This program is distributed in the hope that it will be useful, -+c but WITHOUT ANY WARRANTY; without even the implied warranty of -+c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+c GNU General Public License for more details. -+c -+c You should have received a copy of the GNU General Public License -+c along with this program. If not, see . -+ -+ dimension foo(4294967296_8:4294967297_8) -+ dimension bar(-4294967297_8:-4294967296_8) -+ bar = 42 -+ foo=bar -+ stop -+ end -+ ---- /dev/null 2012-09-26 15:32:16.098506310 +0200 -+++ gdb-7.2/gdb/testsuite/gdb.fortran/array-bounds.S 2012-10-15 20:52:36.851118215 +0200 +diff --git a/gdb/testsuite/gdb.fortran/array-bounds.S b/gdb/testsuite/gdb.fortran/array-bounds.S +new file mode 100644 +index 0000000000..463a427650 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/array-bounds.S @@ -0,0 +1,529 @@ +/* Copyright 2012 Free Software Foundation, Inc. + @@ -630,4 +572,83 @@ Jan + .string "argv" + .ident "GCC: (GNU) 4.8.0 20121015 (experimental)" + .section .note.GNU-stack,"",@progbits +diff --git a/gdb/testsuite/gdb.fortran/array-bounds.exp b/gdb/testsuite/gdb.fortran/array-bounds.exp +new file mode 100644 +index 0000000000..ba0ebe13b8 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/array-bounds.exp +@@ -0,0 +1,43 @@ ++# Copyright 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 . ++ ++# This file is part of the gdb testsuite. It contains test to ensure that ++# array bounds accept LONGEST. ++ ++if { [skip_fortran_tests] } { return -1 } ++ ++set testfile "array-bounds" ++ ++if { [is_ilp32_target] && ([istarget "i\[34567\]86-*-linux*"] ++ || [istarget "x86_64-*-linux*"]) } { ++ set srcfile ${testfile}.S ++ set opts {nodebug f90} ++} else { ++ set srcfile ${testfile}.f ++ set opts {debug f90} ++} ++ ++if {[prepare_for_testing $testfile.exp $testfile $srcfile $opts]} { ++ print "compile failed" ++ return -1 ++} ++ ++if { ![runto MAIN__] } { ++ perror "Could not run to breakpoint `MAIN__'." ++ continue ++} ++ ++gdb_test "print &foo" {.*\(4294967296:4294967297\).*} ++gdb_test "print &bar" {.*\(-4294967297:-4294967296\).*} +diff --git a/gdb/testsuite/gdb.fortran/array-bounds.f b/gdb/testsuite/gdb.fortran/array-bounds.f +new file mode 100644 +index 0000000000..78b36e6c27 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/array-bounds.f +@@ -0,0 +1,22 @@ ++c Copyright 2012 Free Software Foundation, Inc. ++ ++c This program is free software; you can redistribute it and/or modify ++c it under the terms of the GNU General Public License as published by ++c the Free Software Foundation; either version 3 of the License, or ++c (at your option) any later version. ++c ++c This program is distributed in the hope that it will be useful, ++c but WITHOUT ANY WARRANTY; without even the implied warranty of ++c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++c GNU General Public License for more details. ++c ++c You should have received a copy of the GNU General Public License ++c along with this program. If not, see . ++ ++ dimension foo(4294967296_8:4294967297_8) ++ dimension bar(-4294967297_8:-4294967296_8) ++ bar = 42 ++ foo=bar ++ stop ++ end ++ +-- +2.14.3 diff --git a/gdb-rhbz795424-bitpos-25of25.patch b/gdb-rhbz795424-bitpos-25of25.patch index 782066c..3e3076b 100644 --- a/gdb-rhbz795424-bitpos-25of25.patch +++ b/gdb-rhbz795424-bitpos-25of25.patch @@ -1,13 +1,16 @@ +From f487f519fa5965f40049e802c50bceb321153be2 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [PATCH] Expand fortran array bounds sizes to LONGEST +Subject: Expand fortran array bounds sizes to LONGEST FileName: gdb-rhbz795424-bitpos-25of25.patch +;; Fix `GDB cannot access struct member whose offset is larger than 256MB' +;; (RH BZ 795424). +;;=push + http://sourceware.org/ml/gdb-patches/2012-08/msg00562.html - - --MP_/90J7bck2fqDySEX9JkZtaqL Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit @@ -52,12 +55,17 @@ testsuite/ChangeLog: Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=f77-bounds.patch +--- + gdb/f-lang.h | 4 ++-- + gdb/f-typeprint.c | 10 +++++----- + gdb/f-valprint.c | 4 ++-- + 3 files changed, 9 insertions(+), 9 deletions(-) -Index: gdb-7.11.90.20160907/gdb/f-lang.h -=================================================================== ---- gdb-7.11.90.20160907.orig/gdb/f-lang.h 2016-09-07 21:48:33.308624019 +0200 -+++ gdb-7.11.90.20160907/gdb/f-lang.h 2016-09-07 21:48:40.967692469 +0200 -@@ -49,9 +49,9 @@ +diff --git a/gdb/f-lang.h b/gdb/f-lang.h +index fb00f37486..625af96e16 100644 +--- a/gdb/f-lang.h ++++ b/gdb/f-lang.h +@@ -49,9 +49,9 @@ struct common_block struct symbol *contents[1]; }; @@ -69,11 +77,11 @@ Index: gdb-7.11.90.20160907/gdb/f-lang.h extern void f77_get_dynamic_array_length (struct type *); -Index: gdb-7.11.90.20160907/gdb/f-typeprint.c -=================================================================== ---- gdb-7.11.90.20160907.orig/gdb/f-typeprint.c 2016-09-07 21:48:33.309624028 +0200 -+++ gdb-7.11.90.20160907/gdb/f-typeprint.c 2016-09-07 21:48:40.967692469 +0200 -@@ -147,7 +147,7 @@ +diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c +index dccdfe79c6..418693eaba 100644 +--- a/gdb/f-typeprint.c ++++ b/gdb/f-typeprint.c +@@ -149,7 +149,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, int show, int passed_a_ptr, int demangled_args, int arrayprint_recurse_level, int print_rank_only) { @@ -82,7 +90,7 @@ Index: gdb-7.11.90.20160907/gdb/f-typeprint.c /* No static variables are permitted as an error call may occur during execution of this function. */ -@@ -194,7 +194,7 @@ +@@ -196,7 +196,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, { lower_bound = f77_get_lowerbound (type); if (lower_bound != 1) /* Not the default. */ @@ -91,7 +99,7 @@ Index: gdb-7.11.90.20160907/gdb/f-typeprint.c /* Make sure that, if we have an assumed size array, we print out a warning and print the upperbound as '*'. */ -@@ -204,7 +204,7 @@ +@@ -206,7 +206,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, else { upper_bound = f77_get_upperbound (type); @@ -100,7 +108,7 @@ Index: gdb-7.11.90.20160907/gdb/f-typeprint.c } } -@@ -276,7 +276,7 @@ +@@ -278,7 +278,7 @@ void f_type_print_base (struct type *type, struct ui_file *stream, int show, int level) { @@ -109,7 +117,7 @@ Index: gdb-7.11.90.20160907/gdb/f-typeprint.c int index; QUIT; -@@ -358,7 +358,7 @@ +@@ -365,7 +365,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, else { upper_bound = f77_get_upperbound (type); @@ -118,11 +126,11 @@ Index: gdb-7.11.90.20160907/gdb/f-typeprint.c } break; -Index: gdb-7.11.90.20160907/gdb/f-valprint.c -=================================================================== ---- gdb-7.11.90.20160907.orig/gdb/f-valprint.c 2016-09-07 21:48:33.309624028 +0200 -+++ gdb-7.11.90.20160907/gdb/f-valprint.c 2016-09-07 21:48:40.967692469 +0200 -@@ -43,7 +43,7 @@ +diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c +index 4ce78b1d52..10c574c7fa 100644 +--- a/gdb/f-valprint.c ++++ b/gdb/f-valprint.c +@@ -41,7 +41,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; /* Array which holds offsets to be applied to get a row's elements for a given array. Array also holds the size of each subarray. */ @@ -131,7 +139,7 @@ Index: gdb-7.11.90.20160907/gdb/f-valprint.c f77_get_lowerbound (struct type *type) { if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type)) -@@ -52,7 +52,7 @@ +@@ -50,7 +50,7 @@ f77_get_lowerbound (struct type *type) return TYPE_ARRAY_LOWER_BOUND_VALUE (type); } @@ -140,3 +148,6 @@ Index: gdb-7.11.90.20160907/gdb/f-valprint.c f77_get_upperbound (struct type *type) { if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) +-- +2.14.3 + diff --git a/gdb-rhbz795424-bitpos-lazyvalue.patch b/gdb-rhbz795424-bitpos-lazyvalue.patch index 0fd0162..d6f4ec6 100644 --- a/gdb-rhbz795424-bitpos-lazyvalue.patch +++ b/gdb-rhbz795424-bitpos-lazyvalue.patch @@ -1,110 +1,29 @@ +From 579fd09b4223d1a3a05573d7d38ddaefb4c01a87 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz795424-bitpos-lazyvalue.patch FileName: gdb-rhbz795424-bitpos-lazyvalue.patch -Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.exp 2016-07-03 15:00:57.617347850 +0200 -@@ -0,0 +1,59 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 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 . -+ -+standard_testfile .c longest-types-64bit.S -+ -+proc test { name } { with_test_prefix $name { -+ # 64-bit array size should not overflow -+ gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0} -+ -+ # The offset should not overflow -+ gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000} -+}} -+ -+ -+# Test 64-bit file first as it is not compiled so its compilation never fails. -+ -+set file64bitbz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu -+set file64bit [standard_output_file ${testfile}] -+ -+if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} { -+ untested "failed uudecode or bzip2" -+ return -1 -+} -+file stat ${file64bit} file64bitstat -+if {$file64bitstat(size) != 9501} { -+ untested "uudecode or bzip2 produce invalid result" -+ return -1 -+} -+ -+clean_restart ${file64bit} -+ -+#if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile2 {nodebug}] } { -+# return -1 -+#} -+ -+test "64bit" -+ -+ -+# And here is the native build test. -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } { -+ return -1 -+} -+ -+test "native" -Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.c 2016-07-03 15:00:57.618347859 +0200 -@@ -0,0 +1,28 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 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 . */ -+ -+struct foo -+{ -+ char buf[0xffff000000]; -+ char buf2[2]; -+} *f; -+ -+int -+main (void) -+{ -+ return 0; -+} -Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S 2016-07-03 15:00:57.618347859 +0200 +;; Fix `GDB cannot access struct member whose offset is larger than 256MB' +;; (RH BZ 795424). +;;=push +--- + gdb/testsuite/gdb.base/longest-types-64bit.S | 249 ++++++++++++++++++++++ + gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu | 67 ++++++ + gdb/testsuite/gdb.base/longest-types-64bit.c | 28 +++ + gdb/testsuite/gdb.base/longest-types-64bit.exp | 59 +++++ + 4 files changed, 403 insertions(+) + create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.S + create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu + create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.c + create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.exp + +diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.S b/gdb/testsuite/gdb.base/longest-types-64bit.S +new file mode 100644 +index 0000000000..336d3fdb7a +--- /dev/null ++++ b/gdb/testsuite/gdb.base/longest-types-64bit.S @@ -0,0 +1,249 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -355,10 +274,11 @@ Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S + .string "char" + .ident "GCC: (GNU) 4.7.3 20121109 (prerelease)" + .section .note.GNU-stack,"",@progbits -Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu 2016-07-03 15:00:57.618347859 +0200 +diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu +new file mode 100644 +index 0000000000..4007da2917 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu @@ -0,0 +1,67 @@ +begin 755 gdb.base/longest-types-64bit.bz2 +M0EIH.3%!62936<'N#OH`"G/________^______?_Y______//]7SQD5'^/_% @@ -427,3 +347,105 @@ Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu +?<55!2^6_8J$)-O<>\H0U/6Q^>UG0%W)%.%"0P>X.^@`` +` +end +diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.c b/gdb/testsuite/gdb.base/longest-types-64bit.c +new file mode 100644 +index 0000000000..1394c08bdc +--- /dev/null ++++ b/gdb/testsuite/gdb.base/longest-types-64bit.c +@@ -0,0 +1,28 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 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 . */ ++ ++struct foo ++{ ++ char buf[0xffff000000]; ++ char buf2[2]; ++} *f; ++ ++int ++main (void) ++{ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.exp b/gdb/testsuite/gdb.base/longest-types-64bit.exp +new file mode 100644 +index 0000000000..4871dec72f +--- /dev/null ++++ b/gdb/testsuite/gdb.base/longest-types-64bit.exp +@@ -0,0 +1,59 @@ ++# This testcase is part of GDB, the GNU debugger. ++ ++# Copyright 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 . ++ ++standard_testfile .c longest-types-64bit.S ++ ++proc test { name } { with_test_prefix $name { ++ # 64-bit array size should not overflow ++ gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0} ++ ++ # The offset should not overflow ++ gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000} ++}} ++ ++ ++# Test 64-bit file first as it is not compiled so its compilation never fails. ++ ++set file64bitbz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu ++set file64bit [standard_output_file ${testfile}] ++ ++if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} { ++ untested "failed uudecode or bzip2" ++ return -1 ++} ++file stat ${file64bit} file64bitstat ++if {$file64bitstat(size) != 9501} { ++ untested "uudecode or bzip2 produce invalid result" ++ return -1 ++} ++ ++clean_restart ${file64bit} ++ ++#if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile2 {nodebug}] } { ++# return -1 ++#} ++ ++test "64bit" ++ ++ ++# And here is the native build test. ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } { ++ return -1 ++} ++ ++test "native" +-- +2.14.3 + diff --git a/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch b/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch index bea37c3..d60ce1a 100644 --- a/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +++ b/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch @@ -1,13 +1,25 @@ +From d314031914e3eb09cbd9833e3b4f42f3e428bc92 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch FileName: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-rhbz947564.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-rhbz947564.cc 2016-02-15 23:39:21.791458927 +0100 +;; Import regression test for `gdb/findvar.c:417: internal-error: +;; read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5. +;;=fedoratest +--- + gdb/testsuite/gdb.threads/tls-rhbz947564.cc | 53 ++++++++++++++++++++ + gdb/testsuite/gdb.threads/tls-rhbz947564.exp | 75 ++++++++++++++++++++++++++++ + 2 files changed, 128 insertions(+) + create mode 100644 gdb/testsuite/gdb.threads/tls-rhbz947564.cc + create mode 100644 gdb/testsuite/gdb.threads/tls-rhbz947564.exp + +diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.cc b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc +new file mode 100644 +index 0000000000..efb25ab926 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc @@ -0,0 +1,53 @@ +#include +#include @@ -62,10 +74,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-rhbz947564.cc + + return 0; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-rhbz947564.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-rhbz947564.exp 2016-02-15 23:39:30.029517418 +0100 +diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.exp b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp +new file mode 100644 +index 0000000000..e8112e965d +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp @@ -0,0 +1,75 @@ +# Copyright (C) 2013 Free Software Foundation, Inc. + @@ -142,3 +155,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/tls-rhbz947564.exp +} else { + fail "different values for TLS variable" +} +-- +2.14.3 + diff --git a/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch b/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch index be640e9..6463c1f 100644 --- a/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +++ b/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch @@ -1,14 +1,26 @@ +From 998aade37e7e8ffaf60503e2fa1b4573a1d46953 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch FileName: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +;; Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). +;;=fedoratest +--- + gdb/testsuite/gdb.fortran/xlf-variable.S | 638 +++++++++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/xlf-variable.exp | 37 ++ + gdb/testsuite/gdb.fortran/xlf-variable.f | 33 ++ + 3 files changed, 708 insertions(+) + create mode 100644 gdb/testsuite/gdb.fortran/xlf-variable.S + create mode 100644 gdb/testsuite/gdb.fortran/xlf-variable.exp + create mode 100644 gdb/testsuite/gdb.fortran/xlf-variable.f -Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.S -=================================================================== +diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.S b/gdb/testsuite/gdb.fortran/xlf-variable.S +new file mode 100644 +index 0000000000..e826c844c7 --- /dev/null -+++ gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.S ++++ b/gdb/testsuite/gdb.fortran/xlf-variable.S @@ -0,0 +1,638 @@ +/* Copyright (C) 2012 Free Software Foundation, Inc. + @@ -648,10 +660,11 @@ Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.S + .long 0x00000000 + + .comm __N__mod1,4,16 -Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.exp -=================================================================== +diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.exp b/gdb/testsuite/gdb.fortran/xlf-variable.exp +new file mode 100644 +index 0000000000..085da12567 --- /dev/null -+++ gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.exp ++++ b/gdb/testsuite/gdb.fortran/xlf-variable.exp @@ -0,0 +1,37 @@ +# Copyright 2012 Free Software Foundation, Inc. + @@ -690,10 +703,11 @@ Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.exp +gdb_test "step" ".*nullify \\(y\\).*" "nullify (y)" +gdb_test "print z" "= 3" "z = 3" +gdb_test "ptype z" "= REAL" "z is REAL" -Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.f -=================================================================== +diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.f b/gdb/testsuite/gdb.fortran/xlf-variable.f +new file mode 100644 +index 0000000000..0b458f8b0c --- /dev/null -+++ gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.f ++++ b/gdb/testsuite/gdb.fortran/xlf-variable.f @@ -0,0 +1,33 @@ +c Copyright 2012 Free Software Foundation, Inc. +c @@ -728,3 +742,6 @@ Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.f + use mod1 + call sub1 + end +-- +2.14.3 + diff --git a/gdb-runtest-pie-override.patch b/gdb-runtest-pie-override.patch index 1bda5bb..bed5d69 100644 --- a/gdb-runtest-pie-override.patch +++ b/gdb-runtest-pie-override.patch @@ -1,9 +1,12 @@ +From 76528dab6f6971f3753727b2fca7b9ed8325889e Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-runtest-pie-override.patch FileName: gdb-runtest-pie-override.patch +;; Hack for proper PIE run of the testsuite. +;;=fedoratest make check//unix/-fPIE/-pie RUNTESTFLAGS=solib-display.exp @@ -20,10 +23,15 @@ make check//unix RUNTESTFLAGS='CC_FOR_TARGET=gcc\ -fPIC\ -pie CXX_FOR_TARGET=g++ But there is a problem with testsuite.unix non-unique subdir name and also a problem with make -j parallelization of the testsuite. +--- + gdb/testsuite/lib/future.exp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) ---- gdb-7.3.50.20110722/gdb/testsuite/lib/future.exp 2011-10-11 16:44:05.000000000 +0200 -+++ gdb-7.3.50.20110722/gdb/testsuite/lib/future.exp 2011-10-11 16:44:10.000000000 +0200 -@@ -77,6 +77,10 @@ proc gdb_default_target_compile {source +diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp +index aed2cfd476..240d2253ec 100644 +--- a/gdb/testsuite/lib/future.exp ++++ b/gdb/testsuite/lib/future.exp +@@ -185,6 +185,10 @@ proc gdb_default_target_compile {source destfile type options} { set ldflags "" set dest [target_info name] @@ -34,7 +42,7 @@ a problem with make -j parallelization of the testsuite. if {[info exists CFLAGS_FOR_TARGET]} { append add_flags " $CFLAGS_FOR_TARGET" } -@@ -333,10 +337,6 @@ proc gdb_default_target_compile {source +@@ -519,10 +523,6 @@ proc gdb_default_target_compile {source destfile type options} { } } @@ -45,3 +53,6 @@ a problem with make -j parallelization of the testsuite. verbose "doing compile" set sources "" +-- +2.14.3 + diff --git a/gdb-simultaneous-step-resume-breakpoint-test.patch b/gdb-simultaneous-step-resume-breakpoint-test.patch index 205251b..1f5dafd 100644 --- a/gdb-simultaneous-step-resume-breakpoint-test.patch +++ b/gdb-simultaneous-step-resume-breakpoint-test.patch @@ -1,84 +1,24 @@ +From 91c252144f3a4256aaad74732bb6fa01aa64e642 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-simultaneous-step-resume-breakpoint-test.patch FileName: gdb-simultaneous-step-resume-breakpoint-test.patch +;; New test for step-resume breakpoint placed in multiple threads at once. +;;=fedoratest +--- + .../simultaneous-step-resume-breakpoint.c | 79 ++++++++++++++++++++++ + .../simultaneous-step-resume-breakpoint.exp | 65 ++++++++++++++++++ + 2 files changed, 144 insertions(+) + create mode 100644 gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c + create mode 100644 gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp 2016-02-15 23:38:23.366044101 +0100 -@@ -0,0 +1,65 @@ -+# Copyright (C) 2009 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . */ -+ -+# Test multiple threads stepping into a .debug_line-less function with -+# a breakpoint placed on its return-to-caller point. -+ -+set testfile simultaneous-step-resume-breakpoint -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+ -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+ -+# Ensure we have no debuginfo for the `sleep' call itself (=for libc). -+gdb_test "set debug-file-directory /DoesNotExist" -+ -+gdb_load ${binfile} -+if ![runto_main] { -+ return -1 -+} -+ -+# Red Hat vendor patch does set it to "step" by default. -+gdb_test "set scheduler-locking off" -+ -+gdb_breakpoint [gdb_get_line_number "final-exit"] -+ -+gdb_breakpoint [gdb_get_line_number "sleep-call"] -+gdb_continue_to_breakpoint "sleep-call" -+ -+gdb_test "step" "sleep-call.*" "step thread 1" -+gdb_test "step" "sleep-call.*" "step thread 2" -+gdb_test "step" "sleep-after.*" "step thread 3" -+ -+set test "first continue" -+gdb_test_multiple "continue" $test { -+ -re "final-exit.*$gdb_prompt $" { -+ # gdb-7.0. -+ pass $test -+ return -+ } -+ -re "sleep-after.*$gdb_prompt $" { -+ # Fedora/RHEL branch. -+ pass $test -+ } -+} -+ -+gdb_test "continue" "sleep-after.*" "second continue" -+gdb_test "continue" "final-exit.*" "third continue" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c 2016-02-15 23:38:18.257007826 +0100 +diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c +new file mode 100644 +index 0000000000..1f32bbf889 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c @@ -0,0 +1,79 @@ +/* Copyright 2009 Free Software Foundation, Inc. + @@ -159,3 +99,77 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/simultaneous-step-resume-b + + return 0; /* final-exit */ +} +diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp +new file mode 100644 +index 0000000000..ac5111c5ce +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp +@@ -0,0 +1,65 @@ ++# Copyright (C) 2009 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . */ ++ ++# Test multiple threads stepping into a .debug_line-less function with ++# a breakpoint placed on its return-to-caller point. ++ ++set testfile simultaneous-step-resume-breakpoint ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++ ++# Ensure we have no debuginfo for the `sleep' call itself (=for libc). ++gdb_test "set debug-file-directory /DoesNotExist" ++ ++gdb_load ${binfile} ++if ![runto_main] { ++ return -1 ++} ++ ++# Red Hat vendor patch does set it to "step" by default. ++gdb_test "set scheduler-locking off" ++ ++gdb_breakpoint [gdb_get_line_number "final-exit"] ++ ++gdb_breakpoint [gdb_get_line_number "sleep-call"] ++gdb_continue_to_breakpoint "sleep-call" ++ ++gdb_test "step" "sleep-call.*" "step thread 1" ++gdb_test "step" "sleep-call.*" "step thread 2" ++gdb_test "step" "sleep-after.*" "step thread 3" ++ ++set test "first continue" ++gdb_test_multiple "continue" $test { ++ -re "final-exit.*$gdb_prompt $" { ++ # gdb-7.0. ++ pass $test ++ return ++ } ++ -re "sleep-after.*$gdb_prompt $" { ++ # Fedora/RHEL branch. ++ pass $test ++ } ++} ++ ++gdb_test "continue" "sleep-after.*" "second continue" ++gdb_test "continue" "final-exit.*" "third continue" +-- +2.14.3 + diff --git a/gdb-stale-frame_info.patch b/gdb-stale-frame_info.patch index 3921bff..ab13ebc 100644 --- a/gdb-stale-frame_info.patch +++ b/gdb-stale-frame_info.patch @@ -1,13 +1,15 @@ +From 78ed78584876c1c7e2aada2f9614fabb34597325 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [downstream patch FYI] workaround stale frame_info * (PR 13866) +Subject: workaround stale frame_info * (PR 13866) FileName: gdb-stale-frame_info.patch +;; Workaround crashes from stale frame_info pointer (BZ 804256). +;;=push+jan http://sourceware.org/ml/gdb-patches/2012-04/msg00058.html - Hi, I did not look at which commit caused this regression but apparently it was @@ -28,39 +30,41 @@ testsuite under valgrind I did not find feasible. No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu. - Thanks, Jan - gdb/ 2012-04-04 Jan Kratochvil Workaround PR backtrace/13866. * progspace.c (switch_to_program_space_and_thread): Try not to call switch_to_thread. +--- + gdb/progspace-and-thread.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) ---- a/gdb/progspace.c -+++ b/gdb/progspace.c -@@ -481,17 +481,28 @@ save_current_space_and_thread (void) +diff --git a/gdb/progspace-and-thread.c b/gdb/progspace-and-thread.c +index a48faa0f96..8446bfa336 100644 +--- a/gdb/progspace-and-thread.c ++++ b/gdb/progspace-and-thread.c +@@ -23,15 +23,29 @@ void - switch_to_program_space_and_thread (struct program_space *pspace) + switch_to_program_space_and_thread (program_space *pspace) { -- struct inferior *inf; -+ struct inferior *inf = current_inferior (); - -- inf = find_inferior_for_program_space (pspace); +- inferior *inf = find_inferior_for_program_space (pspace); ++ inferior *inf = current_inferior (); ++ + if (inf->pspace != pspace) + inf = find_inferior_for_program_space (pspace); + if (inf != NULL && inf->pid != 0) { -- struct thread_info *tp; -+ struct thread_info *tp, *current_tp = NULL; + thread_info *tp = any_live_thread_of_process (inf->pid); ++ thread_info *current_tp = NULL; + + if (ptid_get_pid (inferior_ptid) == inf->pid) + current_tp = find_thread_ptid (inferior_ptid); - tp = any_live_thread_of_process (inf->pid); if (tp != NULL) { - switch_to_thread (tp->ptid); @@ -75,107 +79,6 @@ gdb/ /* Switching thread switches pspace implicitly. We're done. */ return; +-- +2.14.3 - -Reproducer with: -./gdb -nx ~/t/thread -ex 'b 24' -ex r -ex 'until 25' -Breakpoint 1, main () at /home/jkratoch/t/thread.c:24 -24 v++; -Segmentation fault (core dumped) - -#include -#include -#include - -static int v; - -static void *start (void *arg) -{ - v++; - v++; - v++; - v++; - sleep (100); - return arg; -} - -int main (void) -{ - pthread_t thread1; - int i; - - i = pthread_create (&thread1, NULL, start, NULL); - assert (i == 0); - v++; - v++; - v++; - v++; - i = pthread_join (thread1, NULL); - assert (i == 0); - - return 0; -} -### --- a/gdb/frame.c -### +++ b/gdb/frame.c -### @@ -1522,12 +1522,30 @@ frame_observer_target_changed (struct target_ops *target) -### reinit_frame_cache (); -### } -### -### +typedef struct obstack obstack_s; -### +DEF_VEC_O (obstack_s); -### +static VEC (obstack_s) *frame_poison_vec; -### + -### +void frame_garbage_collection (void); -### +void -### +frame_garbage_collection (void) -### +{ -### + struct obstack *obstack_p; -### + int ix; -### + -### + for (ix = 0; VEC_iterate (obstack_s, frame_poison_vec, ix, obstack_p); ix++) -### + obstack_free (obstack_p, 0); -### + -### + VEC_free (obstack_s, frame_poison_vec); -### + frame_poison_vec = NULL; -### +} -### + -### /* Flush the entire frame cache. */ -### -### void -### reinit_frame_cache (void) -### { -### - struct frame_info *fi; -### + struct frame_info *fi, *fi_prev; -### -### /* Tear down all frame caches. */ -### for (fi = current_frame; fi != NULL; fi = fi->prev) -### @@ -1538,8 +1556,14 @@ reinit_frame_cache (void) -### fi->base->unwind->dealloc_cache (fi, fi->base_cache); -### } -### -### + for (fi = current_frame; fi != NULL; fi = fi_prev) -### + { -### + fi_prev = fi->prev; -### + memset (fi, 0, sizeof (*fi)); -### + } -### + VEC_safe_push (obstack_s, frame_poison_vec, &frame_cache_obstack); -### + -### /* Since we can't really be sure what the first object allocated was. */ -### - obstack_free (&frame_cache_obstack, 0); -### obstack_init (&frame_cache_obstack); -### -### if (current_frame != NULL) -### --- a/gdb/top.c -### +++ b/gdb/top.c -### @@ -359,6 +359,11 @@ prepare_execute_command (void) -### if (non_stop) -### target_dcache_invalidate (); -### -### + { -### + extern void frame_garbage_collection (void); -### + frame_garbage_collection (); -### + } -### + -### return cleanup; -### } -### diff --git a/gdb-test-bt-cfi-without-die.patch b/gdb-test-bt-cfi-without-die.patch index 39ef719..0cd752b 100644 --- a/gdb-test-bt-cfi-without-die.patch +++ b/gdb-test-bt-cfi-without-die.patch @@ -1,17 +1,20 @@ +From ccc6fad15bfe8d7e833d2d84d23673be3b9f595a Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [delayed-symfile] [commit] Fix a regression on CFI without DIE [Re: +Subject: Fix a regression on CFI without DIE [Re: FileName: gdb-test-bt-cfi-without-die.patch +;; [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). +;;=fedoratest http://sourceware.org/ml/archer/2010-q3/msg00028.html On Wed, 25 Feb 2009 00:14:29 +0100, Jan Kratochvil wrote: > commit 6a37c2b9962258ecf9299cc34a650e64a06acaa5 -> +> > There was a regression on gdb.base/savedregs.exp. -> +> > quick_addrmap/require_partial_symbols should be used even for the unwind debug > info checking as its load has been also delayed by this branch. [...] @@ -21,7 +24,7 @@ On Wed, 25 Feb 2009 00:14:29 +0100, Jan Kratochvil wrote: > @@ -1499,6 +1500,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc) > struct dwarf2_fde *fde; > CORE_ADDR offset; -> +> > + if (objfile->quick_addrmap) > + { > + if (!addrmap_find (objfile->quick_addrmap, *pc)) @@ -48,11 +51,9 @@ No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. Checked-in. - Thanks, Jan - eb8df8566acc1ed963e3e9b77c13b9c2c3db03fb Test CFI is parsed even for range (function) not described by any DIE. @@ -67,19 +68,19 @@ gdb/testsuite/ * gdb.base/cfi-without-die.exp, gdb.base/cfi-without-die-main.c, gdb.base/cfi-without-die-caller.c: New files. --- - gdb/dwarf2-frame.c | 8 +-- - gdb/testsuite/gdb.base/cfi-without-die-caller.c | 28 ++++++++++ - gdb/testsuite/gdb.base/cfi-without-die-main.c | 32 +++++++++++ - gdb/testsuite/gdb.base/cfi-without-die.exp | 67 +++++++++++++++++++++++ - 4 files changed, 130 insertions(+), 5 deletions(-) + gdb/testsuite/gdb.base/cfi-without-die-caller.c | 28 ++++++++++ + gdb/testsuite/gdb.base/cfi-without-die-main.c | 32 +++++++++++ + gdb/testsuite/gdb.base/cfi-without-die.exp | 71 +++++++++++++++++++++++++ + 3 files changed, 131 insertions(+) create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-caller.c create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-main.c create mode 100644 gdb/testsuite/gdb.base/cfi-without-die.exp -Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die-caller.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die-caller.c 2016-01-08 21:10:15.498079587 +0100 +diff --git a/gdb/testsuite/gdb.base/cfi-without-die-caller.c b/gdb/testsuite/gdb.base/cfi-without-die-caller.c +new file mode 100644 +index 0000000000..afdfd5331a +--- /dev/null ++++ b/gdb/testsuite/gdb.base/cfi-without-die-caller.c @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -109,10 +110,11 @@ Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die-caller.c + /* Modify the return value to prevent any tail-call optimization. */ + return (*callback) () - one; +} -Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die-main.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die-main.c 2016-01-08 21:10:15.498079587 +0100 +diff --git a/gdb/testsuite/gdb.base/cfi-without-die-main.c b/gdb/testsuite/gdb.base/cfi-without-die-main.c +new file mode 100644 +index 0000000000..8451c4be70 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/cfi-without-die-main.c @@ -0,0 +1,32 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -146,10 +148,11 @@ Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die-main.c +{ + return caller (callback); +} -Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die.exp 2016-01-08 21:13:04.529998009 +0100 +diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp +new file mode 100644 +index 0000000000..5880d46f6d +--- /dev/null ++++ b/gdb/testsuite/gdb.base/cfi-without-die.exp @@ -0,0 +1,71 @@ +# Copyright 2010 Free Software Foundation, Inc. + @@ -222,3 +225,6 @@ Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.base/cfi-without-die.exp +# #1 0x00000000004004e9 in caller () +# #2 0x00000000004004cd in main () at ... +gdb_test "bt" "#0 +callback \[^\r\n\]+\r\n#1 \[^\r\n\]+ in caller \[^\r\n\]+\r\n#2 \[^\r\n\]+ in main \[^\r\n\]+" "verify unwindin works for CFI without DIEs" +-- +2.14.3 + diff --git a/gdb-test-dw2-aranges.patch b/gdb-test-dw2-aranges.patch index 4edb368..c7d3c92 100644 --- a/gdb-test-dw2-aranges.patch +++ b/gdb-test-dw2-aranges.patch @@ -1,9 +1,12 @@ +From f39063cc158f4c747506bf548f956dab5c08b207 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-test-dw2-aranges.patch FileName: gdb-test-dw2-aranges.patch +;; [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. +;;=fedoratest [archer-tromey-delayed-symfile] @@ -12,25 +15,32 @@ Author: Jan Kratochvil Date: Sat Aug 15 15:05:54 2009 +0200 Test for "handle incorrect aranges". - + readelf: Contents of the .debug_aranges section: - + Length: 8 Version: 2 Offset into .debug_info: 0x0 Pointer Size: 0 Segment Size: 0 - + Address Length Floating point exception - - * gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files. -Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.S 2014-02-06 22:02:22.087449660 +0100 + * gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files. +--- + gdb/testsuite/gdb.dwarf2/dw2-aranges.S | 140 +++++++++++++++++++++++++++++++ + gdb/testsuite/gdb.dwarf2/dw2-aranges.exp | 40 +++++++++ + 2 files changed, 180 insertions(+) + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-aranges.S + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-aranges.exp + +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S +new file mode 100644 +index 0000000000..d5b9ca5a3c +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S @@ -0,0 +1,140 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -172,10 +182,11 @@ Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.S + .byte 0 /* aranges segment_size */ + +.Laranges_end: -Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp 2014-02-06 22:09:08.322852771 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp +new file mode 100644 +index 0000000000..f95bde4c35 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp @@ -0,0 +1,40 @@ +# Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. + @@ -217,3 +228,6 @@ Index: gdb-7.7/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp + +# Failed gdb_load would abort the testcase execution earlier. +pass "file loaded" +-- +2.14.3 + diff --git a/gdb-test-expr-cumulative-archer.patch b/gdb-test-expr-cumulative-archer.patch index af158b9..02b30b4 100644 --- a/gdb-test-expr-cumulative-archer.patch +++ b/gdb-test-expr-cumulative-archer.patch @@ -1,17 +1,31 @@ +From 45f37a78bb311e1540fcfb0c8a800eccbd1a3b8f Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-test-expr-cumulative-archer.patch FileName: gdb-test-expr-cumulative-archer.patch +;; [archer-keiths-expr-cumulative+upstream] Import C++ testcases. +;;=fedoratest archer archer-keiths-expr-cumulative b5a7497340b24199f0c7ba7fdf0d54d4df44d6bc +--- + gdb/testsuite/gdb.cp/namespace-nested-imports.cc | 36 ++++++++++++ + gdb/testsuite/gdb.cp/namespace-nested-imports.exp | 50 ++++++++++++++++ + gdb/testsuite/gdb.cp/namespace-no-imports.cc | 37 ++++++++++++ + gdb/testsuite/gdb.cp/namespace-no-imports.exp | 69 +++++++++++++++++++++++ + 4 files changed, 192 insertions(+) + create mode 100644 gdb/testsuite/gdb.cp/namespace-nested-imports.cc + create mode 100644 gdb/testsuite/gdb.cp/namespace-nested-imports.exp + create mode 100644 gdb/testsuite/gdb.cp/namespace-no-imports.cc + create mode 100644 gdb/testsuite/gdb.cp/namespace-no-imports.exp -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.cc 2016-02-15 23:34:32.196402773 +0100 +diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.cc b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc +new file mode 100644 +index 0000000000..9723f874d9 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc @@ -0,0 +1,36 @@ +namespace A +{ @@ -49,10 +63,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.cc + //ab; + return C::first(); +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.exp 2016-02-15 23:34:51.926542859 +0100 +diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.exp b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp +new file mode 100644 +index 0000000000..a606c43cb3 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp @@ -0,0 +1,50 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -104,10 +119,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.exp +gdb_continue_to_breakpoint "C::D::second" + +gdb_test "print ab" "= 11" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.cc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.cc 2016-02-15 23:34:32.196402773 +0100 +diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.cc b/gdb/testsuite/gdb.cp/namespace-no-imports.cc +new file mode 100644 +index 0000000000..d1c68abaea +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/namespace-no-imports.cc @@ -0,0 +1,37 @@ + +namespace A @@ -146,10 +162,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.cc + A::B::C::abc; + return A::B::first(); +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.exp 2016-02-15 23:34:51.926542859 +0100 +diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.exp b/gdb/testsuite/gdb.cp/namespace-no-imports.exp +new file mode 100644 +index 0000000000..a4ae9b3cd2 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/namespace-no-imports.exp @@ -0,0 +1,69 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -220,3 +237,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.exp +gdb_test "print _a" "= 11" +gdb_test "print ab" "= 22" +gdb_test "print abc" "= 33" +-- +2.14.3 + diff --git a/gdb-test-ivy-bridge.patch b/gdb-test-ivy-bridge.patch index 4d973a8..4108344 100644 --- a/gdb-test-ivy-bridge.patch +++ b/gdb-test-ivy-bridge.patch @@ -1,14 +1,132 @@ +From f4ce74be3c96f41057c2e8843b668c519a77fb03 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-test-ivy-bridge.patch FileName: gdb-test-ivy-bridge.patch +;; Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). +;;=fedoratest +--- + gdb/testsuite/gdb.arch/amd64-ivy-bridge.S | 98 ++++++++++++++++ + gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp | 170 ++++++++++++++++++++++++++++ + gdb/testsuite/gdb.arch/i386-ivy-bridge.S | 67 +++++++++++ + gdb/testsuite/gdb.arch/i386-ivy-bridge.exp | 106 +++++++++++++++++ + 4 files changed, 441 insertions(+) + create mode 100644 gdb/testsuite/gdb.arch/amd64-ivy-bridge.S + create mode 100644 gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp + create mode 100644 gdb/testsuite/gdb.arch/i386-ivy-bridge.S + create mode 100644 gdb/testsuite/gdb.arch/i386-ivy-bridge.exp -Index: gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp 2016-10-20 20:57:31.652630455 +0200 +diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S +new file mode 100644 +index 0000000000..24e41c0e02 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S +@@ -0,0 +1,98 @@ ++/* Copyright 2011 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ This file is part of the gdb testsuite. */ ++ ++ .globl _start ++_start: .text ++ ++/* gas/i386/x86-64-rdrnd.s */ ++ .att_syntax prefix ++ rdrand %bx ++ rdrand %ebx ++ rdrand %rbx ++ rdrand %r8w ++ rdrand %r8d ++ rdrand %r8 ++ ++ .intel_syntax noprefix ++ rdrand bx ++ rdrand ebx ++ rdrand rbx ++ rdrand r8w ++ rdrand r8d ++ rdrand r8 ++ ++/* gas/i386/x86-64-f16c.s */ ++ .att_syntax prefix ++ vcvtph2ps %xmm4,%ymm4 ++ vcvtph2ps (%r8),%ymm8 ++ vcvtph2ps %xmm4,%xmm6 ++ vcvtph2ps (%rcx),%xmm4 ++ vcvtps2ph $0x2,%ymm4,%xmm4 ++ vcvtps2ph $0x2,%ymm8,(%r8) ++ vcvtps2ph $0x2,%xmm4,%xmm4 ++ vcvtps2ph $0x2,%xmm4,(%rcx) ++ ++ .intel_syntax noprefix ++ vcvtph2ps ymm4,xmm4 ++ vcvtph2ps ymm8,XMMWORD PTR [r8] ++ vcvtph2ps ymm4,[rcx] ++ vcvtph2ps xmm6,xmm4 ++ vcvtph2ps xmm4,QWORD PTR [rcx] ++ vcvtph2ps xmm4,[rcx] ++ vcvtps2ph xmm4,ymm4,0x2 ++ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2 ++ vcvtps2ph [rcx],ymm4,0x2 ++ vcvtps2ph xmm4,xmm4,0x2 ++ vcvtps2ph QWORD PTR [r8],xmm8,0x2 ++ vcvtps2ph [rcx],xmm4,0x2 ++ ++/* gas/i386/x86-64-fsgs.s */ ++ .att_syntax prefix ++ rdfsbase %ebx ++ rdfsbase %rbx ++ rdfsbase %r8d ++ rdfsbase %r8 ++ rdgsbase %ebx ++ rdgsbase %rbx ++ rdgsbase %r8d ++ rdgsbase %r8 ++ wrfsbase %ebx ++ wrfsbase %rbx ++ wrfsbase %r8d ++ wrfsbase %r8 ++ wrgsbase %ebx ++ wrgsbase %rbx ++ wrgsbase %r8d ++ wrgsbase %r8 ++ ++ .intel_syntax noprefix ++ rdfsbase ebx ++ rdfsbase rbx ++ rdfsbase r8d ++ rdfsbase r8 ++ rdgsbase ebx ++ rdgsbase rbx ++ rdgsbase r8d ++ rdgsbase r8 ++ wrfsbase ebx ++ wrfsbase rbx ++ wrfsbase r8d ++ wrfsbase r8 ++ wrgsbase ebx ++ wrgsbase rbx ++ wrgsbase r8d ++ wrgsbase r8 +diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp +new file mode 100644 +index 0000000000..d1b1f27db4 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp @@ -0,0 +1,170 @@ +# Copyright 2011 Free Software Foundation, Inc. + @@ -180,10 +298,84 @@ Index: gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp +\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase r8d\r +\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase r8\r +End of assembler dump\\." "intel" -Index: gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp 2016-10-20 20:57:43.251721147 +0200 +diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.S b/gdb/testsuite/gdb.arch/i386-ivy-bridge.S +new file mode 100644 +index 0000000000..ff9608d389 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/i386-ivy-bridge.S +@@ -0,0 +1,67 @@ ++/* Copyright 2011 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ This file is part of the gdb testsuite. */ ++ ++ .globl _start ++_start: .text ++ ++/* gas/i386/rdrnd.s */ ++ .att_syntax prefix ++ rdrand %bx ++ rdrand %ebx ++ ++ .intel_syntax noprefix ++ rdrand bx ++ rdrand ebx ++ ++/* gas/i386/f16c.s */ ++ .att_syntax prefix ++ vcvtph2ps %xmm4,%ymm4 ++ vcvtph2ps (%ecx),%ymm4 ++ vcvtph2ps %xmm4,%xmm6 ++ vcvtph2ps (%ecx),%xmm4 ++ vcvtps2ph $0x2,%ymm4,%xmm4 ++ vcvtps2ph $0x2,%ymm4,(%ecx) ++ vcvtps2ph $0x2,%xmm4,%xmm4 ++ vcvtps2ph $0x2,%xmm4,(%ecx) ++ ++ .intel_syntax noprefix ++ vcvtph2ps ymm4,xmm4 ++ vcvtph2ps ymm4,XMMWORD PTR [ecx] ++ vcvtph2ps ymm4,[ecx] ++ vcvtph2ps xmm6,xmm4 ++ vcvtph2ps xmm4,QWORD PTR [ecx] ++ vcvtph2ps xmm4,[ecx] ++ vcvtps2ph xmm4,ymm4,0x2 ++ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2 ++ vcvtps2ph [ecx],ymm4,0x2 ++ vcvtps2ph xmm4,xmm4,0x2 ++ vcvtps2ph QWORD PTR [ecx],xmm4,0x2 ++ vcvtps2ph [ecx],xmm4,0x2 ++ ++/* gas/i386/fsgs.s */ ++ .att_syntax prefix ++ rdfsbase %ebx ++ rdgsbase %ebx ++ wrfsbase %ebx ++ wrgsbase %ebx ++ ++ .intel_syntax noprefix ++ rdfsbase ebx ++ rdgsbase ebx ++ wrfsbase ebx ++ wrgsbase ebx ++ +diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp b/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp +new file mode 100644 +index 0000000000..4ea93edb06 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp @@ -0,0 +1,106 @@ +# Copyright 2011 Free Software Foundation, Inc. + @@ -291,178 +483,6 @@ Index: gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp +\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r +\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r +End of assembler dump\\." "intel" -Index: gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S 2016-10-20 20:55:50.853842324 +0200 -@@ -0,0 +1,98 @@ -+/* Copyright 2011 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ This file is part of the gdb testsuite. */ -+ -+ .globl _start -+_start: .text -+ -+/* gas/i386/x86-64-rdrnd.s */ -+ .att_syntax prefix -+ rdrand %bx -+ rdrand %ebx -+ rdrand %rbx -+ rdrand %r8w -+ rdrand %r8d -+ rdrand %r8 -+ -+ .intel_syntax noprefix -+ rdrand bx -+ rdrand ebx -+ rdrand rbx -+ rdrand r8w -+ rdrand r8d -+ rdrand r8 -+ -+/* gas/i386/x86-64-f16c.s */ -+ .att_syntax prefix -+ vcvtph2ps %xmm4,%ymm4 -+ vcvtph2ps (%r8),%ymm8 -+ vcvtph2ps %xmm4,%xmm6 -+ vcvtph2ps (%rcx),%xmm4 -+ vcvtps2ph $0x2,%ymm4,%xmm4 -+ vcvtps2ph $0x2,%ymm8,(%r8) -+ vcvtps2ph $0x2,%xmm4,%xmm4 -+ vcvtps2ph $0x2,%xmm4,(%rcx) -+ -+ .intel_syntax noprefix -+ vcvtph2ps ymm4,xmm4 -+ vcvtph2ps ymm8,XMMWORD PTR [r8] -+ vcvtph2ps ymm4,[rcx] -+ vcvtph2ps xmm6,xmm4 -+ vcvtph2ps xmm4,QWORD PTR [rcx] -+ vcvtph2ps xmm4,[rcx] -+ vcvtps2ph xmm4,ymm4,0x2 -+ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2 -+ vcvtps2ph [rcx],ymm4,0x2 -+ vcvtps2ph xmm4,xmm4,0x2 -+ vcvtps2ph QWORD PTR [r8],xmm8,0x2 -+ vcvtps2ph [rcx],xmm4,0x2 -+ -+/* gas/i386/x86-64-fsgs.s */ -+ .att_syntax prefix -+ rdfsbase %ebx -+ rdfsbase %rbx -+ rdfsbase %r8d -+ rdfsbase %r8 -+ rdgsbase %ebx -+ rdgsbase %rbx -+ rdgsbase %r8d -+ rdgsbase %r8 -+ wrfsbase %ebx -+ wrfsbase %rbx -+ wrfsbase %r8d -+ wrfsbase %r8 -+ wrgsbase %ebx -+ wrgsbase %rbx -+ wrgsbase %r8d -+ wrgsbase %r8 -+ -+ .intel_syntax noprefix -+ rdfsbase ebx -+ rdfsbase rbx -+ rdfsbase r8d -+ rdfsbase r8 -+ rdgsbase ebx -+ rdgsbase rbx -+ rdgsbase r8d -+ rdgsbase r8 -+ wrfsbase ebx -+ wrfsbase rbx -+ wrfsbase r8d -+ wrfsbase r8 -+ wrgsbase ebx -+ wrgsbase rbx -+ wrgsbase r8d -+ wrgsbase r8 -Index: gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.S -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.S 2016-10-20 20:55:50.853842324 +0200 -@@ -0,0 +1,67 @@ -+/* Copyright 2011 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ This file is part of the gdb testsuite. */ -+ -+ .globl _start -+_start: .text -+ -+/* gas/i386/rdrnd.s */ -+ .att_syntax prefix -+ rdrand %bx -+ rdrand %ebx -+ -+ .intel_syntax noprefix -+ rdrand bx -+ rdrand ebx -+ -+/* gas/i386/f16c.s */ -+ .att_syntax prefix -+ vcvtph2ps %xmm4,%ymm4 -+ vcvtph2ps (%ecx),%ymm4 -+ vcvtph2ps %xmm4,%xmm6 -+ vcvtph2ps (%ecx),%xmm4 -+ vcvtps2ph $0x2,%ymm4,%xmm4 -+ vcvtps2ph $0x2,%ymm4,(%ecx) -+ vcvtps2ph $0x2,%xmm4,%xmm4 -+ vcvtps2ph $0x2,%xmm4,(%ecx) -+ -+ .intel_syntax noprefix -+ vcvtph2ps ymm4,xmm4 -+ vcvtph2ps ymm4,XMMWORD PTR [ecx] -+ vcvtph2ps ymm4,[ecx] -+ vcvtph2ps xmm6,xmm4 -+ vcvtph2ps xmm4,QWORD PTR [ecx] -+ vcvtph2ps xmm4,[ecx] -+ vcvtps2ph xmm4,ymm4,0x2 -+ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2 -+ vcvtps2ph [ecx],ymm4,0x2 -+ vcvtps2ph xmm4,xmm4,0x2 -+ vcvtps2ph QWORD PTR [ecx],xmm4,0x2 -+ vcvtps2ph [ecx],xmm4,0x2 -+ -+/* gas/i386/fsgs.s */ -+ .att_syntax prefix -+ rdfsbase %ebx -+ rdgsbase %ebx -+ wrfsbase %ebx -+ wrgsbase %ebx -+ -+ .intel_syntax noprefix -+ rdfsbase ebx -+ rdgsbase ebx -+ wrfsbase ebx -+ wrgsbase ebx -+ +-- +2.14.3 + diff --git a/gdb-test-pid0-core.patch b/gdb-test-pid0-core.patch index 1cf9d2d..04492bd 100644 --- a/gdb-test-pid0-core.patch +++ b/gdb-test-pid0-core.patch @@ -1,9 +1,12 @@ +From db8771b16cf368aa683cbf5d6d8b8a7f3a9ac508 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-test-pid0-core.patch FileName: gdb-test-pid0-core.patch +;; New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). +;;=fedoratest https://bugzilla.redhat.com/show_bug.cgi?id=611435 @@ -12,11 +15,18 @@ Re: [RFA]corelow.c: Add tid to add_to_thread_list http://sourceware.org/ml/gdb-patches/2010-08/msg00085.html http://sourceware.org/ml/gdb-cvs/2010-08/msg00026.html 2e5bcfdef1ec3883d48c3f87a4be5c0dff25e17e +--- + .../gdb.arch/x86_64-pid0-core.core.bz2.uu | 20 ++++++++++ + gdb/testsuite/gdb.arch/x86_64-pid0-core.exp | 46 ++++++++++++++++++++++ + 2 files changed, 66 insertions(+) + create mode 100644 gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu + create mode 100644 gdb/testsuite/gdb.arch/x86_64-pid0-core.exp -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu 2016-02-15 23:23:40.772772165 +0100 +diff --git a/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu +new file mode 100644 +index 0000000000..4c8200c243 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu @@ -0,0 +1,20 @@ +begin 600 x86_64-pid0-core.core.bz2 +M0EIH.3%!629362,CA>P!$/'_____^*#EZ-A!SP36P&_:G0#=14``04A&8,'U @@ -38,10 +48,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu +4B.Z!/,0-IZ^W_Q=R13A0D",CA>P` +` +end -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp 2016-02-15 23:23:55.145875704 +0100 +diff --git a/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp +new file mode 100644 +index 0000000000..7a5a1cac19 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp @@ -0,0 +1,46 @@ +# This testcase is part of GDB, the GNU debugger. +# @@ -89,3 +100,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp +# Former crash was: +# thread.c:884: internal-error: switch_to_thread: Assertion `inf != NULL' failed. +gdb_test "core-file ${corefile}" "Program terminated with signal (11|SIGSEGV), Segmentation fault\\.\r\n.*" +-- +2.14.3 + diff --git a/gdb-testsuite-readline63-sigint.patch b/gdb-testsuite-readline63-sigint.patch index 23fec81..097d27e 100644 --- a/gdb-testsuite-readline63-sigint.patch +++ b/gdb-testsuite-readline63-sigint.patch @@ -1,20 +1,27 @@ +From 0426eaf3dca37aa00edf926686701bd26442c368 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-testsuite-readline63-sigint.patch FileName: gdb-testsuite-readline63-sigint.patch +;; [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). +;;=fedoratest + gdb/users/ppalka/readline-7.0-update commit 379059215e823555a37a8dc7e02cef8fd86566e4 https://sourceware.org/ml/gdb-patches/2015-07/msg00422.html Message-Id: <1436927724-4059-1-git-send-email-patrick@parcs.ath.cx> https://bugzilla.redhat.com/show_bug.cgi?id=1301175 +--- + gdb/testsuite/gdb.gdb/selftest.exp | 22 +++++++++++++++++++--- + 1 file changed, 19 insertions(+), 3 deletions(-) -Index: gdb-7.10.50.20160131/gdb/testsuite/gdb.gdb/selftest.exp -=================================================================== ---- gdb-7.10.50.20160131.orig/gdb/testsuite/gdb.gdb/selftest.exp 2016-01-31 19:44:47.156963419 +0100 -+++ gdb-7.10.50.20160131/gdb/testsuite/gdb.gdb/selftest.exp 2016-01-31 19:45:11.245135173 +0100 -@@ -458,9 +458,25 @@ +diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp +index a4a446f9df..cc80d171dc 100644 +--- a/gdb/testsuite/gdb.gdb/selftest.exp ++++ b/gdb/testsuite/gdb.gdb/selftest.exp +@@ -104,9 +104,25 @@ proc test_with_self { } { } set description "send SIGINT signal to child process" @@ -43,3 +50,6 @@ Index: gdb-7.10.50.20160131/gdb/testsuite/gdb.gdb/selftest.exp # Switch back to the GDB thread if Guile support is linked in. # "signal SIGINT" could also switch the current thread. +-- +2.14.3 + diff --git a/gdb-tls-1of2.patch b/gdb-tls-1of2.patch deleted file mode 100644 index bf660aa..0000000 --- a/gdb-tls-1of2.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls - -FileName: gdb-tls-1of2.patch - -http://sourceware.org/ml/gdb-patches/2016-10/msg00206.html - - - ---XMCwj5IQnwKtuyBG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline - -Hi, - -no functionality change, for patch 2/2. - - -Jan - ---XMCwj5IQnwKtuyBG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline; filename="tls1.patch" - -gdb/ChangeLog -2016-10-09 Jan Kratochvil - - * parse.c (write_exp_msymbol): New variable is_tls, use it. - ---- a/gdb/parse.c -+++ b/gdb/parse.c -@@ -484,6 +484,8 @@ write_exp_msymbol (struct parser_state *ps, - struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol); - enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol); - CORE_ADDR pc; -+ const int is_tls = (section != NULL -+ && section->the_bfd_section->flags & SEC_THREAD_LOCAL); - - /* The minimal symbol might point to a function descriptor; - resolve it to the actual code address instead. */ -@@ -520,7 +522,7 @@ write_exp_msymbol (struct parser_state *ps, - write_exp_elt_longcst (ps, (LONGEST) addr); - write_exp_elt_opcode (ps, OP_LONG); - -- if (section && section->the_bfd_section->flags & SEC_THREAD_LOCAL) -+ if (is_tls) - { - write_exp_elt_opcode (ps, UNOP_MEMVAL_TLS); - write_exp_elt_objfile (ps, objfile); - ---XMCwj5IQnwKtuyBG-- - diff --git a/gdb-tls-2of2.patch b/gdb-tls-2of2.patch deleted file mode 100644 index 1f050e2..0000000 --- a/gdb-tls-2of2.patch +++ /dev/null @@ -1,165 +0,0 @@ -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: [patch+7.12.1 2/2] Fix TLS (such as 'errno') regression - -FileName: gdb-tls-2of2.patch - -http://sourceware.org/ml/gdb-patches/2016-10/msg00207.html - - - ---3Pql8miugIZX0722 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline - -Hi, - -2273f0ac95a79ce29ef42025c63f90e82cf907d7 is the first bad commit -commit 2273f0ac95a79ce29ef42025c63f90e82cf907d7 -Author: Tom Tromey -Date: Tue Oct 15 13:28:57 2013 -0600 - change minsyms not to be relocated at read-time -[FYI v3 06/10] change minsyms not to be relocated at read-time -Message-Id: <1393441273-32268-7-git-send-email-tromey@redhat.com> -https://sourceware.org/ml/gdb-patches/2014-02/msg00798.html - -mv /usr/lib/debug /usr/lib/debug-x -echo 'int main(){}'|gcc -pthread -x c - -./gdb -q -ex start -ex 'set debug expr 1' -ex 'p errno' ./a.out - 0 UNOP_MEMVAL_TLS TLS type @0x35df7e0 (__thread /* "/lib64/libc.so.6" */ ) - 4 OP_LONG Type @0x35df850 (__CORE_ADDR), value 140737345728528 (0x7ffff77fb010) -Cannot access memory at address 0xffffef7c9698 --> - 0 UNOP_MEMVAL_TLS TLS type @0x3ad9520 (__thread /* "/lib64/libc.so.6" */ ) - 4 OP_LONG Type @0x3ad9590 (__CORE_ADDR), value 16 (0x10) -$1 = 0 - -With glibc debuginfo, that is without: mv /usr/lib/debug /usr/lib/debug-x - 0 OP_VAR_VALUE Block @0x3b30e70, symbol @0x3b30d10 (errno) -$1 = 0 -So such case is unrelated to this patch and the regression is not visible with -glibc debuginfo installed. - -I guess all these issues will be solved by Gary Benson's Infinity. -But at least for older non-Infinity glibcs GDB should not regress. - -For the testcase it is important the variable is in objfile with non-zero base -address. glibc is a shared library for 'errno' but I found easier for the -testcase to use PIE instead of a shlib. For TLS variables in PT_EXEC the -regression obviously does not happen. - -It has been found by a more complete testcase present in Fedora, the fix there -also solves more cases where FSF GDB currently cannot resolve 'errno': - http://pkgs.fedoraproject.org/cgit/rpms/gdb.git/tree/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch - FAIL: gdb.dwarf2/dw2-errno2.exp: macros=N threads=Y: print errno for core - -No regressions on {x86_64,x86_64-m32,i686}-fedora26pre-linux-gnu. - -OK for check-in? - - -Thanks, -Jan - ---3Pql8miugIZX0722 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline; filename="tls1-2.patch" - -gdb/ChangeLog -2016-10-09 Jan Kratochvil - - * parse.c (write_exp_msymbol): Fix ADDR computation. - -gdb/testsuite/ChangeLog -2016-10-09 Jan Kratochvil - - * gdb.threads/tls-nodebug-pie.c: New file. - * gdb.threads/tls-nodebug-pie.exp: New file. - ---- a/gdb/parse.c -+++ b/gdb/parse.c -@@ -480,13 +480,17 @@ write_exp_msymbol (struct parser_state *ps, - struct objfile *objfile = bound_msym.objfile; - struct gdbarch *gdbarch = get_objfile_arch (objfile); - -- CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (bound_msym); - struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol); - enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol); -- CORE_ADDR pc; -+ CORE_ADDR addr, pc; - const int is_tls = (section != NULL - && section->the_bfd_section->flags & SEC_THREAD_LOCAL); - -+ if (is_tls) -+ addr = MSYMBOL_VALUE_RAW_ADDRESS (bound_msym.minsym); -+ else -+ addr = BMSYMBOL_VALUE_ADDRESS (bound_msym); -+ - /* The minimal symbol might point to a function descriptor; - resolve it to the actual code address instead. */ - pc = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, ¤t_target); ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.c -@@ -0,0 +1,27 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2016 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#include -+ -+__thread int thread_local = 42; -+ -+int main(void) -+{ -+ /* Ensure we link against pthreads even with --as-needed. */ -+ pthread_testcancel(); -+ return 0; -+} ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp -@@ -0,0 +1,29 @@ -+# 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 . -+ -+standard_testfile -+ -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ -+ [list "additional_flags=-fPIE -pie"]] != "" } { -+ return -1 -+} -+ -+clean_restart ${binfile} -+if ![runto_main] then { -+ return 0 -+} -+ -+# Formerly: Cannot access memory at address 0xd5554d5216fc -+gdb_test "p thread_local" " = 42" "thread local storage" - ---3Pql8miugIZX0722-- - diff --git a/gdb-upstream.patch b/gdb-upstream.patch deleted file mode 100644 index aa48ef0..0000000 --- a/gdb-upstream.patch +++ /dev/null @@ -1,76 +0,0 @@ -commit 16eb6b2db49e6cf2fdca56efd37689fcc170cd37 -Author: Leszek Swirski -Date: Mon Aug 7 16:40:38 2017 +0200 - - Fix dwarf2_string_attr for -gsplit-dwarf - - The dwarf2_string_attr did not allow DW_FORM_GNU_str_index as a form for - string types. This manifested as null strings in the namespace_name - lookup (replaced with "(anonymous namespace)") when debugging - Fission-compiled code. - - gdb/ChangeLog: - - * dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_strp_alt. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,3 +1,7 @@ -+2017-08-07 Leszek Swirski -+ -+ * dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_strp_alt. -+ - 2017-08-07 Simon Marchi - - * remote-sim.c (gdbsim_load): Remove char **argv local variable. ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -17623,7 +17623,8 @@ dwarf2_string_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *c - if (attr != NULL) - { - if (attr->form == DW_FORM_strp || attr->form == DW_FORM_line_strp -- || attr->form == DW_FORM_string || attr->form == DW_FORM_GNU_strp_alt) -+ || attr->form == DW_FORM_string || DW_FORM_GNU_str_index -+ || attr->form == DW_FORM_GNU_strp_alt) - str = DW_STRING (attr); - else - complaint (&symfile_complaints, - - - -commit b33404388e5bbd8a1fddfde73cd4593ae2b557e8 -Author: H.J. Lu -Date: Wed Aug 9 05:01:55 2017 -0700 - - gdb: Fix build failure with GCC 7 - - Fix: - - /export/gnu/import/git/sources/binutils-gdb/gdb/dwarf2read.c: In function ‘const char* dwarf2_string_attr(die_info*, unsigned int, dwarf2_cu*)’: - /export/gnu/import/git/sources/binutils-gdb/gdb/dwarf2read.c:17626:39: error: enum constant in boolean context [-Werror=int-in-bool-context] - || attr->form == DW_FORM_string || DW_FORM_GNU_str_index - - * dwarf2read.c (dwarf2_string_attr): Fix a typo. - -### a/gdb/ChangeLog -### b/gdb/ChangeLog -## -1,3 +1,7 @@ -+2017-08-09 H.J. Lu -+ -+ * dwarf2read.c (dwarf2_string_attr): Fix a typo. -+ - 2017-08-09 Alex Lindsay - Yao Qi - ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -17623,7 +17623,8 @@ dwarf2_string_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *c - if (attr != NULL) - { - if (attr->form == DW_FORM_strp || attr->form == DW_FORM_line_strp -- || attr->form == DW_FORM_string || DW_FORM_GNU_str_index -+ || attr->form == DW_FORM_string -+ || attr->form == DW_FORM_GNU_str_index - || attr->form == DW_FORM_GNU_strp_alt) - str = DW_STRING (attr); - else diff --git a/gdb-vla-intel-fix-print-char-array.patch b/gdb-vla-intel-fix-print-char-array.patch new file mode 100644 index 0000000..0a60ada --- /dev/null +++ b/gdb-vla-intel-fix-print-char-array.patch @@ -0,0 +1,72 @@ +From 2a510c38e76dbaa5ce67e6e2da5d2720936872b9 Mon Sep 17 00:00:00 2001 +From: Sergio Durigan Junior +Date: Thu, 7 Dec 2017 16:20:31 -0500 +Subject: gdb-vla-intel-fix-print-char-array.patch + +FileName: gdb-vla-intel-fix-print-char-array.patch + +;; Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd + +Revert commit (only the part touching gdb/f-valprint.c): + + commit 469412dd9ccc4de5874fd3299b105833f36b34cd + Author: Christoph Weinmann + Date: Fri Sep 8 15:11:47 2017 +0200 + + Remove C/C++ relevant code in Fortran specific file. + + Remove code relevant for printing C/C++ Integer values in a + Fortran specific file to unify printing of Fortran values. + This does not change the output. + +And adjust its testcase. +--- + gdb/f-valprint.c | 18 ++++++++++++++++-- + gdb/testsuite/gdb.fortran/printing-types.exp | 2 +- + 2 files changed, 17 insertions(+), 3 deletions(-) + +diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c +index 10c574c7fa..eee090dfdd 100644 +--- a/gdb/f-valprint.c ++++ b/gdb/f-valprint.c +@@ -314,8 +314,22 @@ f_val_print (struct type *type, LONGEST embedded_offset, + original_value, &opts, 0, stream); + } + else +- val_print_scalar_formatted (type, embedded_offset, +- original_value, options, 0, stream); ++ { ++ val_print_scalar_formatted (type, embedded_offset, ++ original_value, options, 0, stream); ++ /* C and C++ has no single byte int type, char is used instead. ++ Since we don't know whether the value is really intended to ++ be used as an integer or a character, print the character ++ equivalent as well. */ ++ if (TYPE_LENGTH (type) == 1) ++ { ++ LONGEST c; ++ ++ fputs_filtered (" ", stream); ++ c = unpack_long (type, valaddr + embedded_offset); ++ LA_PRINT_CHAR ((unsigned char) c, type, stream); ++ } ++ } + break; + + case TYPE_CODE_STRUCT: +diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp +index 085de4fc8f..7b2c6516da 100644 +--- a/gdb/testsuite/gdb.fortran/printing-types.exp ++++ b/gdb/testsuite/gdb.fortran/printing-types.exp +@@ -29,7 +29,7 @@ if {![runto MAIN__]} then { + gdb_breakpoint [gdb_get_line_number "write"] + gdb_continue_to_breakpoint "write" + +-gdb_test "print oneByte" " = 1" ++gdb_test "print oneByte" " = 1 \'\\\\001\'" + gdb_test "print twobytes" " = 2" + gdb_test "print chvalue" " = \'a\'" + gdb_test "print logvalue" " = \.TRUE\." +-- +2.14.3 + diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index 7ea7e2c..5106b6f 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -1,10 +1,13 @@ -From f408ba821f8c8b5ad6564b98806666d2478f7599 Mon Sep 17 00:00:00 2001 +From d323882d2c497284f010b70ca605b100068de332 Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-vla-intel-fortran-strides.patch FileName: gdb-vla-intel-fortran-strides.patch +;; VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests. +;;=push + git diff --stat -p gdb/master...gdb/users/bheckel/fortran-strides dbfd7140bf4c0500d1f5d192be781f83f78f7922 @@ -32,12 +35,41 @@ dbfd7140bf4c0500d1f5d192be781f83f78f7922 gdb/valops.c | 197 +++++++++++-- gdb/value.h | 2 + 23 files changed, 1242 insertions(+), 183 deletions(-) +--- + gdb/dwarf2loc.c | 46 ++- + gdb/dwarf2loc.h | 6 + + gdb/dwarf2read.c | 13 +- + gdb/eval.c | 391 +++++++++++++++++++++----- + gdb/expprint.c | 20 +- + gdb/expression.h | 18 +- + gdb/f-exp.y | 42 ++- + gdb/f-valprint.c | 8 +- + gdb/gdbtypes.c | 34 ++- + gdb/gdbtypes.h | 18 +- + gdb/parse.c | 24 +- + gdb/rust-exp.y | 12 +- + gdb/rust-lang.c | 17 +- + gdb/testsuite/gdb.fortran/static-arrays.exp | 421 ++++++++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 ++++ + gdb/testsuite/gdb.fortran/vla-ptype.exp | 4 + + gdb/testsuite/gdb.fortran/vla-sizeof.exp | 4 + + gdb/testsuite/gdb.fortran/vla-stride.exp | 44 +++ + gdb/testsuite/gdb.fortran/vla-stride.f90 | 29 ++ + gdb/testsuite/gdb.fortran/vla.f90 | 10 + + gdb/valarith.c | 10 +- + gdb/valops.c | 199 +++++++++++-- + gdb/value.h | 2 + + 23 files changed, 1245 insertions(+), 182 deletions(-) + create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.exp + create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.f90 + create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.exp + create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.f90 -Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/dwarf2loc.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/dwarf2loc.c 2017-04-20 22:26:14.356446562 +0200 -@@ -2622,11 +2622,14 @@ +diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c +index fe2fea0d0e..54592f0bfc 100644 +--- a/gdb/dwarf2loc.c ++++ b/gdb/dwarf2loc.c +@@ -2604,11 +2604,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, /* See dwarf2loc.h. */ int @@ -54,7 +86,7 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c if (prop == NULL) return 0; -@@ -2650,7 +2653,7 @@ +@@ -2632,7 +2635,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, *value = value_as_address (val); } @@ -63,7 +95,7 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c } } break; -@@ -2672,7 +2675,7 @@ +@@ -2654,7 +2657,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, if (!value_optimized_out (val)) { *value = value_as_address (val); @@ -72,7 +104,7 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c } } } -@@ -2680,8 +2683,8 @@ +@@ -2662,8 +2665,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, case PROP_CONST: *value = prop->data.const_val; @@ -83,7 +115,7 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c case PROP_ADDR_OFFSET: { struct dwarf2_property_baton *baton -@@ -2702,11 +2705,38 @@ +@@ -2684,11 +2687,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, val = value_at (baton->offset_info.type, pinfo->addr + baton->offset_info.offset); *value = value_as_address (val); @@ -91,8 +123,9 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c + rc = 1; } + break; -+ } -+ + } + +- return 0; + if (rc == 1 && is_signed == 1) + { + /* If we have a valid return candidate and it's value is signed, @@ -105,11 +138,10 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c + /* Check if signed bit is set and sign-extend values. */ + if (*value & (neg_mask)) + *value |= (neg_mask ); - } ++ } + return rc; +} - -- return 0; ++ +int +dwarf2_evaluate_property (const struct dynamic_prop *prop, + struct frame_info *frame, @@ -124,11 +156,11 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c } /* See dwarf2loc.h. */ -Index: gdb-7.99.90.20170420/gdb/dwarf2loc.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/dwarf2loc.h 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/dwarf2loc.h 2017-04-20 22:26:14.356446562 +0200 -@@ -143,6 +143,12 @@ +diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h +index db026d3e68..6d24a027a3 100644 +--- a/gdb/dwarf2loc.h ++++ b/gdb/dwarf2loc.h +@@ -143,6 +143,12 @@ int dwarf2_evaluate_property (const struct dynamic_prop *prop, struct property_addr_info *addr_stack, CORE_ADDR *value); @@ -141,11 +173,11 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.h /* A helper for the compiler interface that compiles a single dynamic property to C code. -Index: gdb-7.99.90.20170420/gdb/dwarf2read.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/dwarf2read.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/dwarf2read.c 2017-04-20 22:27:08.510788562 +0200 -@@ -15268,7 +15268,7 @@ +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index 78c663c49b..4f2d04329c 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -16310,7 +16310,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type, *orig_base_type; struct type *range_type; struct attribute *attr; @@ -154,7 +186,7 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2read.c int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -15288,7 +15288,9 @@ +@@ -16330,7 +16330,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -164,7 +196,7 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2read.c /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -15321,6 +15323,13 @@ +@@ -16363,6 +16365,13 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -178,7 +210,7 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) attr_to_dynamic_prop (attr, die, cu, &low); -@@ -15397,7 +15406,7 @@ +@@ -16439,7 +16448,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; @@ -187,11 +219,11 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2read.c if (high_bound_is_count) TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1; -Index: gdb-7.99.90.20170420/gdb/eval.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/eval.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/eval.c 2017-04-20 22:26:14.362446600 +0200 -@@ -379,29 +379,325 @@ +diff --git a/gdb/eval.c b/gdb/eval.c +index 14a3e05ade..44f7a4edfe 100644 +--- a/gdb/eval.c ++++ b/gdb/eval.c +@@ -384,29 +384,325 @@ init_array_element (struct value *array, struct value *element, return index; } @@ -216,6 +248,11 @@ Index: gdb-7.99.90.20170420/gdb/eval.c - = (enum range_type) longest_to_int (exp->elts[pc].longconst); - - *pos += 3; +- +- 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)); + struct value *new_array = array; + struct type *array_type = check_typedef (value_type (new_array)); + struct type *elt_type; @@ -270,21 +307,17 @@ Index: gdb-7.99.90.20170420/gdb/eval.c + { + struct subscript_store *index = &subscript_array[i]; -- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) -- low_bound = TYPE_LOW_BOUND (range); +- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) +- high_bound = TYPE_HIGH_BOUND (range); - else -- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); +- high_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_RANGE) + { + int pc = (*pos) + 1; + subscript_range *range; - -- 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_RANGE; + range = &index->U.range; + @@ -378,8 +411,7 @@ Index: gdb-7.99.90.20170420/gdb/eval.c + + case SUBSCRIPT_INDEX: + break; - -- return value_slice (array, low_bound, high_bound - low_bound + 1); ++ + } + + array_type = TYPE_TARGET_TYPE (array_type); @@ -499,7 +531,8 @@ Index: gdb-7.99.90.20170420/gdb/eval.c + struct type *range_type, *interim_array_type; + + int new_length; -+ + +- return value_slice (array, low_bound, high_bound - low_bound + 1); + /* 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. */ @@ -534,7 +567,7 @@ Index: gdb-7.99.90.20170420/gdb/eval.c } -@@ -1790,19 +2086,8 @@ +@@ -1928,19 +2224,8 @@ evaluate_subexp_standard (struct type *expect_type, switch (code) { case TYPE_CODE_ARRAY: @@ -555,7 +588,7 @@ Index: gdb-7.99.90.20170420/gdb/eval.c case TYPE_CODE_PTR: case TYPE_CODE_FUNC: -@@ -2203,49 +2488,6 @@ +@@ -2336,49 +2621,6 @@ evaluate_subexp_standard (struct type *expect_type, } return (arg1); @@ -605,7 +638,7 @@ Index: gdb-7.99.90.20170420/gdb/eval.c case BINOP_LOGICAL_AND: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -@@ -3102,6 +3344,9 @@ +@@ -3282,6 +3524,9 @@ calc_f77_array_dims (struct type *array_type) int ndimen = 1; struct type *tmp_type; @@ -615,11 +648,11 @@ Index: gdb-7.99.90.20170420/gdb/eval.c if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY)) error (_("Can't get dimensions for a non-array type")); -Index: gdb-7.99.90.20170420/gdb/expprint.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/expprint.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/expprint.c 2017-04-20 22:26:14.363446607 +0200 -@@ -568,12 +568,10 @@ +diff --git a/gdb/expprint.c b/gdb/expprint.c +index a99832c7ab..7135fb50e2 100644 +--- a/gdb/expprint.c ++++ b/gdb/expprint.c +@@ -581,12 +581,10 @@ print_subexp_standard (struct expression *exp, int *pos, *pos += 2; fputs_filtered ("RANGE(", stream); @@ -634,7 +667,7 @@ Index: gdb-7.99.90.20170420/gdb/expprint.c print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); fputs_filtered (")", stream); return; -@@ -1055,16 +1053,16 @@ +@@ -1094,16 +1092,16 @@ dump_subexp_body_standard (struct expression *exp, switch (range_type) { @@ -655,7 +688,7 @@ Index: gdb-7.99.90.20170420/gdb/expprint.c fputs_filtered ("Range 'EXP..EXP'", stream); break; default: -@@ -1072,11 +1070,9 @@ +@@ -1111,11 +1109,9 @@ dump_subexp_body_standard (struct expression *exp, break; } @@ -669,11 +702,11 @@ Index: gdb-7.99.90.20170420/gdb/expprint.c elt = dump_subexp (exp, stream, elt); } break; -Index: gdb-7.99.90.20170420/gdb/expression.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/expression.h 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/expression.h 2017-04-20 22:26:14.363446607 +0200 -@@ -154,17 +154,17 @@ +diff --git a/gdb/expression.h b/gdb/expression.h +index 271baa9f0d..2781d355bf 100644 +--- a/gdb/expression.h ++++ b/gdb/expression.h +@@ -153,17 +153,17 @@ extern void dump_raw_expression (struct expression *, struct ui_file *, const char *); extern void dump_prefix_expression (struct expression *, struct ui_file *); @@ -700,11 +733,11 @@ Index: gdb-7.99.90.20170420/gdb/expression.h }; #endif /* !defined (EXPRESSION_H) */ -Index: gdb-7.99.90.20170420/gdb/f-exp.y -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/f-exp.y 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/f-exp.y 2017-04-20 22:26:14.363446607 +0200 -@@ -254,31 +254,63 @@ +diff --git a/gdb/f-exp.y b/gdb/f-exp.y +index 217191ac88..71c61cab69 100644 +--- a/gdb/f-exp.y ++++ b/gdb/f-exp.y +@@ -257,31 +257,63 @@ arglist : subrange arglist : arglist ',' exp %prec ABOVE_COMMA { arglist_len++; } @@ -773,11 +806,11 @@ Index: gdb-7.99.90.20170420/gdb/f-exp.y write_exp_elt_opcode (pstate, OP_RANGE); } ; -Index: gdb-7.99.90.20170420/gdb/f-valprint.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/f-valprint.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/f-valprint.c 2017-04-20 22:26:14.364446613 +0200 -@@ -121,8 +121,14 @@ +diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c +index c9ece0d5c0..b878d52b62 100644 +--- a/gdb/f-valprint.c ++++ b/gdb/f-valprint.c +@@ -119,8 +119,14 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, if (nss != ndimensions) { @@ -793,11 +826,11 @@ Index: gdb-7.99.90.20170420/gdb/f-valprint.c for (i = lowerbound; (i < upperbound + 1 && (*elts) < options->print_max); -Index: gdb-7.99.90.20170420/gdb/gdbtypes.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/gdbtypes.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/gdbtypes.c 2017-04-20 22:26:14.365446619 +0200 -@@ -862,7 +862,8 @@ +diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c +index 01ab6fa8c7..63ada5a46c 100644 +--- a/gdb/gdbtypes.c ++++ b/gdb/gdbtypes.c +@@ -864,7 +864,8 @@ allocate_stub_method (struct type *type) struct type * create_range_type (struct type *result_type, struct type *index_type, const struct dynamic_prop *low_bound, @@ -807,7 +840,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.c { if (result_type == NULL) result_type = alloc_type_copy (index_type); -@@ -877,6 +878,7 @@ +@@ -879,6 +880,7 @@ create_range_type (struct type *result_type, struct type *index_type, TYPE_ZALLOC (result_type, sizeof (struct range_bounds)); TYPE_RANGE_DATA (result_type)->low = *low_bound; TYPE_RANGE_DATA (result_type)->high = *high_bound; @@ -815,7 +848,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.c if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0) TYPE_UNSIGNED (result_type) = 1; -@@ -905,7 +907,7 @@ +@@ -907,7 +909,7 @@ struct type * create_static_range_type (struct type *result_type, struct type *index_type, LONGEST low_bound, LONGEST high_bound) { @@ -824,7 +857,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.c low.kind = PROP_CONST; low.data.const_val = low_bound; -@@ -913,7 +915,11 @@ +@@ -915,7 +917,11 @@ create_static_range_type (struct type *result_type, struct type *index_type, high.kind = PROP_CONST; high.data.const_val = high_bound; @@ -837,7 +870,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.c return result_type; } -@@ -1110,16 +1116,20 @@ +@@ -1112,16 +1118,20 @@ create_array_type_with_stride (struct type *result_type, && (!type_not_associated (result_type) && !type_not_allocated (result_type))) { @@ -859,7 +892,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.c else if (bit_stride > 0) TYPE_LENGTH (result_type) = (bit_stride * (high_bound - low_bound + 1) + 7) / 8; -@@ -1912,12 +1922,12 @@ +@@ -1914,12 +1924,12 @@ resolve_dynamic_range (struct type *dyn_range_type, CORE_ADDR value; struct type *static_range_type, *static_target_type; const struct dynamic_prop *prop; @@ -874,7 +907,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.c { low_bound.kind = PROP_CONST; low_bound.data.const_val = value; -@@ -1929,7 +1939,7 @@ +@@ -1931,7 +1941,7 @@ resolve_dynamic_range (struct type *dyn_range_type, } prop = &TYPE_RANGE_DATA (dyn_range_type)->high; @@ -883,7 +916,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.c { high_bound.kind = PROP_CONST; high_bound.data.const_val = value; -@@ -1944,12 +1954,20 @@ +@@ -1946,12 +1956,20 @@ resolve_dynamic_range (struct type *dyn_range_type, high_bound.data.const_val = 0; } @@ -905,11 +938,11 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.c TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1; return static_range_type; } -Index: gdb-7.99.90.20170420/gdb/gdbtypes.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/gdbtypes.h 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/gdbtypes.h 2017-04-20 22:26:14.365446619 +0200 -@@ -551,6 +551,10 @@ +diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h +index 03709aa145..e26a09b456 100644 +--- a/gdb/gdbtypes.h ++++ b/gdb/gdbtypes.h +@@ -547,6 +547,10 @@ struct range_bounds struct dynamic_prop high; @@ -920,7 +953,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.h /* True if HIGH range bound contains the number of elements in the subrange. This affects how the final hight bound is computed. */ -@@ -713,7 +717,6 @@ +@@ -708,7 +712,6 @@ struct main_type /* * Union member used for range types. */ struct range_bounds *bounds; @@ -928,7 +961,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.h } flds_bnds; /* * Slot to point to additional language-specific fields of this -@@ -1228,6 +1231,15 @@ +@@ -1223,6 +1226,15 @@ extern void allocate_gnat_aux_type (struct type *); TYPE_RANGE_DATA(range_type)->high.kind #define TYPE_LOW_BOUND_KIND(range_type) \ TYPE_RANGE_DATA(range_type)->low.kind @@ -944,7 +977,7 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.h /* Property accessors for the type data location. */ #define TYPE_DATA_LOCATION(thistype) \ -@@ -1262,6 +1274,9 @@ +@@ -1257,6 +1269,9 @@ extern void allocate_gnat_aux_type (struct type *); TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) @@ -954,19 +987,19 @@ Index: gdb-7.99.90.20170420/gdb/gdbtypes.h #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) -@@ -1776,6 +1791,7 @@ +@@ -1772,6 +1787,7 @@ extern struct type *create_array_type_with_stride + (struct type *, struct type *, struct type *, unsigned int); extern struct type *create_range_type (struct type *, struct type *, - const struct dynamic_prop *, + const struct dynamic_prop *, + const struct dynamic_prop *, const struct dynamic_prop *); - extern struct type *create_array_type (struct type *, struct type *, -Index: gdb-7.99.90.20170420/gdb/parse.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/parse.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/parse.c 2017-04-20 22:26:14.366446625 +0200 -@@ -1007,22 +1007,20 @@ +diff --git a/gdb/parse.c b/gdb/parse.c +index 506efa38fb..9ba6314ab2 100644 +--- a/gdb/parse.c ++++ b/gdb/parse.c +@@ -988,22 +988,20 @@ operator_length_standard (const struct expression *expr, int endpos, case OP_RANGE: oplen = 3; @@ -1000,11 +1033,11 @@ Index: gdb-7.99.90.20170420/gdb/parse.c break; -Index: gdb-7.99.90.20170420/gdb/rust-exp.y -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/rust-exp.y 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/rust-exp.y 2017-04-20 22:26:14.366446625 +0200 -@@ -2409,23 +2409,17 @@ +diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y +index e372a6ea1e..8bbecd2f2f 100644 +--- a/gdb/rust-exp.y ++++ b/gdb/rust-exp.y +@@ -2452,23 +2452,17 @@ convert_ast_to_expression (struct parser_state *state, case OP_RANGE: { @@ -1031,11 +1064,11 @@ Index: gdb-7.99.90.20170420/gdb/rust-exp.y } write_exp_elt_opcode (state, OP_RANGE); write_exp_elt_longcst (state, kind); -Index: gdb-7.99.90.20170420/gdb/rust-lang.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/rust-lang.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/rust-lang.c 2017-04-20 22:26:14.367446632 +0200 -@@ -1314,9 +1314,9 @@ +diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c +index f3562e0f32..1853f683e9 100644 +--- a/gdb/rust-lang.c ++++ b/gdb/rust-lang.c +@@ -1368,9 +1368,9 @@ rust_range (struct expression *exp, int *pos, enum noside noside) kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst); *pos += 3; @@ -1047,7 +1080,7 @@ Index: gdb-7.99.90.20170420/gdb/rust-lang.c high = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -@@ -1405,7 +1405,7 @@ +@@ -1459,7 +1459,7 @@ rust_compute_range (struct type *type, struct value *range, *low = 0; *high = 0; @@ -1056,7 +1089,7 @@ Index: gdb-7.99.90.20170420/gdb/rust-lang.c if (TYPE_NFIELDS (type) == 0) return; -@@ -1413,15 +1413,14 @@ +@@ -1467,15 +1467,14 @@ rust_compute_range (struct type *type, struct value *range, i = 0; if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0) { @@ -1074,7 +1107,7 @@ Index: gdb-7.99.90.20170420/gdb/rust-lang.c *high = value_as_long (value_field (range, i)); } } -@@ -1436,7 +1435,7 @@ +@@ -1490,7 +1489,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, struct type *rhstype; LONGEST low, high_bound; /* Initialized to appease the compiler. */ @@ -1083,7 +1116,7 @@ Index: gdb-7.99.90.20170420/gdb/rust-lang.c LONGEST high = 0; int want_slice = 0; -@@ -1498,7 +1497,7 @@ +@@ -1588,7 +1587,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, error (_("Cannot subscript non-array type")); if (want_slice @@ -1092,7 +1125,7 @@ Index: gdb-7.99.90.20170420/gdb/rust-lang.c low = low_bound; if (low < 0) error (_("Index less than zero")); -@@ -1516,7 +1515,7 @@ +@@ -1606,7 +1605,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, CORE_ADDR addr; struct value *addrval, *tem; @@ -1101,10 +1134,11 @@ Index: gdb-7.99.90.20170420/gdb/rust-lang.c high = high_bound; if (high < 0) error (_("High index less than zero")); -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/static-arrays.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/static-arrays.exp 2017-04-20 22:26:14.367446632 +0200 +diff --git a/gdb/testsuite/gdb.fortran/static-arrays.exp b/gdb/testsuite/gdb.fortran/static-arrays.exp +new file mode 100644 +index 0000000000..cc9ecc04ab +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/static-arrays.exp @@ -0,0 +1,421 @@ +# Copyright 2015 Free Software Foundation, Inc. +# @@ -1527,10 +1561,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/static-arrays.exp +gdb_test "print ar1\(3:7\) = 42" \ + "Invalid cast." \ + "Assignment of value to subarray" -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/static-arrays.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/static-arrays.f90 2017-04-20 22:26:14.368446638 +0200 +diff --git a/gdb/testsuite/gdb.fortran/static-arrays.f90 b/gdb/testsuite/gdb.fortran/static-arrays.f90 +new file mode 100644 +index 0000000000..f22fcbe124 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/static-arrays.f90 @@ -0,0 +1,55 @@ +! Copyright 2015 Free Software Foundation, Inc. +! @@ -1587,11 +1622,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/static-arrays.f90 +program testprog + call sub +end -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-ptype.exp -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-04-20 22:26:14.368446638 +0200 -@@ -98,3 +98,7 @@ +diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp +index c8e72e92e7..76f47708d8 100644 +--- a/gdb/testsuite/gdb.fortran/vla-ptype.exp ++++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp +@@ -98,3 +98,7 @@ gdb_test "ptype vla2" "type = " "ptype vla2 not allocated" gdb_test "ptype vla2(5, 45, 20)" \ "no such vector element \\\(vector not allocated\\\)" \ "ptype vla2(5, 45, 20) not allocated" @@ -1599,11 +1634,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-ptype.exp +gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"] +gdb_continue_to_breakpoint "vla1-neg-bounds" +gdb_test "ptype vla1" "type = $real \\(-2:1,-5:4,-3:-1\\)" "ptype vla1 negative bounds" -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-sizeof.exp -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2017-04-20 22:26:14.368446638 +0200 -@@ -44,3 +44,7 @@ +diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp +index 87b76835db..27403f1f47 100644 +--- a/gdb/testsuite/gdb.fortran/vla-sizeof.exp ++++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp +@@ -44,3 +44,7 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla" gdb_breakpoint [gdb_get_line_number "pvla-associated"] gdb_continue_to_breakpoint "pvla-associated" gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla" @@ -1611,10 +1646,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-sizeof.exp +gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"] +gdb_continue_to_breakpoint "vla1-neg-bounds" +gdb_test "print sizeof(vla1)" " = 480" "print sizeof vla1 negative bounds" -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-stride.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-stride.exp 2017-04-20 22:26:14.368446638 +0200 +diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp +new file mode 100644 +index 0000000000..dcf15e5daf +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-stride.exp @@ -0,0 +1,44 @@ +# Copyright 2016 Free Software Foundation, Inc. + @@ -1660,10 +1696,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-stride.exp +gdb_continue_to_breakpoint "single-element" +gdb_test "print pvla" " = \\\(5\\\)" "print single-element" +gdb_test "print pvla(1)" " = 5" "print one single-element" -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-stride.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-stride.f90 2017-04-20 22:26:14.368446638 +0200 +diff --git a/gdb/testsuite/gdb.fortran/vla-stride.f90 b/gdb/testsuite/gdb.fortran/vla-stride.f90 +new file mode 100644 +index 0000000000..8d2425222e +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-stride.f90 @@ -0,0 +1,29 @@ +! Copyright 2016 Free Software Foundation, Inc. +! @@ -1694,11 +1731,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla-stride.f90 + + pvla => null() ! single-element +end program vla_stride -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla.f90 -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/testsuite/gdb.fortran/vla.f90 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla.f90 2017-04-20 22:26:14.368446638 +0200 -@@ -54,4 +54,14 @@ +diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90 +index 0006b3364a..b3ada0a41b 100644 +--- a/gdb/testsuite/gdb.fortran/vla.f90 ++++ b/gdb/testsuite/gdb.fortran/vla.f90 +@@ -54,4 +54,14 @@ program vla allocate (vla3 (2,2)) ! vla2-deallocated vla3(:,:) = 13 @@ -1713,11 +1750,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/vla.f90 + l = allocated(vla1) + end program vla -Index: gdb-7.99.90.20170420/gdb/valarith.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/valarith.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/valarith.c 2017-04-20 22:26:14.369446644 +0200 -@@ -193,10 +193,16 @@ +diff --git a/gdb/valarith.c b/gdb/valarith.c +index 89e44f3fb0..59af9fcde4 100644 +--- a/gdb/valarith.c ++++ b/gdb/valarith.c +@@ -189,10 +189,16 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); ULONGEST elt_size = type_length_units (elt_type); @@ -1736,14 +1773,15 @@ Index: gdb-7.99.90.20170420/gdb/valarith.c { if (type_not_associated (array_type)) error (_("no such vector element (vector not associated)")); -Index: gdb-7.99.90.20170420/gdb/valops.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/valops.c 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/valops.c 2017-04-20 22:26:14.370446651 +0200 -@@ -3786,55 +3786,194 @@ +diff --git a/gdb/valops.c b/gdb/valops.c +index ccc2bc2afe..4715912b94 100644 +--- a/gdb/valops.c ++++ b/gdb/valops.c +@@ -3776,56 +3776,195 @@ 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 default stride + value of '1', which returns every element between LOWBOUND and + (LOWBOUND + LENGTH). We also provide a default CALL_COUNT of '1' @@ -1768,7 +1806,7 @@ Index: gdb-7.99.90.20170420/gdb/valops.c +struct value * +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; - LONGEST lowerbound, upperbound; - struct value *slice; @@ -1790,10 +1828,6 @@ Index: gdb-7.99.90.20170420/gdb/valops.c - range_type = TYPE_INDEX_TYPE (array_type); - if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0) - error (_("slice from bad array or bitstring")); -- -- if (lowbound < lowerbound || length < 0 -- || lowbound + length - 1 > upperbound) -- error (_("slice out of range")); + ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type)); + ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (array_type)); + @@ -1819,7 +1853,10 @@ Index: gdb-7.99.90.20170420/gdb/valops.c + + elt_size = TYPE_LENGTH (elt_type); + elt_offs = lowbound - ary_low_bound; -+ + +- if (lowbound < lowerbound || length < 0 +- || lowbound + length - 1 > upperbound) +- error (_("slice out of range")); + elt_offs *= elt_size; + + /* Check for valid user input. In case of Fortran this was already done @@ -1866,11 +1903,6 @@ Index: gdb-7.99.90.20170420/gdb/valops.c - struct type *element_type = TYPE_TARGET_TYPE (array_type); - LONGEST offset - = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type)); -- -- slice_type = create_array_type ((struct type *) NULL, -- element_type, -- slice_range_type); -- TYPE_CODE (slice_type) = TYPE_CODE (array_type); + struct type *element_type; + + /* When both CALL_COUNT and STRIDE_LENGTH equal 1, we can use the legacy @@ -1880,9 +1912,15 @@ Index: gdb-7.99.90.20170420/gdb/valops.c + element_type = TYPE_TARGET_TYPE (array_type); + + slice_type = create_array_type (NULL, element_type, slice_range_type); -+ + +- slice_type = create_array_type ((struct type *) NULL, +- element_type, +- slice_range_type); +- TYPE_CODE (slice_type) = TYPE_CODE (array_type); + TYPE_CODE (slice_type) = TYPE_CODE (array_type); -+ + +- if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) +- slice = allocate_value_lazy (slice_type); + if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) + v = allocate_value_lazy (slice_type); + else @@ -1894,9 +1932,7 @@ Index: gdb-7.99.90.20170420/gdb/valops.c + 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); ++ + } + /* 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 @@ -1967,11 +2003,11 @@ Index: gdb-7.99.90.20170420/gdb/valops.c } /* Create a value for a FORTRAN complex number. Currently most of the -Index: gdb-7.99.90.20170420/gdb/value.h -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/value.h 2017-04-20 22:25:43.973254685 +0200 -+++ gdb-7.99.90.20170420/gdb/value.h 2017-04-20 22:26:14.370446651 +0200 -@@ -1106,6 +1106,8 @@ +diff --git a/gdb/value.h b/gdb/value.h +index e0de84427e..8e85452969 100644 +--- a/gdb/value.h ++++ b/gdb/value.h +@@ -1128,6 +1128,8 @@ extern struct value *varying_to_slice (struct value *); extern struct value *value_slice (struct value *, int, int); @@ -1980,3 +2016,6 @@ Index: gdb-7.99.90.20170420/gdb/value.h extern struct value *value_literal_complex (struct value *, struct value *, struct type *); +-- +2.14.3 + diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index c20df1d..781a174 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -1,10 +1,12 @@ -From f408ba821f8c8b5ad6564b98806666d2478f7599 Mon Sep 17 00:00:00 2001 +From 143f160585f142377f0ed46fac353a7189fdccbb Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-vla-intel-fortran-vla-strings.patch FileName: gdb-vla-intel-fortran-vla-strings.patch +;;=push + git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings 0ad7d8d1a3a36c6e04e3b6d37d8825f18d595723 @@ -29,25 +31,51 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings gdb/valops.c | 16 ++- gdb/valprint.c | 6 -- 20 files changed, 827 insertions(+), 110 deletions(-) +--- + gdb/NEWS | 2 + + gdb/c-valprint.c | 22 ++++ + gdb/dwarf2read.c | 160 +++++++++++++++++++++++++----- + gdb/f-typeprint.c | 93 +++++++++-------- + gdb/gdbtypes.c | 44 +++++++- + gdb/testsuite/gdb.cp/vla-cxx.cc | 9 ++ + gdb/testsuite/gdb.cp/vla-cxx.exp | 9 ++ + gdb/testsuite/gdb.fortran/pointers.exp | 143 ++++++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/pointers.f90 | 109 ++++++++++++++++++++ + gdb/testsuite/gdb.fortran/print_type.exp | 100 +++++++++++++++++++ + gdb/testsuite/gdb.fortran/vla-ptype.exp | 12 +-- + gdb/testsuite/gdb.fortran/vla-strings.exp | 103 +++++++++++++++++++ + gdb/testsuite/gdb.fortran/vla-strings.f90 | 39 ++++++++ + gdb/testsuite/gdb.fortran/vla-type.exp | 7 +- + gdb/testsuite/gdb.fortran/vla-value.exp | 4 +- + gdb/testsuite/gdb.mi/mi-vla-fortran.exp | 8 +- + gdb/typeprint.c | 19 ++++ + gdb/valops.c | 16 ++- + gdb/valprint.c | 6 -- + 19 files changed, 807 insertions(+), 98 deletions(-) + create mode 100644 gdb/testsuite/gdb.fortran/pointers.exp + create mode 100644 gdb/testsuite/gdb.fortran/pointers.f90 + create mode 100644 gdb/testsuite/gdb.fortran/print_type.exp + create mode 100644 gdb/testsuite/gdb.fortran/vla-strings.exp + create mode 100644 gdb/testsuite/gdb.fortran/vla-strings.f90 -Index: gdb-8.0/gdb/NEWS -=================================================================== ---- gdb-8.0.orig/gdb/NEWS 2017-06-09 05:51:58.211401718 +0200 -+++ gdb-8.0/gdb/NEWS 2017-06-09 05:52:11.586504927 +0200 +diff --git a/gdb/NEWS b/gdb/NEWS +index ff9a819918..100470b90d 100644 +--- a/gdb/NEWS ++++ b/gdb/NEWS @@ -1,6 +1,8 @@ What has changed in GDB? (Organized release by release) +* Fortran: Support pointers to dynamic types. + - *** Changes in GDB 8.0 + *** Changes since GDB 8.0 - * GDB now supports access to the PKU register on GNU/Linux. The register is -Index: gdb-8.0/gdb/c-valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/c-valprint.c 2017-06-09 05:51:55.838383406 +0200 -+++ gdb-8.0/gdb/c-valprint.c 2017-06-09 05:51:58.212401726 +0200 -@@ -650,6 +650,28 @@ + * New "--readnever" command line option instructs GDB to not read each +diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c +index 653fed657a..96e6c597cf 100644 +--- a/gdb/c-valprint.c ++++ b/gdb/c-valprint.c +@@ -650,6 +650,28 @@ c_value_print (struct value *val, struct ui_file *stream, else { /* normal case */ @@ -76,11 +104,11 @@ Index: gdb-8.0/gdb/c-valprint.c fprintf_filtered (stream, "("); type_print (value_type (val), "", stream, -1); fprintf_filtered (stream, ") "); -Index: gdb-8.0/gdb/dwarf2read.c -=================================================================== ---- gdb-8.0.orig/gdb/dwarf2read.c 2017-06-09 05:51:55.859383569 +0200 -+++ gdb-8.0/gdb/dwarf2read.c 2017-06-09 05:51:58.218401772 +0200 -@@ -1872,7 +1872,8 @@ +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index 4f2d04329c..fdd1d9d688 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -1974,7 +1974,8 @@ static void read_signatured_type (struct signatured_type *); static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, struct dwarf2_cu *cu, @@ -90,7 +118,7 @@ Index: gdb-8.0/gdb/dwarf2read.c /* memory allocation interface */ -@@ -11557,7 +11558,7 @@ +@@ -12562,7 +12563,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { newobj->static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); @@ -99,16 +127,16 @@ Index: gdb-8.0/gdb/dwarf2read.c } cu->list_in_scope = &local_symbols; -@@ -14791,29 +14792,94 @@ +@@ -15834,29 +15835,94 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; - unsigned int length; + unsigned int length = UINT_MAX; - ++ + index_type = objfile_type (objfile)->builtin_int; + range_type = create_static_range_type (NULL, index_type, 1, length); -+ + + /* If DW_AT_string_length is defined, the length is stored in memory. */ attr = dwarf2_attr (die, DW_AT_string_length, cu); if (attr) @@ -205,7 +233,7 @@ Index: gdb-8.0/gdb/dwarf2read.c char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -15163,7 +15229,8 @@ +@@ -16205,7 +16271,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, @@ -215,7 +243,7 @@ Index: gdb-8.0/gdb/dwarf2read.c { struct dwarf2_property_baton *baton; struct obstack *obstack = &cu->objfile->objfile_obstack; -@@ -15173,14 +15240,33 @@ +@@ -16215,14 +16282,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (attr_form_is_block (attr)) { @@ -253,7 +281,7 @@ Index: gdb-8.0/gdb/dwarf2read.c } else if (attr_form_is_ref (attr)) { -@@ -15213,8 +15299,28 @@ +@@ -16255,8 +16341,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; @@ -284,7 +312,7 @@ Index: gdb-8.0/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -15325,24 +15431,24 @@ +@@ -16367,24 +16473,24 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_byte_stride, cu); if (attr) @@ -313,7 +341,7 @@ Index: gdb-8.0/gdb/dwarf2read.c { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -22967,7 +23073,7 @@ +@@ -23973,7 +24079,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_allocated, cu); if (attr_form_is_block (attr)) { @@ -322,7 +350,7 @@ Index: gdb-8.0/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ALLOCATED, prop, type, objfile); } else if (attr != NULL) -@@ -22982,7 +23088,7 @@ +@@ -23988,7 +24094,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_associated, cu); if (attr_form_is_block (attr)) { @@ -331,7 +359,7 @@ Index: gdb-8.0/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type, objfile); } else if (attr != NULL) -@@ -22995,7 +23101,7 @@ +@@ -24001,7 +24107,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); @@ -340,11 +368,11 @@ Index: gdb-8.0/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile); if (dwarf2_per_objfile->die_type_hash == NULL) -Index: gdb-8.0/gdb/f-typeprint.c -=================================================================== ---- gdb-8.0.orig/gdb/f-typeprint.c 2017-06-09 05:51:39.273255581 +0200 -+++ gdb-8.0/gdb/f-typeprint.c 2017-06-09 05:51:58.218401772 +0200 -@@ -37,7 +37,7 @@ +diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c +index 9d9a1f30b9..dccdfe79c6 100644 +--- a/gdb/f-typeprint.c ++++ b/gdb/f-typeprint.c +@@ -37,7 +37,7 @@ static void f_type_print_args (struct type *, struct ui_file *); #endif static void f_type_print_varspec_suffix (struct type *, struct ui_file *, int, @@ -353,7 +381,7 @@ Index: gdb-8.0/gdb/f-typeprint.c void f_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); -@@ -53,18 +53,6 @@ +@@ -53,18 +53,6 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, { enum type_code code; @@ -372,7 +400,7 @@ Index: gdb-8.0/gdb/f-typeprint.c f_type_print_base (type, stream, show, level); code = TYPE_CODE (type); if ((varstring != NULL && *varstring != '\0') -@@ -89,7 +77,7 @@ +@@ -89,7 +77,7 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, demangled_args = (*varstring != '\0' && varstring[strlen (varstring) - 1] == ')'); @@ -381,7 +409,7 @@ Index: gdb-8.0/gdb/f-typeprint.c } } -@@ -159,7 +147,7 @@ +@@ -159,7 +147,7 @@ f_type_print_varspec_prefix (struct type *type, struct ui_file *stream, static void f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, int show, int passed_a_ptr, int demangled_args, @@ -390,7 +418,7 @@ Index: gdb-8.0/gdb/f-typeprint.c { int upper_bound, lower_bound; -@@ -183,34 +171,50 @@ +@@ -183,34 +171,50 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, fprintf_filtered (stream, "("); if (type_not_associated (type)) @@ -467,7 +495,7 @@ Index: gdb-8.0/gdb/f-typeprint.c if (arrayprint_recurse_level == 1) fprintf_filtered (stream, ")"); else -@@ -221,13 +225,14 @@ +@@ -221,13 +225,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, case TYPE_CODE_PTR: case TYPE_CODE_REF: f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0, @@ -484,7 +512,7 @@ Index: gdb-8.0/gdb/f-typeprint.c if (passed_a_ptr) fprintf_filtered (stream, ")"); -@@ -378,7 +383,7 @@ +@@ -383,7 +388,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, fputs_filtered (" :: ", stream); fputs_filtered (TYPE_FIELD_NAME (type, index), stream); f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index), @@ -493,11 +521,11 @@ Index: gdb-8.0/gdb/f-typeprint.c fputs_filtered ("\n", stream); } fprintfi_filtered (level, stream, "End Type "); -Index: gdb-8.0/gdb/gdbtypes.c -=================================================================== ---- gdb-8.0.orig/gdb/gdbtypes.c 2017-06-09 05:51:55.864383607 +0200 -+++ gdb-8.0/gdb/gdbtypes.c 2017-06-09 05:51:58.219401780 +0200 -@@ -1839,7 +1839,8 @@ +diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c +index 63ada5a46c..a25e0a84e9 100644 +--- a/gdb/gdbtypes.c ++++ b/gdb/gdbtypes.c +@@ -1842,7 +1842,8 @@ is_dynamic_type_internal (struct type *type, int top_level) type = check_typedef (type); /* We only want to recognize references at the outermost level. */ @@ -507,7 +535,7 @@ Index: gdb-8.0/gdb/gdbtypes.c type = check_typedef (TYPE_TARGET_TYPE (type)); /* Types that have a dynamic TYPE_DATA_LOCATION are considered -@@ -1873,6 +1874,7 @@ +@@ -1876,6 +1877,7 @@ is_dynamic_type_internal (struct type *type, int top_level) } case TYPE_CODE_ARRAY: @@ -515,7 +543,7 @@ Index: gdb-8.0/gdb/gdbtypes.c { gdb_assert (TYPE_NFIELDS (type) == 1); -@@ -1985,7 +1987,8 @@ +@@ -1988,7 +1990,8 @@ resolve_dynamic_array (struct type *type, struct type *ary_dim; struct dynamic_prop *prop; @@ -525,7 +553,7 @@ Index: gdb-8.0/gdb/gdbtypes.c type = copy_type (type); -@@ -2010,13 +2013,17 @@ +@@ -2013,13 +2016,17 @@ resolve_dynamic_array (struct type *type, ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type)); @@ -546,7 +574,7 @@ Index: gdb-8.0/gdb/gdbtypes.c } /* Resolve dynamic bounds of members of the union TYPE to static -@@ -2146,6 +2153,28 @@ +@@ -2149,6 +2156,28 @@ resolve_dynamic_struct (struct type *type, return resolved_type; } @@ -575,7 +603,7 @@ Index: gdb-8.0/gdb/gdbtypes.c /* Worker for resolved_dynamic_type. */ static struct type * -@@ -2194,7 +2223,12 @@ +@@ -2197,7 +2226,12 @@ resolve_dynamic_type_internal (struct type *type, break; } @@ -588,10 +616,10 @@ Index: gdb-8.0/gdb/gdbtypes.c resolved_type = resolve_dynamic_array (type, addr_stack); break; -Index: gdb-8.0/gdb/testsuite/gdb.cp/vla-cxx.cc -=================================================================== ---- gdb-8.0.orig/gdb/testsuite/gdb.cp/vla-cxx.cc 2017-06-09 05:51:55.864383607 +0200 -+++ gdb-8.0/gdb/testsuite/gdb.cp/vla-cxx.cc 2017-06-09 05:51:58.219401780 +0200 +diff --git a/gdb/testsuite/gdb.cp/vla-cxx.cc b/gdb/testsuite/gdb.cp/vla-cxx.cc +index 83bd24b190..15c683e89c 100644 +--- a/gdb/testsuite/gdb.cp/vla-cxx.cc ++++ b/gdb/testsuite/gdb.cp/vla-cxx.cc @@ -15,6 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -603,7 +631,7 @@ Index: gdb-8.0/gdb/testsuite/gdb.cp/vla-cxx.cc struct container; struct element -@@ -40,11 +44,16 @@ +@@ -40,11 +44,16 @@ int main(int argc, char **argv) typedef typeof (vla) &vlareftypedef; vlareftypedef vlaref2 (vla); container c; @@ -620,11 +648,11 @@ Index: gdb-8.0/gdb/testsuite/gdb.cp/vla-cxx.cc + return vla[2]; } -Index: gdb-8.0/gdb/testsuite/gdb.cp/vla-cxx.exp -=================================================================== ---- gdb-8.0.orig/gdb/testsuite/gdb.cp/vla-cxx.exp 2017-06-09 05:51:55.864383607 +0200 -+++ gdb-8.0/gdb/testsuite/gdb.cp/vla-cxx.exp 2017-06-09 05:51:58.220401787 +0200 -@@ -23,6 +23,12 @@ +diff --git a/gdb/testsuite/gdb.cp/vla-cxx.exp b/gdb/testsuite/gdb.cp/vla-cxx.exp +index a8d811dcf2..04b4ae6e10 100644 +--- a/gdb/testsuite/gdb.cp/vla-cxx.exp ++++ b/gdb/testsuite/gdb.cp/vla-cxx.exp +@@ -23,6 +23,12 @@ if ![runto_main] { return -1 } @@ -637,17 +665,18 @@ Index: gdb-8.0/gdb/testsuite/gdb.cp/vla-cxx.exp gdb_breakpoint [gdb_get_line_number "vlas_filled"] gdb_continue_to_breakpoint "vlas_filled" -@@ -33,3 +39,6 @@ +@@ -33,3 +39,6 @@ gdb_test "print vlaref" " = \\(int \\(&\\)\\\[3\\\]\\) @$hex: \\{5, 7, 9\\}" # bug being tested, it's better not to depend on the exact spelling. gdb_test "print vlaref2" " = \\(.*\\) @$hex: \\{5, 7, 9\\}" gdb_test "print c" " = \\{e = \\{c = @$hex\\}\\}" +gdb_test "ptype ptr" "int \\(\\*\\)\\\[3\\\]" +gdb_test "print ptr" "\\(int \\(\\*\\)\\\[3\\\]\\) $hex" +gdb_test "print *ptr" " = \\{5, 7, 9\\}" -Index: gdb-8.0/gdb/testsuite/gdb.fortran/pointers.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-8.0/gdb/testsuite/gdb.fortran/pointers.exp 2017-06-09 05:51:58.220401787 +0200 +diff --git a/gdb/testsuite/gdb.fortran/pointers.exp b/gdb/testsuite/gdb.fortran/pointers.exp +new file mode 100644 +index 0000000000..67cf99989d +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/pointers.exp @@ -0,0 +1,143 @@ +# Copyright 2016 Free Software Foundation, Inc. + @@ -792,10 +821,11 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/pointers.exp +gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array" +gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla" +gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex " "Print program counter" -Index: gdb-8.0/gdb/testsuite/gdb.fortran/pointers.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-8.0/gdb/testsuite/gdb.fortran/pointers.f90 2017-06-09 05:51:58.220401787 +0200 +diff --git a/gdb/testsuite/gdb.fortran/pointers.f90 b/gdb/testsuite/gdb.fortran/pointers.f90 +new file mode 100644 +index 0000000000..6240c87988 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/pointers.f90 @@ -0,0 +1,109 @@ +! Copyright 2016 Free Software Foundation, Inc. +! @@ -906,10 +936,11 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/pointers.f90 + intv = intv + 1 ! After value assignment + +end program pointers -Index: gdb-8.0/gdb/testsuite/gdb.fortran/print_type.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-8.0/gdb/testsuite/gdb.fortran/print_type.exp 2017-06-09 05:51:58.220401787 +0200 +diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortran/print_type.exp +new file mode 100644 +index 0000000000..45b4968f6c +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/print_type.exp @@ -0,0 +1,100 @@ +# Copyright 2016 Free Software Foundation, Inc. + @@ -1011,11 +1042,11 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/print_type.exp + } +} +gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)" -Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-ptype.exp -=================================================================== ---- gdb-8.0.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-06-09 05:51:55.865383615 +0200 -+++ gdb-8.0/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-06-09 05:51:58.221401795 +0200 -@@ -32,9 +32,9 @@ +diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp +index 76f47708d8..eea93534d2 100644 +--- a/gdb/testsuite/gdb.fortran/vla-ptype.exp ++++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp +@@ -32,9 +32,9 @@ set real [fortran_real4] # Check the ptype of various VLA states and pointer to VLA's. gdb_breakpoint [gdb_get_line_number "vla1-init"] gdb_continue_to_breakpoint "vla1-init" @@ -1028,7 +1059,7 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-ptype.exp gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \ "ptype vla1(3, 6, 9) not initialized" gdb_test "ptype vla2(5, 45, 20)" \ -@@ -81,20 +81,20 @@ +@@ -81,20 +81,20 @@ gdb_test "ptype vla2(5, 45, 20)" "type = $real" \ gdb_breakpoint [gdb_get_line_number "pvla-deassociated"] gdb_continue_to_breakpoint "pvla-deassociated" @@ -1052,10 +1083,11 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-ptype.exp gdb_test "ptype vla2(5, 45, 20)" \ "no such vector element \\\(vector not allocated\\\)" \ "ptype vla2(5, 45, 20) not allocated" -Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-strings.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-8.0/gdb/testsuite/gdb.fortran/vla-strings.exp 2017-06-09 05:51:58.221401795 +0200 +diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp +new file mode 100644 +index 0000000000..484fdcb652 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-strings.exp @@ -0,0 +1,103 @@ +# Copyright 2016 Free Software Foundation, Inc. + @@ -1160,10 +1192,11 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-strings.exp + pass $test + } +} -Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-strings.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-8.0/gdb/testsuite/gdb.fortran/vla-strings.f90 2017-06-09 05:51:58.221401795 +0200 +diff --git a/gdb/testsuite/gdb.fortran/vla-strings.f90 b/gdb/testsuite/gdb.fortran/vla-strings.f90 +new file mode 100644 +index 0000000000..3c22735fdb +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-strings.f90 @@ -0,0 +1,39 @@ +! Copyright 2016 Free Software Foundation, Inc. +! @@ -1204,11 +1237,11 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-strings.f90 + var_char_p => null() + l = associated(var_char_p) ! var_char_p-not-associated +end program vla_strings -Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-type.exp -=================================================================== ---- gdb-8.0.orig/gdb/testsuite/gdb.fortran/vla-type.exp 2017-06-09 05:51:55.866383622 +0200 -+++ gdb-8.0/gdb/testsuite/gdb.fortran/vla-type.exp 2017-06-09 05:51:58.221401795 +0200 -@@ -132,7 +132,10 @@ +diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp +index 6728b48be7..87aac396a2 100755 +--- a/gdb/testsuite/gdb.fortran/vla-type.exp ++++ b/gdb/testsuite/gdb.fortran/vla-type.exp +@@ -132,7 +132,10 @@ gdb_test "ptype fivearr(2)%tone" \ "End Type one" ] # Check allocation status of dynamic array and it's dynamic members @@ -1220,7 +1253,7 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-type.exp gdb_test "next" "" gdb_test "ptype fivedynarr(2)" \ [multi_line "type = Type five" \ -@@ -141,7 +144,7 @@ +@@ -141,7 +144,7 @@ gdb_test "ptype fivedynarr(2)" \ "ptype fivedynarr(2), tone is not allocated" gdb_test "ptype fivedynarr(2)%tone" \ [multi_line "type = Type one" \ @@ -1229,114 +1262,35 @@ Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-type.exp "End Type one" ] \ "ptype fivedynarr(2)%tone, not allocated" -Index: gdb-8.0/gdb/testsuite/gdb.fortran/vla-value.exp -=================================================================== ---- gdb-8.0.orig/gdb/testsuite/gdb.fortran/vla-value.exp 2017-06-09 05:51:55.866383622 +0200 -+++ gdb-8.0/gdb/testsuite/gdb.fortran/vla-value.exp 2017-06-09 05:51:58.221401795 +0200 -@@ -14,6 +14,7 @@ - # along with this program. If not, see . - - standard_testfile "vla.f90" -+load_lib "fortran.exp" - - if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ - {debug f90 quiet}] } { -@@ -25,12 +26,15 @@ - return -1 - } - -+# Depending on the compiler being used, the type names can be printed differently. -+set real [fortran_real4] -+ - # Try to access values in non allocated VLA - gdb_breakpoint [gdb_get_line_number "vla1-init"] +diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp +index 60022c5f62..7f03b76cd1 100644 +--- a/gdb/testsuite/gdb.fortran/vla-value.exp ++++ b/gdb/testsuite/gdb.fortran/vla-value.exp +@@ -35,7 +35,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-init"] gdb_continue_to_breakpoint "vla1-init" gdb_test "print vla1" " = " "print non-allocated vla1" gdb_test "print &vla1" \ -- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(\\\)\\\)\\\) $hex" \ +- " = \\\(PTR TO -> \\\( $real \\\(\\\)\\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \ "print non-allocated &vla1" gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \ "print member in non-allocated vla1 (1)" -@@ -51,7 +55,7 @@ - "step over value assignment of vla1" - } - gdb_test "print &vla1" \ -- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \ -+ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \ - "print allocated &vla1" - gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)" - gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)" -@@ -71,7 +75,7 @@ +@@ -76,7 +76,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \ # Try to access values in undefined pointer to VLA (dangling) gdb_test "print pvla" " = " "print undefined pvla" gdb_test "print &pvla" \ -- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(\\\)\\\)\\\) $hex" \ +- " = \\\(PTR TO -> \\\( $real \\\(\\\)\\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \ "print non-associated &pvla" gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \ "print undefined pvla(1,3,8)" -@@ -80,7 +84,7 @@ - gdb_breakpoint [gdb_get_line_number "pvla-associated"] - gdb_continue_to_breakpoint "pvla-associated" - gdb_test "print &pvla" \ -- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \ -+ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \ - "print associated &pvla" - gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)" - gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)" -Index: gdb-8.0/gdb/testsuite/gdb.mi/mi-var-child-f.exp -=================================================================== ---- gdb-8.0.orig/gdb/testsuite/gdb.mi/mi-var-child-f.exp 2017-06-09 05:51:55.867383630 +0200 -+++ gdb-8.0/gdb/testsuite/gdb.mi/mi-var-child-f.exp 2017-06-09 05:51:58.222401803 +0200 -@@ -17,6 +17,7 @@ - - load_lib mi-support.exp - set MIFLAGS "-i=mi" -+load_lib "fortran.exp" - - if { [skip_fortran_tests] } { return -1 } - -@@ -40,10 +41,8 @@ - mi_create_varobj "array" "array" "create local variable array" - - --# Depending on the compiler version being used, the name of the 4-byte integer --# and real types can be printed differently. For instance, gfortran-4.1 uses --# "int4" whereas gfortran-4.3 uses "integer(kind=4)". --set int4 "(int4|integer\\(kind=4\\))" -+# Depending on the compiler being used, the type names can be printed differently. -+set int4 [fortran_int4] - - set children [list [list "array.-1" "-1" 2 "$int4 \\(2\\)"] \ - [list "array.0" "0" 2 "$int4 \\(2\\)"] \ -Index: gdb-8.0/gdb/testsuite/gdb.mi/mi-vla-fortran.exp -=================================================================== ---- gdb-8.0.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2017-06-09 05:51:55.867383630 +0200 -+++ gdb-8.0/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2017-06-09 05:51:58.222401803 +0200 -@@ -17,7 +17,9 @@ - # Array (VLA). - - load_lib mi-support.exp -+load_lib fortran.exp - set MIFLAGS "-i=mi" -+load_lib "fortran.exp" - - gdb_exit - if [mi_gdb_start] { -@@ -32,6 +34,9 @@ - return -1 - } - -+# Depending on the compiler being used, the type names can be printed differently. -+set real [fortran_real4] -+ - mi_delete_breakpoints - mi_gdb_reinitialize_dir $srcdir/$subdir - mi_gdb_load ${binfile} -@@ -46,10 +51,10 @@ +diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp +index bee6ebe156..f6eb0469a9 100644 +--- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp ++++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp +@@ -51,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ mi_gdb_test "500-data-evaluate-expression vla1" \ - "500\\^done,value=\"\"" "evaluate not allocated vla" + "500\\^done,value=\"\"" "evaluate not allocated vla, before allocation" -mi_create_varobj_checked vla1_not_allocated vla1 "" \ +mi_create_varobj_checked vla1_not_allocated vla1 "$real \\(:\\)" \ @@ -1347,38 +1301,7 @@ Index: gdb-8.0/gdb/testsuite/gdb.mi/mi-vla-fortran.exp "info type variable vla1_not_allocated" mi_gdb_test "502-var-show-format vla1_not_allocated" \ "502\\^done,format=\"natural\"" \ -@@ -58,7 +63,7 @@ - "503\\^done,value=\"\\\[0\\\]\"" \ - "eval variable vla1_not_allocated" - mi_list_array_varobj_children_with_index "vla1_not_allocated" "0" "1" \ -- "real\\\(kind=4\\\)" "get children of vla1_not_allocated" -+ "$real" "get children of vla1_not_allocated" - - - -@@ -71,10 +76,10 @@ - mi_gdb_test "510-data-evaluate-expression vla1" \ - "510\\^done,value=\"\\(.*\\)\"" "evaluate allocated vla" - --mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \ -+mi_create_varobj_checked vla1_allocated vla1 "$real \\\(5\\\)" \ - "create local variable vla1_allocated" - mi_gdb_test "511-var-info-type vla1_allocated" \ -- "511\\^done,type=\"real\\\(kind=4\\\) \\\(5\\\)\"" \ -+ "511\\^done,type=\"$real \\\(5\\\)\"" \ - "info type variable vla1_allocated" - mi_gdb_test "512-var-show-format vla1_allocated" \ - "512\\^done,format=\"natural\"" \ -@@ -83,7 +88,7 @@ - "513\\^done,value=\"\\\[5\\\]\"" \ - "eval variable vla1_allocated" - mi_list_array_varobj_children_with_index "vla1_allocated" "5" "1" \ -- "real\\\(kind=4\\\)" "get children of vla1_allocated" -+ "$real" "get children of vla1_allocated" - - - set bp_lineno [gdb_get_line_number "vla1-filled"] -@@ -136,10 +141,10 @@ +@@ -146,10 +146,10 @@ gdb_expect { -re "580\\^done,value=\"\".*${mi_gdb_prompt}$" { pass $test @@ -1391,32 +1314,11 @@ Index: gdb-8.0/gdb/testsuite/gdb.mi/mi-vla-fortran.exp "info type variable pvla2_not_associated" mi_gdb_test "582-var-show-format pvla2_not_associated" \ "582\\^done,format=\"natural\"" \ -@@ -148,7 +153,7 @@ - "583\\^done,value=\"\\\[0\\\]\"" \ - "eval variable pvla2_not_associated" - mi_list_array_varobj_children_with_index "pvla2_not_associated" "0" "1" \ -- "real\\\(kind=4\\\)" "get children of pvla2_not_associated" -+ "$real" "get children of pvla2_not_associated" - } - -re "580\\^error,msg=\"value contents too large \\(\[0-9\]+ bytes\\).*${mi_gdb_prompt}$" { - # Undefined behaviour in gfortran. -@@ -173,9 +178,9 @@ - "evaluate associated vla" - - mi_create_varobj_checked pvla2_associated pvla2 \ -- "real\\\(kind=4\\\) \\\(5,2\\\)" "create local variable pvla2_associated" -+ "$real \\\(5,2\\\)" "create local variable pvla2_associated" - mi_gdb_test "591-var-info-type pvla2_associated" \ -- "591\\^done,type=\"real\\\(kind=4\\\) \\\(5,2\\\)\"" \ -+ "591\\^done,type=\"$real \\\(5,2\\\)\"" \ - "info type variable pvla2_associated" - mi_gdb_test "592-var-show-format pvla2_associated" \ - "592\\^done,format=\"natural\"" \ -Index: gdb-8.0/gdb/typeprint.c -=================================================================== ---- gdb-8.0.orig/gdb/typeprint.c 2017-06-09 05:51:55.867383630 +0200 -+++ gdb-8.0/gdb/typeprint.c 2017-06-09 05:51:58.222401803 +0200 -@@ -474,6 +474,25 @@ +diff --git a/gdb/typeprint.c b/gdb/typeprint.c +index 427af17ad7..ad150cbfd1 100644 +--- a/gdb/typeprint.c ++++ b/gdb/typeprint.c +@@ -511,6 +511,25 @@ whatis_exp (const char *exp, int show) printf_filtered (" */\n"); } @@ -1442,11 +1344,11 @@ Index: gdb-8.0/gdb/typeprint.c LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags); printf_filtered ("\n"); -Index: gdb-8.0/gdb/valops.c -=================================================================== ---- gdb-8.0.orig/gdb/valops.c 2017-06-09 05:51:55.869383646 +0200 -+++ gdb-8.0/gdb/valops.c 2017-06-09 05:51:58.223401811 +0200 -@@ -1574,6 +1574,19 @@ +diff --git a/gdb/valops.c b/gdb/valops.c +index 4715912b94..4ecfa9fd96 100644 +--- a/gdb/valops.c ++++ b/gdb/valops.c +@@ -1564,6 +1564,19 @@ value_ind (struct value *arg1) if (TYPE_CODE (base_type) == TYPE_CODE_PTR) { struct type *enc_type; @@ -1466,7 +1368,7 @@ Index: gdb-8.0/gdb/valops.c /* We may be pointing to something embedded in a larger object. Get the real type of the enclosing object. */ -@@ -1589,8 +1602,7 @@ +@@ -1579,8 +1592,7 @@ value_ind (struct value *arg1) else /* Retrieve the enclosing object pointed to. */ arg2 = value_at_lazy (enc_type, @@ -1476,11 +1378,11 @@ Index: gdb-8.0/gdb/valops.c enc_type = value_type (arg2); return readjust_indirect_value_type (arg2, enc_type, base_type, arg1); -Index: gdb-8.0/gdb/valprint.c -=================================================================== ---- gdb-8.0.orig/gdb/valprint.c 2017-06-04 17:51:27.000000000 +0200 -+++ gdb-8.0/gdb/valprint.c 2017-06-09 05:51:58.224401818 +0200 -@@ -1166,12 +1166,6 @@ +diff --git a/gdb/valprint.c b/gdb/valprint.c +index 9b07221f1f..20e3a4178b 100644 +--- a/gdb/valprint.c ++++ b/gdb/valprint.c +@@ -1111,12 +1111,6 @@ value_check_printable (struct value *val, struct ui_file *stream, return 0; } @@ -1493,3 +1395,6 @@ Index: gdb-8.0/gdb/valprint.c if (type_not_allocated (value_type (val))) { val_print_not_allocated (stream); +-- +2.14.3 + diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch index a295dc2..47534a6 100644 --- a/gdb-vla-intel-stringbt-fix.patch +++ b/gdb-vla-intel-stringbt-fix.patch @@ -1,9 +1,13 @@ +From 53927eb2d3e8b8217b4b355b723f5231a09497fa Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 1 Aug 2014 23:02:17 +0200 -Subject: [patch 1/2] Re: Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23] Fortran dynamic array support] +Subject: Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23] + Fortran dynamic array support] FileName: gdb-vla-intel-stringbt-fix.patch +;;=push+jan + http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote: @@ -23,23 +27,31 @@ so that there is no longer needed the patch: The fix below has no regressions for me. Unfortunately I do not see why you cannot reproduce it. - Thanks, Jan +--- + gdb/dwarf2loc.c | 15 +++++++++ + .../gdb.fortran/dynamic-other-frame-stub.f90 | 24 +++++++++++++ + gdb/testsuite/gdb.fortran/dynamic-other-frame.exp | 39 ++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 | 36 ++++++++++++++++++++ + 4 files changed, 114 insertions(+) + create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 + create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.exp + create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 -Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c -=================================================================== ---- gdb-7.99.90.20170420.orig/gdb/dwarf2loc.c 2017-04-20 22:28:59.686490666 +0200 -+++ gdb-7.99.90.20170420/gdb/dwarf2loc.c 2017-04-20 22:29:13.104575404 +0200 +diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c +index 54592f0bfc..d2742bbd91 100644 +--- a/gdb/dwarf2loc.c ++++ b/gdb/dwarf2loc.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "common/underlying.h" + #include "common/byte-vector.h" - extern int dwarf_always_disassemble; -@@ -2366,6 +2367,20 @@ +@@ -2350,6 +2351,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, ctx.per_cu = per_cu; ctx.obj_address = 0; @@ -60,10 +72,11 @@ Index: gdb-7.99.90.20170420/gdb/dwarf2loc.c scoped_value_mark free_values; ctx.gdbarch = get_objfile_arch (objfile); -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2017-04-20 22:29:00.673496899 +0200 +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 +new file mode 100644 +index 0000000000..261ce17ae5 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 @@ -0,0 +1,24 @@ +! Copyright 2010 Free Software Foundation, Inc. +! @@ -89,10 +102,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f + real :: dummy + dummy = 1 +end subroutine bar -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2017-04-20 22:29:00.673496899 +0200 +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp +new file mode 100644 +index 0000000000..570a28ca65 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp @@ -0,0 +1,39 @@ +# Copyright 2010 Free Software Foundation, Inc. + @@ -133,10 +147,11 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp +} + +gdb_test "bt" {foo \(string='hello'.*} -Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2017-04-20 22:29:00.673496899 +0200 +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 +new file mode 100644 +index 0000000000..2bc637db49 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 @@ -0,0 +1,36 @@ +! Copyright 2010 Free Software Foundation, Inc. +! @@ -174,3 +189,6 @@ Index: gdb-7.99.90.20170420/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 + end interface + call foo ('hello') +end +-- +2.14.3 + diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch index 67f1605..a9edf93 100644 --- a/gdb-vla-intel-tests.patch +++ b/gdb-vla-intel-tests.patch @@ -1,13 +1,27 @@ +From 1671bb454ed0bab96f316986f396ee67d84ab7cc Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-vla-intel-tests.patch FileName: gdb-vla-intel-tests.patch -Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp 2016-01-08 19:15:44.983637680 +0100 +;;=fedoratest +--- + gdb/testsuite/gdb.fortran/vla-func.exp | 61 ++++++++++++++++ + gdb/testsuite/gdb.fortran/vla-func.f90 | 71 +++++++++++++++++++ + gdb/testsuite/gdb.fortran/vla-stringsold.exp | 101 +++++++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/vla-stringsold.f90 | 40 +++++++++++ + 4 files changed, 273 insertions(+) + create mode 100644 gdb/testsuite/gdb.fortran/vla-func.exp + create mode 100644 gdb/testsuite/gdb.fortran/vla-func.f90 + create mode 100644 gdb/testsuite/gdb.fortran/vla-stringsold.exp + create mode 100644 gdb/testsuite/gdb.fortran/vla-stringsold.f90 + +diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp +new file mode 100644 +index 0000000000..f0f236bef0 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-func.exp @@ -0,0 +1,61 @@ +# Copyright 2014 Free Software Foundation, Inc. + @@ -70,10 +84,11 @@ Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp + "print vla3 (after func2)" +gdb_test "ptype vla3" "type = integer\\\(kind=4\\\) \\\(10\\\)" \ + "ptype vla3 (after func2)" -Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 2016-01-08 19:15:44.983637680 +0100 +diff --git a/gdb/testsuite/gdb.fortran/vla-func.f90 b/gdb/testsuite/gdb.fortran/vla-func.f90 +new file mode 100644 +index 0000000000..7540f54dbb +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-func.f90 @@ -0,0 +1,71 @@ +! Copyright 2014 Free Software Foundation, Inc. +! @@ -146,10 +161,11 @@ Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 + + ret = .TRUE. ! func2-returned +end program vla_func -Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp 2016-01-08 19:15:44.984637686 +0100 +diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp +new file mode 100644 +index 0000000000..c1bf7ef763 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-stringsold.exp @@ -0,0 +1,101 @@ +# Copyright 2014 Free Software Foundation, Inc. + @@ -252,10 +268,11 @@ Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp + "whatis var_char_p after associated" +gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \ + "ptype var_char_p after associated" -Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90 2016-01-08 19:15:44.984637686 +0100 +diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.f90 b/gdb/testsuite/gdb.fortran/vla-stringsold.f90 +new file mode 100644 +index 0000000000..0a1d5221d0 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-stringsold.f90 @@ -0,0 +1,40 @@ +! Copyright 2014 Free Software Foundation, Inc. +! @@ -297,3 +314,6 @@ Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90 + var_char_p => null() + l = associated(var_char_p) ! var_char_p-not-associated +end program vla_strings +-- +2.14.3 + diff --git a/gdb-x86_64-i386-syscall-restart.patch b/gdb-x86_64-i386-syscall-restart.patch index 2ca004f..edee4f4 100644 --- a/gdb-x86_64-i386-syscall-restart.patch +++ b/gdb-x86_64-i386-syscall-restart.patch @@ -1,9 +1,12 @@ +From 418b024eea6cea42e787ff056697f81fa0b55e0b Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-x86_64-i386-syscall-restart.patch FileName: gdb-x86_64-i386-syscall-restart.patch +;; Fix syscall restarts for amd64->i386 biarch. +;;=push+jan http://sourceware.org/ml/gdb-patches/2009-11/msg00592.html Subject: [patch] Fix syscall restarts for amd64->i386 biarch @@ -22,7 +25,6 @@ x86_64 i386 i386 PASS on recent kernels (PASS: kernel-2.6.32-0.55.rc8.git1.fc13.x86_64) i386 i386 i386 PASS - Currently gdb.base/interrupt.exp fails on amd64 host running under --target_board unix/-m32 with: continue @@ -36,7 +38,6 @@ Currently gdb.base/interrupt.exp fails on amd64 host running under * at syscall exit tracing, but they will never be left for the debugged user * process to see. */ -#define ERESTARTSYS 512 "Unknown error 512" printed above is printed by the inferior itself, not by GDB. @@ -46,7 +47,6 @@ It is because GDB reads it as 0xfffffffffffffe00 but writes it back as + for -ERESTART* values -512 being above 0xfffffffffffffe00; tested by + interrupt.exp. */ - Quote of Roland McGrath from IRC: roland: in the user_regset model, there are 64-bit user_regset flavors and @@ -69,7 +69,6 @@ roland: so a 64-bit debugger should see and be able to fiddle the full registers. it can even change cs via ptrace to force the inferior into running 32 or 64 bit code. - Saving whole 64bits for i386 targets on x86_64 hosts does not much match the GDB architecture as `struct type' for these registers still should be 32bit etc. Therefore provided just this exception. @@ -79,20 +78,23 @@ interruption to do full inferior save/restore from GDB regcache. Regression tested on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu. - Thanks, Jan - gdb/ 2009-11-29 Jan Kratochvil * amd64-nat.c (amd64_collect_native_gregset): Do not pre-clear %eax. Sign extend it afterwards. +--- + gdb/amd64-nat.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) +diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c +index b046052954..e0b0762c7c 100644 --- a/gdb/amd64-nat.c +++ b/gdb/amd64-nat.c -@@ -131,9 +131,9 @@ amd64_collect_native_gregset (const struct regcache *regcache, +@@ -135,9 +135,9 @@ amd64_collect_native_gregset (const struct regcache *regcache, { num_regs = amd64_native_gregset32_num_regs; @@ -104,7 +106,7 @@ gdb/ { if (regnum == -1 || regnum == i) memset (regs + amd64_native_gregset_reg_offset (gdbarch, i), 0, 8); -@@ -159,4 +159,20 @@ amd64_collect_native_gregset (const struct regcache *regcache, +@@ -163,4 +163,20 @@ amd64_collect_native_gregset (const struct regcache *regcache, regcache_raw_collect (regcache, i, regs + offset); } } @@ -125,4 +127,6 @@ gdb/ + } + } } +-- +2.14.3 diff --git a/gdb.spec b/gdb.spec index 2d76e8f..0ec4414 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,21 +18,21 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20170420 +%global snapsrc 20171204 # See timestamp of source gnulib installed into gdb/gnulib/ . -%global snapgnulib 20150822 +%global snapgnulib 20161115 %global tarname gdb-%{version} -Version: 8.0.1 +Version: 8.0.50.%{snapsrc} # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 32%{?dist} +Release: 33%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL Group: Development/Debuggers # Do not provide URL for snapshots as the file lasts there only for 2 days. # ftp://sourceware.org/pub/gdb/releases/FIXME{tarname}.tar.xz -Source: ftp://sourceware.org/pub/gdb/releases/%{tarname}.tar.xz +Source: #ftp://sourceware.org/pub/gdb/releases/%{tarname}.tar.xz Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) URL: http://gnu.org/software/gdb/ @@ -174,568 +174,22 @@ Source6: gdbtui Source7: v%{libipt_version}.tar.gz #=fedora Patch1142: v1.5-libipt-static.patch - -# Work around out-of-date dejagnu that does not have KFAIL -#=push: That dejagnu is too old to be supported. -Patch1: gdb-6.3-rh-dummykfail-20041202.patch - -# Match the Fedora's version info. -#=fedora -Patch2: gdb-6.3-rh-testversion-20041202.patch - -# Better parse 64-bit PPC system call prologues. -#=push: Write new testcase. -Patch105: gdb-6.3-ppc64syscall-20040622.patch - -# Include the pc's section when doing a symbol lookup so that the -# correct symbol is found. -#=push: Write new testcase. -Patch111: gdb-6.3-ppc64displaysymbol-20041124.patch - -# Make upstream `set scheduler-locking step' as default. -#=push+jan: How much is scheduler-locking relevant after non-stop? -Patch260: gdb-6.6-scheduler_locking-step-is-default.patch - -# Add a wrapper script to GDB that implements pstack using the -# --readnever option. -#=push -Patch118: gdb-6.3-gstack-20050411.patch - -# VSYSCALL and PIE -#=fedoratest -Patch122: gdb-6.3-test-pie-20050107.patch -#=push+jan: May get obsoleted by Tom's unrelocated objfiles patch. -Patch389: gdb-archer-pie-addons.patch -#=push+jan: Breakpoints disabling matching should not be based on address. -Patch394: gdb-archer-pie-addons-keep-disabled.patch - -# Get selftest working with sep-debug-info -#=fedoratest -Patch125: gdb-6.3-test-self-20050110.patch - -# Test support of multiple destructors just like multiple constructors -#=fedoratest -Patch133: gdb-6.3-test-dtorfix-20050121.patch - -# Fix to support executable moving -#=fedoratest -Patch136: gdb-6.3-test-movedir-20050125.patch - -# Test sibling threads to set threaded watchpoints for x86 and x86-64 -#=fedoratest -Patch145: gdb-6.3-threaded-watchpoints2-20050225.patch - -# Notify observers that the inferior has been created -#=fedoratest -Patch161: gdb-6.3-inferior-notification-20050721.patch - -# Verify printing of inherited members test -#=fedoratest -Patch163: gdb-6.3-inheritancetest-20050726.patch - -# Add readnever option -#=push -Patch164: gdb-6.3-readnever-20050907.patch - -# Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661). -#=push+jan: There was some mail thread about it, this patch may be a hack. -Patch188: gdb-6.5-bz203661-emit-relocs.patch - -# Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). -#=push+jan: It should be replaced by Infinity project. -Patch194: 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. -Patch196: gdb-6.5-sharedlibrary-path.patch - -# Testcase for deadlocking on last address space byte; for corrupted backtraces. -#=fedoratest -Patch211: gdb-6.5-last-address-space-byte-test.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. -Patch208: gdb-6.5-BEA-testsuite.patch - -# Fix readline segfault on excessively long hand-typed lines. -#=fedoratest -Patch213: gdb-6.5-readline-long-line-crash-test.patch - -# Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). -#=fedora -Patch214: gdb-6.5-bz216711-clone-is-outermost.patch - -# Test sideeffects of skipping ppc .so libs trampolines (BZ 218379). -#=fedoratest -Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch - -# Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). -#=fedora -Patch217: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch - -# Find symbols properly at their original (included) file (BZ 109921). -#=fedoratest -Patch225: gdb-6.5-bz109921-DW_AT_decl_file-test.patch - -# Update PPC unwinding patches to their upstream variants (BZ 140532). -#=fedoratest -Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch - -# Testcase for exec() from threaded program (BZ 202689). -#=fedoratest -Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch - -# Backported fixups post the source tarball. -#Xdrop: Just backports. -Patch232: gdb-upstream.patch - -# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). -#=fedoratest -Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch - -# Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). -#=fedoratest -Patch245: gdb-6.6-bz229517-gcore-without-terminal.patch - -# Notify user of a child forked process being detached (BZ 235197). -#=push+jan: This is more about discussion if/what should be printed. -Patch247: gdb-6.6-bz235197-fork-detach-info.patch - -# Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". -#=fedoratest -Patch254: gdb-6.6-testsuite-timeouts.patch - -# Support for stepping over PPC atomic instruction sequences (BZ 237572). -#=fedoratest -Patch258: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch - -# Test kernel VDSO decoding while attaching to an i386 process. -#=fedoratest -Patch263: gdb-6.3-attach-see-vdso-test.patch - -# Test leftover zombie process (BZ 243845). -#=fedoratest -Patch271: gdb-6.5-bz243845-stale-testing-zombie-test.patch - -# New locating of the matching binaries from the pure core file (build-id). -#=push+jan -Patch274: 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 -Patch659: gdb-6.6-buildid-locate-solib-missing-ids.patch -#=push+jan -Patch353: gdb-6.6-buildid-locate-rpm.patch -#=push+jan -Patch415: gdb-6.6-buildid-locate-core-as-arg.patch -# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). -#=push+jan -Patch519: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -# [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). -#=push+jan -Patch833: gdb-6.6-buildid-locate-rpm-scl.patch -# Fix 'gdb gives highly misleading error when debuginfo pkg is present, -# but not corresponding binary pkg' (RH BZ 981154). -#=push+jan -Patch863: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch - -# Fix displaying of numeric char arrays as strings (BZ 224128). -#=fedoratest: But it is failing anyway, one should check the behavior more. -Patch282: gdb-6.7-charsign-test.patch - -# Test PPC hiding of call-volatile parameter register. -#=fedoratest -Patch284: gdb-6.7-ppc-clobbered-registers-O2-test.patch - -# Testsuite fixes for more stable/comparable results. -#=fedoratest -Patch287: gdb-6.7-testsuite-stable-results.patch - -# Test ia64 memory leaks of the code using libunwind. -#=fedoratest -Patch289: gdb-6.5-ia64-libunwind-leak-test.patch - -# Test hiding unexpected breakpoints on intentional step commands. -#=fedoratest -Patch290: gdb-6.5-missed-trap-on-step-test.patch - -# Test gcore memory and time requirements for large inferiors. -#=fedoratest -Patch296: gdb-6.5-gcore-buffer-limit-test.patch - -# Test debugging statically linked threaded inferiors (BZ 239652). -# - It requires recent glibc to work in this case properly. -#=fedoratest -Patch298: gdb-6.6-threads-static-test.patch - -# Test GCORE for shmid 0 shared memory mappings. -#=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible. -Patch309: gdb-6.3-mapping-zero-inode-test.patch - -# Test a crash on `focus cmd', `focus prev' commands. -#=fedoratest -Patch311: gdb-6.3-focus-cmd-prev-test.patch - -# Test various forms of threads tracking across exec() (BZ 442765). -#=fedoratest -Patch315: gdb-6.8-bz442765-threaded-exec-test.patch - -# Silence memcpy check which returns false positive (sparc64) -#=push: But it is just a GCC workaround, look up the existing GCC PR for it. -Patch317: gdb-6.8-sparc64-silence-memcpy-check.patch - -# Test a crash on libraries missing the .text section. -#=fedoratest -Patch320: gdb-6.5-section-num-fixup-test.patch - -# Fix register assignments with no GDB stack frames (BZ 436037). -#=push+jan: This fix is incorrect. -Patch330: gdb-6.8-bz436037-reg-no-longer-active.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 . -Patch331: gdb-6.8-quit-never-aborts.patch - -# [RHEL5,RHEL6] Fix attaching to stopped processes. -# [RHEL5] Workaround kernel for detaching SIGSTOPped processes (BZ 809382). -#=fedora -Patch337: gdb-6.8-attach-signalled-detach-stopped.patch - -# Test the watchpoints conditionals works. -#=fedoratest -Patch343: gdb-6.8-watchpoint-conditionals-test.patch - -# Fix resolving of variables at locations lists in prelinked libs (BZ 466901). -#=fedoratest -Patch348: gdb-6.8-bz466901-backtrace-full-prelinked.patch - -# Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher -#=push -Patch349: gdb-archer.patch - -# New test for step-resume breakpoint placed in multiple threads at once. -#=fedoratest -Patch381: 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@.*> -Patch382: gdb-core-open-vdso-warning.patch - -# Fix syscall restarts for amd64->i386 biarch. -#=push+jan -Patch391: gdb-x86_64-i386-syscall-restart.patch - -# Fix stepping with OMP parallel Fortran sections (BZ 533176). -#=push+jan: It requires some better DWARF annotations. -Patch392: gdb-bz533176-fortran-omp-step.patch - -# Fix regression by python on ia64 due to stale current frame. -#=push+jan -Patch397: gdb-follow-child-stale-parent.patch - -# Workaround ccache making lineno non-zero for command-line definitions. -#=fedoratest: ccache is rarely used and it is even fixed now. -Patch403: gdb-ccache-workaround.patch - -# Testcase for "Do not make up line information" fix by Daniel Jacobowitz. -#=fedoratest -Patch407: gdb-lineno-makeup-test.patch - -# Test power7 ppc disassembly. -#=fedoratest -Patch408: gdb-ppc-power7-test.patch - -# Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). -# Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). -#=push+jan: It should be fixed properly instead. -Patch417: gdb-bz541866-rwatch-before-run.patch - -# Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). -#=push+jan: Currently it is still not fully safe. -Patch459: gdb-moribund-utrace-workaround.patch - -# Fix follow-exec for C++ programs (bugreported by Martin Stransky). -#=fedoratest -Patch470: gdb-archer-next-over-throw-cxx-exec.patch - -# Backport DWARF-4 support (BZ 601887, Tom Tromey). -#=fedoratest -Patch475: gdb-bz601887-dwarf4-rh-test.patch - -# [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). -#=fedoratest -Patch490: gdb-test-bt-cfi-without-die.patch - -# Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey). -#=push: Re-check against the upstream version. -Patch491: gdb-gdb-add-index-script.patch - -# Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). -#=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted. -Patch496: gdb-bz568248-oom-is-error.patch - -# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). -#=fedoratest -Patch526: gdb-bz634108-solib_address.patch - -# New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). -#=fedoratest -Patch542: gdb-test-pid0-core.patch - -# [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. -#=fedoratest -Patch547: gdb-test-dw2-aranges.patch - -# [archer-keiths-expr-cumulative+upstream] Import C++ testcases. -#=fedoratest -Patch548: gdb-test-expr-cumulative-archer.patch - -# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). -#=fedoratest -Patch565: gdb-physname-pr11734-test.patch -#=fedoratest -Patch567: gdb-physname-pr12273-test.patch - -# Toolchain on sparc is slightly broken and debuginfo files are generated -# with non 64bit aligned tables/offsets. -# See for example readelf -S ../Xvnc.debug. -# -# As a consenquence calculation of sectp->filepos as used in -# dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer -# that cannot be used directly as done with MMAP. -# Usage will result in a BusError. -# -# While we figure out what's wrong in the toolchain and do a full archive -# rebuild to fix it, we need to be able to use gdb :) -#=push -Patch579: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch - -# Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). -#=fedoratest -Patch616: gdb-test-ivy-bridge.patch - -# Work around PR libc/13097 "linux-vdso.so.1" warning message. -#=push+jan -Patch627: gdb-glibc-vdso-workaround.patch - -# Hack for proper PIE run of the testsuite. -#=fedoratest -Patch634: gdb-runtest-pie-override.patch - -# Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). -#=fedora -Patch642: gdb-readline62-ask-more-rh.patch - -# Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). -#=push+jan -Patch653: gdb-attach-fail-reasons-5of5.patch - -# Workaround crashes from stale frame_info pointer (BZ 804256). -#=push+jan -Patch661: gdb-stale-frame_info.patch - -# Workaround PR libc/14166 for inferior calls of strstr. -#=fedora: Compatibility with RHELs (unchecked which ones). -Patch690: gdb-glibc-strstr-workaround.patch - -# Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). -#=fedoratest -Patch698: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch - -# Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). -#=fedoratest -Patch703: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch - -# Fix `GDB cannot access struct member whose offset is larger than 256MB' -# (RH BZ 795424). -#=push -Patch811: gdb-rhbz795424-bitpos-20of25.patch -Patch812: gdb-rhbz795424-bitpos-21of25.patch -Patch813: gdb-rhbz795424-bitpos-22of25.patch -Patch814: gdb-rhbz795424-bitpos-23of25.patch -Patch816: gdb-rhbz795424-bitpos-25of25.patch -Patch817: gdb-rhbz795424-bitpos-25of25-test.patch -Patch818: gdb-rhbz795424-bitpos-lazyvalue.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 -Patch832: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch - -# [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon). -#=fedora -Patch848: gdb-dts-rhel6-python-compat.patch - -# Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). -#=push+jan -Patch852: gdb-gnat-dwarf-crash-3of3.patch - -# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) -#=fedoratest -Patch861: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch - -# VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests. -#=push -Patch1058: gdb-vla-intel-fortran-strides.patch -#=push -Patch1132: gdb-vla-intel-fortran-vla-strings.patch -#=push+jan -Patch889: gdb-vla-intel-stringbt-fix.patch -#=fedoratest -Patch887: gdb-archer-vla-tests.patch -Patch888: gdb-vla-intel-tests.patch - -# Continue backtrace even if a frame filter throws an exception (Phil Muldoon). -#=push -Patch918: gdb-btrobust.patch - -# Display Fortran strings in backtraces. -#=fedoratest -Patch925: gdb-fortran-frame-string.patch - -# Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957). -#=push -Patch927: gdb-python-gil.patch - -# Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to -# crash.' (RH BZ 1156192). -#=fedoratest -Patch977: gdb-rhbz1156192-recursive-dlopen-test.patch - -# Fix jit-reader.h for multi-lib. -#=push+jan -Patch978: gdb-jit-reader-multilib.patch - -# Fix '`catch syscall' doesn't work for parent after `fork' is called' -# (Philippe Waroquiers, RH BZ 1149205). -#=fedoratest -Patch984: 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 -Patch991: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch - -# Test 'info type-printers' Python error (RH BZ 1350436). -#=fedoratest -Patch992: gdb-rhbz1350436-type-printers-error.patch - -# Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan -# Kratochvil, RH BZ 1084404). -#=fedoratest -Patch1026: 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 -Patch1053: gdb-bz1219747-attach-kills.patch - -# Fix the pahole command breakage due to its Python3 port (RH BZ 1264532). -#=fedora -Patch1044: gdb-pahole-python2.patch - -# Force libncursesw over libncurses to match the includes (RH BZ 1270534). -#=push+jan -Patch1056: gdb-fedora-libncursesw.patch - -# Test clflushopt instruction decode (for RH BZ 1262471). -#=fedoratest -Patch1073: gdb-opcodes-clflushopt-test.patch - -# [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). -#=fedoratest -Patch1075: gdb-testsuite-readline63-sigint.patch -#=fedoratest -Patch1119: gdb-testsuite-readline63-sigint-revert.patch - -# [aarch64] Fix hardware watchpoints (RH BZ 1261564). -#=fedoratest -Patch1113: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch - -# Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). -#=fedora -Patch1118: gdb-container-rh-pkg.patch - -# New test for Python "Cannot locate object file for block" (for RH BZ 1325795). -#=fedoratest -Patch1123: gdb-rhbz1325795-framefilters-test.patch - -# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). -#=fedora -Patch1143: gdb-linux_perf-bundle.patch - -# Fix TLS (such as 'errno') regression. -#=push+jan -Patch1149: gdb-tls-1of2.patch -#=push+jan -Patch1150: gdb-tls-2of2.patch - -# Fix gdb-headless /usr/bin/ executables (BZ 1390251). -#=fedora -Patch1152: gdb-libexec-add-index.patch - -# Fix gdb-add-index for 444 *.debug files. -#=push+jan -Patch1153: gdb-add-index-chmod.patch - -# New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). -#=fedoratest -Patch1155: gdb-rhbz1398387-tab-crash-test.patch - # [rhel dts libipt] Fix [-Werror=implicit-fallthrough=] with gcc-7.1.1. #=push+jan Patch1171: v1.6.1-implicit-fallthrough.patch -# [s390x] Backport arch12 support and other s390x fixes (RH BZ 1420304). -Patch1210: gdb-rhbz1420304-s390x-01of35.patch -Patch1211: gdb-rhbz1420304-s390x-02of35.patch -Patch1212: gdb-rhbz1420304-s390x-03of35.patch -Patch1213: gdb-rhbz1420304-s390x-04of35.patch -Patch1214: gdb-rhbz1420304-s390x-05of35.patch -Patch1215: gdb-rhbz1420304-s390x-06of35.patch -Patch1216: gdb-rhbz1420304-s390x-07of35.patch -Patch1217: gdb-rhbz1420304-s390x-08of35.patch -Patch1218: gdb-rhbz1420304-s390x-09of35.patch -Patch1219: gdb-rhbz1420304-s390x-10of35.patch -Patch1220: gdb-rhbz1420304-s390x-11of35.patch -Patch1221: gdb-rhbz1420304-s390x-12of35.patch -Patch1222: gdb-rhbz1420304-s390x-13of35.patch -Patch1223: gdb-rhbz1420304-s390x-14of35.patch -Patch1224: gdb-rhbz1420304-s390x-15of35.patch -Patch1225: gdb-rhbz1420304-s390x-16of35.patch -Patch1226: gdb-rhbz1420304-s390x-17of35.patch -Patch1227: gdb-rhbz1420304-s390x-18of35.patch -Patch1228: gdb-rhbz1420304-s390x-19of35.patch -Patch1229: gdb-rhbz1420304-s390x-20of35.patch -Patch1230: gdb-rhbz1420304-s390x-21of35.patch -Patch1231: gdb-rhbz1420304-s390x-22of35.patch -Patch1232: gdb-rhbz1420304-s390x-23of35.patch -Patch1233: gdb-rhbz1420304-s390x-24of35.patch -Patch1234: gdb-rhbz1420304-s390x-25of35.patch -Patch1235: gdb-rhbz1420304-s390x-26of35.patch -Patch1236: gdb-rhbz1420304-s390x-27of35.patch -Patch1237: gdb-rhbz1420304-s390x-28of35.patch -Patch1238: gdb-rhbz1420304-s390x-29of35.patch -Patch1239: gdb-rhbz1420304-s390x-30of35.patch -Patch1240: gdb-rhbz1420304-s390x-31of35.patch -Patch1241: gdb-rhbz1420304-s390x-32of35.patch -Patch1242: gdb-rhbz1420304-s390x-33of35.patch -Patch1243: gdb-rhbz1420304-s390x-34of35.patch -Patch1244: gdb-rhbz1420304-s390x-35of35.patch +## Fix the pahole command breakage due to its Python3 port (RH BZ 1264532). +##=fedora +Patch1044: gdb-pahole-python2.patch +## [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). +##=fedoratest +#Patch1075: gdb-testsuite-readline63-sigint.patch +##=fedoratest +Patch1119: gdb-testsuite-readline63-sigint-revert.patch -# [s390x] Backport arch14 guarded-storage register support (RH BZ 1498758). -Patch1255: gdb-rhbz1498758-1of5.patch -Patch1256: gdb-rhbz1498758-2of5.patch -Patch1257: gdb-rhbz1498758-3of5.patch -Patch1258: gdb-rhbz1498758-4of5.patch -Patch1259: gdb-rhbz1498758-5of5.patch - -# Use inlined func name for printing breakpoints (RH BZ 1228556, Keith Seitz). -Patch1261: gdb-rhbz1228556-bpt-inlined-func-name-1of2.patch -Patch1262: gdb-rhbz1228556-bpt-inlined-func-name-2of2.patch +# Include the auto-generated file containing the "Patch:" directives. +# See README.local-patches for more details. +%include _gdb.spec.Patch.include %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: @@ -963,162 +417,12 @@ tar xzf %{SOURCE7} # we build in %{gdb_build}, just to be sure. find -name "*.info*"|xargs rm -f -# Apply patches defined above. +# Apply patches defined on _gdb.spec.Patch.include -# Match the Fedora's version info. -%patch2 -p1 +# Include the auto-generated "%patch" directives. +# See README.local-patches for more details. +%include _gdb.spec.patch.include -%patch232 -p1 -%patch349 -p1 -%patch1058 -p1 -%patch1132 -p1 -%patch889 -p1 -%patch1 -p1 - -%patch105 -p1 -%patch111 -p1 -%patch118 -p1 -%patch122 -p1 -%patch125 -p1 -%patch133 -p1 -%patch136 -p1 -%patch145 -p1 -%patch161 -p1 -%patch163 -p1 -%patch164 -p1 -%patch188 -p1 -%patch194 -p1 -%patch196 -p1 -%patch208 -p1 -%patch211 -p1 -%patch213 -p1 -%patch214 -p1 -%patch216 -p1 -%patch217 -p1 -%patch225 -p1 -%patch229 -p1 -%patch231 -p1 -%patch234 -p1 -%patch245 -p1 -%patch247 -p1 -%patch254 -p1 -%patch258 -p1 -%patch260 -p1 -%patch263 -p1 -%patch271 -p1 -%patch274 -p1 -%patch659 -p1 -%patch353 -p1 -%patch282 -p1 -%patch284 -p1 -%patch287 -p1 -%patch289 -p1 -%patch290 -p1 -%patch296 -p1 -%patch298 -p1 -%patch309 -p1 -%patch311 -p1 -%patch315 -p1 -%patch317 -p1 -%patch320 -p1 -%patch330 -p1 -%patch343 -p1 -%patch348 -p1 -%patch381 -p1 -%patch382 -p1 -%patch391 -p1 -%patch392 -p1 -%patch397 -p1 -%patch403 -p1 -%patch389 -p1 -%patch394 -p1 -%patch407 -p1 -%patch408 -p1 -%patch417 -p1 -%patch459 -p1 -%patch470 -p1 -%patch475 -p1 -%patch415 -p1 -%patch519 -p1 -%patch490 -p1 -%patch491 -p1 -%patch496 -p1 -%patch526 -p1 -%patch542 -p1 -%patch547 -p1 -%patch548 -p1 -%patch565 -p1 -%patch567 -p1 -%patch579 -p1 -%patch616 -p1 -%patch627 -p1 -%patch634 -p1 -%patch653 -p1 -%patch661 -p1 -%patch690 -p1 -%patch698 -p1 -%patch703 -p1 -%patch1210 -p1 -%patch1211 -p1 -%patch1212 -p1 -%patch1213 -p1 -%patch1214 -p1 -%patch1215 -p1 -%patch1216 -p1 -%patch1217 -p1 -%patch1218 -p1 -%patch1219 -p1 -%patch1220 -p1 -%patch1221 -p1 -%patch1222 -p1 -%patch1223 -p1 -%patch1224 -p1 -%patch1225 -p1 -%patch1226 -p1 -%patch1227 -p1 -%patch1228 -p1 -%patch1229 -p1 -%patch1230 -p1 -%patch1231 -p1 -%patch1232 -p1 -%patch1233 -p1 -%patch1234 -p1 -%patch1235 -p1 -%patch1236 -p1 -%patch1237 -p1 -%patch1238 -p1 -%patch1239 -p1 -%patch1240 -p1 -%patch1241 -p1 -%patch1242 -p1 -%patch1243 -p1 -%patch1244 -p1 -%patch811 -p1 -%patch812 -p1 -%patch813 -p1 -%patch814 -p1 -%patch816 -p1 -%patch817 -p1 -%patch818 -p1 -%patch832 -p1 -%patch852 -p1 -%patch861 -p1 -%patch863 -p1 -%patch887 -p1 -%patch888 -p1 -%patch918 -p1 -%patch925 -p1 -%patch927 -p1 -%patch977 -p1 -%patch978 -p1 -%patch984 -p1 -%patch991 -p1 -%patch992 -p1 -%patch1026 -p1 -%patch1053 -p1 -%patch1056 -p1 -%patch1073 -p1 -%patch848 -p1 %if 0%{!?el6:1} for i in \ gdb/python/lib/gdb/FrameWrapper.py \ @@ -1129,28 +433,7 @@ for i in \ : >$i done %endif -%patch833 -p1 -%patch642 -p1 -%patch337 -p1 -%patch331 -p1 -%patch1113 -p1 -%patch1118 -p1 -%patch1123 -p1 -%patch1143 -p1 -%patch1149 -p1 -%patch1150 -p1 -%patch1152 -p1 -%patch1153 -p1 -%patch1155 -p1 -%patch1255 -p1 -%patch1256 -p1 -%patch1257 -p1 -%patch1258 -p1 -%patch1259 -p1 -%patch1261 -p1 -%patch1262 -p1 -%patch1075 -p1 %if 0%{?rhel:1} && 0%{?rhel} <= 7 %patch1119 -p1 %patch1044 -p1 @@ -1731,6 +1014,10 @@ then fi %changelog +* Thu Dec 7 2017 Sergio Durigan Junior - 8.0.50.20171204-33.fc26 +- Rebase to FSF GDB 8.0.50.20171204 (8.1pre). +- Implemented new method for dealing with local patches. + * Mon Dec 4 2017 Sergio Durigan Junior - 8.0.1-32.fc26 - Convert all the patches to 'git-am' format. diff --git a/generate-git-repo-from-patches.sh b/generate-git-repo-from-patches.sh new file mode 100644 index 0000000..8f68477 --- /dev/null +++ b/generate-git-repo-from-patches.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# Generic function to print an error message and bail out. +die () +{ + echo $1 > /dev/stderr + exit 1 +} + +# Print usage +usage () +{ + cat < + + is the directory where the rebase was performed. You +need to clone the repository first. + +Options are: + + -h: Print this message +EOF + exit 0 +} + +test -f gdb.spec || die "This script needs to run from the same directory as gdb.spec." + +test -z $1 && die "You need to specify the repository." +test "$1" = "-h" && usage + +test -f _git_upstream_commit || die "Cannot find _git_upstream_commit file." +test -f _patch_order || die "Cannot find _patch_order file." + +last_ancestor_commit=`cat _git_upstream_commit` +cd $1 +git checkout $last_ancestor_commit +for p in `cat ../_patch_order` ; do + git am ../$p +done diff --git a/generate-patches-from-git-repo.sh b/generate-patches-from-git-repo.sh new file mode 100644 index 0000000..928f69b --- /dev/null +++ b/generate-patches-from-git-repo.sh @@ -0,0 +1,81 @@ +#!/bin/sh + +# Generic function to print an error message and bail out. +die () +{ + echo $1 > /dev/stderr + exit 1 +} + +# Print usage +usage () +{ + cat < [] + + is the directory where the rebase was performed. + + is the commit or tag against which the rebase was +performed. It is optional, and if not provided "origin/master" will +be used. This script will then use 'git merge-base' to find the most +recent common ancestor between HEAD and COMMIT_OR_TAG. + +Options are: + + -h: Print this message +EOF + exit 0 +} + +test -f gdb.spec || die "This script needs to run from the same directory as gdb.spec." + +test -z $1 && die "You need to specify the repository." +test "$1" = "-h" && usage + +commit_or_tag="origin/master" +if test ! -z "$2" ; then + commit_or_tag="$2" +fi + +test -d $1 || die "$1 is not a directory." + +# Remove all the current patches +for f in `cat _patch_order` ; do + git rm -f $f +done + +cd $1 +idx=1 +common_ancestor=`git merge-base HEAD $commit_or_tag` + +test -z "$common_ancestor" && die "Could not find common ancestor between HEAD and $commit_or_tag." + +temp_PATCH_file=/tmp/_gdb.spec.Patch.include +temp_patch_file=/tmp/_gdb.spec.patch.include +temp_patch_order_file=/tmp/_patch_order + +rm -f $temp_PATCH_file $temp_patch_file $temp_patch_order_file + +for c in `git rev-list --reverse ${common_ancestor}..HEAD` ; do + fname=`git log -1 --pretty='format:%b' $c | sed -n 's/^FileName: \(.*\)$/\1/p'` + test -z $fname && die "Could not determine FileName of commit $c." + git format-patch --keep -1 --stdout $c > ../$fname + (cd .. && git add $fname) + + cat >> $temp_PATCH_file <> $temp_PATCH_file + printf "%%patch%03d -p1\n" $idx >> $temp_patch_file + echo $fname >> $temp_patch_order_file + idx=`expr $idx + 1` +done + +cd .. +mv $temp_PATCH_file _gdb.spec.Patch.include +mv $temp_patch_file _gdb.spec.patch.include +mv $temp_patch_order_file _patch_order +echo "$common_ancestor" > _git_upstream_commit diff --git a/sources b/sources index 61f00b2..39572cb 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ SHA512 (gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz) = 3d540b99581ffa4cf2810bec979c9a01a1f8ce782b7c8efb46b40dd2421d60cdb0e52b53c5477c3e86a57957a2a14489f5c29dc53868738a1ef79e79cf76d0a1 SHA512 (v1.6.1.tar.gz) = c7c9c8ba78021fff3fde12a216f5729c6031114e5a727f49b7ff1a31c53b5ddba24d1b3aee252d8278ecd1fafe78a44ed059c12b9eb29eca33093e0720673468 SHA512 (gdb-8.0.1.tar.xz) = 5eb328910033f0918058be2f92caebf1e8dfc6caa3c730d99d621627e53de3c1b43761c2f683d53555893253c2f06768cbf56cdea051a3d291ffb6cfae87b5e1 +SHA512 (gdb-8.0.50.20171204.tar.xz) = 42d109eb711a0e076a083c4e18ade6946fcac2192096d72dfd10eb4b4fbc72f94a06d5e9b0b715d2d03ac33775325feedea0388ad31ca94285a61f440259d76d