From e0c5ec26e5286aa9bcc7c24677619cc9232f0854 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Tue, 16 Mar 2021 15:24:22 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/gdb.git#37f07ef81844ffce99bad7676b21c3c534df688a --- .gitignore | 2 +- _gdb.spec.Patch.include | 205 ++-- _gdb.spec.patch.include | 1 + _patch_order | 3 +- gdb-6.6-buildid-locate-rpm-scl.patch | 4 +- gdb-6.6-buildid-locate.patch | 6 +- gdb-archer-vla-tests.patch | 14 +- gdb-gnat-dwarf-crash-3of3.patch | 2 +- gdb-rhbz1909902-frame_id_p-assert-1.patch | 593 +++++++++++ gdb-rhbz1909902-frame_id_p-assert-2.patch | 169 ++++ gdb-vla-intel-fortran-vla-strings.patch | 1086 --------------------- gdb-vla-intel-tests.patch | 201 ---- gdb.spec | 26 +- sources | 2 +- 14 files changed, 914 insertions(+), 1400 deletions(-) create mode 100644 gdb-rhbz1909902-frame_id_p-assert-1.patch create mode 100644 gdb-rhbz1909902-frame_id_p-assert-2.patch delete mode 100644 gdb-vla-intel-fortran-vla-strings.patch diff --git a/.gitignore b/.gitignore index bf9d24a..3a21a9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /binutils-gdb /gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz -/v2.0.2.tar.gz /gdb-10.1.tar.xz +/v2.0.4.tar.gz diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index a9fb5aa..ce58612 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -6,369 +6,366 @@ Patch001: gdb-6.3-rh-testversion-20041202.patch #=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 +Patch003: gdb-vla-intel-stringbt-fix.patch # Add a wrapper script to GDB that implements pstack using the # --readnever option. #=push -Patch005: gdb-6.3-gstack-20050411.patch +Patch004: gdb-6.3-gstack-20050411.patch # VSYSCALL and PIE #=fedoratest -Patch006: gdb-6.3-test-pie-20050107.patch +Patch005: gdb-6.3-test-pie-20050107.patch # Get selftest working with sep-debug-info #=fedoratest -Patch007: gdb-6.3-test-self-20050110.patch +Patch006: gdb-6.3-test-self-20050110.patch # Test support of multiple destructors just like multiple constructors #=fedoratest -Patch008: gdb-6.3-test-dtorfix-20050121.patch +Patch007: gdb-6.3-test-dtorfix-20050121.patch # Fix to support executable moving #=fedoratest -Patch009: gdb-6.3-test-movedir-20050125.patch +Patch008: gdb-6.3-test-movedir-20050125.patch # Test sibling threads to set threaded watchpoints for x86 and x86-64 #=fedoratest -Patch010: gdb-6.3-threaded-watchpoints2-20050225.patch +Patch009: gdb-6.3-threaded-watchpoints2-20050225.patch # Notify observers that the inferior has been created #=fedoratest -Patch011: gdb-6.3-inferior-notification-20050721.patch +Patch010: gdb-6.3-inferior-notification-20050721.patch # Verify printing of inherited members test #=fedoratest -Patch012: gdb-6.3-inheritancetest-20050726.patch +Patch011: gdb-6.3-inheritancetest-20050726.patch # Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). #=push+jan: It should be replaced by Infinity project. -Patch013: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +Patch012: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch # Fix TLS symbols resolving for shared libraries with a relative pathname. # The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. #=fedoratest: One should recheck if it is really fixed upstream. -Patch014: gdb-6.5-sharedlibrary-path.patch +Patch013: gdb-6.5-sharedlibrary-path.patch # Improved testsuite results by the testsuite provided by the courtesy of BEA. #=fedoratest: For upstream it should be rewritten as a dejagnu test, the test of no "??" was useful. -Patch015: gdb-6.5-BEA-testsuite.patch +Patch014: gdb-6.5-BEA-testsuite.patch # Testcase for deadlocking on last address space byte; for corrupted backtraces. #=fedoratest -Patch016: gdb-6.5-last-address-space-byte-test.patch +Patch015: gdb-6.5-last-address-space-byte-test.patch # Fix readline segfault on excessively long hand-typed lines. #=fedoratest -Patch017: gdb-6.5-readline-long-line-crash-test.patch +Patch016: gdb-6.5-readline-long-line-crash-test.patch # Test sideeffects of skipping ppc .so libs trampolines (BZ 218379). #=fedoratest -Patch018: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch017: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch # Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). #=fedora -Patch019: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +Patch018: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch # Find symbols properly at their original (included) file (BZ 109921). #=fedoratest -Patch020: gdb-6.5-bz109921-DW_AT_decl_file-test.patch +Patch019: gdb-6.5-bz109921-DW_AT_decl_file-test.patch # Update PPC unwinding patches to their upstream variants (BZ 140532). #=fedoratest -Patch021: gdb-6.3-bz140532-ppc-unwinding-test.patch +Patch020: gdb-6.3-bz140532-ppc-unwinding-test.patch # Testcase for exec() from threaded program (BZ 202689). #=fedoratest -Patch022: gdb-6.3-bz202689-exec-from-pthread-test.patch +Patch021: gdb-6.3-bz202689-exec-from-pthread-test.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). #=fedoratest -Patch023: gdb-6.6-bz230000-power6-disassembly-test.patch +Patch022: gdb-6.6-bz230000-power6-disassembly-test.patch # Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). #=fedoratest -Patch024: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch023: gdb-6.6-bz229517-gcore-without-terminal.patch # Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". #=fedoratest -Patch025: gdb-6.6-testsuite-timeouts.patch +Patch024: gdb-6.6-testsuite-timeouts.patch # Support for stepping over PPC atomic instruction sequences (BZ 237572). #=fedoratest -Patch026: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch025: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch # Test kernel VDSO decoding while attaching to an i386 process. #=fedoratest -Patch027: gdb-6.3-attach-see-vdso-test.patch +Patch026: gdb-6.3-attach-see-vdso-test.patch # Test leftover zombie process (BZ 243845). #=fedoratest -Patch028: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch027: gdb-6.5-bz243845-stale-testing-zombie-test.patch # New locating of the matching binaries from the pure core file (build-id). #=push+jan -Patch029: gdb-6.6-buildid-locate.patch +Patch028: gdb-6.6-buildid-locate.patch # Fix loading of core files without build-ids but with build-ids in executables. # Load strictly build-id-checked core files only if no executable is specified # (Jan Kratochvil, RH BZ 1339862). #=push+jan -Patch030: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch029: gdb-6.6-buildid-locate-solib-missing-ids.patch #=push+jan -Patch031: gdb-6.6-buildid-locate-rpm.patch +Patch030: gdb-6.6-buildid-locate-rpm.patch # Fix displaying of numeric char arrays as strings (BZ 224128). #=fedoratest: But it is failing anyway, one should check the behavior more. -Patch032: gdb-6.7-charsign-test.patch +Patch031: gdb-6.7-charsign-test.patch # Test PPC hiding of call-volatile parameter register. #=fedoratest -Patch033: gdb-6.7-ppc-clobbered-registers-O2-test.patch +Patch032: gdb-6.7-ppc-clobbered-registers-O2-test.patch # Testsuite fixes for more stable/comparable results. #=fedoratest -Patch034: gdb-6.7-testsuite-stable-results.patch +Patch033: gdb-6.7-testsuite-stable-results.patch # Test ia64 memory leaks of the code using libunwind. #=fedoratest -Patch035: gdb-6.5-ia64-libunwind-leak-test.patch +Patch034: gdb-6.5-ia64-libunwind-leak-test.patch # Test hiding unexpected breakpoints on intentional step commands. #=fedoratest -Patch036: gdb-6.5-missed-trap-on-step-test.patch +Patch035: gdb-6.5-missed-trap-on-step-test.patch # Test gcore memory and time requirements for large inferiors. #=fedoratest -Patch037: gdb-6.5-gcore-buffer-limit-test.patch +Patch036: gdb-6.5-gcore-buffer-limit-test.patch # Test GCORE for shmid 0 shared memory mappings. #=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible. -Patch038: gdb-6.3-mapping-zero-inode-test.patch +Patch037: gdb-6.3-mapping-zero-inode-test.patch # Test a crash on `focus cmd', `focus prev' commands. #=fedoratest -Patch039: gdb-6.3-focus-cmd-prev-test.patch +Patch038: gdb-6.3-focus-cmd-prev-test.patch # Test various forms of threads tracking across exec() (BZ 442765). #=fedoratest -Patch040: gdb-6.8-bz442765-threaded-exec-test.patch +Patch039: gdb-6.8-bz442765-threaded-exec-test.patch # Test a crash on libraries missing the .text section. #=fedoratest -Patch041: gdb-6.5-section-num-fixup-test.patch +Patch040: gdb-6.5-section-num-fixup-test.patch # Fix resolving of variables at locations lists in prelinked libs (BZ 466901). #=fedoratest -Patch042: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch041: gdb-6.8-bz466901-backtrace-full-prelinked.patch # New test for step-resume breakpoint placed in multiple threads at once. #=fedoratest -Patch043: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch042: gdb-simultaneous-step-resume-breakpoint-test.patch # Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. # Fix regression of undisplayed missing shared libraries caused by a fix for. #=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> -Patch044: gdb-core-open-vdso-warning.patch +Patch043: gdb-core-open-vdso-warning.patch # Fix stepping with OMP parallel Fortran sections (BZ 533176). #=push+jan: It requires some better DWARF annotations. -Patch045: gdb-bz533176-fortran-omp-step.patch +Patch044: gdb-bz533176-fortran-omp-step.patch # Workaround ccache making lineno non-zero for command-line definitions. #=fedoratest: ccache is rarely used and it is even fixed now. -Patch046: gdb-ccache-workaround.patch +Patch045: gdb-ccache-workaround.patch #=push+jan: May get obsoleted by Tom's unrelocated objfiles patch. -Patch047: gdb-archer-pie-addons.patch +Patch046: gdb-archer-pie-addons.patch #=push+jan: Breakpoints disabling matching should not be based on address. -Patch048: gdb-archer-pie-addons-keep-disabled.patch +Patch047: gdb-archer-pie-addons-keep-disabled.patch # Testcase for "Do not make up line information" fix by Daniel Jacobowitz. #=fedoratest -Patch049: gdb-lineno-makeup-test.patch +Patch048: gdb-lineno-makeup-test.patch # Test power7 ppc disassembly. #=fedoratest -Patch050: gdb-ppc-power7-test.patch +Patch049: gdb-ppc-power7-test.patch # Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). #=push+jan: Currently it is still not fully safe. -Patch051: gdb-moribund-utrace-workaround.patch +Patch050: gdb-moribund-utrace-workaround.patch # Fix follow-exec for C++ programs (bugreported by Martin Stransky). #=fedoratest -Patch052: gdb-archer-next-over-throw-cxx-exec.patch +Patch051: gdb-archer-next-over-throw-cxx-exec.patch # Backport DWARF-4 support (BZ 601887, Tom Tromey). #=fedoratest -Patch053: gdb-bz601887-dwarf4-rh-test.patch +Patch052: gdb-bz601887-dwarf4-rh-test.patch #=push+jan -Patch054: gdb-6.6-buildid-locate-core-as-arg.patch +Patch053: gdb-6.6-buildid-locate-core-as-arg.patch # Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). #=push+jan -Patch055: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch054: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch # [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). #=fedoratest -Patch056: gdb-test-bt-cfi-without-die.patch +Patch055: gdb-test-bt-cfi-without-die.patch # Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). #=fedoratest -Patch057: gdb-bz634108-solib_address.patch +Patch056: gdb-bz634108-solib_address.patch # New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). #=fedoratest -Patch058: gdb-test-pid0-core.patch +Patch057: gdb-test-pid0-core.patch # [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. #=fedoratest -Patch059: gdb-test-dw2-aranges.patch +Patch058: gdb-test-dw2-aranges.patch # [archer-keiths-expr-cumulative+upstream] Import C++ testcases. #=fedoratest -Patch060: gdb-test-expr-cumulative-archer.patch +Patch059: gdb-test-expr-cumulative-archer.patch # Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). #=fedoratest -Patch061: gdb-physname-pr11734-test.patch +Patch060: gdb-physname-pr11734-test.patch # Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). #=fedoratest -Patch062: gdb-physname-pr12273-test.patch +Patch061: gdb-physname-pr12273-test.patch # Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). #=fedoratest -Patch063: gdb-test-ivy-bridge.patch +Patch062: gdb-test-ivy-bridge.patch # Hack for proper PIE run of the testsuite. #=fedoratest -Patch064: gdb-runtest-pie-override.patch +Patch063: gdb-runtest-pie-override.patch # Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). #=push+jan -Patch065: gdb-attach-fail-reasons-5of5.patch +Patch064: gdb-attach-fail-reasons-5of5.patch # Workaround PR libc/14166 for inferior calls of strstr. #=fedoratest: Compatibility with RHELs (unchecked which ones). -Patch066: gdb-glibc-strstr-workaround.patch +Patch065: gdb-glibc-strstr-workaround.patch # Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). #=fedoratest -Patch067: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch066: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch # Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). #=fedoratest -Patch068: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch067: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch # Import regression test for `gdb/findvar.c:417: internal-error: # read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5. #=fedoratest -Patch069: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch068: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch # Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). #=push+jan -Patch070: gdb-gnat-dwarf-crash-3of3.patch +Patch069: gdb-gnat-dwarf-crash-3of3.patch # Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) #=fedoratest -Patch071: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch070: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch # Fix 'gdb gives highly misleading error when debuginfo pkg is present, # but not corresponding binary pkg' (RH BZ 981154). #=push+jan -Patch072: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Patch071: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch #=fedoratest -Patch073: gdb-archer-vla-tests.patch +Patch072: gdb-archer-vla-tests.patch #=fedoratest -Patch074: gdb-vla-intel-tests.patch +Patch073: gdb-vla-intel-tests.patch # Continue backtrace even if a frame filter throws an exception (Phil Muldoon). #=push -Patch075: gdb-btrobust.patch +Patch074: gdb-btrobust.patch # Display Fortran strings in backtraces. #=fedoratest -Patch076: gdb-fortran-frame-string.patch +Patch075: gdb-fortran-frame-string.patch # Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to # crash.' (RH BZ 1156192). #=fedoratest -Patch077: gdb-rhbz1156192-recursive-dlopen-test.patch +Patch076: gdb-rhbz1156192-recursive-dlopen-test.patch # Fix jit-reader.h for multi-lib. #=push+jan -Patch078: gdb-jit-reader-multilib.patch +Patch077: gdb-jit-reader-multilib.patch # Fix '`catch syscall' doesn't work for parent after `fork' is called' # (Philippe Waroquiers, RH BZ 1149205). #=fedoratest -Patch079: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch078: gdb-rhbz1149205-catch-syscall-after-fork-test.patch # Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug # description: 'C++ (and objc): Internal error on unqualified name # re-set', PR 11657] (RH BZ 1186476). #=fedoratest -Patch080: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +Patch079: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch # Test 'info type-printers' Python error (RH BZ 1350436). #=fedoratest -Patch081: gdb-rhbz1350436-type-printers-error.patch +Patch080: gdb-rhbz1350436-type-printers-error.patch # Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan # Kratochvil, RH BZ 1084404). #=fedoratest -Patch082: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch081: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch # Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747). #=push+jan -Patch083: gdb-bz1219747-attach-kills.patch +Patch082: gdb-bz1219747-attach-kills.patch # Force libncursesw over libncurses to match the includes (RH BZ 1270534). #=push+jan -Patch084: gdb-fedora-libncursesw.patch +Patch083: gdb-fedora-libncursesw.patch # Test clflushopt instruction decode (for RH BZ 1262471). #=fedoratest -Patch085: gdb-opcodes-clflushopt-test.patch +Patch084: gdb-opcodes-clflushopt-test.patch # [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon). #=fedora -Patch086: gdb-dts-rhel6-python-compat.patch +Patch085: gdb-dts-rhel6-python-compat.patch # [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). #=push+jan -Patch087: gdb-6.6-buildid-locate-rpm-scl.patch +Patch086: gdb-6.6-buildid-locate-rpm-scl.patch # Make the GDB quit processing non-abortable to cleanup everything properly. #=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch . -Patch088: gdb-6.8-quit-never-aborts.patch +Patch087: gdb-6.8-quit-never-aborts.patch # [aarch64] Fix hardware watchpoints (RH BZ 1261564). #=fedoratest -Patch089: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch088: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch # Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). #=fedora -Patch090: gdb-container-rh-pkg.patch +Patch089: gdb-container-rh-pkg.patch # New test for Python "Cannot locate object file for block" (for RH BZ 1325795). #=fedoratest -Patch091: gdb-rhbz1325795-framefilters-test.patch +Patch090: gdb-rhbz1325795-framefilters-test.patch # [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). #=fedora -Patch092: gdb-linux_perf-bundle.patch +Patch091: gdb-linux_perf-bundle.patch # Fix gdb-headless /usr/bin/ executables (BZ 1390251). # @@ -377,36 +374,42 @@ Patch092: gdb-linux_perf-bundle.patch # # https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot #=fedora -Patch093: gdb-libexec-add-index.patch +Patch092: gdb-libexec-add-index.patch # New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). #=fedoratest -Patch094: gdb-rhbz1398387-tab-crash-test.patch +Patch093: gdb-rhbz1398387-tab-crash-test.patch # Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher #=push -Patch095: gdb-archer.patch +Patch094: gdb-archer.patch # Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd -Patch096: gdb-vla-intel-fix-print-char-array.patch +Patch095: gdb-vla-intel-fix-print-char-array.patch # [s390x] Backport arch12 instructions decoding (RH BZ 1553104). # =fedoratest -Patch097: gdb-rhbz1553104-s390x-arch12-test.patch +Patch096: gdb-rhbz1553104-s390x-arch12-test.patch # Fix off-by-one error in ada_fold_name.patch (RH BZ 1905996) # Upstream patch proposal: https://sourceware.org/pipermail/gdb-patches/2020-December/173935.html # =fedoratest -Patch098: gdb-rhbz1905996-fix-off-by-one-error-in-ada_fold_name.patch +Patch097: gdb-rhbz1905996-fix-off-by-one-error-in-ada_fold_name.patch # Backport fix for libstdc++ assert when performing tab completion # (RH BZ 1912985). -Patch099: gdb-rhbz1912985-libstdc++-assert.patch +Patch098: gdb-rhbz1912985-libstdc++-assert.patch # Backport fix for rawhide build error (RH BZ 1930528). -Patch100: gdb-rhbz1930528-fix-gnulib-build-error.patch +Patch099: gdb-rhbz1930528-fix-gnulib-build-error.patch # [aarch64] Backport fix for aarch64-linux-hw-point.c build problem # (RH BZ 1932645). -Patch101: gdb-rhbz1932645-aarch64-ptrace-header-order.patch +Patch100: gdb-rhbz1932645-aarch64-ptrace-header-order.patch + +# Backport fix for frame_id_p assertion failure (RH BZ 1909902). +Patch101: gdb-rhbz1909902-frame_id_p-assert-1.patch + +# Backport patch #2 which fixes a frame_id_p assertion failure (RH BZ 1909902). +Patch102: gdb-rhbz1909902-frame_id_p-assert-2.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index 202a5cc..48f09cd 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -99,3 +99,4 @@ %patch099 -p1 %patch100 -p1 %patch101 -p1 +%patch102 -p1 diff --git a/_patch_order b/_patch_order index fa31778..9229088 100644 --- a/_patch_order +++ b/_patch_order @@ -1,6 +1,5 @@ gdb-6.3-rh-testversion-20041202.patch gdb-vla-intel-fortran-strides.patch -gdb-vla-intel-fortran-vla-strings.patch gdb-vla-intel-stringbt-fix.patch gdb-6.3-gstack-20050411.patch gdb-6.3-test-pie-20050107.patch @@ -99,3 +98,5 @@ gdb-rhbz1905996-fix-off-by-one-error-in-ada_fold_name.patch gdb-rhbz1912985-libstdc++-assert.patch gdb-rhbz1930528-fix-gnulib-build-error.patch gdb-rhbz1932645-aarch64-ptrace-header-order.patch +gdb-rhbz1909902-frame_id_p-assert-1.patch +gdb-rhbz1909902-frame_id_p-assert-2.patch diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch index 09f930f..947b855 100644 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -98,7 +98,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c -@@ -3025,6 +3025,16 @@ read_gdb_index_from_buffer (const char *filename, +@@ -3022,6 +3022,16 @@ read_gdb_index_from_buffer (const char *filename, "set use-deprecated-index-sections on". */ if (version < 6 && !deprecated_ok) { @@ -115,7 +115,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c static int warning_printed = 0; if (!warning_printed) { -@@ -3036,6 +3046,10 @@ to use the section anyway."), +@@ -3033,6 +3043,10 @@ to use the section anyway."), warning_printed = 1; } return 0; diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 6c9fb81..7bf6d11 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -1107,7 +1107,7 @@ diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c -@@ -2218,7 +2218,7 @@ dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd) +@@ -2215,7 +2215,7 @@ dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd) } if (dwz_bfd == NULL) @@ -1116,7 +1116,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c if (dwz_bfd == nullptr) { -@@ -5980,7 +5980,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) +@@ -5977,7 +5977,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) static gdb::array_view get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) { @@ -1125,7 +1125,7 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c if (build_id == nullptr) return {}; -@@ -5993,7 +5993,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) +@@ -5990,7 +5990,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) static gdb::array_view get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz) { diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch index 47c98d3..ef94df8 100644 --- a/gdb-archer-vla-tests.patch +++ b/gdb-archer-vla-tests.patch @@ -3010,7 +3010,7 @@ diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/st new file mode 100644 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/string.exp -@@ -0,0 +1,59 @@ +@@ -0,0 +1,71 @@ +# Copyright 2008 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -3055,13 +3055,23 @@ new file mode 100644 +gdb_continue_to_breakpoint "var-init" +gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)" +gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)" ++# Fortran: Support pointers to dynamic types. ++setup_kfail gdb/nnnnn "*-*-*" +gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)" ++# Fortran: Support pointers to dynamic types. ++setup_kfail gdb/nnnnn "*-*-*" +gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)" ++# Fortran: Support pointers to dynamic types. ++setup_kfail gdb/nnnnn "*-*-*" +gdb_test "ptype *e" "Attempt to take contents of a non-pointer value." ++# Fortran: Support pointers to dynamic types. ++setup_kfail gdb/nnnnn "*-*-*" +gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)" +gdb_test "p c" "\\$\[0-9\]* = 'c'" +gdb_test "p d" "\\$\[0-9\]* = 'd '" +gdb_test "p e" "\\$\[0-9\]* = 'g '" ++# Fortran: Support pointers to dynamic types. ++setup_kfail gdb/nnnnn "*-*-*" +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\)" +gdb_test "p *e" "Attempt to take contents of a non-pointer value." +gdb_test "p *f" "Attempt to take contents of a non-pointer value." @@ -3069,6 +3079,8 @@ new file mode 100644 +gdb_breakpoint [gdb_get_line_number "var-finish"] +gdb_continue_to_breakpoint "var-finish" +gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set" ++# Fortran: Support pointers to dynamic types. ++setup_kfail gdb/nnnnn "*-*-*" +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" diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90 new file mode 100644 diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index 4197661..5f00bff 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -42,7 +42,7 @@ gdb/ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c -@@ -10162,6 +10162,13 @@ class process_die_scope +@@ -10159,6 +10159,13 @@ class process_die_scope static void process_die (struct die_info *die, struct dwarf2_cu *cu) { diff --git a/gdb-rhbz1909902-frame_id_p-assert-1.patch b/gdb-rhbz1909902-frame_id_p-assert-1.patch new file mode 100644 index 0000000..7bced66 --- /dev/null +++ b/gdb-rhbz1909902-frame_id_p-assert-1.patch @@ -0,0 +1,593 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Pedro Alves +Date: Fri, 30 Oct 2020 18:26:15 +0100 +Subject: gdb-rhbz1909902-frame_id_p-assert-1.patch + +;; Backport fix for frame_id_p assertion failure (RH BZ 1909902). + +Make scoped_restore_current_thread's cdtors exception free (RFC) + +If the remote target closes while we're reading registers/memory for +restoring the selected frame in scoped_restore_current_thread's dtor, +the corresponding TARGET_CLOSE_ERROR error is swallowed by the +scoped_restore_current_thread's dtor, because letting exceptions +escape from a dtor is bad. It isn't great to lose that errors like +that, though. I've been thinking about how to avoid it, and I came up +with this patch. + +The idea here is to make scoped_restore_current_thread's dtor do as +little as possible, to avoid any work that might throw in the first +place. And to do that, instead of having the dtor call +restore_selected_frame, which re-finds the previously selected frame, +just record the frame_id/level of the desired selected frame, and have +get_selected_frame find the frame the next time it is called. In +effect, this implements most of Cagney's suggestion, here: + + /* On demand, create the selected frame and then return it. If the + selected frame can not be created, this function prints then throws + an error. When MESSAGE is non-NULL, use it for the error message, + otherwize use a generic error message. */ + /* FIXME: cagney/2002-11-28: At present, when there is no selected + frame, this function always returns the current (inner most) frame. + It should instead, when a thread has previously had its frame + selected (but not resumed) and the frame cache invalidated, find + and then return that thread's previously selected frame. */ + extern struct frame_info *get_selected_frame (const char *message); + +The only thing missing to fully implement that would be to make +reinit_frame_cache just clear selected_frame instead of calling +select_frame(NULL), and the call select_frame(NULL) explicitly in the +places where we really wanted reinit_frame_cache to go back to the +current frame too. That can done separately, though, I'm not +proposing to do that in this patch. + +Note that this patch renames restore_selected_frame to +lookup_selected_frame, and adds a new restore_selected_frame function +that doesn't throw, to be paired with the also-new save_selected_frame +function. + +There's a restore_selected_frame function in infrun.c that I think can +be replaced by the new one in frame.c. + +Also done in this patch is make the get_selected_frame's parameter be +optional, so that we don't have to pass down nullptr explicitly all +over the place. + +lookup_selected_frame should really move from thread.c to frame.c, but +I didn't do that here, just to avoid churn in the patch while it +collects comments. I did make it extern and declared it in frame.h +already, preparing for the move. I will do the move as a follow up +patch if people agree with this approach. + +Incidentally, this patch alone would fix the crashes fixed by the +previous patches in the series, because with this, +scoped_restore_current_thread's constructor doesn't throw either. + +gdb/ChangeLog: + + * blockframe.c (block_innermost_frame): Use get_selected_frame. + * frame.c + (scoped_restore_selected_frame::scoped_restore_selected_frame): + Use save_selected_frame. Save language as well. + (scoped_restore_selected_frame::~scoped_restore_selected_frame): + Use restore_selected_frame, and restore language as well. + (selected_frame_id, selected_frame_level): New. + (selected_frame): Update comments. + (save_selected_frame, restore_selected_frame): New. + (get_selected_frame): Use lookup_selected_frame. + (get_selected_frame_if_set): Delete. + (select_frame): Record selected_frame_level and selected_frame_id. + * frame.h (scoped_restore_selected_frame) : New + fields. + (get_selected_frame): Make 'message' parameter optional. + (get_selected_frame_if_set): Delete declaration. + (select_frame): Update comments. + (save_selected_frame, restore_selected_frame) + (lookup_selected_frame): Declare. + * gdbthread.h (scoped_restore_current_thread) : New field. + * infrun.c (struct infcall_control_state) : + New field. + (save_infcall_control_state): Use save_selected_frame. + (restore_selected_frame): Delete. + (restore_infcall_control_state): Use restore_selected_frame. + * stack.c (select_frame_command_core, frame_command_core): Use + get_selected_frame. + * thread.c (restore_selected_frame): Rename to ... + (lookup_selected_frame): ... this and make extern. Select the + current frame if the frame level is -1. + (scoped_restore_current_thread::restore): Also restore the + language. + (scoped_restore_current_thread::~scoped_restore_current_thread): + Don't try/catch. + (scoped_restore_current_thread::scoped_restore_current_thread): + Save the language as well. Use save_selected_frame. + +Change-Id: I73fd1cfc40d8513c28e5596383b7ecd8bcfe700f + +diff --git a/gdb/blockframe.c b/gdb/blockframe.c +--- a/gdb/blockframe.c ++++ b/gdb/blockframe.c +@@ -464,14 +464,10 @@ find_gnu_ifunc_target_type (CORE_ADDR resolver_funaddr) + struct frame_info * + block_innermost_frame (const struct block *block) + { +- struct frame_info *frame; +- + if (block == NULL) + return NULL; + +- frame = get_selected_frame_if_set (); +- if (frame == NULL) +- frame = get_current_frame (); ++ frame_info *frame = get_selected_frame (); + while (frame != NULL) + { + const struct block *frame_block = get_frame_block (frame, NULL); +diff --git a/gdb/frame.c b/gdb/frame.c +--- a/gdb/frame.c ++++ b/gdb/frame.c +@@ -317,17 +317,15 @@ frame_stash_invalidate (void) + /* See frame.h */ + scoped_restore_selected_frame::scoped_restore_selected_frame () + { +- m_fid = get_frame_id (get_selected_frame (NULL)); ++ m_lang = current_language->la_language; ++ save_selected_frame (&m_fid, &m_level); + } + + /* See frame.h */ + scoped_restore_selected_frame::~scoped_restore_selected_frame () + { +- frame_info *frame = frame_find_by_id (m_fid); +- if (frame == NULL) +- warning (_("Unable to restore previously selected frame.")); +- else +- select_frame (frame); ++ restore_selected_frame (m_fid, m_level); ++ set_language (m_lang); + } + + /* Flag to control debugging. */ +@@ -1685,10 +1683,63 @@ get_current_frame (void) + } + + /* The "selected" stack frame is used by default for local and arg +- access. May be zero, for no selected frame. */ +- ++ access. ++ ++ The "single source of truth" for the selected frame is the ++ SELECTED_FRAME_ID / SELECTED_FRAME_LEVEL pair. ++ ++ Frame IDs can be saved/restored across reinitializing the frame ++ cache, while frame_info pointers can't (frame_info objects are ++ invalidated). If we know the corresponding frame_info object, it ++ is cached in SELECTED_FRAME. ++ ++ If SELECTED_FRAME_ID / SELECTED_FRAME_LEVEL are null_frame_id / -1, ++ and the target has stack and is stopped, the selected frame is the ++ current (innermost) frame. This means that SELECTED_FRAME_LEVEL is ++ never 0 and SELECTED_FRAME_ID is never the ID of the innermost ++ frame. ++ ++ If SELECTED_FRAME_ID / SELECTED_FRAME_LEVEL are null_frame_id / -1, ++ and the target has no stack or is executing, then there's no ++ selected frame. */ ++static frame_id selected_frame_id = null_frame_id; ++static int selected_frame_level = -1; ++ ++/* The cached frame_info object pointing to the selected frame. ++ Looked up on demand by get_selected_frame. */ + static struct frame_info *selected_frame; + ++/* See frame.h. */ ++ ++void ++save_selected_frame (frame_id *frame_id, int *frame_level) ++ noexcept ++{ ++ *frame_id = selected_frame_id; ++ *frame_level = selected_frame_level; ++} ++ ++/* See frame.h. */ ++ ++void ++restore_selected_frame (frame_id frame_id, int frame_level) ++ noexcept ++{ ++ /* save_selected_frame never returns level == 0, so we shouldn't see ++ it here either. */ ++ gdb_assert (frame_level != 0); ++ ++ /* FRAME_ID can be null_frame_id only IFF frame_level is -1. */ ++ gdb_assert ((frame_level == -1 && !frame_id_p (frame_id)) ++ || (frame_level != -1 && frame_id_p (frame_id))); ++ ++ selected_frame_id = frame_id; ++ selected_frame_level = frame_level; ++ ++ /* Will be looked up later by get_selected_frame. */ ++ selected_frame = nullptr; ++} ++ + bool + has_stack_frames () + { +@@ -1715,9 +1766,7 @@ has_stack_frames () + return true; + } + +-/* Return the selected frame. Always non-NULL (unless there isn't an +- inferior sufficient for creating a frame) in which case an error is +- thrown. */ ++/* See frame.h. */ + + struct frame_info * + get_selected_frame (const char *message) +@@ -1726,24 +1775,14 @@ get_selected_frame (const char *message) + { + if (message != NULL && !has_stack_frames ()) + error (("%s"), message); +- /* Hey! Don't trust this. It should really be re-finding the +- last selected frame of the currently selected thread. This, +- though, is better than nothing. */ +- select_frame (get_current_frame ()); ++ ++ lookup_selected_frame (selected_frame_id, selected_frame_level); + } + /* There is always a frame. */ + gdb_assert (selected_frame != NULL); + return selected_frame; + } + +-/* If there is a selected frame, return it. Otherwise, return NULL. */ +- +-struct frame_info * +-get_selected_frame_if_set (void) +-{ +- return selected_frame; +-} +- + /* This is a variant of get_selected_frame() which can be called when + the inferior does not have a frame; in that case it will return + NULL instead of calling error(). */ +@@ -1756,12 +1795,42 @@ deprecated_safe_get_selected_frame (void) + return get_selected_frame (NULL); + } + +-/* Select frame FI (or NULL - to invalidate the current frame). */ ++/* Select frame FI (or NULL - to invalidate the selected frame). */ + + void + select_frame (struct frame_info *fi) + { + selected_frame = fi; ++ selected_frame_level = frame_relative_level (fi); ++ if (selected_frame_level == 0) ++ { ++ /* Treat the current frame especially -- we want to always ++ save/restore it without warning, even if the frame ID changes ++ (see lookup_selected_frame). E.g.: ++ ++ // The current frame is selected, the target had just stopped. ++ { ++ scoped_restore_selected_frame restore_frame; ++ some_operation_that_changes_the_stack (); ++ } ++ // scoped_restore_selected_frame's dtor runs, but the ++ // original frame_id can't be found. No matter whether it ++ // is found or not, we still end up with the now-current ++ // frame selected. Warning in lookup_selected_frame in this ++ // case seems pointless. ++ ++ Also get_frame_id may access the target's registers/memory, ++ and thus skipping get_frame_id optimizes the common case. ++ ++ Saving the selected frame this way makes get_selected_frame ++ and restore_current_frame return/re-select whatever frame is ++ the innermost (current) then. */ ++ selected_frame_level = -1; ++ selected_frame_id = null_frame_id; ++ } ++ else ++ selected_frame_id = get_frame_id (fi); ++ + /* NOTE: cagney/2002-05-04: FI can be NULL. This occurs when the + frame is being invalidated. */ + +diff --git a/gdb/frame.h b/gdb/frame.h +--- a/gdb/frame.h ++++ b/gdb/frame.h +@@ -186,8 +186,14 @@ class scoped_restore_selected_frame + + private: + +- /* The ID of the previously selected frame. */ ++ /* The ID and level of the previously selected frame. */ + struct frame_id m_fid; ++ int m_level; ++ ++ /* Save/restore the language as well, because selecting a frame ++ changes the current language to the frame's language if "set ++ language auto". */ ++ enum language m_lang; + }; + + /* Methods for constructing and comparing Frame IDs. */ +@@ -316,24 +322,49 @@ extern bool has_stack_frames (); + modifies the target invalidating the frame cache). */ + extern void reinit_frame_cache (void); + +-/* On demand, create the selected frame and then return it. If the +- selected frame can not be created, this function prints then throws +- an error. When MESSAGE is non-NULL, use it for the error message, ++/* Return the selected frame. Always returns non-NULL. If there ++ isn't an inferior sufficient for creating a frame, an error is ++ thrown. When MESSAGE is non-NULL, use it for the error message, + otherwise use a generic error message. */ + /* FIXME: cagney/2002-11-28: At present, when there is no selected + frame, this function always returns the current (inner most) frame. + It should instead, when a thread has previously had its frame + selected (but not resumed) and the frame cache invalidated, find + and then return that thread's previously selected frame. */ +-extern struct frame_info *get_selected_frame (const char *message); +- +-/* If there is a selected frame, return it. Otherwise, return NULL. */ +-extern struct frame_info *get_selected_frame_if_set (void); ++extern struct frame_info *get_selected_frame (const char *message = nullptr); + +-/* Select a specific frame. NULL, apparently implies re-select the +- inner most frame. */ ++/* Select a specific frame. NULL implies re-select the inner most ++ frame. */ + extern void select_frame (struct frame_info *); + ++/* Save the frame ID and frame level of the selected frame in FRAME_ID ++ and FRAME_LEVEL, to be restored later with restore_selected_frame. ++ ++ This is preferred over getting the same info out of ++ get_selected_frame directly because this function does not create ++ the selected-frame's frame_info object if it hasn't been created ++ yet, and thus is more efficient and doesn't throw. */ ++extern void save_selected_frame (frame_id *frame_id, int *frame_level) ++ noexcept; ++ ++/* Restore selected frame as saved with save_selected_frame. ++ ++ Does not try to find the corresponding frame_info object. Instead ++ the next call to get_selected_frame will look it up and cache the ++ result. ++ ++ This function does not throw. It is designed to be safe to called ++ from the destructors of RAII types. */ ++extern void restore_selected_frame (frame_id frame_id, int frame_level) ++ noexcept; ++ ++/* Lookup the frame_info object for the selected frame FRAME_ID / ++ FRAME_LEVEL and cache the result. ++ ++ If FRAME_LEVEL > 0 and the originally selected frame isn't found, ++ warn and select the innermost (current) frame. */ ++extern void lookup_selected_frame (frame_id frame_id, int frame_level); ++ + /* Given a FRAME, return the next (more inner, younger) or previous + (more outer, older) frame. */ + extern struct frame_info *get_prev_frame (struct frame_info *); +diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h +--- a/gdb/gdbthread.h ++++ b/gdb/gdbthread.h +@@ -673,6 +673,10 @@ class scoped_restore_current_thread + frame_id m_selected_frame_id; + int m_selected_frame_level; + bool m_was_stopped; ++ /* Save/restore the language as well, because selecting a frame ++ changes the current language to the frame's language if "set ++ language auto". */ ++ enum language m_lang; + }; + + /* Returns a pointer into the thread_info corresponding to +diff --git a/gdb/infrun.c b/gdb/infrun.c +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -9017,8 +9017,10 @@ struct infcall_control_state + enum stop_stack_kind stop_stack_dummy = STOP_NONE; + int stopped_by_random_signal = 0; + +- /* ID if the selected frame when the inferior function call was made. */ ++ /* ID and level of the selected frame when the inferior function ++ call was made. */ + struct frame_id selected_frame_id {}; ++ int selected_frame_level = -1; + }; + + /* Save all of the information associated with the inferior<==>gdb +@@ -9047,27 +9049,12 @@ save_infcall_control_state () + inf_status->stop_stack_dummy = stop_stack_dummy; + inf_status->stopped_by_random_signal = stopped_by_random_signal; + +- inf_status->selected_frame_id = get_frame_id (get_selected_frame (NULL)); ++ save_selected_frame (&inf_status->selected_frame_id, ++ &inf_status->selected_frame_level); + + return inf_status; + } + +-static void +-restore_selected_frame (const frame_id &fid) +-{ +- frame_info *frame = frame_find_by_id (fid); +- +- /* If inf_status->selected_frame_id is NULL, there was no previously +- selected frame. */ +- if (frame == NULL) +- { +- warning (_("Unable to restore previously selected frame.")); +- return; +- } +- +- select_frame (frame); +-} +- + /* Restore inferior session state to INF_STATUS. */ + + void +@@ -9095,21 +9082,8 @@ restore_infcall_control_state (struct infcall_control_state *inf_status) + + if (target_has_stack) + { +- /* The point of the try/catch is that if the stack is clobbered, +- walking the stack might encounter a garbage pointer and +- error() trying to dereference it. */ +- try +- { +- restore_selected_frame (inf_status->selected_frame_id); +- } +- catch (const gdb_exception_error &ex) +- { +- exception_fprintf (gdb_stderr, ex, +- "Unable to restore previously selected frame:\n"); +- /* Error in restoring the selected frame. Select the +- innermost frame. */ +- select_frame (get_current_frame ()); +- } ++ restore_selected_frame (inf_status->selected_frame_id, ++ inf_status->selected_frame_level); + } + + delete inf_status; +diff --git a/gdb/stack.c b/gdb/stack.c +--- a/gdb/stack.c ++++ b/gdb/stack.c +@@ -1842,9 +1842,9 @@ trailing_outermost_frame (int count) + static void + select_frame_command_core (struct frame_info *fi, bool ignored) + { +- struct frame_info *prev_frame = get_selected_frame_if_set (); ++ frame_info *prev_frame = get_selected_frame (); + select_frame (fi); +- if (get_selected_frame_if_set () != prev_frame) ++ if (get_selected_frame () != prev_frame) + gdb::observers::user_selected_context_changed.notify (USER_SELECTED_FRAME); + } + +@@ -1863,10 +1863,9 @@ select_frame_for_mi (struct frame_info *fi) + static void + frame_command_core (struct frame_info *fi, bool ignored) + { +- struct frame_info *prev_frame = get_selected_frame_if_set (); +- ++ frame_info *prev_frame = get_selected_frame (); + select_frame (fi); +- if (get_selected_frame_if_set () != prev_frame) ++ if (get_selected_frame () != prev_frame) + gdb::observers::user_selected_context_changed.notify (USER_SELECTED_FRAME); + else + print_selected_thread_frame (current_uiout, USER_SELECTED_FRAME); +diff --git a/gdb/thread.c b/gdb/thread.c +--- a/gdb/thread.c ++++ b/gdb/thread.c +@@ -1325,20 +1325,26 @@ switch_to_thread (process_stratum_target *proc_target, ptid_t ptid) + switch_to_thread (thr); + } + +-static void +-restore_selected_frame (struct frame_id a_frame_id, int frame_level) ++/* See frame.h. */ ++ ++void ++lookup_selected_frame (struct frame_id a_frame_id, int frame_level) + { + struct frame_info *frame = NULL; + int count; + +- /* This means there was no selected frame. */ ++ /* This either means there was no selected frame, or the selected ++ frame was the current frame. In either case, select the current ++ frame. */ + if (frame_level == -1) + { +- select_frame (NULL); ++ select_frame (get_current_frame ()); + return; + } + +- gdb_assert (frame_level >= 0); ++ /* select_frame never saves 0 in SELECTED_FRAME_LEVEL, so we ++ shouldn't see it here. */ ++ gdb_assert (frame_level > 0); + + /* Restore by level first, check if the frame id is the same as + expected. If that fails, try restoring by frame id. If that +@@ -1409,64 +1415,28 @@ scoped_restore_current_thread::restore () + && target_has_stack + && target_has_memory) + restore_selected_frame (m_selected_frame_id, m_selected_frame_level); ++ ++ set_language (m_lang); + } + + scoped_restore_current_thread::~scoped_restore_current_thread () + { + if (!m_dont_restore) +- { +- try +- { +- restore (); +- } +- catch (const gdb_exception &ex) +- { +- /* We're in a dtor, there's really nothing else we can do +- but swallow the exception. */ +- } +- } ++ restore (); + } + + scoped_restore_current_thread::scoped_restore_current_thread () + { + m_inf = inferior_ref::new_reference (current_inferior ()); + ++ m_lang = current_language->la_language; ++ + if (inferior_ptid != null_ptid) + { + m_thread = thread_info_ref::new_reference (inferior_thread ()); + +- struct frame_info *frame; +- + m_was_stopped = m_thread->state == THREAD_STOPPED; +- if (m_was_stopped +- && target_has_registers +- && target_has_stack +- && target_has_memory) +- { +- /* When processing internal events, there might not be a +- selected frame. If we naively call get_selected_frame +- here, then we can end up reading debuginfo for the +- current frame, but we don't generally need the debuginfo +- at this point. */ +- frame = get_selected_frame_if_set (); +- } +- else +- frame = NULL; +- +- try +- { +- m_selected_frame_id = get_frame_id (frame); +- m_selected_frame_level = frame_relative_level (frame); +- } +- catch (const gdb_exception_error &ex) +- { +- m_selected_frame_id = null_frame_id; +- m_selected_frame_level = -1; +- +- /* Better let this propagate. */ +- if (ex.error == TARGET_CLOSE_ERROR) +- throw; +- } ++ save_selected_frame (&m_selected_frame_id, &m_selected_frame_level); + } + } + diff --git a/gdb-rhbz1909902-frame_id_p-assert-2.patch b/gdb-rhbz1909902-frame_id_p-assert-2.patch new file mode 100644 index 0000000..d804bbe --- /dev/null +++ b/gdb-rhbz1909902-frame_id_p-assert-2.patch @@ -0,0 +1,169 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Pedro Alves +Date: Sat, 31 Oct 2020 00:27:18 +0000 +Subject: gdb-rhbz1909902-frame_id_p-assert-2.patch + +;; Backport patch #2 which fixes a frame_id_p assertion failure (RH BZ 1909902). + +Fix frame cycle detection + +The recent commit to make scoped_restore_current_thread's cdtors +exception free regressed gdb.base/eh_return.exp: + + Breakpoint 1, 0x00000000004012bb in eh2 (gdb/frame.c:641: internal-error: frame_id get_frame_id(frame_info*): Assertion `stashed' failed. + A problem internal to GDB has been detected, + further debugging may prove unreliable. + Quit this debugging session? (y or n) FAIL: gdb.base/eh_return.exp: hit breakpoint (GDB internal error) + +That testcase uses __builtin_eh_return and, before the regression, the +backtrace at eh2 looked like this: + + (gdb) bt + #0 0x00000000004006eb in eh2 (p=0x4006ec ) at src/gdb/testsuite/gdb.base/eh_return.c:54 + Backtrace stopped: previous frame identical to this frame (corrupt stack?) + +That "previous frame identical to this frame" is caught by the cycle +detection based on frame id. + +The assertion failing is this one: + + 638 /* Since this is the first frame in the chain, this should + 639 always succeed. */ + 640 bool stashed = frame_stash_add (fi); + 641 gdb_assert (stashed); + +originally added by + + commit f245535cf583ae4ca13b10d47b3c7d3334593ece + Author: Pedro Alves + AuthorDate: Mon Sep 5 18:41:38 2016 +0100 + + Fix PR19927: Avoid unwinder recursion if sniffer uses calls parse_and_eval + +The assertion is failing because frame #1's frame id was stashed +before the id of frame #0 is stashed. The frame id of frame #1 was +stashed here: + + (top-gdb) bt + #0 frame_stash_add (frame=0x1e24c90) at src/gdb/frame.c:276 + #1 0x0000000000669c1b in get_prev_frame_if_no_cycle (this_frame=0x19f8370) at src/gdb/frame.c:2120 + #2 0x000000000066a339 in get_prev_frame_always_1 (this_frame=0x19f8370) at src/gdb/frame.c:2303 + #3 0x000000000066a360 in get_prev_frame_always (this_frame=0x19f8370) at src/gdb/frame.c:2319 + #4 0x000000000066b56c in get_frame_unwind_stop_reason (frame=0x19f8370) at src/gdb/frame.c:3028 + #5 0x000000000059f929 in dwarf2_frame_cfa (this_frame=0x19f8370) at src/gdb/dwarf2/frame.c:1462 + #6 0x00000000005ce434 in dwarf_evaluate_loc_desc::get_frame_cfa (this=0x7fffffffc070) at src/gdb/dwarf2/loc.c:666 + #7 0x00000000005989a9 in dwarf_expr_context::execute_stack_op (this=0x7fffffffc070, op_ptr=0x1b2a053 "\364\003", op_end=0x1b2a053 "\364\003") at src/gdb/dwarf2/expr.c:1161 + #8 0x0000000000596af6 in dwarf_expr_context::eval (this=0x7fffffffc070, addr=0x1b2a052 "\234\364\003", len=1) at src/gdb/dwarf2/expr.c:303 + #9 0x0000000000597b4e in dwarf_expr_context::execute_stack_op (this=0x7fffffffc070, op_ptr=0x1b2a063 "", op_end=0x1b2a063 "") at src/gdb/dwarf2/expr.c:865 + #10 0x0000000000596af6 in dwarf_expr_context::eval (this=0x7fffffffc070, addr=0x1b2a061 "\221X", len=2) at src/gdb/dwarf2/expr.c:303 + #11 0x00000000005c8b5a in dwarf2_evaluate_loc_desc_full (type=0x1b564d0, frame=0x19f8370, data=0x1b2a061 "\221X", size=2, per_cu=0x1b28760, per_objfile=0x1a84930, subobj_type=0x1b564d0, subobj_byte_offset=0) at src/gdb/dwarf2/loc.c:2260 + #12 0x00000000005c9243 in dwarf2_evaluate_loc_desc (type=0x1b564d0, frame=0x19f8370, data=0x1b2a061 "\221X", size=2, per_cu=0x1b28760, per_objfile=0x1a84930) at src/gdb/dwarf2/loc.c:2444 + #13 0x00000000005cb769 in locexpr_read_variable (symbol=0x1b59840, frame=0x19f8370) at src/gdb/dwarf2/loc.c:3687 + #14 0x0000000000663137 in language_defn::read_var_value (this=0x122ea60 , var=0x1b59840, var_block=0x0, frame=0x19f8370) at src/gdb/findvar.c:618 + #15 0x0000000000663c3b in read_var_value (var=0x1b59840, var_block=0x0, frame=0x19f8370) at src/gdb/findvar.c:822 + #16 0x00000000008c7d9f in read_frame_arg (fp_opts=..., sym=0x1b59840, frame=0x19f8370, argp=0x7fffffffc470, entryargp=0x7fffffffc490) at src/gdb/stack.c:542 + #17 0x00000000008c89cd in print_frame_args (fp_opts=..., func=0x1b597c0, frame=0x19f8370, num=-1, stream=0x1aba860) at src/gdb/stack.c:890 + #18 0x00000000008c9bf8 in print_frame (fp_opts=..., frame=0x19f8370, print_level=0, print_what=SRC_AND_LOC, print_args=1, sal=...) at src/gdb/stack.c:1394 + #19 0x00000000008c92b9 in print_frame_info (fp_opts=..., frame=0x19f8370, print_level=0, print_what=SRC_AND_LOC, print_args=1, set_current_sal=1) at src/gdb/stack.c:1119 + #20 0x00000000008c75f0 in print_stack_frame (frame=0x19f8370, print_level=0, print_what=SRC_AND_LOC, set_current_sal=1) at src/gdb/stack.c:366 + #21 0x000000000070250b in print_stop_location (ws=0x7fffffffc9e0) at src/gdb/infrun.c:8110 + #22 0x0000000000702569 in print_stop_event (uiout=0x1a8b9e0, displays=true) at src/gdb/infrun.c:8126 + #23 0x000000000096d04b in tui_on_normal_stop (bs=0x1bcd1c0, print_frame=1) at src/gdb/tui/tui-interp.c:98 + ... + +Before the commit to make scoped_restore_current_thread's cdtors +exception free, scoped_restore_current_thread's dtor would call +get_frame_id on the selected frame, and we use +scoped_restore_current_thread pervasively. That had the side effect +of stashing the frame id of frame #0 before reaching the path shown in +the backtrace. I.e., the frame id of frame #0 happened to be stashed +before the frame id of frame #1. But that was by chance, not by +design. + +This commit: + + commit 256ae5dbc73d1348850f86ee77a0dc3b04bc7cc0 + Author: Kevin Buettner + AuthorDate: Mon Oct 31 12:47:42 2016 -0700 + + Stash frame id of current frame before stashing frame id for previous frame + +Fixed a similar problem, by making sure get_prev_frame computes the +frame id of the current frame before unwinding the previous frame, so +that the cycle detection works properly. That fix misses the scenario +we're now running against, because if you notice, the backtrace above +shows that frame #4 calls get_prev_frame_always, not get_prev_frame. +I.e., nothing is calling get_frame_id on the current frame. + +The fix here is to move Kevin's fix down from get_prev_frame to +get_prev_frame_always. Or actually, a bit further down to +get_prev_frame_always_1 -- note that inline_frame_this_id calls +get_prev_frame_always, so we need to be careful to avoid recursion in +that scenario. + +gdb/ChangeLog: + + * frame.c (get_prev_frame): Move get_frame_id call from here ... + (get_prev_frame_always_1): ... to here. + * inline-frame.c (inline_frame_this_id): Mention + get_prev_frame_always_1 in comment. + +Change-Id: Id960c98ab2d072c48a436c3eb160cc4b2a5cfd1d + +diff --git a/gdb/frame.c b/gdb/frame.c +--- a/gdb/frame.c ++++ b/gdb/frame.c +@@ -2133,6 +2133,23 @@ get_prev_frame_always_1 (struct frame_info *this_frame) + if (get_frame_type (this_frame) == INLINE_FRAME) + return get_prev_frame_if_no_cycle (this_frame); + ++ /* If this_frame is the current frame, then compute and stash its ++ frame id prior to fetching and computing the frame id of the ++ previous frame. Otherwise, the cycle detection code in ++ get_prev_frame_if_no_cycle() will not work correctly. When ++ get_frame_id() is called later on, an assertion error will be ++ triggered in the event of a cycle between the current frame and ++ its previous frame. ++ ++ Note we do this after the INLINE_FRAME check above. That is ++ because the inline frame's frame id computation needs to fetch ++ the frame id of its previous real stack frame. I.e., we need to ++ avoid recursion in that case. This is OK since we're sure the ++ inline frame won't create a cycle with the real stack frame. See ++ inline_frame_this_id. */ ++ if (this_frame->level == 0) ++ get_frame_id (this_frame); ++ + /* Check that this frame is unwindable. If it isn't, don't try to + unwind to the prev frame. */ + this_frame->stop_reason +@@ -2410,16 +2427,6 @@ get_prev_frame (struct frame_info *this_frame) + something should be calling get_selected_frame() or + get_current_frame(). */ + gdb_assert (this_frame != NULL); +- +- /* If this_frame is the current frame, then compute and stash +- its frame id prior to fetching and computing the frame id of the +- previous frame. Otherwise, the cycle detection code in +- get_prev_frame_if_no_cycle() will not work correctly. When +- get_frame_id() is called later on, an assertion error will +- be triggered in the event of a cycle between the current +- frame and its previous frame. */ +- if (this_frame->level == 0) +- get_frame_id (this_frame); + + frame_pc_p = get_frame_pc_if_available (this_frame, &frame_pc); + +diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c +--- a/gdb/inline-frame.c ++++ b/gdb/inline-frame.c +@@ -161,7 +161,8 @@ inline_frame_this_id (struct frame_info *this_frame, + real frame's this_id method. So we must call + get_prev_frame_always. Because we are inlined into some + function, there must be previous frames, so this is safe - as +- long as we're careful not to create any cycles. */ ++ long as we're careful not to create any cycles. See related ++ comments in get_prev_frame_always_1. */ + *this_id = get_frame_id (get_prev_frame_always (this_frame)); + + /* We need a valid frame ID, so we need to be based on a valid diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch deleted file mode 100644 index 1e48ee8..0000000 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ /dev/null @@ -1,1086 +0,0 @@ -From FEDORA_PATCHES 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 - -;;=push - -git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings -0ad7d8d1a3a36c6e04e3b6d37d8825f18d595723 - - gdb/NEWS | 2 + - gdb/c-valprint.c | 22 +++++ - gdb/dwarf2read.c | 158 +++++++++++++++++++++++++----- - 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 | 12 ++- - gdb/testsuite/gdb.mi/mi-var-child-f.exp | 7 +- - gdb/testsuite/gdb.mi/mi-vla-fortran.exp | 27 ++--- - gdb/typeprint.c | 19 ++++ - gdb/valops.c | 16 ++- - gdb/valprint.c | 6 -- - 20 files changed, 827 insertions(+), 110 deletions(-) - -diff --git a/gdb/NEWS b/gdb/NEWS ---- a/gdb/NEWS -+++ b/gdb/NEWS -@@ -985,6 +985,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* - - *** Changes in GDB 8.1 - -+* Fortran: Support pointers to dynamic types. -+ - * GDB now supports dynamically creating arbitrary register groups specified - in XML target descriptions. This allows for finer grain grouping of - registers on systems with a large amount of registers. -diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c ---- a/gdb/c-valprint.c -+++ b/gdb/c-valprint.c -@@ -572,6 +572,28 @@ c_value_print (struct value *val, struct ui_file *stream, - else - { - /* normal case */ -+ if (type->code () == TYPE_CODE_PTR -+ && 1 == is_dynamic_type (type)) -+ { -+ CORE_ADDR addr; -+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (type))) -+ addr = value_address (val); -+ else -+ addr = value_as_address (val); -+ -+ /* We resolve the target-type only when the -+ pointer is associated. */ -+ if ((addr != 0) -+ && (0 == type_not_associated (type))) -+ TYPE_TARGET_TYPE (type) = -+ resolve_dynamic_type (TYPE_TARGET_TYPE (type), -+ {}, addr); -+ } -+ else -+ { -+ /* Do nothing. References are already resolved from the beginning, -+ only pointers are resolved when we actual need the target. */ -+ } - fprintf_filtered (stream, "("); - type_print (value_type (val), "", stream, -1); - fprintf_filtered (stream, ") "); -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -1562,7 +1562,10 @@ static void read_signatured_type (signatured_type *sig_type, - - static int attr_to_dynamic_prop (const struct attribute *attr, - struct die_info *die, struct dwarf2_cu *cu, -- struct dynamic_prop *prop, struct type *type); -+ struct dynamic_prop *prop, -+ struct type *default_type, -+ const gdb_byte *additional_data, -+ int additional_data_size); - - /* memory allocation interface */ - -@@ -13631,7 +13634,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) - newobj->static_link - = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); - attr_to_dynamic_prop (attr, die, cu, newobj->static_link, -- cu->addr_type ()); -+ cu->addr_type (), NULL, 0); - } - - cu->list_in_scope = cu->get_builder ()->get_local_symbols (); -@@ -16073,7 +16076,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) - else - { - struct dynamic_prop prop; -- if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type ())) -+ if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type (), NULL, 0)) - type->add_dyn_prop (DYN_PROP_BYTE_SIZE, prop); - TYPE_LENGTH (type) = 0; - } -@@ -16764,7 +16767,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) - byte_stride_prop - = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); - stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop, -- prop_type); -+ prop_type, NULL, 0); - if (!stride_ok) - { - complaint (_("unable to read array DW_AT_byte_stride " -@@ -17522,7 +17525,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) - struct attribute *attr; - struct dynamic_prop prop; - bool length_is_constant = true; -- LONGEST length; -+ ULONGEST length = UINT_MAX; - - /* There are a couple of places where bit sizes might be made use of - when parsing a DW_TAG_string_type, however, no producer that we know -@@ -17543,6 +17546,10 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) - } - } - -+ 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 != nullptr && !attr->form_is_constant ()) - { -@@ -17569,13 +17576,68 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) - } - - /* Convert the attribute into a dynamic property. */ -- if (!attr_to_dynamic_prop (attr, die, cu, &prop, prop_type)) -+ if (!attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0)) - length = 1; - else - length_is_constant = false; - } - else if (attr != nullptr) - { -+ if (attr->form_is_block ()) -+ { -+ struct attribute *byte_size, *bit_size; -+ struct dynamic_prop high; -+ -+ byte_size = dwarf2_attr (die, DW_AT_byte_size, cu); -+ bit_size = dwarf2_attr (die, DW_AT_bit_size, cu); -+ -+ /* DW_AT_byte_size should never occur in combination with -+ DW_AT_bit_size. */ -+ if (byte_size != NULL && bit_size != NULL) -+ complaint (_("DW_AT_byte_size AND " -+ "DW_AT_bit_size found together at the same time.")); -+ -+ /* If DW_AT_string_length AND DW_AT_byte_size exist together, -+ DW_AT_byte_size describes the number of bytes that should be read -+ from the length memory location. */ -+ if (byte_size != NULL) -+ { -+ /* Build new dwarf2_locexpr_baton structure with additions to the -+ data attribute, to reflect DWARF specialities to get address -+ sizes. */ -+ const gdb_byte append_ops[] = -+ { -+ /* DW_OP_deref_size: size of an address on the target machine -+ (bytes), where the size will be specified by the next -+ operand. */ -+ DW_OP_deref_size, -+ /* Operand for DW_OP_deref_size. */ -+ (gdb_byte) DW_UNSND(byte_size) }; -+ -+ if (!attr_to_dynamic_prop (attr, die, cu, &high, index_type, -+ append_ops, ARRAY_SIZE(append_ops))) -+ complaint (_("Could not parse DW_AT_byte_size")); -+ } -+ else if (bit_size != NULL) -+ complaint (_("DW_AT_string_length AND " -+ "DW_AT_bit_size found but not supported yet.")); -+ /* If DW_AT_string_length WITHOUT DW_AT_byte_size exist, the default -+ is the address size of the target machine. */ -+ else -+ { -+ const gdb_byte append_ops[] = -+ { DW_OP_deref }; -+ -+ if (!attr_to_dynamic_prop (attr, die, cu, &high, index_type, -+ append_ops, ARRAY_SIZE(append_ops))) -+ complaint (_("Could not parse DW_AT_string_length")); -+ } -+ -+ range_type->bounds ()->high = high; -+ } -+ else -+ range_type->bounds ()->high.set_const_val (DW_UNSND(attr)); -+ - /* This DW_AT_string_length just contains the length with no - indirection. There's no need to create a dynamic property in this - case. Pass 0 for the default value as we know it will not be -@@ -17589,6 +17651,14 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) - } - else - { -+ /* Check for the DW_AT_byte_size attribute, which represents the length -+ in this case. */ -+ attr = dwarf2_attr (die, DW_AT_byte_size, cu); -+ if (attr) -+ range_type->bounds ()->high.set_const_val (DW_UNSND(attr)); -+ else -+ range_type->bounds ()->high.set_const_val (1); -+ - /* Use 1 as a fallback length if we have nothing else. */ - length = 1; - } -@@ -17603,6 +17673,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) - low_bound.set_const_val (1); - range_type = create_range_type (NULL, index_type, &low_bound, &prop, 0); - } -+ - char_type = language_string_char_type (cu->language_defn, gdbarch); - type = create_string_type (NULL, char_type, range_type); - -@@ -18078,7 +18149,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, - struct dwarf2_cu *cu, struct dynamic_prop *prop, -- struct type *default_type) -+ struct type *default_type, -+ const gdb_byte *additional_data, int additional_data_size) - { - struct dwarf2_property_baton *baton; - dwarf2_per_objfile *per_objfile = cu->per_objfile; -@@ -18108,6 +18180,26 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, - break; - } - -+ if (additional_data != NULL && additional_data_size > 0) -+ { -+ gdb_byte *data; -+ -+ data = (gdb_byte *) obstack_alloc( -+ &cu->per_objfile->objfile->objfile_obstack, -+ DW_BLOCK (attr)->size + additional_data_size); -+ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size); -+ memcpy (data + DW_BLOCK (attr)->size, additional_data, -+ additional_data_size); -+ -+ baton->locexpr.data = data; -+ baton->locexpr.size = DW_BLOCK (attr)->size + additional_data_size; -+ } -+ else -+ { -+ baton->locexpr.data = DW_BLOCK (attr)->data; -+ baton->locexpr.size = DW_BLOCK (attr)->size; -+ } -+ - prop->set_locexpr (baton); - gdb_assert (prop->baton () != NULL); - } -@@ -18142,11 +18234,31 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, - baton->property_type = die_type (target_die, target_cu); - baton->locexpr.per_cu = cu->per_cu; - baton->locexpr.per_objfile = per_objfile; -- baton->locexpr.size = DW_BLOCK (target_attr)->size; -- baton->locexpr.data = DW_BLOCK (target_attr)->data; - baton->locexpr.is_reference = true; -+ -+ if (additional_data != NULL && additional_data_size > 0) -+ { -+ gdb_byte *data; -+ -+ data = (gdb_byte *) obstack_alloc (&cu->per_objfile->objfile->objfile_obstack, -+ DW_BLOCK (target_attr)->size + additional_data_size); -+ memcpy (data, DW_BLOCK (target_attr)->data, -+ DW_BLOCK (target_attr)->size); -+ memcpy (data + DW_BLOCK (target_attr)->size, -+ additional_data, additional_data_size); -+ -+ baton->locexpr.data = data; -+ baton->locexpr.size = (DW_BLOCK (target_attr)->size -+ + additional_data_size); -+ } -+ else -+ { -+ baton->locexpr.data = DW_BLOCK (target_attr)->data; -+ baton->locexpr.size = DW_BLOCK (target_attr)->size; -+ } -+ - prop->set_locexpr (baton); -- gdb_assert (prop->baton () != NULL); -+ gdb_assert (prop->baton() != NULL); - } - else - { -@@ -18308,8 +18420,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - } - - attr = dwarf2_attr (die, DW_AT_lower_bound, cu); -- if (attr != nullptr) -- attr_to_dynamic_prop (attr, die, cu, &low, base_type); -+ if (attr) -+ attr_to_dynamic_prop (attr, die, cu, &low, base_type, NULL, 0); - else if (!low_default_is_valid) - complaint (_("Missing DW_AT_lower_bound " - "- DIE at %s [in module %s]"), -@@ -18318,10 +18430,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - - struct attribute *attr_ub, *attr_count; - attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu); -- if (!attr_to_dynamic_prop (attr, die, cu, &high, base_type)) -+ if (!attr_to_dynamic_prop (attr, die, cu, &high, base_type, NULL, 0)) - { - attr = attr_count = dwarf2_attr (die, DW_AT_count, cu); -- if (attr_to_dynamic_prop (attr, die, cu, &high, base_type)) -+ if (attr_to_dynamic_prop (attr, die, cu, &high, base_type, NULL, 0)) - { - /* If bounds are constant do the final calculation here. */ - if (low.kind () == PROP_CONST && high.kind () == PROP_CONST) -@@ -18372,7 +18484,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - { - struct type *prop_type = cu->addr_sized_int_type (false); - attr_to_dynamic_prop (attr_byte_stride, die, cu, &byte_stride_prop, -- prop_type); -+ prop_type, NULL, 0); - } - - struct dynamic_prop bit_stride_prop; -@@ -18392,7 +18504,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - { - struct type *prop_type = cu->addr_sized_int_type (false); - attr_to_dynamic_prop (attr_bit_stride, die, cu, &bit_stride_prop, -- prop_type); -+ prop_type, NULL, 0); - } - } - -@@ -24424,7 +24536,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) - if (attr != NULL) - { - struct type *prop_type = cu->addr_sized_int_type (false); -- if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type)) -+ if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0)) - type->add_dyn_prop (DYN_PROP_ALLOCATED, prop); - } - -@@ -24433,13 +24545,13 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) - if (attr != NULL) - { - struct type *prop_type = cu->addr_sized_int_type (false); -- if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type)) -+ if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0)) - type->add_dyn_prop (DYN_PROP_ASSOCIATED, prop); - } - - /* Read DW_AT_data_location and set in type. */ - attr = dwarf2_attr (die, DW_AT_data_location, cu); -- if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type ())) -+ if (attr_to_dynamic_prop (attr, die, cu, &prop, cu->addr_type (), NULL, 0)) - type->add_dyn_prop (DYN_PROP_DATA_LOCATION, prop); - - if (per_objfile->die_type_hash == NULL) -diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c ---- a/gdb/f-typeprint.c -+++ b/gdb/f-typeprint.c -@@ -217,8 +217,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - else - { - LONGEST lower_bound = f77_get_lowerbound (type); -+ - if (lower_bound != 1) /* Not the default. */ -- fprintf_filtered (stream, "%s:", plongest (lower_bound)); -+ fprintf_filtered (stream, "%s:", plongest (lower_bound)); - - /* Make sure that, if we have an assumed size array, we - print out a warning and print the upperbound as '*'. */ -@@ -229,7 +230,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - { - LONGEST upper_bound = f77_get_upperbound (type); - -- fputs_filtered (plongest (upper_bound), stream); -+ fprintf_filtered (stream, "%s", plongest (upper_bound)); - } - } - -@@ -249,7 +250,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - case TYPE_CODE_REF: - f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0, - arrayprint_recurse_level, false); -- fprintf_filtered (stream, " )"); -+ fprintf_filtered (stream, ")"); - break; - - case TYPE_CODE_FUNC: -diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c ---- a/gdb/gdbtypes.c -+++ b/gdb/gdbtypes.c -@@ -1977,7 +1977,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. */ -- if (top_level && type->code () == TYPE_CODE_REF) -+ if (top_level && -+ (type->code () == TYPE_CODE_REF || type-> code() == TYPE_CODE_PTR)) - type = check_typedef (TYPE_TARGET_TYPE (type)); - - /* Types that have a dynamic TYPE_DATA_LOCATION are considered -@@ -2017,10 +2018,10 @@ is_dynamic_type_internal (struct type *type, int top_level) - || is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0)); - } - -- case TYPE_CODE_STRING: - /* Strings are very much like an array of characters, and can be - treated as one here. */ - case TYPE_CODE_ARRAY: -+ case TYPE_CODE_STRING: - { - gdb_assert (type->num_fields () == 1); - -@@ -2183,11 +2184,15 @@ resolve_dynamic_array_or_string (struct type *type, - - ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type)); - -- if (ary_dim != NULL && ary_dim->code () == TYPE_CODE_ARRAY) -+ if (ary_dim != NULL && (ary_dim->code () == TYPE_CODE_ARRAY -+ || ary_dim->code () == TYPE_CODE_STRING)) - elt_type = resolve_dynamic_array_or_string (ary_dim, addr_stack); - else - elt_type = TYPE_TARGET_TYPE (type); - -+ if (type->code () == TYPE_CODE_STRING) -+ return create_string_type (type, elt_type, range_type); -+ - prop = type->dyn_prop (DYN_PROP_BYTE_STRIDE); - if (prop != NULL) - { -@@ -2533,6 +2538,25 @@ resolve_dynamic_struct (struct type *type, - return resolved_type; - } - -+/* Worker for pointer types. */ -+ -+static struct type * -+resolve_dynamic_pointer (struct type *type, -+ struct property_addr_info *addr_stack) -+{ -+ struct dynamic_prop *prop; -+ CORE_ADDR value; -+ -+ type = copy_type (type); -+ -+ /* Resolve associated property. */ -+ prop = TYPE_ASSOCIATED_PROP (type); -+ if (prop != NULL && dwarf2_evaluate_property (prop, NULL, addr_stack, &value)) -+ prop->set_const_val (value); -+ -+ return type; -+} -+ - /* Worker for resolved_dynamic_type. */ - - static struct type * -@@ -2594,6 +2618,9 @@ resolve_dynamic_type_internal (struct type *type, - case TYPE_CODE_ARRAY: - resolved_type = resolve_dynamic_array_or_string (type, addr_stack); - break; -+ case TYPE_CODE_PTR: -+ resolved_type = resolve_dynamic_pointer (type, addr_stack); -+ break; - - case TYPE_CODE_RANGE: - resolved_type = resolve_dynamic_range (type, addr_stack); -diff --git a/gdb/testsuite/gdb.cp/vla-cxx.cc b/gdb/testsuite/gdb.cp/vla-cxx.cc ---- 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 . */ - -+extern "C" { -+#include -+} -+ - struct container; - - struct element -@@ -40,11 +44,16 @@ int main(int argc, char **argv) - typedef typeof (vla) &vlareftypedef; - vlareftypedef vlaref2 (vla); - container c; -+ typeof (vla) *ptr = NULL; -+ -+ // Before pointer assignment -+ ptr = &vla; - - for (int i = 0; i < z; ++i) - vla[i] = 5 + 2 * i; - - // vlas_filled - vla[0] = 2 * vla[0]; -+ - return vla[2]; - } -diff --git a/gdb/testsuite/gdb.cp/vla-cxx.exp b/gdb/testsuite/gdb.cp/vla-cxx.exp ---- 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 - } - -+gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] -+gdb_continue_to_breakpoint "Before pointer assignment" -+gdb_test "ptype ptr" "int \\(\\*\\)\\\[variable length\\\]" "ptype ptr, Before pointer assignment" -+gdb_test "print ptr" "\\(int \\(\\*\\)\\\[variable length\\\]\\) 0x0" "print ptr, Before pointer assignment" -+gdb_test "print *ptr" "Cannot access memory at address 0x0" "print *ptr, Before pointer assignment" -+ - gdb_breakpoint [gdb_get_line_number "vlas_filled"] - gdb_continue_to_breakpoint "vlas_filled" - -@@ -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\\}" -diff --git a/gdb/testsuite/gdb.fortran/pointers.exp b/gdb/testsuite/gdb.fortran/pointers.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/pointers.exp -@@ -0,0 +1,143 @@ -+# 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 "pointers.f90" -+load_lib fortran.exp -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+if ![runto_main] { -+ untested "could not run to main" -+ return -1 -+} -+ -+# Depending on the compiler being used, the type names can be printed differently. -+set logical [fortran_logical4] -+set real [fortran_real4] -+set int [fortran_int4] -+set complex [fortran_complex4] -+ -+ -+gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] -+gdb_continue_to_breakpoint "Before pointer assignment" -+gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) 0x0" "print logp, not associated" -+gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated" -+gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) 0x0" "print comp, not associated" -+gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated" -+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) 0x0" "print charp, not associated" -+gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated" -+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) 0x0" "print charap, not associated" -+gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated" -+gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0" "print intp, not associated" -+gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated" -+set test "print intap, not associated" -+gdb_test_multiple "print intap" $test { -+ -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) \r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re " = \r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) 0x0" "print realp, not associated" -+gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated" -+gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0" -+set test "print cyclicp1, not associated" -+gdb_test_multiple "print cyclicp1" $test { -+ -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "= \\( i = -?\\d+, p = \\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+set test "print cyclicp1%p, not associated" -+gdb_test_multiple "print cyclicp1%p" $test { -+ -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) 0x0\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) \r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+ -+gdb_breakpoint [gdb_get_line_number "Before value assignment"] -+gdb_continue_to_breakpoint "Before value assignment" -+gdb_test "print *(twop)%ivla2" "= " -+ -+ -+gdb_breakpoint [gdb_get_line_number "After value assignment"] -+gdb_continue_to_breakpoint "After value assignment" -+gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) $hex\( <.*>\)?" -+gdb_test "print *logp" "= \\.TRUE\\." -+gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) $hex\( <.*>\)?" -+gdb_test "print *comp" "= \\(1,2\\)" -+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) $hex\( <.*>\)?" -+gdb_test "print *charp" "= 'a'" -+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\( <.*>\)?" -+gdb_test "print *charap" "= 'abc'" -+gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) $hex\( <.*>\)?" -+gdb_test "print *intp" "= 10" -+set test_name "print intap, associated" -+gdb_test_multiple "print intap" $test_name { -+ -re "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)\r\n$gdb_prompt $" { -+ pass $test_name -+ } -+ -re "= \\(PTR TO -> \\( $int \\(10,2\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" { -+ gdb_test "print *intap" "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)" -+ pass $test_name -+ } -+} -+set test_name "print intvlap, associated" -+gdb_test_multiple "print intvlap" $test_name { -+ -re "= \\(2, 2, 2, 4(, 2){6}\\)\r\n$gdb_prompt $" { -+ pass $test_name -+ } -+ -re "= \\(PTR TO -> \\( $int \\(10\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" { -+ gdb_test "print *intvlap" "= \\(2, 2, 2, 4(, 2){6}\\)" -+ pass $test_name -+ } -+} -+gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) $hex\( <.*>\)?" -+gdb_test "print *realp" "= 3\\.14000\\d+" -+gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two\\)\\) $hex\( <.*>\)?" -+gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)" -+set test_name "print arrayOfPtr(3)%p" -+gdb_test_multiple $test_name $test_name { -+ -re "= \\(PTR TO -> \\( Type two\\)\\) \r\n$gdb_prompt $" { -+ pass $test_name -+ } -+ -re "= \\(PTR TO -> \\( Type two\\)\\) 0x0\r\n$gdb_prompt $" { -+ pass $test_name -+ } -+} -+set test_name "print *(arrayOfPtr(3)%p), associated" -+gdb_test_multiple "print *(arrayOfPtr(3)%p)" $test_name { -+ -re "Cannot access memory at address 0x0\r\n$gdb_prompt $" { -+ pass $test_name -+ } -+ -re "Attempt to take contents of a not associated pointer.\r\n$gdb_prompt $" { -+ pass $test_name -+ } -+} -+gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)" -+gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer\\)\\) $hex\( <.*>\)?" -+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" -diff --git a/gdb/testsuite/gdb.fortran/pointers.f90 b/gdb/testsuite/gdb.fortran/pointers.f90 ---- a/gdb/testsuite/gdb.fortran/pointers.f90 -+++ b/gdb/testsuite/gdb.fortran/pointers.f90 -@@ -20,21 +20,34 @@ program pointers - integer, allocatable :: ivla2 (:, :) - end type two - -+ type :: typeWithPointer -+ integer i -+ type(typeWithPointer), pointer:: p -+ end type typeWithPointer -+ -+ type :: twoPtr -+ type (two), pointer :: p -+ end type twoPtr -+ - logical, target :: logv - complex, target :: comv - character, target :: charv - character (len=3), target :: chara - integer, target :: intv - integer, target, dimension (10,2) :: inta -- real, target :: realv -- type(two), target :: twov -+ integer, target, allocatable, dimension (:) :: intvla -+ real, target :: realv -+ type(two), target :: twov -+ type(twoPtr) :: arrayOfPtr (3) -+ type(typeWithPointer), target:: cyclicp1,cyclicp2 - - logical, pointer :: logp - complex, pointer :: comp -- character, pointer :: charp -- character (len=3), pointer :: charap -+ character, pointer:: charp -+ character (len=3), pointer:: charap - integer, pointer :: intp - integer, pointer, dimension (:,:) :: intap -+ integer, pointer, dimension (:) :: intvlap - real, pointer :: realp - type(two), pointer :: twop - -@@ -44,8 +57,14 @@ program pointers - nullify (charap) - nullify (intp) - nullify (intap) -+ nullify (intvlap) - nullify (realp) - nullify (twop) -+ nullify (arrayOfPtr(1)%p) -+ nullify (arrayOfPtr(2)%p) -+ nullify (arrayOfPtr(3)%p) -+ nullify (cyclicp1%p) -+ nullify (cyclicp2%p) - - logp => logv ! Before pointer assignment - comp => comv -@@ -53,8 +72,14 @@ program pointers - charap => chara - intp => intv - intap => inta -+ intvlap => intvla - realp => realv - twop => twov -+ arrayOfPtr(2)%p => twov -+ cyclicp1%i = 1 -+ cyclicp1%p => cyclicp2 -+ cyclicp2%i = 2 -+ cyclicp2%p => cyclicp1 - - logv = associated(logp) ! Before value assignment - comv = cmplx(1,2) -@@ -63,6 +88,10 @@ program pointers - intv = 10 - inta(:,:) = 1 - inta(3,1) = 3 -+ allocate (intvla(10)) -+ intvla(:) = 2 -+ intvla(4) = 4 -+ intvlap => intvla - realv = 3.14 - - allocate (twov%ivla1(3)) -diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortran/print_type.exp ---- a/gdb/testsuite/gdb.fortran/print_type.exp -+++ b/gdb/testsuite/gdb.fortran/print_type.exp -@@ -1,5 +1,6 @@ - # Copyright 2019-2020 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 -@@ -42,7 +43,7 @@ set complex [fortran_complex4] - # matches the string TYPE. - proc check_pointer_type { var_name type } { - gdb_test "ptype ${var_name}" \ -- "type = PTR TO -> \\( ${type} \\)" -+ "type = PTR TO -> \\( ${type}\\)" - } - - gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] -@@ -87,7 +88,8 @@ gdb_test "ptype twop" \ - [multi_line "type = PTR TO -> \\( Type two" \ - " $int, allocatable :: ivla1\\(:\\)" \ - " $int, allocatable :: ivla2\\(:,:\\)" \ -- "End Type two \\)"] -+ "End Type two\\)"] -+ - - gdb_breakpoint [gdb_get_line_number "After value assignment"] - gdb_continue_to_breakpoint "After value assignment" -@@ -99,11 +101,11 @@ gdb_test "ptype intv" "type = $int" - gdb_test "ptype inta" "type = $int \\(10,2\\)" - gdb_test "ptype realv" "type = $real" - --gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)" --gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)" --gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)" --gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)" --gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)" -+gdb_test "ptype logp" "type = PTR TO -> \\( $logical\\)" -+gdb_test "ptype comp" "type = PTR TO -> \\( $complex\\)" -+gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1\\)" -+gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3\\)" -+gdb_test "ptype intp" "type = PTR TO -> \\( $int\\)" - set test "ptype intap" - gdb_test_multiple $test $test { - -re "type = $int \\(10,2\\)\r\n$gdb_prompt $" { -@@ -113,4 +115,4 @@ gdb_test_multiple $test $test { - pass $test - } - } --gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)" -+gdb_test "ptype realp" "type = PTR TO -> \\( $real\\)" -diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/vla-strings.exp -@@ -0,0 +1,103 @@ -+# 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 ".f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+# check that all fortran standard datatypes will be -+# handled correctly when using as VLA's -+ -+if ![runto_main] { -+ untested "could not run to main" -+ return -1 -+} -+ -+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"] -+gdb_continue_to_breakpoint "var_char-allocated-1" -+set test "whatis var_char first time" -+gdb_test_multiple "whatis var_char" $test { -+ -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "type = character\\*10\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+set test "ptype var_char first time" -+gdb_test_multiple "ptype var_char" $test { -+ -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "type = character\\*10\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+ -+gdb_test "next" "\\d+.*var_char = 'foo'.*" \ -+ "next to allocation status of var_char" -+gdb_test "print l" " = \\.TRUE\\." "print allocation status first time" -+ -+ -+gdb_breakpoint [gdb_get_line_number "var_char-filled-1"] -+gdb_continue_to_breakpoint "var_char-filled-1" -+set test "print var_char, var_char-filled-1" -+gdb_test_multiple "print var_char" $test { -+ -re "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\r\n$gdb_prompt $" { -+ gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1" -+ pass $test -+ } -+ -re "= 'foo'\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+set test "ptype var_char, var_char-filled-1" -+gdb_test_multiple "ptype var_char" $test { -+ -re "type = PTR TO -> \\( character\\*3\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "type = character\\*3\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)" -+gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)" -+ -+ -+gdb_breakpoint [gdb_get_line_number "var_char-filled-2"] -+gdb_continue_to_breakpoint "var_char-filled-2" -+set test "print var_char, var_char-filled-2" -+gdb_test_multiple "print var_char" $test { -+ -re "= \\(PTR TO -> \\( character\\*6\\)\\) $hex\r\n$gdb_prompt $" { -+ gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2" -+ pass $test -+ } -+ -re "= 'foobar'\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+set test "ptype var_char, var_char-filled-2" -+gdb_test_multiple "ptype var_char" $test { -+ -re "type = PTR TO -> \\( character\\*6\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "type = character\\*6\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -diff --git a/gdb/testsuite/gdb.fortran/vla-strings.f90 b/gdb/testsuite/gdb.fortran/vla-strings.f90 -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/vla-strings.f90 -@@ -0,0 +1,39 @@ -+! 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 . -+ -+program vla_strings -+ character(len=:), target, allocatable :: var_char -+ character(len=:), pointer :: var_char_p -+ logical :: l -+ -+ allocate(character(len=10) :: var_char) -+ l = allocated(var_char) ! var_char-allocated-1 -+ var_char = 'foo' -+ deallocate(var_char) ! var_char-filled-1 -+ l = allocated(var_char) ! var_char-deallocated -+ allocate(character(len=42) :: var_char) -+ l = allocated(var_char) -+ var_char = 'foobar' -+ var_char = '' ! var_char-filled-2 -+ var_char = 'bar' ! var_char-empty -+ deallocate(var_char) -+ allocate(character(len=21) :: var_char) -+ l = allocated(var_char) ! var_char-allocated-3 -+ var_char = 'johndoe' -+ var_char_p => var_char -+ l = associated(var_char_p) ! var_char_p-associated -+ var_char_p => null() -+ l = associated(var_char_p) ! var_char_p-not-associated -+end program vla_strings -diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp ---- a/gdb/testsuite/gdb.fortran/vla-value.exp -+++ b/gdb/testsuite/gdb.fortran/vla-value.exp -@@ -37,7 +37,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, allocatable \\\(:,:,:\\\) \\\)\\\) $hex" \ -+ " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\)\\\)\\\) $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)" -@@ -58,7 +58,7 @@ with_timeout_factor 15 { - "step over value assignment of vla1" - } - gdb_test "print &vla1" \ -- " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\) \\\)\\\) $hex" \ -+ " = \\\(PTR TO -> \\\( $real, allocatable \\\(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)" -@@ -78,7 +78,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 \\\(:,:,:\\\) \\\)\\\) $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)" -@@ -87,7 +87,7 @@ gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated - gdb_breakpoint [gdb_get_line_number "pvla-associated"] - gdb_continue_to_breakpoint "pvla-associated" - gdb_test "print &pvla" \ -- " = \\\(PTR TO -> \\\( $real \\\(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)" -diff --git a/gdb/typeprint.c b/gdb/typeprint.c ---- a/gdb/typeprint.c -+++ b/gdb/typeprint.c -@@ -565,6 +565,25 @@ whatis_exp (const char *exp, int show) - printf_filtered (" */\n"); - } - -+ /* Resolve any dynamic target type, as we might print -+ additional information about the target. -+ For example, in Fortran and C we are printing the dimension of the -+ dynamic array the pointer is pointing to. */ -+ if (type->code () == TYPE_CODE_PTR -+ && is_dynamic_type (type) == 1) -+ { -+ CORE_ADDR addr; -+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE(type))) -+ addr = value_address (val); -+ else -+ addr = value_as_address (val); -+ -+ if (addr != 0 -+ && type_not_associated (type) == 0) -+ TYPE_TARGET_TYPE (type) = resolve_dynamic_type (TYPE_TARGET_TYPE (type), -+ {}, addr); -+ } -+ - LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags); - printf_filtered ("\n"); - } -diff --git a/gdb/valops.c b/gdb/valops.c ---- a/gdb/valops.c -+++ b/gdb/valops.c -@@ -1553,6 +1553,19 @@ value_ind (struct value *arg1) - if (base_type->code () == TYPE_CODE_PTR) - { - struct type *enc_type; -+ CORE_ADDR addr; -+ -+ if (type_not_associated (base_type)) -+ error (_("Attempt to take contents of a not associated pointer.")); -+ -+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (base_type))) -+ addr = value_address (arg1); -+ else -+ addr = value_as_address (arg1); -+ -+ if (addr != 0) -+ TYPE_TARGET_TYPE (base_type) = -+ resolve_dynamic_type (TYPE_TARGET_TYPE (base_type), {}, addr); - - /* We may be pointing to something embedded in a larger object. - Get the real type of the enclosing object. */ -@@ -1570,8 +1583,7 @@ value_ind (struct value *arg1) - else - { - /* Retrieve the enclosing object pointed to. */ -- base_addr = (value_as_address (arg1) -- - value_pointed_to_offset (arg1)); -+ base_addr = (addr - value_pointed_to_offset (arg1)); - } - arg2 = value_at_lazy (enc_type, base_addr); - enc_type = value_type (arg2); -diff --git a/gdb/valprint.c b/gdb/valprint.c ---- a/gdb/valprint.c -+++ b/gdb/valprint.c -@@ -1046,12 +1046,6 @@ value_check_printable (struct value *val, struct ui_file *stream, - return 0; - } - -- if (type_not_associated (value_type (val))) -- { -- val_print_not_associated (stream); -- return 0; -- } -- - if (type_not_allocated (value_type (val))) - { - val_print_not_allocated (stream); diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch index bfde742..b2febb6 100644 --- a/gdb-vla-intel-tests.patch +++ b/gdb-vla-intel-tests.patch @@ -5,28 +5,6 @@ Subject: gdb-vla-intel-tests.patch ;;=fedoratest -diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp ---- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp -+++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp -@@ -37,5 +37,5 @@ gdb_continue_to_breakpoint "BP1" - gdb_test "ptype tinsta" \ - [multi_line "type = Type tuserdef" \ - " $int :: i" \ -- " PTR TO -> \\( $real :: ptr \\)" \ -+ " PTR TO -> \\( $real :: ptr\\)" \ - "End Type tuserdef"] -diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp ---- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp -+++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp -@@ -42,7 +42,7 @@ gdb_test "ptype say_numbers" \ - "type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)" - - gdb_test "ptype fun_ptr" \ -- "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)" -+ "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\)\\)\\)\\)" - - gdb_test "ptype say_string" \ - "type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)" diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp new file mode 100644 --- /dev/null @@ -169,182 +147,3 @@ new file mode 100644 + + ret = .TRUE. ! func2-returned +end program vla_func -diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp ---- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp -+++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp -@@ -33,5 +33,5 @@ set real4 [fortran_real4] - # Check the status of a pointer to a dynamic array. - gdb_breakpoint [gdb_get_line_number "pvla-associated"] - gdb_continue_to_breakpoint "pvla-associated" --gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\) \\)\\) ${hex}" \ -+gdb_test "print &pvla" " = \\(PTR TO -> \\( $real4 \\(10,10,10\\)\\)\\) ${hex}" \ - "print pvla pointer information" -diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/vla-stringsold.exp -@@ -0,0 +1,101 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile ".f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+# check that all fortran standard datatypes will be -+# handled correctly when using as VLA's -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"] -+gdb_continue_to_breakpoint "var_char-allocated-1" -+gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*10\\)\\) ${hex}" \ -+ "print var_char after allocated first time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10\\)" \ -+ "whatis var_char first time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10\\)" \ -+ "ptype var_char first time" -+gdb_test "next" "\\d+.*var_char = 'foo'.*" \ -+ "next to allocation status of var_char" -+gdb_test "print l" " = .TRUE." "print allocation status first time" -+ -+gdb_breakpoint [gdb_get_line_number "var_char-filled-1"] -+gdb_continue_to_breakpoint "var_char-filled-1" -+gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*3\\)\\) ${hex}" \ -+ "print var_char after filled first time" -+gdb_test "print *var_char" " = 'foo'" \ -+ "print *var_char after filled first time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3\\)" \ -+ "whatis var_char after filled first time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3\\)" \ -+ "ptype var_char after filled first time" -+gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)" -+gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)" -+ -+gdb_breakpoint [gdb_get_line_number "var_char-filled-2"] -+gdb_continue_to_breakpoint "var_char-filled-2" -+gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*6\\)\\) ${hex}" \ -+ "print var_char after allocated second time" -+gdb_test "print *var_char" " = 'foobar'" \ -+ "print *var_char after allocated second time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6\\)" \ -+ "whatis var_char second time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6\\)" \ -+ "ptype var_char second time" -+ -+gdb_breakpoint [gdb_get_line_number "var_char-empty"] -+gdb_continue_to_breakpoint "var_char-empty" -+gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*0\\)\\) ${hex}" \ -+ "print var_char after set empty" -+gdb_test "print *var_char" " = \"\"" "print *var_char after set empty" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0\\)" \ -+ "whatis var_char after set empty" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0\\)" \ -+ "ptype var_char after set empty" -+ -+gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"] -+gdb_continue_to_breakpoint "var_char-allocated-3" -+gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*21\\)\\) ${hex}" \ -+ "print var_char after allocated third time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21\\)" \ -+ "whatis var_char after allocated third time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21\\)" \ -+ "ptype var_char after allocated third time" -+ -+gdb_breakpoint [gdb_get_line_number "var_char_p-associated"] -+gdb_continue_to_breakpoint "var_char_p-associated" -+gdb_test "print var_char_p" \ -+ " = \\(PTR TO -> \\( character\\*7\\)\\) ${hex}" \ -+ "print var_char_p after associated" -+gdb_test "print *var_char_p" " = 'johndoe'" \ -+ "print *var_char_ after associated" -+gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7\\)" \ -+ "whatis var_char_p after associated" -+gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7\\)" \ -+ "ptype var_char_p after associated" -diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.f90 b/gdb/testsuite/gdb.fortran/vla-stringsold.f90 -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/vla-stringsold.f90 -@@ -0,0 +1,40 @@ -+! Copyright 2014 Free Software Foundation, Inc. -+! -+! This program is free software; you can redistribute it and/or modify -+! it under the terms of the GNU General Public License as published by -+! the Free Software Foundation; either version 2 of the License, or -+! (at your option) any later version. -+! -+! This program is distributed in the hope that it will be useful, -+! but WITHOUT ANY WARRANTY; without even the implied warranty of -+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+! GNU General Public License for more details. -+! -+! You should have received a copy of the GNU General Public License -+! along with this program; if not, write to the Free Software -+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+program vla_strings -+ character(len=:), target, allocatable :: var_char -+ character(len=:), pointer :: var_char_p -+ logical :: l -+ -+ allocate(character(len=10) :: var_char) -+ l = allocated(var_char) ! var_char-allocated-1 -+ var_char = 'foo' -+ deallocate(var_char) ! var_char-filled-1 -+ l = allocated(var_char) ! var_char-deallocated -+ allocate(character(len=42) :: var_char) -+ l = allocated(var_char) -+ var_char = 'foobar' -+ var_char = '' ! var_char-filled-2 -+ var_char = 'bar' ! var_char-empty -+ deallocate(var_char) -+ allocate(character(len=21) :: var_char) -+ l = allocated(var_char) ! var_char-allocated-3 -+ var_char = 'johndoe' -+ var_char_p => var_char -+ l = associated(var_char_p) ! var_char_p-associated -+ var_char_p => null() -+ l = associated(var_char_p) ! var_char_p-not-associated -+end program vla_strings -diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp ---- a/gdb/testsuite/gdb.fortran/whatis_type.exp -+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp -@@ -44,7 +44,7 @@ gdb_test "whatis t2" "type = Type t2" - gdb_test "whatis t2v" "type = Type t2" - gdb_test "whatis t3" "type = Type t3" - gdb_test "whatis t3v" "type = Type t3" --gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)" -+gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3\\)" - - gdb_test "ptype t1" \ - [multi_line "type = Type t1" \ -@@ -73,4 +73,4 @@ gdb_test "ptype t3p" \ - [multi_line "type = PTR TO -> \\( Type t3" \ - " $int :: t3_i" \ - " Type t2 :: t2_n" \ -- "End Type t3 \\)"] -+ "End Type t3\\)"] diff --git a/gdb.spec b/gdb.spec index 93299e3..56d2c5f 100644 --- a/gdb.spec +++ b/gdb.spec @@ -37,7 +37,7 @@ Version: 10.1 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 7%{?dist} +Release: 10%{?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 # Do not provide URL for snapshots as the file lasts there only for 2 days. @@ -189,7 +189,7 @@ Source5: %{libstdcxxpython}.tar.xz Source6: gdbtui # libipt: Intel Processor Trace Decoder Library -%global libipt_version 2.0.2 +%global libipt_version 2.0.4 #=fedora Source7: v%{libipt_version}.tar.gz #=fedora @@ -1195,6 +1195,28 @@ fi %endif %changelog +* Thu Mar 11 2021 Kevin Buettner - 10.1-10 +- Update libipt to version 2.0.4. + +* Fri Mar 05 2021 Kevin Buettner - 10.1-9 +- Backport patches which fix frame_id_p assertion failure (RHBZ 1909902, + Pedro Alves). + +* Fri Mar 5 2021 Jan Kratochvil - 10.1-8 +- Drop gdb-vla-intel-fortran-vla-strings.patch as it was still regressing the + testsuite. + +* Thu Mar 4 2021 Jan Kratochvil +- Fix gdb-vla-intel-fortran-vla-strings.patch to no longer modify cached + inferior types. + +* Thu Mar 4 2021 Jan Kratochvil +- Align gdb-vla-intel-fortran-vla-strings.patch more to upstream + fixing whitespaces in Fortran types printing. + +* Thu Mar 4 2021 Jan Kratochvil +- Reapply 10.1-8 after it has been accidentally reverted by 10.1-7. + * Wed Feb 24 2021 Kevin Buettner - 10.1-7 - Fix aarch64 build problem (RHBZ 1932645, Kevin Buettner). diff --git a/sources b/sources index 96507cc..5758b05 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8 -SHA512 (v2.0.2.tar.gz) = bc256a57a8481e0be8220624da3ccf1fe4bf0ea83e9808fdf0aad6db865aee402a36e78285efb0316c016f57e0d6fc56b647ee8e9a2ad4b05bfc1ad68ddde535 SHA512 (gdb-10.1.tar.xz) = 0dc54380435c6853db60f1e388b94836d294dfa9ad7f518385a27db4edd03cb970f8717d5f1e9c9a0d4a33d7fcf91bc2e5d6c9cf9e4b561dcc74e65b806c1537 +SHA512 (v2.0.4.tar.gz) = 596d2dac25fdbd3e5660d7e1feeb7e8d5d359d1d0e19b62ef593449037df236db1d4d98820f0031061b5573ed67797a85a77fb9991e215abaabc4bfe16ceaec8